
<!DOCTYPE html>
<html lang="pt-br">

    <head>
        <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, shrink-to-fit=no">

<meta name="ROBOTS" content="INDEX, FOLLOW" />
<meta name="description" content="Questor Cloud using Synopse mORMot MVC">
<meta name="copyright" content="&copy;2015 <a href=http://www.questor.com.br>Questor Sistemas S.A.</a>" />
<meta name="author" content="">  
  
<link rel="icon" href=".static/images/npmnFis.ico">


<title> 
     Fiscal 
    
</title>

  <!-- metronic 6 -->

    <!--begin::Fonts -->
    <script src="https://ajax.googleapis.com/ajax/libs/webfont/1.6.16/webfont.js"></script>
    <script>
        WebFont.load({
            google: {
                "families": ["Poppins:300,400,500,600,700", "Roboto:300,400,500,600,700"]
            },
            active: function() {
                sessionStorage.fonts = true;
            }
        });
    </script>

    <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous">
    </script>
    <script type="text/javascript" src=".static/js/bootstrap-datepicker.min.js"></script>
    <script type="text/javascript" src=".static/js/bootstrap-datepicker.pt-BR.min.js"></script>

    <!--end::Fonts -->

    <!--begin::Page Vendors Styles(used by this page) -->
    <link href=".static/metronic/vendors/custom/fullcalendar/fullcalendar.bundle.css" rel="stylesheet" type="text/css" />
    <!--end::Page Vendors Styles -->

    <!--begin::Global Theme Styles(used by all pages) -->
    <link href=".static/metronic/css/demo7/style.bundle.css" rel="stylesheet" type="text/css" />

    <!--end::Global Theme Styles -->

    <!--begin::Layout Skins(used by all pages) -->
    <link href=".static/metronic/css/demo7/pages/general/wizard/wizard-3.css" rel="stylesheet" type="text/css"/>
    <link href=".static/metronic/css/demo7/pages/general/wizard/wizard-2.css" rel="stylesheet" type="text/css"/>
    <!--end::Layout Skins -->
    <link rel="shortcut icon" href=".static/images/logo_questor_q.png" />


    <!-- metronic 6 -->

<!-- devextreme -->
<!-- <link href=".static/template/empresarialHead/vendors.min.css" rel="stylesheet"> -->
<link href=".static/css/devextreme/dx.common.css" rel="stylesheet">
<link href=".static/css/devextreme/dx.light.css" rel="stylesheet">
<link href=".static/css/devextreme/dx.light.compact.css" rel="stylesheet">
<!-- devextreme -->


<!-- |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -->
<link href=".static/metronic/vendors/custom/jstree/jstree.bundle.css" rel="stylesheet" />

<link href=".static/css/asideMenu.css" rel="stylesheet" />

<link href=".static/vendors/introjs/introjs.min.css" rel="stylesheet" />
<link href=".static/template/empresarialHead/app.min.css" rel="stylesheet">
<link href=".static/template/compact.css" rel="stylesheet">

<link href=".static/css/custom.css" rel="stylesheet"/>



		<!--script src=".static/js/custom.js"></script-->

<!--  SCRIPTS  -->
<script type="text/javascript" src=".static/webroot/assets/js/funcoes.js"></script>


<script src=".static/js/lodash.js"></script>
<script src=".static/vendors/moment/lang/pt-br.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/6.5.3/rxjs.umd.min.js"></script>


<script src=".static/dist/qcloud.bundle.js"></script>
<script type="text/javascript" src=".static/js/prettifyXml.js"></script>
<script type="text/javascript" src=".static/js/nRequests.js"></script>
<script type="text/javascript" src=".static/js/nCaptcha.js"></script>
<script type="text/javascript" src=".static/js/nWebUtil.js"></script>
<script src=".static/js/helpUtility.js"></script>

<link href=".static/template/custom/datatables/datatables.bundle.css" rel="stylesheet"/>

<link rel="stylesheet" href=".static/vendors/jQuery-ContextMenu/jquery.contextMenu.min.css">

