Openbravo Issue Tracking System - Retail Modules
View Issue Details
0031390Retail ModulesDiscounts and Promotionspublic2015-08-04 13:412015-12-03 18:01
malsasua 
jorge-garcia 
highmajoralways
closedfixed 
20Community Appliance
 
RR15Q3.3RR15Q3.3 
guilleaer
No
0031390: infinite loop with discounts of type "Buy X pay Y of different product"
when there are several discounts of type "Buy X pay Y of different product", and several products are added to receipt, then the total button never is enabled. Infinite loop in discount executor

note: with old flow discount is working fine
. in back office:
 . go to discount and promotions window
 . create three new discounts:
  disc1: see disc1 attached
  disc2: see disc2 attached
  disc3: see disc3 attached

. in web pos
 . create a new receipt (see receipt.png attached). Add the products quickly

total button never is enabled
No tags attached.
has duplicate defect 0029522 closed jorge-garcia [RR15Q3 & RR15Q2.4] Adding products fast enough makes product discount disappear 
blocks defect 0030498 closed jorge-garcia infinite loop with discounts of type "Buy X pay Y of different product" 
Issue History
2015-11-06 11:01jorge-garciaTypedefect => backport
2015-11-06 11:01jorge-garciaTarget Version => RR15Q3.3
2015-11-06 11:10jorge-garciaRelationship addedhas duplicate 0029522
2015-11-25 08:42hgbotCheckin
2015-11-25 08:42hgbotNote Added: 0082310
2015-11-25 08:42hgbotStatusscheduled => resolved
2015-11-25 08:42hgbotResolutionopen => fixed
2015-11-25 08:42hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/92e150fb18152d7831b7cfbe74329e5582a0eaf9 [^] => http://code.openbravo.com/retail/backports/3.0RR15Q3.3/org.openbravo.retail.posterminal/rev/72d3ee12d66bfa9e30986477eaeecd3ce8334d0a [^]
2015-11-25 08:42hgbotCheckin
2015-11-25 08:42hgbotNote Added: 0082311
2015-11-25 08:42hgbotCheckin
2015-11-25 08:42hgbotNote Added: 0082312
2015-12-03 18:01guilleaerReview Assigned Tomarvintm => guilleaer
2015-12-03 18:01guilleaerStatusresolved => closed
2015-12-03 18:01guilleaerFixed in Version => RR15Q3.3

Notes
(0082310)
hgbot   
2015-11-25 08:42   
Repository: retail/backports/3.0RR15Q3.3/org.openbravo.retail.posterminal
Changeset: 72d3ee12d66bfa9e30986477eaeecd3ce8334d0a
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Fri Nov 06 11:20:43 2015 +0100
URL: http://code.openbravo.com/retail/backports/3.0RR15Q3.3/org.openbravo.retail.posterminal/rev/72d3ee12d66bfa9e30986477eaeecd3ce8334d0a [^]

Fixed issue 31390: infinite loop with discounts of type "Buy X pay Y of
different product"

It's necessary to set two flags in the applyDiscounts process.
“IsBeingDiscounted” indicates that the process is running. The second,
“reApplyDiscounts” is set to true if the applyDiscounts process is called more
than once, applying the discounts only one more time.

This way, the process doesn't do an infinite loop calculating discounts.

---
M web/org.openbravo.retail.posterminal/js/model/discounts.js
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0082311)
hgbot   
2015-11-25 08:42   
Repository: retail/backports/3.0RR15Q3.3/org.openbravo.retail.posterminal
Changeset: 88deb600cc7ab96a2a6209513de2862aadd8dc92
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Thu Nov 19 10:40:09 2015 +0100
URL: http://code.openbravo.com/retail/backports/3.0RR15Q3.3/org.openbravo.retail.posterminal/rev/88deb600cc7ab96a2a6209513de2862aadd8dc92 [^]

Related to issue 31390: infinite loop with discounts of type "Buy X pay Y of
different products

It's necessary to set applyPromotions to false when setting the order type.
If not, calculateGross is never execute.

---
M web/org.openbravo.retail.posterminal/js/model/order.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/pointofsale.js
---
(0082312)
hgbot   
2015-11-25 08:42   
Repository: retail/backports/3.0RR15Q3.3/org.openbravo.retail.posterminal
Changeset: 2b3dcd5c13acc99d5e0f2bbef7960a779d1f4386
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Tue Nov 24 17:26:22 2015 +0100
URL: http://code.openbravo.com/retail/backports/3.0RR15Q3.3/org.openbravo.retail.posterminal/rev/2b3dcd5c13acc99d5e0f2bbef7960a779d1f4386 [^]

Related to issue 31390: infinite loop with discounts of type "Buy X pay Y
of different product

Need to add a receipt.calculateGross

---
M web/org.openbravo.retail.posterminal/js/model/order.js
---