IDEMPIERE-2472 CalloutInOut/CalloutMovement

This commit is contained in:
Carlos Ruiz 2015-02-25 14:41:58 -05:00
parent 8af991da51
commit be17f8a145
2 changed files with 10 additions and 10 deletions

View File

@ -570,7 +570,7 @@ public class CalloutInOut extends CalloutEngine
if (isCalloutActive() || value == null)
return "";
int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, "M_Product_ID");
int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_Product_ID");
// log.log(Level.WARNING,"qty - init - M_Product_ID=" + M_Product_ID);
BigDecimal MovementQty, QtyEntered;
@ -606,7 +606,7 @@ public class CalloutInOut extends CalloutEngine
mTab.setValue("MovementQty", MovementQty);
}
// No UOM defined
else if (Env.getContextAsInt(ctx, WindowNo, "C_UOM_ID") == 0)
else if (Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID") == 0)
{
QtyEntered = (BigDecimal)mTab.getValue("QtyEntered");
mTab.setValue("MovementQty", QtyEntered);
@ -614,7 +614,7 @@ public class CalloutInOut extends CalloutEngine
// QtyEntered changed - calculate MovementQty
else if (mField.getColumnName().equals("QtyEntered"))
{
int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, "C_UOM_ID");
int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID");
QtyEntered = (BigDecimal)value;
BigDecimal QtyEntered1 = QtyEntered.setScale(MUOM.getPrecision(ctx, C_UOM_To_ID), BigDecimal.ROUND_HALF_UP);
if (QtyEntered.compareTo(QtyEntered1) != 0)
@ -639,7 +639,7 @@ public class CalloutInOut extends CalloutEngine
// MovementQty changed - calculate QtyEntered (should not happen)
else if (mField.getColumnName().equals("MovementQty"))
{
int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, "C_UOM_ID");
int C_UOM_To_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "C_UOM_ID");
MovementQty = (BigDecimal)value;
int precision = MProduct.get(ctx, M_Product_ID).getUOMPrecision();
BigDecimal MovementQty1 = MovementQty.setScale(precision, BigDecimal.ROUND_HALF_UP);
@ -683,9 +683,9 @@ public class CalloutInOut extends CalloutEngine
if (M_ASI_ID == null || M_ASI_ID.intValue() == 0)
return "";
//
int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, "M_Product_ID");
int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_Product_ID");
int M_Warehouse_ID = Env.getContextAsInt(ctx, WindowNo, "M_Warehouse_ID");
int M_Locator_ID = Env.getContextAsInt(ctx, WindowNo, "M_Locator_ID");
int M_Locator_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_Locator_ID");
if (log.isLoggable(Level.FINE)) log.fine("M_Product_ID=" + M_Product_ID
+ ", M_ASI_ID=" + M_ASI_ID
+ " - M_Warehouse_ID=" + M_Warehouse_ID

View File

@ -76,7 +76,7 @@ public class CalloutMovement extends CalloutEngine
if (isCalloutActive() || value == null)
return "";
int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, "M_Product_ID");
int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_Product_ID");
checkQtyAvailable(ctx, mTab, WindowNo, M_Product_ID, (BigDecimal)value);
//
return "";
@ -95,7 +95,7 @@ public class CalloutMovement extends CalloutEngine
public String locator(Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value) {
if (value == null)
return "";
int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, "M_Product_ID");
int M_Product_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_Product_ID");
checkQtyAvailable(ctx, mTab, WindowNo, M_Product_ID, null);
return "";
}
@ -116,11 +116,11 @@ public class CalloutMovement extends CalloutEngine
if (product.isStocked()) {
if (MovementQty == null)
MovementQty = (BigDecimal) mTab.getValue("MovementQty");
int M_Locator_ID = Env.getContextAsInt(ctx, WindowNo, "M_Locator_ID");
int M_Locator_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_Locator_ID");
// If no locator, don't check anything and assume is ok
if (M_Locator_ID <= 0)
return;
int M_AttributeSetInstance_ID = Env.getContextAsInt(ctx, WindowNo, "M_AttributeSetInstance_ID");
int M_AttributeSetInstance_ID = Env.getContextAsInt(ctx, WindowNo, mTab.getTabNo(), "M_AttributeSetInstance_ID");
BigDecimal available = MStorageOnHand.getQtyOnHandForLocator(M_Product_ID, M_Locator_ID, M_AttributeSetInstance_ID, null);
if (available == null)