From bc1d7aa2a40c4afa5064fa8ed5fa5d9a8144dcd4 Mon Sep 17 00:00:00 2001 From: vpj-cd Date: Tue, 7 Oct 2008 20:38:10 +0000 Subject: [PATCH] [ 2151904 ] The Qty Batch Calculate do not work in Manufacturing Order https://sourceforge.net/tracker/?func=detail&atid=879332&aid=2151904&group_id=176962 --- base/src/org/eevolution/model/MPPOrder.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/base/src/org/eevolution/model/MPPOrder.java b/base/src/org/eevolution/model/MPPOrder.java index fcae536e09..923e893127 100644 --- a/base/src/org/eevolution/model/MPPOrder.java +++ b/base/src/org/eevolution/model/MPPOrder.java @@ -18,6 +18,7 @@ package org.eevolution.model; import java.io.File; import java.math.BigDecimal; +import java.math.RoundingMode; import java.sql.ResultSet; import java.sql.Timestamp; import java.util.List; @@ -363,8 +364,19 @@ public class MPPOrder extends X_PP_Order implements DocAction } } PP_Order_Workflow.saveEx(); - } // workflow valid from/to + + BigDecimal QtyBatchs = null; + BigDecimal QtyBatchSize = PP_Order_Workflow.getQtyBatchSize().setScale(0, RoundingMode.UP); + if (QtyBatchSize.signum()==0) + QtyBatchs = Env.ONE; + else + QtyBatchs = getQtyEntered().divide(QtyBatchSize , 0, BigDecimal.ROUND_UP); + + setQtyBatchs(QtyBatchs); + setQtyBatchSize(QtyBatchSize); + + } // workflow valid from/to return true; } // beforeSave