<?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 cpy.company_id,
               cpy.company_code,
               company_short_name company_desc,
               cpy.company_code || '-' || company_short_name code_desc
          from fnd_companies cpy
         where cpy.parent_company_id = ${/session/@company_id}
            or cpy.company_id = ${/session/@company_id}) v 
				#WHERE_CLAUSE# 
				order by v.company_code
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="company_code" forDisplay="true" forQuery="true" prompt="COMPANY_CODE"/>
        <bm:field name="company_desc" forDisplay="true" forQuery="true" prompt="FND_COMPANIES.COMPANY_NAME"/>
        <bm:field name="company_id"/>
        <bm:field name="code_desc"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field field="company_code" queryOperator="like"/>
        <bm:query-field field="company_desc" queryOperator="like"/>
    </bm:query-fields>
</bm:model>
