IDEMPIERE-3910 M_Cost=>Current Cost/Costing Qty not updated due to matched PO posting by accounting engine

This commit is contained in:
Heng Sin Low 2019-04-23 21:06:04 +08:00
parent 61ffa71f8c
commit 2616b201d7
1 changed files with 15 additions and 4 deletions

View File

@ -41,6 +41,7 @@ import org.compiere.model.MProduct;
import org.compiere.model.MTax;
import org.compiere.model.ProductCost;
import org.compiere.model.X_M_InOut;
import org.compiere.process.DocAction;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Util;
@ -113,11 +114,16 @@ public class Doc_MatchPO extends Doc
{
if (matchPO.getM_InOutLine_ID() > 0 && matchPO.getC_InvoiceLine_ID() == 0)
{
String docStatus = matchPO.getM_InOutLine().getM_InOut().getDocStatus();
if (docStatus.equals(DocAction.STATUS_Completed) || docStatus.equals(DocAction.STATUS_Closed)) {
if (matchPO.getQty().compareTo(getQty()) <= 0) {
m_M_InOutLine_ID = matchPO.getM_InOutLine_ID();
break;
}
}
}
}
}
if (m_M_InOutLine_ID == 0) // Defer posting if not matched to Shipment
{
@ -184,11 +190,16 @@ public class Doc_MatchPO extends Doc
{
if (matchPO.getM_InOutLine_ID() > 0 && matchPO.getC_InvoiceLine_ID() == 0)
{
String docStatus = matchPO.getM_InOutLine().getM_InOut().getDocStatus();
if (docStatus.equals(DocAction.STATUS_Completed) || docStatus.equals(DocAction.STATUS_Closed)) {
if (matchPO.getQty().compareTo(getQty()) <= 0) {
m_M_InOutLine_ID = matchPO.getM_InOutLine_ID();
break;
}
}
}
}
}
if (m_M_InOutLine_ID == 0) // No posting if not matched to Shipment
{