<?xml version="1.0" encoding="UTF-8"?>

<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:operations>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
                begin
                hlcm_op_asset_depre_pkg.dcs_no_import(
                p_header_id => ${@header_id},
                p_user_id => ${/session/@user_id}
                );
                end;
                ]]></bm:update-sql>
        </bm:operation>

        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT *
                FROM (SELECT ahd.depreciate_hd_id,
                ahd.BALANCE_SHEET_ACCOUNT_CDE,
                ahd.BALANCE_SHEET_ACCOUNT_DES,
                ahd.ASSET_TYPE,
                ahd.asset_number,
                ahd.asset_desc,
                to_char(ahd.ACQUISITION_COST_HIS, '9999999999999990.99') ACQUISITION_COST_HIS,
                to_char(ahd.CAPITALIZATION_DATE, 'yyyy-mm-dd') c_date,
                ahd.USEFUL_LIFE,
                ahd.REMAINING_USEFUL_LIFE,
                ahd.DEPRECIATION_TYPE,
                to_char(ahd.ACQUISITION_COST_START, '9999999999999990.99') ACQUISITION_COST_START,
                to_char(ahd.DEPRECIATE_SUM_START, '9999999999999990.99') DEPRECIATE_SUM_START,
                to_char(ahd.WRITE_UP_SUM_START, '9999999999999990.99') WRITE_UP_SUM_START,
                to_char(ahd.BOOK_VALUE_START, '9999999999999990.99') BOOK_VALUE_START,
                to_char(ahd.CAPITALIZATION, '9999999999999990.99') CAPITALIZATION,
                to_char(ahd.ACQUISITION_COST_SCRAP, '9999999999999990.99') ACQUISITION_COST_SCRAP,
                to_char(ahd.BOOK_VALUE_SCRAP, '9999999999999990.99') BOOK_VALUE_SCRAP,
                to_char(ahd.ACQUISITION_COST_TRANSFER, '9999999999999990.99') ACQUISITION_COST_TRANSFER,
                to_char(ahd.BOOK_VALUE_TRANSFER, '9999999999999990.99') BOOK_VALUE_TRANSFER,
                to_char(ahd.WRITE_UP_SUM, '9999999999999990.99') WRITE_UP_SUM,
                to_char(ahd.SIMPLE_DEPRECIATE_SUM, '9999999999999990.99') SIMPLE_DEPRECIATE,
                to_char(ahd.ACQUISITION_COST_END, '9999999999999990.99') ACQUISITION_COST_END,
                to_char(ahd.BOOK_VALUE_END, '9999999999999990.99') BOOK_VALUE_END,
                to_char(ahd.DEPRECIATE_SUM_TO_ENDDATE, '9999999999999990.99') DEPRECIATE_SUM_TO_ENDDATE,
                to_char(ahd.DEPRECIATE_SUM_END, '9999999999999990.99') DEPRECIATE_SUM_END,
                ahd.dts
                FROM asset_depreciate_hd ahd) t1
                where t1.asset_number = ${@asset_number}
                ORDER BY t1.depreciate_hd_id desc
                #WHERE_CLAUSE#
                ]]>
            </bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
