<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: DJ
    $Date: 2013-5-21 下午4:20:24
    $Revision: 1.0
    $Purpose:
-->
<bm:model xmlns:o="leaf.database.local.oracle" xmlns:f="leaf.database.features" xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="t1" baseTable="GLD_JE_TEMPLATE_LNS" defaultOrderBy="t1.je_ln_number">
    <bm:fields>
        <bm:field name="je_template_ln_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="JE_TEMPLATE_LN_ID"/>
        <bm:field name="je_template_hd_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="JE_TEMPLATE_HD_ID"/>
        <bm:field name="je_ln_number" databaseType="NUMBER" datatype="java.lang.Long" physicalName="JE_LN_NUMBER" prompt="GLD107.GLD_JE_TEMPLATE_LNS.JE_LN_NUMBER"/>
        <bm:field name="je_desc" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="JE_DESC" prompt="GLD107.GLD_JE_TEMPLATE_LNS.JE_DESC"/>
        <bm:field name="dr_cr" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="DR_CR" prompt="GLD107.GLD_JE_TEMPLATE_LNS.DR_CR"/>
        <bm:field name="usage_code" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="USAGE_CODE" prompt="GLD107.GLD_JE_TEMPLATE_LNS.USAGE_CODE"/>
        <bm:field name="amount_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="AMOUNT_CONFIG_ID"/>
        <bm:field name="amount_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="AMOUNT_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.AMOUNT_CONFIG"/>
        <bm:field name="resp_center_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="RESP_CENTER_CONFIG_ID"/>
        <bm:field name="resp_center_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="RESP_CENTER_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.RESP_CENTER_CONFIG"/>
        <bm:field name="ref_1_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_1_CONFIG_ID"/>
        <bm:field name="ref_2_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_2_CONFIG_ID"/>
        <bm:field name="ref_3_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_3_CONFIG_ID"/>
        <bm:field name="ref_4_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_4_CONFIG_ID"/>
        <bm:field name="ref_5_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_5_CONFIG_ID"/>
        <bm:field name="ref_6_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_6_CONFIG_ID"/>
        <bm:field name="ref_7_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_7_CONFIG_ID"/>
        <bm:field name="ref_8_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_8_CONFIG_ID"/>
        <bm:field name="ref_9_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_9_CONFIG_ID"/>
        <bm:field name="ref_10_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_10_CONFIG_ID"/>
        <bm:field name="ref_11_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_11_CONFIG_ID"/>
        <bm:field name="ref_12_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_12_CONFIG_ID"/>
        <bm:field name="ref_13_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_13_CONFIG_ID"/>
        <bm:field name="ref_14_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_14_CONFIG_ID"/>
        <bm:field name="ref_15_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_15_CONFIG_ID"/>
        <bm:field name="ref_16_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_16_CONFIG_ID"/>
        <bm:field name="ref_17_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_17_CONFIG_ID"/>
        <bm:field name="ref_18_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_18_CONFIG_ID"/>
        <bm:field name="ref_19_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_19_CONFIG_ID"/>
        <bm:field name="ref_20_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="REF_20_CONFIG_ID"/>
        <bm:field name="ref_1_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_1_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.REF_1_CONFIG"/>
        <bm:field name="ref_2_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_2_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.REF_2_CONFIG"/>
        <bm:field name="ref_3_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_3_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.REF_3_CONFIG"/>
        <bm:field name="ref_4_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_4_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.REF_4_CONFIG"/>
        <bm:field name="ref_5_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_5_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.REF_5_CONFIG"/>
        <bm:field name="ref_6_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_6_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.REF_6_CONFIG"/>
        <bm:field name="ref_7_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_7_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.REF_7_CONFIG"/>
        <bm:field name="ref_8_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_8_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.REF_8_CONFIG"/>
        <bm:field name="ref_9_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_9_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.REF_9_CONFIG"/>
        <bm:field name="ref_10_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_10_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.REF_10_CONFIG"/>
        <bm:field name="ref_11_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_11_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.REF_11_CONFIG"/>
        <bm:field name="ref_12_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_12_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.REF_12_CONFIG"/>
        <bm:field name="ref_13_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_13_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.REF_13_CONFIG"/>
        <bm:field name="ref_14_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_14_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.REF_14_CONFIG"/>
        <bm:field name="ref_15_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_15_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.REF_15_CONFIG"/>
        <bm:field name="ref_16_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_16_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.REF_16_CONFIG"/>
        <bm:field name="ref_17_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_17_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.REF_17_CONFIG"/>
        <bm:field name="ref_18_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_18_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.REF_18_CONFIG"/>
        <bm:field name="ref_19_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_19_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.REF_19_CONFIG"/>
        <bm:field name="ref_20_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="REF_20_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.REF_20_CONFIG"/>
        <bm:field name="transaction_date_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TRANSACTION_DATE_CONFIG_ID"/>
        <bm:field name="transaction_date_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TRANSACTION_DATE_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.TRANSACTION_DATE_CONFIG"/>
        <bm:field name="project_id_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="PROJECT_ID_CONFIG_ID"/>
        <bm:field name="project_id_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PROJECT_ID_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.PROJECT_ID_CONFIG"/>
        <bm:field name="contract_id_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID_CONFIG_ID"/>
        <bm:field name="contract_id_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CONTRACT_ID_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.CONTRACT_ID_CONFIG"/>
        <bm:field name="cashflow_id_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CASHFLOW_ID_CONFIG_ID"/>
        <bm:field name="cashflow_id_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="CASHFLOW_ID_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.CASHFLOW_ID_CONFIG"/>
        <bm:field name="account_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="ACCOUNT_CONFIG_ID"/>
        <bm:field name="account_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ACCOUNT_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.ACCOUNT_CONFIG"/>
        <bm:field name="account_config_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="ACCOUNT_CONFIG_TYPE"/>
        <bm:field name="je_ln_type" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="JE_LN_TYPE"/>
        <bm:field name="loop_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="LOOP_CONFIG_ID"/>
        <bm:field name="loop_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="LOOP_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.LOOP_CONFIG"/>
        <bm:field name="amount_fuc_config_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="AMOUNT_FUC_CONFIG_ID"/>
        <bm:field name="amount_fuc_config" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="AMOUNT_FUC_CONFIG" prompt="GLD107.GLD_JE_TEMPLATE_LNS.AMOUNT_FUC_CONFIG"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="insert">
            <bm:parameters>
                <bm:parameter name="je_template_ln_id" dataType="java.lang.Long" input="false" output="true" outputPath="@je_template_ln_id"/>
            </bm:parameters>
            <bm:update-sql><![CDATA[
            	begin

				  GLD104_SAVE_PKG.line_manage(p_sql_type 			  => 'INSERT',
								  			  p_je_template_ln_id     => ${@je_template_ln_id},
								              p_je_template_hd_id     => ${@je_template_hd_id},
								              p_je_ln_number          => ${@je_ln_number},
								              p_je_desc               => ${@je_desc},
								              p_dr_cr                 => ${@dr_cr},
								              p_usage_code            => ${@usage_code},
								              p_je_ln_type			  => ${@je_ln_type},
								              p_user_id               => ${/session/@user_id});

				end;
    		]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
            	begin

				  GLD104_SAVE_PKG.line_manage(p_sql_type 			  => 'UPDATE',
								  			  p_je_template_ln_id     => ${@je_template_ln_id},
								              p_je_template_hd_id     => ${@je_template_hd_id},
								              p_je_ln_number          => ${@je_ln_number},
								              p_je_desc               => ${@je_desc},
								              p_dr_cr                 => ${@dr_cr},
								              p_usage_code            => ${@usage_code},
								              p_je_ln_type			  => ${@je_ln_type},
								              p_user_id               => ${/session/@user_id});

				end;
    		]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="delete">
            <bm:update-sql><![CDATA[
            	begin

				  GLD104_SAVE_PKG.line_manage(p_sql_type 			  => 'DELETE',
								  			  p_je_template_ln_id     => ${@je_template_ln_id},
								              p_je_template_hd_id     => ${@je_template_hd_id},
								              p_je_ln_number          => ${@je_ln_number},
								              p_je_desc               => ${@je_desc},
								              p_dr_cr                 => ${@dr_cr},
								              p_usage_code            => ${@usage_code},
								              p_je_ln_type			  => ${@je_ln_type},
								              p_user_id               => ${/session/@user_id});

				end;
    		]]></bm:update-sql>
        </bm:operation>
        <bm:operation name="execute">
            <bm:update-sql><![CDATA[
            	begin
            		GLD104_SAVE_PKG.je_template_line_copy(p_je_template_ln_id => ${@je_template_ln_id},
						                                  p_new_je_ln_number  => ${@new_je_ln_number},
						                                  p_user_id           => ${/session/@user_id});

				end;
    		]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
    <bm:features>
        <f:standard-who/>
        <o:sequence-pk/>
    </bm:features>
    <bm:primary-key>
        <bm:pk-field name="je_template_ln_id"/>
    </bm:primary-key>
    <bm:data-filters>
        <bm:data-filter name="je_template_hd_id" enforceOperations="query" expression="je_template_hd_id=${@je_template_hd_id}"/>
    </bm:data-filters>
</bm:model>