<script src=".static/vendors/jQuery-ContextMenu/jquery.contextMenu.min.js"></script>
<script src=".static/vendors/jQuery-ContextMenu/jquery.ui.position.js"></script>
    <script> $ModoDebug = true; </script>
 
        <link href=".static/css/login.css" rel="stylesheet" >
        <script>
            $(function () {
                window.rootPath = ".static";
                
                $selecao = '';
                $.each(sessionStorage, function(key, value) {
                    if (key.indexOf('menu') !=  -1) {
                        sessionStorage.removeItem(key);
                    }
                });
                sessionStorage.removeItem('itempesquisamenu');

            });
        </script>
</head>

{{>GoogleTag}}

<body class="login" data-rootpath="/" class="kt-quick-panel--right kt-demo-panel--right kt-offcanvas-panel--right kt-header--fixed kt-header-mobile--fixed kt-subheader--enabled kt-subheader--fixed kt-subheader--solid kt-aside--enabled kt-aside--fixed kt-aside--minimize">
    <div id="kt_aside"> </div>
    <link href=".static/metronic/css/demo7/pages/general/login/login-1.css" rel="stylesheet" type="text/css">
       
        <!-- begin:: Page -->
        <div class="kt-grid kt-grid--ver kt-grid--root kt-page">
            <div class="kt-grid kt-grid--hor kt-grid--root  kt-login kt-login--v1" id="kt_login">
                <div class="kt-grid__item kt-grid__item--fluid kt-grid kt-grid--desktop kt-grid--ver-desktop kt-grid--hor-tablet-and-mobile">
                    <!--begin::Aside-->
                    <div class="kt-grid__item kt-grid__item--order-tablet-and-mobile-2 kt-grid kt-grid--hor kt-login__aside" id="longin-aside" >
                        <div class="kt-grid__item kt-grid__item--fluid kt-grid kt-grid--ver">
                            <div class="kt-grid__item kt-grid__item--middle">
                                <div class="kt-login__title questor-login-title">
                                    <span>Questor Cloud, seus dados com você</span><span> 24h por dia</span> 
                                </div>
                                <h4 class="kt-login__subtitle">
                                    Criamos um ambiente misto onde o atual Questor Gestão Contábil e o novo Questor Cloud
                                    compartilham o mesmo banco de dados e executam as mesmas funções e papéis, um em
                                    desktop o outro em browser. Os usuários podem acessar aos dados simultaneamente, tanto
                                    na plataforma atual (Desktop) quanto na nova plataforma em nuvem.
                                </h4>
                                <h4 class="kt-login__subtitle">
                                    O Questor Cloud oferece toda a mobilidade necessária para ter acesso as informações.
                                    O cliente pode utilizar a sua infraestrutura ou a da Questor. Flexibilidade e praticidade que só a Questor oferece.
                                </h4>
                            </div>
                        </div>
                        <div class="kt-grid__item">
                            <div class="kt-login__info">
                                <div class="kt-login__copyright">
                                <h6> © 2019 Questor Sistemas </h6>
                                </div>
                                <div class="kt-login__menu text-right">
                                    <a target="_blank" class="kt-link btn btn-outline-light btn-outline-hover-orange-q" href="#">Termos e condições</a>
                                    <a target="_blank" class="kt-link btn btn-outline-light btn-outline-hover-orange-q" href="http://questor.com.br/#fale-conosco">Contato</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--begin::Aside-->
            
                    <!--begin::Content-->
                    <div class="kt-grid__item kt-grid__item--fluid  kt-grid__item--order-tablet-and-mobile-1  kt-login__wrapper">
                        <!--begin::Head-->
                        <div class="kt-login__head" style="display: flex; align-items: center">
                            <a href="//www.questor.com.br" target="_blank" style="float: left">
                                <img src=".static/images/logo-questor-q.png" style="width: 150px; background-size: 100px; align-self: flex-start; height: auto" class="login-logo">
                            </a>

                            <!-- <div style="margin-left: auto">
                                <a href="Logout"> 
                                    <span class="kt-login__signup-label"> Sair </span>&nbsp;&nbsp;
                                </a>
                            </div> -->
                        </div>
                        <!--end::Head-->
            
                        <!--begin::Body-->    

                        <div class="kt-login__body" style="height: 90%">
            
                            <!--begin::Signin-->
                            <div class="kt-login__form" id="content_login">
                                <div class="image-form">
                                    <img class="image-company-selection" src=".static/images/login/company-selection.png">
                                </div>
                    
                                <div class="kt-login__title text-left" style="margin-bottom: 0">
                                    <h3>Informe os parâmetros desejados:</h3>
                                </div>

                                <script>
                                    $FormularioAtual = FormManager.Novo({
																				classe: 'TnDMSelecao', 
																				alias: '', 
																				formdetalhe: null, 
																				chavePrimaria: null, 
																				masterclass: null,
																				masterfields: null,
																				detailfields: null,
																				filtrofixo: null, 
																				multiColumn: true,
																				caption: ''
																			});

                                    $FormularioAtual.tipoObjeto = 'ntoProcesso'; 
                                    $FormularioMestre = $FormularioAtual; 
                                </script>
                                <!-- begin:Form -->
                                <form novalidate id="frmParametros" class="formTnDMSelecao kt-form" name="p.Class" action="Selecionar" method="post" data-class="" data-alias="">
                                     


