csh_write_off_interface.lview 71.6 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2 3 4 5 6 7 8
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure>
        <a:model-query fetchAll="true" model="basic.get_sys_default_time" rootPath="sys_default_time"/>
        <a:model-query fetchAll="true" model="csh.CSH531N.csh_transaction" rootPath="csh_transaction_path"/>
    </a:init-procedure>
    <a:view>
        <a:link id="csh531n_csh_confirm_data_link" model="csh.CSH531N.csh_data_confirm" modelaction="update"/>
Darming's avatar
Darming committed
9
        <a:link id="csh531n_submit_link_id" model="csh.CSH531N.csh_data_confirm" modelaction="execute"/>
Spencer Chang's avatar
Spencer Chang committed
10
        <a:link id="transaction_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/>
高泉铭's avatar
高泉铭 committed
11
        <a:link id="transaction_downloadFile_id" url="${/request/@context_path}/downloadFile.lview"/>
12
        <a:link id="csh531n_submit_interface_link_id" model="csh.CSH531N.csh_write_off_interface" modelaction="batch_update"/>
Spencer Chang's avatar
Spencer Chang committed
13 14
        <script src="${/request/@context_path}/javascripts/calculate.js" type="text/javascript"/>
        <script type="text/javascript"><![CDATA[
15

Spencer Chang's avatar
Spencer Chang committed
16 17 18 19 20 21 22 23 24 25 26 27 28
        function csh531n_detail_win_close() {
            $('${/parameter/@winid}').close();
        }

        function csh531d_lock_current_window() {
            Leaf.Masker.mask($('${/parameter/@winid}').wrap, '${l:HLS.EXECUTING}');
        }

        function csh531d_unlock_current_window() {
            Leaf.Masker.unmask($('${/parameter/@winid}').wrap);
        }

        function init() {
Darming's avatar
Darming committed
29

高泉铭's avatar
高泉铭 committed
30

niminmin's avatar
niminmin committed
31
            if ('${/parameter/@collection_classes}' == 'COMBINED' && '${/parameter/@transaction_type}' !== 'DEPOSIT') {
高泉铭's avatar
高泉铭 committed
32
                document.getElementById('write_off_deposit').style.display = 'block';
18083's avatar
18083 committed
33
				document.getElementById('write_off_operat').style.display = 'block';
高泉铭's avatar
高泉铭 committed
34
            }
Darming's avatar
Darming committed
35 36 37
            if ('${/parameter/@advanceDisplayFlag}' == 'Y') {
                document.getElementById('write_off_advance').style.display = 'block';
            }
Darming's avatar
Darming committed
38

高泉铭's avatar
高泉铭 committed
39
            if ('${/parameter/@readOnly}' == 'Y') {
Spencer Chang's avatar
Spencer Chang committed
40 41
                $('csh_grid_add_bt').setVisible(false);
                $('csh_grid_delete_bt').setVisible(false);
42
				$('csh_grid_deposit_add_bt').setVisible(false);
niminmin's avatar
niminmin committed
43
                $('csh_grid_deposit_delete_bt').setVisible(false);
18083's avatar
18083 committed
44 45
				$('csh_grid_operat_add_bt').setVisible(false);
                $('csh_grid_operat_delete_bt').setVisible(false);
Spencer Chang's avatar
Spencer Chang committed
46 47 48
                $('csh_write_off_grid').hideColumn('left_amount');
                $('csh_write_off_grid').hideColumn('left_principal');
                $('csh_write_off_grid').hideColumn('left_interest');
高泉铭's avatar
高泉铭 committed
49
                $('csh_write_off_grid').hideColumn('unreceived_amount');
Darming's avatar
Darming committed
50
                if ('${/parameter/@interfaceQueryFlag}' == 'N') {
51
                    $('csh_write_off_interface_ds').setQueryUrl('${/request/@context_path}/autocrud/csh.CSH531N.csh_write_off/query?transaction_id=${/parameter/@transaction_id}&transaction_date=${/parameter/@transaction_date}');
Darming's avatar
Darming committed
52 53
                    $('csh_write_off_interface_ds').query();
                }
Darming's avatar
Darming committed
54 55 56
                if ('${/parameter/@approval_flag}' == 'Y') {
                    $('csh531n_write_off_btn_id').setVisible(true);
                    $('csh531n_write_off_return_btn_id').setVisible(true);
Darming's avatar
Darming committed
57
                }
Darming's avatar
Darming committed
58 59 60
            } else {
                // $('csh511_save_all_id').setVisible(true);
                $('csh531n_write_off_submit_btn_id').setVisible(true);
Spencer Chang's avatar
Spencer Chang committed
61
            }
高泉铭's avatar
高泉铭 committed
62

Spencer Chang's avatar
Spencer Chang committed
63 64 65 66 67 68 69 70 71 72
        }

        // function csh_write_off_add(){
        //     var record = $('csh_write_off_interface_ds').create();
        //     record.set('csh_bank_slip_num','${/parameter/@csh_bank_slip_num}');
        //     $('csh_write_off_grid').showEditorByRecord(record);
        // }

        function csh_edit_function(record, name) {
            var batch_status = '${/parameter/@batch_status}';
高泉铭's avatar
高泉铭 committed
73
            var readOnly = '${/parameter/@readOnly}';
Spencer Chang's avatar
Spencer Chang committed
74
            var write_off_type = record.get('write_off_type');
高泉铭's avatar
高泉铭 committed
75
            if (batch_status == 'SUBMIT' || readOnly == 'Y') {
76
                return;
Spencer Chang's avatar
Spencer Chang committed
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
            } else {
                if (name == 'contract_number') {
                    if (write_off_type != 'DEPOSIT_POOL_CREDIT') {
                        return 'csh_write_off_grid_lv';
                    }

                }
                if (name == 'write_off_type_desc') {
                    return 'csh_write_off_grid_cb';
                }
                // if (name == 'write_off_bp_name') {
                //     return 'csh_write_off_grid_lv';
                // }
                if (name == 'write_off_times') {
                    if (write_off_type == 'RECEIPT_CREDIT') {
                        return 'csh_write_off_grid_lv';
                    }
                }
高泉铭's avatar
高泉铭 committed
95
                if (name == 'write_off_amount' || name == 'write_off_principal' || name == 'write_off_interest' || name == 'write_off_penalty') {
Spencer Chang's avatar
Spencer Chang committed
96 97 98
                    return 'csh_write_off_grid_nf';
                }
                if (name == 'write_off_date' || name == 'journal_date') {
99
                    if (write_off_type == 'RECEIPT_CREDIT' || write_off_type == 'DEPOSIT_CREDIT') {
Darming's avatar
Darming committed
100 101
                        return 'csh_write_off_grid_dp';
                    }
Darming's avatar
Darming committed
102
                    if (write_off_type == 'RECEIPT_ADVANCE_RECEIPT') {
Darming's avatar
Darming committed
103
                        if (record.get('create_wf_flag') == 'Y') {
Darming's avatar
Darming committed
104 105
                            return;
                        }
Darming's avatar
Darming committed
106 107
                        return 'csh_transaction_advanced_grid_dp';
                    }
Darming's avatar
Darming committed
108
                    if (write_off_type == 'RECEIPT_DEPOSIT_POOL') {
Darming's avatar
Darming committed
109
                        return 'csh_transaction_deposit_grid_dp';
18083's avatar
18083 committed
110 111 112
                    }
					if (write_off_type == 'OPERAT_COMBINED') {
                        return 'csh_transaction_operat_grid_dp';
Darming's avatar
Darming committed
113
                    }
Spencer Chang's avatar
Spencer Chang committed
114 115 116 117 118 119 120 121 122
                }
                if (name == 'agent_id_desc') {
                    if (write_off_type == 'DEPOSIT_POOL_CREDIT') {
                        return 'csh_write_off_grid_lv';
                    }
                }
                if (name == 'write_off_classification_desc') {
                    return 'csh_write_off_grid_cb';
                }
123
                return;
Spencer Chang's avatar
Spencer Chang committed
124 125 126 127 128 129 130
            }
        }

        function summaryRenderer(datas, name) {
            var sum = 0;
            var sum_2 = 0;
            for (var i = 0; i < datas.length; i++) {
Darming's avatar
Darming committed
131
                var record = datas[i];
Spencer Chang's avatar
Spencer Chang committed
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
                if (name == "write_off_amount") {
                    var t_1 = record.get("write_off_amount");
                    var t_2 = parseFloat(t_1);
                    if (!isNaN(t_2)) {
                        sum += t_2;
                    }
                }
                if (name == "unreceived_amount") {
                    var n_1 = record.get("unreceived_amount");
                    var n_2 = parseFloat(n_1);
                    if (!isNaN(n_2)) {
                        sum_2 += n_2;
                    }
                }
            }
            if (name == "csh_bank_slip_num") {
                return '<div align="right">合计:</div>';
            }
            if (name == "unreceived_amount") {
                return '<font color="red">' + Leaf.formatNumber(sum_2, 2) + '</font>';
            }
            if (name == "write_off_amount") {
                return '<font color="red">' + Leaf.formatNumber(sum, 2) + '</font>';
            }
        }

        function csh531_update_fun(ds, record, name, value, oldValue) {
            if (name == 'write_off_amount') {
160
                if(!checkAmount()){
Darming's avatar
Darming committed
161 162 163 164 165 166 167 168
                    setTimeout(function () {//防止递归
                        record.set(name, oldValue);
                    });
                }

                var h_record = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord();
                csh531_load_fun(ds);

Spencer Chang's avatar
Spencer Chang committed
169 170 171 172 173
                var left_amount = record.get('left_amount');
                var left_principal = record.get('left_principal');
                var left_interest = record.get('left_interest');
                var x_amount;
                if (value) {
174 175 176
                    if (value <= left_principal) {
                        if (left_principal > 0) {
                            record.set('write_off_principal', value);
高泉铭's avatar
高泉铭 committed
177
                        } else {
178
                            record.set('write_off_principal', null);
Spencer Chang's avatar
Spencer Chang committed
179
                        }
180 181
                        record.set('write_off_interest', null);
                    } else if (value > left_principal) {
Spencer Chang's avatar
Spencer Chang committed
182
                        if (left_principal > 0) {
183
                            record.set('write_off_principal', left_principal);
高泉铭's avatar
高泉铭 committed
184
                        } else {
Spencer Chang's avatar
Spencer Chang committed
185 186
                            record.set('write_off_principal', null);
                        }
187
                        x_amount = minus(value,left_principal);
188 189 190 191 192
                        if (left_interest > 0) {
                            record.set('write_off_interest', x_amount);
                        } else {
                            record.set('write_off_interest', null);
                        }
Spencer Chang's avatar
Spencer Chang committed
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
                    }
                } else {
                    record.set('write_off_interest', null);
                    record.set('write_off_principal', null);
                }
            }
            if (name == 'write_off_type') {
                if (value != oldValue) {
                    //收款核销
                    if (value == 'RECEIPT_CREDIT') {
                        record.getField('contract_number').setRequired(true);

                        record.getField('write_off_times').setReadOnly(false);
                        record.getField('write_off_times').setRequired(true);

                    } else {
                        record.getField('write_off_times').setRequired(false);
                        record.getField('write_off_times').setReadOnly(true);
                    }
                    //收款核销预收款
                    if (value == 'RECEIPT_ADVANCE_RECEIPT') {
                        record.getField('contract_number').setRequired(true);

                        record.set('agent_id_desc', '');
                        record.set('agent_id', '');
                        record.set('write_off_times', '');
                        record.set('write_off_cf_item', '');
                        record.set('write_off_cf_item_desc', '');
                        record.set('write_off_cashflow_id', '');
                        record.set('due_date', '');

                        record.set('write_off_principal', '');
                        record.set('write_off_interest', '');
                        record.set('left_amount', '');
                        record.set('left_principal', '');
                        record.set('left_interest', '');
                    }
                    //核销为保证金池
                    if (value == 'DEPOSIT_POOL_CREDIT') {
                        record.getField('contract_number').setRequired(false);

                        record.getField('agent_id_desc').setReadOnly(false);
                        record.getField('agent_id_desc').setRequired(true);

                        record.set('contract_number', '');
                        record.set('contract_name', '');
                        record.set('contract_id', '');
                        record.set('write_off_bp_id', '');
                        record.set('write_off_bp_name', '');

                        record.set('write_off_times', '');
                        record.set('write_off_cf_item', '');
                        record.set('write_off_cf_item_desc', '');
                        record.set('write_off_cashflow_id', '');
                        record.set('due_date', '');

                        record.set('write_off_principal', '');
                        record.set('write_off_interest', '');
                        record.set('left_amount', '');
                        record.set('left_principal', '');
                        record.set('left_interest', '');
                    } else {
                        record.getField('agent_id_desc').setRequired(false);
                        record.getField('agent_id_desc').setReadOnly(true);
                    }
                    if (value == 'RECEIPT_NONBUSINESS') {
                        record.getField('contract_number').setReadOnly(true);
                        record.getField('contract_number').setRequired(false);
                        record.getField('write_off_times').setRequired(false);
                        record.getField('write_off_times').setReadOnly(true);

                        record.set('contract_number', '');
                        record.set('contract_name', '');
                        record.set('contract_id', '');
                        record.set('write_off_bp_id', '');
                        record.set('write_off_bp_name', '');


                    }
                }
            }
            if (name == 'contract_id') {
                record.getField('write_off_times').setLovPara('contract_id', value);
                record.set('write_off_times', '');
                record.set('write_off_cf_item', '');
                record.set('write_off_cf_item_desc', '');
                record.set('write_off_cashflow_id', '');
                record.set('due_date', '');
                record.set('write_off_principal', '');
                record.set('write_off_interest', '');
                record.set('left_amount', '');
                record.set('left_principal', '');
                record.set('left_interest', '');
            }
287 288
            if (name == 'wirte_off_date'){
                record.set('journal_date',value);
289
            }
Spencer Chang's avatar
Spencer Chang committed
290 291 292 293 294 295 296 297
        }

        function csh531_wf_amount_validate(record, name, value) {
            var batch_status = '${/parameter/@batch_status}';
            if (batch_status == 'SUBMIT') {
                return true;
            } else {
                if (record.get('write_off_type') == 'RECEIPT_CREDIT') {
高泉铭's avatar
高泉铭 committed
298 299
                    if (value != record.get('left_amount')) {
                        return '分配金额与剩余金额不等!';
Spencer Chang's avatar
Spencer Chang committed
300 301 302 303 304 305 306 307 308 309 310
                    }
                }
            }
            return true;
        }

        function csh531n_save() {
            $('csh_transaction_receipt_write_off_detail_ds').submit();
        }

        function csh531n_write_off() {
Darming's avatar
Darming committed
311
            $('csh531n_write_off_btn_id').disable();
312 313 314
            var returning_amount = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord().get('returning_amount') || 0;
            if (returning_amount > 0) {
                Leaf.showInfoMessage("提示", "该收款单存在审批中的退款流程,无法进行核销操作!");
Darming's avatar
Darming committed
315 316
                $('csh531n_write_off_btn_id').enable();
                return;
317 318 319 320
            }
            var interfaceRs = $('csh_write_off_interface_ds').getAll();
            var depositRs = $('csh_transaction_deposit_ds').getAll();
            var advancedRs = $('csh_transaction_advanced_ds').getAll();
18083's avatar
18083 committed
321
			var operatRs = $('csh_transaction_operat_ds').getAll();
322

Darming's avatar
Darming committed
323 324 325 326 327
            //IE浏览器不支持ES6语法

            // var allRs = [...interfaceRs, ...depositRs, ...advancedRs];

            var allRs = [];
18083's avatar
18083 committed
328
            allRs = interfaceRs.concat(depositRs).concat(advancedRs).concat(operatRs);
329 330 331 332

            for (var i = 0; i < allRs.length; i++) {
                if (allRs[i].dirty) {
                    Leaf.showInfoMessage("提示", "存在未保存数据,请先保存再进行核销操作!");
Darming's avatar
Darming committed
333
                    $('csh531n_write_off_btn_id').enable();
334
                    return;
高泉铭's avatar
高泉铭 committed
335
                }
336
            }
高泉铭's avatar
高泉铭 committed
337

338 339 340 341 342 343 344 345 346 347 348 349 350
            if (checkAmount('WRITE_OFF')) {
                var record = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord();
                if (record) {
                    csh531d_lock_current_window();
                    var transaction_id = record.get('transaction_id');
                    Leaf.request({
                        url: $('csh531n_csh_confirm_data_link').getUrl(),
                        para: {
                            transaction_id: '${/parameter/@transaction_id}',
                            _status: 'update'
                        },
                        success: function () {
                            csh531d_unlock_current_window();
Darming's avatar
Darming committed
351
                            $('csh531n_write_off_btn_id').enable();
352 353 354
                            csh531n_detail_win_close();
                        }, failure: function () {
                            csh531d_unlock_current_window();
Darming's avatar
Darming committed
355
                            $('csh531n_write_off_btn_id').enable();
356 357 358
                        },
                        error: function () {
                            csh531d_unlock_current_window();
Darming's avatar
Darming committed
359
                            $('csh531n_write_off_btn_id').enable();
360 361 362 363
                        },
                        scope: this
                    });
                }
Spencer Chang's avatar
Spencer Chang committed
364 365 366 367 368 369 370 371 372 373 374 375
            }
        }

        function csh531_beforesubmit_fun(ds) {
            var records = ds.getAll();
            var total = 0;
            var head_record = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord();
            var unwrite_off_amount = head_record.get('unwrite_off_amount');
            for (var i = 0; i < records.length; i++) {
                total = plus(total, records[i].get('write_off_amount'))
            }
            if (total > unwrite_off_amount) {
高泉铭's avatar
高泉铭 committed
376
                Leaf.showMessage('${l:PROMPT}', '核销金额不能大于可核销金额!');
Spencer Chang's avatar
Spencer Chang committed
377 378 379 380 381 382 383
                return false;
            }
            return true;
        }

        function csh531_load_fun(ds) {
            var records = ds.getAll();
Darming's avatar
Darming committed
384 385 386 387 388
            var sum = 0;
            var write_off_recs = $('csh_write_off_interface_ds').getAll();
            for (var i = 0; i < write_off_recs.length; i++) {
                var t = parseFloat(write_off_recs[i].get('write_off_amount'));
                if (!isNaN(t)) {
389
                    sum = plus(sum,t);
Darming's avatar
Darming committed
390 391 392 393 394 395
                }
            }
            var deposit_recs = $('csh_transaction_deposit_ds').getAll();
            for (var i = 0; i < deposit_recs.length; i++) {
                var t = parseFloat(deposit_recs[i].get('write_off_amount'));
                if (!isNaN(t)) {
396
                    sum = plus(sum,t);
Darming's avatar
Darming committed
397
                }
18083's avatar
18083 committed
398 399 400 401 402 403 404
            }
			var operat_recs = $('csh_transaction_operat_ds').getAll();
            for (var i = 0; i < operat_recs.length; i++) {
                var t = parseFloat(operat_recs[i].get('write_off_amount'));
                if (!isNaN(t)) {
                    sum = plus(sum, t);
                }
Spencer Chang's avatar
Spencer Chang committed
405
            }
Darming's avatar
Darming committed
406 407 408 409
            var advanced_recs = $('csh_transaction_advanced_ds').getAll();
            for (var i = 0; i < advanced_recs.length; i++) {
                var t = parseFloat(advanced_recs[i].get('write_off_amount'));
                if (!isNaN(t)) {
410
                    sum = plus(sum,t);
Darming's avatar
Darming committed
411 412 413
                }
            }
            var h_record = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord();
Darming's avatar
Darming committed
414
            var for_allocate_amount = 0;
415 416
            if(h_record.get('unwrite_off_amount') && h_record.get('unwrite_off_amount') > 0){
                for_allocate_amount = minus(h_record.get('unwrite_off_amount'),sum);
Darming's avatar
Darming committed
417
            }
418
            h_record.set('for_allocate_amount',for_allocate_amount);
Spencer Chang's avatar
Spencer Chang committed
419 420
        }

Darming's avatar
Darming committed
421
        function csh531n_write_off_return() {
Darming's avatar
Darming committed
422
            var record = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord();
Darming's avatar
Darming committed
423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451
            $('csh531n_write_off_return_btn_id').disable();
            Leaf.Masker.mask(Ext.getBody());
            Leaf.request({
                url: $('csh531n_submit_link_id').getUrl(),
                para: {
                    transaction_id: record.get('transaction_id'),
                    flag: 'RETURN'
                },
                success: function () {
                    Leaf.SideBar.show({
                        msg: '操作成功',
                        duration: 2000
                    });
                    Leaf.Masker.unmask(Ext.getBody());
                    $('csh531n_write_off_return_btn_id').enable();
                    $('${/parameter/@winid}').close();
                },
                error: function () {
                    Leaf.Masker.unmask(Ext.getBody());
                    $('csh531n_write_off_return_btn_id').enable();
                },
                failure: function () {
                    Leaf.Masker.unmask(Ext.getBody());
                    $('csh531n_write_off_return_btn_id').enable();
                },
                scope: this
            });
        }

Spencer Chang's avatar
Spencer Chang committed
452
        function csh531_submitsuccess(ds) {
Darming's avatar
Darming committed
453
            var record = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord();
Darming's avatar
Darming committed
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475
            Leaf.Masker.mask(Ext.getBody());
            Leaf.request({
                url: $('csh531n_submit_link_id').getUrl(),
                para: {
                    transaction_id: record.get('transaction_id'),
                    flag: 'SUBMIT'
                },
                success: function () {
                    Leaf.Masker.unmask(Ext.getBody());
                    $('csh531n_write_off_submit_btn_id').enable();
                    $('${/parameter/@winid}').close();
                },
                error: function () {
                    Leaf.Masker.unmask(Ext.getBody());
                    $('csh531n_write_off_submit_btn_id').enable();
                },
                failure: function () {
                    Leaf.Masker.unmask(Ext.getBody());
                    $('csh531n_write_off_submit_btn_id').enable();
                },
                scope: this
            });
Darming's avatar
Darming committed
476
            // $('csh531n_write_off_submit_btn_id').enable();
Darming's avatar
Darming committed
477
            // ds.query();
Spencer Chang's avatar
Spencer Chang committed
478 479
        }

480
        function csh531_submitfailed(ds) {
Darming's avatar
Darming committed
481
            $('csh531n_write_off_submit_btn_id').enable();
高泉铭's avatar
高泉铭 committed
482 483
        }

Spencer Chang's avatar
Spencer Chang committed
484 485 486 487 488 489 490 491 492 493
        function compareDate(start, end) {
            if (start > end) {
                return false;
            }
            return true;
        }

        function write_off_date_validator(record, name, value) {
            if (name == 'write_off_date') {
                if (value) {
高泉铭's avatar
高泉铭 committed
494
                    var head_record = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord();
Spencer Chang's avatar
Spencer Chang committed
495 496 497 498 499 500 501 502 503 504 505 506 507 508 509
                    var start_date = Leaf.formatDate(value);
                    var end_date = Leaf.formatDate(new Date());//Leaf.formatDate(head_record.get('transaction_date'));

                    if (!compareDate(start_date, end_date)) {
                        return '核销基准日期不能选在当前日期之后'; //'核销基准日期不能选在收款日期之后'; //校验不通过返回字符串
                    }
                }
                return true; //校验通过返回true
            }

        }

        function attachment_upload() {
            if ('${/parameter/@transaction_id}') {
                //
Darming's avatar
Darming committed
510 511 512 513
                var ds = $('csh_transaction_receipt_write_off_detail_ds');
                var record = ds.getCurrentRecord();
                // var header_id = '${/parameter/@transaction_id}';
                var header_id = record.get('transaction_id');
514 515 516 517 518 519 520 521 522 523 524
                //if(record.get('transaction_type') == 'ADVANCE_RECEIPT'||record.get('transaction_type') == 'DEPOSIT'){
                    //header_id = record.get('source_csh_trx_id');
                //}
                var url = $('transaction_uploadFile_id').getUrl() + '?table_name=CSH_TRANSACTION&header_id=' + header_id;
                var win = new Leaf.Window({
                    url: url,
                    title: '${l:HLS.SUPPORTING_DOCUMENT}',
                    id: 'transaction_downFile_winid',
                    width: 850,
                    height: 400
                });
Darming's avatar
Darming committed
525 526 527 528 529
                // win.on('close', function () {
                //     window.location.href = $('csh_transaction_receipt_id').getUrl();
                //     // var url = $('csh_transaction_receipt_id').getUrl();
                //     // Leaf.go(url);
                // });
Spencer Chang's avatar
Spencer Chang committed
530 531
            } else {
                Leaf.showMessage('${l:HLS.PROMPT}', '请先保存!');
532
                return;
Spencer Chang's avatar
Spencer Chang committed
533 534 535
            }
        }

高泉铭's avatar
高泉铭 committed
536
        function attachment_rendered() {
537
            return '<a href="javascript:attachment_upload()"><span style="color:red;">附件上传</span></a>';
高泉铭's avatar
高泉铭 committed
538 539
        }

Spencer Chang's avatar
Spencer Chang committed
540 541 542
        function csh531_add_fun(ds, record, index) {
            record.getField('contract_number').setRequired(true);
            record.getField('write_off_times').setReadOnly(false);
高泉铭's avatar
高泉铭 committed
543 544 545 546
        }

        function csh511_save_all() {
            if (checkAmount()) {
547 548 549
                var datas = [];
                var para = {};
                var records = $('csh_write_off_interface_ds').getAll();
550
                for (var i = 0;i < records.length;i++) {
551 552 553 554 555 556 557
                    para = records[i].data;
                    para['_status'] = 'update';
                    datas.push(para);
                }
                Leaf.request({
                    url: $('csh531n_submit_interface_link_id').getUrl(),
                    para: datas,
558
                    success: function(res) {
38823's avatar
38823 committed
559 560
                        Leaf.Masker.unmask(Ext.getBody());
                        $('csh_transaction_deposit_ds').submit();
18083's avatar
18083 committed
561
						$('csh_transaction_operat_ds').submit();
38823's avatar
38823 committed
562 563
                        $('csh_transaction_advanced_ds').submit();
                        csh531_submitsuccess();
564
                    },
565
                    failure: function() {
566 567 568
                        Leaf.Masker.unmask(Ext.getBody());
                        csh531_submitfailed();
                    },
569
                    error: function() {
570 571 572 573 574 575 576 577
                        Leaf.Masker.unmask(Ext.getBody());
                        csh531_submitfailed();
                    },
                    scope: this
                });
                // $('csh_transaction_deposit_ds').submit();
                // $('csh_transaction_advanced_ds').submit();
                // $('csh_write_off_interface_ds').submit();
高泉铭's avatar
高泉铭 committed
578 579 580 581 582 583 584 585 586
            }
        }

        function checkAmount(type) {
            var sum = 0;
            var write_off_recs = $('csh_write_off_interface_ds').getAll();
            for (var i = 0; i < write_off_recs.length; i++) {
                var t = parseFloat(write_off_recs[i].get('write_off_amount'));
                if (!isNaN(t)) {
587
                    sum = plus(sum,t);
高泉铭's avatar
高泉铭 committed
588 589 590 591 592 593
                }
            }
            var deposit_recs = $('csh_transaction_deposit_ds').getAll();
            for (var i = 0; i < deposit_recs.length; i++) {
                var t = parseFloat(deposit_recs[i].get('write_off_amount'));
                if (!isNaN(t)) {
594
                    sum = plus(sum,t);
高泉铭's avatar
高泉铭 committed
595
                }
18083's avatar
18083 committed
596 597 598 599 600 601 602
            }
			var operat_recs = $('csh_transaction_operat_ds').getAll();
            for (var i = 0; i < operat_recs.length; i++) {
                var t = parseFloat(operat_recs[i].get('write_off_amount'));
                if (!isNaN(t)) {
                    sum = plus(sum, t);
                }
高泉铭's avatar
高泉铭 committed
603 604 605 606 607
            }
            var advanced_recs = $('csh_transaction_advanced_ds').getAll();
            for (var i = 0; i < advanced_recs.length; i++) {
                var t = parseFloat(advanced_recs[i].get('write_off_amount'));
                if (!isNaN(t)) {
608
                    sum = plus(sum,t);
高泉铭's avatar
高泉铭 committed
609 610 611
                }
            }
            var header_rec = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord();
612 613
            if (sum > header_rec.get('unwrite_off_amount')) {
                Leaf.showInfoMessage('提示', '核销总金额不能大于剩余可核销金额');
Darming's avatar
Darming committed
614
                $('csh531n_write_off_submit_btn_id').enable();
Darming's avatar
Darming committed
615
                $('csh531n_write_off_btn_id').enable();
高泉铭's avatar
高泉铭 committed
616 617
                return false;
            }
Darming's avatar
Darming committed
618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635
            // var receipt_type = header_rec.get('receipt_type');
            // var bp_category = header_rec.get('bp_category');
            // var paid_byother_flag = header_rec.get('paid_byother_flag');
            // if (type == 'WRITE_OFF') {
            //     var check_flag = 'N';
            //     if (receipt_type == 'WITHHOLD') { //划扣
            //         check_flag = 'Y';
            //     } else {
            //         if (paid_byother_flag == 'F' && bp_category == 'TENANT') {
            //             check_flag = 'Y';
            //         }
            //     }
            //     if (check_flag == 'Y' && sum != header_rec.get('unwrite_off_amount')) {
            //         Leaf.showInfoMessage('提示', '核销总金额不等于可核销金额,该现金事务不支持部分核销!');
            //         $('csh531n_write_off_submit_btn_id').enable();
            //         return false;
            //     }
            // }
高泉铭's avatar
高泉铭 committed
636
            return true;
Spencer Chang's avatar
Spencer Chang committed
637 638
        }

Darming's avatar
Darming committed
639

640 641
        function csh_deposit_edit_function(record, name) {
            if ('${/parameter/@readOnly}' == 'Y') {
642
                return;
643 644 645 646 647
            } else {
                if (name == 'write_off_amount') {
                    return 'csh_transaction_deposit_grid_nf';
                }
            }
18083's avatar
18083 committed
648 649 650 651 652 653 654 655
        }
		function csh_operat_edit_function(record, name) {
            if ('${/parameter/@readOnly}' == 'Y') {
            } else {
                if (name == 'write_off_amount') {
                    return 'csh_transaction_operat_grid_nf';
                }
            }
656 657 658
        }
        function csh_advance_edit_function(record, name) {
            if ('${/parameter/@readOnly}' == 'Y') {
659
                return;
660 661
            } else {
                if (name == 'write_off_amount') {
662 663
                    var r = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord();
                    var deposit_ds = $('csh_transaction_deposit_ds');
18083's avatar
18083 committed
664
					var operat_ds = $('csh_transaction_operat_ds');
665 666 667
                    var advanced_ds = $('csh_transaction_advanced_ds');

                    var current_deposit_r = deposit_ds.getAt(0);
18083's avatar
18083 committed
668
					var current_operat_r = operat_ds.getAt(0);
669
                    var current_advance_r = advanced_ds.getAt(0);
Darming's avatar
Darming committed
670
                    if (r.get('exists_deposit_flag') == 'Y' && current_deposit_r) {
671 672
                        return;
                    }
Darming's avatar
Darming committed
673 674 675
                    // if (r.get('exists_advance_flag') == 'Y' && current_advance_r) {
                    //     return;
                    // }
Darming's avatar
Darming committed
676
                    if (record.get('create_wf_flag') == 'Y') {
677 678
                        return;
                    }
679 680 681 682 683
                    return 'csh_transaction_advanced_grid_nf';
                }
            }
        }

Darming's avatar
Darming committed
684 685 686 687
        function csh531n_write_off_submit() {
            var returning_amount = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord().get('returning_amount') || 0;
            if (returning_amount > 0) {
                Leaf.showInfoMessage("提示", "该收款单存在审批中的退款流程,无法进行提交操作!");
Darming's avatar
Darming committed
688
                return;
Darming's avatar
Darming committed
689 690 691 692
            }
            var interfaceRs = $('csh_write_off_interface_ds').getAll();
            var depositRs = $('csh_transaction_deposit_ds').getAll();
            var advancedRs = $('csh_transaction_advanced_ds').getAll();
18083's avatar
18083 committed
693
			var operatRs = $('csh_transaction_operat_ds').getAll();
Darming's avatar
Darming committed
694

Darming's avatar
Darming committed
695 696 697 698 699
            //IE浏览器不支持ES6语法

            // var allRs = [...interfaceRs, ...depositRs, ...advancedRs];

            var allRs = [];
18083's avatar
18083 committed
700
            allRs = interfaceRs.concat(depositRs).concat(advancedRs).concat(operatRs);
Darming's avatar
Darming committed
701 702 703 704


            var sum = 0;
            for (var i = 0; i < allRs.length; i++) {
Darming's avatar
Darming committed
705 706 707 708
                // if (allRs[i].dirty) {
                //     Leaf.showInfoMessage("提示", "存在未保存数据,请先保存再进行提交操作!");
                //     return;
                // }
709
                sum = plus(sum,allRs[i].get('write_off_amount') || 0);
Darming's avatar
Darming committed
710 711 712 713 714 715
            }

            if (sum == 0) {
                Leaf.showInfoMessage('提示', '请先分配核销金额再进行提交操作');
                return;
            }
niminmin's avatar
niminmin committed
716
            // 以旧换新与三方协议合同的首付款不可进行电汇核销
717
            var cf_item_2_count=0;
18083's avatar
18083 committed
718
			 var write_date_count =0;
niminmin's avatar
niminmin committed
719
            for (var i = 0; i < interfaceRs.length; i++) {
720
                if ((interfaceRs[i].get('payment_deduction')=='TRADE_IN'||interfaceRs[i].get('payment_deduction')=='TRI_AGREEMENT'||interfaceRs[i].get('payment_deduction')=='DOWN_PAYMENT_DEDUCTION')&&interfaceRs[i].get('write_off_cf_item')=='2') {
721
                    cf_item_2_count = plus(cf_item_2_count,1);
niminmin's avatar
niminmin committed
722
                }
18083's avatar
18083 committed
723 724 725
				if (interfaceRs[i].get('division') == '95' && Leaf.formatDate(interfaceRs[i].get('write_off_date')) < Leaf.formatDate(interfaceRs[i].get('due_date'))  && interfaceRs[i].get('write_off_cf_item') == '1') {
                  write_date_count = plus(write_date_count, 1);
               }
niminmin's avatar
niminmin committed
726
            }
727
            if (cf_item_2_count>0) {
niminmin's avatar
niminmin committed
728 729 730
                Leaf.showInfoMessage('提示', ' 首付款抵扣为“无”以外的合同,不可进行首付款电汇核销!');
                return;
            }
18083's avatar
18083 committed
731 732 733 734
			if (write_date_count > 0) {
                Leaf.showInfoMessage('提示', '经营性租赁合同收款核销当天的系统日期不得早于应收日!');
                return;
            }
Darming's avatar
Darming committed
735

736
            var createConfirm = Leaf.showConfirm('提示', '确认提交复核吗', function () {
Darming's avatar
Darming committed
737
                $('csh531n_write_off_submit_btn_id').disable();
Darming's avatar
Darming committed
738
                csh511_save_all();
Darming's avatar
Darming committed
739 740 741
            });
        }

Darming's avatar
Darming committed
742
        function csh531_add_fun(ds, record, index) {
Darming's avatar
Darming committed
743 744 745
            var h_ds = $('csh_transaction_receipt_write_off_detail_ds');
            var r = h_ds.getCurrentRecord();
            if (r.get('transaction_type') == 'DEPOSIT') {
Darming's avatar
Darming committed
746 747 748 749
                record.set('write_off_type', 'DEPOSIT_CREDIT');
            }
        }

Darming's avatar
Darming committed
750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766
        function get_min_amount(amt1, amt2) {
            if (!Ext.isEmpty(amt1) && !Ext.isEmpty(amt2)) {
                if (amt1 > amt2) {
                    return amt2;
                } else {
                    return amt1;
                }
            } else if (Ext.isEmpty(amt1)) {
                return amt2;
            } else if (Ext.isEmpty(amt2)) {
                return amt1;
            } else {
                return null;
            }
        }

        function write_off_amount_dblclick(grid, record, row, name) {
767
            if(!record){
Darming's avatar
Darming committed
768 769 770 771 772 773
                record = grid.record;
            }
            var head_record = $('csh_transaction_receipt_write_off_detail_ds').getAt(0);
            // record = $('csh_transaction_receipt_write_off_detail_ds').getCurrentRecord();
            var for_allocate_amount = head_record.get('for_allocate_amount'),
                unreceived_amount = record.get('unreceived_amount');
774 775
            if(unreceived_amount){
                if (Ext.isEmpty(record.get('write_off_amount'))||record.get('write_off_amount') == 0) {
Darming's avatar
Darming committed
776 777 778 779 780 781
                    record.set('write_off_amount', get_min_amount(for_allocate_amount, unreceived_amount));
                }
            }
        }


Spencer Chang's avatar
Spencer Chang committed
782 783 784 785 786 787 788 789 790 791 792
        ]]></script>
        <a:dataSets>
            <a:dataSet id="ds_collection_classes_ds" lookupCode="DS_COLLECTION_CLASSES"/>
            <a:dataSet id="ds_csh_write_off_classification_ds" lookupCode="DS_CSH_WRITE_OFF_CLASSIFICATION"/>
            <a:dataSet id="write_off_cf_item_ds" autoQuery="true" model="csh.CSH531N.hls_cashflow_item_v"/>
            <a:dataSet id="write_off_type_ds" autoQuery="true" model="csh.CSH531N.write_off_type_cb"/>
            <a:dataSet id="csh_transaction_receipt_write_off_detail_ds" model="csh.CSH531N.csh_transaction">
                <a:datas dataSource="/model/csh_transaction_path"/>
                <a:fields>
                    <!--  <a:field name="write_off_date" defaultValue="${/model/sys_default_value/record/@now_time}" required="true"/> -->
                    <a:field name="write_off_date" readOnly="true"/>
