Fix bug in generation allocation header, when payment has datetrx <> dateacct the allocation was being generated with wrong dateacct

This commit is contained in:
Carlos Ruiz 2011-03-07 10:23:43 -05:00
parent cc8e13b32f
commit 9da89f5101
1 changed files with 3 additions and 1 deletions

View File

@ -2072,6 +2072,7 @@ public final class MPayment extends X_C_Payment
getDateTrx(), getC_Currency_ID(), getDateTrx(), getC_Currency_ID(),
Msg.translate(getCtx(), "C_Payment_ID") + ": " + getDocumentNo() + " [1]", get_TrxName()); Msg.translate(getCtx(), "C_Payment_ID") + ": " + getDocumentNo() + " [1]", get_TrxName());
alloc.setAD_Org_ID(getAD_Org_ID()); alloc.setAD_Org_ID(getAD_Org_ID());
alloc.setDateAcct(getDateAcct()); // in case date acct is different from datetrx in payment
alloc.saveEx(); alloc.saveEx();
MAllocationLine aLine = null; MAllocationLine aLine = null;
if (isReceipt()) if (isReceipt())
@ -2109,6 +2110,7 @@ public final class MPayment extends X_C_Payment
getDateTrx(), getC_Currency_ID(), getDateTrx(), getC_Currency_ID(),
Msg.translate(getCtx(), "C_Payment_ID") + ": " + getDocumentNo() + " [n]", get_TrxName()); Msg.translate(getCtx(), "C_Payment_ID") + ": " + getDocumentNo() + " [n]", get_TrxName());
alloc.setAD_Org_ID(getAD_Org_ID()); alloc.setAD_Org_ID(getAD_Org_ID());
alloc.setDateAcct(getDateAcct()); // in case date acct is different from datetrx in payment
String sql = "SELECT psc.C_BPartner_ID, psl.C_Invoice_ID, psl.IsSOTrx, " // 1..3 String sql = "SELECT psc.C_BPartner_ID, psl.C_Invoice_ID, psl.IsSOTrx, " // 1..3
+ " psl.PayAmt, psl.DiscountAmt, psl.DifferenceAmt, psl.OpenAmt " + " psl.PayAmt, psl.DiscountAmt, psl.DifferenceAmt, psl.OpenAmt "