IDEMPIERE-2588 Immediate posting of a cash POS Order is not posting allocation

This commit is contained in:
Carlos Ruiz 2015-04-19 20:06:24 -05:00
parent b69fee8c91
commit dd252d2bd7
3 changed files with 12 additions and 2 deletions

View File

@ -1765,6 +1765,9 @@ public class MInvoice extends X_C_Invoice implements DocAction
payment.saveEx(); payment.saveEx();
info.append("@C_Payment_ID@: " + payment.getDocumentInfo()); info.append("@C_Payment_ID@: " + payment.getDocumentInfo());
// IDEMPIERE-2588 - add the allocation generation with the payment
if (payment.getJustCreatedAllocInv() != null)
addDocsPostProcess(payment.getJustCreatedAllocInv());
} // Payment } // Payment
// Update Order & Match // Update Order & Match

View File

@ -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 * Get Payments Of BPartner
@ -2303,6 +2303,7 @@ public class MPayment extends X_C_Payment
throw new AdempiereException("Failed when processing document - " + alloc.getProcessMsg()); throw new AdempiereException("Failed when processing document - " + alloc.getProcessMsg());
// end added // end added
alloc.saveEx(get_TrxName()); alloc.saveEx(get_TrxName());
m_justCreatedAllocInv = alloc;
m_processMsg = "@C_AllocationHdr_ID@: " + alloc.getDocumentNo(); m_processMsg = "@C_AllocationHdr_ID@: " + alloc.getDocumentNo();
// Get Project from Invoice // Get Project from Invoice
@ -2997,5 +2998,11 @@ public class MPayment extends X_C_Payment
return MPaymentTransaction.getAllIDs(Table_Name, whereClause.toString(), trxName); return MPaymentTransaction.getAllIDs(Table_Name, whereClause.toString(), trxName);
} }
// IDEMPIERE-2588
private MAllocationHdr m_justCreatedAllocInv = null;
public MAllocationHdr getJustCreatedAllocInv() {
return m_justCreatedAllocInv;
}
} // MPayment } // MPayment

View File

@ -316,7 +316,7 @@ public class DocumentEngine implements DocAction
if (m_document != null && ok) if (m_document != null && ok)
{ {
// PostProcess documents when invoice or inout (this is to postprocess the generated MatchPO and MatchInv if any) // PostProcess documents when invoice or inout (this is to postprocess the generated MatchPO and MatchInv if any)
ArrayList<PO> docsPostProcess = new ArrayList<PO>();; ArrayList<PO> docsPostProcess = new ArrayList<PO>();
if (m_document instanceof MInvoice || m_document instanceof MInOut) { if (m_document instanceof MInvoice || m_document instanceof MInOut) {
if (m_document instanceof MInvoice) { if (m_document instanceof MInvoice) {
docsPostProcess = ((MInvoice) m_document).getDocsPostProcess(); docsPostProcess = ((MInvoice) m_document).getDocsPostProcess();