高泉铭's avatar
高泉铭 committed
793
                    <a:field name="paid_byother_flag_n" readOnly="true"/>
Spencer Chang's avatar
Spencer Chang committed
794 795 796 797 798 799 800 801 802 803 804 805 806 807
                    <a:field name="ref_contract_num" readOnly="true"/>
                    <a:field name="bank_slip_num" readOnly="true"/>
                    <a:field name="bp_code" readOnly="true"/>
                    <a:field name="bp_category" readOnly="true"/>
                    <a:field name="bp_category_n" readOnly="true"/>
                    <a:field name="transaction_num" readOnly="true"/>
                    <a:field name="currency_name" readOnly="true"/>
                    <a:field name="bp_name" readOnly="true"/>
                    <a:field name="transaction_amount" readOnly="true"/>
                    <a:field name="returned_amount" readOnly="true"/>
                    <a:field name="write_off_amount" readOnly="true"/>
                    <a:field name="unwrite_off_amount" readOnly="true"/>
                    <a:field name="csh_bp_name" readOnly="true"/>
                    <a:field name="bank_account_name" readOnly="true"/>
高泉铭's avatar
高泉铭 committed
808
                    <a:field name="transaction_date" readOnly="true"/>
Spencer Chang's avatar
Spencer Chang committed
809 810 811 812 813
                    <a:field name="bp_bank_account_name" readOnly="true"/>
                    <a:field name="bp_bank_account_num" readOnly="true"/>
                    <a:field name="write_off_flag_desc" readOnly="true"/>
                    <a:field name="review_status_desc" readOnly="true"/>
                    <a:field name="bank_account_num" readOnly="true"/>
