Fixes Issue 10688: CashFlow Forecast report does not work in PostgreSQL
authorJeneive MalarKodi <jeneive.malarkodi@openbravo.com>
Wed, 23 Sep 2009 11:19:02 +0530
changeset 5069 b4990292ae3e
parent 5068 ff6ccc39f03c
child 5070 1c3767f18498
Fixes Issue 10688: CashFlow Forecast report does not work in PostgreSQL
src/org/openbravo/erpCommon/ad_reports/ReportCashflowForecast.jrxml
src/org/openbravo/erpCommon/ad_reports/ReportCashflowForecast_sub.jrxml
--- a/src/org/openbravo/erpCommon/ad_reports/ReportCashflowForecast.jrxml	Wed Sep 23 11:03:25 2009 +0530
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportCashflowForecast.jrxml	Wed Sep 23 11:19:02 2009 +0530
@@ -504,6 +504,12 @@
 					<subreportParameter  name="LOCALE">
 						<subreportParameterExpression><![CDATA[$P{LOCALE}]]></subreportParameterExpression>
 					</subreportParameter>
+					<subreportParameter  name="USER_CLIENT">
+						<subreportParameterExpression><![CDATA[$P{USER_CLIENT}]]></subreportParameterExpression>
+					</subreportParameter>
+					<subreportParameter  name="USER_ORG">
+						<subreportParameterExpression><![CDATA[$P{USER_ORG}]]></subreportParameterExpression>
+					</subreportParameter>
 					<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
 					<subreportExpression  class="net.sf.jasperreports.engine.JasperReport"><![CDATA[$P{ReportData}]]></subreportExpression>
 				</subreport>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportCashflowForecast_sub.jrxml	Wed Sep 23 11:03:25 2009 +0530
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportCashflowForecast_sub.jrxml	Wed Sep 23 11:19:02 2009 +0530
@@ -231,7 +231,7 @@
     FROM C_BANKSTATEMENTLINE BL,     
     C_BANKSTATEMENT     BS,           C_BANK              B,           C_BANKACCOUNT       BA     
     WHERE BS.C_BANKSTATEMENT_ID = BL.C_BANKSTATEMENT_ID        AND BA.C_BANKACCOUNT_ID = BS.C_BANKACCOUNT_ID        AND BA.C_BANK_ID = B.C_BANK_ID         AND BS.PROCESSED='Y'        
-    AND BS.STATEMENTDATE <= NOW()        AND 3=3    AND B.AD_CLIENT_ID IN (0,1000000)        AND B.AD_ORG_ID IN (1000000,0)        
+    AND BS.STATEMENTDATE <= NOW()        AND 3=3    AND B.AD_CLIENT_ID IN ($P!{USER_CLIENT})      AND B.AD_ORG_ID IN ($P!{USER_ORG})       
     GROUP BY (B.CODEBANK || '/' || B.CODEBRANCH || B.DIGITCONTROL || BA.CODEACCOUNT || '.' || BA.DIGITCONTROL), BA.C_BANKACCOUNT_ID, ba.c_Currency_ID, ba.ad_client_id, ba.ad_org_id        ) AAA        
     ORDER BY 1]]></queryString>