[ 
https://issues.apache.org/jira/browse/OFBIZ-13254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17958639#comment-17958639
 ] 

ASF subversion and git services commented on OFBIZ-13254:
---------------------------------------------------------

Commit 6259d185583fc7a26a2e7266b74dea053b6a53a0 in ofbiz-framework's branch 
refs/heads/trunk from Yashwant Dhakad
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=6259d18558 ]

Fixed: ArithmeticException when producing inventory from a production run with 
general cost set on task level (OFBIZ-13254) (#893)

Fixed: ArithmeticException when producing inventory from a production
run with general cost set on task level (OFBIZ-13254)

Co-authored-by: Yashwant Dhakad <yashwantdhakad@Yashwant-Dhakad-MBA.local>

> 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
>            Assignee: Deepak Dixit
>            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)

Reply via email to