Bitrix API

Accounting

Table of Contents

Methods

__construct()  : mixed
calculate()  : array<string|int, mixed>|null
Calculates total sums based on current tax mode and provided data.
calculateByItem()  : Result
Calculate total sums based on current tax mode and $item`s fields.
calculateDeliveryTotal()  : float
calculatePriceWithoutTax()  : float
Returns original price before tax
calculatePriceWithTax()  : float
Applies tax with $taxRate to the price and returns its new value
clearCache()  : $this
Clear inner calculation cache.
isTaxMode()  : bool
Return true if location dependant tax mode is used.
resolvePersonTypeId()  : int
Returns person type id based on data contained in the $item
setTaxMode()  : $this
Switch location dependant tax mode.

Methods

calculate()

Calculates total sums based on current tax mode and provided data.

public calculate(array<string|int, mixed> $productRows, string $currencyId, int $personTypeId[, string|null $locationId = null ]) : array<string|int, mixed>|null
Parameters
$productRows : array<string|int, mixed>
$currencyId : string
$personTypeId : int
$locationId : string|null = null
Tags
see
CCrmSaleHelper::Calculate
Return values
array<string|int, mixed>|null

calculateByItem()

Calculate total sums based on current tax mode and $item`s fields.

public calculateByItem(Item $item) : Result

This method stores calculation result in inner cache.

Parameters
$item : Item
Return values
Result

calculateDeliveryTotal()

public calculateDeliveryTotal(ItemIdentifier $itemIdentifier) : float
Parameters
$itemIdentifier : ItemIdentifier
Return values
float

calculatePriceWithoutTax()

Returns original price before tax

public calculatePriceWithoutTax(float $priceWithTax, float|null $taxRate) : float
Parameters
$priceWithTax : float
$taxRate : float|null
Return values
float

calculatePriceWithTax()

Applies tax with $taxRate to the price and returns its new value

public calculatePriceWithTax(float $priceWithoutTax, float|null $taxRate) : float
Parameters
$priceWithoutTax : float
$taxRate : float|null
Return values
float

clearCache()

Clear inner calculation cache.

public clearCache() : $this
Return values
$this

isTaxMode()

Return true if location dependant tax mode is used.

public isTaxMode() : bool

By default VAT taxes used.

Return values
bool

resolvePersonTypeId()

Returns person type id based on data contained in the $item

public resolvePersonTypeId(Item $item) : int
Parameters
$item : Item
Return values
int
  • if a suitable person type was not found, returns 0

setTaxMode()

Switch location dependant tax mode.

public setTaxMode(bool $isTaxMode) : $this
Parameters
$isTaxMode : bool
Return values
$this

        
On this page

Search results