Openbravo Issue Tracking System - Retail Modules
View Issue Details
0043203Retail ModulesDiscounts and Promotionspublic2020-02-13 08:102020-03-20 17:54
psarobe 
ranjith_qualiantech_com 
urgentmajoralways
closedfixed 
5
pi 
RR20Q2 
marvintm
Production - QA Approved
2019-08-02
RR19Q4
https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/file/711d273a9a3a/web/org.openbravo.retail.posterminal/js/model/order.js [^]
No
0043203: Discounts with Characteristics. Having diferent characteristics work as "OR" instead of "AND"
If you have two characterstics:
- Season
- Brand

And you use these two in the characteristic tab as:
- Season: 2019
- Brand: Gucci

Instead of applying the discount to the products that are in season 2019 and Gucci is applying to either product in season 2019 or with brand Gucci

Update: After analyze
Prior to discount refactor -> Working as OR -> match with above description -> Applying for products with at least one of the characteristics
After discounts refactor -> Working as AND -> only apply for products with both characteristics
1. Create two characteristics with values
2. In the discount and promotion window select price adjustment with 10%
3. Move to the Characteristics tab and add these two characteristics and with value in each.
4. Go to POS and see the result.

Expected result:
- Only for products that are season 2019 and Gucci

Current result:
- It is applying to either products that in season 2019 or Gucci
This is the expected behaviour with the current definition. We need to improve the configuration options so that we can support both ways of working.

The proposal is the following:
- First we need to change the configuration options of the "Included characteristics". We need to replace the "Only the values defined" by "Any of the ones defined" (change only the displayed value, we should not change the internal value of the reflist to preserve the compatibility with previous data), and we need to add a new one called "All of the values defined".
- After that we need to change the discount-rules.js file (specifically the isApplicableToLine function), to take into account this new value, so that if it is set, all characteristic values specified in the discount need to be present in the product for the discount to be applicable to the line.


Update: After analyze
-> return to previous behavior -> OR
-> add new behavior -> AND
No tags attached.
depends on backport 0043282RR20Q1 closed ranjith_qualiantech_com Discounts with Characteristics. Having diferent characteristics work as "OR" instead of "AND" 
depends on backport 0043283RR19Q4.2 closed ranjith_qualiantech_com Discounts with Characteristics. Having diferent characteristics work as "OR" instead of "AND" 
related to feature request 0043204 closed Retail Discounts with Characteristics. It is not possible to create exceptions within characteristics. 
Issue History
2020-02-13 08:10psarobeNew Issue
2020-02-13 08:10psarobeAssigned To => Retail
2020-02-13 08:10psarobeTriggers an Emergency Pack => No
2020-02-13 08:11martinsdanIssue Monitored: martinsdan
2020-02-13 08:31martinsdanRelationship addedrelated to 0043204
2020-02-13 09:06marvintmProposed Solution updated
2020-02-14 08:43guilleaerResolution time => 1583276400
2020-02-17 12:58ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2020-02-17 12:58ranjith_qualiantech_comStatusnew => scheduled
2020-02-17 13:31ranjith_qualiantech_comNote Added: 0117856
2020-02-20 10:12ranjith_qualiantech_comNote Added: 0117961
2020-02-20 15:17hgbotCheckin
2020-02-20 15:17hgbotNote Added: 0117974
2020-02-20 15:17hgbotCheckin
2020-02-20 15:17hgbotNote Added: 0117975
2020-02-20 15:17hgbotStatusscheduled => resolved
2020-02-20 15:17hgbotResolutionopen => fixed
2020-02-20 15:17hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/38d39c4d560b2115a78f3dd41bd579e89c195124 [^]
2020-02-20 15:26guilleaerNote Deleted: 0117856
2020-02-20 15:31ranjith_qualiantech_comRegression level => Production - QA Approved
2020-02-20 15:31ranjith_qualiantech_comRegression date => 2019-08-02
2020-02-20 15:31ranjith_qualiantech_comRegression introduced in release => RR19Q4
2020-02-20 15:31ranjith_qualiantech_comRegression introduced by commit => https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/file/711d273a9a3a/web/org.openbravo.retail.posterminal/js/model/order.js [^]
2020-02-20 15:31ranjith_qualiantech_comNote Added: 0117976
2020-02-20 15:31ranjith_qualiantech_comStatusresolved => new
2020-02-20 15:31ranjith_qualiantech_comResolutionfixed => open
2020-02-20 15:31ranjith_qualiantech_comStatusnew => scheduled
2020-02-20 15:32ranjith_qualiantech_comStatusscheduled => resolved
2020-02-20 15:32ranjith_qualiantech_comResolutionopen => fixed
2020-02-20 17:09guilleaerDescription Updatedbug_revision_view_page.php?rev_id=20417#r20417
2020-02-20 17:09guilleaerProposed Solution updated
2020-02-20 19:39marvintmReview Assigned To => marvintm
2020-02-20 19:39marvintmStatusresolved => closed
2020-02-20 19:39marvintmFixed in Version => RR20Q2
2020-02-21 05:58hgbotCheckin
2020-02-21 05:58hgbotNote Added: 0117992
2020-02-27 18:33rafarodaIssue Monitored: rafaroda
2020-03-17 13:19hgbotCheckin
2020-03-17 13:19hgbotNote Added: 0118642
2020-03-20 17:54hudsonbotCheckin
2020-03-20 17:54hudsonbotNote Added: 0118737

