Openbravo Issue Tracking System - Retail Modules
View Issue Details
0047670Retail ModulesDiscounts and Promotionspublic2021-09-10 12:092021-09-15 16:22
jetxarri 
rqueralta 
urgentmajoralways
closedfixed 
5
pi 
 
No
0047670: Backend discounts executor not ordering properly the discount rules
Backend discounts executor not ordering properly the discount rules.

Null values should go first and with same priority, should be ordered by id.

 * OB.Discounts.Pos.ruleImpls: array with not manual discounts and promotions including children filters, filtered by current role and sorted by priority and id (null priorities first).
-Create 2 discounts
-First discount priority 10
-Second one priority null

Go to web pos and create a ticket that applies 2 discounts. Discount without priority is applied first and later the other one

Use the endpoint ../ws/org.openbravo.discounts.discount. Discount with priority is applied first and later the other one
Attached file
NOR
diff patch.diff (1,050) 2021-09-10 12:09
https://issues.openbravo.com/file_download.php?file_id=16190&type=bug
Issue History
2021-09-10 12:09jetxarriNew Issue
2021-09-10 12:09jetxarriAssigned To => Retail
2021-09-10 12:09jetxarriFile Added: patch.diff
2021-09-10 12:09jetxarriTriggers an Emergency Pack => No
2021-09-10 12:10jetxarriTag Attached: NOR
2021-09-13 21:02rqueraltaAssigned ToRetail => rqueralta
2021-09-13 21:02rqueraltaStatusnew => scheduled
2021-09-14 13:08hgbotNote Added: 0131780
2021-09-15 16:22hgbotNote Added: 0131822
2021-09-15 16:22hgbotResolutionopen => fixed
2021-09-15 16:22hgbotStatusscheduled => closed
2021-09-15 16:22hgbotNote Added: 0131823

Notes
(0131780)
hgbot   
2021-09-14 13:08   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.discounts/-/merge_requests/11 [^]
(0131822)
hgbot   
2021-09-15 16:22   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.discounts/-/merge_requests/11 [^]
(0131823)
hgbot   
2021-09-15 16:22   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.discounts [^]
Changeset: 9a0758229ea5a0de988086e1546dda1517269570
Author: Rafael Queralta <rafaelcuba81@gmail.com>
Date: 2021-09-14T07:06:03-04:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.discounts/-/commit/9a0758229ea5a0de988086e1546dda1517269570 [^]

Fixed BUG-47670: Filtered by current role and sorted by priority and id

---
M src/org/openbravo/discounts/engine/DiscountJSExecutor.java
---