1003759 How to re-post a document if Charge type is changed in Product? ( related to IDEMPIERE-216 Average Costing: Zero Costing Item From Vendor but for standard costing ).

This commit is contained in:
Heng Sin Low 2014-02-26 15:01:52 +08:00
parent a1332d890a
commit 38f64d4f54
1 changed files with 11 additions and 3 deletions

View File

@ -294,11 +294,19 @@ public class Doc_MatchPO extends Doc
{ {
// No Costs yet - no PPV // No Costs yet - no PPV
if (costs == null || costs.signum() == 0) if (costs == null || costs.signum() == 0)
{
//ok if purchase price is zero too
if (m_oLine.getPriceActual().signum() == 0)
{
costs = BigDecimal.ZERO;
}
else
{ {
p_Error = "Resubmit - No Costs for " + product.getName(); p_Error = "Resubmit - No Costs for " + product.getName();
log.log(Level.SEVERE, p_Error); log.log(Level.SEVERE, p_Error);
return null; return null;
} }
}
// Difference // Difference
BigDecimal difference = totalCost.subtract(costs); BigDecimal difference = totalCost.subtract(costs);