Openbravo Issue Tracking System - Retail Modules
View Issue Details
0036324Retail ModulesWeb POSpublic2017-06-23 12:412017-09-21 16:49
JONHM 
asiermartirena 
highmajoralways
closedfixed 
5
 
RR17Q4 
marvintm
No
0036324: Error doing cancel and replace of an already paid and returned receipt
Having a receipt which has been paid, returned and invoiced, there is an error while importing when trying to cancel and replace that receipt.
*Login with vallblanca user In WebPos:
1) Create a new receipt for 'Avalanche transceiver' product and set the 'Invoice this receipt' flag as YES. Finish the payment.
2) Return that receipt: Click on 'Verified returns' and select the previous receipt. Also set the 'Invoice this receipt' flag as YES and finish the return.
3) Cancel and replace the first receipt: Open the tab 'Receipts' and select the previously created receipt. Then, set the 'Invoice this receipt' flag as YES and finish the process.

**In the backend
4) Open window 'Errors While Importing POS Data' and see the related error
The problem is caused because the 'generateShipment' property should be set as 'false', but in this case this is not happening because of this lines of pointofsale-model.js file:

if (_.isUndefined(_.find(receipt.get('lines').models, function (line) {
                var qty = line.get('qty') ? line.get('qty') : 0,
                    remainingQuantity = line.get('remainingQuantity') ? line.get('remainingQuantity') : 0;
                return (qty > 0 && qty > remainingQuantity) || (qty < 0 && qty < remainingQuantity);
              }))) {
                receipt.set('generateShipment', false);
              }

The quantity should be compared with the 'deliveredQuantity' instead of 'remainingQuantity'
No tags attached.
? errorCancReplace.mp4 (4,360,248) 2017-06-23 12:41
https://issues.openbravo.com/file_download.php?file_id=10866&type=bug
Issue History
2017-06-23 12:41JONHMNew Issue
2017-06-23 12:41JONHMAssigned To => Retail
2017-06-23 12:41JONHMFile Added: errorCancReplace.mp4
2017-06-23 12:41JONHMResolution time => 1499983200
2017-06-23 12:41JONHMTriggers an Emergency Pack => No
2017-06-26 10:20ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2017-06-26 10:20ranjith_qualiantech_comStatusnew => scheduled
2017-06-27 09:19ranjith_qualiantech_comAssigned Toranjith_qualiantech_com => Retail
2017-06-27 09:19ranjith_qualiantech_comStatusscheduled => acknowledged
2017-06-27 09:29asiermartirenaAssigned ToRetail => asiermartirena
2017-08-14 09:31hgbotCheckin
2017-08-14 09:31hgbotNote Added: 0098494
2017-08-14 09:31hgbotStatusacknowledged => resolved
2017-08-14 09:31hgbotResolutionopen => fixed
2017-08-14 09:31hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/b7733f310ef6887e968162da0803e857df11ba0a [^]
2017-08-14 09:33hgbotCheckin
2017-08-14 09:33hgbotNote Added: 0098495
2017-08-14 09:34hgbotCheckin
2017-08-14 09:34hgbotNote Added: 0098496
2017-08-18 09:44marvintmReview Assigned To => marvintm
2017-08-18 09:44marvintmStatusresolved => closed
2017-08-18 09:44marvintmFixed in Version => RR17Q4
2017-09-21 16:49hudsonbotCheckin
2017-09-21 16:49hudsonbotNote Added: 0099310

Notes
(0098494)
hgbot   
2017-08-14 09:31   
Repository: erp/devel/pi
Changeset: b7733f310ef6887e968162da0803e857df11ba0a
Author: Asier Martirena <asier.martirena <at> openbravo.com>
Date: Mon Jul 17 18:28:09 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/b7733f310ef6887e968162da0803e857df11ba0a [^]

Fixed issue 36324: Error doing cancel and replace of an already paid and returned receipt.

Also changed the C&R process to work correctly with invoices. Now, after doing a C&R, the lines that were delivered in the initial ticket creates also an invoice line, even if the line doesn't have a goods shipment related.
Managed also the C&R properties. If a netting shipment is created, all invoice lines now has a shipment related, and if the shipment lines are moved from the original ticket to the new ticket, the original invoice lines (if there are) don't have related shipment lines no more and the new invoice lines will be related to the moved shipment lines.

---
M src/org/openbravo/erpCommon/businessUtility/CancelAndReplaceUtils.java
---
(0098495)
hgbot   
2017-08-14 09:33   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: e048e6e1f7f6fd3cdc542f1a2c883281be43b524
Author: Asier Martirena <asier.martirena <at> openbravo.com>
Date: Wed Jul 19 17:11:31 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/e048e6e1f7f6fd3cdc542f1a2c883281be43b524 [^]

Related to issue 36324: Error doing cancel and replace of an already paid and returned receipt.

Also changed the C&R process to work correctly with invoices. Now, after doing a C&R, the lines that were delivered in the initial ticket creates also an invoice line, even if the line doesn't have a goods shipment related.
Managed also the C&R properties. If a netting shipment is created, all invoice lines now has a shipment related, and if the shipment lines are moved from the original ticket to the new ticket, the original invoice lines (if there are) don't have related shipment lines no more and the new invoice lines will be related to the moved shipment lines.

---
M src/org/openbravo/retail/posterminal/OrderLoader.java
M web/org.openbravo.retail.posterminal/js/pointofsale/model/pointofsale-model.js
---
(0098496)
hgbot   
2017-08-14 09:34   
Repository: tools/automation/pi-mobile
Changeset: 316929778a5299a286497ed64516b9999da313ad
Author: Asier Martirena <asier.martirena <at> openbravo.com>
Date: Mon Jul 17 18:39:42 2017 +0200
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/316929778a5299a286497ed64516b9999da313ad [^]

Related to issue 36324: Automated tests

---
M src-test/org/openbravo/test/mobile/retail/pack/selenium/terminals/WebPOSCancelAndReplaceTerminalHelper.java
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/cancelandreplace/I36324_CancelAndRplcInvOrdWithPrefAssociateShipToNewOrd_AddLne.java
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/cancelandreplace/I36324_CancelAndRplcInvOrdWithPrefAssociateShipToNewOrd_AddQty.java
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/cancelandreplace/I36324_CancelAndRplcInvOrdWithPrefNettingGoodShpmnt_AddLne.java
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/cancelandreplace/I36324_CancelAndRplcInvOrdWithPrefNettingGoodShpmnt_AddQty.java
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/cancelandreplace/I36324_CancelAndRplcInvOrdWithReturn_AddProd.java
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/cancelandreplace/I36324_CancelAndRplcInvOrd_AddQtyAndProd.java
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/cancelandreplace/I36324_CancelAndRplcLayawayByInvoicing.java
---
(0099310)
hudsonbot   
2017-09-21 16:49   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/9750b78d3e5c [^]
Maturity status: Test