Author Topic: Discounted price round on multiple items  (Read 157 times)

JM0308

• Beginner
• Posts: 5
• A beginner
Discounted price round on multiple items
« on: November 08, 2017, 10:58:43 am »
Hi
We have come across an issue with the taxes and calculations rules of apply a discount of 20%.

If a customer buys 1 item at £6.16 with a discount of 20% it comes out at £4.93. Discount of £1.23. This is correct per item.
If a customer buys 4 items at £6.16 with a discount of 20% it comes out at £19.71. Discount of £4.93. This is incorrect, is should be £4.92. What it has done is 4 x £6.16 = £24.64 then applied 20% discount which is £19.71.
What it should be doing is 4 x the discounted price of £4.93 = £19.72 rather than discounting the total net price it needs to discount the individual item price then times it by 4.

I have been looking through the config and tax calculation rules but none of them seem to work?

Any ideas?

VirtueMart 3.2.4
Joomla! 3.8.1

alexanderflr

• Beginner
• Posts: 38
• VirtueMart Version: 3.2.2
Re: Discounted price round on multiple items
« Reply #1 on: November 09, 2017, 15:32:10 pm »
I would like to know how to change that as well,  I have issues with the pricing because of that. The price doesn't match anymore with the data from our ERP software and our accountant is to lazy to do the adjustments.
VM 3.2.4 on Joomla! 3.8.1 Stable, PHP Version 7.0.25

AH

• Global Moderator
• Sr. Member
• Posts: 2639
• VirtueMart Version: 3.2.5
Re: Discounted price round on multiple items
« Reply #2 on: November 09, 2017, 20:58:33 pm »
Jm0308

Quote
If a customer buys 1 item at £6.16 with a discount of 20% it comes out at £4.93. Discount of £1.23. This is correct per item.
If a customer buys 4 items at £6.16 with a discount of 20% it comes out at £19.71. Discount of £4.93. This is incorrect, is should be £4.92. What it has done is 4 x £6.16 = £24.64 then applied 20% discount which is £19.71.
What it should be doing is 4 x the discounted price of £4.93 = £19.72 rather than discounting the total net price it needs to discount the individual item price then times it by 4.

Review your calculations and consider each step.  VM does not round each step in the process

The single Item price with discount = 6.16 * .8  = 4.928

A line item of qty = 1 = 1 * 4.928 = 4.928 rounded to 2dp = 4.93
A line item of qty = 4 = 4 * 4.928 = 19.712 rounded to 2dp = 19.71

alexanderflr
Quote
The price doesn't match anymore with the data from our ERP software and our accountant is to lazy to do the adjustments.

Maybe you can get the accountant to consider how discount works in his ERP system calculations   - the price per item should have more than 2 decimal places in any ERP or accounting system.
regards
A

Joomla 3.8.2
php 5.6 + php 7