Brutto sum in cart/checkout

31.03.2015 13:06
#1
skrzypol
Joomshopping forum user no avatar
Name: Piotr
02.03.2015
Posts: 2
Quote
Brutto sum in cart/checkout

Hello!

I have a serious problem with calculating prices. In cart brutto sum is calculated as: netto-sum * (1+tax). This is wrong, because of tax roundings. It should be calculated as brutto-sum or netto-sum + tax-sum.

Example:

Tax: 23%
Product A: 125 brutto / 101,63 netto
Quantity: 15

Calculated in cart/checkout: netto-sum 1524,45 / VAT 350,62 / brutto-sum 1875,07 (not correct!)

Proper calculation: netto-sum 1524,45 / VAT 350,55 / brutto-sum 1875,00 (correct)

0,07 difference!

Problem is in calculation. Cart/checkout makes netto-price * quantity and calculate tax using this sum. It should calculate each sum separately (netto sum, tax sum, brutto sum). Or at least brutto sum should be proper! (15*125=1875).

Please help me to solve this problem :(


Joomla: 3.4
JoomShopping: 4.6
PHP: 5.5
 
31.03.2015 14:40
#2
skrzypol
Joomshopping forum user no avatar
Name: Piotr
02.03.2015
Posts: 2
Quote
Aw: Brutto sum in cart/checkout

Found solution on my own...

In components\com_jshopping\models\cart.php in function getTaxExt summing tax values is proccesed without tax value rounding.

Line about 175:
$tax_summ[$value['tax']] += $value['quantity'] * getPriceTaxValue($value['price'], $value['tax'], $jshopConfig->display_price_front_current);

SHOULD BE:
$tax_summ[$value['tax']] += $value['quantity'] * round(getPriceTaxValue($value['price'], $value['tax'], $jshopConfig->display_price_front_current),2);

Then everything works perfectely.

 
Copyrights MAXXmarketing GmbH. All Rights Reserved