Bitrix API

VatCalculator

Calculating vat value.

Example:

$calculator = new VatCalculator($rate, $isVatInPrice, $quantity);
$vatAmout = $calculator->calc($price, $isVatInPrice, $quantity);

Table of Contents

Methods

__construct()  : mixed
accrue()  : float
Accrue vat value to price.
allocate()  : float
Allocate price without vat from price with vat.
calc()  : float
Calculate vat value.

Methods

__construct()

public __construct(float $rate) : mixed
Parameters
$rate : float

number from 0 to 1 (20% its 0.2).

accrue()

Accrue vat value to price.

public accrue(float $price[, bool $withRound = true ]) : float
Parameters
$price : float
$withRound : bool = true
Return values
float

price with vat.

allocate()

Allocate price without vat from price with vat.

public allocate(float $price[, bool $withRound = true ]) : float
Parameters
$price : float
$withRound : bool = true
Return values
float

price without vat.

calc()

Calculate vat value.

public calc(float $price, bool $isVatInPrice[, bool $withRound = true ]) : float
Parameters
$price : float
$isVatInPrice : bool
$withRound : bool = true
Return values
float

        
On this page

Search results