Openbravo Issue Tracking System - Retail Modules  | 
| View Issue Details | 
  | 
| ID | Project | Category | View Status | Date Submitted | Last Update | 
| 0041789 | Retail Modules | Discounts and Promotions | public | 2019-09-10 09:52 | 2019-11-15 11:59 | 
  | 
| Reporter | Leyre |   | 
| Assigned To | rqueralta |   | 
| Priority | high | Severity | major | Reproducibility | always | 
| Status | closed | Resolution | fixed |   | 
| Platform |  | OS | 5 | OS Version |  | 
| Product Version |  |   | 
| Target Version |  | Fixed in Version | RR20Q1 |   | 
| Merge Request Status |  | 
| Review Assigned To | marvintm | 
| OBNetwork customer | Gold | 
| Support ticket | 11704 | 
| Regression level |  | 
| Regression date |  | 
| Regression introduced in release |  | 
| Regression introduced by commit |  | 
| Triggers an Emergency Pack | No | 
  | 
| Summary | 0041789: Discount "Buy X and get Y as gift" does not work correctly. | 
| Description | Discount "Buy X and get Y as gift" does not work correctly. | 
| Steps To Reproduce | 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. 
 | 
| Proposed Solution | The Promo 2 must deduct the total price of the gift product. | 
| Additional Information |  | 
| Tags | No tags attached. | 
| Relationships | | related to  | defect  | 0042291 |   | scheduled  | marvintm  | Incorrect price is discounted when combining rules which gift full units  |  
  | 
| Attached Files |   buyXgetY.png (112,881) 2019-09-10 09:52 https://issues.openbravo.com/file_download.php?file_id=13296&type=bug
  
  | 
  | 
| Issue History | 
| Date Modified | Username | Field | Change | 
| 2019-09-10 09:52 | Leyre | New Issue |  | 
| 2019-09-10 09:52 | Leyre | Assigned To |  => Retail | 
| 2019-09-10 09:52 | Leyre | File Added: buyXgetY.png |  | 
| 2019-09-10 09:52 | Leyre | OBNetwork customer |  => Gold | 
| 2019-09-10 09:52 | Leyre | Support ticket |  => 11704 | 
| 2019-09-10 09:52 | Leyre | Resolution time |  => 1569880800 | 
| 2019-09-10 09:52 | Leyre | Triggers an Emergency Pack |  => No | 
| 2019-09-17 12:28 | rqueralta | Assigned To | Retail => rqueralta | 
| 2019-09-17 12:28 | rqueralta | Status | new => scheduled | 
| 2019-10-25 16:11 | hgbot | Checkin |  | 
| 2019-10-25 16:11 | hgbot | Note Added: 0115283 |  | 
| 2019-10-25 16:11 | hgbot | Status | scheduled => resolved | 
| 2019-10-25 16:11 | hgbot | Resolution | open => fixed | 
| 2019-10-25 16:11 | hgbot | Fixed in SCM revision |  => http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/ba6900b20a4f5de23a9b8050c0f866d90a42988b [^] | 
| 2019-10-31 16:30 | marvintm | Note Added: 0115374 |  | 
| 2019-10-31 16:30 | marvintm | Status | resolved => new | 
| 2019-10-31 16:30 | marvintm | Resolution | fixed => open | 
| 2019-10-31 16:31 | hgbot | Checkin |  | 
| 2019-10-31 16:31 | hgbot | Note Added: 0115375 |  | 
| 2019-11-07 15:07 | hgbot | Checkin |  | 
| 2019-11-07 15:07 | hgbot | Note Added: 0115453 |  | 
| 2019-11-07 15:07 | hgbot | Status | new => resolved | 
| 2019-11-07 15:07 | hgbot | Resolution | open => fixed | 
| 2019-11-07 15:07 | hgbot | Fixed in SCM revision | http://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:09 | hgbot | Checkin |  | 
| 2019-11-08 08:09 | hgbot | Note Added: 0115470 |  | 
| 2019-11-13 15:22 | marvintm | Status | resolved => new | 
| 2019-11-13 15:22 | marvintm | Resolution | fixed => open | 
| 2019-11-13 15:22 | marvintm | Status | new => scheduled | 
| 2019-11-13 21:26 | hgbot | Checkin |  | 
| 2019-11-13 21:26 | hgbot | Note Added: 0115592 |  | 
| 2019-11-14 17:22 | marvintm | Status | scheduled => resolved | 
| 2019-11-14 17:22 | marvintm | Resolution | open => fixed | 
| 2019-11-15 11:59 | marvintm | Review Assigned To |  => marvintm | 
| 2019-11-15 11:59 | marvintm | Status | resolved => closed | 
| 2019-11-15 11:59 | marvintm | Fixed in Version |  => RR20Q1 | 
| 2019-11-15 11:59 | marvintm | Relationship added | related 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 
--- 
			 | 
		 
		 
	 | 
	
		 
	 | 
	| 
		
	 | 
	
		
		
			| 
				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 
--- 
			 | 
		 
		 
	 |