Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0021831Openbravo ERP09. Financial managementpublic2012-10-02 13:182017-05-12 12:31
xabiermerino 
jecharri 
urgentminoralways
closedno change required 
5
 
3.0MP19 
Core
No
0021831: Trial Balance shows different Final Balance depending the check 'Opening Entry Amount to Initial Balance'
Trial Balance shows different Final Balance depending the check 'Opening Entry Amount to Initial Balance'.
In the database execute this query:
update fact_acct set factaccttype = 'N' where acctvalue like '%57200%' and factaccttype = 'O'

As admin execute the report with the field checked, the result is correct.
Execute the report with the field unchecked, the result is wrong
ReportTrialBalance.java

Method calculateTree:

Change:

        // Set calculated Initial Balances
        for (int k = 0; k < dataIB.length; k++) {
          if (dataIB[k].accountId.equals(data[i].id)) {
            if (strNotInitialBalance.equals("Y")) {
              data[i].saldoInicial = (new BigDecimal(dataIB[k].saldoInicial).add(parcialInicial))
                  .toPlainString();
            } else {
              data[i].amtacctdr = (new BigDecimal(dataIB[k].amtacctdr).add(parcialDR))
                  .toPlainString();
              data[i].amtacctcr = (new BigDecimal(dataIB[k].amtacctcr).add(parcialCR))
                  .toPlainString();
            }
            data[i].saldoFinal = (new BigDecimal(dataIB[k].saldoInicial).add(parcialDR)
                .subtract(parcialCR)).toPlainString();
          }
        }

for:

        // Set calculated Initial Balances
        for (int k = 0; k < dataIB.length; k++) {
          if (dataIB[k].accountId.equals(data[i].id)) {
            if (strNotInitialBalance.equals("Y")) {
              data[i].saldoInicial = (new BigDecimal(dataIB[k].saldoInicial).add(parcialInicial))
                  .toPlainString();
            } else {
              data[i].amtacctdr = (new BigDecimal(dataIB[k].amtacctdr).add(parcialDR).add(new BigDecimal(data[i].amtacctdr)))
                  .toPlainString();
              data[i].amtacctcr = (new BigDecimal(dataIB[k].amtacctcr).add(parcialCR).add(new BigDecimal(data[i].amtacctcr)))
                  .toPlainString();
            }
            data[i].saldoFinal = (new BigDecimal(dataIB[k].saldoInicial).add(parcialDR)
                .subtract(parcialCR)).toPlainString();
          }
        }
No tags attached.
has duplicate defect 00284523.0PR15Q2 closed reinaldoguerra Wrong Trial Balance when standard accounting information exists in Opening date 
related to defect 0035896 closed AtulOpenbravo Wrong Trial Balance at "Account" level and without checking "Opening Entry Amount to Initial Balance" 
Issue History
2012-10-02 13:18xabiermerinoNew Issue
2012-10-02 13:18xabiermerinoAssigned To => dmiguelez
2012-10-02 13:18xabiermerinoModules => Core
2012-10-02 13:18xabiermerinoIssue Monitored: networkb
2012-10-02 16:22dmiguelezAssigned Todmiguelez => jonalegriaesarte
2012-10-03 18:31xabiermerinoDescription Updatedbug_revision_view_page.php?rev_id=3938#r3938
2012-10-03 18:31xabiermerinoSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=3940#r3940
2012-10-03 18:31xabiermerinoProposed Solution updated
2012-10-04 16:10jonalegriaesarteTarget Version => 3.0MP17
2012-10-23 18:41jonalegriaesarteAssigned Tojonalegriaesarte => jecharri
2012-10-30 17:48hgbotCheckin
2012-10-30 17:48hgbotNote Added: 0053853
2012-10-30 17:48hgbotStatusnew => resolved
2012-10-30 17:48hgbotResolutionopen => fixed
2012-10-30 17:48hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/26799413cdbcee5d0ed80f4a4c08fd481d62d9c5 [^]
2012-10-30 17:51jecharriNote Added: 0053854
2012-10-31 13:31hudsonbotCheckin
2012-10-31 13:31hudsonbotNote Added: 0053944
2012-10-31 16:40jecharriStatusresolved => new
2012-10-31 16:40jecharriResolutionfixed => open
2012-10-31 16:40jecharriResolution time => 1349560800
2012-10-31 16:40jecharriTarget Version3.0MP17 => 3.0MP18
2012-10-31 19:51hgbotCheckin
2012-10-31 19:51hgbotNote Added: 0053959
2012-11-06 10:47hudsonbotCheckin
2012-11-06 10:47hudsonbotNote Added: 0054026
2012-11-16 17:42jonalegriaesarteNote Added: 0054299
2012-11-16 17:42jonalegriaesarteSeveritymajor => minor
2012-12-04 11:50jonalegriaesarteTarget Version3.0MP18 => 3.0MP19
2012-12-19 14:53jonalegriaesarteNote Added: 0055079
2012-12-19 14:53jonalegriaesarteStatusnew => closed
2012-12-19 14:53jonalegriaesarteResolutionopen => no change required
2017-05-09 18:09aferrazRelationship addedrelated to 0035896
2017-05-12 12:31aferrazRelationship addedhas duplicate 0028452

Notes
(0053853)
hgbot   
2012-10-30 17:48   
Repository: erp/devel/pi
Changeset: 26799413cdbcee5d0ed80f4a4c08fd481d62d9c5
Author: Javier Etxarri <javier.echarri <at> openbravo.com>
Date: Tue Oct 30 17:47:23 2012 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/26799413cdbcee5d0ed80f4a4c08fd481d62d9c5 [^]

Fixes issue 21831: Trial Balance shows different Final Balance depending
the check 'Opening Entry Amount to Initial Balance'

---
M src/org/openbravo/erpCommon/ad_reports/ReportTrialBalance.java
---
(0053854)
jecharri   
2012-10-30 17:51   
test plan. With steps to reproduce is enough.

You can try to launch the report in a short time periods or large periods:
-only some days or 3 years
(0053944)
hudsonbot   
2012-10-31 13:31   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/9e773cbcb723 [^]

Maturity status: Test
(0053959)
hgbot   
2012-10-31 19:51   
Repository: erp/devel/pi
Changeset: f88e6d65740382a4922bf2f7af50b80d1021bc5c
Author: Javier Etxarri <javier.echarri <at> openbravo.com>
Date: Wed Oct 31 19:48:02 2012 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/f88e6d65740382a4922bf2f7af50b80d1021bc5c [^]

Backout issue 21831: Trial Balance shows different Final Balance depending
the check 'Opening Entry Amount to Initial Balance'

---
M src/org/openbravo/erpCommon/ad_reports/ReportTrialBalance.java
---
(0054026)
hudsonbot   
2012-11-06 10:47   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/905762a34c04 [^]

Maturity status: Test
(0054299)
jonalegriaesarte   
2012-11-16 17:42   
It must be tested in depth
(0055079)
jonalegriaesarte   
2012-12-19 14:53   
After last refactor, this check has disappeared