diff --git a/org.adempiere.base/src/org/compiere/model/MInvoice.java b/org.adempiere.base/src/org/compiere/model/MInvoice.java index 3f67ebf446..ad7c08e171 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoice.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoice.java @@ -1765,6 +1765,9 @@ public class MInvoice extends X_C_Invoice implements DocAction payment.saveEx(); info.append("@C_Payment_ID@: " + payment.getDocumentInfo()); + // IDEMPIERE-2588 - add the allocation generation with the payment + if (payment.getJustCreatedAllocInv() != null) + addDocsPostProcess(payment.getJustCreatedAllocInv()); } // Payment // Update Order & Match diff --git a/org.adempiere.base/src/org/compiere/model/MPayment.java b/org.adempiere.base/src/org/compiere/model/MPayment.java index 74958be833..d9bd87d70a 100644 --- a/org.adempiere.base/src/org/compiere/model/MPayment.java +++ b/org.adempiere.base/src/org/compiere/model/MPayment.java @@ -83,7 +83,7 @@ public class MPayment extends X_C_Payment /** * */ - private static final long serialVersionUID = -7646717328867858897L; + private static final long serialVersionUID = -7179638016937305380L; /** * Get Payments Of BPartner @@ -2303,6 +2303,7 @@ public class MPayment extends X_C_Payment throw new AdempiereException("Failed when processing document - " + alloc.getProcessMsg()); // end added alloc.saveEx(get_TrxName()); + m_justCreatedAllocInv = alloc; m_processMsg = "@C_AllocationHdr_ID@: " + alloc.getDocumentNo(); // Get Project from Invoice @@ -2997,5 +2998,11 @@ public class MPayment extends X_C_Payment return MPaymentTransaction.getAllIDs(Table_Name, whereClause.toString(), trxName); } + + // IDEMPIERE-2588 + private MAllocationHdr m_justCreatedAllocInv = null; + public MAllocationHdr getJustCreatedAllocInv() { + return m_justCreatedAllocInv; + } } // MPayment diff --git a/org.adempiere.base/src/org/compiere/process/DocumentEngine.java b/org.adempiere.base/src/org/compiere/process/DocumentEngine.java index 8e33cf54fa..6b5d477132 100644 --- a/org.adempiere.base/src/org/compiere/process/DocumentEngine.java +++ b/org.adempiere.base/src/org/compiere/process/DocumentEngine.java @@ -316,7 +316,7 @@ public class DocumentEngine implements DocAction if (m_document != null && ok) { // PostProcess documents when invoice or inout (this is to postprocess the generated MatchPO and MatchInv if any) - ArrayList docsPostProcess = new ArrayList();; + ArrayList docsPostProcess = new ArrayList(); if (m_document instanceof MInvoice || m_document instanceof MInOut) { if (m_document instanceof MInvoice) { docsPostProcess = ((MInvoice) m_document).getDocsPostProcess();