814 815
                    <a:field name="opposite_band_na" readOnly="true"/>
                    <a:field name="bank_branch_name" readOnly="true"/>
高泉铭's avatar
高泉铭 committed
816 817
                    <a:field name="collection_classes_desc" readOnly="true" options="ds_collection_classes_ds"
                             displayField="code_value_name" returnField="collection_classes" valueField="code_value"/>
Spencer Chang's avatar
Spencer Chang committed
818 819
                    <a:field name="ref_v01"/>
                    <a:field name="approving_return_amount" readOnly="true"/>
820
                    <a:field name="for_allocate_amount" readOnly="true" />
Spencer Chang's avatar
Spencer Chang committed
821 822 823
                </a:fields>

            </a:dataSet>
高泉铭's avatar
高泉铭 committed
824 825
            <a:dataSet id="csh_write_off_interface_ds" autoQuery="true" fetchAll="true"
                       model="csh.CSH531N.csh_write_off_interface"
826
                       queryUrl="${/request/@context_path}/autocrud/csh.CSH531N.csh_write_off_interface/query?trx_interface_id=${/parameter/@transaction_id}&amp;trx_transaction_type=${/parameter/@transaction_type}&amp;transaction_date=${/parameter/@transaction_date}"
高泉铭's avatar
高泉铭 committed
827
                       selectable="true">
Spencer Chang's avatar
Spencer Chang committed
828 829
                <a:fields>
                    <a:field name="company_id" defaultValue="${/parameter/@company_id}"/>
830
                    <a:field name="write_off_date" datatype="java.util.Date" validator="write_off_date_validator" required="true"
Darming's avatar
Darming committed
831
                             defaultValue="${/model/sys_default_time/record/@now_date}"/>
高泉铭's avatar
高泉铭 committed
832 833
                    <a:field name="journal_date" required="true"
                             defaultValue="${/model/sys_default_time/record/@now_date}"/>
Spencer Chang's avatar
Spencer Chang committed
834 835 836 837
                    <a:field name="write_off_period_name" defaultValue="${/parameter/@period_name}"/>
                    <a:field name="write_off_period_num" defaultValue="${/parameter/@internal_period_num}"/>
                    <a:field name="check_flag" defaultValue="Y"/>
                    <a:field name="record_type" defaultValue="MANUAL"/>
高泉铭's avatar
高泉铭 committed
838 839
                    <a:field name="write_off_times" readOnly="true"/>
                    <a:field name="write_off_amount" required="true"/>
Spencer Chang's avatar
Spencer Chang committed
840 841 842 843 844
                    <a:field name="due_date"/>
                    <a:field name="unreceived_amount"/>
                    <a:field name="write_off_cashflow_id"/>
                    <a:field name="contract_id"/>
                    <a:field name="trx_interface_id" defaultValue="${/parameter/@transaction_id}"/>
