/** * verifyQuantity - checks that the warehouse specified in the work order transaction * has sufficient quantity of the product * @param product * @param wot * @param qty * @param asiID * @return error message if any, else Quantity Available */ private String VerifyQuantity(VAdvantage.Model.MProduct product, ViennaAdvantage.Model.MVAMFGMWrkOdrTransaction wot, Decimal qty, int asiID) { if (product.IsStocked()) { ViennaAdvantage.Model.MVAMFGMWorkOrder wo = new ViennaAdvantage.Model.MVAMFGMWorkOrder(wot.GetCtx(), wot.GetVAMFG_M_WorkOrder_ID(), wot.Get_TrxName()); int M_Warehouse_ID = wo.GetM_Warehouse_ID(); //logic change by Raghu //Decimal available = ViennaAdvantage.Model.Storage.GetQtyAvailable //(M_Warehouse_ID, product.GetM_Product_ID(), asiID, null); // during creation of production execution line, reserverd qty to be checked or not Decimal?available = 0.0M; if (VAdvantage.Utility.Util.GetValueOfString(wot.GetConsiderReservedQty()) == "N") { try { available = MStorage.GetQtyAvailableWithoutReserved (M_Warehouse_ID, product.GetM_Product_ID(), asiID, null); } catch { return(Msg.GetMsg(wot.GetCtx(), "PleaseUpdateVAFramework")); } } else { available = MStorage.GetQtyAvailable (M_Warehouse_ID, product.GetM_Product_ID(), asiID, null); } if (available == null) { available = Env.ZERO; } if (Env.Signum(available.Value) == 0) { return(Msg.GetMsg(wot.GetCtx(), "NoQtyAvailable", "0")); } else if (available.Value.CompareTo(qty) < 0) { return(Msg.GetMsg(wot.GetCtx(), "InsufficientQtyAvailable", available.ToString())); } } return(Msg.GetMsg(wot.GetCtx(), "QtyAvailable")); } // verifyQuantity