<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: feng
    $Date: 2013-9-11 下午15:13:20
    $Revision: 1.0
    $Purpose:
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql>
                <![CDATA[
               select *
                   from (select c.contract_id, c.contract_number, c.contract_name
                from con_contract c
                where c.data_class = 'NORMAL'
                and c.contract_status  IN ('REPURING','ETING','INCEPT','PENDING')
                and not exists (select 1 from acp_invoice_ln an where an.contract_id=c.contract_id and an.confirmation_status in('APPROVING','APPROVED'))
                ) V
                #WHERE_CLAUSE#
                ]]></bm:query-sql>
        </bm:operation>

    </bm:operations>
    <bm:fields>
        <bm:field name="contract_number" forDisplay="true"  forQuery="true" prompt="ACR310.CONTRACT_NUMBER"/>
        <bm:field name="contract_name"  forDisplay="true" forQuery="true" prompt="ACR310.CONTRACT_NAME"/>
        <bm:field name="contract_id"/>
    </bm:fields>
<!--    <bm:fields>-->
<!--        <bm:field name="contract_number" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="contract_number" prompt="ACR310.CONTRACT_NUMBER"/>-->
<!--        <bm:field name="contract_name" databaseType="VARCHAR2" datatype="java.lang.String" forDisplay="true" forQuery="true" physicalName="contract_name" prompt="ACR310.CONTRACT_NAME"/>-->
<!--        <bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="contract_id" />-->
<!--    </bm:fields>-->
    <bm:query-fields>
        <bm:query-field field="contract_number" queryOperator="like"/>
        <bm:query-field field="contract_name" queryOperator="like"/>
    </bm:query-fields>
</bm:model>