<div class="kt-portlet__body col-lg-12" data-select2-id="12">
	<div class="row">
		<div class="col-md-12 validation-summary-wrapper">
		</div>
	</div>
	<div class="form-fields row anchor-accordion">
			<div id="formField1" 
					 class="input-block form-group kt-form__group col-md-12 "> 
						<label id="labelctrloptCODIGOEMPRESA" for="ctrlCODIGOEMPRESA" class=" col-form-label   ">
		<span data-text>Empresa</span> <span data-span-required="CODIGOEMPRESA" > * </span> 		
	</label> 
	
	
        			<div class="input-group "> <!-- class="col-12 col-sm-9" -->
					<div class="input-group input-addon-default col-md-12" style="padding-left: 0px; padding-right: 0px">
						<input autocomplete="off" 
							data-button="btnCODIGOEMPRESA"
							data-Dicionario="" 
							data-haslinklookup="true" 
							data-multicolumn="true"
							data-value="1062"
							data-lookup="Empresa Questor Sistemas"
							class="form-control kt-input cad-control cad-logchange text-right ctrlCODIGOEMPRESA " 
							id="ctrlCODIGOEMPRESA" 
							name="p.CODIGOEMPRESA" 
							onblur="FindLookupValue('CODIGOEMPRESA', 'TnDMSelecao', '')"
							onfocus="focusImputFunc(this, true)" 
							style="text-align: left !important; " 
							title="Informe o código da empresa" 
							type="text"  
							value="1062" 
							data-mask="0000" 
							data-mask-reverse="true" 
							 
							required
							
							>
						<div class="input-group-append">
							<button class="kt-btn btn btn-sm btn-secondary kt-dropdown__toggle "  tabindex="-1" type="button"
								id="btnCODIGOEMPRESA" 
								data-original-title="Incluir um Novo" 
								data-toggle="modal" 
								data-target="#myModal"
								data-id="ctrlCODIGOEMPRESA"
								data-LinkLookupDataSetNome="nGemDCEmpresa"
								data-LinkLookupKeyFields="CODIGOEMPRESA"
								data-LinkKeyFields="CODIGOEMPRESA"
								data-LinkLookupMultiSelecao="false"
								data-LinkLookupResultField="NOMEEMPRESA"					  
								data-NomesValores=""
								data-control="ctrlCODIGOEMPRESA"
								data-dmclassName="TnDMSelecao"
								
								
							><i class="la la-search "></i></button>
						</div>
					</div>

					<input autocomplete="off" type="hidden" class="form-control kt-input cad-control" name="p.CODIGOEMPRESAresult" id="ctrlCODIGOEMPRESAresult" value="Empresa Questor Sistemas" disabled>
					<script>
						//$FormularioAtual.addfield('CODIGOEMPRESAresult', $('.formTnDMSelecao #ctrlCODIGOEMPRESAresult'),null,null,null,null,null,null,null, true);
						//$FormularioAtual.addfield('CODIGOEMPRESAresultText', $('.formTnDMSelecao #ctrlCODIGOEMPRESAresultText'), null,null,null,null,null,null,null, true);
						$FormularioAtual.addfield({
								nome: 'CODIGOEMPRESAresult', 
								componente: $('.formTnDMSelecao #ctrlCODIGOEMPRESAresult'),
								linkbutton: null,
								label: null,
								resultcomponente: null,
								componenteimage: null,
								resultcomponentetext: null,
								visible: null,
								index: null, 
								isMultiColumn: true
							});
						$FormularioAtual.addfield({
								nome: 'CODIGOEMPRESAresultText', 
								componente: $('.formTnDMSelecao #ctrlCODIGOEMPRESAresultText'), 
								linkbutton: null,
								label: null,
								resultcomponente: null,
								componenteimage: null,
								resultcomponentetext: null,
								visible: null,
								index: null, 
								isMultiColumn: true
							});
					</script>
					<script>
    addFieldToForm('CODIGOEMPRESA', 
	               'TnDMSelecao', 
				   '', 
				   false,
				   true,
				   1,
				   true,
				   null
                   );
