IDEMPIERE-1750:Restore M_ProductionPlan backward compatibility
This commit is contained in:
parent
d37e7661fe
commit
8b7c5413e3
|
@ -84,7 +84,7 @@ public class Doc_Production extends Doc
|
||||||
+ " M_ProductionLine pro_line INNER JOIN M_ProductionPlan plan ON pro_line.M_ProductionPlan_id = plan.M_ProductionPlan_id "
|
+ " M_ProductionLine pro_line INNER JOIN M_ProductionPlan plan ON pro_line.M_ProductionPlan_id = plan.M_ProductionPlan_id "
|
||||||
+ " INNER JOIN M_Production pro ON pro.M_Production_id = plan.M_Production_id "
|
+ " INNER JOIN M_Production pro ON pro.M_Production_id = plan.M_Production_id "
|
||||||
+ " WHERE pro.M_Production_ID=? "
|
+ " WHERE pro.M_Production_ID=? "
|
||||||
+ " ORDER BY pro_line.Line";
|
+ " ORDER BY plan.M_ProductionPlan_id, pro_line.Line";
|
||||||
}else{
|
}else{
|
||||||
// Production
|
// Production
|
||||||
// -- ProductionLine - the real level
|
// -- ProductionLine - the real level
|
||||||
|
@ -164,6 +164,7 @@ public class Doc_Production extends Doc
|
||||||
|
|
||||||
// Line pointer
|
// Line pointer
|
||||||
FactLine fl = null;
|
FactLine fl = null;
|
||||||
|
X_M_Production prod = (X_M_Production)getPO();
|
||||||
for (int i = 0; i < p_lines.length; i++)
|
for (int i = 0; i < p_lines.length; i++)
|
||||||
{
|
{
|
||||||
DocLine line = p_lines[i];
|
DocLine line = p_lines[i];
|
||||||
|
@ -181,12 +182,18 @@ public class Doc_Production extends Doc
|
||||||
}
|
}
|
||||||
if (line.isProductionBOM())
|
if (line.isProductionBOM())
|
||||||
{
|
{
|
||||||
|
X_M_ProductionLine endProLine = (X_M_ProductionLine)line.getPO();
|
||||||
|
Object parentEndPro = prod.isUseProductionPlan()?endProLine.getM_ProductionPlan_ID():endProLine.getM_Production_ID();
|
||||||
|
|
||||||
// Get BOM Cost - Sum of individual lines
|
// Get BOM Cost - Sum of individual lines
|
||||||
BigDecimal bomCost = Env.ZERO;
|
BigDecimal bomCost = Env.ZERO;
|
||||||
for (int ii = 0; ii < p_lines.length; ii++)
|
for (int ii = 0; ii < p_lines.length; ii++)
|
||||||
{
|
{
|
||||||
DocLine line0 = p_lines[ii];
|
DocLine line0 = p_lines[ii];
|
||||||
if (line0.getM_Production_ID() != line.getM_Production_ID())
|
X_M_ProductionLine bomProLine = (X_M_ProductionLine)line0.getPO();
|
||||||
|
Object parentBomPro = prod.isUseProductionPlan()?bomProLine.getM_ProductionPlan_ID():bomProLine.getM_Production_ID();
|
||||||
|
|
||||||
|
if (!parentBomPro.equals(parentEndPro))
|
||||||
continue;
|
continue;
|
||||||
//pb changed this 20/10/06
|
//pb changed this 20/10/06
|
||||||
if (!line0.isProductionBOM())
|
if (!line0.isProductionBOM())
|
||||||
|
|
Loading…
Reference in New Issue