Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0057892 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
backport | [Openbravo ERP] 06. Material requirement planning (MRP) | major | have not tried | 2025-02-03 14:06 | 2025-02-11 07:37 | |||
Reporter | javietxe | View Status | public | |||||
Assigned To | kousalya_r | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | PR25Q1 | |||
Status | closed | Fix in branch | Fixed in SCM revision | |||||
Projection | none | ETA | none | Target Version | PR25Q1 | |||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | SCM revision | |||||||
Review Assigned To | ||||||||
Web browser | ||||||||
Modules | Core | |||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0057892: BigDecimal.divide(BigDecimal) does not specify a rounding mode | |||||||
Description | There 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 Reproduce | In Terrena happening due to a customization. | |||||||
Proposed Solution | Add 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())); | |||||||
Tags | No tags attached. | |||||||
Attached Files | ||||||||
![]() |
||||||||
|
![]() |
|
(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 --- |
![]() |
|||
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 |