Openbravo Issue Tracking System - Retail Modules
View Issue Details
0040504Retail ModulesDiscounts and Promotionspublic2019-04-01 23:492019-04-15 14:46
matias-bernal 
ranjith_qualiantech_com 
normalminoralways
closedfixed 
5
 
RR19Q3 
adrianromero
No
0040504: Promotion of type Discount per Total Amount are not properly applied in Live Builds
Promotion of type Discount per Total Amount are not properly applied in Live Builds, but Percentage Discount per Total Amount are properly applied instead http://wiki.openbravo.com/wiki/Retail:By_Total_Discounts [^]


For our use case we should be using the automatic discounts types (not the manual ones), which are:
* Discount per Total Amount (seems not to be working as it should in Live Builds PI)
* Percentage Discount per Total Amount (seems to be working OK in Live Builds PI)
*Create a new promotion of type "Discount per Total Amount" and amount = 10 that applies to 100% of the ticket
*Create a new record in the coupon tab
*Reload the POS Terminal to add this promotion
*In POS add 2 products to the ticket
*Click on Menu > Coupon Code and enter the coupon code
*See that the distribution of the 10€ discount is not properly applied in the lines, and finally sum discount of 11.12: see video attached
No tags attached.
? LIVE BUILDS - 10$ Discount - NOK.webm (644,497) 2019-04-02 15:38
https://issues.openbravo.com/file_download.php?file_id=12822&type=bug
diff I40504_possibleFix_bytotal.diff (2,765) 2019-04-03 10:04
https://issues.openbravo.com/file_download.php?file_id=12827&type=bug
diff I40504_possibleFix_posterminal.diff (732) 2019-04-03 10:05
https://issues.openbravo.com/file_download.php?file_id=12828&type=bug
Issue History
2019-04-01 23:49matias-bernalNew Issue
2019-04-01 23:49matias-bernalAssigned To => Retail
2019-04-01 23:49matias-bernalFile Added: lb.zip
2019-04-01 23:49matias-bernalTriggers an Emergency Pack => No
2019-04-02 08:18rafarodaIssue Monitored: rafaroda
2019-04-02 11:04rafarodaNote Added: 0110963
2019-04-02 15:38rafarodaSummaryNo coupons apply for certain promotions types => Promotion of type Discount per Total Amount are not properly applied in Live Builds
2019-04-02 15:38rafarodaDescription Updatedbug_revision_view_page.php?rev_id=18569#r18569
2019-04-02 15:38rafarodaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=18571#r18571
2019-04-02 15:38rafarodaFile Deleted: lb.zip
2019-04-02 15:38rafarodaFile Added: LIVE BUILDS - 10$ Discount - NOK.webm
2019-04-02 15:40rafarodaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=18572#r18572
2019-04-03 10:04jorge-garciaFile Added: I40504_possibleFix_bytotal.diff
2019-04-03 10:05jorge-garciaFile Added: I40504_possibleFix_posterminal.diff
2019-04-03 15:18ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2019-04-03 15:18ranjith_qualiantech_comStatusnew => scheduled
2019-04-08 12:40hgbotCheckin
2019-04-08 12:40hgbotNote Added: 0111018
2019-04-08 12:47hgbotCheckin
2019-04-08 12:47hgbotNote Added: 0111020
2019-04-08 15:23hgbotCheckin
2019-04-08 15:23hgbotNote Added: 0111026
2019-04-09 07:29ranjith_qualiantech_comStatusscheduled => resolved
2019-04-09 07:29ranjith_qualiantech_comResolutionopen => fixed
2019-04-09 09:08ranjith_qualiantech_comNote Added: 0111034
2019-04-09 09:08ranjith_qualiantech_comStatusresolved => new
2019-04-09 09:08ranjith_qualiantech_comResolutionfixed => open
2019-04-09 10:50hgbotCheckin
2019-04-09 10:50hgbotNote Added: 0111038
2019-04-09 10:50ranjith_qualiantech_comStatusnew => scheduled
2019-04-10 09:44hgbotCheckin
2019-04-10 09:44hgbotNote Added: 0111052
2019-04-10 09:45hgbotCheckin
2019-04-10 09:45hgbotNote Added: 0111053
2019-04-10 15:22ranjith_qualiantech_comStatusscheduled => resolved
2019-04-10 15:22ranjith_qualiantech_comResolutionopen => fixed
2019-04-15 14:46adrianromeroReview Assigned To => adrianromero
2019-04-15 14:46adrianromeroNote Added: 0111138
2019-04-15 14:46adrianromeroStatusresolved => closed
2019-04-15 14:46adrianromeroFixed in Version => RR19Q3

