diff --git a/base/src/org/eevolution/model/MPPProductPlanning.java b/base/src/org/eevolution/model/MPPProductPlanning.java index b447b3f8d0..bf7ef3df90 100644 --- a/base/src/org/eevolution/model/MPPProductPlanning.java +++ b/base/src/org/eevolution/model/MPPProductPlanning.java @@ -180,6 +180,13 @@ public class MPPProductPlanning extends X_PP_Product_Planning @Override protected boolean beforeSave(boolean newRecord) { + // + // Set default : Order_Policy + if (getOrder_Policy() == null) + { + setOrder_Policy(ORDER_POLICY_LoteForLote); + } + // // Check Order_Min < Order_Max if (getOrder_Min().signum() > 0 && getOrder_Max().signum() > 0 @@ -187,6 +194,21 @@ public class MPPProductPlanning extends X_PP_Product_Planning { throw new AdempiereException("@Order_Min@ > @Order_Max@"); } + // + // Check Order_Period + if (ORDER_POLICY_PeriodOrderQuantity.equals(getOrder_Policy()) + && getOrder_Period().signum() <= 0) + { + throw new AdempiereException("@Order_Period@ <= 0"); + } + // + // Check Order_Qty + if (ORDER_POLICY_FixedOrderQuantity.equals(getOrder_Policy()) + && getOrder_Qty().signum() <= 0) + { + throw new AdempiereException("@Order_Qty@ <= 0"); + } + // return true; }