Openbravo Issue Tracking System - Retail Modules
View Issue Details
0039092Retail ModulesWeb POSpublic2018-08-03 15:012018-09-11 14:50
marvintm 
migueldejuana 
highmajoralways
closedfixed 
5
 
 
marvintm
No
0039092: 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.
depends on backport 0039264RR18Q3.1 closed migueldejuana In some circumstances, cashup may be synchronized twice and the second one generates entry in "Errors while importing POS data" 
related to defect 0038969 closed ranjith_qualiantech_com If a cashup with an approval is executed twice, an error is raised due to an ID duplication 
Issue History
2018-08-03 15:01marvintmNew Issue
2018-08-03 15:01marvintmAssigned To => Retail
2018-08-03 15:01marvintmTriggers an Emergency Pack => No
2018-08-03 15:01marvintmResolution time => 1534716000
2018-08-06 09:15ngarciaIssue Monitored: ngarcia
2018-08-16 08:27marvintmResolution time1534716000 => 1535320800
2018-08-21 10:07hgbotCheckin
2018-08-21 10:07hgbotNote Added: 0106421
2018-08-21 10:07hgbotStatusnew => resolved
2018-08-21 10:07hgbotResolutionopen => fixed
2018-08-21 10:07hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/02b3aa0a2c01c6cb807c9b28b96f1b68fbea711c [^]
2018-08-21 10:07hgbotCheckin
2018-08-21 10:07hgbotNote Added: 0106422
2018-08-21 10:07hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/02b3aa0a2c01c6cb807c9b28b96f1b68fbea711c [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/91f14846d4cf7dc50acd987405ef7d266bf46b05 [^]
2018-08-21 10:08hgbotCheckin
2018-08-21 10:08hgbotNote Added: 0106423
2018-08-21 10:08hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/91f14846d4cf7dc50acd987405ef7d266bf46b05 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/6f58c90947b2d45b69a0ed1b24fa101c9abb52d9 [^]
2018-08-21 10:08hgbotCheckin
2018-08-21 10:08hgbotNote Added: 0106424
2018-08-21 10:08hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/6f58c90947b2d45b69a0ed1b24fa101c9abb52d9 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/742d9d729e52c627394fc98138f1e350c87ba459 [^]
2018-08-21 10:08hgbotCheckin
2018-08-21 10:08hgbotNote Added: 0106425
2018-08-21 10:08hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/742d9d729e52c627394fc98138f1e350c87ba459 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/39a43eb397a2761a529ba95c417bf1c5c14008a9 [^]
2018-08-21 15:15marvintmAssigned ToRetail => migueldejuana
2018-08-23 12:16marvintmReview Assigned To => marvintm
2018-08-23 12:16marvintmStatusresolved => closed
2018-08-23 12:16marvintmFixed in Version => RR18Q4
2018-08-27 14:52ngarciaRelationship addedrelated to 0038969
2018-09-11 14:50migueldejuanaStatusclosed => new
2018-09-11 14:50migueldejuanaResolutionfixed => open
2018-09-11 14:50migueldejuanaFixed in VersionRR18Q4 =>
2018-09-11 14:50migueldejuanaStatusnew => scheduled
2018-09-11 14:50migueldejuanaStatusscheduled => resolved
2018-09-11 14:50migueldejuanaResolutionopen => fixed
2018-09-11 14:50migueldejuanaStatusresolved => closed

Notes
(0106421)
hgbot   
2018-08-21 10:07   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 02b3aa0a2c01c6cb807c9b28b96f1b68fbea711c
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Fri Aug 10 12:00:18 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/02b3aa0a2c01c6cb807c9b28b96f1b68fbea711c [^]

Fixed issue 0039092: 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

---
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
---
(0106422)
hgbot   
2018-08-21 10:07   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 91f14846d4cf7dc50acd987405ef7d266bf46b05
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Tue Aug 14 10:12:58 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/91f14846d4cf7dc50acd987405ef7d266bf46b05 [^]

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

- Allow to execute removeSyncedElemsCallback for a model which defines this
- Do not forget to execute generic removeSyncedElemsCallback to continue with the rest of models

---
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---
(0106423)
hgbot   
2018-08-21 10:08   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 6f58c90947b2d45b69a0ed1b24fa101c9abb52d9
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Mon Aug 20 12:36:14 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/6f58c90947b2d45b69a0ed1b24fa101c9abb52d9 [^]

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

- Wait to sendMessages just for models coming from runSyncProcess

---
M web/org.openbravo.mobile.core/source/data/ob-requestrouter.js
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---
(0106424)
hgbot   
2018-08-21 10:08   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 742d9d729e52c627394fc98138f1e350c87ba459
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Mon Aug 20 17:24:00 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/742d9d729e52c627394fc98138f1e350c87ba459 [^]

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

- Execute callback(sendMessages) also for persistent models

---
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---
(0106425)
hgbot   
2018-08-21 10:08   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 39a43eb397a2761a529ba95c417bf1c5c14008a9
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Tue Aug 14 10:22:52 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/39a43eb397a2761a529ba95c417bf1c5c14008a9 [^]

Fixed issue 0039092: 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
---