</script>

			</div>			
			
					
	
				
		
			





			</div>
					
			<div id="formField2" 
					 class="input-block form-group kt-form__group col-md-12 "> 
						<label id="labelctrloptCODIGOESTAB" for="ctrlCODIGOESTAB" class=" col-form-label   ">
		<span data-text>Filial</span> <span data-span-required="CODIGOESTAB" > * </span> 		
	</label> 
	
	
        			<div class="input-group "> <!-- class="col-12 col-sm-9" -->
					<div class="input-group input-addon-default col-md-12" style="padding-left: 0px; padding-right: 0px">
						<input autocomplete="off" 
							data-button="btnCODIGOESTAB"
							data-Dicionario="" 
							data-haslinklookup="true" 
							data-multicolumn="true"
							data-value="1"
							data-lookup="Empresa Questor Sistemas-Matriz"
							class="form-control kt-input cad-control cad-logchange text-right ctrlCODIGOESTAB " 
							id="ctrlCODIGOESTAB" 
							name="p.CODIGOESTAB" 
							onblur="FindLookupValue('CODIGOESTAB', 'TnDMSelecao', '')"
							onfocus="focusImputFunc(this, true)" 
							style="text-align: left !important; " 
							title="Informe o código da matriz ou filial" 
							type="text"  
							value="1" 
							data-mask="0000" 
							data-mask-reverse="true" 
							 
							required
							
							>
						<div class="input-group-append">
							<button class="kt-btn btn btn-sm btn-secondary kt-dropdown__toggle "  tabindex="-1" type="button"
								id="btnCODIGOESTAB" 
								data-original-title="Incluir um Novo" 
								data-toggle="modal" 
								data-target="#myModal"
								data-id="ctrlCODIGOESTAB"
								data-LinkLookupDataSetNome="nGemDCEstab"
								data-LinkLookupKeyFields="CODIGOEMPRESA;CODIGOESTAB"
								data-LinkKeyFields="CODIGOEMPRESA;CODIGOESTAB"
								data-LinkLookupMultiSelecao="false"
								data-LinkLookupResultField="NOMEESTAB"					  
								data-NomesValores=""
								data-control="ctrlCODIGOESTAB"
								data-dmclassName="TnDMSelecao"
								
								
							><i class="la la-search "></i></button>
						</div>
					</div>

					<input autocomplete="off" type="hidden" class="form-control kt-input cad-control" name="p.CODIGOESTABresult" id="ctrlCODIGOESTABresult" value="Empresa Questor Sistemas-Matriz" disabled>
					<script>
						//$FormularioAtual.addfield('CODIGOESTABresult', $('.formTnDMSelecao #ctrlCODIGOESTABresult'),null,null,null,null,null,null,null, true);
						//$FormularioAtual.addfield('CODIGOESTABresultText', $('.formTnDMSelecao #ctrlCODIGOESTABresultText'), null,null,null,null,null,null,null, true);
						$FormularioAtual.addfield({
								nome: 'CODIGOESTABresult', 
								componente: $('.formTnDMSelecao #ctrlCODIGOESTABresult'),
								linkbutton: null,
								label: null,
								resultcomponente: null,
								componenteimage: null,
								resultcomponentetext: null,
								visible: null,
								index: null, 
								isMultiColumn: true
							});
						$FormularioAtual.addfield({
								nome: 'CODIGOESTABresultText', 
								componente: $('.formTnDMSelecao #ctrlCODIGOESTABresultText'), 
								linkbutton: null,
								label: null,
								resultcomponente: null,
								componenteimage: null,
								resultcomponentetext: null,
								visible: null,
								index: null, 
								isMultiColumn: true
							});
					</script>
					<script>
    addFieldToForm('CODIGOESTAB', 
	               'TnDMSelecao', 
				   '', 
				   false,
				   true,
				   2,
				   true,
				   null
                   );
