Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0039392
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Discounts and Promotionsmajoralways2018-10-02 17:012018-11-22 10:27
ReporterlbressanView Statuspublic 
Assigned Toranjith_qualiantech_com 
PriorityhighResolutionfixedFixed in VersionRR19Q1
StatusclosedFix in branchFixed in SCM revision2e5923e545df
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionRR18Q1.1SCM revision 
Review Assigned Tomarvintm
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0039392: Division by zero error when several products are included in both a pack discount and another discount.

DescriptionWhen products that belong to a pack discount, are also included in a higher priority discount, a "division by zero" error may occur.
Steps To ReproduceDefine a Pack discount with more than 1 product:
    Pack discount:
        - Apply next discount = Yes
        - Priority = 2
        - Product A
        - Product B

Define a Price Adjustment discount with the same products
    Price Adjustment discount:
        - Apply next discount = Yes
        - Priority = 1
        - Product A
        - Product B

Create a Sales Order and press the "Add Pack" button.
Select the "Pack discount" just created.
A division by zero error should display, while executing OBDISC_Pack function.

The same error is visible if manually adding pack products and then Booking the Sales Order.

The issue is in the OBDISC_Pack, with a variable v_totalAmount. This variable starts as 0 and gets filled in a loop, but if this loops is not executed, then a division by zero will occur.
With the above configuration, for one specific orderline, the loop won't be executed and then the error happens.
TagsNo tags attached.
Attached Filespng file icon Screen Shot 2018-10-04 at 16.14.38.png [^] (439,310 bytes) 2018-10-04 21:17
png file icon Screen Shot 2018-10-04 at 16.14.52.png [^] (425,516 bytes) 2018-10-04 21:17
png file icon Screen Shot 2018-10-04 at 16.15.13.png [^] (289,826 bytes) 2018-10-04 21:18
png file icon Screen Shot 2018-10-04 at 16.15.26.png [^] (302,334 bytes) 2018-10-04 21:18

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0107135)
jorge-garcia (reporter)
2018-10-03 12:31
edited on: 2018-10-03 12:32

Issue is not reproducible neither PI nor 3.0RR18Q1.1

(0107163)
lbressan (developer)
2018-10-04 21:22
edited on: 2018-10-04 21:23

I added some screentshots that contain some examples in order to reproduce the error, and the error itself. These are in 3.0RR18Q3.1, but I also reproduced it in 18Q1.1.
I apologize if I missed any detail in the issue description that is present on these screenshot.

Let me know if you still cant reproduce the error.

(0107866)
hgbot (developer)
2018-11-13 07:37

Repository: erp/pmods/org.openbravo.retail.discounts
Changeset: 816f4f4497b14682e2029d6c603d72e7870e7c48
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Tue Nov 13 12:06:48 2018 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/816f4f4497b14682e2029d6c603d72e7870e7c48 [^]

Fixed issue 39392 : Refactored Discount pack calculation

* Previous applied discounts must be consider for pack discount calculation
* Pack discount should be applied for recently added pack products
* Refactored Discount pack calculation changes
  * While iterating order lines, pack discout will be calculated for pack's last product line.
    For previous line iteration, calculation is prevented. Because for pack discount calculation, all lines "gross amount" is needed including discount amount.
    So in the last line iteration, its possible to fetch all the pack lines information
  * If Products added manually which are from Pack, and we are trying to add new pack, pack discount will be calculated for newly added products not for maunally added products

---
M src-db/database/model/functions/OBDISC_PACK.xml
M src/org/openbravo/retail/discounts/AddPack.java
---
(0107877)
hgbot (developer)
2018-11-13 10:59

Repository: erp/pmods/org.openbravo.retail.discounts
Changeset: 72ebc6f003bd7741547f3f705e1773566dc386f5
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Tue Nov 13 15:29:31 2018 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/72ebc6f003bd7741547f3f705e1773566dc386f5 [^]

Related to issue 39392 : Backed out changeset: 816f4f4497b1

* Backed out due to error in dbcons-oracle

---
M src-db/database/model/functions/OBDISC_PACK.xml
M src/org/openbravo/retail/discounts/AddPack.java
---
(0107902)
ranjith_qualiantech_com (developer)
2018-11-14 11:16

Function OBDISC_PACK failing in oracle
(0107948)
hgbot (developer)
2018-11-16 13:01

Repository: erp/pmods/org.openbravo.retail.discounts
Changeset: 2e5923e545dfca37a1d8f043614d95bf72f28203
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Thu Nov 15 14:37:31 2018 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/2e5923e545dfca37a1d8f043614d95bf72f28203 [^]

Fixed issue 39392 : Refactored Discount pack calculation

