<?xml version="1.0" encoding="UTF-8"?>

<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[select sum(ca.due_amount) fin_monthly_payment from con_contract cc,con_contract_cashflow ca  where cc.bp_id_tenant = ${/parameter/@bp_id}
and cc.contract_id = ca.contract_id 
and cc.data_class = 'NORMAL'
and cc.contract_status not in('PENDING','ET','REPUR','TERMINATE','CANCEL')
and trunc(ca.due_date,'MONTH') = trunc(sysdate)]]></bm:query-sql>
            <bm:parameters>
                <bm:parameter inputPath="/parameter/@bp_id"/>
            </bm:parameters>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="fin_monthly_payment" databaseType="NUMBER" datatype="java.lang.Long" physicalName="FIN_MONTHLY_PAYMENT"/>
    </bm:fields>
</bm:model>
