gld_journal_entry.lview 19.2 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 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang  
    $Date: 2013-12-3 上午11:18:39  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure>
        <a:model-query defaultWhereClause="t1.document_category = &apos;JE&apos;" fetchAll="true" model="basic.hls_document_type_for_lov" queryOrderBy="document_type desc" rootPath="hls_document_type_path"/>
    </a:init-procedure>
    <a:view>
        <a:link id="welcome_link_id" url="${/request/@context_path}/welcome.lview"/>
        <a:link id="hls_journal_con_contract_update_link_id" url="${/request/@context_path}/modules/cont/CON500/con_contract_update.lview"/>
        <a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="hls_journal_submit_link" model="hls.HLS301.hls_journal_submit" modelaction="batch_update"/>
        <a:link id="hls_journal_reject_to_gld_link" model="hls.HLS301.hls_journal_reject" modelaction="batch_update"/>
        <a:link id="hls_journal_delete_to_gld_link" model="hls.HLS301.hls_journal_delete" modelaction="delete"/>
        <a:screen-include screen="modules/hls/hls_common_javascript.lview"/>
        <script type="text/javascript"><![CDATA[
            //查询按钮
            
            function hls301_journal_query() {
                $('hls_journal_header_result_ds').query();
            }
            //重置按钮
            
            function hls301_journal_reset() {
                $('hls_journal_header_query').reset();
            }
            //退出按钮
            
            function hls301_journal_exit() {
                location.href = $('welcome_link_id').getUrl();
                parent.shMenu('show');
            }
            
            function construct_from_to() {
                var config = ['responsibility_center_code', 'responsibility_center_name', 'account_code', 'account_name'];
                var pattern = ['_from', '_to'];
                var obj = {};
                for (var i = 0,
                    j = config.length;i < j;i++) {
                    for (var m = 0,
                        n = pattern.length;m < n;m++) {
                        obj[config[i] + pattern[m]] = config[i] + pattern[n - 1 - m];
                    }
                }
                return obj;
            }
            
            function onUpdate_para_journalQueryDs(ds, record, name, value, oldvalue) {
                var from_to = construct_from_to();
                var opposite_name = from_to[name];
                if (!Ext.isEmpty(opposite_name)) {
                    var opposite_value = record.get(opposite_name);
                    if (!Ext.isEmpty(value) && Ext.isEmpty(opposite_value)) {
                        record.set(opposite_name, value);
                    }
                }
            
            }
            
            function hls301_link_dynamic(reocrd_id, journal_header_id) {
            
                var maintain_type = 'UPDATE';
                var record = $('hls_journal_header_result_ds').findById(reocrd_id);
                var param = record.data;
                param['function_code'] = 'GLD530';
                param['document_id'] = journal_header_id;
                param['document_category'] = 'JE';
                param['function_usage'] = 'MODIFY';
                param['maintain_type'] = maintain_type;
                param['url_title'] = '${l:HLS530.JOURNAL_LINE_QUERY}';
                hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'hls_journal_con_contract_update_link_id', 'hls_journal_header_result_ds');
            }
            
            function hls301_journal_num_render(value, record, name) {
                return '<a href="javascript:hls301_link_dynamic(' + record.id + ',' + record.get('journal_header_id') + ');">' + value + '</a>';
            }
            
            function on_loan_journal_header_query(ds, qpara) {
                qpara['status_list_flag'] = 'Y';
                qpara['gld_flag'] = 'Y';
            }
            
            function journal_submit(datas) {
                Leaf.request({
                    url: $('hls_journal_submit_link').getUrl(),
                    para: datas,
                    success: function(res) {
                        f_hls.winNoMask();
                        Leaf.SideBar.show({
                            msg: '${l:HLS.SUBMIT_SUCCESS}',
                            duration: 2000
                        });
                        $('hls_journal_header_result_ds').query();
                    },
                    failure: function() {
                        f_hls.winNoMask();
                    },
                    error: function() {
                        f_hls.winNoMask();
                    },
                    scope: this
                });
            }
            
            function hls301_journal_submit() {
                f_hls.winMask();
                var ds = $('hls_journal_header_result_ds');
                var records = ds.getSelected();
                if (records.length == 0) {
                    f_hls.winNoMask();
                    return;
                }
                var datas = [];
                for (var i = 0;i < records.length;i++) {
                    var obj = {};
                    obj['journal_header_id'] = records[i].get('journal_header_id');
                    obj['_status'] = 'execute';
                    datas[i] = obj;
                }
                journal_submit(datas);
            }
            
            function journal_submit_reject(datas) {
                Leaf.request({
                    url: $('hls_journal_reject_to_gld_link').getUrl(),
                    para: datas,
                    success: function(res) {
                        f_hls.winNoMask();
                        Leaf.SideBar.show({
                            msg: '${l:HLS.SUBMIT_SUCCESS}',
                            duration: 2000
                        });
                        $('hls_journal_header_result_ds').query();
                    },
                    failure: function() {
                        f_hls.winNoMask();
                    },
                    error: function() {
                        f_hls.winNoMask();
                    },
                    scope: this
                });
            }
            
            function hls301_journal_reject() {
                f_hls.winMask();
                var ds = $('hls_journal_header_result_ds');
                var records = ds.getSelected();
                if (records.length == 0) {
                    f_hls.winNoMask();
                    return;
                }
                var datas = [];
                for (var i = 0;i < records.length;i++) {
                    var obj = {};
                    obj['journal_header_id'] = records[i].get('journal_header_id');
                    obj['_status'] = 'execute';
                    datas[i] = obj;
                }
                journal_submit_reject(datas);
            }
            
            function hls301_journal_create() {
                var param = new Object();
                param['function_code'] = 'GLD530';
                param['function_usage'] = 'CREATE';
                param['document_category'] = 'JE';
                param['company_id'] = '${/session/@top_biz_company_id}';
            
            
                param['url_title'] = '${l:HLS530.JOURNAL_LINE_QUERY}';
                hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'hls_journal_con_contract_update_link_id', 'hls_journal_header_result_ds');
            }
            
            function hls301_journal_delete() {
                f_hls.winMask(null, '${l:HLS.DELETING}');
                var result_ds = $('hls_journal_header_result_ds');
                var records = result_ds.getSelected();
                if (records.length != 1) {
                    f_hls.winNoMask();
                    Leaf.showMessage('${l:HLS.PROMPT}', '${l:HLS.SELECT_RECORD}');
                    return;
                }
                var record = records[0];
                var ajax_flag = 'N';
                var confirm_win = Leaf.showConfirm('${l:HLS.PROMPT}', '${l:HLS.DELETE_CONFIRM}', function() {
                    ajax_flag = 'Y';
                    Leaf.request({
                        url: $('hls_journal_delete_to_gld_link').getUrl(),
                        para: {
                            journal_header_id: record.get('journal_header_id')
                        },
                        success: function(res) {
                            f_hls.winNoMask();
                            result_ds.query(result_ds.currentPage);
                        },
                        failure: function() {
                            f_hls.winNoMask();
                        },
                        error: function() {
                            f_hls.winNoMask();
                        },
                        scope: this
                    });
                }, function() {
                    f_hls.winNoMask();
                });
                confirm_win.on('close', function() {
                    if (ajax_flag == 'N') {
                        f_hls.winNoMask();
                    }
                });
            }
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
        <a:dataSets>
            <a:dataSet id="hls_document_type_ds">
                <a:datas dataSource="/model/hls_document_type_path"/>
            </a:dataSet>
            <a:dataSet id="post_gl_status_ds" lookupCode="SUBSYSTEM_POST_GL_FLAG"/>
            <a:dataSet id="hls_journal_header_query">
                <a:fields>
                    <a:field name="journal_num"/>
                    <a:field name="category_code_desc" displayField="description" options="hls_document_type_ds" returnField="category_code" valueField="document_type"/>
                    <a:field name="journal_date_from"/>
                    <a:field name="journal_date_to"/>
                    <a:field name="total_amount_dr_from"/>
                    <a:field name="total_amount_dr_to"/>
                    <a:field name="period_name"/>
                    <a:field name="external_journal_num"/>
                    <a:field name="bp_id_tenant"/>
                    <a:field name="bp_id_tenant_desc" lovGridHeight="350" lovHeight="550" lovService="basic.hls_bp_master_v_for_lov?bp_category=TENANT" lovWidth="500">
                        <a:mapping>
                            <a:map from="bp_name" to="bp_id_tenant_desc"/>
                            <a:map from="bp_id" to="bp_id_tenant"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="source_table"/>
                    <a:field name="reference1"/>
                    <a:field name="je_transaction_code"/>
                    <a:field name="je_transaction_desc" lovGridHeight="420" lovHeight="550" lovPageSize="20" lovService="gld.GLD104.gld_je_transaction_for_lov" lovWidth="500">
                        <a:mapping>
                            <a:map from="je_transaction_code" to="je_transaction_code"/>
                            <a:map from="je_transaction_desc" to="je_transaction_desc"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="post_gl_status"/>
                    <a:field name="post_gl_status_desc" displayField="code_value_name" options="post_gl_status_ds" returnField="post_gl_status" valueField="code_value"/>
                    <a:field name="responsibility_center_name_from" lovHeight="500" lovLabelWidth="100" lovService="fnd.FND2110.fnd_responsibility_centers_lov" lovWidth="550" title="HLS.RESPONSIBILITY_CENTER_NAME">
                        <a:mapping>
                            <a:map from="responsibility_center_id" to="responsibility_center_id"/>
                            <a:map from="responsibility_center_code" to="responsibility_center_code_from"/>
                            <a:map from="responsibility_center_name" to="responsibility_center_name_from"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="responsibility_center_name_to" lovHeight="500" lovLabelWidth="100" lovService="fnd.FND2110.fnd_responsibility_centers_lov" lovWidth="550" title="HLS.RESPONSIBILITY_CENTER_NAME">
                        <a:mapping>
                            <a:map from="responsibility_center_code" to="responsibility_center_code_to"/>
                            <a:map from="responsibility_center_name" to="responsibility_center_name_to"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="account_code_from" autoComplete="true" lovHeight="500" lovLabelWidth="100" lovService="hls.HLS301.hls_journal_account_for_lov" lovWidth="500" title="HLS530.ACCOUNT_NAME">
                        <a:mapping>
                            <a:map from="account_code" to="account_code_from"/>
                            <a:map from="description" to="account_name_from"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="account_code_to" autoComplete="true" lovHeight="600" lovLabelWidth="100" lovUrl="${/request/@context_path}/modules/hls/HLS530/gld_company_account_tree.lview" lovWidth="550" title="HLS530.ACCOUNT_NAME">
                        <a:mapping>
                            <a:map from="account_code" to="account_code_to"/>
                            <a:map from="description" to="account_name_to"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="company_short_name" lovHeight="500" lovLabelWidth="100" lovService="fnd.fnd_companies_lov" lovWidth="550" title="HLS530.JOURNAL_COMPANY">
                        <a:mapping>
                            <a:map from="company_id" to="je_company_id"/>
                            <a:map from="company_short_name" to="company_short_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="currency_code" lovHeight="500" lovLabelWidth="100" lovService="basic.gld_currency_v_lov" lovWidth="550">
                        <a:mapping>
                            <a:map from="currency_code" to="currency_code"/>
                            <a:map from="currency_name" to="currency_name"/>
                        </a:mapping>
                    </a:field>
                </a:fields>
                <a:events>
                    <a:event name="update" handler="onUpdate_para_journalQueryDs"/>
                </a:events>
            </a:dataSet>
            <a:dataSet id="hls_journal_header_result_ds" autoPageSize="true" autoQuery="true" model="hls.HLS301.hls_journal_header_v" queryDataSet="hls_journal_header_query" selectable="true">
                <a:events>
                    <a:event name="query" handler="on_loan_journal_header_query"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:toolbarButton click="hls301_journal_exit" text="HLS.EXIT"/>
                <a:toolbarButton click="hls301_journal_reset" text="HLS.RESET"/>
                <a:toolbarButton click="hls301_journal_query" text="HLS.QUERY"/>
                <a:toolbarButton click="hls301_journal_delete" text="HLS.DELETE_JE"/>
                <a:toolbarButton click="hls301_journal_submit" text="HLS.SUBMIT_TO_AUDIT"/>
                <!-- <a:toolbarButton click="hls301_journal_reject" text="拒绝"/> -->
                <a:toolbarButton click="hls301_journal_create" text="HLS.CREATE_JE"/>
            </a:screenTopToolbar>
            <a:form column="5" labelSeparator=" " labelWidth="100" marginWidth="30" title="HAP_QUERY_TITLE">
                <a:lov name="account_code_from" bindTarget="hls_journal_header_query" prompt="HLS530.ACCOUNT_NAME_FROM"/>
                <a:lov name="account_code_to" bindTarget="hls_journal_header_query" prompt="HLS530.ACCOUNT_NAME_TO"/>
                <a:lov name="responsibility_center_name_from" bindTarget="hls_journal_header_query" prompt="HLS530.RESPONSIBILITY_CENTER_NAME_FROM"/>
                <a:lov name="responsibility_center_name_to" bindTarget="hls_journal_header_query" prompt="HLS530.RESPONSIBILITY_CENTER_NAME_TO"/>
                <a:lov name="company_short_name" bindTarget="hls_journal_header_query" prompt="HLS530.JOURNAL_COMPANY"/>
                <a:datePicker name="journal_date_from" bindTarget="hls_journal_header_query" prompt="HLS530.JOURNAL_DATE_FROM"/>
                <a:datePicker name="journal_date_to" bindTarget="hls_journal_header_query" prompt="HLS530.JOURNAL_DATE_TO"/>
                <a:numberField name="total_amount_dr_from" allowFormat="true" bindTarget="hls_journal_header_query" prompt="HLS530.TOTAL_AMOUNT_DR_FROM"/>
                <a:numberField name="total_amount_dr_to" allowFormat="true" bindTarget="hls_journal_header_query" prompt="HLS530.TOTAL_AMOUNT_DR_TO"/>
                <a:textField name="journal_num" bindTarget="hls_journal_header_query" prompt="HLS530.JOURNAL_NUM"/>
                <a:textField name="project_name" bindTarget="hls_journal_header_query" prompt="HLS.PROJECT_NAME"/>
                <a:lov name="je_transaction_desc" bindTarget="hls_journal_header_query" prompt="HLS530.JE_TRANSACTION"/>
                <a:lov name="currency_code" bindTarget="hls_journal_header_query" prompt="HLS.CURRENCY"/>
                <a:lov name="bp_id_tenant_desc" bindTarget="hls_journal_header_query" prompt="HLS.TENANT_CODE"/>
                <!-- <a:textField name="external_journal_num" bindTarget="hls_journal_header_query" prompt="HLS530.EXTERNAL_JOURNAL_NUM"/> -->
                <!-- <a:textField name="reference1" bindTarget="hls_journal_header_query" prompt="HLS530.REFERENCE1"/> -->
            </a:form>
            <a:grid id="hls_journal_headers_grid" bindTarget="hls_journal_header_result_ds" marginHeight="230" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="journal_num" lock="true" prompt="HLS530.JOURNAL_NUM" renderer="hls301_journal_num_render" width="120"/>
                    <a:column name="js_company_short_name" prompt="HLS530.JOURNAL_COMPANY" width="90"/>
                    <a:column name="period_name" align="center" prompt="HLS530.PERIOD_NAME" width="80"/>
                    <a:column name="journal_date" align="center" prompt="HLS530.JOURNAL_DATE" renderer="Leaf.formatDate" width="90"/>
                    <a:column name="total_amount_dr" align="right" prompt="HLS530.TOTAL_AMOUNT_DR" renderer="Leaf.formatMoney" width="120"/>
                    <a:column name="currency_desc" align="center" prompt="HLS.CURRENCY" width="80"/>
                    <a:column name="total_amount_fuc_dr" align="right" prompt="HLS530.TOTAL_AMOUNT_FUC_DR" renderer="Leaf.formatMoney" width="120"/>
                    <a:column name="je_transaction_desc" prompt="HLS530.JE_TRANSACTION" width="150"/>
                    <a:column name="status_desc" align="center" prompt="HLS.STATUS" width="100"/>
                    <a:column name="description" prompt="HLS530.JOURNAL_DESCRIPTION" width="220"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>