View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002442 | OXID eShop (all versions) | 1.02. Price calculations (discounts, coupons, additional costs etc.) | public | 2011-01-25 10:02 | 2012-12-07 15:19 |
Reporter | tjungcl | Assigned To | |||
Priority | high | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 4.5.0_beta1 | ||||
Fixed in Version | 4.5.1 revision 38045 | ||||
Summary | 0002442: Netto ist rounded in brutto mode | ||||
Description | In class oxprice the static function netto2brutto($dNetto, $dVat) rounds the given $dNetto, than adds the $dVat. - Rounding the netto is correct, if _blNetPriceMode is true, else it can result in differing bruttoprices. - netto2brutto is static, so it cant access $this->_blNetPriceMode, so it has no possibility to decide, if netto has to be rounded or not. - netto2brutto is used at two places: - oxprice->_recalculate, inside the (_blNetPriceMode) case, just after rounding the netto. --> so netto is already rounded. - oxprice->setUserVat, inside (!_blNetPriceMode) case, where the netto must not be rounded (but it will in netto2brutto). --> so if you just dont round the netto within netto2brutto, in nettomode all is still correct, and in bruttomode the netto no longer gets rounded. =========== The same problem, just harmless: The static function brutto2netto rounds the brutto before calculating the netto. This is only correct in bruttomode, otherwise it must not be rounded. Fortunatelly the function brutto2netto is only called twice, and in both cases in bruttomode. Nevertheless the static funtion brutto2netto should not round anything - it is static and so it cant access $this->_blNetPriceMode, so it cant know if to round or not. Instead the function recalculate should round brutto in bruttomode (which it doesnt), before calling brutto2netto. | ||||
Additional Information | in the documentation for this method is an error: the docu says: Converts Netto price to Brotto using formula: X = $dBrutto + $dVat% returns X In fact the formula at the moment is X = round($dNetto) + $dVat% and it should be X = $dNetto + $dVat% as stated above. | ||||
Tags | VAT | ||||
Theme | |||||
Browser | All | ||||
PHP Version | any | ||||
Database Version | any | ||||