<?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="fc" extend="fnd.fnd_companies" extendMode="reference">
    <bm:fields>
        <bm:field name="company_id"/>
        <bm:field name="company_code"/>
        <bm:field name="set_of_books_id"/>
        <bm:field name="company_short_name" forInsert="false" forUpdate="false" prompt="FND_COMPANIES.COMPANY_SHORT_NAME"/>
        <bm:field name="set_of_books_name" databaseType="VARCHAR" datatype="java.lang.String" expression="(select gsv.SET_OF_BOOKS_CODE||&apos;-&apos;||gsv.SET_OF_BOOKS_NAME from gld_set_of_books_vl gsv where gsv.SET_OF_BOOKS_ID=fc.set_of_books_id)" forInsert="false" forUpdate="false" prompt="FND_COMPANIES.SET_OF_BOOKS"/>
    </bm:fields>
    <bm:primary-key>
        <bm:pk-field name="company_id"/>
    </bm:primary-key>
    <bm:relations>
        <bm:relation name="gs" joinType="INNER" refModel="gld.gld_set_of_books">
            <bm:reference foreignField="set_of_books_id" localField="set_of_books_id"/>
        </bm:relation>
    </bm:relations>
    <bm:query-fields>
        <bm:query-field field="company_code" queryOperator="="/>
        <bm:query-field field="company_short_name" queryOperator="like"/>
        <bm:query-field name="set_of_books_id" queryExpression="fc.set_of_books_id = ${@set_of_books_id}"/>
        <bm:query-field field="company_id" queryOperator="="/>
    </bm:query-fields>
    <bm:data-filters>
        <bm:data-filter name="company_type" enforceOperations="query" expression="fc.company_type=2"/>
        <bm:data-filter name="enabled_flag" enforceOperations="query" expression="gs.enabled_flag=&apos;Y&apos;"/>
        <bm:data-filter name="sysdate" enforceOperations="query" expression="((sysdate between fc.start_date_active and fc.end_date_active) or fc.end_date_active is null)"/>
    </bm:data-filters>
    <bm:features>
        <ns2:sequence-pk/>
        <f:standard-who/>
        <f:multi-language-display/>
    </bm:features>
    <bm:ref-fields>
        <bm:ref-field name="set_of_books_code" relationName="gs" sourceField="set_of_books_code"/>
    </bm:ref-fields>
</bm:model>
