Skip to content

Latest commit

 

History

History
210 lines (99 loc) · 3.97 KB

class.TaxCalculatorCore.md

File metadata and controls

210 lines (99 loc) · 3.97 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($price_te)

Compute and add the taxes to the specified price

Arguments

  • $price_te mixed

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()

getTotalRate

float TaxCalculatorCore::getTotalRate()

removeTaxes

\price TaxCalculatorCore::removeTaxes($price_ti)

Compute and remove the taxes to the specified price

Arguments

  • $price_ti mixed