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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0057841
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 06. Material requirement planning (MRP)majorhave not tried2025-02-03 14:062025-02-11 07:36
ReporterjavietxeView Statuspublic 
Assigned Tokousalya_r 
PrioritynormalResolutionfixedFixed in VersionPR25Q2
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
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

0057841: 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 ]
depends on backport 0057892PR25Q1 closedkousalya_r BigDecimal.divide(BigDecimal) does not specify a rounding mode 
depends on backport 0057893PR24Q4.2 closedkousalya_r BigDecimal.divide(BigDecimal) does not specify a rounding mode 

-  Notes
(0175136)
jonae (developer)
2025-02-05 08:08

Jira - https://openbravo.atlassian.net/browse/RM-20986 [^]
(0175147)
hgbot (developer)
2025-02-05 08:50

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

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

Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/openbravo [^]
Changeset: a4095963e4e5322a65bedb671b311e9ab0f18e78
Author: Kousalya Ramasamy <k.ramasamy@external.orisha.com>
Date: 11-02-2025 06:36:20
URL: https://gitlab.com/orisha-group/bu-commerce/openbravo/product/openbravo/-/commit/a4095963e4e5322a65bedb671b311e9ab0f18e78 [^]

Fixed ISSUE-57841: 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-03 14:06 javietxe New Issue
2025-02-03 14:06 javietxe Assigned To => Triage Omni OMS
2025-02-03 14:06 javietxe Modules => Core
2025-02-03 14:06 javietxe Triggers an Emergency Pack => No
2025-02-03 14:06 javietxe Issue Monitored: javietxe
2025-02-05 08:08 jonae Note Added: 0175136
2025-02-05 08:08 jonae Assigned To Triage Omni OMS => kousalya_r
2025-02-05 08:50 hgbot Note Added: 0175147
2025-02-06 14:02 jonae Status new => scheduled
2025-02-11 07:36 hgbot Note Added: 0175446
2025-02-11 07:36 hgbot Resolution open => fixed
2025-02-11 07:36 hgbot Status scheduled => closed
2025-02-11 07:36 hgbot Fixed in Version => PR25Q2
2025-02-11 07:36 hgbot Note Added: 0175447


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker