List of all members.
Detailed Description
Price calculation class. Responsible for simple price calculations. Basically contains Brutto, Netto prices and VAT values.
Definition at line 6 of file oxprice.php.
Constructor & Destructor Documentation
oxPrice.__construct |
( |
$ |
dInitPrice = null |
) |
|
Class constructor. Gets price entering mode.
- Parameters:
-
| double | $dInitPrice given price |
- Returns:
- oxPrice
Definition at line 46 of file oxprice.php.
Member Function Documentation
oxPrice._recalculate |
( |
|
) |
[protected] |
Calculates price depending on price entering mode
protected
- Returns:
- null
Definition at line 385 of file oxprice.php.
Adds given value to price depending on price entering mode, and recalulates price
- Parameters:
-
| double | $dValue value to add to price |
- Returns:
- null
Definition at line 236 of file oxprice.php.
oxPrice.addPercent |
( |
$ |
dValue |
) |
|
Adds given percent to price depending on price entering mode, and recalulates price
- Parameters:
-
| double | $dValue percent to add to price |
- Returns:
- null
Definition at line 207 of file oxprice.php.
oxPrice.addPrice |
( |
oxPrice $ |
oPrice |
) |
|
Adds another oxPrice object and recalculates current method.
- Parameters:
-
- Returns:
- null
Definition at line 219 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
- Parameters:
-
| double | $dBrutto brutto price |
| double | $dVat vat |
- Returns:
- double
Definition at line 347 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.
- Parameters:
-
- Returns:
- null
Definition at line 306 of file oxprice.php.
oxPrice.divide |
( |
$ |
dValue |
) |
|
Divides price by gived value depending on price entering mode, and recalulates price
- Parameters:
-
| double | $dValue value for divideing price |
- Returns:
- null
Definition at line 285 of file oxprice.php.
oxPrice.getBruttoPrice |
( |
|
) |
|
Returns brutto price
- Returns:
- double
Definition at line 149 of file oxprice.php.
oxPrice.getNettoPrice |
( |
|
) |
|
Returns netto price
- Returns:
- double
Definition at line 162 of file oxprice.php.
static oxPrice.getPriceInActCurrency |
( |
$ |
dPrice |
) |
[static] |
Returns price multiplied by current currency
- Parameters:
-
| string | $dPrice price value |
- Returns:
- double
Definition at line 407 of file oxprice.php.
Returns setted VAT percent
- Returns:
- double
Definition at line 116 of file oxprice.php.
Returns absolute VAT value
- Returns:
- double
Definition at line 175 of file oxprice.php.
oxPrice.multiply |
( |
$ |
dValue |
) |
|
Multiplies price by gived value depending on price entering mode, and recalulates price
- Parameters:
-
| double | $dValue value for multipying price |
- Returns:
- null
Definition at line 267 of file oxprice.php.
static oxPrice.netto2Brutto |
( |
$ |
dNetto, |
|
|
$ |
dVat | |
|
) |
| | [static] |
Converts Netto price to Brutto using formula: X = $dNetto + $dVat% returns X
- Parameters:
-
| double | $dNetto netto price |
| double | $dVat vat |
- Returns:
- double
Definition at line 373 of file oxprice.php.
static oxPrice.percent |
( |
$ |
dValue, |
|
|
$ |
dPercent | |
|
) |
| | [static] |
Private function for percent value calculations
- Parameters:
-
| double | $dValue value |
| double | $dPercent percent |
- Returns:
- double
Definition at line 330 of file oxprice.php.
oxPrice.setBruttoPriceMode |
( |
|
) |
|
Brutprice mode setter
- Returns:
- null
Definition at line 70 of file oxprice.php.
oxPrice.setNettoPriceMode |
( |
|
) |
|
Netprice mode setter
- Returns:
- null
Definition at line 60 of file oxprice.php.
oxPrice.setPrice |
( |
$ |
newPrice, |
|
|
$ |
dVat = null | |
|
) |
| | |
Sets new price and VAT percent(optional). Recalculates price by price entering mode
- Parameters:
-
| double | $newPrice new price |
| double | $dVat (optional) |
- Returns:
- null
Definition at line 130 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 when local VAT differs from user VAT), USE setVat() in usual case !!!
- Parameters:
-
| double | $newVat vat percent |
- See also:
- setVat()
- Returns:
- null
Definition at line 102 of file oxprice.php.
oxPrice.setVat |
( |
$ |
newVat |
) |
|
Sets new VAT percent, and recaluates price.
- Parameters:
-
| double | $newVat vat percent |
- Returns:
- null
Definition at line 82 of file oxprice.php.
oxPrice.subtract |
( |
$ |
dValue |
) |
|
Subtracts given value from price depending on price entering mode, and recalulates price
- Parameters:
-
| double | $dValue value to subtracts from price |
- Returns:
- null
Definition at line 254 of file oxprice.php.
oxPrice.subtractPercent |
( |
$ |
dValue |
) |
|
Subtracts given percent from price depending on price entering mode, and recalulates price
- Parameters:
-
| double | $dValue percent to subtract from price |
- Returns:
- null
Definition at line 188 of file oxprice.php.
Member Data Documentation
oxPrice.$_blNetPriceMode [protected] |
oxPrice.$_dBrutto = 0.0 [protected] |
oxPrice.$_dNetto = 0.0 [protected] |
oxPrice.$_dVat = 0.0 [protected] |
The documentation for this class was generated from the following file: