details:   https://code.openbravo.com/erp/stable/2.50/rev/4aef77ce4df8
changeset: 9742:4aef77ce4df8
user:      Jon Alegría <jon.alegria <at> openbravo.com>
date:      Tue Nov 15 12:37:08 2011 +0100
summary:   Fixes issue 0018869: The General Ledger Report does not show 
properly data
depending of the organization, when the organization is *
In html format, a warning is shown when the fiscal year initial date can
not be found regarding the date from selected in the filter.

diffstat:

 src-db/database/sourcedata/AD_MESSAGE.xml                            |  11 
+++++
 src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.java      |  21 
++++++---
 src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger_data.xsql |   5 +-
 3 files changed, 29 insertions(+), 8 deletions(-)

diffs (94 lines):

diff -r 679a0bcc50a4 -r 4aef77ce4df8 src-db/database/sourcedata/AD_MESSAGE.xml
--- a/src-db/database/sourcedata/AD_MESSAGE.xml Tue Nov 15 11:02:57 2011 +0100
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml Tue Nov 15 12:37:08 2011 +0100
@@ -32547,6 +32547,17 @@
 <!--8DA2AC3A69BF4686A821CA634149C501-->  
<AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--8DA2AC3A69BF4686A821CA634149C501--></AD_MESSAGE>
 
+<!--8DACEA313A3D4A94877E7218881DCCC2--><AD_MESSAGE>
+<!--8DACEA313A3D4A94877E7218881DCCC2-->  
<AD_MESSAGE_ID><![CDATA[8DACEA313A3D4A94877E7218881DCCC2]]></AD_MESSAGE_ID>
+<!--8DACEA313A3D4A94877E7218881DCCC2-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--8DACEA313A3D4A94877E7218881DCCC2-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--8DACEA313A3D4A94877E7218881DCCC2-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--8DACEA313A3D4A94877E7218881DCCC2-->  
<VALUE><![CDATA[InitialDateNotFoundCalendar]]></VALUE>
+<!--8DACEA313A3D4A94877E7218881DCCC2-->  <MSGTEXT><![CDATA[The initial date 
for the fiscal calendar can not be retrieved. The initial balance could not 
show the real initial balance.]]></MSGTEXT>
+<!--8DACEA313A3D4A94877E7218881DCCC2-->  <MSGTYPE><![CDATA[W]]></MSGTYPE>
+<!--8DACEA313A3D4A94877E7218881DCCC2-->  
<AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--8DACEA313A3D4A94877E7218881DCCC2--></AD_MESSAGE>
+
 <!--8DB007EDD43F487790B3E304D41C39E6--><AD_MESSAGE>
 <!--8DB007EDD43F487790B3E304D41C39E6-->  
<AD_MESSAGE_ID><![CDATA[8DB007EDD43F487790B3E304D41C39E6]]></AD_MESSAGE_ID>
 <!--8DB007EDD43F487790B3E304D41C39E6-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff -r 679a0bcc50a4 -r 4aef77ce4df8 
src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.java
--- a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.java   Tue Nov 
15 11:02:57 2011 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.java   Tue Nov 
15 12:37:08 2011 +0100
@@ -244,11 +244,11 @@
     // String strTreeAccount = ReportTrialBalanceData.treeAccount(this, 
vars.getClient());
     String strOrgFamily = getFamily(strTreeOrg, strOrg);
     String strFinancialOrgFamily = getFinancialFamily(strTreeOrg, strOrg, 
vars.getClient());
-    String strYearInitialDate = ReportGeneralLedgerData.yearInitialDate(this, 
vars
+    String strExistsInitialDate = 
ReportGeneralLedgerData.yearInitialDate(this, vars
         .getSessionValue("#AD_SqlDateFormat"), strDateFrom, 
Utility.getContext(this, vars,
         "#User_Client", "ReportGeneralLedger"), strFinancialOrgFamily);
-    if (strYearInitialDate.equals(""))
-      strYearInitialDate = strDateFrom;
+    String strYearInitialDate = strDateFrom;
+    if (strExistsInitialDate.equals("")) strYearInitialDate = 
strExistsInitialDate;
     String toDatePlusOne = DateTimeData.nDaysAfter(this, strDateTo, "1");
 
     String strGroupByText = (strGroupBy.equals("BPartner") ? 
Utility.messageBD(this, "BusPartner",
@@ -461,6 +461,13 @@
       log4j.debug("data.length: " + data.length);
 
     if (data != null && data.length > 0) {
+      if (strExistsInitialDate.equals("") && vars.commandIn("FIND")) {
+        xmlDocument.setParameter("messageType", "WARNING");
+       xmlDocument.setParameter("messageTitle",
+          Utility.messageBD(this, "ProcessStatus-W", vars.getLanguage()));
+       xmlDocument.setParameter("messageMessage",
+          Utility.messageBD(this, "InitialDateNotFoundCalendar", 
vars.getLanguage()));
+      }
       if (strGroupBy.equals(""))
         xmlDocument.setData("structure1", data);
       else
@@ -506,8 +513,8 @@
     String strYearInitialDate = ReportGeneralLedgerData.yearInitialDate(this, 
vars
         .getSessionValue("#AD_SqlDateFormat"), strDateFrom, 
Utility.getContext(this, vars,
         "#User_Client", "ReportGeneralLedger"), strFinancialOrgFamily);
-    if (strYearInitialDate.equals(""))
-      strYearInitialDate = strDateFrom;
+    if (strYearInitialDate.equals("")) strYearInitialDate = strDateFrom;
+
     String toDatePlusOne = DateTimeData.nDaysAfter(this, strDateTo, "1");
 
     String strGroupByText = (strGroupBy.equals("BPartner") ? 
Utility.messageBD(this, "BusPartner",
@@ -608,8 +615,8 @@
     String strYearInitialDate = ReportGeneralLedgerData.yearInitialDate(this, 
vars
         .getSessionValue("#AD_SqlDateFormat"), strDateFrom, 
Utility.getContext(this, vars,
         "#User_Client", "ReportGeneralLedger"), strFinancialOrgFamily);
-    if (strYearInitialDate.equals(""))
-      strYearInitialDate = strDateFrom;
+    if (strYearInitialDate.equals("")) strYearInitialDate = strDateFrom;
+
     String toDatePlusOne = DateTimeData.nDaysAfter(this, strDateTo, "1");
 
     String strAllaccounts = "Y";
diff -r 679a0bcc50a4 -r 4aef77ce4df8 
src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger_data.xsql
--- a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger_data.xsql      
Tue Nov 15 11:02:57 2011 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger_data.xsql      
Tue Nov 15 12:37:08 2011 +0100
@@ -291,11 +291,14 @@
        SELECT NODE_ID AS ID
        FROM AD_TREENODE
        WHERE AD_TREE_ID = ?
-       AND AD_ISORGINCLUDED(?, NODE_ID, ?) <> -1
+       AND (AD_ISORGINCLUDED(?, NODE_ID, ?) <> -1
+       OR AD_ISORGINCLUDED(NODE_ID, ?, ?) <> -1)
      ]]></Sql>
      <Parameter name="adTreeId"/>
      <Parameter name="adOrgId"/>
      <Parameter name="adClientId"/>
+     <Parameter name="adOrgId"/>
+     <Parameter name="adClientId"/>
   </SqlMethod>
 
 </SqlClass>

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to