Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0005096Openbravo ERP09. Financial managementpublic2008-09-17 23:492009-04-21 11:06
galderromo 
dalsasua 
highmajoralways
closedfixed 
20Gentoo 2.6.24
2.35MP5 
 
Core
No
0005096: General Ledger: Accumulated amounts when using more than a range
When having more than 500 records, the report shows more than a view.
The break between ranges can happend during the same accounting date. On this cases, the new range's amounts are not proparly calculated.
Supposing you have this records on facct_acct:
Date: 11-08-08 fact_acct_id:1000 amount:1000
Date: 11-08-08 fact_acct_id:1001 amount:800
---------------- Range break ----------------
Date: 11:08-08 fact_acct_id:1002 amount:350
Date: 12-08-08 fact_acct_id:1003 amount:100

When the new range is loaded, you previous amount will be 2150 instead of 1800.

Change selectPrevious method on ReportGeneralLedger_data.xsql with:
  <SqlMethod name="selectPrevious" type="preparedStatement" return="multiple">
      <SqlMethodComment></SqlMethodComment>
      <Sql><![CDATA[
      SELECT COALESCE(SUM(AMTACCTDR),0) AS TOTALDR, COALESCE(SUM(AMTACCTCR),0) AS TOTALCR,
      COALESCE(SUM(AMTACCTDR-AMTACCTCR),0) AS TOTAL
      FROM FACT_ACCT
      WHERE 1=1
      AND FACT_ACCT.ACCOUNT_ID = ?
      AND (DATEACCT < ? OR (DATEACCT= ? AND FACT_ACCT_ID < ? ))
      AND FACT_ACCT.AD_ORG_ID IN ('1')
      AND 2=2
      ]]></Sql>
      <Parameter name="bpartner" optional="true" after="1=1"><![CDATA[ AND FACT_ACCT.C_BPARTNER_ID = ? ]]></Parameter>
      <Parameter name="project" optional="true" after="1=1"><![CDATA[ AND FACT_ACCT.C_PROJECT_ID = ? ]]></Parameter>
      <Parameter name="acctschema" optional="true" after="1=1"><![CDATA[ and fact_acct.C_ACCTSCHEMA_ID = ? ]]></Parameter>
      <Parameter name="account"/>
      <Parameter name="date"/>
      <Parameter name="date"/>
      <Parameter name="factacct"/>
      <Parameter name="orgs" type="replace" optional="true" after="AND FACT_ACCT.AD_ORG_ID IN (" text="'1'"/>
      <Parameter name="productId" optional="true" type="argument" after="2=2"><![CDATA[ AND FACT_ACCT.M_PRODUCT_ID IN ]]></Parameter>
      <Parameter name="user1" optional="true" after="2=2"><![CDATA[ AND fact_acct.USER1_ID = ? ]]></Parameter>
      <Parameter name="user2" optional="true" after="2=2"><![CDATA[ AND fact_acct.USER2_ID = ? ]]></Parameter>
   </SqlMethod>
GPS-Top20
depends on backport 0005136 closed dalsasua General Ledger: Accumulated amounts when using more than a range 
depends on backport 0005849 closed dalsasua General Ledger: Accumulated amounts when using more than a range 
related to defect 0004494 closed dalsasua Navigation with the arrows between pages in large HTML reports is not clear 
Issue History
2008-09-17 23:49galderromoNew Issue
2008-09-17 23:49galderromoAssigned To => cromero
2008-09-17 23:49galderromosf_bug_id0 => 2116881
2008-09-22 10:37cromeroStatusnew => scheduled
2008-09-22 10:37cromeroAssigned Tocromero => dalsasua
2008-09-22 10:37cromerofix_in_branch => trunk
2008-09-22 20:12galderromoIssue Monitored: galderromo
2008-09-23 12:58cromeroRelationship addedrelated to 0004494
2008-09-30 12:31pjuvaraTag Attached: GPS-Top20
2008-09-30 12:31pjuvaraTag Attached: ReleaseCandidate
2008-09-30 12:31pjuvaraTag Detached: ReleaseCandidate
2008-09-30 12:32pjuvaraPrioritynormal => high
2008-09-30 12:32pjuvarafix_in_branchtrunk =>
2008-10-06 13:09svnbotCheckin
2008-10-06 13:09svnbotNote Added: 0009383
2008-10-06 13:09svnbotStatusscheduled => resolved
2008-10-06 13:09svnbotResolutionopen => fixed
2008-10-06 13:09svnbotsvn_revision => 8266
2008-10-06 13:19svnbotCheckin
2008-10-06 13:19svnbotNote Added: 0009386
2008-10-06 13:19svnbotsvn_revision8266 => 8268
2008-10-07 07:49svnbotCheckin
2008-10-07 07:49svnbotNote Added: 0009411
2008-10-07 07:49svnbotsvn_revision8268 => 8304
2008-11-06 12:15psarobeStatusresolved => new
2008-11-06 12:15psarobeResolutionfixed => open
2008-11-06 12:15psarobeStatusnew => scheduled
2008-11-06 12:15psarobefix_in_branch => trunk
2008-11-07 10:54rafarodafix_in_branchtrunk =>
2008-11-07 10:56svnbotCheckin
2008-11-07 10:56svnbotNote Added: 0010073
2008-11-07 10:56svnbotStatusscheduled => resolved
2008-11-07 10:56svnbotResolutionopen => fixed
2008-11-07 10:56svnbotsvn_revision8304 => 9776
2008-11-26 09:48svnbotCheckin
2008-11-26 09:48svnbotNote Added: 0010686
2008-11-26 09:48svnbotsvn_revision9776 => 10591
2008-11-26 12:53svnbotCheckin
2008-11-26 12:53svnbotNote Added: 0010709
2008-11-26 12:53svnbotsvn_revision10591 => 10604
2009-04-21 11:06psarobeStatusresolved => closed

