Openbravo Issue Tracking System - Retail Modules
View Issue Details
0039264Retail ModulesWeb POSpublic2018-08-03 15:012018-09-18 18:16
marvintm 
migueldejuana 
highmajoralways
closedfixed 
5
 
RR18Q3.1RR18Q3.1 
marvintm
No
0039264: In some circumstances, cashup may be synchronized twice and the second one generates entry in "Errors while importing POS data"
In some circumstances, the cashup may be synchronized twice. The first time it will be processed correctly, but the second time detects that the cashup was already processed, and therefore generates an Error while importing POS Data.

- Go to the cashup window.
- Go through all steps to complete the cashup.
- Before clicking on "Post, print and close" button, add a breakpoint in the client side, in the line:

"OB.RR.ServTypeFailover.implementation(service, request);"

- Click on the button. Flow will continue until the line with the breakpoint.
- Execute that line, but not the rest of the flow. The request will be done, and the cashup will be processed in the backend. This is correct.
- Then, press F5, or close the browser, and then access the WebPOS again.
- Once you have logged in, you will see that the cashup has already been sent again, and this time it has failed.

Real customers are reproducing this problem very rarely, with slow computers, and by closing the browser before the process to complete the cashup has been fully executed.
The problem is that the generation of the message and the deletion of the cashup is still not fully transactional.

We need to make sure that both the message generation and the cashup deletion are executed in the same database transaction, but also before the request is triggered, because otherwise there is a risk that the deletion may not happen before the request is done, and even if the message is not generated, the cashup has already arrived to the backend, and should have already been removed from the client side.
No tags attached.
blocks defect 0039092 closed migueldejuana In some circumstances, cashup may be synchronized twice and the second one generates entry in "Errors while importing POS data" 
Issue History
2018-09-11 14:50migueldejuanaTypedefect => backport
2018-09-11 14:50migueldejuanaTarget Version => RR18Q3.1
2018-09-11 14:54hgbotCheckin
2018-09-11 14:54hgbotNote Added: 0106682
2018-09-11 14:54hgbotStatusscheduled => resolved
2018-09-11 14:54hgbotResolutionopen => fixed
2018-09-11 14:54hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/39a43eb397a2761a529ba95c417bf1c5c14008a9 [^] => http://code.openbravo.com/retail/backports/3.0RR18Q3.1/org.openbravo.retail.posterminal/rev/1875838e4ce4c243131597184d95cc355a96b52a [^]
2018-09-11 14:54hgbotCheckin
2018-09-11 14:54hgbotNote Added: 0106683
2018-09-11 14:54hgbotFixed in SCM revisionhttp://code.openbravo.com/retail/backports/3.0RR18Q3.1/org.openbravo.retail.posterminal/rev/1875838e4ce4c243131597184d95cc355a96b52a [^] => http://code.openbravo.com/retail/backports/3.0RR18Q3.1/org.openbravo.mobile.core/rev/17c1ad8af5b1e9beaff3832b8e1ecd9cf32fa9d4 [^]
2018-09-18 18:16marvintmStatusresolved => closed
2018-09-18 18:16marvintmFixed in Version => RR18Q3.1

Notes
(0106682)
hgbot   
2018-09-11 14:54   
Repository: retail/backports/3.0RR18Q3.1/org.openbravo.retail.posterminal
Changeset: 1875838e4ce4c243131597184d95cc355a96b52a
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Tue Sep 11 14:53:55 2018 +0200
URL: http://code.openbravo.com/retail/backports/3.0RR18Q3.1/org.openbravo.retail.posterminal/rev/1875838e4ce4c243131597184d95cc355a96b52a [^]

Fixed issue 0039264: In some circumstances, cashup may be synchronized twice and the second one generates entry in "Errors while importing POS data"

- Define a removeSyncedElemsCallback to deleteCashups tables in cashup model.
- Make synchronous the deleteCashups function
- Allow to pass last cashup to initCashup createNewCashup function. Add a function createPaymentMethods which includes existing code

---
M web/org.openbravo.retail.posterminal/js/login/model/login-model.js
M web/org.openbravo.retail.posterminal/js/utils/cashUpReportUtils.js
---
(0106683)
hgbot   
2018-09-11 14:54   
Repository: retail/backports/3.0RR18Q3.1/org.openbravo.mobile.core
Changeset: 17c1ad8af5b1e9beaff3832b8e1ecd9cf32fa9d4
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Tue Sep 11 14:52:03 2018 +0200
URL: http://code.openbravo.com/retail/backports/3.0RR18Q3.1/org.openbravo.mobile.core/rev/17c1ad8af5b1e9beaff3832b8e1ecd9cf32fa9d4 [^]

Fixed issue 0039264: In some circumstances, cashup may be synchronized twice and the second one generates entry in "Errors while importing POS data"

- Ensure that we do not send messages till we fully finished transaction (create message/remove model). Only for non persistent
- Allow to execute removeSyncedElemsCallback for a model which defines this
- Do not forget to execute generic removeSyncedElemsCallback to continue with the rest of models
- Wait to sendMessages just for models coming from runSyncProcess
- Execute callback(sendMessages) also for persistent models

---
M web/org.openbravo.mobile.core/source/data/ob-datasource.js
M web/org.openbravo.mobile.core/source/data/ob-requestrouter.js
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---