Openbravo Issue Tracking System - Retail Modules
View Issue Details
0040620Retail ModulesWeb POSpublic2019-04-15 17:522019-04-24 12:18
xabiermerino 
jorge-garcia 
normalmajoralways
closedfixed 
5
 
RR19Q3 
adrianromero
No
0040620: The priority of promotions is not managed properly
We have three promotions:
Promotion 1.-
* Price adjustment;
* Fixed Price 140;
* Product Avalanche Transceiver;
* Priority: 400

Promotion 2.-
* Scaled Price;
* 1 unit 0% discount; 2 unit 50% discount
* All products
* Priority: 450

Promotion 3.-
* Discount per total amount;
* Total receipt 0; Amount 10
* For Avalanche transceiver
* Priority: 500
* Uses coupon
* Coupon code: COUPON10
Note: In customer environment this discounts is defined with any specific selection. (All excluding define -> no products defined)


The third promotions is applied in second place when it priority is less than promotion 2
1.- Log into webPOS
2.- Create a ticket
3.- Introduce Avalanche transceiver:
TICKET:
* Avalanceh transceiver 150,50€
   > Promotion 1 --> -10,50€
TOTAL: 140€

4.- Introduce Balaclava Cap. Second unit with 50% off is applied to the line with less price (avalanche)
TICKET:
* Avalanceh transceiver 150,50€
   > Promotion 1 --> Fixed price --> -10,50€
   > Promotion 2 --> 2ª Ud 50% ----> -70€ (OK)
* Balaclava CAP 169€
TOTAL: 239€

5.- Introduce COUPON10
TICKET:
* Avalanceh transceiver 150,50€
   > Promotion 1 --> Fixed price --> -10,50€
   > Promotion 3 --> Coupon --> WRONG: it has less priority of promotion 3
   > Promotion 2 --> 2ª Ud 50% ----> -65€ WRONG --> Now, 50% is applied for 130€ of avalanche (140-coupon10)
* Balaclava CAP 169€
TOTAL: 234€ --> WRONG


Promotion 3 has to be applied in third place. This should be the ticket:
TICKET:
* Avalanceh transceiver 150,50€
   > Promotion 1 --> Fixed price --> -10,50€
   > Promotion 2 --> 2ª Ud 50% ----> -70€
   > Promotion 3 --> Coupon -------> -10€
* Balaclava CAP 169€
TOTAL: 229€
No tags attached.
related to defect 0040460 closed ranjith_qualiantech_com Discounts by Total are not applied properly based on priority 
Issue History
2019-04-15 17:52xabiermerinoNew Issue
2019-04-15 17:52xabiermerinoAssigned To => Retail
2019-04-15 17:52xabiermerinoResolution time => 1555452000
2019-04-15 17:52xabiermerinoTriggers an Emergency Pack => No
2019-04-16 09:07ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2019-04-16 09:07ranjith_qualiantech_comStatusnew => scheduled
2019-04-16 09:14ranjith_qualiantech_comRelationship addedrelated to 0040460
2019-04-16 13:35guilleaerDescription Updatedbug_revision_view_page.php?rev_id=18635#r18635
2019-04-23 13:16jorge-garciaAssigned Toranjith_qualiantech_com => jorge-garcia
2019-04-24 08:40hgbotCheckin
2019-04-24 08:40hgbotNote Added: 0111250
2019-04-24 08:40hgbotCheckin
2019-04-24 08:40hgbotNote Added: 0111251
2019-04-24 08:40hgbotCheckin
2019-04-24 08:40hgbotNote Added: 0111252
2019-04-24 11:08hgbotCheckin
2019-04-24 11:08hgbotNote Added: 0111260
2019-04-24 11:08hgbotStatusscheduled => resolved
2019-04-24 11:08hgbotResolutionopen => fixed
2019-04-24 11:08hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/e2c852a8e323aae31e59d751f03f1c77efad5d74 [^]
2019-04-24 11:09hgbotCheckin
2019-04-24 11:09hgbotNote Added: 0111261
2019-04-24 12:18adrianromeroReview Assigned To => adrianromero
2019-04-24 12:18adrianromeroNote Added: 0111264
2019-04-24 12:18adrianromeroStatusresolved => closed
2019-04-24 12:18adrianromeroFixed in Version => RR19Q3

