Openbravo Issue Tracking System - Openbravo ERP |
| View Issue Details |
|
| ID | Project | Category | View Status | Date Submitted | Last Update |
| 0057841 | Openbravo ERP | 06. Material requirement planning (MRP) | public | 2025-02-03 14:06 | 2025-02-11 07:36 |
|
| Reporter | javietxe | |
| Assigned To | kousalya_r | |
| Priority | normal | Severity | major | Reproducibility | have not tried |
| Status | closed | Resolution | fixed | |
| Platform | | OS | 5 | OS Version | |
| Product Version | | |
| Target Version | | Fixed in Version | PR25Q2 | |
| Merge Request Status | approved |
| Review Assigned To | |
| OBNetwork customer | Gold |
| Web browser | |
| Modules | Core |
| Support ticket | |
| Regression level | |
| Regression date | |
| Regression introduced in release | |
| Regression introduced by commit | |
| Triggers an Emergency Pack | No |
|
| Summary | 0057841: 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()));
|
| Additional Information | |
| Tags | No tags attached. |
| Relationships | | depends on | backport | 0057892 | PR25Q1 | closed | kousalya_r | BigDecimal.divide(BigDecimal) does not specify a rounding mode | | depends on | backport | 0057893 | PR24Q4.2 | closed | kousalya_r | BigDecimal.divide(BigDecimal) does not specify a rounding mode |
|
| Attached Files | |
|
| 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 | OBNetwork customer | => Gold |
| 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 | Merge Request Status | => open |
| 2025-02-05 08:50 | hgbot | Note Added: 0175147 | |
| 2025-02-06 14:02 | jonae | Status | new => scheduled |
| 2025-02-11 07:36 | hgbot | Merge Request Status | open => approved |
| 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 | |