* Previous applied discounts must be consider for pack discount calculation
* Pack discount should be applied for recently added pack products
* Refactored Discount pack calculation changes
  * While iterating order lines, pack discout will be calculated for pack's last product line.
    For previous line iteration, calculation is prevented. Because for pack discount calculation, all lines "gross amount" is needed including discount amount.
    So in the last line iteration, its possible to fetch all the pack lines information
  * If Products added manually which are from Pack, and we are trying to add new pack, pack discount will be calculated for newly added products not for maunally added products

---
M src-db/database/model/functions/OBDISC_PACK.xml
M src/org/openbravo/retail/discounts/AddPack.java
---
(0108052)
hgbot (developer)
2018-11-22 10:27

Repository: erp/pmods/org.openbravo.retail.discounts
Changeset: 87de3847adea1e274c3d45d96a678e0b2c0a9729
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Thu Nov 22 12:11:00 2018 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/87de3847adea1e274c3d45d96a678e0b2c0a9729 [^]

Related to issue 39392 : Removed unused variables in obdisc_pack function

---
M src-db/database/model/functions/OBDISC_PACK.xml
---

- Issue History
Date Modified Username Field Change
2018-10-02 17:01 lbressan New Issue
2018-10-02 17:01 lbressan Assigned To => Retail
2018-10-02 17:01 lbressan Resolution time => 1540245600
2018-10-02 17:01 lbressan Triggers an Emergency Pack => No
2018-10-03 08:56 ranjith_qualiantech_com Assigned To Retail => ranjith_qualiantech_com
2018-10-03 08:56 ranjith_qualiantech_com Status new => scheduled
2018-10-03 12:31 jorge-garcia Note Added: 0107135
2018-10-03 12:31 jorge-garcia Assigned To ranjith_qualiantech_com => lbressan
2018-10-03 12:32 jorge-garcia Status scheduled => feedback
2018-10-03 12:32 jorge-garcia Note Edited: 0107135 View Revisions
2018-10-04 21:17 lbressan File Added: Screen Shot 2018-10-04 at 16.14.38.png
2018-10-04 21:17 lbressan File Added: Screen Shot 2018-10-04 at 16.14.52.png
2018-10-04 21:18 lbressan File Added: Screen Shot 2018-10-04 at 16.15.13.png
2018-10-04 21:18 lbressan File Added: Screen Shot 2018-10-04 at 16.15.26.png
2018-10-04 21:22 lbressan Note Added: 0107163
2018-10-04 21:22 lbressan Assigned To lbressan => jorge-garcia
2018-10-04 21:23 lbressan Status feedback => new
2018-10-04 21:23 lbressan Note Edited: 0107163 View Revisions
2018-10-16 08:39 jorge-garcia Assigned To jorge-garcia => Retail
2018-10-16 11:36 ranjith_qualiantech_com Assigned To Retail => ranjith_qualiantech_com
2018-10-16 11:36 ranjith_qualiantech_com Status new => scheduled
2018-11-12 13:15 mgonzalezh Issue Monitored: mgonzalezh
2018-11-13 07:37 hgbot Checkin
2018-11-13 07:37 hgbot Note Added: 0107866
2018-11-13 07:37 hgbot Status scheduled => resolved
2018-11-13 07:37 hgbot Resolution open => fixed
2018-11-13 07:37 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/816f4f4497b14682e2029d6c603d72e7870e7c48 [^]
2018-11-13 10:59 hgbot Checkin
2018-11-13 10:59 hgbot Note Added: 0107877
2018-11-14 11:16 ranjith_qualiantech_com Note Added: 0107902
2018-11-14 11:16 ranjith_qualiantech_com Status resolved => new
2018-11-14 11:16 ranjith_qualiantech_com Resolution fixed => open
2018-11-14 11:16 ranjith_qualiantech_com Status new => scheduled
2018-11-16 13:01 hgbot Checkin
2018-11-16 13:01 hgbot Note Added: 0107948
2018-11-16 13:01 hgbot Status scheduled => resolved
2018-11-16 13:01 hgbot Resolution open => fixed
2018-11-16 13:01 hgbot Fixed in SCM revision http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/816f4f4497b14682e2029d6c603d72e7870e7c48 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.discounts/rev/2e5923e545dfca37a1d8f043614d95bf72f28203 [^]
2018-11-16 13:50 marvintm Review Assigned To => marvintm
2018-11-16 13:50 marvintm Status resolved => closed
2018-11-16 13:50 marvintm Fixed in Version => RR19Q1
2018-11-22 10:27 hgbot Checkin
2018-11-22 10:27 hgbot Note Added: 0108052


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker