| 
		Notes	 | 
	
		 
	 | 
	
		
		
			| 
				(0115193)
			 | 
		 
		
			| 
				hgbot   
			 | 
		 
		
			| 
				2019-10-21 20:33   
							 | 
		 
		 
	 | 
	
		
		
			
				Repository: erp/pmods/org.openbravo.retail.discounts.bytotal 
Changeset: 41a4e206faede44da5800372f7501757929f4abc 
Author: Rafael Queralta <rafaelcuba81 <at> gmail.com> 
Date: Wed Oct 16 16:01:02 2019 -0400 
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.bytotal/rev/41a4e206faede44da5800372f7501757929f4abc [^] 
 
Fixed issue 41887: The "By Total" discount does not apply correctly the 
discounted qty. on the receipt lines 
 
- Instead of calculating the discount amount from the total price of the line, 
now we calculate it from the total price minus the discounted amount of the line, 
if the promitions applied are diferent of the new promotion to apply in the line. 
 
--- 
M web/org.openbravo.retail.discounts.bytotal/js/promotion-by-total-utils.js 
--- 
			 | 
		 
		 
	 | 
	
		 
	 | 
	
		
		
			| 
				(0115195)
			 | 
		 
		
			| 
				hgbot   
			 | 
		 
		
			| 
				2019-10-22 02:28   
							 | 
		 
		 
	 | 
	
		
	 | 
	
		 
	 | 
	
		
		
			| 
				(0115255)
			 | 
		 
		
			| 
				hgbot   
			 | 
		 
		
			| 
				2019-10-23 19:27   
							 | 
		 
		 
	 | 
	
		
		
			
				Repository: erp/pmods/org.openbravo.retail.discounts.bytotal 
Changeset: 798cdc80552645d077de1f3db5701e0a1ed59a08 
Author: Rafael Queralta <rafaelcuba81 <at> gmail.com> 
Date: Tue Oct 22 13:35:35 2019 -0400 
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.bytotal/rev/798cdc80552645d077de1f3db5701e0a1ed59a08 [^] 
 
Fixed issue 41887: The "By Total" discount does not apply correctly the 
discounted qty. on the receipt lines 
 
- Instead of calculating the discount amount from the total price of the line, 
now we calculate it from the total price minus the discounted amount of the line, 
if the promitions applied are diferent of the new promotion to apply in the line 
and the line it is not a splited line 
 
--- 
M web/org.openbravo.retail.discounts.bytotal/js/promotion-by-total-utils.js 
--- 
			 | 
		 
		 
	 | 
	
		 
	 | 
	
		
		
			| 
				(0115261)
			 | 
		 
		
			| 
				jorge-garcia   
			 | 
		 
		
			| 
				2019-10-24 10:27   
							 | 
		 
		 
	 | 
	
		
		
			
				Code is not working correctly in all cases. 
 
1. Add two lines of the same non-grouped product with price = 100: 
   Line 1 - P1 100 
   Line 2 - P1 100 
2. Add a discount type = User Defined Amount of 40 to the SECOND line 
   Line 1 - P1 100 
   Line 2 - P1 100 -40 = 60 
3. Add a discount type = Variable Discount per Total Amount of 20 to the receipt 
 
The by total discount is not being applied proportionally to the lines. It should be 
   Line 1 - P1 14 from by total discount 
   Line 2 - P1 6 from by total discount 
 
And instead it is: 
   Line 1 - P1 10 from by total discount (wrong) 
   Line 2 - P1 10 from by total discount (wrong)			 | 
		 
		 
	 | 
	
		 
	 | 
	
		
		
			| 
				(0115285)
			 | 
		 
		
			| 
				hgbot   
			 | 
		 
		
			| 
				2019-10-26 19:42   
							 | 
		 
		 
	 | 
	
		
		
			
				Repository: erp/pmods/org.openbravo.retail.discounts.bytotal 
Changeset: 6e03fca44e7e75cf77dd4711df6ba3a9c49596fc 
Author: Rafael Queralta <rafaelcuba81 <at> gmail.com> 
Date: Fri Oct 25 13:57:49 2019 -0400 
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.bytotal/rev/6e03fca44e7e75cf77dd4711df6ba3a9c49596fc [^] 
 
Fixed issue 41887: The "By Total" discount does not apply correctly the 
discounted qty. on the receipt lines 
 
