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