<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: DJ  
    $Date: 2014-2-18 下午1:43:37  
    $Revision: 1.0  
    $Purpose: 
-->
<ns1:model xmlns:ns1="http://www.leaf-framework.org/schema/bm" alias="t1" extend="basic.gld_accounts_v" extendMode="reference">
    <ns1:fields>
        <ns1:field name="account_id"/>
        <ns1:field name="parent_account_id"/>
        <ns1:field name="account_code" displayWidth="150" forDisplay="true" forQuery="true"/>
        <ns1:field name="account_desc" displayWidth="300" forDisplay="true" forQuery="true"/>
        <ns1:field name="account_type_desc" displayWidth="80" forDisplay="true"/>
        <ns1:field name="summary_flag" displayWidth="60" forDisplay="true"/>
        <ns1:field name="account_code_desc"/>
    </ns1:fields>
    <ns1:operations>
        <ns1:operation name="query">
            <ns1:query-sql><![CDATA[
    			select t1.account_id,
				       t1.parent_account_id,
				       t1.company_id,
				       t1.account_code,
				       t1.account_desc,
				       t1.account_code_desc,
				       t1.account_type,
				       t1.account_type_desc,
				       t1.summary_flag,
				       t1.enabled_flag
				  from gld_accounts_pack_v t1
				 #WHERE_CLAUSE#
				 order by t1.account_code
    		]]></ns1:query-sql>
        </ns1:operation>
    </ns1:operations>
    <ns1:query-fields>
        <ns1:query-field name="account_code" queryExpression="t1.account_code like &apos;%&apos;||${@account_code} ||&apos;%&apos; "/>
        <ns1:query-field name="account_desc" queryExpression="t1.account_desc like &apos;%&apos;||${@account_desc} ||&apos;%&apos; "/>
    </ns1:query-fields>
    <ns1:data-filters>
        <ns1:data-filter enforceOperations="query" expression="t1.company_id = ${/session/@top_biz_company_id}"/>
        <ns1:data-filter enforceOperations="query" expression="t1.enabled_flag = &apos;Y&apos; "/>
    </ns1:data-filters>
</ns1:model>
