<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1">
    <bm:fields/>
    <bm:features>
        <f:standard-who/>
    </bm:features>
    <bm:fields>
        <bm:field name="batch_id"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
                begin
                 for cv in (select t.attribute_1,t.attribute_2,t.attribute_3,t.attribute_4,t.attribute_5,t.attribute_6 from fnd_interface_lines t where t.header_id = ${@batch_id} and t.line_number != 0)
			      loop
			        insert into con_contract_location(
			                    location_id,
			                    storage,
			                    chest_number,
			                    chest_floors,
			                    docu_number,
			                    docu_amount,
			                    note,
			                    created_by,
			                    creation_date,
			                    last_updated_by,
			                    last_update_date)
			                    values(
			                    con_contract_location_s.nextval,
			                    cv.attribute_1,
			                    cv.attribute_2,
			                    cv.attribute_3,
			                    cv.attribute_4,
			                    cv.attribute_5,
			                    cv.attribute_6,
			                    ${/session/@user_id},
			                    sysdate,
			                    ${/session/@user_id},
			                    sysdate);
			      end loop;
                end;
            ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