高泉铭's avatar
高泉铭 committed
845
                    <a:field name="contract_number" prompt="合同编号" autoComplete="true" lovAutoQuery="true"
Darming's avatar
Darming committed
846
                             lovHeight="850" required="true"
847
                             lovUrl="${/request/@context_path}/modules/csh/CSH531N/csh_write_off_ref_contract.lview?bp_id=${/model/csh_transaction_path/record/@bp_id}&amp;deposit_flag=${/parameter/@deposit_flag}&amp;transaction_date=${/model/csh_transaction_path/record/@transaction_date}"
18083's avatar
18083 committed
848
                             lovWidth="1550" title="合同号选择">
Spencer Chang's avatar
Spencer Chang committed
849 850 851 852 853 854 855
                        <a:mapping>
                            <a:map from="contract_number" to="contract_number"/>
                            <a:map from="contract_name" to="contract_name"/>
                            <a:map from="contract_id" to="contract_id"/>
                            <a:map from="bp_id_tenant" to="write_off_bp_id"/>
                            <a:map from="bp_id_tenant_name" to="write_off_bp_name"/>
                            <a:map from="contract_status_desc" to="contract_status_desc"/>
niminmin's avatar
niminmin committed
856
                            <a:map from="payment_deduction" to="payment_deduction"/>
18083's avatar
18083 committed
857
							 <a:map from="division" to="division"/>
Spencer Chang's avatar
Spencer Chang committed
858 859 860 861
                        </a:mapping>
                    </a:field>
                    <a:field name="batch_id" defaultValue="${/parameter/@batch_id}"/>
                    <a:field name="write_off_type" defaultValue="RECEIPT_CREDIT"/>
高泉铭's avatar
高泉铭 committed
862 863 864
                    <a:field name="write_off_type_desc" defaultValue="收款核销债权" prompt="核销类型" required="true"
                             displayField="code_value_name" options="write_off_type_ds" returnField="write_off_type"
                             valueField="code_value"/>
Spencer Chang's avatar
Spencer Chang committed
865
                    <a:field name="write_off_bp_id"/>
niminmin's avatar
niminmin committed
866
                    <a:field name="payment_deduction"/>
18083's avatar
18083 committed
867
					<a:field name="division"/>
高泉铭's avatar
高泉铭 committed
868 869 870
                    <a:field name="write_off_classification_desc" prompt="核销分类"
                             options="ds_csh_write_off_classification_ds" returnField="write_off_classification"
                             valueField="code_value" displayField="code_value_name"/>
Spencer Chang's avatar
Spencer Chang committed
871
                    <a:field name="write_off_cf_item" readOnly="true"/>
高泉铭's avatar
高泉铭 committed
872 873 874
                    <a:field name="write_off_cf_item_desc" readOnly="true" displayField="cf_item_desc"
                             options="write_off_cf_item_ds"
                             returnField="write_off_cf_item" valueField="cf_item"/>
Spencer Chang's avatar
Spencer Chang committed
875 876 877
                </a:fields>
                <a:events>
                    <a:event name="update" handler="csh531_update_fun"/>
878
                    <!--                    <a:event name="beforesubmit" handler="csh531_beforesubmit_fun"/>-->
Spencer Chang's avatar
Spencer Chang committed
879
                    <a:event name="load" handler="csh531_load_fun"/>
880 881
                    <!--<a:event name="submitsuccess" handler="csh531_submitsuccess"/>
                    <a:event name="submitfailed" handler="csh531_submitfailed"/>-->
Spencer Chang's avatar
Spencer Chang committed
882 883 884
                    <a:event name="add" handler="csh531_add_fun"/>
                </a:events>
            </a:dataSet>
高泉铭's avatar
高泉铭 committed
885 886 887 888 889
            <a:dataSet id="csh_transaction_deposit_ds" model="csh.CSH531N.csh_transaction_plan_query" fetchAll="true"
                       autoQuery="true"
                       queryUrl="${/request/@context_path}/autocrud/csh.CSH531N.csh_transaction_plan_query/query?transaction_id=${/parameter/@transaction_id}&amp;write_off_type=RECEIPT_DEPOSIT_POOL"
                       selectable="true">
                <a:fields>
