Openbravo Issue Tracking System - Retail Modules
View Issue Details
0034299Retail ModulesDiscounts and Promotionspublic2016-10-26 09:282016-12-16 08:40
prakashmurugesan88 
mario_castello 
normalmajorhave not tried
closedfixed 
5
 
RR17Q1 
marvintm
Production - QA Approved
2016-09-27
RR16Q3
https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/97c95e2c63c9 [^]
No
0034299: [SER-QA 1942] Error while deleting a receipt that has line with discounts applied.
It appears an error in the console "Divide by 0" when deleting a receipt that has line with discounts applied.

Error occurs in the following line,

https://code.openbravo.com/erp/pmods-branches/org.openbravo.retail.discounts-but-dev/file/6c275711a250/web/org.openbravo.retail.discounts/js/promotion-discount.js#l36 [^]
Steps to reproduce in live builds,

    Backend:
    Set Preference "Web POS Save Removed Tickets" = "Y".

    POS Terminal:
    create a new receipt.
    Add a product GPS handheld.
    Ensure discount GPS_10_per is applied to the line.
    Click on thrash icon and confirm deletion of the receipt.

    Check in browser console "Divide by 0" error will be displayed.
SER-QA
depends on backport 0034388RR16Q4 closed mario_castello [SER-QA 1942] Error while deleting a receipt that has line with discounts applied. 
has duplicate defect 0034387 closed Retail [RR16Q4] Close a Layaway with discounts in POS throws an error: "Cannot calculate receipt taxes" 
related to defect 0034372 closed ranjith_qualiantech_com [RR16Q4] Persistent deleted tickets do not keep manual discounts 
patch DivedByZeroSuggestedFixScenario2.patch (1,182) 2016-10-28 10:21
https://issues.openbravo.com/file_download.php?file_id=9984&type=bug
Issue History
2016-10-26 09:28prakashmurugesan88New Issue
2016-10-26 09:28prakashmurugesan88Assigned To => Retail
2016-10-26 09:28prakashmurugesan88Triggers an Emergency Pack => No
2016-10-26 09:50adrianromeroResolution time => 1478646000
2016-10-26 09:50adrianromeroSummaryError while deleting a receipt that has line with discounts applied. => [SER-QA 1942] Error while deleting a receipt that has line with discounts applied.
2016-10-26 09:50adrianromeroDescription Updatedbug_revision_view_page.php?rev_id=13483#r13483
2016-10-26 09:50adrianromeroTag Attached: SER-QA
2016-10-26 14:08prakashmurugesan88Description Updatedbug_revision_view_page.php?rev_id=13489#r13489
2016-10-27 15:58marvintmAssigned ToRetail => prakashmurugesan88
2016-10-27 15:58marvintmNote Added: 0090961
2016-10-27 15:58marvintmStatusnew => feedback
2016-10-28 10:20prakashmurugesan88Note Added: 0090983
2016-10-28 10:21prakashmurugesan88File Added: DivedByZeroSuggestedFixScenario2.patch
2016-10-28 10:21prakashmurugesan88Statusfeedback => new
2016-10-28 10:22prakashmurugesan88Assigned Toprakashmurugesan88 => marvintm
2016-10-28 10:23prakashmurugesan88Note Edited: 0090983bug_revision_view_page.php?bugnote_id=0090983#r13503
2016-10-28 21:12mario_castelloAssigned Tomarvintm => mario_castello
2016-10-28 21:12mario_castelloStatusnew => acknowledged
2016-10-28 21:13mario_castelloStatusacknowledged => scheduled
2016-10-31 21:58hgbotCheckin
2016-10-31 21:58hgbotNote Added: 0091029
2016-10-31 21:58hgbotStatusscheduled => resolved
2016-10-31 21:58hgbotResolutionopen => fixed
2016-10-31 21:58hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/8eec55651e77c64fb85720d618279c9f01e8e714 [^]
2016-10-31 21:59hgbotCheckin
2016-10-31 21:59hgbotNote Added: 0091030
2016-11-01 08:53marvintmReview Assigned To => marvintm
2016-11-01 08:53marvintmStatusresolved => closed
2016-11-01 08:53marvintmFixed in Version => RR17Q1
2016-11-04 10:11marvintmStatusclosed => new
2016-11-04 10:11marvintmResolutionfixed => open
2016-11-04 10:11marvintmFixed in VersionRR17Q1 =>
2016-11-04 10:11marvintmStatusnew => scheduled
2016-11-04 10:11marvintmStatusscheduled => resolved
2016-11-04 10:11marvintmFixed in Version => RR17Q1
2016-11-04 10:11marvintmResolutionopen => fixed
2016-11-04 10:11marvintmStatusresolved => closed
2016-11-04 10:11marvintmRelationship addedhas duplicate 0034387
2016-11-04 10:12marvintmStatusclosed => new
2016-11-04 10:12marvintmResolutionfixed => open
2016-11-04 10:12marvintmFixed in VersionRR17Q1 =>
2016-11-04 10:13marvintmStatusnew => scheduled
2016-11-04 10:13marvintmStatusscheduled => resolved
2016-11-04 10:13marvintmResolutionopen => fixed
2016-11-04 10:13marvintmStatusresolved => closed
2016-11-04 10:13marvintmFixed in Version => RR17Q1
2016-11-09 11:47ranjith_qualiantech_comRelationship addedrelated to 0034372
2016-11-16 18:19mario_castelloRegression level => Production - QA Approved
2016-11-16 18:19mario_castelloRegression date => 2016-09-27
2016-11-16 18:19mario_castelloRegression introduced in release => RR16Q3
2016-11-16 18:19mario_castelloRegression introduced by commit => https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/97c95e2c63c9 [^]
2016-12-06 10:54hgbotCheckin
2016-12-06 10:54hgbotNote Added: 0092129
2016-12-09 14:58hgbotCheckin
2016-12-09 14:58hgbotNote Added: 0092250
2016-12-09 15:03OrekariaNote Deleted: 0092129
2016-12-09 15:19hgbotCheckin
2016-12-09 15:19hgbotNote Added: 0092251
2016-12-16 08:40hgbotCheckin
2016-12-16 08:40hgbotNote Added: 0092443

