Openbravo Issue Tracking System - Retail Modules
View Issue Details
0028358Retail ModulesWeb POSpublic2014-12-08 23:122015-04-10 15:03
jecharri 
migueldejuana 
urgentmajoralways
closedfixed 
5
 
RR15Q1 
mtaal
No
0028358: Discounts rounding is not properly calculated
Discounts rounding is not properly calculated. The discounts are not being properly calculated so the total is wrong
-Configure a product with price 10.82
-Go to Web POS
-Add 13 units of his product
-Apply 6 percent of discount

Verify that calculated discount is 8.45 instead of 8.44

140.66 * 0.06 = 8.4396 ~ 8.44
No tags attached.
causes defect 0029339 closed migueldejuana Discounts are not properly calculated in Q1.1 of 2015 version 
png Captura de pantalla 2014-12-08 a las 16.12.06.png (250,025) 2014-12-08 23:12
https://issues.openbravo.com/file_download.php?file_id=7584&type=bug
png
Issue History
2014-12-08 23:12jecharriNew Issue
2014-12-08 23:12jecharriAssigned To => marvintm
2014-12-08 23:12jecharriFile Added: Captura de pantalla 2014-12-08 a las 16.12.06.png
2014-12-08 23:12jecharriResolution time => 1389394800
2014-12-08 23:12jecharriTriggers an Emergency Pack => No
2014-12-08 23:17jecharriSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=7223#r7223
2014-12-09 16:04mtaalResolution time1389394800 => 1420930800
2014-12-11 12:31hgbotCheckin
2014-12-11 12:31hgbotNote Added: 0072422
2014-12-11 12:31hgbotStatusnew => resolved
2014-12-11 12:31hgbotResolutionopen => fixed
2014-12-11 12:31hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/354010b54e3a4243a8a61e99169c2664d03a6ef8 [^]
2014-12-11 12:32migueldejuanaAssigned Tomarvintm => migueldejuana
2014-12-12 09:12hgbotCheckin
2014-12-12 09:12hgbotNote Added: 0072444
2014-12-17 19:37mtaalReview Assigned To => mtaal
2014-12-17 19:37mtaalNote Added: 0072674
2014-12-17 19:37mtaalStatusresolved => closed
2014-12-17 19:37mtaalFixed in Version => RR15Q1
2015-03-19 11:25hgbotCheckin
2015-03-19 11:25hgbotNote Added: 0075766
2015-03-19 11:50hgbotCheckin
2015-03-19 11:50hgbotNote Added: 0075768
2015-03-19 12:03OrekariaRelationship addedblocks 0029339
2015-03-20 10:53dmitry_mezentsevRelationship replacedcauses 0029339
2015-03-20 11:09dmitry_mezentsevIssue Monitored: dmitry_mezentsev
2015-03-20 11:12migueldejuanaNote Added: 0075783
2015-04-10 15:03hgbotCheckin
2015-04-10 15:03hgbotNote Added: 0076454

Notes
(0072422)
hgbot   
2014-12-11 12:31   
Repository: erp/pmods/org.openbravo.retail.discounts
Changeset: 354010b54e3a4243a8a61e99169c2664d03a6ef8
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Thu Dec 11 12:30:16 2014 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/354010b54e3a4243a8a61e99169c2664d03a6ef8 [^]

Fixed issue 0028358: Discounts rounding is not properly calculated

Before the change: price x OneUnit / discount = round(discount) and then roundedDiscount x qty. Loosing precision
Now: (price x qty) / discount = round(totalDiscount)

---
M web/org.openbravo.retail.discounts/js/promotion-manual.js
---
(0072444)
hgbot   
2014-12-12 09:12   
Repository: tools/automation/pi-mobile
Changeset: d02a9bc19b64692153753afbf275644d9b21a1fb
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Thu Dec 11 18:05:03 2014 +0100
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/d02a9bc19b64692153753afbf275644d9b21a1fb [^]

Change test because issue 28358

---
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/discountsandpromotions/I28100_DiscountsNotAppliedToReturnLinesI.java
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/discountsandpromotions/I28100_DiscountsNotAppliedToReturnLinesII.java
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/discountsandpromotions/I28164_DiscountsRemovedWhenReturnPresentI.java
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/discountsandpromotions/I28164_DiscountsRemovedWhenReturnPresentII.java
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/discountsandpromotions/ReceiptDiscount.java
---
(0072674)
mtaal   
2014-12-17 19:37   
Reviewed and tested
(0075766)
hgbot   
2015-03-19 11:25   
Repository: erp/pmods/org.openbravo.retail.discounts
Changeset: 4f4dd55ff95394b821439149e41239405b6a0f72
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Thu Mar 19 11:21:09 2015 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/4f4dd55ff95394b821439149e41239405b6a0f72 [^]

Fixed issue 0029339: Discounts are not properly calculated in Q1.1 of 2015 version

Backout issue 28358

---
M web/org.openbravo.retail.discounts/js/promotion-manual.js
---
(0075768)
hgbot   
2015-03-19 11:50   
Repository: tools/automation/pi-mobile
Changeset: df0ae84ed721b99ce809d6756f8411e2bd626fa5
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Thu Mar 19 11:19:27 2015 +0100
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/df0ae84ed721b99ce809d6756f8411e2bd626fa5 [^]

Fixed issue 0029339: Discounts are not properly calculated in Q1.1 of 2015 version

Backout issue 28358

---
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/discountsandpromotions/I28100_DiscountsNotAppliedToReturnLinesI.java
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/discountsandpromotions/I28100_DiscountsNotAppliedToReturnLinesII.java
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/discountsandpromotions/I28164_DiscountsRemovedWhenReturnPresentI.java
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/discountsandpromotions/I28164_DiscountsRemovedWhenReturnPresentII.java
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/discountsandpromotions/ReceiptDiscount.java
---
(0075783)
migueldejuana   
2015-03-20 11:12   
This is not an issue, this is the expected behaviour. When we apply discounts, we have to apply the discount to each item of the line, not to the total price of the line.

Example, you buy a computer and it has a 20% of discount, if you buy 2 computer, the 20% of discount is applyed to each computer and then they sum the price of each pc. It is a mistake to apply 20% of discount to the total price(sum of the 2 computers).
(0076454)
hgbot   
2015-04-10 15:03   
Repository: retail/backports/3.0RR15Q1.3/org.openbravo.retail.discounts
Changeset: f78942ca26348142af4c6c56a1cd1a3a094886f4
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Thu Mar 19 11:21:09 2015 +0100
URL: http://code.openbravo.com/retail/backports/3.0RR15Q1.3/org.openbravo.retail.discounts/rev/f78942ca26348142af4c6c56a1cd1a3a094886f4 [^]

Fixed issue 0029339: Discounts are not properly calculated in Q1.1 of 2015 version

Backout issue 28358

---
M web/org.openbravo.retail.discounts/js/promotion-manual.js
---