Notes
(0111250)
hgbot   
2019-04-24 08:40   
Repository: erp/pmods/org.openbravo.retail.discounts.bytotal
Changeset: 81b6d8f43909791b4b7c0ac9d853c8ae32e84475
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Tue Apr 23 17:36:06 2019 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.bytotal/rev/81b6d8f43909791b4b7c0ac9d853c8ae32e84475 [^]

Related to issue 40620: The priority of promotions is not managed properly

Set executedAtTheEndPromo attribute to by total discounts.

---
M web/org.openbravo.retail.discounts.bytotal/js/promotion-by-total-utils.js
M web/org.openbravo.retail.discounts.bytotal/js/promotion-discounttotal.js
M web/org.openbravo.retail.discounts.bytotal/js/promotion-freeitemstotal.js
M web/org.openbravo.retail.discounts.bytotal/js/promotion-percentagediscounttotal.js
---
(0111251)
hgbot   
2019-04-24 08:40   
Repository: erp/pmods/org.openbravo.retail.discounts.combo
Changeset: 8299b5a06bfa075a618448b8fdeed5c79d2a5f67
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Tue Apr 23 16:03:14 2019 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.combo/rev/8299b5a06bfa075a618448b8fdeed5c79d2a5f67 [^]

Related to issue 40620: The priority of promotions is not managed properly

Use new API getCurrentDiscountedLinePrice in Combos.

---
M web/org.openbravo.retail.discounts.combo/source/combo-rule-impl.js
---
(0111252)
hgbot   
2019-04-24 08:40   
Repository: erp/pmods/org.openbravo.retail.discounts.scaledprice
Changeset: b88c7274bedc51e5b5a0fab7600cf4c4bc207770
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Tue Apr 23 16:04:36 2019 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.scaledprice/rev/b88c7274bedc51e5b5a0fab7600cf4c4bc207770 [^]

Related to issue 40620: The priority of promotions is not managed properly

Use new API getCurrentDiscountedLinePrice in Scaled Price

---
M web/org.openbravo.retail.discounts.scaledprice/js/scaledprice.js
---
(0111260)
hgbot   
2019-04-24 11:08   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: e2c852a8e323aae31e59d751f03f1c77efad5d74
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Tue Apr 23 15:58:16 2019 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/e2c852a8e323aae31e59d751f03f1c77efad5d74 [^]

Fixed issue 40620: The priority of promotions is not managed properly

In some cases (like with discounts by total with a limit of 0) the
discountedLinePrice of a line could not be correctly calculated once a new
multi-line promotion is being applied.

To avoid this incorrect behavior, a new API function has been created to get
the current discounted line price ignoring those promotions applied at the end
of all possible promotions (like by total).

Use new API getCurrentDiscountedLinePrice in Price Adjustment.

---
M web/org.openbravo.retail.posterminal/js/model/discounts.js
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0111261)
hgbot   
2019-04-24 11:09   
Repository: erp/pmods/org.openbravo.retail.discounts
Changeset: 29a4f865ad55f700384034dba112727ce530afb8
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Tue Apr 23 16:02:26 2019 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/29a4f865ad55f700384034dba112727ce530afb8 [^]

Related to issue 40620: The priority of promotions is not managed properly

Use new API getCurrentDiscountedLinePrice in:
  * Buy X Pay Y Same products.
  * Buy X Gift Y.
  * Manual Promotions.
  * Packs.
  * Fixed Percentage Discount.

---
M web/org.openbravo.retail.discounts/js/promotion-XYsameProduct.js
M web/org.openbravo.retail.discounts/js/promotion-buyXgiftY.js
M web/org.openbravo.retail.discounts/js/promotion-discount.js
M web/org.openbravo.retail.discounts/js/promotion-manual.js
M web/org.openbravo.retail.discounts/js/promotion-pack.js
---
(0111264)
adrianromero   
2019-04-24 12:18   
Verified.