Openbravo Issue Tracking System - Retail Modules
View Issue Details
0038847Retail ModulesWeb POSpublic2018-06-27 13:472018-07-26 10:03
guilleaer 
guilleaer 
normalminorhave not tried
closedfixed 
5
 
RR18Q4 
marvintm
No
0038847: Wrong asynchrony point in in cash managment process
Wrong asynchrony point in in cash managment process

file: cashmgmt.js
line: 172 & 184

this.model.get('cashMgmtDropEvents').on('click', function (model) {
  this.model.depsdropstosave.trigger('paymentDone', model,
  this.currentPayment);
  delete this.currentPayment;
}, this);

delete this.currentPayment -> is being executed after trigger, but trigger is creating asynchrony. This is wrong.

delete this.currentPayment should be executed when trigger execution really finishes. To do that trigger admits a callbacf function as a parameter. Is there where the instruction should be executed.
Add this log

      OB.info('[CashMgmnt] Items to be processed (Apart from new one): ' + JSON.stringify(this.model.depsdropstosave.models.map(function (item) {
        return item.get('id') + ' Amount: ' + item.get('amount') + ' origAmount: ' + item.get('origAmount') + ' currency: ' + item.get('isocode') + ' paymentMethodId: ' + item.get('paymentMethodId') + ' cashup_id: ' + item.get('cashup_id')
      })));

just before

delete this.currentPayment;

You will se that log will show that the cash managment action is not already added
No tags attached.
related to defect 0038848 closed guilleaer Poor log for cash management process 
diff 38847_PI.diff (4,290) 2018-06-28 17:21
https://issues.openbravo.com/file_download.php?file_id=11909&type=bug
diff 38847_2_PI.diff (1,186) 2018-07-02 14:06
https://issues.openbravo.com/file_download.php?file_id=11919&type=bug
Issue History
2018-06-27 13:47guilleaerNew Issue
2018-06-27 13:47guilleaerAssigned To => Retail
2018-06-27 13:47guilleaerTriggers an Emergency Pack => No
2018-06-28 15:27guilleaerRelationship addedrelated to 0038848
2018-06-28 16:01egoitzIssue Monitored: egoitz
2018-06-28 17:20guilleaerAssigned ToRetail => guilleaer
2018-06-28 17:20guilleaerStatusnew => scheduled
2018-06-28 17:21guilleaerFile Added: 38847_PI.diff
2018-06-28 17:42guilleaerResolution time => 1531951200
2018-07-02 14:06guilleaerFile Added: 38847_2_PI.diff
2018-07-04 14:12hgbotCheckin
2018-07-04 14:12hgbotNote Added: 0105572
2018-07-04 14:12hgbotStatusscheduled => resolved
2018-07-04 14:12hgbotResolutionopen => fixed
2018-07-04 14:12hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/3c658d4c71ce95f1e520f743635820a3cee2adec [^]
2018-07-26 10:03marvintmReview Assigned To => marvintm
2018-07-26 10:03marvintmStatusresolved => closed
2018-07-26 10:03marvintmFixed in Version => RR18Q4

Notes
(0105572)
hgbot   
2018-07-04 14:12   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 3c658d4c71ce95f1e520f743635820a3cee2adec
Author: Guillermo Alvarez de Eulate <guillermo.alvarez <at> openbravo.com>
Date: Wed Jul 04 14:09:16 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/3c658d4c71ce95f1e520f743635820a3cee2adec [^]

Fixed issue 38847: Fixed some asynchrony points in cash managment process

---
M web/org.openbravo.retail.posterminal/js/cashmgmt/model/cashmgmt-model.js
M web/org.openbravo.retail.posterminal/js/cashmgmt/view/cashmgmt.js
---