<?xml version="1.0" encoding="UTF-8"?>
<a:service xmlns:ns1="leaf.application.action" xmlns:p="uncertain.proc" xmlns:a="http://www.leaf-framework.org/application" xmlns:s="leaf.plugin.script" trace="true">
    <a:init-procedure>
        <s:server-script import="app/app_login_check.js"><![CDATA[
        //开票信息_下拉框
            function lov_query() { 
                var taxpayer_type_details;
                
                try {
                    var taxpayer_type_bm = $bm('app.bp_master.hls_taxpayer_type_list');
                    var taxpayer_type_map = taxpayer_type_bm.queryAsMap();
                    taxpayer_type_details = taxpayer_type_map.getChildren();
                    
                    $ctx.parameter.return_status = 'S';
                    $ctx.parameter.return_message = '执行成功';
                    
                } catch (e) {
                    $ctx.parameter.return_status = 'E';
                    $ctx.parameter.return_message = String(e);
                }
            
            
                var result = {
                    result: $ctx.parameter.return_status,
                    message: $ctx.parameter.return_message,

                    taxpayer_type_list: []
                };
                
                var taxpayer_type_list = result.taxpayer_type_list;
            	
            	for (var j = 0;j < taxpayer_type_details.length;j++) {
                    var taxpayer_type_detail = taxpayer_type_details[j];
                    taxpayer_type_list.push({
                        "code": taxpayer_type_detail.code,
                        "code_name": taxpayer_type_detail.code_name
                    });
                }
            	
                $ctx.parameter.json = JSON.stringify(result);
            }
            
            if ($ctx.parameter.return_status != 'E'&& $ctx.parameter.return_status != 'TIMEOUT') {
                lov_query();
            }
        ]]></s:server-script>
    </a:init-procedure>
    <a:service-output output="/parameter/@json"/>
</a:service>
