src-db/database/model/views/AD_REF_LIST_V.xml
author Adrián Romero <adrianromero@openbravo.com>
Tue, 02 Mar 2010 12:49:24 +0100
changeset 6545 27d9578201da
parent 6544 2e60729b9c13
child 6912 38c773f35773
permissions -rw-r--r--
Fixes issue 0012014: Error in Project Profitability
adrian@94
     1
<?xml version="1.0"?>
adrian@94
     2
  <database name="VIEW AD_REF_LIST_V">
gorka@406
     3
    <view name="AD_REF_LIST_V"><![CDATA[SELECT ad_ref_list.ad_ref_list_id, ad_ref_list.value, to_char(ad_ref_list.name) AS name, 'en_US' AS ad_language, ad_ref_list.ad_reference_id
adrianromero@6545
     4
   FROM ad_ref_list
antonio@776
     5
UNION 
adrianromero@6545
     6
 SELECT v1.ad_ref_list_id, v1.value, COALESCE(v1.name_trl, v2.name) AS name, v1.ad_language, v1.ad_reference_id
adrianromero@6545
     7
   FROM ( SELECT ad_ref_list.ad_ref_list_id, ad_ref_list.value, to_char(ad_ref_list_trl.name) AS name_trl, '' AS name, ad_ref_list_trl.ad_language, ad_ref_list.ad_reference_id
adrianromero@6545
     8
           FROM ad_ref_list, ad_ref_list_trl
adrianromero@6545
     9
          WHERE ad_ref_list.ad_ref_list_id = ad_ref_list_trl.ad_ref_list_id) v1, ( SELECT ad_ref_list.ad_ref_list_id, ad_ref_list.value, to_char(ad_ref_list.name) AS name, ad_language.ad_language, ad_ref_list.ad_reference_id
adrianromero@6545
    10
           FROM ad_ref_list, ad_language
adrianromero@6545
    11
          WHERE ad_language.issystemlanguage = 'Y') v2
adrianromero@6545
    12
  WHERE v1.ad_ref_list_id = v2.ad_ref_list_id AND v1.ad_reference_id = v2.ad_reference_id]]></view>
adrian@94
    13
  </database>