<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:ns2="leaf.database.local.oracle" xmlns:bm="http://www.leaf-framework.org/schema/bm" xmlns:f="leaf.database.features" alias="t1" extend="fnd.fnd_companies" extendMode="reference">
    <bm:fields>
        <bm:field name="company_id" databaseType="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="company_code" databaseType="VARCHAR" datatype="java.lang.String" displayWidth="150" forQuery="true" fordisplay="true" prompt="COMPANY_CODE" queryWidth="150"/>
        <bm:field name="company_short_name" databaseType="VARCHAR" datatype="java.lang.String" displayWidth="150" forInsert="false" forUpdate="false" fordisplay="true" prompt="FND_COMPANIES.COMPANY_SHORT_NAME"/>
        <bm:field name="company_full_name" databaseType="VARCHAR" datatype="java.lang.String" forInsert="false" forUpdate="false" prompt="FND_COMPANIES.COMPANY_FULL_NAME"/>
        <bm:field name="set_of_books_id" databaseType="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="address" databaseType="VARCHAR" datatype="java.lang.String" prompt="FND_COMPANIES.ADDRESS"/>
        <bm:field name="start_date_active" databaseType="DATE" datatype="java.sql.Date" forUpdate="true" prompt="HAP_START_DATE"/>
        <bm:field name="end_date_active" databaseType="DATE" datatype="java.sql.Date" forUpdate="true" prompt="HAP_END_DATE"/>
        <bm:field name="set_of_books_name" expression="(select set_of_books_name from gld_set_of_books_vl gl where gl.set_of_books_id=t1.set_of_books_id)" fordisplay="true"/>
    </bm:fields>
    <bm:primary-key>
        <bm:pk-field name="company_id"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field field="company_id" queryOperator="="/>
        <bm:query-field field="company_code" queryOperator="like"/>
        <bm:query-field field="set_of_books_id" queryOperator="="/>
        <bm:query-field name="company_short_name" queryOperator="like"/>
    </bm:query-fields>
    <bm:features>
        <ns2:sequence-pk/>
        <f:standard-who/>
        <f:multi-language-storage/>
    </bm:features>
    <bm:ref-fields/>
    <bm:data-filters>
        <bm:data-filter name="set_of_books_id" enforceOperations="query" expression="t1.set_of_books_id=(         select set_of_books_id from fnd_companies fcc         where fcc.company_id=${/session/@company_id}         )"/>
        <bm:data-filter name="start_date" enforceOperations="query" expression="t1.start_date_active &lt;sysdate"/>
        <bm:data-filter name="start_date" enforceOperations="query" expression="(t1.end_date_active is null or  t1.end_date_active  &gt;sysdate)"/>
    </bm:data-filters>
</bm:model>
