Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0020148Openbravo ERP09. Financial managementpublic2012-03-29 11:302012-04-02 06:13
mirurita 
mirurita 
highminoralways
closedfixed 
5
pi 
3.0MP10 
Core
No
0020148: java.lang.NumberFormatException in General Ledger Journal pdf output using comma as decimal separator in initial balance filter
Use comma as decimal separator.
If the Initial Balance filter in general ledger journal contains a comma if you run the pdf report it will fail:
java.lang.NumberFormatException

it is trying to convert a number with commas as decimal separator to BigDecimal.
1) Comma must be configured as decimal separator.
2) Go to General Ledger Journal
3) By default Initial Balance filter contains 0 as value
4) Enter any value and the input will be formatted to euroEdition containing comma as decimal separator
5) Click on the printer icon on the toolbar.
use vars.getNumeric... methods for getting the value of this filter

instead of

String strInitialBalance = vars.getGlobalVariable("inpInitialBalance",
          "ReportGeneralLedgerJournal|InitialBalance", "0");
use

String strInitialBalance = vars.getNumericGlobalVariable("inpInitialBalance",
          "ReportGeneralLedgerJournal|InitialBalance", "0");
No tags attached.
png GeneralLedgerReport.png (52,828) 2012-03-29 11:30
https://issues.openbravo.com/file_download.php?file_id=5104&type=bug
png
Issue History
2012-03-29 11:30miruritaNew Issue
2012-03-29 11:30miruritaAssigned To => vmromanos
2012-03-29 11:30miruritaFile Added: GeneralLedgerReport.png
2012-03-29 11:30miruritaModules => Core
2012-03-29 17:01miruritaAssigned Tovmromanos => mirurita
2012-03-29 17:03hgbotCheckin
2012-03-29 17:03hgbotNote Added: 0046910
2012-03-29 17:03hgbotStatusnew => resolved
2012-03-29 17:03hgbotResolutionopen => fixed
2012-03-29 17:03hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/944195714367a88173715611a25a9a04550ff88d [^]
2012-03-29 17:10miruritaNote Added: 0046920
2012-03-30 12:55vmromanosNote Added: 0046972
2012-03-30 12:55vmromanosStatusresolved => closed
2012-03-30 12:55vmromanosFixed in Version => 3.0MP10
2012-04-02 06:13hudsonbotCheckin
2012-04-02 06:13hudsonbotNote Added: 0047272

Notes
(0046910)
hgbot   
2012-03-29 17:03   
Repository: erp/devel/pi
Changeset: 944195714367a88173715611a25a9a04550ff88d
Author: Mikel Irurita <mikel.irurita <at> openbravo.com>
Date: Thu Mar 29 16:55:28 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/944195714367a88173715611a25a9a04550ff88d [^]

Fixes issue 20148: General Ledger report NumberFormatException using commas as decimal separator
If the initial balance amount contains a comma when printing in pdf format
it will fail: java.lang.NumberFormatException, because it's trying to cast
to BigDecimal an number string containing a commas as decimal separator

---
M src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.java
M src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal.xml
---
(0046920)
mirurita   
2012-03-29 17:10   
Testing Plan
1.- Set commas as decimal separator in Format.xml
2.- Go to General Ledger Journal report
3.- Enter as initial balance: 10,57
4.- Click on Print record icon in the toolbar
5.- The pdf file should be printed and the initial balance amount displayed.
6.- Click on Export to Excel icon in the toolbar
7.- The excel file should be printed and the initial balance amount displayed.
8.- Click on HTML format button
9.- In HTML format this initial balance information is not used but the result should be displayed.
10.- Close the tab and return again. The initial balance field should display: 10,57

Alternative Testing Plan
1.- Repeat previous steps using dot as decimal separator
(0046972)
vmromanos   
2012-03-30 12:55   
code review + testing OK.

Tested using '.' and ',' as decimal separator (qtyEdition and euroEdition)
(0047272)
hudsonbot   
2012-04-02 06:13   
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/7814864461ac [^]

Maturity status: Test