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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0057892
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 VersionPR25Q1
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget VersionPR25Q1
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

0057892: 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
(0175361)
hgbot (developer)
2025-02-10 08:02

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

Merge request merged: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/openbravo/-/merge_requests/1529 [^]
(0175451)
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: 9e28f61a9bc7bdaced60c0d3cc84baf3feb27bae
Author: Kousalya Ramasamy <k.ramasamy@external.orisha.com>
Date: 10-02-2025 12:30:48
URL: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/openbravo/-/commit/9e28f61a9bc7bdaced60c0d3cc84baf3feb27bae [^]

Fixed ISSUE-57892: 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 => PR25Q1
2025-02-10 08:02 hgbot Note Added: 0175361
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: 0175450
2025-02-11 07:37 hgbot Fixed in Version => PR25Q1
2025-02-11 07:37 hgbot Note Added: 0175451


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker