<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Feng  
    $Date: 2013-10-23 下午3:39:41  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="FRS_REPORTS_FIELDS">
    <bm:fields>
        <bm:field name="field_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FIELD_ID" prompt="FRS_REPORTS_FIELDS.FIELD_ID"/>
        <bm:field name="report_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REPORT_ID" prompt="FRS_REPORTS_FIELDS.REPORT_ID"/>
        <bm:field name="column_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COLUMN_ID" prompt="FRS_REPORTS_FIELDS.COLUMN_ID"/>
        <bm:field name="line_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LINE_ID" prompt="FRS_REPORTS_FIELDS.LINE_ID"/>
        <bm:field name="account_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="ACCOUNT_ID" prompt="FRS_REPORTS_FIELDS.ACCOUNT_ID"/>
        <bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMPANY_ID" prompt="FRS_REPORTS_FIELDS.COMPANY_ID"/>
        <bm:field name="responsbility_center_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="RESPONSBILITY_CENTER_ID" prompt="FRS_REPORTS_FIELDS.RESPONSBILITY_CENTER_ID"/>
        <bm:field name="data_element_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DATA_ELEMENT_CODE" prompt="FRS_REPORTS_FIELDS.DATA_ELEMENT_CODE"/>
        <bm:field name="period_offset_num" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PERIOD_OFFSET_NUM" prompt="FRS_REPORTS_FIELDS.PERIOD_OFFSET_NUM"/>
        <bm:field name="formula_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FORMULA_ID" prompt="FRS_REPORTS_FIELDS.FORMULA_ID"/>
        <bm:field name="calculation_priority" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CALCULATION_PRIORITY" prompt="FRS_REPORTS_FIELDS.CALCULATION_PRIORITY"/>
        <bm:field name="invisible_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="INVISIBLE_FLAG"/>
        <bm:field name="field_parameter_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FIELD_PARAMETER_FLAG" prompt="FRS_REPORTS_FIELDS.FIELD_PARAMETER_FLAG"/>
        <bm:field name="period_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PERIOD_NAME" prompt="FRS_REPORTS_FIELDS.PERIOD_NAME"/>
        <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" 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_name" displayField="code_value_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" returnfield="data_element_code" valueField="code_value"/>
        <bm:field name="account_code" expression="(select account_code from gld_accounts_vl where account_id = t1.account_id)" forInsert="false" forUpdate="false"/>
        <bm:field name="account_description" expression="(select description from gld_accounts_vl where account_id = t1.account_id)" forInsert="false" forUpdate="false"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="field_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="column_id" queryOperator="="/>
        <bm:query-field field="line_id" queryOperator="="/>
    </bm:query-fields>
</bm:model>
