Openbravo Issue Tracking System - POS2
View Issue Details
0047547POS2POSpublic2021-08-13 10:262021-09-03 11:39
jmelin 
AtulOpenbravo 
highmajoralways
closedfixed 
5
 
 
approved
Gold
No
0047547: JIRA 2277 - Overpayment with CRT and Cash generate a credit note
When we have an overpayment with the following paymeny moe
- payment mode as credit note
- payment mode as cash

We generate both cashback and credit notes
In BO, for the touchpoint type, we have:

a payment mode A defined as "cash"

a payment mode B defined as "Return overpayment as Credit note"

On the till,
Create an order of 15€ for example
Pay 10€ with payment mode B
Pay 10€ with payment mode A

So we have an overpayment that should be given back in cash.
On the screen, we have a cash back of 5€, but it also generate a credit note of 5€

We should have first a cash back as much of possible in cash and then credit note of the left to refund
No tags attached.
depends on backport 0047555TAP closed Retail JIRA 2277 - Overpayment with CRT and Cash generate a credit note 
related to defect 0047587 closed AtulOpenbravo JIRA 2298 - Overpayment with cash and credit note applies on credit note instead of cash 
related to defect 0047586 closed vmromanos JIRA 2297 - Generation through overpayment and payment amount in BO 
Issue History
2021-08-13 10:26jmelinNew Issue
2021-08-13 10:26jmelinAssigned To => Retail
2021-08-13 10:26jmelinOBNetwork customer => Gold
2021-08-13 10:26jmelinTriggers an Emergency Pack => No
2021-08-16 12:07guilleaerStatusnew => acknowledged
2021-08-16 12:08guilleaerResolution time => 1630274400
2021-08-16 12:08guilleaerStatusacknowledged => scheduled
2021-08-16 12:08guilleaerAssigned ToRetail => AtulOpenbravo
2021-08-30 11:00dmiguelezRegression date => 2021-09-01
2021-08-30 11:01dmiguelezRegression date2021-09-01 =>
2021-08-30 11:02dmiguelezRelationship addedrelated to 0047587
2021-08-30 11:02dmiguelezRelationship addedrelated to 0047586
2021-08-31 16:31hgbotMerge Request Status => open
2021-08-31 16:31hgbotNote Added: 0131462
2021-08-31 16:48AtulOpenbravoNote Added: 0131463
2021-09-02 23:44hgbotMerge Request Statusopen => approved
2021-09-03 11:39hgbotResolutionopen => fixed
2021-09-03 11:39hgbotStatusscheduled => closed
2021-09-03 11:39hgbotNote Added: 0131548
2021-09-03 11:39hgbotNote Added: 0131549
2021-09-03 11:39hgbotNote Added: 0131550
2021-09-03 11:39hgbotNote Added: 0131551
2021-09-03 11:39hgbotNote Added: 0131552
2021-09-03 11:39hgbotNote Added: 0131553
2021-09-03 11:39hgbotNote Added: 0131554

Notes
(0131462)
hgbot   
2021-08-31 16:31   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.giftcards/-/merge_requests/83 [^]
(0131463)
AtulOpenbravo   
2021-08-31 16:48   
Test Plan

- In BO, for the touchpoint type, we have:

- Payment mode "Cash" defined with Cash flag = Yes
- Payment mode "Voucher" defined with "Return overpayment as Credit note" = Yes

- Using POS2, Create an ticket of 15€ for example
- Pay 10€ with payment mode = Voucher
- Pay 10€ with payment mode = Cash

- Check in BackOffice,

Ticket is paid with below payments
- Voucher payment method: 10€
- Cash payment method: 5€
(0131548)
hgbot   
2021-09-03 11:39   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.giftcards [^]
Changeset: 31ed4a022dee3010eb690e25b9c66d929c5fd634
Author: Atul Gaware <atul.gaware@openbravo.com>
Date: 2021-09-03T13:39:38+05:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.giftcards/-/commit/31ed4a022dee3010eb690e25b9c66d929c5fd634 [^]

Fixes BUG-0047547: JIRA 2277 - Overpayment with CRT and Cash generate
a credit note