</script>

			</div>			
			
					
	
				
		
			





			</div>
					
			<div id="formField3" 
					 class="input-block form-group kt-form__group col-md-12 "> 
						<label id="labelctrloptDATALCTOFIS_MAIORIGUAL" for="ctrlDATALCTOFIS_MAIORIGUAL" class=" col-form-label   ">
		<span data-text>Período Inicial</span> <span data-span-required="DATALCTOFIS_MAIORIGUAL" > * </span> 		
	</label> 
	
	
        			<div class=" input-group   "> 
					<div class="input-group">
						<div class="input-group-prepend">
							<span class=" btn btn-secondary btn-icon  input-group-text "><i class="far fa-calendar-alt "></i></span>
						</div>
						<input autocomplete="off" onfocus="focusImputFunc('ctrlDATALCTOFIS_MAIORIGUAL')" type="text"  
							data-mask= "00/00/0000"  
							class="form-control kt-input cad-control cad-logchange datepicker ctrlDATALCTOFIS_MAIORIGUAL " 
							title="Informe a data inicial para o filtro do período fiscal" value="" data-original-value="2018-12-01" data-Dicionario=""
							 style="" required >
					</div>
					<input autocomplete="off" type="hidden" class="hasdatepicker" id="ctrlDATALCTOFIS_MAIORIGUAL" name="p.DATALCTOFIS_MAIORIGUAL" value="2018-12-01" data-Dicionario="" 
	data-fracontrol-script="true"
	data-name="DATALCTOFIS_MAIORIGUAL"
	data-classname="TnDMSelecao"
	data-alias=""
	data-isimage="false"
	data-visible="true"
	data-index="3"
	data-multicolumn="true"
	data-isgroupcolumn="null"
	data-expressoes="null"
 >
				
				
				<script>
    addFieldToForm('DATALCTOFIS_MAIORIGUAL', 
	               'TnDMSelecao', 
				   '', 
				   false,
				   true,
				   3,
				   true,
				   null
                   );
