<?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="query">
            <bm:query-sql><![CDATA[
                SELECT *
                FROM (SELECT li.attribute_1,
                li.attribute_2,
                li.attribute_3,
                li.attribute_4,
                li.attribute_5,
                li.attribute_6,
                li.attribute_7,
                li.attribute_8,
                li.attribute_9,
                li.attribute_10,
                li.attribute_11,
                li.attribute_12,
                li.attribute_13,
                li.attribute_14,
                li.attribute_15,
                li.attribute_16,
                li.attribute_17,
                li.attribute_18,
                li.attribute_19,
                li.attribute_20,
                li.attribute_21,
                li.attribute_22,
                li.attribute_23,
                li.attribute_24,
                li.attribute_25,
                li.line_id,
                li.error_message,
                li.header_id
                FROM fnd_interface_lines li, fnd_interface_headers hd
                WHERE hd.header_id = li.header_id
                AND hd.template_code = 'depreciation'
                AND HD.CREATED_BY = ${/session/@user_id}
                AND li.line_number > 0
                AND li.header_id =
                (SELECT MAX(li.header_id)
                FROM fnd_interface_lines li, fnd_interface_headers hd
                WHERE li.header_id = hd.header_id
                AND hd.template_code = 'depreciation'
                AND HD.CREATED_BY = ${/session/@user_id})) t1
                ORDER BY t1.line_id ASC
                #WHERE_CLAUSE#
                ]]>
            </bm:query-sql>
        </bm:operation>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
                begin
                hlcm_op_asset_depre_pkg.dcs_check(
                p_header_id => ${/model/header/record/@header_id},
                p_user_id => ${/session/@user_id}
                );
                end;
                ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>


</bm:model>
