<?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
                    (SELECT
                        pp.virtual_con_number,
                        v.contract_id,
                        cc.contract_number,
                        ccc.cf_item,
                        (SELECT
                            hci.description
                        FROM
                            hls_cashflow_item hci
                        WHERE
                            hci.cf_item      = ccc.cf_item AND
                            hci.enabled_flag = 'Y'
                        ) cf_item_n,
                        ccc.due_amount,
                        ccc.cashflow_id,
                        v.bp_id,
                        v.bp_name,
                        v.tax_registry_num bp_tax_registry_num
                    FROM
                        prj_project pp,
                        acr_invoice_billing_object_v v,
                        con_contract cc,
                        con_contract_cashflow ccc
                    WHERE
                        pp.project_id  = cc.project_id AND
                        cc.contract_id = v.contract_id AND
                        v.contract_id  = ccc.contract_id
                    ) t1 #WHERE_CLAUSE#
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