niminmin's avatar
niminmin committed
890 891 892 893 894 895 896 897 898 899 900 901 902 903
                    <!--                    <a:field name="bp_agent_name" lovGridHeight="350" lovHeight="550" lovLabelWidth="50" lovWidth="550"-->
                    <!--                             required="true" readOnly="true" autoComplete="true" autoCompleteField="bp_agent_name"-->
                    <!--                             lovService="basic.hls_bp_master_v_for_lov?bp_category=AGENT&amp;bp_id=${/parameter/@bp_id}"-->
                    <!--                             title="HLS.BP_TITLE">-->
                    <!--                        <a:mapping>-->
                    <!--                            <a:map from="bp_id" to="bp_id"/>-->
                    <!--                            <a:map from="bp_name" to="bp_agent_name"/>-->
                    <!--                        </a:mapping>-->
                    <!--                    </a:field>-->
                    <a:field name="bp_name" readOnly="true" autoComplete="true" lovGridHeight="350" lovHeight="550"
                             lovLabelWidth="50"
                             lovWidth="550"
                             required="true"
                             lovService="basic.hls_bp_master_v_for_lov?bp_id=${/parameter/@bp_id}" title="HLS.BP_TITLE">
高泉铭's avatar
高泉铭 committed
904 905
                        <a:mapping>
                            <a:map from="bp_id" to="bp_id"/>
niminmin's avatar
niminmin committed
906
                            <a:map from="bp_name" to="bp_name"/>
高泉铭's avatar
高泉铭 committed
907 908 909
                        </a:mapping>
                    </a:field>
                    <a:field name="bp_id" defaultValue="${/parameter/@bp_id}"/>
niminmin's avatar
niminmin committed
910
                    <a:field name="bp_name" defaultValue="${/model/csh_transaction_path/record/@bp_name}"/>
高泉铭's avatar
高泉铭 committed
911 912 913
                    <a:field name="transaction_id" defaultValue="${/parameter/@transaction_id}"/>
                    <a:field name="write_off_type" defaultValue="RECEIPT_DEPOSIT_POOL"/>
                    <a:field name="company_id" defaultValue="${/session/@company_id}"/>
高泉铭's avatar
高泉铭 committed
914
                    <a:field name="write_off_amount"/>
niminmin's avatar
niminmin committed
915
                    <a:field name="create_wf_flag" defaultValue="N"/>
Darming's avatar
Darming committed
916
                    <a:field name="write_off_date" validator="write_off_date_validator" required="true"
Darming's avatar
Darming committed
917
                             defaultValue="${/model/sys_default_time/record/@now_date}"/>
高泉铭's avatar
高泉铭 committed
918 919 920 921 922 923 924
                </a:fields>
            </a:dataSet>
            <a:dataSet id="csh_transaction_advanced_ds" model="csh.CSH531N.csh_transaction_plan_query" fetchAll="true"
                       autoQuery="true"
                       queryUrl="${/request/@context_path}/autocrud/csh.CSH531N.csh_transaction_plan_query/query?transaction_id=${/parameter/@transaction_id}&amp;write_off_type=RECEIPT_ADVANCE_RECEIPT"
                       selectable="true">
                <a:fields>
高泉铭's avatar
高泉铭 committed
925 926
                    <a:field name="bp_name" readOnly="true" autoComplete="true" lovGridHeight="350" lovHeight="550"
                             lovLabelWidth="50"
高泉铭's avatar
高泉铭 committed
927 928 929 930 931 932 933 934 935 936 937 938
                             lovWidth="550"
                             required="true"
                             lovService="basic.hls_bp_master_v_for_lov?bp_id=${/parameter/@bp_id}" title="HLS.BP_TITLE">
                        <a:mapping>
                            <a:map from="bp_id" to="bp_id"/>
                            <a:map from="bp_name" to="bp_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="bp_id" defaultValue="${/parameter/@bp_id}"/>
                    <a:field name="transaction_id" defaultValue="${/parameter/@transaction_id}"/>
                    <a:field name="write_off_type" defaultValue="RECEIPT_ADVANCE_RECEIPT"/>
                    <a:field name="company_id" defaultValue="${/session/@company_id}"/>
高泉铭's avatar
高泉铭 committed
939
                    <a:field name="write_off_amount"/>
Darming's avatar
Darming committed
940
                    <a:field name="create_wf_flag" defaultValue="N"/>
Darming's avatar
Darming committed
941
                    <a:field name="write_off_date" validator="write_off_date_validator" required="true"
Darming's avatar
Darming committed
942
                             defaultValue="${/model/sys_default_time/record/@now_date}"/>
高泉铭's avatar
高泉铭 committed
943 944
                </a:fields>
            </a:dataSet>
18083's avatar
18083 committed
945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970
			<a:dataSet id="csh_transaction_operat_ds" model="csh.CSH531N.csh_transaction_plan_query" fetchAll="true"
               autoQuery="true"
               queryUrl="${/request/@context_path}/autocrud/csh.CSH531N.csh_transaction_plan_query/query?transaction_id=${/parameter/@transaction_id}&amp;write_off_type=OPERAT_COMBINED"
               selectable="true">
           <a:fields>
                     <a:field name="bp_name" readOnly="true" autoComplete="true" lovGridHeight="350" lovHeight="550"
                     lovLabelWidth="50"
                     lovWidth="550"
                     required="true"
                     lovService="basic.hls_bp_master_v_for_lov?bp_id=${/parameter/@bp_id}" title="HLS.BP_TITLE">
                <a:mapping>
                    <a:map from="bp_id" to="bp_id"/>
                    <a:map from="bp_name" to="bp_name"/>
                </a:mapping>
            </a:field>
            <a:field name="bp_id" defaultValue="${/parameter/@bp_id}"/>
            <a:field name="bp_name" defaultValue="${/model/csh_transaction_path/record/@bp_name}"/>
            <a:field name="transaction_id" defaultValue="${/parameter/@transaction_id}"/>
            <a:field name="write_off_type" defaultValue="OPERAT_COMBINED"/>
            <a:field name="company_id" defaultValue="${/session/@company_id}"/>
            <a:field name="write_off_amount"/>
            <a:field name="create_wf_flag" defaultValue="N"/>
            <a:field name="write_off_date" validator="write_off_date_validator" required="true"
                     defaultValue="${/model/sys_default_time/record/@now_date}"/>
        </a:fields>
    </a:dataSet>
Spencer Chang's avatar
Spencer Chang committed
971 972 973
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
Darming's avatar
Darming committed
974 975 976
                <a:screenTitle/>
                <!--                <a:gridButton id="csh511_save_all_id" click="csh511_save_all" style="margin-left:20px;display:none"-->
                <!--                              text="暂存"/>-->
高泉铭's avatar
高泉铭 committed
977
                <a:gridButton id="csh531n_write_off_btn_id" click="csh531n_write_off"
Darming's avatar
Darming committed
978
                              style="margin-left:10px;display:none" text="确认核销"/>
Darming's avatar
Darming committed
979 980
                <a:gridButton id="csh531n_write_off_return_btn_id" click="csh531n_write_off_return"
                              style="margin-left:10px;display:none" text="核销退回"/>
Darming's avatar
Darming committed
981 982
                <a:gridButton id="csh531n_write_off_submit_btn_id" click="csh531n_write_off_submit"
                              style="margin-left:10px;display:none" text="提交复核"/>
Spencer Chang's avatar
Spencer Chang committed
983
            </a:screenTopToolbar>
高泉铭's avatar
高泉铭 committed
984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012
            <a:form style="margin-left:20px;">
                <a:fieldSet labelWidth="250" title="收款单详情">
                    <a:box column="3" labelWidth="100">
                        <a:datePicker name="transaction_date" bindTarget="csh_transaction_receipt_write_off_detail_ds"/>
                        <a:numberField name="transaction_amount" allowFormat="true"
                                       bindTarget="csh_transaction_receipt_write_off_detail_ds"/>
                        <!--                        <a:textField name="transaction_num" bindTarget="csh_transaction_receipt_write_off_detail_ds"/>-->
                        <!--                        <a:textField name="bank_account_name" bindTarget="csh_transaction_receipt_write_off_detail_ds"/>-->
                        <a:textField name="bank_slip_num" bindTarget="csh_transaction_receipt_write_off_detail_ds"
                                     prompt="银行流水号"/>
                        <!--                        <a:textField name="bank_account_num" bindTarget="csh_transaction_receipt_write_off_detail_ds"/>-->
                    </a:box>
                    <a:box column="3" labelWidth="100">
                        <a:textField name="paid_byother_flag_n" prompt="代付"
                                     bindTarget="csh_transaction_receipt_write_off_detail_ds"/>
                        <a:textField name="bp_name" prompt="商业伙伴"
                                     bindTarget="csh_transaction_receipt_write_off_detail_ds"/>
                        <a:textField name="collection_classes_desc" prompt="款项用途"
                                     bindTarget="csh_transaction_receipt_write_off_detail_ds"/>
                        <!--                        <a:numberField name="returned_amount" allowFormat="true"-->
                        <!--                                       bindTarget="csh_transaction_receipt_write_off_detail_ds"-->
                        <!--                                       prompt="HLS.RETURNED_AMOUNT"/>-->
                        <!--                        <a:numberField name="write_off_amount" allowFormat="true"-->
                        <!--                                       bindTarget="csh_transaction_receipt_write_off_detail_ds"-->
                        <!--                                       prompt="HLS.WRITEOFF_AMOUNT"/>-->
                        <!--                        <a:numberField name="unwrite_off_amount" allowFormat="true"-->
                        <!--                                       bindTarget="csh_transaction_receipt_write_off_detail_ds"-->
                        <!--                                       prompt="CSH513.REMAINING_WRITEOFF_AMOUNT"/>-->
                    </a:box>