</script>

			</div>
			
					
	
				
		
			





			</div>
					
			<div id="formField4" 
					 class="input-block form-group kt-form__group col-md-12 "> 
						<label id="labelctrloptDATALCTOFIS_MENORIGUAL" for="ctrlDATALCTOFIS_MENORIGUAL" class=" col-form-label   ">
		<span data-text>Período Final</span> <span data-span-required="DATALCTOFIS_MENORIGUAL" > * </span> 		
	</label> 
	
	
        			<div class=" input-group   "> 
					<div class="input-group">
						<div class="input-group-prepend">
							<span class=" btn btn-secondary btn-icon  input-group-text "><i class="far fa-calendar-alt "></i></span>
						</div>
						<input autocomplete="off" onfocus="focusImputFunc('ctrlDATALCTOFIS_MENORIGUAL')" type="text"  
							data-mask= "00/00/0000"  
							class="form-control kt-input cad-control cad-logchange datepicker ctrlDATALCTOFIS_MENORIGUAL " 
							title="Informe a data final para o filtro do período fiscal" value="" data-original-value="2018-12-31" data-Dicionario=""
							 style="" required >
					</div>
					<input autocomplete="off" type="hidden" class="hasdatepicker" id="ctrlDATALCTOFIS_MENORIGUAL" name="p.DATALCTOFIS_MENORIGUAL" value="2018-12-31" data-Dicionario="" 
	data-fracontrol-script="true"
	data-name="DATALCTOFIS_MENORIGUAL"
	data-classname="TnDMSelecao"
	data-alias=""
	data-isimage="false"
	data-visible="true"
	data-index="4"
	data-multicolumn="true"
	data-isgroupcolumn="null"
	data-expressoes="null"
 >
				
				
				<script>
    addFieldToForm('DATALCTOFIS_MENORIGUAL', 
	               'TnDMSelecao', 
				   '', 
				   false,
				   true,
				   4,
				   true,
				   null
                   );
</script>

			</div>
			
					
	
				
		
			





			</div>
					
	
	</div>
	
</div>

<script> createFormSections([], true)</script>

	
 
                    
                                    <div class="row mt-1">
                                        <div class="col kt-align-left d-flex align-items-center">
                                            <a href="/home/Inicio" class="btn btn-outline-dark-q btn-outline-hover-orange-q">
                                                <span class="kt-nav-grid__text">&nbsp;Voltar</span>
                                            </a>
                                        </div>
                                        <div class="col kt-align-right">
                                            <button id="btnDefaultSubmit" class="btn kt-btn btn-dark-q kt-btn--wide kt-login__btn kt-login__btn--success" type="submit">
                                                Selecionar
                                            </button>
                                        </div>
                                        <script>
                                            $("#btnDefaultSubmit").on('click', function(event) {
                                                savedLookups = saveLookupFields();
                                                fixLookupFields();
                                                setTimeout(recoverLookupFields, 5, savedLookups);
                                                if (!ValidarCamposObrigatorios())
                                                    event.preventDefault();
                                            })
                                        </script>
                                    </div>
                    
                                </form>
                    
                            </div>
                            <!--end::Signin-->
                        </div>
                        <!--end::Body-->
                    </div>

                  
                    <script>
                        $(document).ready(function() {

                                $selecao = '';

                            $eventoExitUltimoBotao = ExecutarForm;
                            initLookupStyle(true, true);
                        });
                    </script>
                    <!--end::Content-->
                </div>
            </div>
        </div>
        <!-- end:: Page -->
        <!-- begin::Global Config(global config for global JS sciprts) -->
        <script>
            var KTAppSettings = {"colors":{"state":{"brand":"#22b9ff","light":"#ffffff","dark":"#282a3c","primary":"#5867dd","success":"#34bfa3","info":"#36a3f7","warning":"#ffb822","danger":"#fd3995"},"base":{"label":["#c5cbe3","#a1a8c3","#3d4465","#3e4466"],"shape":["#f0f3ff","#d9dffa","#afb4d4","#646c9a"]}}};
            var KTAppOptions = {"colors":{"state":{"brand":"#22b9ff","light":"#ffffff","dark":"#282a3c","primary":"#5867dd","success":"#34bfa3","info":"#36a3f7","warning":"#ffb822","danger":"#fd3995"},"base":{"label":["#c5cbe3","#a1a8c3","#3d4465","#3e4466"],"shape":["#f0f3ff","#d9dffa","#afb4d4","#646c9a"]}}};
        </script>
        <!-- end::Global Config -->

        <!--begin::Global Theme Bundle(used by all pages) -->
        <script src=".static/metronic/js/demo7/scripts.bundle.js" type="text/javascript"></script>
        <!--end::Global Theme Bundle -->

        <!--begin::Page Scripts(used by this page) -->
        <!-- <script src=".static/metronic/js/demo7/pages/login/login-1.js" type="text/javascript"></script> -->
        <!--end::Page Scripts -->
    
        <!-- end::Body -->
        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="ModalLabel">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title">Modal title</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">×</span>
        </button>
      </div>
      <div class="modal-body">
        <div class="kt-content" id="conteudo">
			<div class="kt-portlet kt-portlet--full-heigh">
				<div class="kt-portlet__body">										
					<div id="gridTools"></div>	
					<div id="dataGridModal"></div>
				</div>
			</div>
		</div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Sair</button>
        <button type="button" class="btn btn-primary" onclick="RetornarData()" data-dismiss="modal">Selecionar</button>
      </div>
    </div>
  </div>
