<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: qwm  
    $Date: 2013-8-6 下午3:46:41  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[ select * from  (SELECT gp.period_year, gp.internal_period_num, gp.period_name,gp.period_num
  FROM GLD_PERIODS gp, GLD_PERIOD_STATUS gps
 WHERE gps.internal_period_num = gp.internal_period_num
 AND gps.period_set_code = gp.period_set_code
   and gp.period_set_code =
       (SELECT period_set_code
          FROM gld_set_of_books
         WHERE set_of_books_id = (SELECT set_of_books_id
                                    FROM fnd_companies
                                   WHERE company_id = ${/session/@company_id}))
 ORDER BY gp.period_year asc, gp.period_num asc) t
 #WHERE_CLAUSE#
	]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
    <bm:fields>
        <bm:field name="period_year" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="200" forQuery="true" fordisplay="true" prompt="GLD_PERIODS.PERIOD_YEAR" queryWidth="150"/>
        <bm:field name="internal_period_num" databaseType="BIGINT" datatype="java.lang.Long"/>
        <bm:field name="period_name" databaseType="VARCHAR2" datatype="java.lang.String" displayWidth="230" forQuery="true" fordisplay="true" prompt="GLD_PERIODS.PERIOD_NAME" queryWidth="150"/>
    </bm:fields>
    <bm:query-fields>
        <bm:query-field field="period_year" queryExpression="t.period_year like &apos;%&apos;||${@period_year}||&apos;%&apos;"/>
        <bm:query-field field="period_name" queryExpression="t.period_name like &apos;%&apos;||${@period_name}||&apos;%&apos;"/>
    </bm:query-fields>
</bm:model>
