Openbravo Issue Tracking System - Retail Modules
View Issue Details
0027904Retail ModulesWeb POSpublic2014-10-17 14:332015-01-15 19:27
naiaramartinez 
mario_castello 
normalmajorhave not tried
closedfixed 
5
 
pi 
Orekaria
No
0027904: Weird behaviour in lines when executing preorderSave hook and it stops the synchronization
When the shyncronziation is stopped (using args.cancellation=true in PreOrderSave Hook), and trying to continue with the synchronization of the order... the lines that were in the order are not taken into account, and the price of those lines become 0.
PreorderSave hook is used to validate the data of the lines. Imagine, when selling 'gift cards and vouchers' before saving and creating the instance of the GC/Voucher, it is nice to have a validation to check if the ID is in used for another GC/Voucher or not.

In the case of the ID is in used for another GC/Voucher, the synchronization should be stopped, the user should change the ID of the voucher and user should be able to continue with the synchronization. But this behaviour is not working correctly.

Steps to reproduce:

Install 'gift cards and vouchers' module, and apply the patch is attached to the issue.

Login as 'The White Valley Group Admin'.
Go to Products and select 'Alpine skiing backpack 27 L'. Open it in form view and modify the following information:
    - gift Card Type: Gift voucher
    - Grouped Product: No

Login in the webPOs and create a new order. Add 'Alpine skiing backpack 27 L' to the order. In the popup write in ID field: 1
Pay and complete the order.


Now, open the develpers tool and uncomment the following code:
// gcids.push({
// gcid: '1'
// });

The previous code is adding the code 1 to the list of ids to check in the backend if it is already in use. Since we create a voucher with id 1, now that the code is uncommented, the preOrderSave won't do the synchronization with the backend.


Create a new order. Add 'Alpine skiing backpack 27 L' and in the ID write something different to 1 (in the previous code is already writing 1). Pay it and see that an error is shown because the id 1 is already in use.

Notice that 'Done' button is disabled (this could be another issue).
Then, click again in the line and notice that 'done' button is enabled again. Click in 'Done' button and notice that the price of 'Alpine skiing backpack 27 L', the tax amount, the total amount... all of them are 0. Using this hook, we should be able to fix the data (in this case the ID of the voucher) and be able to process the order, but there is a bug that is not allowing to continue with the process.


No tags attached.
related to defect 0027864 closed Orekaria Closing a Layaway adds a new blank receipt to the pile with no reason 
diff PreOrderSaveHookError.diff (10,402) 2014-10-17 14:33
https://issues.openbravo.com/file_download.php?file_id=7390&type=bug
Issue History
2014-10-17 14:33naiaramartinezNew Issue
2014-10-17 14:33naiaramartinezAssigned To => marvintm
2014-10-17 14:33naiaramartinezFile Added: PreOrderSaveHookError.diff
2014-10-17 14:33naiaramartinezTriggers an Emergency Pack => No
2015-01-09 19:37mario_castelloAssigned Tomarvintm => mario_castello
2015-01-09 19:37mario_castelloStatusnew => scheduled
2015-01-09 19:37mario_castellofix_in_branch => pi
2015-01-12 16:29malsasuaRelationship addedrelated to 0027864
2015-01-13 15:15hgbotCheckin
2015-01-13 15:15hgbotNote Added: 0073460
2015-01-13 15:15hgbotStatusscheduled => resolved
2015-01-13 15:15hgbotResolutionopen => fixed
2015-01-13 15:15hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/f2e1ff005d0ddc043bc30043c06a141f917651f0 [^]
2015-01-15 19:27OrekariaReview Assigned To => Orekaria
2015-01-15 19:27OrekariaStatusresolved => closed
2015-01-15 19:27OrekariaFixed in Version => pi

Notes
(0073460)
hgbot   
2015-01-13 15:15   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: f2e1ff005d0ddc043bc30043c06a141f917651f0
Author: Mario Castello <mario.castello <at> peoplewalking.com>
Date: Tue Jan 13 08:13:40 2015 -0600
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/f2e1ff005d0ddc043bc30043c06a141f917651f0 [^]

fixed issue 27904: Weird behaviour in lines when executing preorderSave hook and it stops the synchronization

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