IDEMPIERE-1447 Posting fails on reversal shipment with services

This commit is contained in:
Carlos Ruiz 2013-10-16 16:52:29 -05:00
parent 533302fbc1
commit a36239a8d9
2 changed files with 14 additions and 1 deletions

View File

@ -296,6 +296,7 @@ public class Doc_InOut extends Doc
for (int i = 0; i < p_lines.length; i++) for (int i = 0; i < p_lines.length; i++)
{ {
DocLine line = p_lines[i]; DocLine line = p_lines[i];
MProduct product = line.getProduct();
BigDecimal costs = null; BigDecimal costs = null;
if (!isReversal(line)) if (!isReversal(line))
{ {
@ -306,7 +307,6 @@ public class Doc_InOut extends Doc
if (costs == null || costs.signum() == 0) // zero costs OK if (costs == null || costs.signum() == 0) // zero costs OK
{ {
MProduct product = line.getProduct();
if (product.isStocked()) if (product.isStocked())
{ {
p_Error = "No Costs for " + line.getProduct().getName(); p_Error = "No Costs for " + line.getProduct().getName();
@ -340,6 +340,10 @@ public class Doc_InOut extends Doc
if (!dr.updateReverseLine (MInOut.Table_ID, if (!dr.updateReverseLine (MInOut.Table_ID,
m_Reversal_ID, line.getReversalLine_ID(),Env.ONE)) 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"; p_Error = "Original Shipment/Receipt not posted yet";
return null; return null;
} }
@ -502,6 +506,10 @@ public class Doc_InOut extends Doc
if (!dr.updateReverseLine (MInOut.Table_ID, if (!dr.updateReverseLine (MInOut.Table_ID,
m_Reversal_ID, line.getReversalLine_ID(),Env.ONE)) m_Reversal_ID, line.getReversalLine_ID(),Env.ONE))
{ {
if (! product.isStocked()) { // ignore service
fact.remove(dr);
continue;
}
p_Error = "Original Receipt not posted yet"; p_Error = "Original Receipt not posted yet";
return null; return null;
} }
@ -615,6 +623,10 @@ public class Doc_InOut extends Doc
if (!dr.updateReverseLine (MInOut.Table_ID, if (!dr.updateReverseLine (MInOut.Table_ID,
m_Reversal_ID, line.getReversalLine_ID(),Env.ONE)) m_Reversal_ID, line.getReversalLine_ID(),Env.ONE))
{ {
if (! product.isStocked()) { // ignore service
fact.remove(dr);
continue;
}
p_Error = "Original Receipt not posted yet"; p_Error = "Original Receipt not posted yet";
return null; return null;
} }

View File

@ -154,6 +154,7 @@ public final class ImpFormat
{ {
m_tableUnique1 = "UPC"; // UPC = unique m_tableUnique1 = "UPC"; // UPC = unique
m_tableUnique2 = "Value"; m_tableUnique2 = "Value";
// must validate both fields - if one is empty don't check
m_tableUniqueChild = "VendorProductNo"; // Vendor No may not be unique ! m_tableUniqueChild = "VendorProductNo"; // Vendor No may not be unique !
m_tableUniqueParent = "BPartner_Value"; // Makes it unique m_tableUniqueParent = "BPartner_Value"; // Makes it unique
} }