Notes
(0110963)
rafaroda   
2019-04-02 11:04   
Comment after talking with Pablo Sarobe and based on Wiki info http://wiki.openbravo.com/wiki/Retail:By_Total_Discount [^]

For our use case we should be using the automatic discounts types (not the manual ones), which are:
* Discount per Total Amount (seems not to be working as it should in Live Builds PI)
* Percentage Discount per Total Amount (seems to be working OK in Live Builds PI)
(0111018)
hgbot   
2019-04-08 12:40   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 49e637120914487fbe6285efad827269d62e3a0d
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Mon Apr 08 16:09:47 2019 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/49e637120914487fbe6285efad827269d62e3a0d [^]

Related to issue 40504 : Added additional args to OBPOS_PreApplyAutomaticDiscount hook

* Added receipt and line as args to OBPOS_PreApplyAutomaticDiscount hook

---
M web/org.openbravo.retail.posterminal/js/model/executor.js
---
(0111020)
hgbot   
2019-04-08 12:47   
Repository: erp/pmods/org.openbravo.retail.discounts.bytotal
Changeset: d37c97ec169b8395dd4bc531f59cf25638e1d0fd
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Mon Apr 08 16:16:38 2019 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.bytotal/rev/d37c97ec169b8395dd4bc531f59cf25638e1d0fd [^]

Related to issue 40504 : Updated Discount calculation when applying coupon code

* When apply coupon code, coupon amount should be splited among lines proportionally

---
M web/org.openbravo.retail.discounts.bytotal/js/preApplyAutomaticDiscountHook.js
M web/org.openbravo.retail.discounts.bytotal/js/promotion-discounttotal.js
---
(0111026)
hgbot   
2019-04-08 15:23   
Repository: tools/automation/pi-mobile
Changeset: 70bfa487774978648dd05e052bab711993c73cf7
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Mon Apr 08 18:52:58 2019 +0530
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/70bfa487774978648dd05e052bab711993c73cf7 [^]

Verifies issue 40504 : Added automated test 'I40504_VerifyCouponDistributionWithReceiptLines'

---
A src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/discounts_coupons/I40504_VerifyCouponDistributionWithReceiptLines.java
---
(0111034)
ranjith_qualiantech_com   
2019-04-09 09:08   
Test failing in modules suite
(0111038)
hgbot   
2019-04-09 10:50   
Repository: tools/automation/pi-mobile
Changeset: 8395d3ad257a5fe93db072c180b59c5057cb7354
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Tue Apr 09 14:19:57 2019 +0530
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/8395d3ad257a5fe93db072c180b59c5057cb7354 [^]

Verifies issue 40504 : Added waitFixOf for test 'Multidiscounts_RemoveMultiDiscountsByTotal'

---
M src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/multidiscounts/Multidiscounts_RemoveMultiDiscountsByTotal.java
---
(0111052)
hgbot   
2019-04-10 09:44   
Repository: erp/pmods/org.openbravo.retail.discounts.bytotal
Changeset: 1906dc3d194e5bfa0de8ddb38fd4f7dbeb9de5e5
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Wed Apr 10 13:14:23 2019 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.bytotal/rev/1906dc3d194e5bfa0de8ddb38fd4f7dbeb9de5e5 [^]

Related to issue 40504 : Reverted changes in preApplyAutomaticDiscountHook which removes the necessary discounts

* Backed out changeset: d37c97ec169b

---
M web/org.openbravo.retail.discounts.bytotal/js/preApplyAutomaticDiscountHook.js
---
(0111053)
hgbot   
2019-04-10 09:45   
Repository: tools/automation/pi-mobile
Changeset: c9cda53cf012f074ffe45907e2a822668ab89cde
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Wed Apr 10 13:15:13 2019 +0530
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/c9cda53cf012f074ffe45907e2a822668ab89cde [^]

Verifies issue 40504 : Removed waitFixOf for test 'Multidiscounts_RemoveMultiDiscountsByTotal'

---
M src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/multidiscounts/Multidiscounts_RemoveMultiDiscountsByTotal.java
---
(0111138)
adrianromero   
2019-04-15 14:46   
Verified