Openbravo Issue Tracking System - Retail Modules
View Issue Details
0050976Retail ModulesDiscounts and Promotionspublic2022-11-23 10:102023-02-19 09:30
noemieroussel 
ranjith_qualiantech_com 
urgentmajoralways
closedfixed 
5
 
RR23Q1 
No
0050976: [Promo] - Buy X Get Y - Number of gifts is multiplied by number of eligible products bought even if Max Y = 1
When configuring Buy X Get Y, the number of gifts is multiplied by number of eligible products bought even if Max Y = 1. Moreover, when adding several gifts to the ticket, only one is free.
Step 1: Definition of promotion

                Name: Test number of gift multiplied

                Type: Buy X get Y as a gift

               Subtype: Here Buy Any X Get Any Y (But this bug concerns the 4
               subtypes)

               Application Method: Optional

               Add in the list of products in "Product subtab":

               Product: “Alpine poles “

               Product: “Blue Coat “

               Gift Product: “Beer 0.5L”

X = 1
Min Y = 1
Max Y = 1

Step 2: Add one eligible product to the ticket, only one gift can be selected among the 3 possible gifts defined => Result OK

Step 3 : Add a second eligible product to the ticket --> KO
The pop up indicates that 2 eligible products can be selected instead of 1 (number of gifts is equal to the number of eligible products bought)
When we select only one gift and click on Apply, error message is displayed

Step 4: We select 2 gifts and click on Apply --> KO both gifts are added to the ticket, but only one is free
Expected behavior : If max Y = 1, only one gift can be offered to the client, even if he buys several eligible products - we expect the same pop up and behavior as when only one eligible product is bought (requirement 3 in the specification)
FASH
png gift not free.png (52,141) 2022-11-23 10:10
https://issues.openbravo.com/file_download.php?file_id=17871&type=bug
png
Issue History
2022-11-23 10:10noemierousselNew Issue
2022-11-23 10:10noemierousselAssigned To => Retail
2022-11-23 10:10noemierousselFile Added: gift not free.png
2022-11-23 10:10noemierousselTriggers an Emergency Pack => No
2022-11-23 10:11noemierousselTag Attached: FASH
2022-11-23 11:03rafarodaPriorityhigh => urgent
2022-12-12 12:39noemierousselTypedesign defect => defect
2022-12-13 10:36ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2022-12-13 10:36ranjith_qualiantech_comStatusnew => scheduled
2022-12-15 09:10hgbotNote Added: 0144728
2023-02-19 09:30hgbotNote Added: 0146726
2023-02-19 09:30hgbotResolutionopen => fixed
2023-02-19 09:30hgbotStatusscheduled => closed
2023-02-19 09:30hgbotFixed in Version => RR23Q1
2023-02-19 09:30hgbotNote Added: 0146727

Notes
(0144728)
hgbot   
2022-12-15 09:10   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/merge_requests/79 [^]
(0146726)
hgbot   
2023-02-19 09:30   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/merge_requests/79 [^]
(0146727)
hgbot   
2023-02-19 09:30   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts [^]
Changeset: d505d79ce62e71f12e09bb16b22920fc58d024a7
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 14-12-2022 13:41:51
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts/-/commit/d505d79ce62e71f12e09bb16b22920fc58d024a7 [^]

Fixed ISSUE-50976: Discount X units should be used to calculated required gift qty
* Gift qty should be maximum of X Units if BuyXGetYasGift configured

---
M web/org.openbravo.retail.discounts/app/model/business-logic/discounts-engine/engine/rules/buy-x-gift-y-discount.js
---