Fixes issue 22265: First entry in "journal entries report" is number 2
authorPandeeswari Ramakrishnan <pandeeswari.ramakrishnan@openbravo.com>
Thu, 23 May 2013 17:50:17 +0530
changeset 20474 bb419c9b4257
parent 20473 ee752250a37d
child 20475 8a750c29825c
Fixes issue 22265: First entry in "journal entries report" is number 2
src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.java
src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal_data.xsql
--- a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.java	Mon May 27 15:40:47 2013 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.java	Thu May 23 17:50:17 2013 +0530
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2001-2012 Openbravo SLU
+ * All portions are Copyright (C) 2001-2013 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -463,7 +463,7 @@
           strPosition = ReportGeneralLedgerJournalData.selectCountDirect(this,
               Utility.getContext(this, vars, "#User_Client", "ReportGeneralLedger"),
               Utility.getContext(this, vars, "#AccessibleOrgTree", "ReportGeneralLedger"),
-              strTable, strRecord, data[0].dateacct, data[0].identifier);
+              strTable, strRecord, strFactAcctGroupId, data[0].dateacct, data[0].identifier);
       }
     } else if (vars.commandIn("DIRECT")) {
       data = ReportGeneralLedgerJournalData.selectDirect(this,
@@ -474,7 +474,7 @@
         strPosition = ReportGeneralLedgerJournalData.selectCountDirect(this,
             Utility.getContext(this, vars, "#User_Client", "ReportGeneralLedger"),
             Utility.getContext(this, vars, "#AccessibleOrgTree", "ReportGeneralLedger"), strTable,
-            strRecord, data[0].dateacct, data[0].identifier);
+            strRecord, strFactAcctGroupId, data[0].dateacct, data[0].identifier);
     } else if (vars.commandIn("DIRECT2")) {
       data = ReportGeneralLedgerJournalData.selectDirect2(this,
           Utility.getContext(this, vars, "#User_Client", "ReportGeneralLedger"),
--- a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal_data.xsql	Mon May 27 15:40:47 2013 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal_data.xsql	Thu May 23 17:50:17 2013 +0530
@@ -12,7 +12,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2001-2012 Openbravo SLU
+ * All portions are Copyright (C) 2001-2013 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -200,6 +200,7 @@
         WHERE F.AD_CLIENT_ID IN ('1')
         AND F.AD_ORG_ID IN('1')
         AND 1=1
+        AND F.fact_acct_group_id = ?
         AND (CASE (SELECT MAX(ISSOTRX) FROM C_DOCTYPE D 
         WHERE D.DOCBASETYPE = F.DOCBASETYPE) WHEN 'N' THEN COALESCE(T.PO_WINDOW_ID, T.AD_WINDOW_ID) ELSE T.AD_WINDOW_ID END) = W.AD_WINDOW_ID 
         GROUP BY F.DATEACCT, F.FACT_ACCT_GROUP_ID) AA
@@ -209,6 +210,7 @@
     <Parameter name="adUserOrg" type="replace" optional="true" after="AND F.AD_ORG_ID IN(" text="'1'"/>
     <Parameter name="table" optional="true" after="AND 1=1"><![CDATA[ AND f.ad_table_Id = ?]]></Parameter>
     <Parameter name="record" optional="true" after="AND 1=1"><![CDATA[ AND f.record_Id = ?]]></Parameter>
+    <Parameter name="factAcctGroup"/>
     <Parameter name="dateAcct"/>
     <Parameter name="dateAcct"/>
     <Parameter name="factAcctGroupId"/>