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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0057893
TypeCategorySeverityReproducibilityDate SubmittedLast Update
backport[Openbravo ERP] 06. Material requirement planning (MRP)majorhave not tried2025-02-03 14:062025-02-11 07:37
ReporterjavietxeView Statuspublic 
Assigned Tokousalya_r 
PrioritynormalResolutionfixedFixed in VersionPR24Q4.1
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget VersionPR24Q4.2
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0057893: BigDecimal.divide(BigDecimal) does not specify a rounding mode

DescriptionThere is an arithmetic division that is not being handled correctly in the class ServicePriceUtils.java .
 
In the getServiceAmoutnt method, if olsr.getAmount() and olsr.getQuantity() result in a non-terminating decimal expansion, such as: 10 / 3 = 3.3333333333... Java throws ArithmeticException.
Steps To ReproduceIn Terrena happening due to a customization.
Proposed SolutionAdd the precision and rounding in the next lines.

Class:
openbravo/src/org/openbravo/materialmgmt/ServicePriceUtils.java

Method
getServiceAmount

Lines:
        relatedPrices.put(olsr.getQuantity().compareTo(BigDecimal.ZERO) == 0 ? BigDecimal.ZERO
            : olsr.getAmount().divide(olsr.getQuantity()));

TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
blocks defect 0057841 closedkousalya_r BigDecimal.divide(BigDecimal) does not specify a rounding mode 

-  Notes
(0175360)
hgbot (developer)
2025-02-10 07:55

Merge Request created: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/openbravo/-/merge_requests/1528 [^]
(0175448)
hgbot (developer)
2025-02-11 07:37

Merge request merged: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/openbravo/-/merge_requests/1528 [^]
(0175449)
hgbot (developer)
2025-02-11 07:37

Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/openbravo [^]
Changeset: ae9e32881b3587f70f726548807abda19fbf9fb4
Author: Kousalya Ramasamy <k.ramasamy@external.orisha.com>
Date: 10-02-2025 12:23:49
URL: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/openbravo/-/commit/ae9e32881b3587f70f726548807abda19fbf9fb4 [^]

Fixed ISSUE-57893: Added Rounding mode to handle non-terminating arthimetic exception

---
M src/org/openbravo/materialmgmt/ServicePriceUtils.java
---

- Issue History
Date Modified Username Field Change
2025-02-06 14:02 jonae Type defect => backport
2025-02-06 14:02 jonae Target Version => PR24Q4.2
2025-02-10 07:55 hgbot Note Added: 0175360
2025-02-11 07:37 hgbot Resolution open => fixed
2025-02-11 07:37 hgbot Status scheduled => closed
2025-02-11 07:37 hgbot Note Added: 0175448
2025-02-11 07:37 hgbot Fixed in Version => PR24Q4.1
2025-02-11 07:37 hgbot Note Added: 0175449


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker