Skip to content

Latest commit

 

History

History
230 lines (109 loc) · 4.46 KB

class.TaxCalculatorCore.md

File metadata and controls

230 lines (109 loc) · 4.46 KB

Class TaxCalculatorCore

Contents

Constants

Properties

Methods

Constants

COMBINE_METHOD

const COMBINE_METHOD = 1

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

ONE_AFTER_ANOTHER_METHOD

const ONE_AFTER_ANOTHER_METHOD = 2

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

Properties

$computation_method

public integer $computation_method

$taxes

public array $taxes

Methods

__construct

mixed TaxCalculatorCore::__construct(array $taxes, integer $computation_method)

Arguments

  • $taxes array
  • $computation_method integer - (COMBINE_METHOD | ONE_AFTER_ANOTHER_METHOD)

addTaxes

float TaxCalculatorCore::addTaxes(float $price_te)

Compute and add the taxes to the specified price

Arguments

  • $price_te float - price tax excluded

getTaxesAmount

array TaxCalculatorCore::getTaxesAmount(float $price_te)

Return the tax amount associated to each taxes of the TaxCalculator

Arguments

  • $price_te float

getTaxesName

mixed TaxCalculatorCore::getTaxesName()

getTaxesTotalAmount

float TaxCalculatorCore::getTaxesTotalAmount(float $price_te)

Return the total taxes amount

Arguments

  • $price_te float

getTotalRate

float TaxCalculatorCore::getTotalRate()

removeTaxes

float TaxCalculatorCore::removeTaxes(float $price_ti)

Compute and remove the taxes to the specified price

Arguments

  • $price_ti float - price tax inclusive