Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0012502Openbravo ERP09. Financial managementpublic2010-03-01 12:272010-05-18 12:12
networkb 
shuehner 
highminoralways
closedfixed 
5
2.50MP11 
2.50MP17 
Core
No
0012502: Error with RptC_Remittance.jrxml.pdf
We need to do two changes:

1.- /config/Format.xml:

<Number name="euroRelation"
       decimal="." grouping="," formatOutput="#,##0.0000" FormatInternal="#0.0000" />
   <Number name="euroEdition"
       decimal="." grouping="," formatOutput="#0.0000" formatInternal="#0.0000" />

- ant compile.development -Dtab=xxx

2.- As System Administrator:
Go to General Setup || Application || Currency, select EUR.
Standard Precision: 4.

Now, on Remmitance, we create two lines from two payments:
-Payment 1: 200.5445
-Payment 2: 400.2239

Total amount: 600.7684 rounded to 600.77

when we click on Print Record button, the PDF created is wrong (PDF atached).

The amounts are 200.54 and 400.22.
The total amount is 600.77

it also happens when we generate the bank.dat


-As Openbravo Admin and the changes mentioned go to Sales Management || Transactions || Sales Invoice
-Create a new record: Bussiness Partner: John Moneymaker, save and go to lines.
-Create a line, save, and go to Payment, create two records:
     - Amount: 400.2239, Due Date: 01-02-2010.
     - Amount: 200.5445, Due Date: 01-02-2010.
-Go back to the Header and complete.

-Go to Financial Management || Receivables & Payables || Transactions || Remittance
-Create a new record. Click 'Create Lines From' and select the payments created and process.
-Click 'Print Record'
No tags attached.
pdf RptC_Remittance.jrxml.pdf (2,469) 2010-03-01 12:27
https://issues.openbravo.com/file_download.php?file_id=2284&type=bug
Issue History
2010-03-01 12:27networkbNew Issue
2010-03-01 12:27networkbAssigned To => dalsasua
2010-03-01 12:27networkbFile Added: RptC_Remittance.jrxml.pdf
2010-03-01 12:28dalsasuaNote Added: 0024900
2010-03-01 12:28dalsasuaStatusnew => feedback
2010-03-01 12:56networkbDescription Updatedbug_revision_view_page.php?rev_id=85#r85
2010-03-02 09:17networkbNote Added: 0024930
2010-03-02 09:17networkbStatusfeedback => new
2010-03-08 16:05jpabloaeTarget Version2.50MP14 => 2.50MP15
2010-04-06 14:01balamuruganAssigned Todalsasua => balamurugan
2010-04-06 14:31balamuruganAssigned Tobalamurugan => networkb
2010-04-06 14:39balamuruganNote Added: 0025898
2010-04-06 14:40balamuruganNote Added: 0025900
2010-04-06 14:40balamuruganStatusnew => feedback
2010-04-08 12:43balamuruganAssigned Tonetworkb => iciordia
2010-04-08 13:32iciordiaAssigned Toiciordia => shuehner
2010-04-08 13:33iciordiaStatusfeedback => scheduled
2010-04-08 13:33iciordiaNote Added: 0025978
2010-04-08 13:33iciordiafix_in_branch => pi
2010-04-08 18:04shuehnerNote Added: 0025996
2010-04-08 18:23iciordiaNote Added: 0025998
2010-04-08 18:25shuehnerNote Added: 0025999
2010-04-09 13:38shuehnerNote Added: 0026032
2010-04-09 15:01dalsasuaNote Added: 0026033
2010-04-09 15:53hgbotCheckin
2010-04-09 15:53hgbotNote Added: 0026039
2010-04-09 15:53hgbotStatusscheduled => resolved
2010-04-09 15:53hgbotResolutionopen => fixed
2010-04-09 15:53hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/e809fe06034de0148fcc39aae65eaad40a18c0d7 [^]
2010-04-09 15:56shuehnerNote Added: 0026040
2010-04-15 11:10iperdomoNote Added: 0026237
2010-04-15 11:10iperdomoStatusresolved => closed
2010-04-16 00:00anonymoussf_bug_id0 => 2987961
2010-04-19 21:13hudsonbotCheckin
2010-04-19 21:13hudsonbotNote Added: 0026445
2010-05-18 12:12gorka_gilTarget Version2.50MP15 => 2.50MP17

