From 2540820787d7b014abcb8e2dd8493ddc365c53ae Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 7 Apr 2008 15:28:03 +0000 Subject: [PATCH] Fix [ 1933947 ] BPartnerValidate Error --- base/src/org/compiere/model/MBPartner.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/base/src/org/compiere/model/MBPartner.java b/base/src/org/compiere/model/MBPartner.java index 8a6e6ddd22..db6fe44a62 100644 --- a/base/src/org/compiere/model/MBPartner.java +++ b/base/src/org/compiere/model/MBPartner.java @@ -738,10 +738,10 @@ public class MBPartner extends X_C_BPartner BigDecimal TotalOpenBalance = null; String sql = "SELECT " // SO Credit Used - + "COALESCE((SELECT SUM(currencyBase(invoiceOpen(i.C_Invoice_ID,i.C_InvoicePaySchedule_ID),i.C_Currency_ID,i.DateOrdered, i.AD_Client_ID,i.AD_Org_ID)) FROM C_Invoice_v i " + + "COALESCE((SELECT SUM(currencyBase(invoiceOpen(i.C_Invoice_ID,i.C_InvoicePaySchedule_ID),i.C_Currency_ID,i.DateInvoiced, i.AD_Client_ID,i.AD_Org_ID)) FROM C_Invoice_v i " + "WHERE i.C_BPartner_ID=bp.C_BPartner_ID AND i.IsSOTrx='Y' AND i.IsPaid='N'),0), " // Balance (incl. unallocated payments) - + "COALESCE((SELECT SUM(currencyBase(invoiceOpen(i.C_Invoice_ID,i.C_InvoicePaySchedule_ID),i.C_Currency_ID,i.DateOrdered, i.AD_Client_ID,i.AD_Org_ID)*i.MultiplierAP) FROM C_Invoice_v i " + + "COALESCE((SELECT SUM(currencyBase(invoiceOpen(i.C_Invoice_ID,i.C_InvoicePaySchedule_ID),i.C_Currency_ID,i.DateInvoiced, i.AD_Client_ID,i.AD_Org_ID)*i.MultiplierAP) FROM C_Invoice_v i " + "WHERE i.C_BPartner_ID=bp.C_BPartner_ID AND i.IsPaid='N'),0) - " + "COALESCE((SELECT SUM(currencyBase(Paymentavailable(p.C_Payment_ID),p.C_Currency_ID,p.DateTrx,p.AD_Client_ID,p.AD_Org_ID)) FROM C_Payment_v p " + "WHERE p.C_BPartner_ID=bp.C_BPartner_ID AND p.IsAllocated='N'" @@ -793,7 +793,7 @@ public class MBPartner extends X_C_BPartner { BigDecimal ActualLifeTimeValue = null; String sql = "SELECT " - + "COALESCE ((SELECT SUM(currencyBase(i.GrandTotal,i.C_Currency_ID,i.DateOrdered, i.AD_Client_ID,i.AD_Org_ID)) FROM C_Invoice_v i " + + "COALESCE ((SELECT SUM(currencyBase(i.GrandTotal,i.C_Currency_ID,i.DateInvoiced, i.AD_Client_ID,i.AD_Org_ID)) FROM C_Invoice_v i " + "WHERE i.C_BPartner_ID=bp.C_BPartner_ID AND i.IsSOTrx='Y'),0) " + "FROM C_BPartner bp " + "WHERE C_BPartner_ID=?";