diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java index 2cb9ce56c7..9bec930acb 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java @@ -822,7 +822,7 @@ public class CalloutOrder extends CalloutEngine int M_Warehouse_ID = Env.getContextAsInt(ctx, WindowNo, "M_Warehouse_ID"); int M_AttributeSetInstance_ID = Env.getContextAsInt(ctx, WindowNo, "M_AttributeSetInstance_ID"); BigDecimal available = MStorageReservation.getQtyAvailable - (M_Warehouse_ID, 0, M_Product_ID.intValue(), M_AttributeSetInstance_ID, null); + (M_Warehouse_ID, M_Product_ID.intValue(), M_AttributeSetInstance_ID, null); if (available == null) available = Env.ZERO; if (available.signum() == 0) @@ -1297,7 +1297,7 @@ public class CalloutOrder extends CalloutEngine int M_Warehouse_ID = Env.getContextAsInt(ctx, WindowNo, "M_Warehouse_ID"); int M_AttributeSetInstance_ID = Env.getContextAsInt(ctx, WindowNo, "M_AttributeSetInstance_ID"); BigDecimal available = MStorageReservation.getQtyAvailable - (M_Warehouse_ID, 0, M_Product_ID, M_AttributeSetInstance_ID, null); + (M_Warehouse_ID, M_Product_ID, M_AttributeSetInstance_ID, null); if (available == null) available = Env.ZERO; if (available.signum() == 0) diff --git a/org.adempiere.base/src/org/compiere/model/MProduct.java b/org.adempiere.base/src/org/compiere/model/MProduct.java index 4fca26086b..e8928ef744 100644 --- a/org.adempiere.base/src/org/compiere/model/MProduct.java +++ b/org.adempiere.base/src/org/compiere/model/MProduct.java @@ -719,15 +719,15 @@ public class MProduct extends X_M_Product // Check Storage if (isStocked() || PRODUCTTYPE_Item.equals(getProductType())) { - MStorageOnHand[] onHandStorages = MStorageOnHand.getOfProduct(getCtx(), get_ID(), get_TrxName()); + MStorageOnHand[] storages = MStorageOnHand.getOfProduct(getCtx(), get_ID(), get_TrxName()); MStorageReservation[] reserves = MStorageReservation.getOfProduct(getCtx(), get_ID(), get_TrxName()); BigDecimal OnHand = Env.ZERO; BigDecimal Ordered = Env.ZERO; BigDecimal Reserved = Env.ZERO; - for (int i = 0; i < onHandStorages.length; i++) + for (int i = 0; i < storages.length; i++) { - OnHand = OnHand.add(onHandStorages[i].getQtyOnHand()); + OnHand = OnHand.add(storages[i].getQtyOnHand()); } for (int i = 0; i < reserves.length; i++)