</div>

<div class="modal fade" id="detalheModal" tabindex="-1" role="dialog" aria-labelledby="ModalLabel">
  <div class="modal-dialog modal-lg modal-xl  modal-dialog-centered" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title"></h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">×</span>
        </button>
      </div>
      <div class="modal-body iframe-modal">
        <div class="kt-content" id="conteudo" style="margin-bottom: -5px">
			<iframe id="framemodal" class="iframe-modal" width=100% onload="resizeIframe(this)">			
			</iframe>
		</div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Sair</button>        
      </div>
    </div>
  </div>
</div>

<div class="modal fade" id="xmlDetailModal" tabindex="-1" role="dialog" aria-labelledby="ModalLabel">
  <div class="modal-dialog modal-lg modal-xl  modal-dialog-centered" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title"></h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">×</span>
        </button>
      </div>
      <div class="modal-body iframe-modal">
      	<div class="kt-content" id="xmlContent" style="margin-bottom: -5px">
				</div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Sair</button>        
      </div>
    </div>
  </div>
</div>

<script>
    $OnBuildModalGrid = function(_AData){		
		var consulta = JSON.parse(_AData.consulta);		
		var dataSource = createdxDatasource(_AData.Class, cxGridIncluirFiltroLookup);
		consulta.selection.mode = $SelectStyle;				

		$(function () { 
		    gridConfigModal = {
    		 "onRowRemoving": ConsultaAjaxDeleteReg,
				 "dataSource": dataSource,
				 "showRowLines": false,
				 "stateStoring":{enabled: true,
									type: "custom",
									customLoad:function () {return qGrid.loadGridState(_AData.Class + consulta.nomegrid); }, 
									customSave: function (state) { qGrid.saveGridState(_AData.Class + consulta.nomegrid, state); }
					},
				 "onToolbarPreparing": function (e) {
					var toolbarItems = e.toolbarOptions.items;						
																	
					toolbarItems.push({
						widget: "dxButton", 
						locateInMenu: "auto",
						showText: "inMenu",
						options: { 
							icon: "refresh",
							text: "Atualizar", 
							hint: "Atualizar", 
							onClick: function() { dxDataGrid.getInstance("#dataGridModal").refresh(); } 
						},
						location: "after"
					});					

					toolbarItems.push({
						location: "after",
						widget: "dxDropDownButton",
						options: {
							dropDownOptions: {
								width: 140
							},
							displayExpr: "text",
							icon: "las la-th",
							hint: "Opções do grid",
							items: [
								{ text: "Restaurar colunas", action: "restaurar"},
								{ text: "Selecionar colunas", action: "selecionar"}
							],
							onItemClick(data) {
								if (data.itemData.action == 'restaurar'){
									dxDataGrid.getInstance('#dataGridModal').state({});
								} else {
									dxDataGrid.getInstance("#dataGridModal").showColumnChooser();
								}
							}
						}
					});	                						
				 }
				 
				};	

			evaluateGridConfig(consulta);
			var config = prepareGridConfig(gridConfigModal, consulta);

			if ($OnConfigurarGrid != null){
				$OnConfigurarGrid(consultaModal);
			};

			createGrid("dataGridModal", config);
		});
		
		$('#myModal').find('.modal-title').text('Consulta '+ _AData.Caption);
	};
	
