Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0012818Openbravo ERP03. Procurement managementpublic2010-03-26 10:262010-05-14 15:27
networkb 
adrianromero 
urgentmajoralways
closedfixed 
5
2.40MP12 
2.40MP13 
Core
No
0012818: Error in 'Purchase Order Report'
When we want to create a Purchase Order Report with a currency different from EURO, this error appears:

Error executing SQL statement for : ReportPurchaseOrder
- Go to Procurement Management || Analysis Tools || Purchase Order Report
- Currency: USD and click 'Ok'
No tags attached.
depends on backport 00128562.40MP13 closed adrianromero Error in 'Purchase Order Report' 
Issue History
2010-03-26 10:26networkbNew Issue
2010-03-26 10:26networkbAssigned To => adrianromero
2010-03-31 16:46adrianromeroIssue cloned0012856
2010-03-31 16:46adrianromeroRelationship addeddepends on 0012856
2010-03-31 16:46adrianromeroStatusnew => scheduled
2010-03-31 16:46adrianromerofix_in_branch => pi
2010-04-16 13:04adrianromeroNote Added: 0026314
2010-04-20 17:39hgbotCheckin
2010-04-20 17:39hgbotNote Added: 0026518
2010-04-20 17:39hgbotStatusscheduled => resolved
2010-04-20 17:39hgbotResolutionopen => fixed
2010-04-20 17:39hgbotFixed in SCM revision => http://code.openbravo.com/erp/stable/2.40/rev/4110117ac7c437640eba5f95aed3113245b45e63 [^]
2010-04-20 17:45adrianromeroStatusresolved => new
2010-04-20 17:45adrianromeroResolutionfixed => open
2010-04-20 17:45adrianromeroStatusnew => scheduled
2010-04-20 17:47adrianromeroNote Deleted: 0026518
2010-04-20 17:47adrianromeroFixed in SCM revisionhttp://code.openbravo.com/erp/stable/2.40/rev/4110117ac7c437640eba5f95aed3113245b45e63 [^] =>
2010-04-20 17:47adrianromerofix_in_branchpi =>
2010-04-21 13:08hgbotCheckin
2010-04-21 13:08hgbotNote Added: 0026540
2010-04-21 13:08hgbotStatusscheduled => resolved
2010-04-21 13:08hgbotResolutionopen => fixed
2010-04-21 13:08hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/0d1ece383cd81f2ff5c525d8c09ddedc737b25a4 [^]
2010-04-26 07:55arunkumarNote Added: 0026664
2010-04-26 07:55arunkumarStatusresolved => closed
2010-04-26 15:24adrianromeroNote Added: 0026681
2010-04-26 15:25adrianromeroNote Added: 0026682
2010-04-26 15:25adrianromeroStatusclosed => new
2010-04-26 15:25adrianromeroStatusnew => scheduled
2010-04-26 15:25adrianromerofix_in_branch => pi
2010-04-26 15:26adrianromeroNote Added: 0026683
2010-04-26 15:26adrianromeroStatusscheduled => resolved
2010-04-26 15:27adrianromeroFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/0d1ece383cd81f2ff5c525d8c09ddedc737b25a4 [^] => http://code.openbravo.com/erp/devel/pi/rev/19f1bedbb5caa79ee914b4824633b874a4720b61 [^]
2010-04-26 15:27adrianromerofix_in_branchpi =>
2010-04-26 15:27adrianromeroNote Edited: 0026682bug_revision_view_page.php?bugnote_id=0026682#r283
2010-04-27 04:16sureshbabuNote Added: 0026712
2010-04-27 04:16sureshbabuStatusresolved => closed
2010-04-28 00:00anonymoussf_bug_id0 => 2993262
2010-05-14 15:27hudsonbotCheckin
2010-05-14 15:27hudsonbotNote Added: 0027256

Notes
(0026314)
adrianromero   
2010-04-16 13:04   
It also does not work selecting EUR.
It seems that the problem are the Starting Date and Ending Date fields. If these fields are empty, the reports works but if any of these fields has a valid date, it does not work.
(0026540)
hgbot   
2010-04-21 13:08   
Repository: erp/devel/pi
Changeset: 0d1ece383cd81f2ff5c525d8c09ddedc737b25a4
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Wed Apr 21 13:23:06 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/0d1ece383cd81f2ff5c525d8c09ddedc737b25a4 [^]

Fixes issue 0012818: Error in Purchase Order Report

---
M src/org/openbravo/base/secureApp/HttpSecureAppServlet.java
---
(0026664)
arunkumar   
2010-04-26 07:55   
Now the error message is displayed as There is no conversion rate defined from (EUR-€) to (USD-$) for date '07-08-2006', Client 'SmallBazaar' and Organization 'Main'.

Tested & working fine
(0026681)
adrianromero   
2010-04-26 15:24   
Repository: erp/devel/pi
Changeset: 19f1bedbb5caa79ee914b4824633b874a4720b61
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Mon Apr 26 15:10:45 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/19f1bedbb5caa79ee914b4824633b874a4720b61 [^] [^]

Fixes issue 0012856: Error in 'Purchase Order Report

---
M src/org/openbravo/erpCommon/ad_reports/ReportPurchaseOrder.jrxml
---
(0026682)
adrianromero   
2010-04-26 15:25   
(edited on: 2010-04-26 15:27)
* Testing of the issue:
To test the issue just follow the steps to reproduce and execute the report with a currency different than EUR. Try to execute the report several times using different "Starting date" and "Ending date" values. The error message should always be similar to: There is no conversion rate defined from (EUR-€) to (USD-$) for date '07-08-2006', Client 'SmallBazaar' and Organization 'Main'.

* Explanation of the changeset that fixes the issue:
There has been modified the File HttpSecureAppServlet.java to get the causeException message instead of the JasperError Exception message. This is because the real message of the exception is in the causeException object.
It has been modified too the report template ReportPurchaseOrder.jrxml adding the function TO_DATE to the date parameters of the report to make the report work properly in Oracle and Postgresql.

* Other areas affected by the changeset:
The changes in the report template only affects to this report. And the changes in HttpSecureAppServlet.java affects to all jasper reports that throw an exception. The change is done the way if the causeException is an SQLException then use the SQLException message. That is the correct message that has to be translated and displayed to the user. In other case it will behave as before.

(0026683)
adrianromero   
2010-04-26 15:26   
It has been set as resolved again because it needed another changeset for Oracle
(0026712)
sureshbabu   
2010-04-27 04:16   
Retested in oracle context
(0027256)
hudsonbot   
2010-05-14 15:27   
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/0d1ece383cd8 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/36f76c8d7193 [^]
Tests: http://builds.openbravo.com/view/devel-int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17198.obx [^]