Fix [1884379] - MM Doc: MA should be created on complete and for each line

http://sourceforge.net/support/tracker.php?aid=1884379
Implement fix for Movements
This commit is contained in:
Carlos Ruiz 2011-03-26 01:41:17 -05:00
parent bf4b9127ff
commit 0de1a309e5
2 changed files with 14 additions and 3 deletions

View File

@ -539,7 +539,7 @@ public class MMovement extends X_M_Movement implements DocAction
*/
private void checkMaterialPolicy(MMovementLine line)
{
int no = MMovementLineMA.deleteMovementMA(getM_Movement_ID(), get_TrxName());
int no = MMovementLineMA.deleteMovementLineMA(line.getM_MovementLine_ID(), get_TrxName());
if (no > 0)
log.config("Delete old #" + no);

View File

@ -38,8 +38,7 @@ public class MMovementLineMA extends X_M_MovementLineMA
/**
*
*/
private static final long serialVersionUID = -9056217457105828481L;
private static final long serialVersionUID = -8812388635431003742L;
/**
* Get Material Allocations for Line
@ -100,6 +99,18 @@ public class MMovementLineMA extends X_M_MovementLineMA
return DB.executeUpdate(sql, trxName);
} // deleteInOutMA
/**
* Delete all Material Allocation for Movement Line
* @param M_MovementLine_ID movement line
* @param trxName transaction
* @return number of rows deleted or -1 for error
*/
public static int deleteMovementLineMA (int M_MovementLine_ID, String trxName)
{
String sql = "DELETE FROM M_MovementLineMA WHERE M_MovementLine_ID=" + M_MovementLine_ID;
return DB.executeUpdate(sql, trxName);
} // deleteMovementLineMA
/** Logger */
private static CLogger s_log = CLogger.getCLogger (MMovementLineMA.class);