Openbravo Issue Tracking System - Retail Modules
View Issue Details
0040666Retail ModulesDiscounts and Promotionspublic2019-04-24 11:092019-05-30 15:52
Leyre 
ranjith_qualiantech_com 
highmajoralways
closedfixed 
5
 
RR19Q3 
jorge-garcia
No
0040666: Several discounts do not apply to all lines
Several discounts do not apply to all lines
BACKEND:
https://livebuilds.openbravo.com/retail_modules_pgsql_pi [^]

1. Define a discount type "User Defined Amount"
2. Define a discount type "Variable Discount per Total Amount"

WEB POS:
https://livebuilds.openbravo.com/retail_modules_pgsql_pi/web/org.openbravo.retail.posterminal/?terminal=VBS-1 [^]

1. Add three units of a product, for example: Avalanche transceiver. This product must be marked as "non grouped"
2. Add the first defined discount -> User Defined Amount
3. Add the second defined discount -> Variable Discount per Total Amount

Verify that the last discount does not apply to all lines.
No tags attached.
related to defect 0040812 closed ranjith_qualiantech_com If a manual discount is applied to an order, it is not possible to apply it again. It will remain the first discount 
causes defect 0041097 closed ranjith_qualiantech_com When adding multiple discounts the override functionality is not working as expected under certain conditions 
patch issue 40666 source discountsbytotal.patch (1,137) 2019-04-29 15:40
https://issues.openbravo.com/file_download.php?file_id=12895&type=bug
patch issue 40666 source pi-mobile.patch (6,044) 2019-04-30 07:55
https://issues.openbravo.com/file_download.php?file_id=12898&type=bug
Issue History
2019-04-24 11:09LeyreNew Issue
2019-04-24 11:09LeyreAssigned To => Retail
2019-04-24 11:09LeyreResolution time => 1557871200
2019-04-24 11:09LeyreTriggers an Emergency Pack => No
2019-04-25 11:41ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2019-04-25 11:41ranjith_qualiantech_comStatusnew => scheduled
2019-04-26 11:18marvintmSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=18681#r18681
2019-04-26 11:18marvintmSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=18682#r18682
2019-04-29 15:40ranjith_qualiantech_comFile Added: issue 40666 source discountsbytotal.patch
2019-04-30 07:55ranjith_qualiantech_comFile Added: issue 40666 source pi-mobile.patch
2019-05-03 08:32hgbotCheckin
2019-05-03 08:32hgbotNote Added: 0111454
2019-05-03 11:43hgbotCheckin
2019-05-03 11:43hgbotNote Added: 0111468
2019-05-03 14:06hgbotCheckin
2019-05-03 14:06hgbotNote Added: 0111477
2019-05-04 09:04hgbotCheckin
2019-05-04 09:04hgbotNote Added: 0111481
2019-05-04 12:44hgbotCheckin
2019-05-04 12:44hgbotNote Added: 0111482
2019-05-04 12:44ranjith_qualiantech_comStatusscheduled => resolved
2019-05-04 12:44ranjith_qualiantech_comResolutionopen => fixed
2019-05-09 15:43jorge-garciaReview Assigned To => jorge-garcia
2019-05-09 15:44jorge-garciaNote Added: 0111604
2019-05-09 15:44jorge-garciaStatusresolved => closed
2019-05-09 15:44jorge-garciaFixed in Version => RR19Q3
2019-05-15 10:15LeyreRelationship addedcauses 0040881
2019-05-15 11:06LeyreRelationship deletedcauses 0040881
2019-05-27 11:52jorgewederagoNote Added: 0112162
2019-05-27 11:52jorgewederagoStatusclosed => new
2019-05-27 11:52jorgewederagoResolutionfixed => open
2019-05-27 11:52jorgewederagoFixed in VersionRR19Q3 =>
2019-05-27 11:52jorgewederagoRelationship addedrelated to 0040812
2019-05-27 15:28ranjith_qualiantech_comStatusnew => scheduled
2019-05-27 15:29ranjith_qualiantech_comNote Added: 0112179
2019-05-27 15:29ranjith_qualiantech_comStatusscheduled => resolved
2019-05-27 15:29ranjith_qualiantech_comResolutionopen => fixed
2019-05-30 15:52jorge-garciaNote Added: 0112273
2019-05-30 15:52jorge-garciaStatusresolved => closed
2019-05-30 15:52jorge-garciaFixed in Version => RR19Q3
2019-06-24 11:15ranjith_qualiantech_comRelationship addedcauses 0041097

