<?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 fv.COMPANY_ID, fv.COMPANY_CODE, fv.COMPANY_SHORT_NAME ,  COMPANY_CODE || ' - ' || COMPANY_SHORT_NAME as company_code_name     
            from fnd_companies_vl fv        
            where  (fv.end_date_active is null or sysdate between fv.start_date_active and fv.end_date_active)     
            and  (fv.SET_OF_BOOKS_ID = nvl(${/parameter/@set_of_books_id},fv.SET_OF_BOOKS_ID))     
            )    V      #WHERE_CLAUSE# 
            order by  v.COMPANY_CODE
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long" physicalName="COMPANY_ID"/>
        <bm:field name="company_code" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="234" forDisplay="true" forQuery="true" physicalName="COMPANY_CODE" prompt="COMPANY_CODE"/>
        <bm:field name="company_short_name" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="234" forDisplay="true" forQuery="true" physicalName="COMPANY_SHORT_NAME" prompt="FND_COMPANIES.COMPANY_SHORT_NAME"/>
        <bm:field name="company_code_name"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field name="company_code" queryExpression="company_code like ${@company_code}"/>
        <bm:query-field name="company_short_name" queryExpression="company_short_name like ${@company_short_name}"/>
    </bm:query-fields>
</bm:model>
