Openbravo Issue Tracking System - Retail Modules
View Issue Details
0045184Retail ModulesWeb POSpublic2020-10-05 08:462020-11-18 12:21
rafael_salmean 
jorge-garcia 
normalmajoralways
closedno change required 
5
 
 
jorge-garcia
No
0045184: Unsafe division may cause division by 0
One of our clients has encountered a situation where the till crashes and a cache refresh is needed.

After some research, a division by 0 was found and a failsafe was put in place.

Solution discussed directly with Antonio Moreno.
Added diff file as proposed solution.
No tags attached.
diff order.diff (807) 2020-10-05 08:46
https://issues.openbravo.com/file_download.php?file_id=15003&type=bug
Issue History
2020-10-05 08:46rafael_salmeanNew Issue
2020-10-05 08:46rafael_salmeanAssigned To => Retail
2020-10-05 08:46rafael_salmeanFile Added: order.diff
2020-10-05 08:46rafael_salmeanTriggers an Emergency Pack => No
2020-11-16 12:35rafael_salmeanSummaryDeleting a Kept Ticket with discounts blocks Web POS => Unsafe division may cause division by 0
2020-11-16 12:35rafael_salmeanDescription Updatedbug_revision_view_page.php?rev_id=21889#r21889
2020-11-16 12:35rafael_salmeanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=21891#r21891
2020-11-16 12:35rafael_salmeanProposed Solution updated
2020-11-16 12:38rafael_salmeanResolution time => 1607295600
2020-11-17 16:10jorge-garciaAssigned ToRetail => jorge-garcia
2020-11-17 16:54jorge-garciaStatusnew => scheduled
2020-11-18 12:21jorge-garciaReview Assigned To => jorge-garcia
2020-11-18 12:21jorge-garciaNote Added: 0124478
2020-11-18 12:21jorge-garciaStatusscheduled => closed
2020-11-18 12:21jorge-garciaResolutionopen => no change required

Notes
(0124478)
jorge-garcia   
2020-11-18 12:21   
After discussing with reporter:

OB Product's API (PaidReceipts.java) to load ticket from backoffice does not load those lines from the ticket that are marked as deleted (obposIsDeleted field in db). As these lines are not loaded, the problem reported in this issue could not happened in standard product.

For customer code, two different options we can provide:
  1) Do not load the obposisdeletedLines as PaidReceipts does right now
  2) In case those lines are required to be loaded in WebPOS, instead of adding all loaded lines to the lines of the ticket, set lines mark as obposIsDeleted to the deletedLines array of the ticket.