Openbravo Issue Tracking System - Retail Modules
View Issue Details
0047625Retail ModulesWeb POSpublic2021-09-02 20:092021-10-20 08:03
lbressan 
ranjith_qualiantech_com 
highmajoralways
closedfixed 
5
RR20Q3.4 
RR22Q1 
No
0047625: The customer remains in debt after making a return with the purchase of a new product for the same amount (Order Amount 0) being
The customer is left with debt after making a return with purchase.
-The new product is configured with Delivery Mode: Pick Up in Store / Image: D2dev-Product
-The client is configured with Invoice Term: After Delivery. The client has no debt / Image: D1dev-BP
The client should not have debt since the new product was acquired in replacement of the original product and for the same amount.

Observation:
This issue is replicated if the new product has a different delivery mode than Pick & Carry.

Openbravo3.0 PR20Q3.4
Version number:3.0.203401
1.A Pick & Carry product is sold from the POS. The total is paid, the order and corresponding invoice are generated.
Images: D3dev-Venta, D4dev-Back-SO, D5dev-Back-SI

2.From the POS, the return of the product purchased in the previous step is made through the Verified Return option and a product is selected for the same amount with Delivery Mode PickUpInStore.
Images: D6dev-VerifiedReturn, D7dev-VerifiedReturnCompraMismoMonto-ProdPickUpInStore

The SO is generated for the return / purchase, leaving the new product pending delivery / invoicing.
Images: D8dev-Back-SO, D9dev-Back-SI

3. From Backoffice, the new product is delivered.
Images: D10dev-Back-GSfromOrder

4. From Backoffice, the invoice is made from the delivery of the delivery made in the previous step.
Images: D11dev-Back-SIfromGS

5. From Backoffice, the client is consulted and it is observed that he has a debt corresponding to the new product.
Images: D12dev-BPcon Debt


Livebuilds Video: https://drive.google.com/file/d/1X8bt_dhOY6JW0wUmxl3yEpUIQqYPl2JE/view?usp=sharing [^]

Steps to reproduce in livebuilds
Backoffice
Business Partner - Mara Palliot - Update Invoice Terms to "After Delivery"
POS
Incremental Refresh
1) Add Product A and Complete it - Ticket A
2) Return the above product using Verified Return - Ticket B
3) Add same product (Product A) in Ticket B and update the delivery mode as pickup in store
4) Now, we have 2 lines (1st line - Verified Returned Product A, 2nd Line - Product A with pickup in store)
5) Total is Zero. Complete it
Backoffice
1) Check Order Status. Delivery Status will be 50%. Invoice Status will be 50%
2) Check Customer Balance is 0
POS
1) Issue Sales Order for Ticket B - Line 2. Shipment will be created
Backoffice
1) Check Order Status. Delivery Status will be 100%. Invoice Status will be 100%
2) Check Customer Balance is updated. As per issues desc, it should not be updated
No tags attached.
rar IMG.rar (1,252,433) 2021-09-02 20:09
https://issues.openbravo.com/file_download.php?file_id=16172&type=bug
Issue History
2021-09-02 20:09lbressanNew Issue
2021-09-02 20:09lbressanAssigned To => Retail
2021-09-02 20:09lbressanFile Added: IMG.rar
2021-09-02 20:09lbressanRegression date => 2021-09-22
2021-09-02 20:09lbressanTriggers an Emergency Pack => No
2021-09-14 13:09marvintmRegression date2021-09-22 =>
2021-09-15 09:59ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2021-10-01 13:17ranjith_qualiantech_comSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=23127#r23127
2021-10-17 00:36marvintmNote Added: 0132368
2021-10-18 12:01hgbotNote Added: 0132405
2021-10-19 04:27hgbotNote Added: 0132426
2021-10-20 08:03hgbotResolutionopen => fixed
2021-10-20 08:03hgbotStatusnew => closed
2021-10-20 08:03hgbotFixed in Version => RR22Q1
2021-10-20 08:03hgbotNote Added: 0132470
2021-10-20 08:03hgbotNote Added: 0132471
2021-10-20 08:03hgbotNote Added: 0132472
2021-10-20 08:03hgbotNote Added: 0132473

Notes
(0132368)
marvintm   
2021-10-17 00:36   
This issue is quite tricky. The solution is to actually generate negative credit when the return+new good order is completed, as at that point, the store actually owes the customer money (because the customer returned the good, didn't receive a new one yet, and he didn't receive money either).

We are going to change the flow so that at this point, the credit is updated correctly to a negative amount. Then, when the pending item is finally delivered, a new invoice will be generated, and the credit will be 0 again.

One important caveat: we only support POS to POS flows here, and not POS to backoffice or backoffice to POS. As long as you execute the full flow, including the final delivery of the pending item, in the POS, this will work correctly after our changes.
(0132405)
hgbot   
2021-10-18 12:01   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/596 [^]
(0132426)
hgbot   
2021-10-19 04:27   
Merge Request created: https://gitlab.com/openbravo/ci/mobile-test/-/merge_requests/136 [^]
(0132470)
hgbot   
2021-10-20 08:03   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: 7af5198163389120b0b67d485d62dc3cff41fd44
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 2021-10-20T11:28:10+05:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/7af5198163389120b0b67d485d62dc3cff41fd44 [^]

Fixed ISSUE-47625: Customer credit should be updated when invoice is present
* During return order with partial delivery, if payments is not present and invoice is present,
  then Customer creditUsed should be updated with invoice amount.
  When return order is completely delivered,
  Customer creditUsed will be updated with pendingAmount and balance will be zero.

---
M src/org/openbravo/retail/posterminal/OrderLoader.java
---
(0132471)
hgbot   
2021-10-20 08:03   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/596 [^]
(0132472)
hgbot   
2021-10-20 08:03   
Repository: https://gitlab.com/openbravo/ci/mobile-test [^]
Changeset: d0d1e449c74d6e9597ddbeb505816bbe93bf293f
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 2021-10-18T22:06:54+05:30
URL: https://gitlab.com/openbravo/ci/mobile-test/-/commit/d0d1e449c74d6e9597ddbeb505816bbe93bf293f [^]

Verifies ISSUE-47625: Added test I47625_CheckCustomerBalanceOnReturn

---
A src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/deliverymodes/I47625_CheckCustomerBalanceOnReturn.java
---
(0132473)
hgbot   
2021-10-20 08:03   
Merge request merged: https://gitlab.com/openbravo/ci/mobile-test/-/merge_requests/136 [^]