Fixes Issue 9254: The Report Not Posted shouldn't show the good shipments and receipts if they are not being posted
authorDavid Alsasua <david.alsasua@openbravo.com>
Mon, 01 Jun 2009 18:30:49 +0200
changeset 3940 df2da712501b
parent 3939 87f54d2c3ce0
child 3941 cca535cc6e26
Fixes Issue 9254: The Report Not Posted shouldn't show the good shipments and receipts if they are not being posted
src/org/openbravo/erpCommon/ad_reports/ReportNotPosted.java
src/org/openbravo/erpCommon/ad_reports/ReportNotPosted_data.xsql
--- a/src/org/openbravo/erpCommon/ad_reports/ReportNotPosted.java	Mon Jun 01 17:19:44 2009 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportNotPosted.java	Mon Jun 01 18:30:49 2009 +0200
@@ -72,8 +72,8 @@
     } else {
       xmlDocument = xmlEngine.readXmlTemplate("org/openbravo/erpCommon/ad_reports/ReportNotPosted")
           .createXmlDocument();
-      data = ReportNotPostedData.select(this, vars.getLanguage(), strDateFrom, strDateTo, vars
-          .getClient());
+      data = ReportNotPostedData.select(this, vars.getLanguage(), vars.getClient(), strDateFrom,
+          strDateTo);
     }// DateTimeData.nDaysAfter
 
     ToolBar toolbar = new ToolBar(this, vars.getLanguage(), "ReportNotPosted", false, "", "", "",
--- a/src/org/openbravo/erpCommon/ad_reports/ReportNotPosted_data.xsql	Mon Jun 01 17:19:44 2009 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportNotPosted_data.xsql	Mon Jun 01 18:30:49 2009 +0200
@@ -30,58 +30,74 @@
         where processed = 'Y'
         and posted = 'N'
         and issotrx = 'Y'
+        and 'Y'=(select isactive from c_acctschema_table where ad_table_id='318' and ad_client_id=?)
         union
         select ad_client_id, documentno, dateacct, ad_column_identifier('C_Bpartner',to_char(C_bpartner_id), TO_CHAR(?)) as name, 0 as GRANDTOTAL, 'Goods Receipts' as document
         from m_inout
         where processed = 'Y'
         and posted = 'N'
         and issotrx = 'N'
+        and 'Y'=(select isactive from c_acctschema_table where ad_table_id='319' and ad_client_id=?)
         union
         select ad_client_id, documentno, dateacct, ad_column_identifier('C_Bpartner',to_char(C_bpartner_id), TO_CHAR(?)), GRANDTOTAL, 'Purchase Invoices'
         from c_invoice
         where processed = 'Y'
         and posted = 'N'
         and issotrx = 'N'
+        and 'Y'=(select isactive from c_acctschema_table where ad_table_id='318' and ad_client_id=?)
         union
         select ad_client_id, name, dateacct, ad_column_identifier('C_Cash',to_char(C_Cash_id), TO_CHAR(?)), c_cash.STATEMENTDIFFERENCE, 'Cash Journal'
         from C_Cash
         where processed = 'Y'
         and posted = 'N'
+        and 'Y'=(select isactive from c_acctschema_table where ad_table_id='407' and ad_client_id=?)
         union
         select ad_client_id, name, statementdate, ad_column_identifier('C_Bankstatement',to_char(C_bankstatement_id), TO_CHAR(?)), STATEMENTDIFFERENCE, 'Bank Statements'
         from c_bankstatement
         where processed = 'Y'
         and posted = 'N'
+        and 'Y'=(select isactive from c_acctschema_table where ad_table_id='392' and ad_client_id=?)
         union
         select ad_client_id, documentno, dateacct, ad_column_identifier('C_Settlement',to_char(C_Settlement_id), TO_CHAR(?)), generatedamt, 'Manual Settlements'
         from c_Settlement
         where processed = 'Y'
         and posted = 'N'
         and settlementtype = 'I'
+        and 'Y'=(select isactive from c_acctschema_table where ad_table_id='800019' and ad_client_id=?)
         union
         select ad_client_id, documentno, dateacct, ad_column_identifier('C_Settlement',to_char(C_Settlement_id), TO_CHAR(?)), generatedamt, 'Settlements'
         from c_Settlement
         where processed = 'Y'
         and posted = 'N'
         and settlementtype <> 'I'
+        and 'Y'=(select isactive from c_acctschema_table where ad_table_id='800019' and ad_client_id=?)
         union
         select ad_client_id, documentno, dateacct, ad_column_identifier('GL_Journal',to_char(GL_Journal_id), TO_CHAR(?)), totaldr, 'GL Journal'
         from GL_Journal
         where processed = 'Y'
-        and posted = 'N') AAA
+        and posted = 'N'
+        and 'Y'=(select isactive from c_acctschema_table where ad_table_id='224' and ad_client_id=?)) AAA
         where dateacct >= ?
         and dateacct <= ?
         and ad_client_id = ?
         order by  document, dateacct, name
       ]]></Sql>
     <Parameter name="adLanguage"/>
+    <Parameter name="client"></Parameter>
     <Parameter name="adLanguage"/>
+    <Parameter name="client"></Parameter>
     <Parameter name="adLanguage"/>
+    <Parameter name="client"></Parameter>
     <Parameter name="adLanguage"/>
+    <Parameter name="client"></Parameter>
     <Parameter name="adLanguage"/>
+    <Parameter name="client"></Parameter>
     <Parameter name="adLanguage"/>
+    <Parameter name="client"></Parameter>
     <Parameter name="adLanguage"/>
+    <Parameter name="client"></Parameter>
     <Parameter name="adLanguage"/>
+    <Parameter name="client"></Parameter>
     <Parameter name="dateFrom"></Parameter>
     <Parameter name="dateTo"></Parameter>
     <Parameter name="client"></Parameter>