<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang  
    $Date: 2013-11-14 下午02:42:53  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:operations>
        <bm:operation name="update">
            <bm:parameters>
                <bm:parameter name="confirm_message" dataType="java.lang.Long" input="false" output="true" outputPath="@confirm_message"/>
                <bm:parameter name="err_count" dataType="java.lang.Long" input="false" output="true" outputPath="@err_count"/>
                <bm:parameter name="warning_count" dataType="java.lang.Long" input="false" output="true" outputPath="@warning_count"/>
            </bm:parameters>
            <bm:update-sql><![CDATA[
            	begin
            		${@confirm_message} := tre_loan_contract_itfc_pkg.submit_interface(
            			p_batch_id =>${@batch_id}, 
            			p_err_count=>${@err_count},
                        p_warning_count=>${@warning_count},
                        p_ignore_warning_flag=>nvl(${@ignore_warning_flag},'N'),
            			p_user_id  =>${/session/@user_id}
            		);
            		
            		if nvl(${@validate_source},'CREATE')='INTEREST_RESET' then
            		   tre_loan_contract_pkg.update_after_interest_rest(
            		   	   p_loan_contract_id =>${@loan_contract_id},
                           p_user_id          =>${/session/@user_id}
                       );
            		end if;
            		
            		tre_loan_contract_pkg.valid_loan_contract(
            			p_loan_contract_id =>${@loan_contract_id},
                        p_validate_source  =>nvl(${@validate_source},'CREATE'),
                        p_user_id          =>${/session/@user_id}
                    );
            	end;
            ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
