Documentation

Add

int
CSaleOrderTax::Add(
  array arFields
);

The method Add adds a new amount of tax to an order.

Parameters

ParameterDescription
arFields Associated array containing parameters of the new record whose keys are the order parameter names, and values are the parameter values.

The following values are possible:
  • ORDER_ID - the order ID (required);
  • TAX_NAME - tax name;
  • VALUE - amount of tax (percentage);
  • VALUE_MONEY - total calculated amount of this tax;
  • APPLY_ORDER - order in which the tax is applied;
  • CODE - mnemonic tax code;
  • IS_PERCENT - must be set to "Y";
  • IS_IN_PRICE - product price includes the tax amount (Y/N).

Returned values

Returns the ID of the new tax amount on success or false otherwise.

Example


<?
$arFields = array(
   "ORDER_ID" => 12789,
   "TAX_NAME" => "VAT",
   "IS_PERCENT" => "Y",
   "VALUE" => 3.5,
   "VALUE_MONEY" => 6948.55,
   "APPLY_ORDER" => 300,
   "IS_IN_PRICE" => "N",
   "CODE" => "NDS"
);

CSaleOrderTax::Add($arFields);
?>
© «Bitrix24», 2001-2024
Up