Openbravo Issue Tracking System - Retail Modules
View Issue Details
0039857Retail ModulesWeb POSpublic2018-12-27 12:442019-01-07 17:04
joniturralde93 
ranjith_qualiantech_com 
urgentmajoralways
closedfixed 
5
pi 
piRR19Q2 
guilleaer
No
0039857: If there is an error doing a cash management, there is no rollback of changed cashup data.
An error happens when inserting cash management: The cash management process failed to execute successfully. Please contact your system administrator.

But the cashup was already updated and no rollback is done. Cashup shows amount as if the cash management was completed.

This results in inconsistences:
-Difference in cashup report (POS) and cashup report (backoffice)
-Payment Method Status Cashup total different from Payment Method Cashup Events total.

This happened to a gold customer in a random way, and has happened other times producing incorrect cashup data.
Since we could not reproduce it the same way, we did this:

1. Log into POS Terminal: https://livebuilds.openbravo.com/retail_pi_pgsql/web/org.openbravo.retail.posterminal/?terminal=VBS-1 [^]
2. Do a cashup.
3. Open developer tools and set a breakpoint in the following line:
    currentTransaction.executeSql(sql, params, silentFunction(successFunction), processError);
4. Do a cash management: Deposit 4000 in cash. Click done.
5. Debug and check when sql parameter is 'INSERT INTO cashmanagement...' and get the cashmanagement_id value.
6. Do another cash management: Deposit 4000 in cash. Click done.
7. Now, when sql parameter is 'INSERT INTO cashmanagement...' stop the execution and change cashmanagement_id value to the previous one so we can get an error (duplicated id). In the console: params[0]='previous cashmanagement id';
8. Continue the execution; an error is thrown: The cash management process failed to execute successfully. Please contact your system administrator.
9. There is an error doing the cash management, but the cashup data is updated anyway.
10. Do a cashup: Remaining -8.000.

You can check in backoffice:
11. Channel - Touchpoint -> Cash Up History -> Payment Method Status Cashup: Cashup total deposits: 8000
12. However, Payment Method Cashup Events only has one record: Amount 4000
13. Cash Up Report from backoffice shows DEPOSIT Cash - Backoffice transfer to VBS: 4,000.00
No tags attached.
Issue History
2018-12-27 12:44joniturralde93New Issue
2018-12-27 12:44joniturralde93Assigned To => Retail
2018-12-27 12:44joniturralde93Resolution time => 1547679600
2018-12-27 12:44joniturralde93Triggers an Emergency Pack => No
2019-01-02 12:02ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2019-01-02 12:03ranjith_qualiantech_comStatusnew => scheduled
2019-01-07 16:04hgbotCheckin
2019-01-07 16:04hgbotNote Added: 0108841
2019-01-07 16:09hgbotCheckin
2019-01-07 16:09hgbotNote Added: 0108842
2019-01-07 16:09hgbotStatusscheduled => resolved
2019-01-07 16:09hgbotResolutionopen => fixed
2019-01-07 16:09hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/9603cad2b028d0cfaf3155868611a440d276db68 [^]
2019-01-07 17:04guilleaerReview Assigned To => guilleaer
2019-01-07 17:04guilleaerStatusresolved => closed
2019-01-07 17:04guilleaerFixed in Version => RR19Q2

Notes
(0108841)
hgbot   
2019-01-07 16:04   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 1da2bb7c9184d74f93af5da112f65c9960b3ac83
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Mon Jan 07 20:34:39 2019 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/1da2bb7c9184d74f93af5da112f65c9960b3ac83 [^]

Related to issue 39857 : Added transaction to DAL Save method in Cash Managament functions

---
M web/org.openbravo.retail.posterminal/js/utils/cashUpReportUtils.js
---
(0108842)
hgbot   
2019-01-07 16:09   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 9603cad2b028d0cfaf3155868611a440d276db68
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Mon Jan 07 20:39:21 2019 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/9603cad2b028d0cfaf3155868611a440d276db68 [^]

Fixed issue 39857 : Value true must be returned in WEBSQL Transaction Error callback handler

* If no value is returned or false is returned, execution will be continue with next execution
  If true is returned in error callback, transaction will be reverted

---
M web/org.openbravo.mobile.core/source/data/ob-dal.js
---