IDEMPIERE-1447 Posting fails on reversal shipment with services
This commit is contained in:
parent
5803ed9602
commit
533302fbc1
|
@ -168,6 +168,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))
|
||||||
{
|
{
|
||||||
|
@ -178,7 +179,6 @@ public class Doc_InOut extends Doc
|
||||||
// end MZ
|
// end MZ
|
||||||
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())
|
||||||
{
|
{
|
||||||
//ok if we have purchased zero cost item from vendor before
|
//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,
|
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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue