<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:o="leaf.database.local.oracle" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" baseTable="HLS_TAX_ACT_CONFIRM" needAccessControl="false">
	<bm:fields>
		<bm:field name="act_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="ACT_ID" prompt="HLS_TAX_ACT_CONFIRM.ACT_ID"/>
		<bm:field name="cashflow_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CASHFLOW_ID" prompt="HLS_TAX_ACT_CONFIRM.CASHFLOW_ID"/>
		<bm:field name="contract_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CONTRACT_ID" prompt="HLS_TAX_ACT_CONFIRM.CONTRACT_ID"/>
		<bm:field name="cf_item" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CF_ITEM" prompt="HLS_TAX_ACT_CONFIRM.CF_ITEM"/>
		<bm:field name="cf_type" databaseType="NUMBER" datatype="java.lang.Long" physicalName="CF_TYPE" prompt="HLS_TAX_ACT_CONFIRM.CF_TYPE"/>
		<bm:field name="times" databaseType="NUMBER" datatype="java.lang.Long" physicalName="TIMES" prompt="HLS_TAX_ACT_CONFIRM.TIMES"/>
		<bm:field name="due_date" databaseType="DATE" datatype="java.util.Date" physicalName="DUE_DATE" prompt="HLS_TAX_ACT_CONFIRM.DUE_DATE"/>
		<bm:field name="due_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="DUE_AMOUNT" prompt="HLS_TAX_ACT_CONFIRM.DUE_AMOUNT"/>
		<bm:field name="vat_due_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="VAT_DUE_AMOUNT" prompt="HLS_TAX_ACT_CONFIRM.VAT_DUE_AMOUNT"/>
		<bm:field name="received_amount" databaseType="NUMBER" datatype="java.lang.Double" physicalName="RECEIVED_AMOUNT" prompt="HLS_TAX_ACT_CONFIRM.RECEIVED_AMOUNT"/>
		<bm:field name="last_received_date" databaseType="DATE" datatype="java.util.Date" physicalName="LAST_RECEIVED_DATE" prompt="HLS_TAX_ACT_CONFIRM.LAST_RECEIVED_DATE"/>
		<bm:field name="full_write_off_date" databaseType="DATE" datatype="java.util.Date" physicalName="FULL_WRITE_OFF_DATE" prompt="HLS_TAX_ACT_CONFIRM.FULL_WRITE_OFF_DATE"/>
		<bm:field name="period_name" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="PERIOD_NAME" prompt="HLS_TAX_ACT_CONFIRM.PERIOD_NAME"/>
		<bm:field name="tax_create_je_flag" databaseType="VARCHAR2" datatype="java.lang.String" physicalName="TAX_CREATE_JE_FLAG" prompt="HLS_TAX_ACT_CONFIRM.TAX_CREATE_JE_FLAG"/>
		<bm:field name="batch_je_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="BATCH_JE_ID" prompt="HLS_TAX_ACT_CONFIRM.BATCH_JE_ID"/>
		<bm:field name="contract_number" expression="(select cc.contract_number from  con_contract cc where cc.contract_id=t1.contract_id)"/>
		<bm:field name="cf_item_n" expression="(select ct.description from hls_cashflow_item ct where ct.cf_item=t1.cf_item)"/>
	</bm:fields>
	<bm:features>
		<f:standard-who/>
		<o:sequence-pk/>
	</bm:features>
	<bm:primary-key>
		<bm:pk-field name="act_id"/>
	</bm:primary-key>
	<bm:query-fields>
		<bm:query-field name="period_name" queryExpression="t1.period_name = ${@period_name}"/>
	</bm:query-fields>
	<bm:data-filters>
		<bm:data-filter name="period_name" enforceOperations="query" expression="t1.period_name =  ${@period_name}"/>
	</bm:data-filters>
	<bm:operations>
		<bm:operation name="update">
			<bm:update-sql><![CDATA[
            	begin
					hls_monthend_new_pkg.insert_tax_confirm_data(
									p_first_flag => ${@first_flag},
                                    p_period_name  => ${@period_name},
                                    p_calc_end_date   => to_date(${@calc_end_date},'yyyy-mm-dd'),
                                    p_user_id   => ${/session/@user_id}
                                   );
            	end;
            ]]></bm:update-sql>
		</bm:operation>
		<bm:operation name="execute">
			<bm:update-sql><![CDATA[
            	begin
					hls_monthend_new_pkg.refresh_tax_confirm_data(
                                    p_period_name  => ${@period_name},
                                    p_calc_end_date   => to_date(${@calc_end_date},'yyyy-mm-dd'),
                                    p_user_id   => ${/session/@user_id}
                                   );
            	end;
            ]]></bm:update-sql>
		</bm:operation>
	</bm:operations>
</bm:model>
