Openbravo Issue Tracking System - Retail Modules
View Issue Details
0051659Retail ModulesWeb POSpublic2023-02-21 15:002023-03-17 07:55
gorkaion 
ranjith_qualiantech_com 
highmajoralways
closedfixed 
5
pi 
RR23Q2 
No
0051659: Wrong discounts in deleted Lines
When the removed tickets are set to be stored the discount information on deleted lines is not correct. Currently there are 3 different scenarios depending on how the line is deleted and its source:

Case 1 OK. Create a ticket with a line that has discounts applied. Click on delete ticket. On backend the Discounts and Promotions tab has the discount with the correct information.

Case 2 KO. Create a ticket with 2 lines with discounts applied. Click on Delete Line on one of them and complete the ticket. On backend the deleted line does not have the Discounts and Promotions.

Case 3 KO. Create a Verified return of a ticket with 2 lines that have Discounts applied. Delete one of the lines and complete the ticket. On backend the deleted line has the Discounts and Promotion but the Base Gross Unit Price is ZERO instead of the original price when the discount was applied.
Prerequisite: Web POS Save Removed Ticket preference must be enabled.

Case 1.
- In POS:
1. Add a line and apply any discount
2. Click on delete ticket
- In Backend
1. Find the removed ticket and check the Discounts and Promotion tab has the discount with expected Base Gross Unit Price and discount amounts.

Case 2.
In POS:
1. Add 3 lines and apply any discount in both of them.
2. Delete one of the lines.
3. Complete the ticket.
In Backend:
1. Find the paid ticket
2. Check that deleted line has the Discount and Promotion tab empty

Case 3a:
In POS:
1. Open verified return and find ticket from case 2.
2. Return all lines
3. Delete one of the lines.
4. Click on Delete ticket
In Backend:
1. Find the deleted return ticket.
2. Check Discounts and Promotinos of line that WAS NOT deleted. Base Gross Unit Price and discount amounts are correct.
3. Check Discoutns and Promotions of line that WAS deleted. Base Gross Unit Price is ZERO which is wrong.

Case 3b (same as before but completing the return after deleting 1 line):
In POS:
1. Open verified return and find ticket from case 2.
2. Return all lines
3. Delete one of the lines.
4. Complete the ticket
In Backend:
1. Find the return ticket.
2. Check Discounts and Promotions of line that WAS NOT deleted. Base Gross Unit Price and discount amounts are correct.
3. Check Discoutns and Promotions of line that WAS deleted. Base Gross Unit Price is ZERO which is wrong.
Any form of deleting a ticket and/or any line must preserve the Discounts and Promotions tab information as it was in the moment of the deletion. As it is done when the ticket is deleted.

Base Gross Unit Price has to be the price in that moment. Including any manual price change.

Verified return line promotions are not removed per below ticket. But even if the promotion is not reset the original price is lost:
https://issues.openbravo.com/view.php?id=30755 [^]

calculate receipt reapplies the promotions when a line is deleted. but it is not considering 0 qty lines (deleted ones) because of below changesets:
https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/ab2ece3b1073ddc3e436b2dab10bc05733105520 [^]
https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/6cc38ae18ad8a1b7d4497a97aed2b96a0e730158 [^]

No tags attached.
related to defect 0030755 closed fmolina using verified return, discount is removed 
related to defect 0035974 closed jorge-garcia It's possible to apply a manual promotion to a negative or a return line 
depends on defect 0039495 closed jorge-garcia It is not possible to apply a manual promotion/discount to a negative line 
Issue History
2023-02-21 15:00gorkaionNew Issue
2023-02-21 15:00gorkaionAssigned To => Retail
2023-02-21 15:00gorkaionTriggers an Emergency Pack => No
2023-02-21 15:00gorkaionRelationship addedrelated to 0030755
2023-02-21 15:01gorkaionRelationship addedrelated to 0035974
2023-02-21 15:01gorkaionRelationship addeddepends on 0039495
2023-02-24 13:44ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2023-02-24 13:44ranjith_qualiantech_comStatusnew => scheduled
2023-02-27 10:35hgbotNote Added: 0147018
2023-02-27 10:35hgbotNote Added: 0147019
2023-03-08 01:07hgbotNote Added: 0147347
2023-03-10 04:51ranjith_qualiantech_comNote Deleted: 0147347
2023-03-10 04:52ranjith_qualiantech_comNote Deleted: 0147019
2023-03-10 09:31hgbotNote Added: 0147436
2023-03-17 07:55hgbotResolutionopen => fixed
2023-03-17 07:55hgbotStatusscheduled => closed
2023-03-17 07:55hgbotFixed in Version => RR23Q2
2023-03-17 07:55hgbotNote Added: 0147632
2023-03-17 07:55hgbotNote Added: 0147633
2023-03-17 07:55hgbotNote Added: 0147634
2023-03-17 07:55hgbotNote Added: 0147635

Notes
(0147018)
hgbot   
2023-02-27 10:35   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/1080 [^]
(0147436)
hgbot   
2023-03-10 09:31   
Merge Request created: https://gitlab.com/openbravo/ci/mobile-test/-/merge_requests/276 [^]
(0147632)
hgbot   
2023-03-17 07:55   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: 7e34c40139d1a4a879bfa4fc85e83eebe18f4862
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 17-03-2023 06:54:45
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/7e34c40139d1a4a879bfa4fc85e83eebe18f4862 [^]

Fixed ISSUE-51659: Discounts should not be removed when deleting lines
* With Pref. "Web POS Save Removed Tickets" is enabled,
  when deleting ticket (or) lines
  1) Discounts should not be removed
  2) Gross unit price & Net unit price should be set as Zero

---
M web-test/model/business-object/ticket/actions/DeleteLine.test.js
M web/org.openbravo.retail.posterminal/app/model/business-object/ticket/actions/DeleteLine.js
M web/org.openbravo.retail.posterminal/app/model/business-object/ticket/actions/DeleteTicket.js
---
(0147633)
hgbot   
2023-03-17 07:55   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/1080 [^]
(0147634)
hgbot   
2023-03-17 07:55   
Repository: https://gitlab.com/openbravo/ci/mobile-test [^]
Changeset: b526bb18218470cb222774ccc02fe54d0b8dc414
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 17-03-2023 06:54:54
URL: https://gitlab.com/openbravo/ci/mobile-test/-/commit/b526bb18218470cb222774ccc02fe54d0b8dc414 [^]

Verifies ISSUE-51659: Updated Delete Receipt automated tests

---
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/receipts/I35797_VerifyRemoveOrderWithServices.java
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/sales/I33759_DeleteReceiptLinesToZero.java
---
(0147635)
hgbot   
2023-03-17 07:55   
Merge request merged: https://gitlab.com/openbravo/ci/mobile-test/-/merge_requests/276 [^]