Notes
(0024900)
dalsasua   
2010-03-01 12:28   
I think
ant compile.development -Dtab=xxx
is not correct in steps to reproduce. Can you check that, please?
(0024930)
networkb   
2010-03-02 09:17   
David,
the step is correct.
(0025898)
balamurugan   
2010-04-06 14:39   
After triaging this issue, it is known that the pdf reports which are using jrxml as template will take the number format from the session variable "#AD_ReportNumberFormat" which is set/hardcoded in the renderJR() funtions in HttpSecureAppServlet.java.

For example, Purchase/Sales Invoice or Order windows, Remittance windows use jrxml. But Settlement window uses FO to create the pdf document (using renderFO function) which take the format values from "Format.xml" file.

So, the Platform team has to decide, whether the Reports using JRXML will have to take formatting values from "Format.xml" or not.
(0025900)
balamurugan   
2010-04-06 14:40   
After triaging this issue, it is known that the pdf reports which are using jrxml as template will take the number format from the session variable "#AD_ReportNumberFormat" which is set/hardcoded in the renderJR() funtions in HttpSecureAppServlet.java.

For example, Purchase/Sales Invoice or Order windows, Remittance windows use jrxml. But Settlement window uses FO to create the pdf document (using renderFO function) which take the format values from "Format.xml" file.

So, the Platform team has to decide, whether the Reports using JRXML will have to take formatting values from "Format.xml" or not.
(0025978)
iciordia   
2010-04-08 13:33   
Stefan,

please discuss the issue with Ivan, the fix seems to be pretty simple.

Sorry for late assignment, I hope it will no be very disruptive.

Ismael
(0025996)
shuehner   
2010-04-08 18:04   
Just taken a quick look:
We seem to have three values currently used for building the numberformat used in renderJR for jrxml files:
- #AD_ReportNumberFormat
- #AD_ReportDecimalSeparator
- #AD_ReportGroupingSeparator

Those together construct the format which is passed to every jrxml.

From those three values the last two come from the 'euroInform' entry in Format.xml, so are customizable. However the first is hardcoded in java and not read from the Format.xml file.

Proposed change: use the formatOutput from Format.xml to populate this #Ad_ReportNumberFormat

Then the euroInform definition would be consistently used to pass the format to jrxml files.
(0025998)
iciordia   
2010-04-08 18:23   
I agree with the proposed solution

Ismael
(0025999)
shuehner   
2010-04-08 18:25   
The proposed change will change the default format used for all renderJR reports: from "###,##0.00" (current, hardcoded) to "#,##0.00" (default for euroInform, in the current Format.xml.template)
(0026032)
shuehner   
2010-04-09 13:38   
After checking documentation: Those two format strings are equivalent so no change in existing behavior if you did not modify the Format.xml euroInform outputFormat value.
(0026033)
dalsasua   
2010-04-09 15:01   
Regarding the "it also happens when we generate the bank.dat" comment, please realize that ERP standard just support the "Cuaderno" format from "AEB-Asociación Española de Banca", which is just designed for Spanish market. While Euro maintains the two decimals precision, no change in bank.dat file generation will be needed. The creation of this file is not determined by the configuration in the application, but by the standard files format provided by AEB.
(0026039)
hgbot   
2010-04-09 15:53   
Repository: erp/devel/pi
Changeset: e809fe06034de0148fcc39aae65eaad40a18c0d7
Author: Stefan Hühner <stefan.huehner <at> openbravo.com>
Date: Fri Apr 09 16:05:37 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/e809fe06034de0148fcc39aae65eaad40a18c0d7 [^]

Fixed 12502: Make decimalformat used by renderJR fully configurable
via Format.xml format name euroInform

---
M src/org/openbravo/base/secureApp/HttpSecureAppServlet.java
---
(0026040)
shuehner   
2010-04-09 15:56   
After this change the format used in renderJR can be configured via the euroInform (outputFormat) entry in Format.xml
(0026237)
iperdomo   
2010-04-15 11:10   
Tested on PI @ rev 7076c219cdd9
(0026445)
hudsonbot   
2010-04-19 21:13   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/e809fe06034d [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/91d98bda46c1 [^]
Tests: http://builds.openbravo.com/view/devel-int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17088.obx [^]