1013
                    <a:box column="3" labelWidth="100">
高泉铭's avatar
高泉铭 committed
1014 1015 1016
                        <a:textField name="description" bindTarget="csh_transaction_receipt_write_off_detail_ds"
                                     prompt="摘要"
                                     readOnly="true" colspan="2" width="370"/>
Darming's avatar
Darming committed
1017
                        <a:numberField name="unwrite_off_amount" prompt="剩余可核销金额" renderer="Leaf.formatMoney"
1018
                                       bindTarget="csh_transaction_receipt_write_off_detail_ds" readOnly="true"/>
高泉铭's avatar
高泉铭 committed
1019
                    </a:box>
1020
                    <a:box column="3" labelWidth="100">
高泉铭's avatar
高泉铭 committed
1021 1022
                        <a:textField colspan="2" name="ref_v05" bindTarget="csh_transaction_receipt_write_off_detail_ds"
                                     prompt="备注" width="370" readOnly="true"/>
Darming's avatar
Darming committed
1023
                        <a:numberField name="returned_amount" prompt="已退款金额" renderer="Leaf.formatMoney"
1024
                                       bindTarget="csh_transaction_receipt_write_off_detail_ds" readOnly="true"/>
高泉铭's avatar
高泉铭 committed
1025
                    </a:box>
Darming's avatar
Darming committed
1026
                    <a:box column="3" labelWidth="100">
1027
                        <a:label prompt="附件上传" colspan="2" bindTarget="csh_transaction_receipt_write_off_detail_ds"
Darming's avatar
Darming committed
1028
                                 renderer="attachment_rendered" width="370"/>
1029
                        <a:numberField name="for_allocate_amount" renderer="Leaf.formatMoney" prompt="剩余可分配金额" readOnly="true" bindTarget="csh_transaction_receipt_write_off_detail_ds" />
高泉铭's avatar
高泉铭 committed
1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053
                    </a:box>

                    <!--                    <a:box column="4" labelWidth="100">-->
                    <!--                        <a:textField name="review_status_desc" prompt="分配状态"-->
                    <!--                                     bindTarget="csh_transaction_receipt_write_off_detail_ds"/>-->
                    <!--                        <a:textField name="purpose" prompt="用途" readOnly="true"-->
                    <!--                                     bindTarget="csh_transaction_receipt_write_off_detail_ds"/>-->

                    <!--                        <a:numberField name="approving_return_amount" allowFormat="true"-->
                    <!--                                       bindTarget="csh_transaction_receipt_write_off_detail_ds" prompt="审批中退款金额"/>-->
                    <!--                    </a:box>-->
                    <!--                    <a:box column="4" labelWidth="100">-->

                    <!--                        <a:comboBox name="collection_classes_desc"-->
                    <!--                                    bindTarget="csh_transaction_receipt_write_off_detail_ds"-->
                    <!--                                    prompt="款项分类"/>-->

                    <!--                        <a:gridButton click="csh531n_save" text="HLS.SAVE"/>-->
                    <!--                    </a:box>-->
                    <!--<a:box column="2" labelWidth="100">-->
                    <!--<a:textArea name="description" bindTarget="csh_transaction_receipt_write_off_detail_ds" prompt="摘要" readOnly="true" width="405"/>-->
                    <!--</a:box>-->
                </a:fieldSet>
                <a:fieldSet labelWidth="250" title="账户信息">
1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076
                    <a:box column="3" labelWidth="100">
                        <!--                        <a:textField name="bp_bank_account_name" prompt="对方账户"-->
                        <!--                                     bindTarget="csh_transaction_receipt_write_off_detail_ds"/>-->
                        <!--                        <a:textField name="bp_bank_account_num" prompt="对方账号"-->
                        <!--                                     bindTarget="csh_transaction_receipt_write_off_detail_ds"/>-->
                        <!--                        <a:textField name="write_off_flag_desc" prompt="核销状态"-->
                        <!--                                     bindTarget="csh_transaction_receipt_write_off_detail_ds"/>-->
                        <a:textField name="bank_account_name" bindTarget="csh_transaction_receipt_write_off_detail_ds"
                                     prompt="CSH510.CSH_TRANSACTION.MY_ACCOUNT_NAME"/>
                        <a:textField name="bank_branch_name" bindTarget="csh_transaction_receipt_write_off_detail_ds"
                                     prompt="CSH510.CSH_TRANSACTION.MY_BANK_NAME"/>
                        <a:textField name="bank_account_num" bindTarget="csh_transaction_receipt_write_off_detail_ds"
                                     prompt="CSH510.CSH_TRANSACTION.MY_ACCOUNT_USERNAME"/>
                        <!--对方账户户名-->
                        <a:textField name="bp_bank_account_name"
                                     bindTarget="csh_transaction_receipt_write_off_detail_ds"
                                     prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_NAME"/>
                        <!--对方银行名称-->
                        <a:textField name="opposite_band_na" bindTarget="csh_transaction_receipt_write_off_detail_ds"
                                     prompt="CSH510.CSH_TRANSACTION.YOUR_BANK_NAME"/>
                        <!--对方账户账号-->
                        <a:textField name="bp_bank_account_num" bindTarget="csh_transaction_receipt_write_off_detail_ds"
                                     prompt="CSH510.CSH_TRANSACTION.YOUR_ACCOUNT_USERNAME"/>
高泉铭's avatar
高泉铭 committed
1077 1078
                    </a:box>
                </a:fieldSet>
Spencer Chang's avatar
Spencer Chang committed
1079
            </a:form>
高泉铭's avatar
高泉铭 committed
1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101
            <a:tabPanel height="450" marginWidth="30" style="margin-left:20px;">
                <a:tabs>
                    <a:tab prompt="核销债权" width="120" id="write_off_rental">
                        <a:grid id="csh_write_off_grid" bindTarget="csh_write_off_interface_ds" height="370"
                                marginWidth="10" navBar="true">
                            <a:toolBar>
                                <a:button id="csh_grid_add_bt" type="add"/>
                                <a:button id="csh_grid_delete_bt" type="delete"/>
                            </a:toolBar>
                            <a:columns>
                                <!--<a:column name="csh_bank_slip_num" footerRenderer="summaryRenderer" prompt="CSH531.BANK_SLIP_NUM" width="120"/>-->
                                <!--                                <a:column name="write_off_type_desc" editorFunction="csh_edit_function"-->
                                <!--                                          prompt="HLS.WRITE_OFF_TYPE"-->
                                <!--                                          width="100"/>-->
                                <a:column name="contract_number" editorFunction="csh_edit_function" align="center"
                                          prompt="HLS.CONTRACT_NUMBER"
                                          width="120"/>
                                <a:column name="bp_tenant_name" prompt="承租人" width="120"/>
                                <a:column name="write_off_cf_item_desc" editorFunction="csh_edit_function"
                                          align="center"
                                          prompt="CSH531.CF_ITEM"
                                          width="80"/>
Darming's avatar
Darming committed
1102 1103
                                <a:column name="due_date" prompt="支付日" renderer="Leaf.formatDate" width="80"
                                          align="center"/>
高泉铭's avatar
高泉铭 committed
1104 1105
                                <a:column name="write_off_times" prompt="HLS.TIMES" align="center"
                                          width="80"/>
Darming's avatar
Darming committed
1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121
                                <!--                                <a:column name="left_principal" renderer="Leaf.formatMoney" prompt="未收本金"-->
                                <!--                                          width="120" align="right"/>-->
                                <!--                                <a:column name="left_interest" renderer="Leaf.formatMoney" prompt="未收利息"-->
                                <!--                                          width="120"-->
                                <!--                                          align="right"/>-->
                                <!--                                <a:column name="left_amount" renderer="Leaf.formatMoney" prompt="未收金额"-->
                                <!--                                          width="120"-->
                                <!--                                          align="right"/>-->
                                <a:column name="principal" renderer="Leaf.formatMoney" prompt="应收本金"
                                          width="120" align="right"/>
                                <a:column name="interest" renderer="Leaf.formatMoney" prompt="应收利息"
                                          width="120"
                                          align="right"/>
                                <a:column name="due_amount" renderer="Leaf.formatMoney" prompt="应收金额"
                                          width="120"
                                          align="right"/>
