Openbravo Issue Tracking System - Retail Modules
View Issue Details
0057339Retail ModulesGift cards and gift voucherspublic2024-12-02 08:332024-12-19 09:11
william_vermersch 
aaroncalero 
highmajorhave not tried
closedinvalid 
5
RR20Q3 
 
No
0057339: Credit note transaction reverted in case of error, but payment is not removed
Hello, it seems it is possible to open multiple times the credit note consumption popin.

It is then possible to click on "Consume/Apply" multiple times to consume more than what is "possible to consume" on the credit note.

This is causing an issue, credit note with amount inferior to the total amount can be used to paid entirely the order.
1. Add products, Go to payment
2. Select credit note as payment method + Click on Enter
3. In the popin (with low latency, low processing) scan multiple time a credit note number
 => To make it easier scan it, wait that the list is loaded, delete the value in the search field, scan it again
4. It should open 2 popins (or X popins if you're fast enough)
5. Click on Apply
The issue is not reproducible every time, this is my hypothesis of what can happen.

What is happening every time is the second "Consume" call is throwing an error on the server side (expected): GCNV_ErrorGiftCardClosed

Then a new call to revert the transaction is made in the POS code, for that part there are 2 cases:

1. A error is thrown on the server => GCNV_ErrorGiftCardTransactionNotExists (seems OK)
2. No error is thrown on the server (I don't know why) => The transaction is deleted from the credit note, BUT the payment is not remove from the POS, allowing to consume again the credit note.

We couldn't reproduce it on the prepoduction environment, or local ones, only production ones.

Potential solutions:

1. Forbid to open multiple times the details gift card/credit note popin (if one was opened before and not closed)
2. In the previous specific case, when revertCreditNoteTransaction is coming back without issue => Remove the payment from the POS (the main issue is probably here)


No tags attached.
Issue History
2024-12-02 08:33william_vermerschNew Issue
2024-12-02 08:33william_vermerschAssigned To => Retail
2024-12-02 08:33william_vermerschTriggers an Emergency Pack => No
2024-12-11 15:52guilleaerNote Added: 0173181
2024-12-12 12:33aaroncaleroNote Added: 0173234
2024-12-12 12:33aaroncaleroAssigned ToRetail => william_vermersch
2024-12-12 12:33aaroncaleroStatusnew => feedback
2024-12-12 14:00william_vermerschNote Added: 0173239
2024-12-16 18:13william_vermerschStatusfeedback => new
2024-12-16 18:13william_vermerschAssigned Towilliam_vermersch => aaroncalero
2024-12-19 09:11aaroncaleroNote Added: 0173490
2024-12-19 09:11aaroncaleroStatusnew => closed
2024-12-19 09:11aaroncaleroResolutionopen => invalid

Notes
(0173181)
guilleaer   
2024-12-11 15:52   
Requested more info through a private conversation
(0173234)
aaroncalero   
2024-12-12 12:33   
It seems there was a related issue over a year ago https://issues.openbravo.com/view.php?id=53317 [^]

William, could you check if this was backported into the client's code? And it if is, can you check if the code has been modified/reverted after it was backported?
(0173239)
william_vermersch   
2024-12-12 14:00   
Hi Aaron,

The fix is present and not modified:

https://gitlab.com/openbravo/customers/WELDOM/org.openbravo.retail.giftcards/-/blob/weldom-master/web/org.openbravo.retail.giftcards/js/components/GiftCardDialog.js [^]

I thinks this fix was to prevent the multiple click on a giftcard line (which was an issue at that time), here it seems that if you search a gift card (with its complete number) it is automatically opening the popin, and by having some latency you can open it multiple time by repeating the operation.
(0173490)
aaroncalero   
2024-12-19 09:11   
As commented through private chat, since this can only be reproduced in a specific client environment, it should be reported through Jira so we can manage it through the appropriate issue buffer for that client