Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0012363Openbravo ERP09. Financial managementpublic2010-02-19 16:302010-05-18 12:12
networkb 
alostale 
highminoralways
closedfixed 
5
2.50MP11 
2.50MP17 
Core
No
0012363: An error on Report Remittance
NULL appears on the Report Remittance (when you click on Print Record).
-As Openbravo Admin go to Financial Management || Receivables & Payables || Transactions || Remittance
-Click Print Record (In a Remittance with complete lines)
-Realize that NULL appears. (File attached)
No tags attached.
png RptC_Remittance.png (39,889) 2010-02-19 16:30
https://issues.openbravo.com/file_download.php?file_id=2251&type=bug
png

diff Issue_12363_pi.diff (1,975) 2010-04-09 12:40
https://issues.openbravo.com/file_download.php?file_id=2420&type=bug
Issue History
2010-02-19 16:30networkbNew Issue
2010-02-19 16:30networkbAssigned To => dalsasua
2010-02-19 16:30networkbFile Added: RptC_Remittance.png
2010-02-19 16:36networkbSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=52#r52
2010-03-08 16:05jpabloaeTarget Version2.50MP14 => 2.50MP15
2010-04-08 08:41sathiyanAssigned Todalsasua => sathiyan
2010-04-08 08:41sathiyanStatusnew => scheduled
2010-04-08 08:41sathiyanfix_in_branch => pi
2010-04-09 12:38sathiyanNote Added: 0026024
2010-04-09 12:38sathiyanAssigned Tosathiyan => iciordia
2010-04-09 12:40sathiyanFile Added: Issue_12363_pi.diff
2010-04-13 12:42iciordiaAssigned Toiciordia => alostale
2010-04-13 12:50hgbotCheckin
2010-04-13 12:50hgbotNote Added: 0026134
2010-04-13 12:50hgbotStatusscheduled => resolved
2010-04-13 12:50hgbotResolutionopen => fixed
2010-04-13 12:50hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d301591fbf605d4a994b39488c137809e038ad7d [^]
2010-04-15 13:22iperdomoNote Added: 0026255
2010-04-15 13:22iperdomoStatusresolved => closed
2010-04-16 00:00anonymoussf_bug_id0 => 2987952
2010-04-19 21:13hudsonbotCheckin
2010-04-19 21:13hudsonbotNote Added: 0026462
2010-05-18 12:12gorka_gilTarget Version2.50MP15 => 2.50MP17

Notes
(0026024)
sathiyan   
2010-04-09 12:38   
We have to fix it in core class for this issue. Because We will get REPORT_TITLE from generic method in renderJR at HttpSecureAppServlet class like below.

     designParameters.put("REPORT_TITLE", PrintJRData.getReportTitle(this, variables.getLanguage(), classInfo.id);
  
Query For Report Title:

select COALESCE(t.name, m.name) AS paramname
FROM AD_Menu M LEFT JOIN AD_Menu_Trl t ON m.AD_Menu_ID = t.AD_Menu_ID
    AND t.AD_Language = 'en_US' WHERE M.AD_Process_ID = '800146'

<<no records selected for reports/process which is not configured through Menu>>

The above report will work while click on print icon in the transaction window (Remittance).

Remittance Print Report/Process query to get process id:

select * from ad_process where ad_process_id='800146'

"800146";"0";"0";"Y";"2010-03-24 18:17:53.635099";"0";"2010-03-24 18:17:53.635099";"0";"RptC_Remittance";"Remittance printed";"Remittance printed";"Remittance printed";"3";"N";"";"Y";"N";"";"N";"N";"";"";"";"";"0";"M"

How to fix it:

If any Report/Process is not configured through menu, We have to get REPORT_TITLE from process name(from ad_process table), since that is null in menu(given process id won't be there in menu table). Since this is common across all Report/process which is not mapped/configured with menu. So We have to fix it in renderJR method level(available in HttpSecureAppServlet class).

I have attached diff for your review, since it is in HttpSecureAppServlet class. David advise me to assign this issue to platform team to push.

diff -r 610225e88ac0 src/org/openbravo/base/secureApp/HttpSecureAppServlet.java
--- a/src/org/openbravo/base/secureApp/HttpSecureAppServlet.java Wed Mar 17 20:29:41 2010 +0100
+++ b/src/org/openbravo/base/secureApp/HttpSecureAppServlet.java Thu Apr 08 20:44:18 2010 +0530
@@ -1083,8 +1083,12 @@
       designParameters.put("USER_ORG", Utility.getContext(this, variables, "#User_Org", ""));
       designParameters.put("LANGUAGE", strLanguage);
       designParameters.put("LOCALE", locLocale);
- designParameters.put("REPORT_TITLE", PrintJRData.getReportTitle(this,
- variables.getLanguage(), classInfo.id));
+ String reportTitle = PrintJRData.getReportTitle(this, variables.getLanguage(), classInfo.id);
+ if (reportTitle == null) {
+ reportTitle = PrintJRData.getReportTitleFromProcess(this, variables.getLanguage(),
+ classInfo.id);
+ }
+ designParameters.put("REPORT_TITLE", reportTitle);
 
       final DecimalFormatSymbols dfs = new DecimalFormatSymbols();
       dfs.setDecimalSeparator(variables.getSessionValue("#AD_ReportDecimalSeparator").charAt(0));
diff -r 610225e88ac0 src/org/openbravo/erpCommon/utility/PrintJR_data.xsql
--- a/src/org/openbravo/erpCommon/utility/PrintJR_data.xsql Wed Mar 17 20:29:41 2010 +0100
+++ b/src/org/openbravo/erpCommon/utility/PrintJR_data.xsql Thu Apr 08 20:44:18 2010 +0530
@@ -54,5 +54,16 @@
       <Parameter name="adLanguage"/>
       <Parameter name="adProcessId"/>
     </SqlMethod>
+ <SqlMethod name="getReportTitleFromProcess" type="preparedStatement" return="String">
+ <SqlMethodComment></SqlMethodComment>
+ <Sql>
+ select COALESCE(t.name, m.name) AS paramname
+ FROM AD_PROCESS m LEFT JOIN ad_process_trl t ON m.AD_Process_ID = t.AD_Process_ID
+ AND t.AD_Language = ?
+ WHERE m.AD_Process_ID = ?
+ </Sql>
+ <Parameter name="adLanguage"/>
+ <Parameter name="adProcessId"/>
+ </SqlMethod>
     
 </SqlClass>
(0026134)
hgbot   
2010-04-13 12:50   
Repository: erp/devel/pi
Changeset: d301591fbf605d4a994b39488c137809e038ad7d
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Apr 13 13:03:01 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/d301591fbf605d4a994b39488c137809e038ad7d [^]

fixed bug 12363: An error on Report Remittance

---
M src/org/openbravo/erpCommon/utility/PrintJR_data.xsql
---
(0026255)
iperdomo   
2010-04-15 13:22   
Tested on PI @ rev 90e107951e84
(0026462)
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/d301591fbf60 [^]
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 [^]