Support multiple production plan
This commit is contained in:
parent
d7052d7f31
commit
df284fa6f8
|
@ -90,6 +90,7 @@ public class M_Production_Run extends SvrProcess {
|
|||
return "@AlreadyPosted@";
|
||||
}
|
||||
|
||||
|
||||
String whereClause = "M_Production_ID=? ";
|
||||
List<X_M_ProductionPlan> lines = new Query(getCtx(), X_M_ProductionPlan.Table_Name , whereClause, get_TrxName())
|
||||
.setParameters(new Object[]{p_Record_ID })
|
||||
|
@ -99,7 +100,6 @@ public class M_Production_Run extends SvrProcess {
|
|||
|
||||
if (!production.isCreated())
|
||||
{
|
||||
|
||||
int line = 100;
|
||||
int no = DB.executeUpdateEx("DELETE M_ProductionLine WHERE M_ProductionPlan_ID = ?", new Object[]{pp.get_ID()},get_TrxName());
|
||||
if (no == -1) raiseError("ERROR", "DELETE M_ProductionLine WHERE M_ProductionPlan_ID = "+ pp.get_ID());
|
||||
|
@ -115,12 +115,7 @@ public class M_Production_Run extends SvrProcess {
|
|||
pl.setM_ProductionPlan_ID(pp.get_ID());
|
||||
pl.setMovementQty(pp.getProductionQty());
|
||||
pl.saveEx();
|
||||
if (explosion(pp, product, pp.getProductionQty() , line) > 0 )
|
||||
{
|
||||
production.setIsCreated(true);
|
||||
production.saveEx();
|
||||
}
|
||||
else
|
||||
if (explosion(pp, product, pp.getProductionQty() , line) == 0 )
|
||||
raiseError("Do not exist componets", "");
|
||||
|
||||
}
|
||||
|
@ -181,11 +176,19 @@ public class M_Production_Run extends SvrProcess {
|
|||
|
||||
pp.setProcessed(true);
|
||||
pp.saveEx();
|
||||
}
|
||||
} // Production Plan
|
||||
|
||||
if(!production.isCreated())
|
||||
{
|
||||
production.setIsCreated(true);
|
||||
production.saveEx();
|
||||
}
|
||||
else
|
||||
{
|
||||
production.setProcessed(true);
|
||||
production.saveEx();
|
||||
}
|
||||
} // Production Plan
|
||||
|
||||
return "@OK@";
|
||||
|
||||
|
|
Loading…
Reference in New Issue