<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: qwm  
    $Date: 2013-7-18 下午7:01:56  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="execute">
            <bm:parameters>
                <bm:parameter name="et_agreement_id" dataType="java.lang.Long" input="true" output="false" required="true"/>
                <bm:parameter name="user_id" dataType="java.lang.Long" input="true" output="false"/>
                <bm:parameter name="ref_n04" dataType="java.lang.Double" input="true" output="false"/>
                <bm:parameter name="ref_n05" dataType="java.lang.Double" input="true" output="false"/>
                <bm:parameter name="reduce_residual_value" dataType="java.lang.Double" input="true" output="false"/>
                <bm:parameter name="reduce_period_interest" dataType="java.lang.Double" input="true" output="false"/>
                <bm:parameter name="ref_n06" dataType="java.lang.Double" input="true" output="false"/>
                <bm:parameter name="ref_n07" dataType="java.lang.Double" input="true" output="false"/>
                <bm:parameter name="discount_exemption" dataType="java.lang.Double" input="true" output="false"/>
                <bm:parameter name="et_total_amount" dataType="java.lang.Double" input="true" output="false"/>
                <bm:parameter name="et_agreement_number" input="true" output="true"/>
                <bm:parameter name="remittance_amount" dataType="java.lang.Double" input="true" output="false"/>
                <bm:parameter name="remittance_date" input="true" output="false"/>
            </bm:parameters>
            <bm:update-sql><![CDATA[
                begin
                    CON_CONTRACT_ET_PKG.ET_SAVE
                    (
                        p_et_agreement_id=>${@et_agreement_id},
                        p_user_id=>${/session/@user_id},
                        p_deposit_deduction_flag =>${@deposit_deduction_flag},
                        p_deposit_by_agent =>${@deposit_by_agent},
                        p_ref_n04=>${@ref_n04},
                        p_ref_n05 =>${@ref_n05},
                        p_reduce_residual_value  =>${@reduce_residual_value},
                        p_reduce_period_interest   =>${@reduce_period_interest},
                        p_deposit => ${@deposit},
                        p_third_party_deposit =>${@third_party_deposit},
                        p_note_s => ${@note_s},
                        p_cost_reduction => ${@cost_reduction},
                        p_remittance_date => to_date(${@remittance_date} ,'yyyy-mm-dd hh24:mi:ss'),
                        p_remittance_amount => ${@remittance_amount}
                    );
                    
                end;]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="update">
            <bm:parameters>
                <bm:parameter name="et_agreement_id" dataType="java.lang.Long" input="true" output="false" required="true"/>
                <bm:parameter name="user_id" dataType="java.lang.Long" input="true" output="false"/>
                <bm:parameter name="ref_n04" dataType="java.lang.Double" input="true" output="false"/>
                <bm:parameter name="ref_n05" dataType="java.lang.Double" input="true" output="false"/>
                <bm:parameter name="ref_n06" dataType="java.lang.Double" input="true" output="false"/>
                <bm:parameter name="ref_n07" dataType="java.lang.Double" input="true" output="false"/>
                <bm:parameter name="et_total_amount" dataType="java.lang.Double" input="true" output="false"/>
                <bm:parameter name="et_agreement_number" input="true" output="true"/>
            </bm:parameters>
            <bm:update-sql><![CDATA[
                begin
                    CON_CONTRACT_ET_PKG.ET_SAVE_WFL
                    (
                        p_et_agreement_id=>${@et_agreement_id},
                        p_user_id=>${/session/@user_id},
                        p_et_total_amount =>${@et_total_amount},
                        p_ref_n04=>${@ref_n04},
                        p_ref_n05 =>${@ref_n05},
    					p_ref_n06 =>${@ref_n06},
                        p_ref_n07 => ${@ref_n07},
                        p_discount_exemption => ${@discount_exemption},
                        p_note    => ${@note},
                        p_write_off_desc =>${@write_off_desc},
                        p_et_agreement_number => ${@et_agreement_number}
                    );
                    
                end;]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
