From 5088b011e4e6dc42831e8bf2603a7e1aa9f12433 Mon Sep 17 00:00:00 2001 From: croo Date: Wed, 21 Feb 2007 11:28:19 +0000 Subject: [PATCH] Fix for Bug#1605368 Only due invoices in Payment Selection --- client/src/org/compiere/apps/form/VPaySelect.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/src/org/compiere/apps/form/VPaySelect.java b/client/src/org/compiere/apps/form/VPaySelect.java index e5b05904cf..db4539340c 100644 --- a/client/src/org/compiere/apps/form/VPaySelect.java +++ b/client/src/org/compiere/apps/form/VPaySelect.java @@ -13,6 +13,8 @@ * For the text or an alternative of this public license, you may reach us * * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * * or via info@compiere.org or http://www.compiere.org/license.html * + * Contributors: * + * Colin Rooney (croo) Patch 1605368 Fixed Payment Terms & Only due * *****************************************************************************/ package org.compiere.apps.form; @@ -282,7 +284,7 @@ public class VPaySelect extends CPanel m_sql = miniTable.prepareTable(new ColumnInfo[] { // 0..4 new ColumnInfo(" ", "i.C_Invoice_ID", IDColumn.class, false, false, null), - new ColumnInfo(Msg.translate(ctx, "DueDate"), "i.DateInvoiced+p.NetDays AS DateDue", Timestamp.class, true, true, null), + new ColumnInfo(Msg.translate(ctx, "DueDate"), "paymentTermDueDate(i.C_PaymentTerm_ID, i.DateInvoiced) AS DateDue", Timestamp.class, true, true, null), new ColumnInfo(Msg.translate(ctx, "C_BPartner_ID"), "bp.Name", KeyNamePair.class, true, false, "i.C_BPartner_ID"), new ColumnInfo(Msg.translate(ctx, "DocumentNo"), "i.DocumentNo", String.class), new ColumnInfo(Msg.translate(ctx, "C_Currency_ID"), "c.ISO_Code", KeyNamePair.class, true, false, "i.C_Currency_ID"), @@ -384,7 +386,7 @@ public class VPaySelect extends CPanel } // if (onlyDue.isSelected()) - sql += " AND i.DateInvoiced+p.NetDays <= ?"; + sql += " AND paymentTermDueDate(i.C_PaymentTerm_ID, i.DateInvoiced) <= ?"; // KeyNamePair pp = (KeyNamePair)fieldBPartner.getSelectedItem(); int C_BPartner_ID = pp.getKey();