<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: WangQiaosen3207  
    $Date: 2011-6-2 下午02:35:51  
    $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 t.expense_type_id,
				       t.company_id,
				       fv.company_short_name,
				       t.expense_type_code,
				       t.description
				  from exp_expense_types_vl t, fnd_companies_vl fv
				  #WHERE_CLAUSE#
			]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="expense_type_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="EXPENSE_TYPE_ID"/>
        <bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMPANY_ID"/>
        <bm:field name="expense_type_code" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="EXPENSE_TYPE_CODE" prompt="报销类型代码" queryWidth="100"/>
        <bm:field name="description" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="DESCRIPTION" prompt="描述" queryWidth="100"/>
        <bm:field name="company_short_name" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" physicalName="COMPANY_SHORT_NAME" prompt="所属公司"/>
    </bm:fields>
    <bm:data-filters>
        <bm:data-filter name="enabled_flag" enforceOperations="query" expression="t.enabled_flag = &apos;Y&apos;"/>
        <bm:data-filter name="company_id" enforceOperations="query" expression="t.company_id = fv.company_id  and  t.company_id=${/session/@company_id}"/>
    </bm:data-filters>
    <bm:query-fields>
        <bm:query-field field="expense_type_code" queryOperator="like"/>
        <bm:query-field field="description" queryOperator="like"/>
    </bm:query-fields>
</bm:model>
