Openbravo Issue Tracking System - Retail Modules
View Issue Details
0040007Retail ModulesDiscount Matrix Managementpublic2019-01-23 11:572019-11-28 16:22
malsasua 
ranjith_qualiantech_com 
highmajoralways
closedfixed 
5
 
RR19Q2 
jorge-garcia
Production - Confirmed Stable
2018-02-05
RR18Q2
https://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/e8a94369c01f [^]
No
0040007: Receipt with discounts can not be completed
with the module Discount Matrix Management, if one line is added with a discretionary discount, it is not possible to complete the receipt. When click in total button is done, error is returned:
Uncaught dodivide(): Divide by 0
POS:
. new receipt:
. add Avalanche Transceiver
. click discount button: add disc_fixed_5_euro
. click in total button

in cosole, error is returned:
Uncaught dodivide(): Divide by 0
Attached a possible fix
No tags attached.
related to defect 0039536 closed ranjith_qualiantech_com [RR18Q4] Total Amount discounts get removed when splitting lines 
depends on backport 0040154RR19Q1 closed ranjith_qualiantech_com Receipt with discounts can not be completed 
depends on backport 0040155RR18Q4.2 closed ranjith_qualiantech_com Receipt with discounts can not be completed 
depends on backport 0040156RR18Q3.5 closed ranjith_qualiantech_com Receipt with discounts can not be completed 
causes defect 0040286 closed ranjith_qualiantech_com Receipt with discounts can not be completed 
diff posibleFix40007.diff (1,184) 2019-01-23 12:04
https://issues.openbravo.com/file_download.php?file_id=12530&type=bug
patch issue 40007 source discountmatrixmanagement.patch (1,435) 2019-02-05 09:12
https://issues.openbravo.com/file_download.php?file_id=12616&type=bug
Issue History
2019-01-23 11:57malsasuaNew Issue
2019-01-23 11:57malsasuaAssigned To => Retail
2019-01-23 11:57malsasuaResolution time => 1548543600
2019-01-23 11:57malsasuaRegression level => Production - Confirmed Stable
2019-01-23 11:57malsasuaTriggers an Emergency Pack => No
2019-01-23 12:04malsasuaFile Added: posibleFix40007.diff
2019-01-23 12:04malsasuaProposed Solution updated
2019-01-23 15:02ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2019-01-23 15:02ranjith_qualiantech_comStatusnew => scheduled
2019-01-28 07:22ranjith_qualiantech_comRelationship addedrelated to 0039536
2019-01-28 08:20hgbotCheckin
2019-01-28 08:20hgbotNote Added: 0109265
2019-01-28 12:55hgbotCheckin
2019-01-28 12:55hgbotNote Added: 0109273
2019-01-28 12:55hgbotStatusscheduled => resolved
2019-01-28 12:55hgbotResolutionopen => fixed
2019-01-28 12:55hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/80f1109499f38e1f7d8a6123aead1ef6b126480c [^]
2019-01-28 12:55hgbotCheckin
2019-01-28 12:55hgbotNote Added: 0109274
2019-01-28 12:55hgbotCheckin
2019-01-28 12:55hgbotNote Added: 0109275
2019-02-04 17:16jorge-garciaNote Added: 0109537
2019-02-04 17:16jorge-garciaStatusresolved => new
2019-02-04 17:16jorge-garciaResolutionfixed => open
2019-02-04 17:40jorge-garciaReview Assigned To => jorge-garcia
2019-02-05 09:01hgbotCheckin
2019-02-05 09:01hgbotNote Added: 0109563
2019-02-05 09:03hgbotCheckin
2019-02-05 09:03hgbotNote Added: 0109565
2019-02-05 09:12ranjith_qualiantech_comFile Added: issue 40007 source discountmatrixmanagement.patch
2019-02-05 12:52ranjith_qualiantech_comStatusnew => scheduled
2019-02-05 12:52ranjith_qualiantech_comStatusscheduled => resolved
2019-02-05 12:52ranjith_qualiantech_comResolutionopen => fixed
2019-02-06 09:55jorge-garciaNote Added: 0109620
2019-02-06 09:55jorge-garciaStatusresolved => new
2019-02-06 09:55jorge-garciaResolutionfixed => open
2019-02-06 09:55jorge-garciaStatusnew => scheduled
2019-02-06 09:55jorge-garciaStatusscheduled => resolved
2019-02-06 09:55jorge-garciaFixed in Version => RR19Q2
2019-02-06 09:55jorge-garciaResolutionopen => fixed
2019-02-06 09:55jorge-garciaNote Added: 0109621
2019-02-06 09:55jorge-garciaStatusresolved => closed
2019-02-06 10:00jorge-garciaRegression date => 2018-02-05
2019-02-06 10:00jorge-garciaRegression introduced in release => RR18Q2
2019-02-06 10:00jorge-garciaRegression introduced by commit => https://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/e8a94369c01f [^]
2019-02-27 16:51LeyreRelationship addedcauses 0040286
2019-11-28 16:22hgbotCheckin
2019-11-28 16:22hgbotNote Added: 0115952

