libero: MPPProductPlanning : more field validation
Victor, please help me on this talk, to define more validations
This commit is contained in:
parent
060ff39708
commit
e81be62d56
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue