<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: mumu  
    $Date: 2014-7-25 上午01:15:21  
    $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
                    t1.*,
                    TO_CHAR(add_months(to_date(t1.inception_of_lease,'yyyy-mm-dd'),1),'yyyy-mm-dd') first_lease,
                    TO_CHAR(to_date(t1.inception_of_lease,'yyyy-mm-dd'),'dd') deduction_day,
                    NVL(t1.lease_mgt_fee,0)+NVL(t1.finance_amount,0) AS due_payment_amount,
                    nvl(t1.vat_commission_receivable,0) as vat_commission_receivable
                FROM
                    hls_fin_calculator_hd t1,
                    prj_quotation t2
                WHERE
                    t1.calc_session_id   = t2.calc_session_id AND
                    t2.document_category = 'PROJECT' AND
                    t2.document_id       = ${@project_id}
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