Notes
(0009383)
svnbot   
2008-10-06 13:09   
Repository: openbravo
Revision: 8266
Author: davidalsasua
Date: 2008-10-06 13:09:49 +0200 (Mon, 06 Oct 2008)

Fixes Bug 0005096: General Ledger: Accumulated amounts when using more than a range

---
U branches/r2.40/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger_data.xsql
---

https://dev.openbravo.com/websvn/openbravo/?rev=8266&sc=1 [^]
(0009386)
svnbot   
2008-10-06 13:19   
Repository: openbravo
Revision: 8268
Author: davidalsasua
Date: 2008-10-06 13:18:56 +0200 (Mon, 06 Oct 2008)

Fixes Bug 0005096: General Ledger: Accumulated amounts when using more than a range

---
U trunk/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.java
U trunk/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger_data.xsql
---

https://dev.openbravo.com/websvn/openbravo/?rev=8268&sc=1 [^]
(0009411)
svnbot   
2008-10-07 07:49   
Repository: openbravo
Revision: 8304
Author: villind
Date: 2008-10-07 07:49:23 +0200 (Tue, 07 Oct 2008)

Merged change 8266. Fixes Bug 0005096: General Ledger: Accumulated amounts when using more than a range

---
_U branches/bonware/r2.40/
_U branches/bonware/r2.40/eclipse.install.source.launch
_U branches/bonware/r2.40/export.database.launch
U branches/bonware/r2.40/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.java
U branches/bonware/r2.40/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger_data.xsql
_U branches/bonware/r2.40/src-core/src/org/openbravo/database/OpenbravoDriverManagerConnectionFactory.java
_U branches/bonware/r2.40/update.database.launch
---

https://dev.openbravo.com/websvn/openbravo/?rev=8304&sc=1 [^]
(0010073)
svnbot   
2008-11-07 10:56   
Repository: openbravo
Revision: 9776
Author: davidalsasua
Date: 2008-11-07 10:56:24 +0100 (Fri, 07 Nov 2008)

Fixes Bug 0005096: General Ledger: Accumulated amounts when using more than a range

---
U trunk/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.html
U trunk/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.java
U trunk/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.xml
---

https://dev.openbravo.com/websvn/openbravo/?rev=9776&sc=1 [^]
(0010686)
svnbot   
2008-11-26 09:48   
Repository: openbravo
Revision: 10591
Author: davidalsasua
Date: 2008-11-26 09:48:57 +0100 (Wed, 26 Nov 2008)

Fixes Bug 0005096: General Ledger: Accumulated amounts when using more than a range

---
U trunk/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger_data.xsql
---

https://dev.openbravo.com/websvn/openbravo/?rev=10591&sc=1 [^]
(0010709)
svnbot   
2008-11-26 12:53   
Repository: openbravo
Revision: 10604
Author: davidalsasua
Date: 2008-11-26 12:53:48 +0100 (Wed, 26 Nov 2008)

Fixes Bug 0005096: General Ledger: Accumulated amounts when using more than a range

---
U trunk/config/Format.xml
U trunk/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.html
U trunk/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.java
U trunk/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.xml
U trunk/src/org/openbravo/erpCommon/ad_reports/Totals.srpt
U trunk/web/skins/Default/Openbravo_ERP_250.css
---

https://dev.openbravo.com/websvn/openbravo/?rev=10604&sc=1 [^]