<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" alias="gp" baseTable="GLD_PERIODS">
    <bm:fields>
        <bm:field name="period_set_code" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="period_year" databaseType="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="period_num" databaseType="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="period_name" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="adjustment_flag" databaseType="VARCHAR2" datatype="java.lang.String"/>
        <bm:field name="internal_period_num" databaseType="NUMBER" datatype="java.lang.Long"/>
        <bm:field name="start_date" databaseType="DATE" datatype="java.util.Date"/>
        <bm:field name="end_date" databaseType="DATE" datatype="java.util.Date"/>
        <bm:field name="quarter_num" databaseType="NUMBER" datatype="java.lang.Long"/>
    </bm:fields>
    <bm:primary-key>
        <bm:pk-field name="internal_period_num"/>
        <bm:pk-field name="period_set_code"/>
    </bm:primary-key>
    <bm:query-fields>
        <bm:query-field name="company_id" queryExpression="period_set_code=(select gd.period_set_code from gld_set_of_books gd,fnd_companies fc  where gd.set_of_books_id=fc.set_of_books_id and fc.company_id=${/session/@company_id})"/>
        <bm:query-field name="date" queryExpression="start_date &lt;= to_date(${@date},&apos;yyyy-mm-dd&apos;) and end_date&gt;= to_date(${@date},&apos;yyyy-mm-dd&apos;)"/>
    </bm:query-fields>
</bm:model>