<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Feng  
    $Date: 2013-10-14 上午11:02:49  
    $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_HEADERS">
    <bm:fields>
        <bm:field name="report_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REPORT_ID" prompt="FRS_REPORTS_HEADERS.REPORT_ID"/>
        <bm:field name="report_format_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REPORT_FORMAT_CODE" prompt="FRS_REPORTS_HEADERS.REPORT_FORMAT_CODE"/>
        <bm:field name="amount_uom_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="AMOUNT_UOM_CODE" prompt="FRS_REPORTS_HEADERS.AMOUNT_UOM_CODE"/>
        <bm:field name="format_mask_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FORMAT_MASK_CODE" prompt="FRS_REPORTS_HEADERS.FORMAT_MASK_CODE"/>
        <bm:field name="enabled_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ENABLED_FLAG" prompt="FRS_REPORTS_HEADERS.ENABLED_FLAG"/>
        <bm:field name="report_description_id" databaseType="NUMBER" datatype="java.lang.Long" multiLanguage="true" multiLanguageDescField="report_description" physicalName="REPORT_DESCRIPTION_ID" prompt="FRS_REPORTS_HEADERS.REPORT_DESCRIPTION_ID"/>
        <bm:field name="report_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REPORT_NAME" prompt="FRS_REPORTS_HEADERS.REPORT_NAME"/>
        <bm:field name="currency_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CURRENCY_CODE" prompt="FRS_REPORTS_HEADERS.CURRENCY_CODE"/>
        <bm:field name="functional_balances_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FUNCTIONAL_BALANCES_FLAG" prompt="FRS_REPORTS_HEADERS.FUNCTIONAL_BALANCES_FLAG"/>
        <bm:field name="set_of_books_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="SET_OF_BOOKS_ID" prompt="FRS_REPORTS_HEADERS.SET_OF_BOOKS_ID"/>
        <bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMPANY_ID" prompt="FRS_REPORTS_HEADERS.COMPANY_ID"/>
        <bm:field name="report_description" databaseType="VARCHAR2" datatype="java.lang.String" forInsert="false" forUpdate="false"/>
        <bm:field name="report_format" expression="(select code_value_name from sys_code_values_v where code_value = t1.report_format_code and code = &apos;REPORT_FORMAT&apos;)" forInsert="false" forUpdate="false"/>
        <bm:field name="amount_uom" expression="(select code_value_name from sys_code_values_v where code_value = t1.amount_uom_code and code = &apos;AMOUNT_UOM&apos;)" forInsert="false" forUpdate="false"/>
        <bm:field name="format_mask" expression="(select code_value_name from sys_code_values_v where code_value = t1.format_mask_code and code = &apos;FORMAT_MASK&apos;)" forInsert="false" forUpdate="false"/>
        <bm:field name="currency_name" expression="(select currency_name from gld_currency_vl where enabled_flag = &apos;Y&apos; and currency_code = t1.currency_code)" forInsert="false" forUpdate="false"/>
    </bm:fields>
    <bm:features>
        <f:standard-who/>
        <f:multi-language-storage/>
        <o:sequence-pk sequenceName="FRS_REPORTS_HEADERS_S"/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="report_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="report_name" queryExpression="report_name like &apos;%&apos;||${@report_name}||&apos;%&apos;"/>
        <bm:query-field name="report_description" queryExpression="exists (select 1 from fnd_descriptions where description_text like &apos;%&apos;||${@report_description}||&apos;%&apos; and description_id = t1.report_description_id and language = ${/session/@lang})"/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="t1.company_id = ${/session/@company_id}"/>
    </bm:data-filters>
</bm:model>
