IDEMPIERE-3910 M_Cost=>Current Cost/Costing Qty not updated due to matched PO posting by accounting engine
This commit is contained in:
parent
61ffa71f8c
commit
2616b201d7
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue