From 149316e79e28bf07d55ac02c0c95478f976be6b1 Mon Sep 17 00:00:00 2001 From: Elaine Tan Date: Fri, 20 Dec 2013 18:38:21 +0800 Subject: [PATCH] IDEMPIERE-1632 When match 1 receipt linked 1 PO with two invoice. 2 new matchPO is create with error post --- .../src/org/compiere/acct/Doc_MatchPO.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_MatchPO.java b/org.adempiere.base/src/org/compiere/acct/Doc_MatchPO.java index 536124971a..ebbad798fd 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_MatchPO.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_MatchPO.java @@ -134,6 +134,19 @@ public class Doc_MatchPO extends Doc return facts; } + if (m_M_InOutLine_ID == 0) + { + MMatchPO[] matchPOs = MMatchPO.getOrderLine(getCtx(), m_oLine.getC_OrderLine_ID(), getTrxName()); + for (MMatchPO matchPO : matchPOs) + { + if (matchPO.getM_InOutLine_ID() > 0 && matchPO.getC_InvoiceLine_ID() == 0) + { + m_M_InOutLine_ID = matchPO.getM_InOutLine_ID(); + break; + } + } + } + if (m_M_InOutLine_ID == 0) // No posting if not matched to Shipment { p_Error = "No posting if not matched to Shipment";