Notes
(0109265)
hgbot   
2019-01-28 08:20   
Repository: erp/pmods/org.openbravo.retail.discounts.bytotal
Changeset: 054a73439f878c47bcfbd2e699c78fd88420acd7
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Mon Jan 28 12:50:31 2019 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.bytotal/rev/054a73439f878c47bcfbd2e699c78fd88420acd7 [^]

Related to issue 40007 : New attribute lineQtyOffer is added to promotion

* For MultiDiscount support, qtyOffer has been set as 0.
  But qtyOffer has been used in few modules to calculate custome discount.
  So new attribute "lineQtyOffer" is added to promotion which holds the value of line qty
* Attribute "pendingQtyOffer" is added for above case, but same property is used in fillPromotionsStandard in calculateReceipt process
  So "pendingQtyOffer" is replaced with "lineQtyOffer"

---
M web/org.openbravo.retail.discounts.bytotal/js/promotion-by-total-utils.js
---
(0109273)
hgbot   
2019-01-28 12:55   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 80f1109499f38e1f7d8a6123aead1ef6b126480c
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Mon Jan 28 17:25:16 2019 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/80f1109499f38e1f7d8a6123aead1ef6b126480c [^]

Fixed issue 40007 : New attribute lineQtyOffer is added to promotion

* For MultiDiscount support, qtyOffer has been set as 0.
  But qtyOffer has been used in few modules to calculate custome discount.
  So new attribute "lineQtyOffer" is added to promotion which holds the value of line qty
  When spliting the line, lineQtyOffer is updated based on obdiscQtyoffer

---
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0109274)
hgbot   
2019-01-28 12:55   
Repository: erp/pmods/org.openbravo.retail.discounts
Changeset: 057d37aaab37ae0244391b5eeea5e16a587e1253
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Mon Jan 28 17:25:36 2019 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/057d37aaab37ae0244391b5eeea5e16a587e1253 [^]

Related to issue 40007 : New attribute lineQtyOffer is added to promotion

* For MultiDiscount support, qtyOffer has been set as 0.
  But qtyOffer has been used in few modules to calculate custome discount.
  So new attribute "lineQtyOffer" is added to promotion which holds the value of line qty

---
M web/org.openbravo.retail.discounts/js/promotion-manual.js
---
(0109275)
hgbot   
2019-01-28 12:55   
Repository: erp/pmods/org.openbravo.retail.discounts.discountmatrixmanagement
Changeset: c21e897e012af3fc8e6db202318aacb56df34a4b
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Mon Jan 28 17:25:24 2019 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.discountmatrixmanagement/rev/c21e897e012af3fc8e6db202318aacb56df34a4b [^]

Related to issue 40007 : New attribute lineQtyOffer is added to promotion

* For MultiDiscount support, qtyOffer has been set as 0.
  But qtyOffer has been used in few modules to calculate custome discount.
  So new attribute "lineQtyOffer" is added to promotion which holds the value of line qty

---
M web/org.openbravo.retail.discounts.discountmatrixmanagement/js/hookRoleDiscounts.js
---
(0109537)
jorge-garcia   
2019-02-04 17:16   
It is possible we had found the original fix for this scenario in a missing patch that was never pushed to main repository of discount matrix management.
(0109563)
hgbot   
2019-02-05 09:01   
Repository: erp/pmods/org.openbravo.retail.discounts.discountmatrixmanagement
Changeset: b6f152a1ed2b0613fa2cb122eb656eabc8fb9872
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Tue Feb 05 13:31:35 2019 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.discountmatrixmanagement/rev/b6f152a1ed2b0613fa2cb122eb656eabc8fb9872 [^]

Related to issue 40007 : Backed out changeset: c21e897e012a

---
M web/org.openbravo.retail.discounts.discountmatrixmanagement/js/hookRoleDiscounts.js
---
(0109565)
hgbot   
2019-02-05 09:03   
Repository: erp/pmods/org.openbravo.retail.discounts.discountmatrixmanagement
Changeset: 54faf346af7083b97d21e6d816d1742968dc462c
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Tue Feb 05 13:33:45 2019 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts.discountmatrixmanagement/rev/54faf346af7083b97d21e6d816d1742968dc462c [^]

Related to issue 40007 : Discount Should be calculated from discount models which are not hidden

* If qtyOffer is ZERO, for Discount calculation line qty must be used

---
M web/org.openbravo.retail.discounts.discountmatrixmanagement/js/hookRoleDiscounts.js
---
(0109620)
jorge-garcia   
2019-02-06 09:55   
Reopened to create backports
(0109621)
jorge-garcia   
2019-02-06 09:55   
Code reviewed and tested
(0115952)
hgbot   
2019-11-28 16:22   
Repository: tools/automation/pi-mobile
Changeset: 6398cb96a2e5c841da43e517806cf312561fa9cc
Author: Fidel <fidel.campos <at> doceleguas.com>
Date: Wed Nov 27 11:06:01 2019 -0500
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/6398cb96a2e5c841da43e517806cf312561fa9cc [^]

Related to issue 40007: Added automated test I40007_VerifyErrorWhenAddDiscFixed5Euro

---
A src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/discounts_bytotal/I40007_VerifyErrorWhenAddDiscFixed5Euro.java
---