Openbravo Issue Tracking System - Retail Modules
View Issue Details
0057781Retail ModulesDiscounts and Promotionspublic2025-01-28 13:352025-03-04 08:53
sofidossant 
sreehari 
highmajoralways
closedfixed 
5
RR24Q4 
RR25Q2 
No
0057781: Error with positive discount
We have a problem when placing a specific order in which when we apply a discount of type “Variable Discount per Total Amount”, it generates a positive discount in a line of the order.
This line generates error with the RTPrinter, since the fiscalization does not accept positive discounts.
1- Configurate a discount type “Variable Discount per Total Amount”, for all org, all product, any filter.
2- Open the webpos.
3- Add 21 product without discounts and change the price (I attached the table with the price in the lines)
4- Then add the discount in 9 EUR
5- See the last line with the discount in positive 0.01 EUR
No tags attached.
png Captura de pantalla -2025-01-28 09-19-36.png (109,687) 2025-01-28 13:35
https://issues.openbravo.com/file_download.php?file_id=20803&type=bug
png

? JSONERROR01.json (158,992) 2025-01-28 13:37
https://issues.openbravo.com/file_download.php?file_id=20804&type=bug
Issue History
2025-01-28 13:35sofidossantNew Issue
2025-01-28 13:35sofidossantAssigned To => Retail
2025-01-28 13:35sofidossantTriggers an Emergency Pack => No
2025-01-28 13:35sofidossantFile Added: Captura de pantalla -2025-01-28 09-19-36.png
2025-01-28 13:37sofidossantNote Added: 0174821
2025-01-28 13:37sofidossantFile Added: JSONERROR01.json
2025-01-28 14:22sreehariAssigned ToRetail => sreehari
2025-01-28 14:22sreehariStatusnew => scheduled
2025-02-03 12:55sreehariNote Added: 0175054
2025-02-04 06:05hgbotNote Added: 0175076
2025-02-06 17:19hgbotResolutionopen => fixed
2025-02-06 17:19hgbotStatusscheduled => closed
2025-02-06 17:19hgbotNote Added: 0175234
2025-02-06 17:19hgbotFixed in Version => RR25Q2
2025-02-06 17:19hgbotNote Added: 0175235
2025-02-21 15:43sofidossantStatusclosed => new
2025-02-21 15:44sofidossantNote Added: 0176022
2025-02-26 12:08sreehariStatusnew => scheduled
2025-02-27 06:01hgbotNote Added: 0176182
2025-03-04 08:53hgbotStatusscheduled => closed
2025-03-04 08:53hgbotNote Added: 0176388
2025-03-04 08:53hgbotNote Added: 0176389

Notes
(0174821)
sofidossant   
2025-01-28 13:37   
Table with price
https://docs.google.com/spreadsheets/d/1MgmRcKdjHlufH1LHPCrcpM3p6OkfUm0sug1ekiVWHa4/edit?usp=sharing [^]

Video in livebuilds
https://drive.google.com/file/d/1sQbtXXAiRCp2goR4UI3Vp_8mG68tgdrT/view?usp=sharing [^]
(0175054)
sreehari   
2025-02-03 12:55   
Reproduced Video - https://drive.google.com/file/d/1e5dAuc7yfKWoskKIr4bOLyv9v735YCrw/view?usp=sharing [^]
(0175076)
hgbot   
2025-02-04 06:05   
Merge Request created: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.retail.discounts/-/merge_requests/162 [^]
(0175234)
hgbot   
2025-02-06 17:19   
Merge request merged: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.retail.discounts/-/merge_requests/162 [^]
(0175235)
hgbot   
2025-02-06 17:19   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.retail.discounts [^]
Changeset: c8291ac3d3d063079cf28f30cce9d5f168028c10
Author: Sreehari Venkataraman <sreehari.venkataraman.ext@openbravo.com>
Date: 03-02-2025 17:46:06
URL: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.retail.discounts/-/commit/c8291ac3d3d063079cf28f30cce9d5f168028c10 [^]

Fixes ISSUE-57781: Updated ByTotalAmount Discount
*now when the line discount is more than the expected discount, it will be reset to remaining amount available to be discounted for the line
*and so avoiding +ve discounts on the line

---
M web/org.openbravo.retail.discounts/app/model/business-logic/discounts-engine/engine/rules/by-total-amount-discount.js
---
(0176022)
sofidossant   
2025-02-21 15:44   
With the new change, there are discount lines at 0, and this generates an error in the RTPRINTER. There do not have to be lines in 0 or positive discounts.
(0176182)
hgbot   
2025-02-27 06:01   
Merge Request created: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.retail.discounts/-/merge_requests/170 [^]
(0176388)
hgbot   
2025-03-04 08:53   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.retail.discounts [^]
Changeset: 4333a87c462c0da84b5c8b1cd285a61a0057c1a9
Author: Sreehari Venkataraman <sreehari.venkataraman.ext@openbravo.com>
Date: 26-02-2025 16:57:02
URL: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.retail.discounts/-/commit/4333a87c462c0da84b5c8b1cd285a61a0057c1a9 [^]

Fixes ISSUE-57781: Added case to avoid promotion object when discount is 0

---
M web/org.openbravo.retail.discounts/app/model/business-logic/discounts-engine/engine/rules/by-total-amount-discount.js
---
(0176389)
hgbot   
2025-03-04 08:53   
Merge request merged: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/pmods/org.openbravo.retail.discounts/-/merge_requests/170 [^]