Fix [2845052] - InventoryCountUpdate calling wrongly deleteInventoryMA

https://sourceforge.net/tracker/?func=detail&aid=2845052&group_id=176962&atid=879332
This commit is contained in:
Carlos Ruiz 2009-08-26 16:46:11 +00:00
parent 2742a37a32
commit 9441393a77
2 changed files with 16 additions and 2 deletions

View File

@ -570,7 +570,7 @@ public class MInventory extends X_M_Inventory implements DocAction
*/
private void checkMaterialPolicy(MInventoryLine line, BigDecimal qtyDiff)
{
int no = MInventoryLineMA.deleteInventoryMA(line.getM_InventoryLine_ID(), get_TrxName());
int no = MInventoryLineMA.deleteInventoryLineMA(line.getM_InventoryLine_ID(), get_TrxName());
if (no > 0)
log.config("Delete old #" + no);

View File

@ -83,7 +83,21 @@ public class MInventoryLineMA extends X_M_InventoryLineMA
* @param trxName transaction
* @return number of rows deleted or -1 for error
*/
public static int deleteInventoryMA (int M_InventoryLine_ID, String trxName)
public static int deleteInventoryMA (int M_Inventory_ID, String trxName)
{
String sql = "DELETE FROM M_InventoryLineMA ma WHERE EXISTS "
+ "(SELECT * FROM M_InventoryLine l WHERE l.M_InventoryLine_ID=ma.M_InventoryLine_ID"
+ " AND M_Inventory_ID=" + M_Inventory_ID + ")";
return DB.executeUpdate(sql, trxName);
} // deleteInventoryMA
/**
* Delete all Material Allocation for Inventory
* @param M_InventoryLine_ID inventory
* @param trxName transaction
* @return number of rows deleted or -1 for error
*/
public static int deleteInventoryLineMA (int M_InventoryLine_ID, String trxName)
{
String sql = "DELETE FROM M_InventoryLineMA ma WHERE EXISTS "
+ "(SELECT * FROM M_InventoryLine l WHERE l.M_InventoryLine_ID=ma.M_InventoryLine_ID"