Openbravo Issue Tracking System - Retail Modules
View Issue Details
0042603Retail ModulesWeb POSpublic2019-12-18 18:542019-12-20 09:32
ngarcia 
ranjith_qualiantech_com 
urgentmajoralways
closedfixed 
5
 
RR20Q1 
marvintm
No
0042603: If a payment is modified in OBPOS_postAddPayment and the POS is refreshed (F5) that change is lost
If a payment is modified in OBPOS_postAddPayment and the POS is refreshed (F5) that change is lost
In the POS:
   Open the developers tools of the browser
   Add the following code in the console:
      OB.UTIL.HookManager.registerHook('OBPOS_postAddPayment', function(args, callbacks) {
    args.paymentAdded.set('newproperty', true);
    OB.UTIL.HookManager.callbackExecutor(args, callbacks);
});
   Create a new receipt
   Add a payment to it
   Check the 'newproperty' is present in the payment by
      OB.MobileApp.model.receipt.attributes.payments.models[0].attributes
   Push F5
   Check the 'newproperty' is not present in the payment by
      OB.MobileApp.model.receipt.attributes.payments.models[0].attributes
   Complete the receipt and check the JSON is sent without newproperty
Change the logic of saving the ticket after the hook:

if (saveChanges && !payment.get('changePayment')) {
   order.adjustPayment();
   order.trigger('displayTotal');
   order.save();
   order.trigger('saveCurrent');
}
No tags attached.
causes defect 0042671 closed ranjith_qualiantech_com Save on PostAddPaymentHook breaks custom functionality 
Issue History
2019-12-18 18:54ngarciaNew Issue
2019-12-18 18:54ngarciaAssigned To => Retail
2019-12-18 18:54ngarciaResolution time => 1578438000
2019-12-18 18:54ngarciaTriggers an Emergency Pack => No
2019-12-18 18:54ngarciaIssue Monitored: networkb
2019-12-19 12:35ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2019-12-20 03:19ranjith_qualiantech_comStatusnew => scheduled
2019-12-20 03:39hgbotCheckin
2019-12-20 03:39hgbotNote Added: 0116447
2019-12-20 03:39hgbotStatusscheduled => resolved
2019-12-20 03:39hgbotResolutionopen => fixed
2019-12-20 03:39hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/3b75f505153444ce248669df317b4702da2330cf [^]
2019-12-20 09:32marvintmReview Assigned To => marvintm
2019-12-20 09:32marvintmStatusresolved => closed
2019-12-20 09:32marvintmFixed in Version => RR20Q1
2020-01-02 08:54guillermogilRelationship addedcauses 0042671

Notes
(0116447)
hgbot   
2019-12-20 03:39   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 3b75f505153444ce248669df317b4702da2330cf
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Fri Dec 20 08:08:45 2019 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/3b75f505153444ce248669df317b4702da2330cf [^]

Fixed issue 42603 : Order should be saved after OBPOS_postAddPayment hook completed

---
M web/org.openbravo.retail.posterminal/js/model/order.js
---