IDEMPIERE-3361 Cost details inherit amt/qty from wrong history cost element

This commit is contained in:
Heng Sin Low 2017-09-13 15:01:34 +08:00
parent 2d8ab00c56
commit d4765a29e4
1 changed files with 8 additions and 4 deletions

View File

@ -1383,10 +1383,14 @@ public class MCostDetail extends X_M_CostDetail
log.warning("Unknown Type: " + toString());
return false;
}
setCurrentCostPrice(cost.getCurrentCostPrice());
setCurrentQty(cost.getCurrentQty());
setCumulatedAmt(cost.getCumulatedAmt());
setCumulatedQty(cost.getCumulatedQty());
//Should only update cost detail with value from as costing method
if(as.getCostingMethod().equals(ce.getCostingMethod())) {
setCurrentCostPrice(cost.getCurrentCostPrice());
setCurrentQty(cost.getCurrentQty());
setCumulatedAmt(cost.getCumulatedAmt());
setCumulatedQty(cost.getCumulatedQty());
}
//update history
history.setNewQty(cost.getCurrentQty());