fnd_sob_period_status.lview 10.9 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zjw  
    $Date: 2011-9-6 下午02:49:20  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure>
        <a:model-query fetchAll="true" model="fnd.FND2440.fnd_sob_period_sets" rootPath="fieldset"/>
    </a:init-procedure>
    <a:view>
        <a:link id="fnd_sob_period_status_err_link" url="${/request/@context_path}/modules/fnd/FND2440/fnd_sob_period_status_err.lview"/>
        <a:link id="fnd_sob_period_pkg_init_period_link" model="db.fnd_sob_period_pkg.init_period" modelaction="update"/>
        <a:link id="fnd_sob_period_pkg_close_link" model="db.fnd_sob_period_pkg.close_period" modelaction="update"/>
        <a:link id="fnd_sob_period_pkg_open_link" model="db.fnd_sob_period_pkg.open_period" modelaction="update"/>
        <a:link id="sys_service_welcome_link" url="${/request/@context_path}/welcome.lview"/>
        <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_open/update*/$('fnd_sob_period_pkg_open_link').getUrl();
                    return '<a href="javascript:execute(\'' + openurl + '\',\'' + record.get('period_set_code') + '\',\'' + record.get('period_name') + '\');">' + '${l:OPEN_PERIOD}' + '</a>';
                } else if (period_set_code == 'O') {
                    var closeurl = /*${/request/@context_path}/autocrud/fnd.fnd_sob_period_pkg_close/update*/$('fnd_sob_period_pkg_close_link').getUrl();
                    return '<a href="javascript:execute(\'' + closeurl + '\',\'' + record.get('period_set_code') + '\',\'' + record.get('period_name') + '\');">' + '${l:CLOSE_PERIOD}' + '</a>';
                }
            }
            
            function execute(ourl, rd1, rd2) {
                if ($('set_gld_period_status_o_query_ds').getAll().length == 0) {
                    Leaf.request({
                        url: /*${/request/@context_path}/autocrud/fnd.fnd_sob_period_pkg_init_period/update*/$('fnd_sob_period_pkg_init_period_link').getUrl(),
                        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();
                            });*/
                            doQuery();
                        },
                        scope: this
                    });
            
                } else {
                    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();
                            });*/
                            doQuery();
                        },
                        scope: this
                    });
            
                }
            }
            
            function doQuery() {
                $('set_gld_period_status_o_query_ds').setQueryParameter('period_set_code', '${/model/fieldset/record/@period_set_code}');
                $('set_gld_period_status_o_query_ds').query();
                $('set_gld_period_status_u_query_ds').setQueryParameter('period_set_code', '${/model/fieldset/record/@period_set_code}');
                $('set_gld_period_status_u_query_ds').query();
            }
            
            function errorLog() {
                window.open(/*fnd_sob_period_status_err.screen*/$('fnd_sob_period_status_err_link').getUrl());
            }]]></script>
        <a:dataSets>
            <a:dataSet id="set_gld_period_sets_ds">
                <a:datas dataSource="/model/fieldset"/>
                <a:fields>
                    <a:field name="period_set_code" prompt="GLD_PERIOD_SET.PERIOD_SET_CODE" readOnly="true"/>
                    <a:field name="total_period_num" prompt="GLD_PERIOD_SET.TOTAL_PERIOD_NUM" readOnly="true"/>
                    <a:field name="period_set_name" prompt="GLD_PERIOD_SET.PERIOD_SET_NAME" readOnly="true"/>
                    <a:field name="set_of_books_code" prompt="GLD_PERIOD_SET.PERIOD_SET_NAME" readOnly="true"/>
                    <a:field name="set_of_books_name" prompt="GLD_PERIOD_SET.PERIOD_SET_NAME" readOnly="true"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="set_gld_period_sets_query_ds" autoCreate="true">
                <a:fields>
                    <a:field name="period_set_code" defaultValue="${/model/fieldset/record/@period_set_code}"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="set_gld_period_status_o_query_ds" autoCount="true" autoQuery="true" model="fnd.FND2440.fnd_sob_period_status_o_query" pageSize="10" queryDataSet="set_gld_period_sets_query_ds">
                <a:fields>
                    <a:field name="adjustment_flag" checkedValue="Y" defaultValue="N" readOnly="true" uncheckedValue="N"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="set_gld_period_status_u_query_ds" autoCount="true" autoQuery="true" model="fnd.FND2440.fnd_sob_period_status_u_query" pageSize="10" queryDataSet="set_gld_period_sets_query_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:screenTopToolbar height="29">
                <a:button click="fnd_2440_back" height="20" icon="${/request/@context_path}/images/back.png" iconAlign="left" text="HLS.BACK" width="50"/>
                <a:separator style="margin-left:3px;"/>
                <a:button click="fnd_2440_next" height="20" icon="${/request/@context_path}/images/forward.png" iconAlign="left" text="HLS.FORWARD" width="50"/>
                <a:separator style="margin-left:3px;"/>
                <a:button click="fnd_2440_quit" height="20" icon="${/request/@context_path}/images/quit.png" iconAlign="left" text="HLS.EXIT" width="50"/>
                <a:separator style="margin-left:3px;"/>
                <a:button click="doQuery" height="20" icon="${/request/@context_path}/images/search.png" iconAlign="left" text="查询" width="50"/>
                <a:separator style="margin-left:3px;"/>
                <a:button click="errorLog" height="20" text="查看日志" width="50"/>
                <a:separator style="margin-left:3px;"/>
            </a:screenTopToolbar>
            <a:form id="gld_period_sets_ds_form" Title="FND_SET_BOOK_CONTROL.ACCOUNTING" column="1">
                <a:hBox>
                    <a:textField name="period_set_code" bindTarget="set_gld_period_sets_ds"/>
                    <a:textField name="period_set_name" bindTarget="set_gld_period_sets_ds"/>
                    <a:textField name="total_period_num" bindTarget="set_gld_period_sets_ds"/>
                </a:hBox>
                <a:hBox>
                    <a:textField name="set_of_books_code" bindTarget="set_gld_period_sets_ds" prompt="FND_SET_BOOK_CONTROL.BOOKCODE"/>
                    <a:textField name="set_of_books_name" bindTarget="set_gld_period_sets_ds" prompt="FND_SET_BOOK_CONTROL.BOOKNAME"/>
                </a:hBox>
            </a:form>
            <a:grid id="gld_period_status_u_query_ds_grid" bindTarget="set_gld_period_status_u_query_ds" height="220" marginWidth="20" navBar="true" width="1000">
                <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_close" prompt="GLD_PERIOD_STATUS.ADJUST"/>
                </a:columns>
                <a:editors>
                    <a:checkBox id="CheckBox_close"/>
                </a:editors>
            </a:grid>
            <a:grid id="gld_period_status_o_query_ds_grid" bindTarget="set_gld_period_status_o_query_ds" height="220" marginWidth="20" navBar="true" width="1000">
                <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_open" prompt="GLD_PERIOD_STATUS.ADJUST"/>
                </a:columns>
                <a:editors>
                    <a:checkBox id="CheckBox_open"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
        <script type="text/javascript"><![CDATA[
            
            ]]></script>
    </a:view>
</a:screen>