<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true"
          trace="true">
    <a:init-procedure/>
    <a:view>
        <a:link id="contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="con_contract_ifrs9_link" url="${/request/@context_path}/modules/cont/CON3500/contract_ifrs9_report_query.lview"/>

        <a:link id="${/parameter/@layout_code}con_contract_query_link"
                url="${/request/@context_path}/modules/cont/CON505/con_contract_modify.lview"/>
        <style>
            body{
                font-size: 12px;
            }
        </style>
        <script type="text/javascript"><![CDATA[
        window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
            var ds_id = get_dsid_by_tabcode_basetable(
                window['${/parameter/@layout_code}_layoutDataSetList'],
                'F_QUERY',
                'con_contract'
            );
            var param={};

            var period_name=$(ds_id).getAt(0).get('period_name');
            var record = $(ds_id).getAt(0);
            record.data.division1='';
            record.data.division2='';
            record.data.division3='';
            record.data.division4='';
            record.data.division5='';
            record.data.division6='';
            record.data.division7='';
            record.data.division8='';
            record.data.division9='';
            record.data.division10='';
            record.data.division11='';
            if(record.data.lease_name10=='Y'){
                record.data.division1='10';
            }
            if(record.data.lease_name20=='Y'){
                record.data.division2='20';
            }
            if(record.data.lease_name30=='Y'){
                record.data.division3='30';
            }
            if(record.data.lease_name40=='Y'){
                record.data.division4='40';
            }
            if(record.data.lease_name50=='Y'){
                record.data.division5='50';
            }
            if(record.data.lease_name60=='Y'){
                record.data.division6='60';
            }
            if(record.data.lease_name70=='Y'){
                record.data.division7='70';
            };
            if(record.data.lease_name80=='Y'){
                record.data.division8='80';
            };
            if(record.data.lease_name90=='Y'){
                record.data.division9='90';
            };
            if(record.data.lease_name91=='Y'){
                record.data.division10='91';
            };
            if(record.data.lease_name92=='Y'){
                record.data.division11='92';
            };
         //   record.data.division=record.data.division.substr(1,record.data.division.length);
            if(record.data.division1 == ''&&record.data.division2 == ''&&record.data.division3 == ''&&record.data.division4 == ''
                &&record.data.division5 == ''&&record.data.division6 == ''&&record.data.division7 == ''&&record.data.division8 == ''&&record.data.division9 == ''&&record.data.division10 == ''&&record.data.division11 == ''){
               // record.data.division1='10,20,30,40,50,60,70,80';
                record.data.division1='10';
                record.data.division2='20';
                record.data.division3='30';
                record.data.division4='40';
                record.data.division5='50';
                record.data.division6='60';
                record.data.division7='70';
                record.data.division8='80';
                record.data.division9='90';
                record.data.division10='91';
                record.data.division11='92';
            };
            param['division1']= record.data.division1;
            param['division2']= record.data.division2;
            param['division3']= record.data.division3;
            param['division4']= record.data.division4;
            param['division5']= record.data.division5;
            param['division6']= record.data.division6;
            param['division7']= record.data.division7;
            param['division8']= record.data.division8;
            param['division9']= record.data.division9;
            param['division10']= record.data.division10;
            param['division11']= record.data.division11;
            param['period_name']=period_name;
            param['function_code'] = 'CON3400N';
            param['function_usage'] = 'MODIFY';
            param['url_title'] = 'IFRS9';
            param['winid']='ifrs9_win';

            var win = new Leaf.Window({
                id: 'ifrs9_win',
                url: $('con_contract_ifrs9_link').getUrl(),
                params: param,
                title: '发送信息',
                fullScreen: true
            });
            win.on('close', function () {
               document.getElementsByClassName('alert')[0].remove();
            });
           // hls_doc_get_layout_code('contract_get_layout_code_link_id', param, 'con_contract_ifrs9_link',ds_id);

        }


        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>
