Bitrix Site Manager

CSaleTaxRate::GetList

CDBResult
CSaleTaxRate::GetList(
 array arOrder = Array("APPLY_ORDER"=>"ASC"),
 array arFilter = Array()
);

The method GetList returns an optionally sorted and filtered list of tax rates.

Parameters

ParameterDescription
arOrder Assosiated array used to sort records. The sorting is performed consequently on each pair "key-value". Keys are the parameter names. Values are sort direction constants.

The following keys are possible:
  • APPLY_ORDER - order in which the tax is applied;
  • ID - the tax rate ID;
  • LID - the ID of the site for which the tax is applicable;
  • CODE - tax mnemonic code;
  • TIMESTAMP_X - the date the record was last modified;
  • ACTIVE - specifies the tax is active (Y/N);
  • NAME - tax name;
  • PERSON_TYPE_ID - the tax payer ID;
  • IS_IN_PRICE - product price includes the tax amount (Y/N).
Possible values:
  • ASC - ascending;
  • DESC - descending.
arFilter Associated array used to filter records. Only the records which satisfy the filter are included in the returned list. Keys are the parameter names, and the values are conditions.

The following keys are possible:
  • ID - the tax rate ID;
  • LID - the ID of the site for which the tax is applicable;
  • CODE - tax mnemonic code;
  • TAX_ID - the tax ID;
  • PERSON_TYPE_ID - the tax payer ID;
  • IS_IN_PRICE - product price includes the tax amount (Y/N);
  • ACTIVE - specifies the tax is active (Y/N);
  • APPLY_ORDER - order in which the tax is applied;
  • LOCATION_ID - the ID of location to which the tax can be applied.

Return Values

Returns a CDBResult instance containing a set of associated arrays with the following keys.

Key Description
ID The tax rate ID.
TAX_ID The tax ID.
PERSON_TYPE_ID The payer type ID.
VALUE Amount of tax (percentage).
CURRENCY Currency.
IS_PERCENT Always set to "Y".
IS_IN_PRICE Product price includes the tax amount (Y/N).
APPLY_ORDER Order in which the tax is applied.
TIMESTAMP_X The date the record was last modified.
LID The ID of the site for which the tax is applicable.
NAME Tax name.
CODE Tax mnemonic code.
DESCRIPTION Tax description.
ACTIVE Specifies the tax is active (Y/N).

Example



<?
// Get the array of active tax rates for the current site
// for payer type $PERSON_TYPE and location $TAX_LOCATION

$arTaxList = array();

$arTaxFilter = array(
   "LID" => SITE_ID,
   "PERSON_TYPE_ID" => $PERSON_TYPE,
   "ACTIVE" => "Y",
   "LOCATION" => $TAX_LOCATION
);

$db_tax_rate_tmp = CSaleTaxRate::GetList(array("APPLY_ORDER"=>"ASC"), $arTaxFilter);
while ($ar_tax_rate_tmp = $db_tax_rate_tmp->Fetch())
{
   $arTaxList[] = $ar_tax_rate_tmp;
}
?>