Openbravo Issue Tracking System - Retail Modules
View Issue Details
0036918Retail ModulesWeb POSpublic2017-09-21 15:272017-10-02 19:52
migueldejuana 
migueldejuana 
normalmajoralways
closedfixed 
5
 
RR17Q4 
marvintm
No
0036918: In Synchronized Mode, doing F5 while and order is being loaded reaches a wrong scenario
In Synchronized Mode, doing F5 while and order is being loaded reaches a wrong scenario.

If we refresh while an order is being processed in a Synchronized Mode we need to do 3 things depending the status of the order:

- If the order is Processed: We need continue, remove the sent order from the UI and update the cashup info.

- If the order is being Processed: We need to wait till it is synchronized, check it continuously.

- If the order gave an Error: Show a modal showing an error and leave the order in the UI to be able to resend it
- Enable Synchronized Mode
- Put a breakpoint in OrderLoader.java
- Do a sale --> Transaction being processed modal is showm
- Refresh the window
- Resume the breakpoint
- ERROR! We have the sent order in the UI but we already processed it. We are able to resend it and we shouldn't
No tags attached.
related to defect 0036790 closed migueldejuana Synchronized mode has problems when the request to the backend reaches timeout 
related to defect 0036987 closed migueldejuana There are still problems in Synchronized mode when the user refreshes the page (F5) 
png Selection_043.png (150,870) 2017-10-01 23:11
https://issues.openbravo.com/file_download.php?file_id=11125&type=bug
png