Notes
(0117961)
ranjith_qualiantech_com   
2020-02-20 10:12   
Updated Sampledata
https://code.openbravo.com/erp/pmods-branches/org.openbravo.test.mobile.sampledata/rev/87fe0ab4e4b8 [^]
(0117974)
hgbot   
2020-02-20 15:17   
Repository: erp/devel/pi
Changeset: 872551aee83f5f6aa034dd974727f801c98d26c5
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Thu Feb 20 19:47:12 2020 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/872551aee83f5f6aa034dd974727f801c98d26c5 [^]

Related to issue 43203 : Added Reference List for Characteristics Offers

* New Reference List is created for Characteristics Offers Definition
  a) All excluding defined
  b) Any of the ones defined (Only those defined)
  c) All of the values defined (Discount will be applied
     only if all Characteristics is available in product)

---
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_REFERENCE.xml
M src-db/database/sourcedata/AD_REF_LIST.xml
---
(0117975)
hgbot   
2020-02-20 15:17   
Repository: erp/pmods/org.openbravo.retail.discounts
Changeset: 38d39c4d560b2115a78f3dd41bd579e89c195124
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Thu Feb 20 19:47:35 2020 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/38d39c4d560b2115a78f3dd41bd579e89c195124 [^]

Fixed issue 43203 : Updated Discount Calculation for Characteristics Definition

* Characteristics Definition is updated
  a) All excluding defined
  b) Any of the ones defined (Only those defined)
  c) All of the values defined (Discount will be applied only if all Characteristics is available in product)

---
M src-test/org/openbravo/retail/discounts/test/base/model/DiscountRule.java
M src-test/org/openbravo/retail/discounts/test/base/model/OfferCharacteristic.java
M src-test/org/openbravo/retail/discounts/test/base/model/ProductCharacteristic.java
M src-test/org/openbravo/retail/discounts/test/unittests/DiscountPriceAdjusmentTest.java
M web/org.openbravo.retail.discounts/js/discountsengine/common/discount-rules.js
---
(0117976)
ranjith_qualiantech_com   
2020-02-20 15:31   
Reopening to create backports
(0117992)
hgbot   
2020-02-21 05:58   
Repository: erp/pmods/org.openbravo.retail.discounts
Changeset: 0d11298c1f4ccaa20c5ae4f23b8764046002dd69
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Fri Feb 21 10:28:04 2020 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/0d11298c1f4ccaa20c5ae4f23b8764046002dd69 [^]

Related to issue 43203 : Disabled Unit Test

---
M src-test/org/openbravo/retail/discounts/test/unittests/DiscountPriceAdjusmentTest.java
---
(0118642)
hgbot   
2020-03-17 13:19   
Repository: retail/backports/3.0RR20Q1/pi-mobile
Changeset: 09ca2c51134db500ce873c7ecfc598da686e4080
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Tue Mar 17 17:41:40 2020 +0530
URL: http://code.openbravo.com/retail/backports/3.0RR20Q1/pi-mobile/rev/09ca2c51134db500ce873c7ecfc598da686e4080 [^]

Stabilized Test C360CheckStatistics.java

* Disabled tests which are failing due to issue 43203

---
M src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/certification_france/OBCFRTicket.java
M src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/discounts_bytotal/I39536_VerifyTotalDiscountWithSplitLines.java
M src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/discounts_scaledprice/I40478_VerifyScaledDiscountWithLowerPrice.java
M src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/multidiscounts/Multidiscounts_ChangeLineQuantitiesWithByTotals.java
M src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/multidiscounts/Multidiscounts_RemoveMultiDiscountsByTotal.java
M src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/restaurants/VerifySubstitutedProductWithNotes.java
M src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/splitline/SplitLineWithAutomaticPromoCombos.java
M src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/splitline/SplitLineWithAutomaticPromoDiscPerTotalAmt.java
M src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/splitline/SplitLineWithAutomaticPromoFreeProdPerTotalAmt.java
M src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/splitline/SplitLineWithAutomaticPromoFreeProdScaledPriceAndManualPromo.java
M src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/splitline/SplitLineWithAutomaticPromoPercentDiscPerTotalAmt.java
M src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/splitline/SplitLineWithAutomaticPromoScaledPrice.java
M src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/stockvalidation/I34089_OrderFromQuotationAllowNegativeStock.java
M src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/stockvalidation/I34089_OrderFromQuotationNotAllowNegativeStock.java
M src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/stockvalidation/I34092_OrderStockValidationMultiReceipt.java
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/customer/C360CheckStatistics.java
---
(0118737)
hudsonbot   
2020-03-20 17:54   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/b31620115262 [^]
Maturity status: Test