IDEMPIERE-210 Costing: Revert [ 1693997 ] Calculation of cost should happen when transaction complete. Fixed a regression introduce in previous revision.

This commit is contained in:
Heng Sin Low 2012-03-26 14:14:35 +08:00
parent b2a9801ed3
commit 69fc191cc7
1 changed files with 8 additions and 6 deletions

View File

@ -427,17 +427,19 @@ public class Doc_InOut extends Doc
{ {
costs = line.getProductCosts(as, line.getAD_Org_ID(), false); // current costs costs = line.getProductCosts(as, line.getAD_Org_ID(), false); // current costs
} }
if (costs == null || costs.signum() == 0)
{
p_Error = "Resubmit - No Costs for " + product.getName();
log.log(Level.WARNING, p_Error);
return null;
}
} }
else else
{ {
costs = BigDecimal.ZERO; costs = BigDecimal.ZERO;
} }
if (costs == null || costs.signum() == 0)
{
p_Error = "Resubmit - No Costs for " + product.getName();
log.log(Level.WARNING, p_Error);
return null;
}
// Inventory/Asset DR // Inventory/Asset DR
MAccount assets = line.getAccount(ProductCost.ACCTTYPE_P_Asset, as); MAccount assets = line.getAccount(ProductCost.ACCTTYPE_P_Asset, as);
if (product.isService()) if (product.isService())