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-06 14:02
ReporterjavietxeView Statuspublic 
Assigned Tokousalya_r 
PrioritynormalResolutionopenFixed in Version
StatusscheduledFix 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 scheduledkousalya_r BigDecimal.divide(BigDecimal) does not specify a rounding mode 
depends on backport 0057893PR24Q4.2 scheduledkousalya_r BigDecimal.divide(BigDecimal) does not specify a rounding mode 
Not all the children of this issue are yet resolved or closed.

-  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 [^]

- 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


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker