|View Issue Details|
|Type||Category||Severity||Reproducibility||Date Submitted||Last Update|
|defect||[Retail Modules] Gift cards and gift vouchers||major||always||2021-10-14 18:29||2021-10-29 07:40|
|Priority||urgent||Resolution||fixed||Fixed in Version||RR22Q1|
|Status||closed||Fix in branch||Fixed in SCM revision|
|OS Version||Database version||Ant version|
|Product Version||SCM revision|
|Review Assigned To||marvintm|
|Regression introduced in release|
|Regression introduced by commit|
|Triggers an Emergency Pack||No|
0047854: Error trying to pay a ticket with Credit Notes after multiple Cancel and Replace executions
|Description||When a ticket had originally some payments and the Cancel and Replace process is executed, the new ticket contains a 'Cancelled' payment with the amount paid originally. The payment method of this cancelled payment matches the original payment method, although no other details (paymentData or other extra fields) are transferred to the cancelled payment.|
|Steps To Reproduce||In an environment with the Giftcards module installed and Credit Notes configured (e.g. livebuilds modules instance, YS-11 terminal):|
1) Create a new ticket and add a product.
Click on the product line, and then on the EDIT tab, click on Return Line
Go to the payments tab, select Credit Notes, and finish the ticket. This will create a new Credit Note in the system.
2) Create another ticket and add a product
Click on the total amount button, select Credit Notes as payment method, and pay with the CN created in step 1. Finish the ticket
3) Load the ticket created in 2, go to the Menu > Cancel and Replace, click on the total amount button and click on Done without any other change.
4) Load the ticket created in step 3 (the ticket will have the same docNo as the one created in (2), with a "-1" at the end.
Verify that the ticket contains a payment, labelled as cancelled.
Click again on Menu > Cancel and replace.
Add a second unit of the same product
Click on the total amount button, and try to pay the remaining amount again with Credit Notes. The following error will appear in the console and the upper right corner:
OBDAL error: TypeError: Cannot read properties of undefined (reading 'groupingCriteria');
* Steps 3 and 4 can be simplified if Prepayments and/or Delivery modes are configured on the terminal: instead of executing a second cancel and replace, add the extra unit during the first CR, and leave the amount unpaid. Then load the "-1" and complete the payment.
|Proposed Solution||The postAddPayment hook defined on the Giftcards module assume that all Credit notes payments contain a paymentData object, which is not true.|
Simply add the "... && payment.get('paymentData') && ..." condition to skip not valid payments.
 https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.giftcards/-/blob/master/web/org.openbravo.retail.giftcards/js/hooks/postaddpaymenthook.js [^]
|Tags||No tags attached.|
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.giftcards/-/merge_requests/100 [^]
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/446 [^]
Merge request closed: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/446 [^]
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.giftcards/-/merge_requests/100 [^]
Fixed by the following commit:
|2021-10-14 18:29||aaroncalero||New Issue|
|2021-10-14 18:29||aaroncalero||Assigned To||=> Retail|
|2021-10-14 18:29||aaroncalero||Triggers an Emergency Pack||=> No|
|2021-10-25 08:26||marvintm||Status||new => scheduled|
|2021-10-25 08:26||marvintm||Assigned To||Retail => justin_patterson|
|2021-10-25 18:06||hgbot||Note Added: 0132621|
|2021-10-25 18:24||hgbot||Note Added: 0132623|
|2021-10-26 11:40||hgbot||Note Added: 0132637|
|2021-10-29 07:38||hgbot||Note Added: 0132724|
|2021-10-29 07:40||marvintm||Note Added: 0132725|
|2021-10-29 07:40||marvintm||Status||scheduled => resolved|
|2021-10-29 07:40||marvintm||Fixed in Version||=> RR22Q1|
|2021-10-29 07:40||marvintm||Resolution||open => fixed|
|2021-10-29 07:40||marvintm||Review Assigned To||=> marvintm|
|2021-10-29 07:40||marvintm||Status||resolved => closed|
|Copyright © 2000 - 2009 MantisBT Group|