Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0037436
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Web POSmajorhave not tried2017-12-05 16:202018-01-18 18:33
ReporteraaroncaleroView Statuspublic 
Assigned Toranjith_qualiantech_com 
PrioritynormalResolutionfixedFixed in VersionRR18Q2
StatusclosedFix in branchFixed in SCM revision5d2c8347e44c
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tomarvintm
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0037436: The cancellation of the OBPOS_PreOrderSave hook is not correctly handled in Pay Open Tickets

DescriptionThe cancellation of the OBPOS_PreOrderSave hook is not handled correctly in Pay Open Tickets. Depending on which ticket cancels the hook, it might leave the previous tickets saved in websql with the hasbeenpaid attribute to 'Y', but not synchronized, making it impossible to update them afterwards.
This can lead to cashup differences if the payments change between synchronization retries (because the "locked" ticket won't be updated).
Steps To ReproduceLogin in web pos.
Create two tickets in draft and add products to both of them.
Go to the Menu > Pay Open Tickets and select the tickets created in the first step.
Open the browser console and execute the following:
OB.MobileApp.model.attributes.permissions["OBMOBC_SynchronizedMode"] = true
OB.FAILCONDITION = true
OB.FAILDOCNO = the_documentNo_of_the_second_ticket
OB.UTIL.HookManager.registerHook('OBPOS_PreOrderSave', function(a,b){
  if(OB.FAILCONDITION && a.receipt.get('documentNo') === OB.FAILDOCNO){
    OB.MobileApp.model.hideSynchronizingDialog();
    a.cancellation = true;
  }
  OB.UTIL.HookManager.callbackExecutor(a,b);
})

Add a full payment in Card and click on Done. The process will stop because of the hook.
Remove the Card payment.
Add a full payment in Voucher.
Execute the following in the browser console:
OB.FAILCONDITION = false;

Click on the Done button again. This time the hook will not cancel the execution and the tickets will be synchronized, although the following error will appear in the console:
[checkBlocked][no-transaction][hasbeenpaid_is_yes] Wrong write in c_order avoided.

Load both tickets again in WebPOS:
The first ticket will be paid with Card (although the card payment was completely removed).
The second ticket will be paid with Voucher.
TagsNo tags attached.
Attached Filespatch file icon issue 37436 posterminal.patch [^] (1,096 bytes) 2018-01-02 16:09 [Show Content]
patch file icon issue 37436 test.patch [^] (5,572 bytes) 2018-01-02 16:09 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
depends on backport 0037674RR18Q1 closedranjith_qualiantech_com The cancellation of the OBPOS_PreOrderSave hook is not correctly handled in Pay Open Tickets 

-  Notes
(0100952)
hgbot (developer)
2017-12-11 08:32

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 556a2d5cde71d730aaad67bd86e0cea47985fa92
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Mon Dec 11 13:02:05 2017 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/556a2d5cde71d730aaad67bd86e0cea47985fa92 [^]

Fixed issue 37436 : Restore Receipt and Payments on PreOrderSave hook cancel

* In Pay open tickets, if PreOrderSave hook is cancelled then receipts and payments should be restored with original values

---
M web/org.openbravo.retail.posterminal/js/data/dataordersave.js
---
(0101174)
marvintm (manager)
2017-12-20 18:47

The current fix doesn't work. I've managed to reproduce the problem with the steps to reproduce specified in the issue.

The problem is that when there is a hook which cancels the processing of the a ticket different from the first, the first ticket already has payments assigned to it, and this should be reset, so that when the process is completed again, the payments are correctly distributed among all orders again.
(0101593)
hgbot (developer)
2018-01-05 12:54

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 8e28db8bf44e47756d6f4e18457d03f71d105902
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Fri Jan 05 17:24:09 2018 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/8e28db8bf44e47756d6f4e18457d03f71d105902 [^]

Fixed issue 37436 : Restore Receipt and Payments in Pay Open Tickets on PreOrderSave hook cancel

* In Pay open tickets, if PreOrderSave hook is cancelled then receipts and payments should be restored with original values

---
M web/org.openbravo.retail.posterminal/js/data/dataordersave.js
---
(0101594)
hgbot (developer)
2018-01-05 12:55

Repository: tools/automation/pi-mobile
Changeset: e63759b420d33ae9c78e94dbf521ffd3a921f272
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Fri Jan 05 17:25:04 2018 +0530
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/e63759b420d33ae9c78e94dbf521ffd3a921f272 [^]

Verifies issue 37436 : Added automated test 'I37436_VerifyReceiptOnPreSaveHook'

---
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/receipts/I37436_VerifyReceiptOnPreSaveHook.java
---
(0101618)
marvintm (manager)
2018-01-08 12:06

The fix is still not fully correct. After following steps to reproduce, the payment for the first ticket is still with Card, and not Voucher, even though the Card payment was fully reverted.
(0101740)
hgbot (developer)
2018-01-17 09:54

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 5d2c8347e44c29bd53a4130dbb341602d46a1695
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Wed Jan 17 14:24:15 2018 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/5d2c8347e44c29bd53a4130dbb341602d46a1695 [^]

Fixed issue 37436 : Refactored MultiOrder Close function

* Hook PreOrderSave will be validated for all receipts and then receipt sync process will be started

---
M web/org.openbravo.retail.posterminal/js/data/dataordersave.js
---
(0101741)
hgbot (developer)
2018-01-17 09:54

Repository: tools/automation/pi-mobile
Changeset: 089d85a5cae4a7f61a585438d70e16651db2b556
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Wed Jan 17 14:24:35 2018 +0530
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/089d85a5cae4a7f61a585438d70e16651db2b556 [^]

Verifies issue 37436 : Modified automated test 'I37436_VerifyReceiptOnPreSaveHook'

---
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/receipts/I37436_VerifyReceiptOnPreSaveHook.java
---

- Issue History
Date Modified Username Field Change
2017-12-05 16:20 aaroncalero New Issue
2017-12-05 16:20 aaroncalero Assigned To => Retail
2017-12-05 16:20 aaroncalero Resolution time => 1513638000
2017-12-05 16:20 aaroncalero Triggers an Emergency Pack => No
2017-12-07 15:00 ranjith_qualiantech_com Assigned To Retail => ranjith_qualiantech_com
2017-12-07 15:00 ranjith_qualiantech_com Status new => scheduled
2017-12-11 08:32 hgbot Checkin
2017-12-11 08:32 hgbot Note Added: 0100952
2017-12-11 08:32 hgbot Status scheduled => resolved
2017-12-11 08:32 hgbot Resolution open => fixed
2017-12-11 08:32 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/556a2d5cde71d730aaad67bd86e0cea47985fa92 [^]
2017-12-20 18:47 marvintm Note Added: 0101174
2017-12-20 18:47 marvintm Status resolved => new
2017-12-20 18:47 marvintm Resolution fixed => open
2017-12-21 07:06 ranjith_qualiantech_com Status new => scheduled
2018-01-02 16:09 ranjith_qualiantech_com File Added: issue 37436 posterminal.patch
2018-01-02 16:09 ranjith_qualiantech_com File Added: issue 37436 test.patch
2018-01-05 12:54 hgbot Checkin
2018-01-05 12:54 hgbot Note Added: 0101593
2018-01-05 12:54 hgbot Status scheduled => resolved
2018-01-05 12:54 hgbot Resolution open => fixed
2018-01-05 12:54 hgbot Fixed in SCM revision http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/556a2d5cde71d730aaad67bd86e0cea47985fa92 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/8e28db8bf44e47756d6f4e18457d03f71d105902 [^]
2018-01-05 12:55 hgbot Checkin
2018-01-05 12:55 hgbot Note Added: 0101594
2018-01-08 12:06 marvintm Note Added: 0101618
2018-01-08 12:06 marvintm Status resolved => new
2018-01-08 12:06 marvintm Resolution fixed => open
2018-01-17 07:57 ranjith_qualiantech_com Status new => scheduled
2018-01-17 09:54 hgbot Checkin
2018-01-17 09:54 hgbot Note Added: 0101740
2018-01-17 09:54 hgbot Status scheduled => resolved
2018-01-17 09:54 hgbot Resolution open => fixed
2018-01-17 09:54 hgbot Fixed in SCM revision http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/8e28db8bf44e47756d6f4e18457d03f71d105902 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/5d2c8347e44c29bd53a4130dbb341602d46a1695 [^]
2018-01-17 09:54 hgbot Checkin
2018-01-17 09:54 hgbot Note Added: 0101741
2018-01-18 18:32 marvintm Status resolved => new
2018-01-18 18:32 marvintm Resolution fixed => open
2018-01-18 18:32 marvintm Status new => scheduled
2018-01-18 18:32 marvintm Status scheduled => resolved
2018-01-18 18:32 marvintm Fixed in Version => RR18Q2
2018-01-18 18:32 marvintm Resolution open => fixed
2018-01-18 18:33 marvintm Review Assigned To => marvintm
2018-01-18 18:33 marvintm Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker