<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Leauan
    $Date: 20201106
    $Revision: 1.0
    $Purpose:
-->

<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">

    <bm:operations>
        <bm:operation name="insert">
            <bm:update-sql><![CDATA[
                begin
                    acr_invoice_wfl_pkg.acr_invoice_apply_insert(p_invoice_apply_id  =>  ${@invoice_apply_id},
                                                                 p_invoice_hd_id_rec =>  ${@invoice_hd_ids},
                                                                 p_note              =>  ${@note},
                                                                 p_company_id        =>  ${/session/@company_id},
                                                                 p_user_id           =>  ${/session/@user_id},
                                                                 p_apply_mode        =>  ${@apply_mode},
                                                                 p_invoice_apply_num=>   ${@invoice_apply_num});
                end;
                ]]></bm:update-sql>
            <bm:parameters>
                <bm:parameter name="invoice_apply_id" dataType="java.lang.Long" input="false" output="true" outputPath="/parameter/@invoice_apply_id"/>
                <bm:parameter name="invoice_apply_num" dataType="java.lang.String" input="false" output="true" outputPath="/parameter/@invoice_apply_num"/>
            </bm:parameters>
        </bm:operation>

        <bm:operation name="update">
            <bm:update-sql><![CDATA[
                begin
                    acr_invoice_wfl_pkg.acr_invoice_wfl_insert(p_invoice_apply_id  =>  ${../../@invoice_apply_id},
                                                               p_invoice_hd_id     =>  ${@invoice_hd_id},
                                                               p_user_id           =>  ${/session/@user_id});
                end;
                ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
