IDEMPIERE-1174 Found avg po cost detail record was not being created when following flow PO->Inv->Receipt - force the posting of matchpo just when receipt is associated
This commit is contained in:
parent
180a720f25
commit
46585842d2
|
@ -126,14 +126,19 @@ public class Doc_MatchPO extends Doc
|
|||
ArrayList<Fact> facts = new ArrayList<Fact>();
|
||||
//
|
||||
if (getM_Product_ID() == 0 // Nothing to do if no Product
|
||||
|| getQty().signum() == 0
|
||||
|| m_M_InOutLine_ID == 0) // No posting if not matched to Shipment
|
||||
|| getQty().signum() == 0)
|
||||
{
|
||||
if (log.isLoggable(Level.FINE)) log.fine("No Product/Qty - M_Product_ID=" + getM_Product_ID()
|
||||
+ ",Qty=" + getQty());
|
||||
return facts;
|
||||
}
|
||||
|
||||
if (m_M_InOutLine_ID == 0) // No posting if not matched to Shipment
|
||||
{
|
||||
p_Error = "No posting if not matched to Shipment";
|
||||
return null;
|
||||
}
|
||||
|
||||
// create Fact Header
|
||||
Fact fact = new Fact(this, as, Fact.POST_Actual);
|
||||
setC_Currency_ID(as.getC_Currency_ID());
|
||||
|
|
|
@ -1849,7 +1849,7 @@ public class MInvoice extends X_C_Invoice implements DocAction
|
|||
return DocAction.STATUS_Invalid;
|
||||
}
|
||||
matchPO++;
|
||||
if (!po.isPosted())
|
||||
if (!po.isPosted() && po.getM_InOutLine_ID() > 0) // match po don't post if receipt is not assigned, and it doesn't create avg po record
|
||||
addDocsPostProcess(po);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue