\TaxCalculatorCore

Summary

Methods
Properties
Constants
__construct()
addTaxes()
removeTaxes()
getTotalRate()
getTaxesName()
getTaxesAmount()
getTaxesTotalAmount()
$taxes
$computation_method
COMBINE_METHOD
ONE_AFTER_ANOTHER_METHOD
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

COMBINE_METHOD

COMBINE_METHOD

COMBINE_METHOD sum taxes eg: 100€ * (10% + 15%)

ONE_AFTER_ANOTHER_METHOD

ONE_AFTER_ANOTHER_METHOD

ONE_AFTER_ANOTHER_METHOD apply taxes one after another eg: (100€ * 10%) * 15%

Properties

$taxes

$taxes : array

Type

array

$computation_method

$computation_method : integer

Type

integer — (COMBINE_METHOD | ONE_AFTER_ANOTHER_METHOD)

Methods

__construct()

__construct(array  $taxes = array(), integer  $computation_method = \TaxCalculator::COMBINE_METHOD) 

Parameters

array $taxes
integer $computation_method

(COMBINE_METHOD | ONE_AFTER_ANOTHER_METHOD)

addTaxes()

addTaxes(float  $price_te) : float

Compute and add the taxes to the specified price

Parameters

float $price_te

price tax excluded

Returns

float —

price with taxes

removeTaxes()

removeTaxes(float  $price_ti) : float

Compute and remove the taxes to the specified price

Parameters

float $price_ti

price tax inclusive

Returns

float —

price without taxes

getTotalRate()

getTotalRate() : float

Returns

float —

total taxes rate

getTaxesName()

getTaxesName() 

getTaxesAmount()

getTaxesAmount(float  $price_te) : array

Return the tax amount associated to each taxes of the TaxCalculator

Parameters

float $price_te

Returns

array —

$taxes_amount

getTaxesTotalAmount()

getTaxesTotalAmount(float  $price_te) : float

Return the total taxes amount

Parameters

float $price_te

Returns

float —

$amount