Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0023112Openbravo ERP09. Financial managementpublic2013-02-19 10:282013-04-04 13:16
xabiermerino 
jonalegriaesarte 
urgentmajoralways
closedno change required 
5
3.0MP19.3 
3.0MP23 
Core
No
0023112: 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.
related to design defect 0023606 new Triage Omni OMS In Trial Balance Report Opening journal entries are not shown if its date does not match the From date 
Issue History
2013-02-19 10:28xabiermerinoNew Issue
2013-02-19 10:28xabiermerinoAssigned To => dmiguelez
2013-02-19 10:28xabiermerinoModules => Core
2013-02-19 10:28xabiermerinoTriggers an Emergency Pack => No
2013-02-20 08:47dmiguelezAssigned Todmiguelez => jonalegriaesarte
2013-03-04 10:49jonalegriaesarteNote Added: 0056964
2013-03-04 10:49jonalegriaesarteTarget Version3.0MP21 => 3.0MP22
2013-04-02 18:50jonalegriaesarteTarget Version3.0MP22 => 3.0MP23
2013-04-04 13:16ioritzCiaNote Added: 0057729
2013-04-04 13:16ioritzCiaStatusnew => closed
2013-04-04 13:16ioritzCiaResolutionopen => no change required
2013-04-22 13:25ngarciaRelationship addedrelated to 0023606
2019-08-23 14:59ngarciaNote Edited: 0057729bug_revision_view_page.php?bugnote_id=0057729#r19330

Notes
(0056964)
jonalegriaesarte   
2013-03-04 10:49   
Moved to MP22 due to it is a very critical report that has to be tested in depth
(0057729)
ioritzCia   
2013-04-04 13:16   
(edited on: 2019-08-23 14:59)
The issue can only be reproduced when the starting date and ending date are from different fiscal years. Executing this report between dates from different fiscal years has no sense, so there is no need of fixing the output.