<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang  
    $Date: 2013-5-10 下午12:52:17  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    gb.functional_currency_code,
                    gc.precision functional_precision,
                    gc.currency_name functional_currency_name,
                    'MANUAL'  default_exchange_rate_type,
                    (select t.type_name from gld_exchangerate_types_vl t where t.type_code = 'MANUAL') default_exch_rate_type_desc,
                    (select t.rate_method_code from gld_exchangerate_types_vl t where t.type_code = 'MANUAL') default_rate_method_code
                FROM
                    fnd_companies fc,
                    gld_set_of_books gb,
                    gld_currency_v gc
                WHERE
                    fc.company_id              = ${/session/@company_id} AND
                    fc.set_of_books_id         = gb.set_of_books_id AND
                    gb.functional_currency_code=gc.currency_code
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="functional_currency_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FUNCTIONAL_CURRENCY_CODE"/>
        <bm:field name="functional_currency_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="FUNCTIONAL_CURRENCY_NAME"/>
        <bm:field name="functional_precision" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FUNCTIONAL_PRECISION"/>
        <bm:field name="default_exchange_rate_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DEFAULT_EXCHANGE_RATE_TYPE"/>
        <bm:field name="default_exch_rate_type_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DEFAULT_EXCH_RATE_TYPE_DESC"/>
        <bm:field name="default_rate_method_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DEFAULT_RATE_METHOD_CODE"/>
    </bm:fields>
</bm:model>
