You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Yashwant Dhakad (Jira)" <ji...@apache.org> on 2025/06/10 09:14:00 UTC
[jira] [Updated] (OFBIZ-13254) ArithmeticException when producing inventory with general cost set on routing task
[ https://issues.apache.org/jira/browse/OFBIZ-13254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yashwant Dhakad updated OFBIZ-13254:
------------------------------------
Issue Type: Bug (was: Improvement)
> ArithmeticException when producing inventory with general cost set on routing task
> ----------------------------------------------------------------------------------
>
> Key: OFBIZ-13254
> URL: https://issues.apache.org/jira/browse/OFBIZ-13254
> Project: OFBiz
> Issue Type: Bug
> Components: manufacturing
> Affects Versions: Upcoming Branch, 24.09
> Reporter: Yashwant Dhakad
> Priority: Major
> Fix For: Upcoming Branch
>
>
> h3. {*}Description{*}:
> We are encountering a runtime exception when attempting to produce inventory from a *Production Run* in the *Manufacturing* module. This issue specifically occurs when a *general cost* is configured on a {*}routing task{*}.
> ----
> h3. {*}Steps to Reproduce{*}:
> # Navigate to the *Manufacturing > Production Run* module.
> # Create a Production Run for any finished good item.
> # Assign a routing that includes one or more routing tasks.
> # On any of the routing tasks, set a *general cost* (e.g., other fixed cost).
> # Start the production run and complete the tasks.
> # Try to *produce inventory* using the "Produce" button.
> h3. {*}Expected Behavior{*}:
> The inventory should be produced successfully, and unit cost should be calculated based on total cost and quantity.
> ----
> h3. {*}Actual Behavior{*}:
> The system throws the following exception:
> java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result.
> at java.base/java.math.BigDecimal.divide(BigDecimal.java:1780)
> at org.apache.ofbiz.manufacturing.jobshopmgt.ProductionRunServices.productionRunProduce(ProductionRunServices.java:1872)
>
> This happens when {{unitCost = totalCost.divide(quantity)}} is called and the result is a non-terminating decimal (e.g., 10 / 3).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)