fixed bug related to inventory move

This commit is contained in:
uthadehikaru 2012-11-12 09:54:53 +07:00
parent 030ebd747e
commit 80e81f4c86
2 changed files with 7 additions and 5 deletions

View File

@ -123,7 +123,7 @@ public class CalloutMovement extends CalloutEngine
if (M_Locator_ID <= 0)
return;
//@win - IDEMPIERE-385
int M_Warehouse_ID = DB.getSQLValue(null, "SELECT M_Warehouse_ID FROM M_Locator WHERE M_Locator_ID=?");
int M_Warehouse_ID = DB.getSQLValue(null, "SELECT M_Warehouse_ID FROM M_Locator WHERE M_Locator_ID=?", M_Locator_ID);
//
int M_AttributeSetInstance_ID = Env.getContextAsInt(ctx, WindowNo, "M_AttributeSetInstance_ID");
BigDecimal available = MStorageReservation.getQtyAvailable(M_Warehouse_ID, M_Product_ID, M_AttributeSetInstance_ID, null);

View File

@ -87,10 +87,12 @@ public class MStorageReservation extends X_M_StorageReservation {
public static BigDecimal getQtyReserved(int M_Product_ID, int M_Warehouse_ID, int M_AttributeSetInstance_ID, String trxName){
ArrayList<Object> params = new ArrayList<Object>();
StringBuffer sql = new StringBuffer();
sql.append(" SELECT SUM(QtyReserved) FROM M_StorageReservation oh")
.append(" WHERE oh.M_Product_ID=? AND oh.M_Warehouse_ID=?");
params.add(M_Product_ID,M_Warehouse_ID);
sql.append(" SELECT SUM(Qty) FROM M_StorageReservation oh")
.append(" WHERE oh.M_Product_ID=? AND oh.M_Warehouse_ID=?")
.append(" AND oh.IsSOTrx='Y'");
params.add(M_Product_ID);
params.add(M_Warehouse_ID);
// With ASI
if (M_AttributeSetInstance_ID != 0) {