Openbravo Issue Tracking System - Retail Modules
View Issue Details
0036803Retail ModulesWeb POSpublic2017-09-07 10:472017-09-08 15:08
marvintm 
ranjith_qualiantech_com 
normalmajorhave not tried
closedfixed 
5
 
RR17Q4 
marvintm
No
0036803: Pay Open Tickets doesn't handle correctly the case of a receipt failing some check in the PreOrderSave hook
There is a problem when using Pay Open Tickets, if one of the tickets fails in the middle of completion, when using synchronized mode.

The problem can be reproduced when using Digital Coupons, but most likely can also happen with any other module that uses the PreOrderSave hook and cancels the process.
- Install digital coupons, and configure Synchronized mode
- Log in the Web POS, and create three layaways.
- Execute Pay Open Tickets, and select the three layaways.
- Add the same digital coupon twice (can be achieved by using the scanner to scan the same coupon)
- Add the rest of the payment in cash
- Click on DONE. The process will start, and at some point you will get an error message explaining that the same coupon was added twice.
- Click on DONE again, without doing any changes. Instead of seeing the same error message, some of the orders will be synchronized to the backend (the ones paid using cash), and the Web POS will navigate to the main page, without showing any order. <- This is wrong.
- If you then refresh the page, you will see the missing ticket, with its payments intact, but still not synchronized to the backend.
The cause of this problem is that in dataordersave.js, inside the multiOrdersFunction flow, the multiorder variable me.ordersToSend is incremented when initially the process is executed, but then when it fails it's not reset to 0, so the next time the process is called, instead of starting in 0, it starts in a different position, which causes the runSyncProcess call to be executed too early.

The solution is just to reset this variable when the process is started again.
No tags attached.
Issue History
2017-09-07 10:47marvintmNew Issue
2017-09-07 10:47marvintmAssigned To => Retail
2017-09-07 10:47marvintmTriggers an Emergency Pack => No
2017-09-07 10:48marvintmResolution time => 1505944800
2017-09-07 10:54marvintmProposed Solution updated
2017-09-07 11:31ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2017-09-07 11:31ranjith_qualiantech_comStatusnew => scheduled
2017-09-07 14:00hgbotCheckin
2017-09-07 14:00hgbotNote Added: 0098888
2017-09-07 14:00hgbotStatusscheduled => resolved
2017-09-07 14:00hgbotResolutionopen => fixed
2017-09-07 14:00hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/c390dfed1e4f5638c6b5035d407da4a595bd1171 [^]
2017-09-08 15:08marvintmReview Assigned To => marvintm
2017-09-08 15:08marvintmStatusresolved => closed
2017-09-08 15:08marvintmFixed in Version => RR17Q4

Notes
(0098888)
hgbot   
2017-09-07 14:00   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: c390dfed1e4f5638c6b5035d407da4a595bd1171
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Thu Sep 07 17:29:54 2017 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/c390dfed1e4f5638c6b5035d407da4a595bd1171 [^]

Fixed issue 36803 : Reset ordersToSend while Completing Multi Orders

---
M web/org.openbravo.retail.posterminal/js/data/dataordersave.js
---