**Get cash paid amount from the ticket payments, based on total
amount and paid amount calculate overpaid amount, check if
cash amount is returnable instead of going for credit note
generation.

---
M web-jspack/org.openbravo.retail.giftcards/src/model/ticket/CreditNoteTicketExtension.js
---
(0131549)
hgbot   
2021-09-03 11:39   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.giftcards [^]
Changeset: 41ee0a809d7374a85212c235838bb7bb140fc42c
Author: Atul Gaware <atul.gaware@openbravo.com>
Date: 2021-09-03T13:39:38+05:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.giftcards/-/commit/41ee0a809d7374a85212c235838bb7bb140fc42c [^]

Related To BUG-0047547: JIRA 2277 - Overpayment with CRT and Cash generate
a credit note

**Hide Return Overpayment as Credit Note flag for Cash Payment
Methods in Touchpoint Type Payment Method Configuration.
**Set Return Overpayment as Credit Note flag as No when user
sets IsCash flag from No to Yes leaving the flag Return
Overpayment as Credit Note flag Yes.

---
A src/org/openbravo/retail/giftcards/event/GCNVTerminalTypePaymentMethodEventHandler.java
M src-db/database/sourcedata/AD_FIELD.xml
---
(0131550)
hgbot   
2021-09-03 11:39   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.giftcards [^]
Changeset: c7ceef6d58786ab7ee73bde84e0cda25a9d57c9f
Author: Atul Gaware <atul.gaware@openbravo.com>
Date: 2021-09-03T13:39:39+05:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.giftcards/-/commit/c7ceef6d58786ab7ee73bde84e0cda25a9d57c9f [^]

Related To BUG-0047547: JIRA 2277 - Overpayment with CRT and Cash generate
a credit note

**Handle multiple cash payment methods, consider lastly paid cash
payment for cash back.

---
M web-jspack/org.openbravo.retail.giftcards/src/model/ticket/CreditNoteTicketExtension.js
---
(0131551)
hgbot   
2021-09-03 11:39   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.giftcards [^]
Changeset: 4254d617196ab6a33731502b310daecdf6a1be01
Author: Atul Gaware <atul.gaware@openbravo.com>
Date: 2021-09-03T13:39:39+05:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.giftcards/-/commit/4254d617196ab6a33731502b310daecdf6a1be01 [^]

Related To BUG-0047547: JIRA 2277 - Overpayment with CRT and Cash generate
a credit note

**Fix tests adding isCash flag, rate info in payment payload,
OB.DEC.mul method/function.

---
M web-jspack/org.openbravo.retail.giftcards/src/model/ticket/__test__/CreditNoteTicketExtension.test.jsx
---
(0131552)
hgbot   
2021-09-03 11:39   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.giftcards [^]
Changeset: acfbb293fe6d984de794f61bdc480c915c36f9db
Author: Atul Gaware <atul.gaware@openbravo.com>
Date: 2021-09-03T13:39:39+05:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.giftcards/-/commit/acfbb293fe6d984de794f61bdc480c915c36f9db [^]

Related To BUG-0047547: JIRA 2277 - Overpayment with CRT and Cash generate
a credit note

**Cash back / Cash payment needs to be adjusted only if overPaid is
greater than zero as well as there is cashPaid Amount.

---
M web-jspack/org.openbravo.retail.giftcards/src/model/ticket/CreditNoteTicketExtension.js
---
(0131553)
hgbot   
2021-09-03 11:39   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.giftcards [^]
Changeset: 73a6abcd38de851e884f22a8c43fb41a101662ab
Author: Atul Gaware <atul.gaware@openbravo.com>
Date: 2021-09-03T14:24:57+05:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.giftcards/-/commit/73a6abcd38de851e884f22a8c43fb41a101662ab [^]

Related To BUG-0047547: JIRA 2277 - Overpayment with CRT and Cash generate
    a credit note

**fix credit note payment amount as -ve as the change for
46874

---
M web-jspack/org.openbravo.retail.giftcards/src/model/ticket/__test__/CreditNoteTicketExtension.test.jsx
---
(0131554)
hgbot   
2021-09-03 11:39   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.giftcards/-/merge_requests/83 [^]