ZenMagick 0.9.10


zenmagick.store.shared.model\ZMTaxRate
model\ZMTaxRate.php at line 35

Class ZMTaxRate

ZMObject
└─ZMTaxRate

public class ZMTaxRate
extends ZMObject

Info for a single tax rate.

The tax rate id is build from the tax classId, countryId and zoneId to make it unique.

Author:
DerManoMann

Field Summary
mixed

$classId_

mixed

$countryId_

mixed

$description_

mixed

$id_

mixed

$rate_

mixed

$zoneId_

Fields inherited from org.zenmagick.core\ZMObject
properties_
Method Summary
void

__construct()

Create new instance.

double

addTax(double amount)

Add tax to the given amount.

int

getClassId()

Get the tax class id.

int

getCountryId()

Get the country id.

protected ZMCurrency

getCurrency()

Get the best matching currency.

string

getDescription()

Get the tax descrption.

string

getId()

Get the tax rate idendtifier

float

getRate()

Get the tax rate.

double

getTaxAmount(double amount)

Caclulate tax for the given amount.

int

getZoneId()

Get the zone id.

void

setClassId(int classId)

Set the tax class id.

void

setCountryId(int countryId)

Set the country id.

void

setDescription(string description)

Set the tax description.

void

setId(string id)

Set the tax rate idendtifier

void

setRate(float rate)

Set the tax rate.

void

setZoneId(int zoneId)

Set the zone id.

Methods inherited from org.zenmagick.core\ZMObject
__construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton

Field Detail

model\ZMTaxRate.php at line 37

classId_

public mixed $classId_

model\ZMTaxRate.php at line 38

countryId_

public mixed $countryId_

model\ZMTaxRate.php at line 41

description_

public mixed $description_

model\ZMTaxRate.php at line 36

id_

public mixed $id_ = ''

model\ZMTaxRate.php at line 40

rate_

public mixed $rate_

model\ZMTaxRate.php at line 39

zoneId_

public mixed $zoneId_

Method Detail

model\ZMTaxRate.php at line 47

__construct

public void __construct()

Create new instance.


model\ZMTaxRate.php at line 160

addTax

public double addTax(double amount)

Add tax to the given amount.

Parameters:
amount - The amount.
Returns:
The amount incl. tax.

model\ZMTaxRate.php at line 117

getClassId

public int getClassId()

Get the tax class id.

Returns:
The tax class id or 0.

model\ZMTaxRate.php at line 131

getCountryId

public int getCountryId()

Get the country id.

Returns:
The country id or 0.

model\ZMTaxRate.php at line 185

getCurrency

protected ZMCurrency getCurrency()

Get the best matching currency.

Returns:
A currency.

model\ZMTaxRate.php at line 84

getDescription

public string getDescription()

Get the tax descrption.

Returns:
The tax description.

model\ZMTaxRate.php at line 70

getId

public string getId()

Get the tax rate idendtifier

Returns:
The tax rate idendtifier.

model\ZMTaxRate.php at line 96

getRate

public float getRate()

Get the tax rate.

Returns:
The tax rate.

model\ZMTaxRate.php at line 175

getTaxAmount

public double getTaxAmount(double amount)

Caclulate tax for the given amount.

Parameters:
amount - The amount.
Returns:
The (non rounded) tax value.

model\ZMTaxRate.php at line 145

getZoneId

public int getZoneId()

Get the zone id.

Returns:
The zone id or 0.

model\ZMTaxRate.php at line 124

setClassId

public void setClassId(int classId)

Set the tax class id.

Parameters:
classId - The tax class id.

model\ZMTaxRate.php at line 138

setCountryId

public void setCountryId(int countryId)

Set the country id.

Parameters:
countryId - The country id.

model\ZMTaxRate.php at line 103

setDescription

public void setDescription(string description)

Set the tax description.

Parameters:
description - The tax description.

model\ZMTaxRate.php at line 77

setId

public void setId(string id)

Set the tax rate idendtifier

Parameters:
id - The tax rate idendtifier.

model\ZMTaxRate.php at line 110

setRate

public void setRate(float rate)

Set the tax rate.

Parameters:
rate - The tax rate.

model\ZMTaxRate.php at line 152

setZoneId

public void setZoneId(int zoneId)

Set the zone id.

Parameters:
zoneId - The zone id.

ZenMagick 0.9.10