<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT * FROM con_collection_v t1 #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
        <bm:operation name="update">
            <bm:update-sql><![CDATA[
            BEGIN
                -- Call the procedure
                con_persons_district_area_pkg.update_collection_hand(p_col_id => ${@col_id}, p_staff_id => ${@staff_id}, p_user_id => ${/session/@user_id});
            END;
        ]]></bm:update-sql>
        </bm:operation>
    </bm:operations>
    <bm:query-fields>
        <bm:query-field name="contract_number" queryExpression="t1.contract_number like  &apos;%&apos; || ${@contract_number} || &apos;%&apos;"/>
        <bm:query-field name="project_number" queryExpression="t1.project_number like  &apos;%&apos; || ${@project_number} || &apos;%&apos;"/>
        <bm:query-field name="bp_name" queryExpression="t1.bp_name like  &apos;%&apos; || ${@bp_name} || &apos;%&apos;"/>
        <bm:query-field name="bp_phone" queryExpression="t1.bp_phone like  &apos;%&apos; || ${@bp_phone} || &apos;%&apos;"/>
        <bm:query-field name="license_number" queryExpression="t1.license_number like  &apos;%&apos; || ${@license_number} || &apos;%&apos;"/>
        <bm:query-field name="staff_id" queryExpression="t1.staff_id = ${@staff_id}"/>
        <bm:query-field name="overdue_status" queryExpression="t1.overdue_status = ${@overdue_status}"/>
        <bm:query-field name="province" queryExpression="t1.province like  &apos;%&apos; || ${@province} || &apos;%&apos;"/>
        <bm:query-field name="creation_date" queryExpression="t1.creation_date = to_date(${@creation_date},&apos;yyyy-mm-dd&apos;)"/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter enforceOperations="query" expression="t1.data_class =&apos;NORMAL&apos;"/>
    </bm:data-filters>
</bm:model>
