IDEMPIERE-3960 Partial payments or installment payment not working in payment selection (#138)
This commit is contained in:
parent
2d70a1a169
commit
9da97ab06d
|
@ -243,13 +243,13 @@ public class PaySelect
|
||||||
+ " INNER JOIN C_PaymentTerm p ON (i.C_PaymentTerm_ID=p.C_PaymentTerm_ID)",
|
+ " INNER JOIN C_PaymentTerm p ON (i.C_PaymentTerm_ID=p.C_PaymentTerm_ID)",
|
||||||
// WHERE
|
// WHERE
|
||||||
"i.IsSOTrx=? AND IsPaid='N'"
|
"i.IsSOTrx=? AND IsPaid='N'"
|
||||||
+ " AND invoiceOpen(i.C_Invoice_ID, i.C_InvoicePaySchedule_ID) != 0" //Check that AmountDue <> 0
|
+ " AND invoiceOpenToDate(i.C_Invoice_ID, i.C_InvoicePaySchedule_ID, SysDate) != 0" //Check that AmountDue <> 0
|
||||||
// Different Payment Selection
|
// Different Payment Selection
|
||||||
+ " AND NOT EXISTS (SELECT * FROM C_PaySelectionLine psl"
|
+ " AND (i.C_InvoicePaySchedule_ID > 0 OR NOT EXISTS (SELECT * FROM C_PaySelectionLine psl"
|
||||||
+ " INNER JOIN C_PaySelectionCheck psc ON (psl.C_PaySelectionCheck_ID=psc.C_PaySelectionCheck_ID)"
|
+ " INNER JOIN C_PaySelectionCheck psc ON (psl.C_PaySelectionCheck_ID=psc.C_PaySelectionCheck_ID)"
|
||||||
+ " LEFT OUTER JOIN C_Payment pmt ON (pmt.C_Payment_ID=psc.C_Payment_ID)"
|
+ " LEFT OUTER JOIN C_Payment pmt ON (pmt.C_Payment_ID=psc.C_Payment_ID)"
|
||||||
+ " WHERE i.C_Invoice_ID=psl.C_Invoice_ID AND psl.IsActive='Y'"
|
+ " WHERE i.C_Invoice_ID=psl.C_Invoice_ID AND psl.IsActive='Y'"
|
||||||
+ " AND (pmt.DocStatus IS NULL OR pmt.DocStatus NOT IN ('VO','RE')) )"
|
+ " AND (pmt.DocStatus IS NULL OR pmt.DocStatus NOT IN ('VO','RE')) ))"
|
||||||
+ " AND i.DocStatus IN ('CO','CL')"
|
+ " AND i.DocStatus IN ('CO','CL')"
|
||||||
+ " AND i.AD_Client_ID=?", // additional where & order in loadTableInfo()
|
+ " AND i.AD_Client_ID=?", // additional where & order in loadTableInfo()
|
||||||
true, "i");
|
true, "i");
|
||||||
|
|
Loading…
Reference in New Issue