高泉铭's avatar
高泉铭 committed
1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143
                                <!--                                <a:column name="write_off_bp_name" editorFunction="csh_edit_function"-->
                                <!--                                          prompt="CSH531.WRITE_OFF_BP_NAME" width="100"/>-->
                                <!--                                <a:column name="left_amount" align="right" footerRenderer="summaryRenderer"-->
                                <!--                                          prompt="剩余金额"-->
                                <!--                                          renderer="Leaf.formatMoney" width="120"/>-->
                                <!--<a:column name="left_principal" align="right" footerRenderer="summaryRenderer" prompt="剩余本金" renderer="Leaf.formatMoney" width="120"/>-->
                                <!--<a:column name="left_interest" align="right" footerRenderer="summaryRenderer" prompt="剩余利息" renderer="Leaf.formatMoney" width="120"/>-->
                                <!--                                <a:column name="write_off_classification_desc" editorFunction="csh_edit_function"-->
                                <!--                                          prompt="核销分类"/>-->
                                <!--                                <a:column name="write_off_date" align="center" editorFunction="csh_edit_function"-->
                                <!--                                          renderer="Leaf.formatDate" prompt="核销基准日期" width="120"/>-->
                                <!--                                <a:column name="journal_date" align="center" editorFunction="csh_edit_function"-->
                                <!--                                          renderer="Leaf.formatDate" prompt="凭证日期" width="120"/>-->
                                <a:column name="unreceived_amount" align="right" editorFunction="csh_edit_function"
                                          footerRenderer="summaryRenderer" prompt="未收金额"
                                          renderer="Leaf.formatMoney"
                                          width="120"/>
                                <a:column name="write_off_amount" align="right" editorFunction="csh_edit_function"
                                          footerRenderer="summaryRenderer" prompt="核销金额"
                                          renderer="Leaf.formatMoney"
                                          width="120"/>
                                <a:column name="write_off_date"
Darming's avatar
Darming committed
1144
                                          prompt="核销日期" editorFunction="csh_edit_function"
高泉铭's avatar
高泉铭 committed
1145 1146 1147 1148 1149
                                          renderer="Leaf.formatDate" width="80"/>
                                <!--<a:column name="agent_id_desc" editorFunction="csh_edit_function" prompt="代理商"/>-->
                            </a:columns>
                            <a:editors>
                                <a:textField id="csh_write_off_grid_tf"/>
Darming's avatar
Darming committed
1150 1151 1152 1153 1154
                                <a:numberField id="csh_write_off_grid_nf" allowNegative="false">
                                    <a:events>
                                        <a:event name="focus" handler="write_off_amount_dblclick"/>
                                    </a:events>
                                </a:numberField>
高泉铭's avatar
高泉铭 committed
1155 1156 1157 1158
                                <a:datePicker id="csh_write_off_grid_dp"/>
                                <a:comboBox id="csh_write_off_grid_cb"/>
                                <a:lov id="csh_write_off_grid_lv"/>
                            </a:editors>
Darming's avatar
Darming committed
1159 1160 1161
                            <a:events>
                                <a:event name="dblclick" handler="write_off_amount_dblclick"/>
                            </a:events>
高泉铭's avatar
高泉铭 committed
1162 1163
                        </a:grid>
                    </a:tab>
18083's avatar
18083 committed
1164
                    <a:tab id="write_off_deposit" tabStyle="display:none" prompt="核销为融租保证金" width="150">
高泉铭's avatar
高泉铭 committed
1165 1166 1167 1168
                        <a:grid id="csh_transaction_deposit_grid" navBar="true"
                                bindTarget="csh_transaction_deposit_ds"
                                height="370"
                                marginWidth="10">
niminmin's avatar
niminmin committed
1169 1170 1171 1172
                            <a:toolBar>
                                <a:button id="csh_grid_deposit_add_bt" type="add"/>
                                <a:button id="csh_grid_deposit_delete_bt" type="delete"/>
                            </a:toolBar>
高泉铭's avatar
高泉铭 committed
1173
                            <a:columns>
niminmin's avatar
niminmin committed
1174
                                <a:column name="bp_name" prompt="商业伙伴" width="180" align="center"
高泉铭's avatar
高泉铭 committed
1175
                                          editor="csh_transaction_deposit_grid_lv"/>
1176 1177
                                <a:column name="write_off_amount" prompt="核销金额"
                                          editorFunction="csh_deposit_edit_function" renderer="Leaf.formatMoney"
高泉铭's avatar
高泉铭 committed
1178
                                          width="180"
1179
                                          align="right"
高泉铭's avatar
高泉铭 committed
1180 1181
                                          footerRenderer="summaryRenderer"/>
                                <a:column name="write_off_date" prompt="核销日期" width="180" align="center"
Darming's avatar
Darming committed
1182
                                          renderer="Leaf.formatDate" editorFunction="csh_edit_function"/>
高泉铭's avatar
高泉铭 committed
1183 1184 1185
                            </a:columns>
                            <a:editors>
                                <a:lov id="csh_transaction_deposit_grid_lv"/>
niminmin's avatar
niminmin committed
1186 1187 1188 1189 1190
                                <a:numberField id="csh_transaction_deposit_grid_nf" allowNegative="false">
                                    <a:events>
                                        <a:event name="focus" handler="write_off_amount_dblclick"/>
                                    </a:events>
                                </a:numberField>
高泉铭's avatar
高泉铭 committed
1191 1192
                                <a:datePicker id="csh_transaction_deposit_grid_dp"/>
                            </a:editors>
niminmin's avatar
niminmin committed
1193 1194 1195
                            <a:events>
                                <a:event name="dblclick" handler="write_off_amount_dblclick"/>
                            </a:events>
高泉铭's avatar
高泉铭 committed
1196 1197
                        </a:grid>
                    </a:tab>
Darming's avatar
Darming committed
1198
                    <a:tab id="write_off_advance" tabStyle="display:none" prompt="核销为预收款" width="150">
高泉铭's avatar
高泉铭 committed
1199 1200 1201 1202 1203 1204 1205 1206 1207 1208
                        <a:grid id="csh_transaction_advanced_grid" navBar="true"
                                bindTarget="csh_transaction_advanced_ds" height="370"
                                marginWidth="10">
                            <!--                            <a:toolBar>-->
                            <!--                                <a:button id="csh_grid_advanced_add_bt" type="add"/>-->
                            <!--                                <a:button id="csh_grid_advanced_delete_bt" type="delete"/>-->
                            <!--                            </a:toolBar>-->
                            <a:columns>
                                <a:column name="bp_name" prompt="商业伙伴" width="180" align="center"
                                          editor="csh_transaction_advanced_grid_lv"/>
1209 1210
                                <a:column name="write_off_amount" prompt="核销金额"
                                          editorFunction="csh_advance_edit_function" renderer="Leaf.formatMoney"
高泉铭's avatar
高泉铭 committed
1211
                                          width="180"
1212
                                          align="right"
高泉铭's avatar
高泉铭 committed
1213 1214
                                          footerRenderer="summaryRenderer"/>
                                <a:column name="write_off_date" prompt="核销日期" width="180" align="center"
Darming's avatar
Darming committed
1215
                                          renderer="Leaf.formatDate" editorFunction="csh_edit_function"/>
Darming's avatar
Darming committed
1216
                                <!--                                <a:column name="create_wf_flag_desc" prompt="已核销标志"/>-->
高泉铭's avatar
高泉铭 committed
1217 1218 1219
                            </a:columns>
                            <a:editors>
                                <a:lov id="csh_transaction_advanced_grid_lv"/>
Darming's avatar
Darming committed
1220 1221 1222 1223 1224
                                <a:numberField id="csh_transaction_advanced_grid_nf" allowNegative="false">
                                    <a:events>
                                        <a:event name="focus" handler="write_off_amount_dblclick"/>
                                    </a:events>
                                </a:numberField>
高泉铭's avatar
高泉铭 committed
1225 1226
                                <a:datePicker id="csh_transaction_advanced_grid_dp"/>
                            </a:editors>
Darming's avatar
Darming committed
1227 1228 1229
                            <a:events>
                                <a:event name="dblclick" handler="write_off_amount_dblclick"/>
                            </a:events>
高泉铭's avatar
高泉铭 committed
1230
                        </a:grid>
18083's avatar
18083 committed
1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264
                    </a:tab>
				   <a:tab id="write_off_operat" tabStyle="display:none" prompt="核销为经租保证金" width="150">
                        <a:grid id="csh_transaction_operat_grid" navBar="true"
                                bindTarget="csh_transaction_operat_ds"
                                height="370"
                                marginWidth="10">
                            <a:toolBar>
                                <a:button id="csh_grid_operat_add_bt" type="add"/>
                                <a:button id="csh_grid_operat_delete_bt" type="delete"/>
                            </a:toolBar>
                            <a:columns>
                                <a:column name="bp_name" prompt="商业伙伴" width="180" align="center"
                                          editor="csh_transaction_operat_grid_lv"/>
                                <a:column name="write_off_amount" prompt="核销金额"
                                          editorFunction="csh_operat_edit_function" renderer="Leaf.formatMoney"
                                          width="180"
                                          align="right"
                                          footerRenderer="summaryRenderer"/>
                                <a:column name="write_off_date" prompt="核销日期" width="180" align="center"
                                          renderer="Leaf.formatDate" editorFunction="csh_edit_function"/>
                            </a:columns>
                            <a:editors>
                                <a:lov id="csh_transaction_operat_grid_lv"/>
                                <a:numberField id="csh_transaction_operat_grid_nf" allowNegative="false">
                                    <a:events>
                                        <a:event name="focus" handler="write_off_amount_dblclick"/>
                                    </a:events>
                                </a:numberField>
                                <a:datePicker id="csh_transaction_operat_grid_dp"/>
                            </a:editors>
                            <a:events>
                                <a:event name="dblclick" handler="write_off_amount_dblclick"/>
                            </a:events>
                        </a:grid>
高泉铭's avatar
高泉铭 committed
1265 1266 1267
                    </a:tab>
                </a:tabs>
            </a:tabPanel>
Spencer Chang's avatar
Spencer Chang committed
1268 1269 1270 1271 1272 1273
        </a:screenBody>
        <script type="text/javascript"><![CDATA[
        Leaf.onReady(init);
        ]]></script>
    </a:view>
</a:screen>