<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: LR  
    $Date: 2014-4-8 下午02:35:37  
    $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
                    m.bp_id,
                    m.bp_name,
                    b.contract_number,
                    b.contract_id,
                    SUM((a.due_amount-NVL(a.received_amount,0))) AS amt
                FROM
                    con_contract_cashflow a,
                    con_contract b,
                    hls_bp_master m
                #WHERE_CLAUSE#
                    
                GROUP BY
                    m.bp_id,
                    m.bp_name,
                    b.contract_number,
                    b.contract_id
                ORDER BY
                    m.bp_name,
                    b.contract_number
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field name="bp_name" queryExpression="m.bp_name like ${@bp_name}"/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="a.contract_id= b.contract_id AND b.contract_status = &apos;INCEPT&apos; AND  b.bp_id_tenant = m.bp_id AND a.cf_item  = 1 AND (a.due_amount-NVL(a.received_amount,0)) &gt; 0 AND ( a.due_date + NVL(b.grace_period,0)) &lt; TRUNC(sysdate)"/>
    </bm:data-filters>
</bm:model>
