
Jacek Es
Members-
Posts
79 -
Joined
-
Last visited
About Jacek Es
- Birthday 07/29/1975
Profile Information
-
Location
Portugal
-
Activity
Developer
Recent Profile Visitors
1,059 profile views
Jacek Es's Achievements
-
Rounded price is displayed but unrounded price is used for calculations
Jacek Es replied to Jacek Es's topic in Bug reports
Hi, No, sadly I haven't. It appears this issue is not straightforward to fix. Sadly no one from PrestaShop cares even to reply to this Bug report. The issue has been reported by others on other forums but still no solution. Good luck!- 9 replies
-
- specific prices
- discounts
-
(and 2 more)
Tagged with:
-
Rounded price is displayed but unrounded price is used for calculations
Jacek Es replied to Jacek Es's topic in Bug reports
Thanks MadMar. I didn't want to comment on the previous reply no to heat up emotions but you are spot on it. You are right... the new rounding system has flows and these aren't easy to fix. I have even hired a professional PrestaShop developer. He initially quoted the task for 2-3 days work but is already on it for 3 weeks. From the possible approaches that I suggested: 1. Display rounded value and use it for further calculations (as it was in PrestaShop 1.6): £0.21 * 1000 = £210.00 2. Display unrounded value and use it for further calculations (but the shop is set to 2 Decimals which is an issue): £0.207 * 1000 = £207.00 he has already abandoned the approach 1. above. He is now trying to implement the 2nd approach but it's a messy road. Your suggestion seems to be the best - address the issue at the core level- 9 replies
-
- specific prices
- discounts
-
(and 2 more)
Tagged with:
-
Rounded price is displayed but unrounded price is used for calculations
Jacek Es replied to Jacek Es's topic in Bug reports
There would be a sense to it - to have calculations on the invoice and during checkout process that are mathematically correct. You cannot have the following: £0.21 * 1000 = £207.00 You can either have: £0.21 * 1000 = £210.00 or £0.207 * 1000 = £207.00 Don't you agree? In PrestaShop 1.6 with Classical rounding mode the calculations were made correct - the rounded value was displayed and used for the calculations:- 9 replies
-
- specific prices
- discounts
-
(and 2 more)
Tagged with:
-
Hi, I have discovered this on PrestaShop 8.1.7. It applies to rounding methods: Round on each line and Round on total when currency Decimals is set to 2. PrestaShop 8.1 rounds Unit Price with discount applied value but uses unrounded value for further calculations. This makes the calculations appear wrong. Example: Product base price: £0.30 Discount from 1000pcs: 31% Product price with discount applied: £0.207 (rounded to £0.21) PrestaShop makes the following calculations: £0.21 * 1000 cannot be £207.00 The problem is that rounded Unit Price with discount is displayed (£0.21) but unrounded value is taken to the calculations (£0.207). Possible approaches to correct this: 1. Display rounded value and use it for further calculations (as it was in PrestaShop 1.6): £0.21 * 1000 = £210.00 2. Display unrounded value and use it for further calculations (but the shop is set to 2 Decimals which is an issue): £0.207 * 1000 = £207.00 How to fix this? Thanks
- 9 replies
-
- specific prices
- discounts
-
(and 2 more)
Tagged with:
-
Increase currency decimals but only product unit price
Jacek Es replied to Jacek Es's topic in General topics
To simplify... The issue comes from a fact (should be considered as bug) that PrestaShop 8.1 rounds Unit Price value but uses unrounded value for further calculations. This makes the calculations wrong. Example: Product base price: £0.30 Discount from 1000pcs: 31% Product price with discount applied: £0.207 PrestaShop 8.1, rounding method: Round on each line or Round on total makes the following calculations: £0.21 * 1000 cannot be £207.00 The problem is that rounded Unit Price with discount is displayed (£0.21) but unrounded value is taken to the calculations (£0.207) In PrestaShop 1.6 with Classical rounding mode the calculations were made correct - the rounded value was displayed and used for the calculations: Possible approaches to resolve this: 1. Display rounded value and use it for further calculations (as it was in PrestaShop 1.6): £0.21 * 1000 = £210.00 2. Display unrounded value and use it for further calculations: £0.207 * 1000 = £207.00 Is there another way of resolving this? Can this bug be taken to the developers somehow? -
Increase currency decimals but only product unit price
Jacek Es replied to Jacek Es's topic in General topics
Yes. The screenshot in the above post was actually from 'Round on each line' method. 'Round on total' method displays the same as 'Round on each line' in this example. 'Round on each item' is different but the way it's done doesn't serve us because everything is rounded, tax added per item and rounded and at the end multiplied by quantities . The calculations are as follows: Rounding mode: Round on each item Product base price: £0.30 Discount applied at 1000pc: -31% Price after discount excl. VAT: £0.207, rounded to £0.21 20% VAT applied to each item: £0.21 * 0.20 = 0.042, rounded to £0.04 Item price, incl. VAT: £0.21 + £0.04 = £0.25 Total for 1000pcs: £0.25 * 1000 = £250 -
Increase currency decimals but only product unit price
Jacek Es replied to Jacek Es's topic in General topics
Hi, It seems the Unit Price value (with % discount added) is stored with all decimals or calculated on the fly when needed. Please see below screenshot of invoice generated when the shop currency is set to 2 Decimals (left) and 4 Decimals (right). Order was placed when currency decimals was set to 2: What I am trying to achieve is to change how the calculations are presented. With the 2 Decimals it shows as: £0.21 * 1000 = £207.00 which isn't correct This is because the discounted Unit Price is in fact £0.207. Prestashop 8 rounds the display to £0.21 but for the calculations uses £207.00 How can I address this? -
Hi, PS 8.1.7 While not intending to change currency decimal for the entire shop (Localization > Currencies > Decimals) is it possible to increase the decimals of the Unit Price on the invoice? I have now currency decimals set to 2 but would like to have product unit price displayed with 4 decimals because when the quantity discount is applied the price often has more decimals than 2. I believe this is the part on the invoice (invoice.product-tab.tpl) {displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_excl_including_ecotax} I tried changing it to: {displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_excl_including_ecotax|sprintf:"%.4f"} and {displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_excl_including_ecotax precision=4} but no effect. Is it possible somehow?
-
Hi, PrestaShop 8.1 How can I make the product specific price (discount by percentage) consistent throughout the shop and ordering process? Here my scenario and issue: Product base price: £0.30 Specific price by % discount: -31% from 1000pcs UK VAT @ 20% Rounding mode: Round on the total Currency decimal: 2 PrestaShop calculates the order as follows: The issue comes from the product price with discount applied which is: £0.207. £0.30 - £0.93 (31% discount) = £0.207 The shop's currency decimal is set to 2 and product discounted price is rounded to £0.21 but only on the display and invoice because the calculations are made from £0.207 which creates discrepancies. We cannot have £0.21 * 1000 = £207 Two acceptable options would be either: 1. Display product discounted price with all decimals (without turning the entire shop into this): £0.207 * 1000 = £207 or 2. Make the final calculations from the rounded product discounted price: £0.21 * 1000 = £210 I have explored all rounding options and sadly non provides an acceptable solution. Rounding on each item have the display of initial calculations correct: £0.21 * 1000 = £210 but in this option the tax is added to each item and rounded before the total is made which isn't desired: Price after discount excl. VAT: £0.207, rounded to £0.21 20% VAT applied to each item: £0.21 * 0.20 = 0.042, rounded to £0.04 Item price, incl. VAT: £0.21 + £0.04 = £0.25 Total for 1000pcs: £0.25 * 1000 = £250 Anyone have ideas on how to keep the product discounted price the same in the order display, invoice and in the calculations? Thanks
-
It appears that the PS calculations may be correct based on the following: Rounding mode: Round on each item Product base price: £0.30 Discount applied at 1000pc: -31% Price after discount excl. VAT: £0.207, rounded to £0.21 20% VAT applied to each item: £0.21 * 0.20 = 0.042, rounded to £0.04 Item price, incl. VAT: £0.21 + £0.04 = £0.25 Total for 1000pcs: £0.25 * 1000 = £250 In this example VAT is added to each item and then multiplied by quantities? Is there a way of changing this that first is a total calculated excl. VAT and then VAT is added? This would make the calculations more clear and avoiding rounding differences.
-
I don't see this option: All the customers groups are set for Price display method: Tax excluded I think the problem may be with the rounding. In my example when the base price is £0.30 and 31% discount is applied then it gives the discounted price of £0.207. When the currency is set to 2 Decimals the calculations are wrong. When I set the currency Decimals to 4 the order calculations are correct:
-
Hi, PrestaShop v8.1.7 Tested on fresh installation Settings: Product base price: £0.30 Specific price by discount: -31% from 1000pcs UK VAT @ 20% Rounding mode: Round on each item Rounding type: Round up away from zero, when it is half way there (recommended) Currency decimal: 2 Free delivery Quantity ordered: 1000 pcs PrestaShop calculations: Correct calculations should be: Subtotal: £210.00 Total (VAT excl.): £210.00 Total (tax incl.): £252.00 Regards, Jacek
-
Hi, I am struggling with Tax calculation on PS 8.1.7 which I believe to be a bug. I have tested all rounding modes and rounding types. The problem for me appears with the Round on each item type, Round up away from zero, when it is half way there (recommended) mode for products that have Specific prices set by percentage. Here is my scenario: Currency decimal: 2 Round on each item Round up away from zero, when it is half way there (recommended) Specific prices set by percentage Product base price: £0.30 Discount at 1000pcs: -31% Tax: UK VAT @ 20% PrestaShop Order calculations: The calculated VAT (20%) from £210 should be £42 but PrestaShop calculated it as £40. I can't figure it out why and how to change it. The other 2 rounding types (Round on each line, Round on the total) have the tax calculations correct but the Item price with the discount applied is displayed wrong. It is displayed as £0.21 x 1000 = £207. For that reason I don't use these 2 rounding types: Any idea how to resolve the wrong tax calculations on Round on each item option or change the display of item price for Round on each line, Round on the total options? Regards, Jacek