</script>
        <!-- metronic 6 -->


    <!-- begin::Global Config(global config for global JS sciprts) -->
    <script>
		var KTAppOptions = {
			"colors": {
				"state": {
					"brand": "#22b9ff",
					"light": "#ffffff",
					"dark": "#282a3c",
					"primary": "#5867dd",
					"success": "#34bfa3",
					"info": "#36a3f7",
					"warning": "#ffb822",
					"danger": "#fd3995"
				},
				"base": {
					"label": ["#c5cbe3", "#a1a8c3", "#3d4465", "#3e4466"],
					"shape": ["#f0f3ff", "#d9dffa", "#afb4d4", "#646c9a"]
				}
			}
		};

		var KTAppSettings = {
			"colors": {
				"state": {
					"brand": "#22b9ff",
					"light": "#ffffff",
					"dark": "#282a3c",
					"primary": "#5867dd",
					"success": "#34bfa3",
					"info": "#36a3f7",
					"warning": "#ffb822",
					"danger": "#fd3995"
				},
				"base": {
					"label": ["#c5cbe3", "#a1a8c3", "#3d4465", "#3e4466"],
					"shape": ["#f0f3ff", "#d9dffa", "#afb4d4", "#646c9a"]
				}
			}
		};
    </script>

    <!-- end::Global Config -->

    <!--begin::Global Theme Bundle(used by all pages) -->
     
    <script src=".static/metronic/js/demo7/scripts.bundle.js" type="text/javascript"></script>

    <!--end::Global Theme Bundle -->

    <!--begin::Page Vendors(used by this page) -->
    <script src=".static/metronic/vendors/custom/fullcalendar/fullcalendar.bundle.js" type="text/javascript"></script>
    <script src=".static/metronic/vendors/custom/gmaps/gmaps.js" type="text/javascript"></script>
    <script src=".static/metronic/vendors/custom/jstree/jstree.bundle.js" type="text/javascript"></script>
    <!--end::Page Vendors -->

    <!--begin::Page Scripts(used by this page) -->

    <!-- metronic 6 -->

<!-- ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -->

<script src=".static/vendors/toastr/toastr.js"></script>
<!-- <script src=".static/vendors/moment/lang/pt-br.js"></script>  conteudo_head.partial-->
<script src=".static/js/bootbox.min.js"></script>
<script src=".static/vendors/introjs/intro.min.js"></script>
<script src=".static/metronic/vendors/custom/datatables/datatables.bundle.js"></script><!-- <script src=".static/template/custom/datatables/datatables.bundle.js"></script> -->  <!-- duv -->   
<script src=".static/template/utils/settings.js"></script>
<script src=".static/template/utils/notifier.js"></script>
<script src=".static/template/utils/utils.js"></script>
<script src=".static/js/app.js"></script>

<script src=".static/js/devextreme/jszip.min.js"></script>
<script src=".static/js/pdfmake.min.js"></script>
<script src=".static/js/vfs_fonts.js"></script>
<script src=".static/js/buttons.html5.min.js"></script>
<script src=".static/js/buttons.print.min.js"></script>
<script src=".static/vendors/jQueryMaskPlugin/jquery.mask.min.js"></script>
<script src=".static/js/lodash.js"></script>

<script src=".static/js/fnSetFilteringDelay.js"></script>
<script src=".static/vendors/bs-custom-file-input/bs-custom-file-input.js"></script>
<script src=".static/vendors/sweetalert2/sweetalert2.all.min.js"></script>

<script src=".static/js/custom.js"></script>

	<script>
	    function fail(message){external.Notificar("FAIL|"+message);}	
		function pass(message){external.Notificar("PASS|"+message);}	
		window.onerror = function(message, source, lineno, colno, error) {
		    fail(` Message: ${message} Line: ${lineno} Column: ${colno} Error: ${error} Source ${source}`);				
		};
		
		$(document).ready(function(){
			external.Notificar('COMPLETO');				
		});		
	</script>
	{{>cookiesBar}}		
</body>

</html>