fnd_sob_period_init.lview 5.07 KB
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zjw  
    $Date: 2011-9-8 上午10:41:12  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure><![CDATA[
      
    ]]></a:init-procedure>
    <a:view package="leaf.ui.std" template="default">
        <a:link id="fnd_sob_period_pkg_init_period_link_1" model="db.fnd_sob_period_pkg.init_period" modelaction="update"/>
        <div/>
        <script type="text/javascript"><![CDATA[
            
            
            function PeriodStatus(value, record, name) {
                if (Ext.isEmpty(value)) {
                    return '${l:PROMPT.NOT_OPEN}';
                } else if (value == 'O') {
                    return '${l:PROMPT.OPENED}';
                } else if (value == 'C') {
                    return '${l:PROMPT.CLOSED}';
                }
            }
            
            function OpenPeriod(value, record, name) {
                var period_set_code = record.get('period_status_code');
                var recordString = Ext.urlEncode(record.data);
                if (Ext.isEmpty(period_set_code) || period_set_code == 'C') {
                    var openurl = /*${/request/@context_path}/autocrud/fnd.fnd_sob_period_pkg_init_period/update*/$('fnd_sob_period_pkg_init_period_link_1').getUrl();
                    return '<a href="javascript:execute(\'' + openurl + '\',\'' + record.get('period_set_code') + '\',\'' + record.get('period_name') + '\');">' + '${l:OPEN_PERIOD}' + '</a>';
                }
            
            }
            
            function execute(ourl, rd1, rd2) {
             
                
                Leaf.request({
                    url: ourl,
                    para: {
                        'period_name': rd2,
                        'period_set_code': rd1
                    },
                    success: function() {
            
                        Leaf.showMessage('${l:PROMPT}', '${l:FND_DIMENSION_VALUES.OPR_SUC}', function(cmp) {
                            document.location.reload();
                             
                           cmp.close();
                        });
                    },
                    scope: this
                });
            
            }
            
            function reset() {
                $('list_ds').reset();
            }
            
            function query() {
                $('set_gld_period_init_period_ds').query();
            }]]></script>
        <a:dataSets>
            <a:dataSet id="set_period_set_list_ds" autoQuery="true" fetchAll="true" model="fnd.FND2440.fnd_sob_period_set_list"/>
            <a:dataSet id="list_ds">
                <a:fields>
                    <a:field name="period_set" displayField="period_set_name" options="set_period_set_list_ds" returnField="period_set_code" valueField="period_set_code"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="set_gld_period_init_period_ds" autoQuery="false" model="fnd.FND2440.fnd_sob_period_init_period" pageSize="10" queryDataSet="list_ds">
                <a:fields>
                    <a:field name="adjustment_flag" checkedValue="Y" defaultValue="N" readOnly="true" uncheckedValue="N"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:form id="set_period_set_list_ds_form" column="1" title="THE_ACCOUNTING_PERIOD" width="500">
                <a:hBox>
                    <a:comboBox name="period_set" bindTarget="list_ds" prompt="GLD_PERIOD_STATUS.TITLE"/>
                    <a:textField name="period_name" bindTarget="list_ds" prompt="GLD_PERIODS.PERIOD_NAME"/>
                </a:hBox>
            </a:form>
            <a:hBox>
                <a:button click="query" text="PROMPT.QUERY"/>
                <a:button click="reset" text="PROMPT.RESET"/>
            </a:hBox>
            <a:grid id="set_gld_period_init_period_ds_grid" bindTarget="set_gld_period_init_period_ds" height="330" navBar="true" width="900">
                <a:columns>
                    <a:column name="period_year" prompt="GLD_PERIODS.PERIOD_YEAR"/>
                    <a:column name="period_num" prompt="FND_DIMENSIONS.DIMENSION_SEQUENCE"/>
                    <a:column name="start_date_c" prompt="GLD_EXCHANGE_RATE.START_DATE"/>
                    <a:column name="end_date_c" prompt="GLD_EXCHANGE_RATE.END_DATE"/>
                    <a:column name="quarter_num" prompt="GLD_PERIOD_STATUS.QUARTER"/>
                    <a:column name="period_name" prompt="GLD_PERIODS.PERIOD_NAME"/>
                    <a:column name="period_status_code" prompt="GLD_PERIOD_STATUS.PERIOD_STATUS" renderer="PeriodStatus"/>
                    <a:column name="OpenPeriod" prompt="GLD_PERIOD_STATUS.ADJUST_PERIOD" renderer="OpenPeriod"/>
                    <a:column name="adjustment_flag" Align="left" editor="CheckBox" prompt="GLD_PERIOD_STATUS.ADJUST"/>
                </a:columns>
                <a:editors>
                    <a:checkBox id="CheckBox"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>