Openbravo Issue Tracking System - Retail Modules
View Issue Details
0041789Retail ModulesDiscounts and Promotionspublic2019-09-10 09:522019-11-15 11:59
Leyre 
rqueralta 
highmajoralways
closedfixed 
5
 
RR20Q1 
marvintm
No
0041789: Discount "Buy X and get Y as gift" does not work correctly.
Discount "Buy X and get Y as gift" does not work correctly.
Backend:
Define this two discounts:
1. Promo 1:
   Discount type = Buy X and get Y as gift
   Product P1 -> Gift Product = N
   Product P2 -> Gift Product = Y
2. Promo 2:
   Discount type = Buy X and get Y as gift
   Product P3 -> Gift Product = N
   Product P2 -> Gift Product = Y (The same product as the Promo 1)

Web POS:
1. Add the Product P1
2. Add the product P2 and verify that the Promo 1 apply correctly.
3. Add the product P3
4. Add the product P2 and verify that the Promo 2 is applied, but only the half price of the gift product is discounted.

Look at the attached image.
The Promo 2 must deduct the total price of the gift product.
No tags attached.
related to defect 0042291 scheduled marvintm Incorrect price is discounted when combining rules which gift full units 
png buyXgetY.png (112,881) 2019-09-10 09:52
https://issues.openbravo.com/file_download.php?file_id=13296&type=bug
png
Issue History
2019-09-10 09:52LeyreNew Issue
2019-09-10 09:52LeyreAssigned To => Retail
2019-09-10 09:52LeyreFile Added: buyXgetY.png
2019-09-10 09:52LeyreResolution time => 1569880800
2019-09-10 09:52LeyreTriggers an Emergency Pack => No
2019-09-17 12:28rqueraltaAssigned ToRetail => rqueralta
2019-09-17 12:28rqueraltaStatusnew => scheduled
2019-10-25 16:11hgbotCheckin
2019-10-25 16:11hgbotNote Added: 0115283
2019-10-25 16:11hgbotStatusscheduled => resolved
2019-10-25 16:11hgbotResolutionopen => fixed
2019-10-25 16:11hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/ba6900b20a4f5de23a9b8050c0f866d90a42988b [^]
2019-10-31 16:30marvintmNote Added: 0115374
2019-10-31 16:30marvintmStatusresolved => new
2019-10-31 16:30marvintmResolutionfixed => open
2019-10-31 16:31hgbotCheckin
2019-10-31 16:31hgbotNote Added: 0115375
2019-11-07 15:07hgbotCheckin
2019-11-07 15:07hgbotNote Added: 0115453
2019-11-07 15:07hgbotStatusnew => resolved
2019-11-07 15:07hgbotResolutionopen => fixed
2019-11-07 15:07hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/ba6900b20a4f5de23a9b8050c0f866d90a42988b [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/69c24297218972353a20b85e0858780320b5e9e7 [^]
2019-11-08 08:09hgbotCheckin
2019-11-08 08:09hgbotNote Added: 0115470
2019-11-13 15:22marvintmStatusresolved => new
2019-11-13 15:22marvintmResolutionfixed => open
2019-11-13 15:22marvintmStatusnew => scheduled
2019-11-13 21:26hgbotCheckin
2019-11-13 21:26hgbotNote Added: 0115592
2019-11-14 17:22marvintmStatusscheduled => resolved
2019-11-14 17:22marvintmResolutionopen => fixed
2019-11-15 11:59marvintmReview Assigned To => marvintm
2019-11-15 11:59marvintmStatusresolved => closed
2019-11-15 11:59marvintmFixed in Version => RR20Q1
2019-11-15 11:59marvintmRelationship addedrelated to 0042291

Notes
(0115283)
hgbot   
2019-10-25 16:11   
Repository: erp/pmods/org.openbravo.retail.discounts
Changeset: ba6900b20a4f5de23a9b8050c0f866d90a42988b
Author: Rafael Queralta <rafaelcuba81 <at> gmail.com>
Date: Tue Sep 24 15:13:49 2019 -0400
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/ba6900b20a4f5de23a9b8050c0f866d90a42988b [^]

Fixed issue 41789: Discount "Buy X and get Y as gift" does not work correctly.

- Taken into account the original unit price instead the current unit price in
the new discount engine, and in the old discount engine was taken the price of
the line

---
M web/org.openbravo.retail.discounts/js/discountsengine/common/discount-rules.js
M web/org.openbravo.retail.discounts/js/discountsengine/common/rules/buy-x-gift-y-discount.js
M web/org.openbravo.retail.discounts/js/promotion-buyXgiftY.js
---
(0115374)
marvintm   
2019-10-31 16:30   
Reopened because it's making unit tests fail currently on integration
(0115375)
hgbot   
2019-10-31 16:31   
Repository: erp/pmods/org.openbravo.retail.discounts
Changeset: fef111a332f9dd32cbcf49a1e4e00a32b314809d
Author: Antonio Moreno Perez <antonio.moreno <at> openbravo.com>
Date: Thu Oct 31 16:31:24 2019 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/fef111a332f9dd32cbcf49a1e4e00a32b314809d [^]

Related to issue 41789. Backed out because it's making unit tests fail on integration.

---
M web/org.openbravo.retail.discounts/js/discountsengine/common/discount-rules.js
M web/org.openbravo.retail.discounts/js/discountsengine/common/rules/buy-x-gift-y-discount.js
M web/org.openbravo.retail.discounts/js/promotion-buyXgiftY.js
---
(0115453)
hgbot   
2019-11-07 15:07   
Repository: erp/pmods/org.openbravo.retail.discounts
Changeset: 69c24297218972353a20b85e0858780320b5e9e7
Author: Rafael Queralta <rafaelcuba81 <at> gmail.com>
Date: Mon Nov 04 13:33:17 2019 -0500
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/69c24297218972353a20b85e0858780320b5e9e7 [^]

Fixed issue 41789: Discount "Buy X and get Y as gift" does not work correctly.

- Taken into account the original unit price instead the current unit price in
the new discount engine, and in the old discount engine was taken the price of
the line

---
M web/org.openbravo.retail.discounts/js/discountsengine/common/discount-rules.js
M web/org.openbravo.retail.discounts/js/discountsengine/common/rules/buy-x-gift-y-discount.js
M web/org.openbravo.retail.discounts/js/promotion-buyXgiftY.js
---
(0115470)
hgbot   
2019-11-08 08:09   
Repository: erp/pmods/org.openbravo.retail.discounts
Changeset: a67db373556bc4ff9df6d91176a270deec5be186
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Fri Nov 08 08:08:45 2019 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/a67db373556bc4ff9df6d91176a270deec5be186 [^]

Related to issue 41789. Rolled back change as it was breaking unit tests

---
M web/org.openbravo.retail.discounts/js/discountsengine/common/discount-rules.js
M web/org.openbravo.retail.discounts/js/discountsengine/common/rules/buy-x-gift-y-discount.js
M web/org.openbravo.retail.discounts/js/promotion-buyXgiftY.js
---
(0115592)
hgbot   
2019-11-13 21:26   
Repository: erp/pmods/org.openbravo.retail.discounts
Changeset: 0a389ab0dea087e1f9119abb8da39beef210e558
Author: Rafael Queralta <rafaelcuba81 <at> gmail.com>
Date: Wed Nov 13 09:40:15 2019 -0500
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/0a389ab0dea087e1f9119abb8da39beef210e558 [^]

Related issue 41789: Discount "Buy X and get Y as gift" does not work correctly.

- Taken into account the original unit price instead the current unit price in
the new discount engine, and in the old discount engine was taken the price of
the line

---
M web/org.openbravo.retail.discounts/js/discountsengine/common/discount-rules.js
M web/org.openbravo.retail.discounts/js/discountsengine/common/rules/buy-x-gift-y-discount.js
M web/org.openbravo.retail.discounts/js/promotion-buyXgiftY.js
---