Notes
(0090961)
marvintm   
2016-10-27 15:58   
We have been unable to reproduce the issue with the current code in pi. There have been several fixes in the last days which affected the Save Delete Tickets project, so it's possible that one of them fixed this problem. Can you confirm please?
(0090983)
prakashmurugesan88   
2016-10-28 10:20   
(edited on: 2016-10-28 10:23)
Its working fine for the above mentioned scenario.

But however there is another scenario where similar issue occurs.

Steps to reproduce this issue in live builds,

    Backend:
    Set Preference "Web POS Save Removed Tickets" = "Y".

    POS Terminal:
    create a new receipt.
    Add a product GPS handheld.
    Ensure discount GPS_10_per is applied to the line.
    Pay the receipt.

    From menu select "Verified Returns".
    Select the receipt created above and add all products.
    Now click on thrash icon and confirm deletion of the receipt.
    Shows "Divide by 0" error message.

Suggested Fix:

Please check the attachement(DivedByZeroSuggestedFixScenario2.patch) for suggested fix.

(0091029)
hgbot   
2016-10-31 21:58   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 8eec55651e77c64fb85720d618279c9f01e8e714
Author: Mario Castello <mario.castello <at> peoplewalking.com>
Date: Fri Oct 28 11:22:35 2016 -0600
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/8eec55651e77c64fb85720d618279c9f01e8e714 [^]

Fixed issue 34299: Fixed divide by zero error while deleting verified return with Web POS Save Removed Tickets preference acivated

---
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0091030)
hgbot   
2016-10-31 21:59   
Repository: tools/automation/pi-mobile
Changeset: 1c4a6b8c3b6b02156d92e7c9ac9fd09e0691cdf4
Author: Mario Castello <mario.castello <at> peoplewalking.com>
Date: Fri Oct 28 13:02:10 2016 -0600
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/1c4a6b8c3b6b02156d92e7c9ac9fd09e0691cdf4 [^]

Related to issue 34299: Added automated test I34299_VerifiedReturnsWithDiscountAndSaveRemoveTicket

---
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/returns/I34299_VerifiedReturnsWithDiscountAndSaveRemoveTicket.java
---
(0092250)
hgbot   
2016-12-09 14:58   
Repository: retail/backports/3.0RR16Q4/org.openbravo.retail.posterminal
Changeset: 77ae9fb0ba7de664c844170e8c23ea2eb22be2f7
Author: Rafa Alonso <ral <at> openbravo.com>
Date: Fri Dec 09 14:58:02 2016 +0100
URL: http://code.openbravo.com/retail/backports/3.0RR16Q4/org.openbravo.retail.posterminal/rev/77ae9fb0ba7de664c844170e8c23ea2eb22be2f7 [^]

Related to issue 34388, backport of issue 34299: Fixed divide by zero error while deleting verified return with Web POS Save Removed Tickets preference acivated

---
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0092251)
hgbot   
2016-12-09 15:19   
Repository: retail/backports/3.0RR16Q4/pi-mobile
Changeset: ea0a16cf68d5517550d495a80e336ded449ae38b
Author: Rafa Alonso <ral <at> openbravo.com>
Date: Wed Dec 07 10:36:22 2016 +0100
URL: http://code.openbravo.com/retail/backports/3.0RR16Q4/pi-mobile/rev/ea0a16cf68d5517550d495a80e336ded449ae38b [^]

Fixes issue 34388, backport of issue 34299: Added test

---
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/returns/I34299_VerifiedReturnsWithDiscountAndSaveRemoveTicket.java
---
(0092443)
hgbot   
2016-12-16 08:40   
Repository: tools/automation/pi-mobile
Changeset: ea0a16cf68d5517550d495a80e336ded449ae38b
Author: Rafa Alonso <ral <at> openbravo.com>
Date: Wed Dec 07 10:36:22 2016 +0100
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/ea0a16cf68d5517550d495a80e336ded449ae38b [^]

Fixes issue 34388, backport of issue 34299: Added test

---
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/returns/I34299_VerifiedReturnsWithDiscountAndSaveRemoveTicket.java
---