<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: niujiaqing1265 $
    $Date: 2010/12/09 05:48:38 $
    $Revision: 1.2 $
    $Purpose: 用途代码定义-配置匹配值-科目代码选择lov
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="ga" extend="gld.FND2140.gld_accounts" extendMode="reference">
    <bm:fields>
        <bm:field name="account_id"/>
        <bm:field name="account_code" displayWidth="200" forDisplay="true" forQuery="true" queryWidth="120"/>
        <bm:field name="description_id" multiLanguage="true" multiLanguageDescField="account_description"/>
        <bm:field name="account_description" databaseType="VARCHAR" datatype="java.lang.String" displayWidth="200" forDisplay="true" forInsert="false" forQuery="true" forUpdate="false" queryWidth="120"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field name="company_id" queryExpression="gca.company_id = ${/parameter/@company_id}"/>
        <bm:query-field field="account_code" queryOperator="like"/>
        <bm:query-field name="account_description" queryExpression="exists (select 1 from fnd_descriptions fd where ga.description_id=fd.description_id and fd.description_text like ${@account_description} and fd.language = ${/session/@lang})"/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="ga.enabled_flag = &apos;Y&apos; and ga.summary_flag = &apos;N&apos; and ga.account_type in (select d.code_value from sys_code_values_v d where d.code = &apos;ACCOUNT_TYPE&apos; and d.code_enabled_flag=&apos;Y&apos; and d.code_value_enabled_flag=&apos;Y&apos;)"/>
        <bm:data-filter name="exists" enforceOperations="query" expression="exists (select 1 from fnd_companies c where gca.set_of_books_id = c.set_of_books_id and c.company_id = gca.company_id)"/>
    </bm:data-filters>
    <bm:features>
        <f:multi-language-display/>
    </bm:features>
    <bm:relations>
        <bm:relation name="gca" joinType="inner" refModel="gld.FND2140.gld_company_accounts">
            <bm:reference foreignField="account_id" localField="account_id"/>
        </bm:relation>
    </bm:relations>
    <bm:ref-fields>
        <bm:ref-field name="company_id" databaseType="NUMBER" relationName="gca" sourceField="company_id"/>
    </bm:ref-fields>
</bm:model>
