IDEMPIERE-1447 Posting fails on reversal shipment with services

This commit is contained in:
Carlos Ruiz 2013-10-16 16:35:48 -05:00
parent 5803ed9602
commit 533302fbc1
1 changed files with 5 additions and 1 deletions

View File

@ -168,6 +168,7 @@ public class Doc_InOut extends Doc
for (int i = 0; i < p_lines.length; i++)
{
DocLine line = p_lines[i];
MProduct product = line.getProduct();
BigDecimal costs = null;
if (!isReversal(line))
{
@ -178,7 +179,6 @@ public class Doc_InOut extends Doc
// end MZ
if (costs == null || costs.signum() == 0) // zero costs OK
{
MProduct product = line.getProduct();
if (product.isStocked())
{
//ok if we have purchased zero cost item from vendor before
@ -227,6 +227,10 @@ public class Doc_InOut extends Doc
if (!dr.updateReverseLine (MInOut.Table_ID,
m_Reversal_ID, line.getReversalLine_ID(),Env.ONE))
{
if (! product.isStocked()) { // ignore service
fact.remove(dr);
continue;
}
p_Error = "Original Shipment/Receipt not posted yet";
return null;
}