Fixes issue 9734: Balance Sheet provisional amounts not calculated correctly
authorDavid Alsasua <david.alsasua@openbravo.com>
Wed, 01 Jul 2009 08:26:39 +0200
changeset 4079 7604d5276b6a
parent 4078 9c8e98c4df2c
child 4080 3f159d6df853
Fixes issue 9734: Balance Sheet provisional amounts not calculated correctly
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_ELEMENT.xml
src-db/database/sourcedata/AD_FIELD.xml
src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports_data.xsql
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Tue Jun 30 21:06:36 2009 +0200
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Wed Jul 01 08:26:39 2009 +0200
@@ -264069,7 +264069,8 @@
 <!--6BDD5BBDFE613D4BE040007F01013540-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--6BDD5BBDFE613D4BE040007F01013540-->  <NAME><![CDATA[Report Type]]></NAME>
 <!--6BDD5BBDFE613D4BE040007F01013540-->  <DESCRIPTION><![CDATA[Indicates whether the report is "Point in time" (needs to calculate an opening balance if it does not exist) or a "Periodic" report (in this case that calculation is not needed)]]></DESCRIPTION>
-<!--6BDD5BBDFE613D4BE040007F01013540-->  <HELP><![CDATA[Indicates whether the report is "Point in time" (needs to calculate an opening balance if it does not exist) or a "Periodic" report (in this case that calculation is not needed)]]></HELP>
+<!--6BDD5BBDFE613D4BE040007F01013540-->  <HELP><![CDATA[Indicates whether the report is a "Point in Time" or a "Periodic" report.
+A Point in Time report is obtained as of a given date, taking into account the whole historical financial movements; an example of point in time report is the Balance Sheet.<br> A periodic report is executed for a date range and it does not carry forward the balance of accounting movements previous to the range; an example of periodic report is the Income Statement.]]></HELP>
 <!--6BDD5BBDFE613D4BE040007F01013540-->  <COLUMNNAME><![CDATA[ReportType]]></COLUMNNAME>
 <!--6BDD5BBDFE613D4BE040007F01013540-->  <AD_TABLE_ID><![CDATA[800223]]></AD_TABLE_ID>
 <!--6BDD5BBDFE613D4BE040007F01013540-->  <AD_REFERENCE_ID><![CDATA[17]]></AD_REFERENCE_ID>
--- a/src-db/database/sourcedata/AD_ELEMENT.xml	Tue Jun 30 21:06:36 2009 +0200
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml	Wed Jul 01 08:26:39 2009 +0200
@@ -24477,7 +24477,8 @@
 <!--6BDD5E11747C51DAE040007F01013550-->  <NAME><![CDATA[Report Type]]></NAME>
 <!--6BDD5E11747C51DAE040007F01013550-->  <PRINTNAME><![CDATA[Report Type]]></PRINTNAME>
 <!--6BDD5E11747C51DAE040007F01013550-->  <DESCRIPTION><![CDATA[Indicates whether the report is "Point in time" (needs to calculate an opening balance if it does not exist) or a "Periodic" report (in this case that calculation is not needed)]]></DESCRIPTION>
-<!--6BDD5E11747C51DAE040007F01013550-->  <HELP><![CDATA[Indicates whether the report is "Point in time" (needs to calculate an opening balance if it does not exist) or a "Periodic" report (in this case that calculation is not needed)]]></HELP>
+<!--6BDD5E11747C51DAE040007F01013550-->  <HELP><![CDATA[Indicates whether the report is a "Point in Time" or a "Periodic" report.
+A Point in Time report is obtained as of a given date, taking into account the whole historical financial movements; an example of point in time report is the Balance Sheet.<br> A periodic report is executed for a date range and it does not carry forward the balance of accounting movements previous to the range; an example of periodic report is the Income Statement.]]></HELP>
 <!--6BDD5E11747C51DAE040007F01013550-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--6BDD5E11747C51DAE040007F01013550--></AD_ELEMENT>
 
--- a/src-db/database/sourcedata/AD_FIELD.xml	Tue Jun 30 21:06:36 2009 +0200
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Wed Jul 01 08:26:39 2009 +0200
@@ -190806,7 +190806,8 @@
 <!--6BDD5BBDFE623D4BE040007F01013540-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--6BDD5BBDFE623D4BE040007F01013540-->  <NAME><![CDATA[Report Type]]></NAME>
 <!--6BDD5BBDFE623D4BE040007F01013540-->  <DESCRIPTION><![CDATA[Indicates whether the report is "Point in time" (needs to calculate an opening balance if it does not exist) or a "Periodic" report (in this case that calculation is not needed)]]></DESCRIPTION>
-<!--6BDD5BBDFE623D4BE040007F01013540-->  <HELP><![CDATA[Indicates whether the report is "Point in time" (needs to calculate an opening balance if it does not exist) or a "Periodic" report (in this case that calculation is not needed)]]></HELP>
+<!--6BDD5BBDFE623D4BE040007F01013540-->  <HELP><![CDATA[Indicates whether the report is a "Point in Time" or a "Periodic" report.
+A Point in Time report is obtained as of a given date, taking into account the whole historical financial movements; an example of point in time report is the Balance Sheet.<br> A periodic report is executed for a date range and it does not carry forward the balance of accounting movements previous to the range; an example of periodic report is the Income Statement.]]></HELP>
 <!--6BDD5BBDFE623D4BE040007F01013540-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
 <!--6BDD5BBDFE623D4BE040007F01013540-->  <AD_TAB_ID><![CDATA[800261]]></AD_TAB_ID>
 <!--6BDD5BBDFE623D4BE040007F01013540-->  <AD_COLUMN_ID><![CDATA[6BDD5BBDFE613D4BE040007F01013540]]></AD_COLUMN_ID>
--- a/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports_data.xsql	Tue Jun 30 21:06:36 2009 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports_data.xsql	Wed Jul 01 08:26:39 2009 +0200
@@ -192,7 +192,7 @@
       <Sql><![CDATA[
         SELECT CASE WHEN C.CLOSE_FACT_ACCT_GROUP_ID IS NULL THEN 'N' ELSE 'Y' END || SELECTED.C_YEAR_ID AS ID,
           C_YEAR.YEAR AS NAME
-        FROM C_PERIOD PREVIOUS, C_PERIOD SELECTED, C_YEAR LEFT JOIN AD_ORG_CLOSING C ON C.C_YEAR_ID = C_YEAR.C_YEAR_ID
+        FROM C_PERIOD PREVIOUS LEFT JOIN AD_ORG_CLOSING C ON C.C_YEAR_ID = PREVIOUS.C_YEAR_ID, C_PERIOD SELECTED, C_YEAR
         WHERE PREVIOUS.AD_CLIENT_ID = ?
           AND SELECTED.AD_CLIENT_ID = ?
           AND SELECTED.ISACTIVE = 'Y'