<?xml version="1.0" encoding="UTF-8"?>
<bm:model xmlns:bm="http://www.leaf-framework.org/schema/bm">
    <bm:fields>
        <bm:field name="period_name" datatype="java.lang.String" physicalName="PERIOD_NAME" prompt="CSH_TRANSACTION_HEADERS.PERIOD_NAME"/>
        <bm:field name="internal_period_num" datatype="java.lang.Long" physicalName="INTERNAL_PERIOD_NUM"/>
        <bm:field name="adjust_period_name" datatype="java.lang.String" physicalName="ADJUST_PERIOD_NAME" prompt="CSH_TRANSACTION_HEADERS.PERIOD_NAME"/>
        <bm:field name="adjust_internal_period_num" datatype="java.lang.Long" physicalName="ADJUST_INTERNAL_PERIOD_NUM"/>
    </bm:fields>
    <bm:operations>
        <bm:operation name="query">
            <bm:query-sql><![CDATA[
                SELECT
                    v.period_name,
                    v.adjust_period_name,
                    gld_common_pkg.get_gld_internal_period_num(NVL(${@company_id},${/session/@company_id}),v.period_name) internal_period_num,
                    gld_common_pkg.get_gld_internal_period_num(NVL(${@company_id},${/session/@company_id}),v.adjust_period_name) adjust_internal_period_num
                FROM
                    (SELECT
                        gld_common_pkg.get_gld_period_name(NVL(${@company_id},${/session/@company_id}),to_date(${@p_date},'yyyy-mm-dd')) period_name,
                        gld_common_pkg.get_gld_adjustment_period_name(NVL(${@company_id},${/session/@company_id}),to_date(${@p_date},'yyyy-mm-dd')) adjust_period_name
                    FROM
                        dual
                    ) v
            ]]></bm:query-sql>
        </bm:operation>
    </bm:operations>
</bm:model>
