View Issue Details

IDProjectCategoryView StatusLast Update
0002896OXID eShop (all versions)1.02. Price calculations (discounts, coupons, additional costs etc.)public2012-12-07 15:19
Reportermydevs Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionno change required 
Summary0002896: Netto rounding problems in brutto mode
DescriptionBug 0002442 has been fixed, but isn't it necessary to delete the line
$this->_dNetto = oxUtils::getInstance()->fRound( $this->_dNetto );
too? If the net price is rounded before you have the same problem as on 0002442 mentioned. Better way is not to round any net price because you loose information on every rounding that can do calculating erros.

Or is that rounding necessary?

protected function _recalculate()
    {
        if ( $this->_blNetPriceMode ) {
            // rounding base price in netto mode
            $this->_dNetto = oxUtils::getInstance()->fRound( $this->_dNetto );
            $this->_dBrutto = self::netto2Brutto($this->_dNetto, $this->_dVat);
        } else {
            $this->_dNetto = self::brutto2Netto($this->_dBrutto, $this->_dVat);
        }

        // rounding brutto price value after each operation
        $this->_dBrutto = oxUtils::getInstance()->fRound( $this->_dBrutto );
    }
TagsVAT
ThemeBoth
BrowserAll
PHP Versionany
Database Versionany

Activities

birute_meilutyte

2011-05-19 08:49

reporter   ~0004611

@developers: check from source code side if such issue still exist

tjungcl

2011-05-19 09:24

reporter   ~0004612

netpricemode means, you work with rounded netto prices (for b2b customers for example.

so this should be correct.

mydevs

2011-05-21 12:04

reporter   ~0004635

I think that netpricemode means, you insert all prices in netto and the shop then calculates the gross price - no difference between b2c or b2b.
The question is why to round at this position of code. If you send the price to template it got rounded again. So why round here and loose price-information?

The problem is if your shop is in netpricemode but you just want to insert prices in netto and display them as gross prices. It is impossible to display 13,50€ on a 19% tax. (precision is 2 decimals because you don't want to display 3 decimals on frontend)
11,34 results in 13,49 and 11,35 results in 13,51.
Only way to get the 13,50 displayed you need to remove that too often rounding and set a netprice of 11,344.

tjungcl

2011-05-23 08:15

reporter   ~0004637

Last edited: 2011-05-23 08:56

interesting aspect.

i understood the netprice mode differently, and i think, both ways are of practical use: one for brutto-b2c shops where you want to store your prices in netto, the other for netto-b2b shops, where customers without ustid see brutto prices based on rounded nettos.

oxid should clearify what the nettomode is meant for, but as it is now, it is the second variant (netto-b2b).

arvydas_vapsva

2011-08-29 16:13

reporter   ~0005139

Current shop impl. is "b2c" oriented, so we cant just remove rounding and expect everything goes fine. Simple example - we have net price mode shop (actually in any mode this can happen) and VAT = 0% (some special case for easier understanding):

Shop has products:

Product1 - 1.333 EUR - 0% VAT
Product2 - 0.333 EUR - 0% VAT
Product3 - 2.333 EUR - 0% VAT

Customer adds them to basket and sees:

Product1 - 1 x 1.33 EUR
Product2 - 1 x 0.33 EUR
Product3 - 1 x 2.33 EUR
-----------------------
Total: 3.99 EUR

This means we've rounded all prices and get correct final value. Now if we disable rounding during internal calculations, just display rounded final prices, so we get:

Product1 - 1 x 1.33 EUR
Product2 - 1 x 0.33 EUR
Product3 - 1 x 2.33 EUR
-----------------------
Total: 4.00 EUR

Means - 1.333 + 0.333 + 2.333 = 3.999 -> rounding -> 4.00. I think this is inacceptable for regular customers.

Pure "b2b" support is pending and highly requested feature we will implement in next versions. Please have a look at http://oxid.uservoice.com/forums/31940-feature-requests/suggestions/373196-install-a-b2b-b2c-feature