Openbravo Issue Tracking System - Retail Modules
View Issue Details
0037448Retail ModulesCash uppublic2017-12-11 15:172017-12-20 19:10
aaroncalero 
jorge-garcia 
highmajoralways
closedfixed 
5
 
RR18Q1 
marvintm
No
0037448: RebuildCashUpFromServer doesn't handle correctly network errors
If the OB.UTIL.rebuildCashupFromServer function fails because the connection has been interrupted momentarily, it might happen that a new unprocessed cashup is generated in addition to the existing cashup.
Log in in backend, go to the preferences window and enable the Web POS Synchronized Mode preference.
Verify in POS Terminal window that there is only one unprocessed cashup for the VBS-1 terminal.
Log in in web pos (VBS-1 terminal).
Create a new ticket and add some products.
Click on the total amount button to go to the payment tab.
Open developer tools and add the following breakpoints:
One inside the OB.UTIL.rebuildCashupFromServer function. (cashUpReportUtils.js)
One inside the serviceError function. (ob-datasource.js)
Add a payment and click on Done.
The code will stop on the OB.UTIL.rebuildCashupFromServer breakpoint.
Disconnect the network.
Continue the code flow. The code will stop on the serviceError breakpoint.
Connect the network again and then continue the flow.
The ticket will be correctly synchronized.

Log in again in backend and verify on the POS Terminal window that there are now 2 unprocessed cashups for the VBS-1 terminal.
If the OB.UTIL.rebuildCashupFromServer function fails with an exception (which is different from returning 0 cashups) or with a connection error, it should show the error to the user and it should stop the workflow.
No tags attached.
Issue History
2017-12-11 15:17aaroncaleroNew Issue
2017-12-11 15:17aaroncaleroAssigned To => Retail
2017-12-11 15:17aaroncaleroResolution time => 1514156400
2017-12-11 15:17aaroncaleroTriggers an Emergency Pack => No
2017-12-12 15:09jorge-garciaStatusnew => scheduled
2017-12-12 15:09jorge-garciaAssigned ToRetail => jorge-garcia
2017-12-19 10:25hgbotCheckin
2017-12-19 10:25hgbotNote Added: 0101121
2017-12-19 10:25hgbotStatusscheduled => resolved
2017-12-19 10:25hgbotResolutionopen => fixed
2017-12-19 10:25hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/4411cad18c262adcd858941b4657a7ac59c4672e [^]
2017-12-19 10:25hgbotCheckin
2017-12-19 10:25hgbotNote Added: 0101122
2017-12-19 10:25hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/4411cad18c262adcd858941b4657a7ac59c4672e [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/79e43cc4018cbb37d0f4d4765715e93628222bb6 [^]
2017-12-20 19:10marvintmReview Assigned To => marvintm
2017-12-20 19:10marvintmStatusresolved => closed
2017-12-20 19:10marvintmFixed in Version => RR18Q1

Notes
(0101121)
hgbot   
2017-12-19 10:25   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 4411cad18c262adcd858941b4657a7ac59c4672e
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Thu Dec 14 16:52:43 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/4411cad18c262adcd858941b4657a7ac59c4672e [^]

Fixed issue 37448: RebuildCashUpFromServer doesn't handle correctly
network errors

The solution is to handle network errors as a transaction failure in synchronize
mode.

To do so, the synchErrorCallback implementation has been moved to a new
global function and used in case a network error is raised.

---
M web/org.openbravo.retail.posterminal/js/data/dataordersave.js
M web/org.openbravo.retail.posterminal/js/utils/cashUpReportUtils.js
---
(0101122)
hgbot   
2017-12-19 10:25   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 79e43cc4018cbb37d0f4d4765715e93628222bb6
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Fri Dec 15 13:56:52 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/79e43cc4018cbb37d0f4d4765715e93628222bb6 [^]

Fixed issue 37448: RebuildCashUpFromServer doesn't handle correctly
network errors

The solution is to handle network errors as a transaction failure in synchronize
mode.

This commits implements only the part for network problem in multiorders.

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