[ 1689521 ] Issue when you need buy with um minor that stoked

This commit is contained in:
Heng Sin Low 2007-07-16 04:38:44 +00:00
parent 190ff03523
commit 64d99c7354
1 changed files with 17 additions and 10 deletions

View File

@ -696,6 +696,8 @@ public class MUOMConversion extends X_C_UOM_Conversion
return false; return false;
} }
// Enforce Product UOM // Enforce Product UOM
if (MSysConfig.getBooleanValue("ProductUOMConversionUOMValidate", true))
{
if (getM_Product_ID() != 0 if (getM_Product_ID() != 0
&& (newRecord || is_ValueChanged("M_Product_ID"))) && (newRecord || is_ValueChanged("M_Product_ID")))
{ {
@ -707,13 +709,18 @@ public class MUOMConversion extends X_C_UOM_Conversion
return false; return false;
} }
} }
}
// The Product UoM needs to be the smallest UoM - Multiplier must be > 0 // The Product UoM needs to be the smallest UoM - Multiplier must be > 0
if (MSysConfig.getBooleanValue("ProductUOMConversionRateValidate", true))
{
if (getM_Product_ID() != 0 && getDivideRate().compareTo(Env.ONE) < 0) if (getM_Product_ID() != 0 && getDivideRate().compareTo(Env.ONE) < 0)
{ {
log.saveError("ProductUOMConversionRateError", ""); log.saveError("ProductUOMConversionRateError", "");
return false; return false;
} }
}
return true; return true;
} // beforeSave } // beforeSave