Openbravo Issue Tracking System - Retail Modules
View Issue Details
0035311Retail ModulesWeb POSpublic2017-02-20 16:202017-03-14 17:20
aaroncalero 
mario_castello 
normalminoralways
closedfixed 
5
 
RR17Q2 
marvintm
No
0035311: Changes done to the receipt on the OBPOS_PreOrderSave hook are not saved using multiorders
The OBPOS_PreOrderSave hook can be used to modify ticket properties just before the ticket is synchronized to the server.
After all the hook executions have finished, the order's json attribute is updated (using the serializeToJSON method) and all these modifications are saved.
During the multiorders flow, however, the call to serializeToJSON is placed before the call to the OBPOS_PreOrderSave hook, so any modification done to the receipt object on the hooks is never saved.
Login in web pos
Using the browser console, implement the following hook:
OB.UTIL.HookManager.registerHook('OBPOS_PreOrderSave', function (args, callback) {
  args.receipt.set('description', 'test description');
  OB.UTIL.HookManager.callbackExecutor(args, callback);
});
Create a ticket and pay it using the standard flow and verify that the description is correctly shown in backend after the ticket is synchronized.
Create a ticket and pay it using the multiorders flow and verify that the description is NOT shown in backend after the ticket is synchronized.
Attached a patch that moves the call to currentReceipt.serializeToJSON to the callback of the preordersave hook on the multiorders flow.
No tags attached.
diff Issue35311.diff (797) 2017-02-20 16:21
https://issues.openbravo.com/file_download.php?file_id=10467&type=bug
Issue History
2017-02-20 16:20aaroncaleroNew Issue
2017-02-20 16:20aaroncaleroAssigned To => Retail
2017-02-20 16:20aaroncaleroResolution time => 1488754800
2017-02-20 16:20aaroncaleroTriggers an Emergency Pack => No
2017-02-20 16:21aaroncaleroFile Added: Issue35311.diff
2017-02-20 18:56mario_castelloAssigned ToRetail => mario_castello
2017-02-20 18:56mario_castelloStatusnew => acknowledged
2017-02-20 19:14mario_castelloStatusacknowledged => scheduled
2017-03-07 16:15hgbotCheckin
2017-03-07 16:15hgbotNote Added: 0094799
2017-03-07 16:15hgbotStatusscheduled => resolved
2017-03-07 16:15hgbotResolutionopen => fixed
2017-03-07 16:15hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/2f43cffd88a61f15e427056e5b71660062345045 [^]
2017-03-14 17:20marvintmReview Assigned To => marvintm
2017-03-14 17:20marvintmStatusresolved => closed
2017-03-14 17:20marvintmFixed in Version => RR17Q2

Notes
(0094799)
hgbot   
2017-03-07 16:15   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 2f43cffd88a61f15e427056e5b71660062345045
Author: Mario Castello <mario.castello <at> peoplewalking.com>
Date: Mon Feb 20 12:02:01 2017 -0600
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/2f43cffd88a61f15e427056e5b71660062345045 [^]

Fixed issue 0035311: Changes done to the receipt on the OBPOS_PreOrderSave hook are not saved using multiorders

- Moves the call to currentReceipt.serializeToJSON to the callback of the preordersave hook on the multiorders flow.

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