Fixes issue 9273: The documents not posted report always appears in english although another language is correctly installed
authorDavid Alsasua <david.alsasua@openbravo.com>
Tue, 02 Jun 2009 11:49:10 +0200
changeset 3945 02f5d14bcacb
parent 3944 497df2a505ef
child 3946 ce482f6efadb
Fixes issue 9273: The documents not posted report always appears in english although another language is correctly installed
src/org/openbravo/erpCommon/ad_reports/ReportNotPosted_data.xsql
--- a/src/org/openbravo/erpCommon/ad_reports/ReportNotPosted_data.xsql	Tue Jun 02 11:23:00 2009 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportNotPosted_data.xsql	Tue Jun 02 11:49:10 2009 +0200
@@ -12,7 +12,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
+ * All portions are Copyright (C) 2001-2009 Openbravo SL 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -25,54 +25,54 @@
     <![CDATA[
         select documentno, dateacct, name as description, GRANDTOTAL  as amount, document as doctype
         from
-        (select ad_client_id, documentno, dateacct, ad_column_identifier('C_Bpartner',to_char(C_bpartner_id), TO_CHAR(?)) as name, GRANDTOTAL, 'Sales Invoices' as document
+        (select ad_client_id, documentno, dateacct, ad_column_identifier('C_Bpartner',to_char(C_bpartner_id), TO_CHAR(?)) as name, GRANDTOTAL, coalesce(to_char((select printname from c_doctype_trl where c_doctype_id=c_invoice.c_doctype_id and ad_language=to_char(?) and ad_client_id=?)), 'Sales Invoices') as document
         from c_invoice
         where processed = 'Y'
         and posted = 'N'
         and issotrx = 'Y'
         and 'Y'=(select isactive from c_acctschema_table where ad_table_id='318' and ad_client_id=?)
         union
-        select ad_client_id, documentno, dateacct, ad_column_identifier('C_Bpartner',to_char(C_bpartner_id), TO_CHAR(?)) as name, 0 as GRANDTOTAL, 'Goods Receipts' as document
+        select ad_client_id, documentno, dateacct, ad_column_identifier('C_Bpartner',to_char(C_bpartner_id), TO_CHAR(?)) as name, 0 as GRANDTOTAL, coalesce(to_char((select printname from c_doctype_trl where c_doctype_id=m_inout.c_doctype_id and ad_language=to_char(?) and ad_client_id=?)), 'Goods Receipts') as document
         from m_inout
         where processed = 'Y'
         and posted = 'N'
         and issotrx = 'N'
         and 'Y'=(select isactive from c_acctschema_table where ad_table_id='319' and ad_client_id=?)
         union
-        select ad_client_id, documentno, dateacct, ad_column_identifier('C_Bpartner',to_char(C_bpartner_id), TO_CHAR(?)), GRANDTOTAL, 'Purchase Invoices'
+        select ad_client_id, documentno, dateacct, ad_column_identifier('C_Bpartner',to_char(C_bpartner_id), TO_CHAR(?)), GRANDTOTAL, coalesce(to_char((select printname from c_doctype_trl where c_doctype_id=c_invoice.c_doctype_id and ad_language=to_char(?) and ad_client_id=?)), 'Purchase Invoices') as document
         from c_invoice
         where processed = 'Y'
         and posted = 'N'
         and issotrx = 'N'
         and 'Y'=(select isactive from c_acctschema_table where ad_table_id='318' and ad_client_id=?)
         union
-        select ad_client_id, name, dateacct, ad_column_identifier('C_Cash',to_char(C_Cash_id), TO_CHAR(?)), c_cash.STATEMENTDIFFERENCE, 'Cash Journal'
+        select ad_client_id, name, dateacct, ad_column_identifier('C_Cash',to_char(C_Cash_id), TO_CHAR(?)), c_cash.STATEMENTDIFFERENCE, coalesce(to_char((select printname from c_doctype_trl where c_doctype_id=(select min(c_doctype_id) from c_doctype where ad_client_id=? and docbasetype='CMC') and ad_language=to_char(?) and ad_client_id=?)), 'Cash Journal') as document
         from C_Cash
         where processed = 'Y'
         and posted = 'N'
         and 'Y'=(select isactive from c_acctschema_table where ad_table_id='407' and ad_client_id=?)
         union
-        select ad_client_id, name, statementdate, ad_column_identifier('C_Bankstatement',to_char(C_bankstatement_id), TO_CHAR(?)), STATEMENTDIFFERENCE, 'Bank Statements'
+        select ad_client_id, name, statementdate, ad_column_identifier('C_Bankstatement',to_char(C_bankstatement_id), TO_CHAR(?)), STATEMENTDIFFERENCE, coalesce(to_char((select printname from c_doctype_trl where c_doctype_id=(select min(c_doctype_id) from c_doctype where ad_client_id=? and docbasetype='CMB') and ad_language=to_char(?) and ad_client_id=?)), 'Bank Statements') as document
         from c_bankstatement
         where processed = 'Y'
         and posted = 'N'
         and 'Y'=(select isactive from c_acctschema_table where ad_table_id='392' and ad_client_id=?)
         union
-        select ad_client_id, documentno, dateacct, ad_column_identifier('C_Settlement',to_char(C_Settlement_id), TO_CHAR(?)), generatedamt, 'Manual Settlements'
+        select ad_client_id, documentno, dateacct, ad_column_identifier('C_Settlement',to_char(C_Settlement_id), TO_CHAR(?)), generatedamt, coalesce(to_char((select printname from c_doctype_trl where c_doctype_id=c_Settlement.c_doctype_id and ad_language=to_char(?) and ad_client_id=?)), 'Manual Settlements') as document
         from c_Settlement
         where processed = 'Y'
         and posted = 'N'
         and settlementtype = 'I'
         and 'Y'=(select isactive from c_acctschema_table where ad_table_id='800019' and ad_client_id=?)
         union
-        select ad_client_id, documentno, dateacct, ad_column_identifier('C_Settlement',to_char(C_Settlement_id), TO_CHAR(?)), generatedamt, 'Settlements'
+        select ad_client_id, documentno, dateacct, ad_column_identifier('C_Settlement',to_char(C_Settlement_id), TO_CHAR(?)), generatedamt, coalesce(to_char((select printname from c_doctype_trl where c_doctype_id=c_Settlement.c_doctype_id and ad_language=to_char(?) and ad_client_id=?)), 'Settlements') as document
         from c_Settlement
         where processed = 'Y'
         and posted = 'N'
         and settlementtype <> 'I'
         and 'Y'=(select isactive from c_acctschema_table where ad_table_id='800019' and ad_client_id=?)
         union
-        select ad_client_id, documentno, dateacct, ad_column_identifier('GL_Journal',to_char(GL_Journal_id), TO_CHAR(?)), totaldr, 'GL Journal'
+        select ad_client_id, documentno, dateacct, ad_column_identifier('GL_Journal',to_char(GL_Journal_id), TO_CHAR(?)), totaldr, coalesce(to_char((select printname from c_doctype_trl where c_doctype_id=GL_Journal.c_doctype_id and ad_language=to_char(?) and ad_client_id=?)), 'GL Journal') as document
         from GL_Journal
         where processed = 'Y'
         and posted = 'N'
@@ -83,20 +83,38 @@
         order by  document, dateacct, name
       ]]></Sql>
     <Parameter name="adLanguage"/>
+    <Parameter name="adLanguage"/>
+    <Parameter name="client"></Parameter>
+    <Parameter name="client"></Parameter>
+    <Parameter name="adLanguage"/>
+    <Parameter name="adLanguage"/>
+    <Parameter name="client"></Parameter>
+    <Parameter name="client"></Parameter>
+    <Parameter name="adLanguage"/>
+    <Parameter name="adLanguage"/>
+    <Parameter name="client"></Parameter>
     <Parameter name="client"></Parameter>
     <Parameter name="adLanguage"/>
     <Parameter name="client"></Parameter>
     <Parameter name="adLanguage"/>
     <Parameter name="client"></Parameter>
-    <Parameter name="adLanguage"/>
     <Parameter name="client"></Parameter>
     <Parameter name="adLanguage"/>
     <Parameter name="client"></Parameter>
     <Parameter name="adLanguage"/>
     <Parameter name="client"></Parameter>
+    <Parameter name="client"></Parameter>
+    <Parameter name="adLanguage"/>
     <Parameter name="adLanguage"/>
     <Parameter name="client"></Parameter>
+    <Parameter name="client"></Parameter>
     <Parameter name="adLanguage"/>
+    <Parameter name="adLanguage"/>
+    <Parameter name="client"></Parameter>
+    <Parameter name="client"></Parameter>
+    <Parameter name="adLanguage"/>
+    <Parameter name="adLanguage"/>
+    <Parameter name="client"></Parameter>
     <Parameter name="client"></Parameter>
     <Parameter name="dateFrom"></Parameter>
     <Parameter name="dateTo"></Parameter>