<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Feng  
    $Date: 2013-10-15 上午11:02:05  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:o="leaf.database.local.oracle" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="FRS_REPORTS_COLUMNS" defaultOrderBy="column_num">
    <bm:fields>
        <bm:field name="column_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COLUMN_ID" prompt="FRS_REPORTS_COLUMNS.COLUMN_ID"/>
        <bm:field name="report_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REPORT_ID" prompt="FRS_REPORTS_COLUMNS.REPORT_ID"/>
        <bm:field name="column_num" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COLUMN_NUM" prompt="FRS_REPORTS_COLUMNS.COLUMN_NUM"/>
        <bm:field name="description_id" databaseType="NUMBER" datatype="java.lang.Long" multiLanguage="true" multiLanguageDescField="description" physicalName="DESCRIPTION_ID" prompt="FRS_REPORTS_COLUMNS.DESCRIPTION_ID"/>
        <bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMPANY_ID" prompt="FRS_REPORTS_COLUMNS.COMPANY_ID"/>
        <bm:field name="company_name" expression="(select fvl.company_short_name from fnd_companies_vl fvl where fvl.company_id = t1.company_id and sysdate between fvl.start_date_active and nvl(fvl.end_date_active, sysdate))" forInsert="false" forUpdate="false"/>
        <bm:field name="responsbility_center_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="RESPONSBILITY_CENTER_ID" prompt="FRS_REPORTS_COLUMNS.RESPONSBILITY_CENTER_ID"/>
        <bm:field name="responsbility_center" expression="(select responsibility_center_name from fnd_responsibility_centers_vl fv where fv.responsibility_center_id = t1.responsbility_center_id)" forInsert="false" forUpdate="false"/>
        <bm:field name="data_element_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DATA_ELEMENT_CODE" prompt="FRS_REPORTS_COLUMNS.DATA_ELEMENT_CODE"/>
        <bm:field name="data_element_name" expression="(select code_value_name from sys_code_values_v where code_value = t1.data_element_code and code = &apos;DATA_ELEMENT&apos;)" forInsert="false" forUpdate="false"/>
        <bm:field name="period_offset_num" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PERIOD_OFFSET_NUM" prompt="FRS_REPORTS_COLUMNS.PERIOD_OFFSET_NUM"/>
        <bm:field name="period_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PERIOD_NAME" prompt="FRS_REPORTS_COLUMNS.PERIOD_NAME"/>
        <bm:field name="invisible_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVISIBLE_FLAG" prompt="FRS_REPORTS_COLUMNS.INVISIBLE_FLAG"/>
        <bm:field name="description" databaseType="VARCHAR" datatype="java.lang.String" forInsert="false" forUpdate="false" prompt="FRS_REPORTS_COLUMNS.DESCRIPTION"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
        <f:multi-language-storage/>
        <o:sequence-pk/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="column_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="report_id" queryOperator="="/>
    </bm:query-fields>
</bm:model>