diff additional_change_checkprocessing.diff (598) 2017-10-01 23:11
https://issues.openbravo.com/file_download.php?file_id=11126&type=bug
Issue History
2017-09-21 15:27migueldejuanaNew Issue
2017-09-21 15:27migueldejuanaAssigned To => migueldejuana
2017-09-21 15:27migueldejuanaTriggers an Emergency Pack => No
2017-09-21 15:27migueldejuanaRelationship addedrelated to 0036790
2017-09-21 15:40migueldejuanaDescription Updatedbug_revision_view_page.php?rev_id=15963#r15963
2017-09-21 15:50hgbotCheckin
2017-09-21 15:50hgbotNote Added: 0099217
2017-09-21 15:50hgbotStatusnew => resolved
2017-09-21 15:50hgbotResolutionopen => fixed
2017-09-21 15:50hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/5c4dc52552ccd74f75542c1c9a9d4f1add8693aa [^]
2017-09-21 15:50hgbotCheckin
2017-09-21 15:50hgbotNote Added: 0099218
2017-09-21 15:50hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/5c4dc52552ccd74f75542c1c9a9d4f1add8693aa [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/2c66d533e1ac98d3d01131482eecbc9ba6602f68 [^]
2017-09-22 14:28marvintmResolution time => 1506636000
2017-09-25 13:29hgbotCheckin
2017-09-25 13:29hgbotNote Added: 0099543
2017-09-25 13:29hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/2c66d533e1ac98d3d01131482eecbc9ba6602f68 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/50ac454e92e09206b1d18a00b54f42b2c4d34f4a [^]
2017-09-26 09:49hgbotCheckin
2017-09-26 09:49hgbotNote Added: 0099572
2017-09-26 09:49hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/50ac454e92e09206b1d18a00b54f42b2c4d34f4a [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/41fc2124602f5ced42746f722de2f5451086a952 [^]
2017-09-26 09:50hgbotCheckin
2017-09-26 09:50hgbotNote Added: 0099573
2017-09-26 09:50hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/41fc2124602f5ced42746f722de2f5451086a952 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/f4608148c9c69a8b22d526f3988d1d6ae59cc499 [^]
2017-09-27 09:11mtaalReview Assigned To => mtaal
2017-10-01 23:11mtaalNote Added: 0099688
2017-10-01 23:11mtaalStatusresolved => new
2017-10-01 23:11mtaalResolutionfixed => open
2017-10-01 23:11mtaalFile Added: Selection_043.png
2017-10-01 23:11mtaalFile Added: additional_change_checkprocessing.diff
2017-10-02 14:45hgbotCheckin
2017-10-02 14:45hgbotNote Added: 0099695
2017-10-02 14:45hgbotStatusnew => resolved
2017-10-02 14:45hgbotResolutionopen => fixed
2017-10-02 14:45hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/f4608148c9c69a8b22d526f3988d1d6ae59cc499 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/bf75c8c9a3e062bbe49926eea786e26f61445b5c [^]
2017-10-02 19:52marvintmReview Assigned Tomtaal => marvintm
2017-10-02 19:52marvintmNote Added: 0099704
2017-10-02 19:52marvintmStatusresolved => closed
2017-10-02 19:52marvintmFixed in Version => RR17Q4
2017-10-02 19:56marvintmRelationship addedrelated to 0036987

Notes
(0099217)
hgbot   
2017-09-21 15:50   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 5c4dc52552ccd74f75542c1c9a9d4f1add8693aa
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Thu Sep 21 15:13:10 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/5c4dc52552ccd74f75542c1c9a9d4f1add8693aa [^]

Fixed issue 0036918: In Synchronized Mode, doing F5 while and order is being loaded reaches a wrong scenario

- Send inSender parameter in serviceError to know more info from the error. "timeout" or "0" as server is down.
- Add a condition to the SynchronizingDialog to ensure that we control when is show and when is hidden (as we do with showLoading)
- Save the messageId while the transaction is processing, remove it when it is processed

---
M web/org.openbravo.mobile.core/source/data/ob-datasource.js
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---
(0099218)
hgbot   
2017-09-21 15:50   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 2c66d533e1ac98d3d01131482eecbc9ba6602f68
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Thu Sep 21 15:21:58 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/2c66d533e1ac98d3d01131482eecbc9ba6602f68 [^]

Fixed issue 0036918: In Synchronized Mode, doing F5 while and order is being loaded reaches a wrong scenario

- Add a check CheckProcessingMessage to know the status of the processing message after doing a refresh
- Add CheckProcessingMessage to the services list
- Handle the possible cases:

    * If the order is Processed: We need continue, remove the sent order from the UI and update the cashup info.
    * If the order is being Processed: We need to wait till it is synchronized, check it continuously.
    * If the order gave an Error: Show a modal showing an error and leave the order in the UI to be able to resend it

---
M src-db/database/sourcedata/OBMOBC_SERVICES.xml
M web/org.openbravo.retail.posterminal/js/login/model/login-model.js
A src/org/openbravo/retail/posterminal/CheckProcessingMessage.java
---
(0099543)
hgbot   
2017-09-25 13:29   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 50ac454e92e09206b1d18a00b54f42b2c4d34f4a
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Mon Sep 25 13:11:16 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/50ac454e92e09206b1d18a00b54f42b2c4d34f4a [^]

Fixed issue 0036918: In Synchronized Mode, doing F5 while and order is being loaded reaches a wrong scenario

- Improve the query performance. Filter by import entry archive id because it is the same of messageId
- Add an else option when checking the processing message to ensure that we do not get blocked.

---
M src/org/openbravo/retail/posterminal/CheckProcessingMessage.java
M web/org.openbravo.retail.posterminal/js/login/model/login-model.js
---
(0099572)
hgbot   
2017-09-26 09:49   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 41fc2124602f5ced42746f722de2f5451086a952
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Mon Sep 25 17:17:38 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/41fc2124602f5ced42746f722de2f5451086a952 [^]

Fixed issue 0036918: In Synchronized Mode, doing F5 while and order is being loaded reaches a wrong scenario

- Do no execute doPostSynchronizedCallActions because it can be executed before the process in the backend has finished

---
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---
(0099573)
hgbot   
2017-09-26 09:50   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: f4608148c9c69a8b22d526f3988d1d6ae59cc499
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Mon Sep 25 17:33:07 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/f4608148c9c69a8b22d526f3988d1d6ae59cc499 [^]

Fixed issue 0036918: In Synchronized Mode, doing F5 while and order is being loaded reaches a wrong scenario

- Add a function lo load an order by id from orderlist
- Send to frontend the json to ensure that we delete the processed order

---
M web/org.openbravo.retail.posterminal/js/login/model/login-model.js
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0099688)
mtaal   
2017-10-01 23:11   
I get a js error when an order has already been processed. See attached screenshot. The data.json field is undefined. When I check the java code of CheckProcessingMessage I don't see any place where it is set. I tried a change to set the json (see attached diff). This works. Can you review and push it?
(0099695)
hgbot   
2017-10-02 14:45   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: bf75c8c9a3e062bbe49926eea786e26f61445b5c
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Mon Oct 02 12:18:14 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/bf75c8c9a3e062bbe49926eea786e26f61445b5c [^]

Fixed issue 0036918: In Synchronized Mode, doing F5 while and order is being loaded reaches a wrong scenario

- Add the missing attribute json

---
M src/org/openbravo/retail/posterminal/CheckProcessingMessage.java
---
(0099704)
marvintm   
2017-10-02 19:52   
There are still two cases which are not working completely for me right now:
- If I do F5 while in the middle of the processing of the order, I get the popup again (correct), but if then the OrderLoader finishes, on the next retry I get a javascript error in the console, and the receipt is not removed from the UI (wrong):

985f177adb2d112341363d73f496088d.js:3076 TypeError: Cannot read property 'get' of undefined
    at 985f177adb2d112341363d73f496088d.js:37250
    at processResult (985f177adb2d112341363d73f496088d.js:4412); line: Object.OB.UTIL.showError (http://localhost:8080/openbravo/web/js/gen/985f177adb2d112341363d73f496088d.js:11975:6 [^]) (*,+)


(Related to the OB.UTIL.calculateCurrentCash function, and particularly this line:

OB.Dal.findInTransaction(tx, OB.Model.PaymentMethodCashUp, {
        'cashup_id': cashUp.at(0).get('id')

- If I do F5 while in the middle of the processing of the order, but then I process the order while the Web POS is still loading, then the popup is shown (wrong), and it never goes away until I refresh the page again.


However, we are closing this issue and keeping track of these problems in separate issue.