- To solve all cases related to this problem, it was required to sort the list 
of preprocesses ascendingly and take into account the lists of promotions and 
manualpromotions. 
 
--- 
M web/org.openbravo.retail.discounts.bytotal/js/promotion-by-total-utils.js 
--- 
			 | 
		 
		 
	 | 
	
		 
	 | 
	
		
		
			| 
				(0115387)
			 | 
		 
		
			| 
				jorge-garcia   
			 | 
		 
		
			| 
				2019-11-04 10:13   
							 | 
		 
		 
	 | 
	
		
	 | 
	
		 
	 | 
	
		
		
			| 
				(0115491)
			 | 
		 
		
			| 
				Leyre   
			 | 
		 
		
			
				2019-11-11 10:15   
				 (edited on: 2019-11-11 13:16)			 | 
		 
		 
	 | 
	
		
		
			
				Backend: 
1. Set a discount: User Defined Amount 
2. Set another discount: Variable Discount per Total Amount 
3. Modify the Price on the product "Alpine Poles" = 100 and grouped Product= no 
 
Web POS: 
1. Add Alpine poles. 
2. Add Alpine poles again. 
3. Add the first discount (User defined amount) to the first line with amount = 40. 
4. Try adding the first discount (By total) to both lines with amount = 20 
 
Solution: 
The discount must be: 
Product 1 -> price 100 -> First discount = 40; Second discount = 7.5 
Product 1 -> price 100 Second discount = 12.5 
 
Possible problem: 
if (index < list.length - 1) { 
    discount = OB.DEC.toNumber( 
      OB.DEC.toBigDecimal(linePrice).multiply( 
        OB.DEC.toBigDecimal(totaldiscount).divide( 
          OB.DEC.toBigDecimal( 
        preprocess.totalNet || preprocess.total 
          ), 
          20, 
          OB.DEC.getRoundingMode() 
... 
 
The total in the division must be 160 instead of 200. 
 
			 | 
		 
		 
	 | 
	
		 
	 | 
	
		
		
			| 
				(0115542)
			 | 
		 
		
			| 
				hgbot   
			 | 
		 
		
			| 
				2019-11-11 21:57   
							 | 
		 
		 
	 | 
	
		
		
			
				Repository: erp/pmods/org.openbravo.retail.discounts.bytotal 
Changeset: 8ed992a5708171ab948d0ab74643faf058df73d3 
Author: Rafael Queralta <rafaelcuba81 <at> gmail.com> 
Date: Mon Nov 11 15:52:48 2019 -0500 
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.bytotal/rev/8ed992a5708171ab948d0ab74643faf058df73d3 [^] 
 
Fixed issue 41887: The "By Total" discount does not apply correctly the 
discounted qty. on the receipt lines 
 
- Updated the divisor value, discounting the amount of the previous applied 
discounts 
 
--- 
M web/org.openbravo.retail.discounts.bytotal/js/promotion-by-total-utils.js 
--- 
			 | 
		 
		 
	 | 
	
		 
	 | 
	
		
		
			| 
				(0115544)
			 | 
		 
		
			| 
				hgbot   
			 | 
		 
		
			| 
				2019-11-12 03:20   
							 | 
		 
		 
	 | 
	
		
	 | 
	
		 
	 | 
	
		
		
			| 
				(0115545)
			 | 
		 
		
			| 
				hgbot   
			 | 
		 
		
			| 
				2019-11-12 04:59   
							 | 
		 
		 
	 | 
	
		
		
			
				Repository: erp/pmods/org.openbravo.retail.discounts.bytotal 
Changeset: b04833a67ca82127602de9e1b5b5f37b9a442f5a 
Author: Rafael Queralta <rafaelcuba81 <at> gmail.com> 
Date: Mon Nov 11 22:56:45 2019 -0500 
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.bytotal/rev/b04833a67ca82127602de9e1b5b5f37b9a442f5a [^] 
 
Fixed issue 41887: The "By Total" discount does not apply correctly the 
discounted qty. on the receipt lines 
 
- Updated the divisor value, discounting the amount of the previous applied 
discounts 
 
--- 
M web/org.openbravo.retail.discounts.bytotal/js/promotion-by-total-utils.js 
--- 
			 | 
		 
		 
	 |