Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0037763Openbravo ERP09. Financial managementpublic2018-01-30 10:242018-02-22 18:19
samuel_nicuesa 
collazoandy4 
highmajoralways
closedfixed 
5
3.0PR17Q2 
3.0PR18Q2 
dmiguelez
Core
No
0037763: Trial Balance Report sometimes returns null pointer exception when include zero figures is checked.
Trial Balance Report sometimes returns null pointer exception when include zero figures is checked.
We are not able to reproduce it in PI Version, we have used the client environment.
If you need to have access talk with support.
-Login into ERP

-Go to Trial Balance report

-Fill Date from , Date To and include zero figures

-Click search button and you will see a null pointer exception error.
In ReprorTrialBalance.java there are 2 arrays (vec and dataAccountCombinations).

Here is the problem :
dataZeroFigures = new ReportTrialBalanceData[dataAccountCombinations.length + extra];
      vec.copyInto(dataZeroFigures);

If (vec.size() < dataAccountCombinations.length) when you copy vec to dataZeroFigures will be null values in the new array.

Is necessary that vec.size() = dataAccountCombinations.length so we think the solution is use:

dataZeroFigures = new ReportTrialBalanceData[vec.size()];

instead of

dataZeroFigures = new ReportTrialBalanceData[dataAccountCombinations.length + extra];
No tags attached.
Issue History
2018-01-30 10:24samuel_nicuesaNew Issue
2018-01-30 10:24samuel_nicuesaAssigned To => Triage Finance
2018-01-30 10:24samuel_nicuesaModules => Core
2018-01-30 10:24samuel_nicuesaResolution time => 1519081200
2018-01-30 10:24samuel_nicuesaTriggers an Emergency Pack => No
2018-01-30 16:22dmiguelezAssigned ToTriage Finance => collazoandy4
2018-01-31 21:10collazoandy4Statusnew => scheduled
2018-02-02 20:19collazoandy4Note Added: 0102163
2018-02-08 09:56hgbotCheckin
2018-02-08 09:56hgbotNote Added: 0102270
2018-02-08 09:56hgbotStatusscheduled => resolved
2018-02-08 09:56hgbotResolutionopen => fixed
2018-02-08 09:56hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/fcb60f9bbde5cf20bdff4f7a2d583f5cd8696ac8 [^]
2018-02-08 09:57dmiguelezReview Assigned To => dmiguelez
2018-02-08 09:57dmiguelezNote Added: 0102271
2018-02-08 09:57dmiguelezStatusresolved => closed
2018-02-08 09:57dmiguelezFixed in Version => 3.0PR18Q2
2018-02-22 18:19hudsonbotCheckin
2018-02-22 18:19hudsonbotNote Added: 0102734

Notes
(0102163)
collazoandy4   
2018-02-02 20:19   
Test Plan
  In client enviroment
    Go to Trial Balance Report and fill all the requires values and check Include zero figures
      Clic on Search button and check the report is shown without error
      Group by Business Partner and check the report is shown without error
      Uncheck Include Zero figures and check the report is shown without error
      Group by Product and check the report is shown without error
(0102270)
hgbot   
2018-02-08 09:56   
Repository: erp/devel/pi
Changeset: fcb60f9bbde5cf20bdff4f7a2d583f5cd8696ac8
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Wed Feb 07 11:59:36 2018 -0500
URL: http://code.openbravo.com/erp/devel/pi/rev/fcb60f9bbde5cf20bdff4f7a2d583f5cd8696ac8 [^]

Fixes issue 37763: Trial Balance Report sometimes returns null pointer exception
when include zero figures is checked.

When zero figures is checked the matches accounts are skipped from vector list
causing null entries when the vector values are copied with different sizes

Now the dataZeroFigures size is equal to the vector size to avoid null entries

---
M src/org/openbravo/erpCommon/ad_reports/ReportTrialBalance.java
---
(0102271)
dmiguelez   
2018-02-08 09:57   
Code Review + Testing Ok
(0102734)
hudsonbot   
2018-02-22 18:19   
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/980a6ad5bbf5 [^]
Maturity status: Test