• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/tax/vatcalculator.php
  • Класс: BitrixSaleTaxVatCalculator
  • Вызов: VatCalculator::calc
public function calc(float $price, bool $isVatInPrice, bool $withRound = true): float
{
	if ($this->rate === 0.0)
	{
		return 0.0;
	}
	elseif ($isVatInPrice)
	{
		$vat = $price * $this->rate / ($this->rate + 1);
	}
	else
	{
		$vat = $price * $this->rate;
	}

	return $withRound ? PriceMaths::roundPrecision($vat) : $vat;
}