Definition at line 7 of file oxprice.php.
Public Member Functions | |
__construct ($dInitPrice=null) | |
setNettoPriceMode () | |
setBruttoPriceMode () | |
setVat ($newVat) | |
setUserVat ($newVat) | |
getVat () | |
setPrice ($newPrice, $dVat=null) | |
getBruttoPrice () | |
getNettoPrice () | |
getVatValue () | |
subtractPercent ($dValue) | |
addPercent ($dValue) | |
addPrice (oxPrice $oPrice) | |
add ($dValue) | |
subtract ($dValue) | |
multiply ($dValue) | |
divide ($dValue) | |
compare (oxPrice $oPrice) | |
Static Public Member Functions | |
static | percent ($dValue, $dPercent) |
static | brutto2Netto ($dBrutto, $dVat) |
static | netto2Brutto ($dNetto, $dVat) |
Protected Member Functions | |
_recalculate () | |
Protected Attributes | |
$_dBrutto = 0.0 | |
$_dNetto = 0.0 | |
$_dVat = 0.0 | |
$_blNetPriceMode |
oxPrice.__construct | ( | $ | dInitPrice = null |
) |
Class constructor. Gets price entering mode.
double | $dInitPrice given price |
Definition at line 47 of file oxprice.php.
oxPrice.setNettoPriceMode | ( | ) |
oxPrice.setBruttoPriceMode | ( | ) |
oxPrice.setVat | ( | $ | newVat | ) |
Sets new VAT percent, and recaluates price.
double | $newVat vat percent |
Definition at line 83 of file oxprice.php.
oxPrice.setUserVat | ( | $ | newVat | ) |
Sets new base VAT percent, recalculates brutto, and then netto price (in brutto mode). if bruttoMode then BruttoPrice =(BruttoPrice - oldVAT% ) + newVat; oldVAT = newVat; finally recalculate; USE ONLY TO CHANGE BASE VAT (in case then local VAT differs from use VAT), USE setVAT in usual case !!!
double | $newVat vat percent |
Definition at line 101 of file oxprice.php.
oxPrice.getVat | ( | ) |
oxPrice.setPrice | ( | $ | newPrice, | |
$ | dVat = null | |||
) |
Sets new price and VAT percent(optional). Recalculates price by price entering mode
double | $newPrice new price | |
double | $dVat (optional) |
Definition at line 129 of file oxprice.php.
oxPrice.getBruttoPrice | ( | ) |
oxPrice.getNettoPrice | ( | ) |
oxPrice.getVatValue | ( | ) |
oxPrice.subtractPercent | ( | $ | dValue | ) |
Subtracts given percent from price depending on price entering mode, and recalulates price
double | $dValue percent to subtract from price |
Definition at line 187 of file oxprice.php.
oxPrice.addPercent | ( | $ | dValue | ) |
Adds given percent to price depending on price entering mode, and recalulates price
double | $dValue percent to add to price |
Definition at line 206 of file oxprice.php.
oxPrice.addPrice | ( | oxPrice $ | oPrice | ) |
Adds another oxPrice object and recalculates current method.
oxPrice | $oPrice object |
Definition at line 218 of file oxprice.php.
oxPrice.add | ( | $ | dValue | ) |
Adds given value to price depending on price entering mode, and recalulates price
double | $dValue value to add to price |
Definition at line 235 of file oxprice.php.
oxPrice.subtract | ( | $ | dValue | ) |
Subtracts given value from price depending on price entering mode, and recalulates price
double | $dValue value to subtracts from price |
Definition at line 253 of file oxprice.php.
oxPrice.multiply | ( | $ | dValue | ) |
Multiplies price by gived value depending on price entering mode, and recalulates price
double | $dValue value for multipying price |
Definition at line 266 of file oxprice.php.
oxPrice.divide | ( | $ | dValue | ) |
Divides price by gived value depending on price entering mode, and recalulates price
double | $dValue value for divideing price |
Definition at line 284 of file oxprice.php.
oxPrice.compare | ( | oxPrice $ | oPrice | ) |
Compares this object to another oxPrice objects. Comparisson is performed on brutto price. Result is equal to: 0 - when prices are equal. 1 - when this price is larger than $oPrice. -1 - when this price is smaller than $oPrice.
oxPrice | $oPrice price object |
Definition at line 305 of file oxprice.php.
static oxPrice.percent | ( | $ | dValue, | |
$ | dPercent | |||
) | [static] |
Private function for percent value calculations
double | $dValue value | |
double | $dPercent percent |
Definition at line 329 of file oxprice.php.
static oxPrice.brutto2Netto | ( | $ | dBrutto, | |
$ | dVat | |||
) | [static] |
Converts Brutto price to Netto using formula: X + $dVat% = $dBrutto X/100 = $dBrutto/(100+$dVAT) X= ($dBrutto/(100+$dVAT))/100 returns X
double | $dBrutto brutto price | |
double | $dVat vat |
Definition at line 347 of file oxprice.php.
static oxPrice.netto2Brutto | ( | $ | dNetto, | |
$ | dVat | |||
) | [static] |
Converts Netto price to Brotto using formula: X = $dBrutto + $dVat% returns X
double | $dNetto netto price | |
double | $dVat vat |
Definition at line 375 of file oxprice.php.
oxPrice._recalculate | ( | ) | [protected] |
Calculates price depending on price entering mode
protected
Definition at line 388 of file oxprice.php.
oxPrice.$_dBrutto = 0.0 [protected] |
Definition at line 14 of file oxprice.php.
oxPrice.$_dNetto = 0.0 [protected] |
Definition at line 21 of file oxprice.php.
oxPrice.$_dVat = 0.0 [protected] |
Definition at line 28 of file oxprice.php.
oxPrice.$_blNetPriceMode [protected] |
Definition at line 38 of file oxprice.php.