Openbravo Issue Tracking System - Retail Modules
View Issue Details
0048934Retail ModulesDiscounts Combopublic2022-03-30 22:262024-04-15 10:08
rmagnoli 
rqueralta 
normalmajoralways
closedfixed 
5
pi 
 
No
0048934: Combo fixed price discount are not applying well
When you define two families combos, the first one with 1 quantity product each (two lines with 1 product each with quantity 1) and the other with 2 quantities of each product (two lines with 1 product each with quantity 2). If you add 1 of each product, the first discount is applying well, but when you add one more product to get the second combo, the promotion is applying incorrectly.
1 - Log in to the back office.
2 - Create a discount with the "Combo Fixed Price" type, set the priority to 2, add a Combo Fixed Price, and the remaining fields as default.
3 - On the "Family" tab create 2 lines with qty 1 each.
4 - For each line, add a product.
5 - Create another discount with the "Combo Fixed Price" type, set the priority to 3, add a Combo Fixed Price, and the remaining fields as default.
6 - On the "Family" tab create 2 lines with qty 2 each.
7 - For each line, add the same products as the previous promotion.
8 - Login on WebPOS
9 - Add one product of each line defined previously.
10 - The first combo discount will be applied.
11 - Add one more product to each line.
12 - You will see that the second combo discount is applying wrong.
No tags attached.
related to defect 0055000 closed Triage Omni OMS POS2 Error with Combo Fixed Price in POS 2 
Issue History
2022-03-30 22:26rmagnoliNew Issue
2022-03-30 22:26rmagnoliAssigned To => Retail
2022-03-30 22:26rmagnoliTriggers an Emergency Pack => No
2022-04-08 00:10rqueraltaAssigned ToRetail => rqueralta
2022-04-08 00:11rqueraltaStatusnew => scheduled
2022-04-09 05:40hgbotNote Added: 0136448
2022-04-25 08:04marvintmNote Added: 0136709
2022-04-25 08:04hgbotResolutionopen => fixed
2022-04-25 08:04hgbotStatusscheduled => closed
2022-04-25 08:04hgbotNote Added: 0136710
2022-04-25 08:04hgbotNote Added: 0136711
2024-04-15 10:08aferrazRelationship addedrelated to 0055000

Notes
(0136448)
hgbot   
2022-04-09 05:40   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.combo/-/merge_requests/20 [^]
(0136709)
marvintm   
2022-04-25 08:04   
I think the described case does not make sense in most situations. Normally if you define two combos for the same products, the one that uses more units of the products should come first in priority, and should be marked as "apply next discount = no".

However, with the proposed fix the problem does no longer happen, so we are going to merge it.
(0136710)
hgbot   
2022-04-25 08:04   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.combo [^]
Changeset: 9a078d2d637a3f2bd1c8f0ec52a01b754b8bdb4a
Author: Rafael Queralta <rafaelcuba81@gmail.com>
Date: 25-04-2022 06:03:37
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.combo/-/commit/9a078d2d637a3f2bd1c8f0ec52a01b754b8bdb4a [^]

Fixed BUG-48934: Take into account previous accumDiscounted value when a different Combo Fixed Price rule is applied.

---
M web/org.openbravo.retail.discounts.combo/app/model/business-logic/discounts-engine/engine/rules/fixed-combo-discount.js
---
(0136711)
hgbot   
2022-04-25 08:04   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.combo/-/merge_requests/20 [^]