Notes
(0111454)
hgbot   
2019-05-03 08:32   
Repository: erp/pmods/org.openbravo.retail.discounts.bytotal
Changeset: 76c3dce67191de78e51842320809f87f68949df1
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Fri May 03 12:02:09 2019 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.bytotal/rev/76c3dce67191de78e51842320809f87f68949df1 [^]

Related to issue 40666 : Discount by Total should be calculated again when PreApplyAutomaticDiscount hook is called

* When PreApplyAutomaticDiscount hook is called, line orderManualPromotionsAlreadyApplied should be set as false
  for recalculating the discount by total.

---
M web/org.openbravo.retail.discounts.bytotal/js/preApplyAutomaticDiscountHook.js
---
(0111468)
hgbot   
2019-05-03 11:43   
Repository: erp/pmods/org.openbravo.retail.discounts.bytotal
Changeset: 475ed764a500f00d99f788e1ce5f90dbde0ccb1a
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Fri May 03 15:13:14 2019 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.bytotal/rev/475ed764a500f00d99f788e1ce5f90dbde0ccb1a [^]

Related to issue 40666 : Discount by Total should be calculated again when PreApplyAutomaticDiscount hook is called

* When PreApplyAutomaticDiscount hook is called, line orderManualPromotionsAlreadyApplied should be set as false
  for recalculating the discount by total only if product is non grouped.

---
M web/org.openbravo.retail.discounts.bytotal/js/preApplyAutomaticDiscountHook.js
---
(0111477)
hgbot   
2019-05-03 14:06   
Repository: erp/pmods/org.openbravo.retail.discounts.bytotal
Changeset: 4e94d834773131e44f244186f2f4d5fa1bed88f1
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Fri May 03 17:35:58 2019 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.bytotal/rev/4e94d834773131e44f244186f2f4d5fa1bed88f1 [^]

Related to issue 40666 : Backed out changeset: 475ed764a500

---
M web/org.openbravo.retail.discounts.bytotal/js/preApplyAutomaticDiscountHook.js
---
(0111481)
hgbot   
2019-05-04 09:04   
Repository: erp/pmods/org.openbravo.retail.discounts.bytotal
Changeset: cd409d69cbafa07ffc091a78953beb63cb0e6d07
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Sat May 04 12:33:53 2019 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.bytotal/rev/cd409d69cbafa07ffc091a78953beb63cb0e6d07 [^]

Related to issue 40666 : Discount by Total should be calculated again when PreApplyAutomaticDiscount hook is called

* When PreApplyAutomaticDiscount hook is called, line orderManualPromotionsAlreadyApplied should be set as false
  for recalculating the discount by total only if product is non grouped.

---
M web/org.openbravo.retail.discounts.bytotal/js/preApplyAutomaticDiscountHook.js
---
(0111482)
hgbot   
2019-05-04 12:44   
Repository: tools/automation/pi-mobile
Changeset: d0dd0843aae82d79b249635c0d4d47b61238f0a9
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Sat May 04 16:14:33 2019 +0530
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/d0dd0843aae82d79b249635c0d4d47b61238f0a9 [^]

Verifies issue 40666 : Added automated test 'I40666_VerifyTotalDiscountWithNonGroupedProduct'

---
M src-test/org/openbravo/test/mobile/retail/pack/selenium/TestIdPack.java
A src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/discounts_bytotal/I40666_VerifyTotalDiscountWithNonGroupedProduct.java
---
(0111604)
jorge-garcia   
2019-05-09 15:43   
Code reviewed and tested
(0112162)
jorgewederago   
2019-05-27 11:52   
If the same case is done with one product marked as non grouped and another one marked as grouped. The one marked as grouped will have the discount applied twice.

Steps to reproduce the issue in pi with modules:
*Add Avalanche Transciever
*Add GPS Handheld (is ok to use the default discount in the environment)
*Select the GPS Handheld line and add the discount disc_5_var_euro - 5 EUR to the line
*Add a new discount: Variable Perfecntage Discount by Total 23%
*Check that the Avalanche Transciever will have the discount applied twice.
(0112179)
ranjith_qualiantech_com   
2019-05-27 15:29   
Fixed in https://issues.openbravo.com/view.php?id=40812 [^]
Changeset: https://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.bytotal/rev/2b9c28f2fe3250e21cf413407157e38ffef9dd55 [^]
(0112273)
jorge-garcia   
2019-05-30 15:52   
Code reviewed and tested