IDEMPIERE-3352 Enhancement of Batch Level Costing. Use safer approach for production reversal checking.
This commit is contained in:
parent
8194d58ec1
commit
f4969a172f
|
@ -1263,11 +1263,11 @@ public class MCostDetail extends X_M_CostDetail
|
||||||
}
|
}
|
||||||
else if (addition)
|
else if (addition)
|
||||||
{
|
{
|
||||||
MProductionLine productionLine = (MProductionLine) getM_ProductionLine();
|
MProductionLine productionLine = getM_ProductionLine_ID() > 0 ? new MProductionLine(getCtx(), getM_ProductionLine_ID(), get_TrxName()) : null;
|
||||||
if (productionLine.getProductionReversalId() <= 0)
|
if (productionLine != null && productionLine.getProductionReversalId() > 0)
|
||||||
cost.add(amt, qty);
|
|
||||||
else
|
|
||||||
cost.setCurrentQty(cost.getCurrentQty().add(qty));
|
cost.setCurrentQty(cost.getCurrentQty().add(qty));
|
||||||
|
else
|
||||||
|
cost.add(amt, qty);
|
||||||
|
|
||||||
// Initial
|
// Initial
|
||||||
if (cost.getCurrentCostPrice().signum() == 0
|
if (cost.getCurrentCostPrice().signum() == 0
|
||||||
|
|
Loading…
Reference in New Issue