<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hp  
    $Date: 2013-9-3 下午02:06:17  
    $Revision: 1.0  
    $Purpose: 
-->
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm" needAccessControl="false">
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
            select v.period_name,v.PERIOD_YEAR,v.PERIOD_NUM
          from gld_period_status_v v
         where to_date(${@journal_date},'yyyy-mm-dd') 
         between v.start_date and v.end_date           
           and v.period_set_code =
               (select b.period_set_code
                  from gld_set_of_books b
                 where b.set_of_books_id =
                       (select f.set_of_books_id
                          from fnd_companies f
                         where f.company_id = ${/session/@company_id}))
           and v.company_id = ${/session/@company_id}
           and v.period_status_code = 'O'           
           ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
