<!-- <link rel="stylesheet" href="<?php echo BASE_URI; ?>/dist/css/select.bootstrap.min.css"> -->
<aside class="right-sidebar sidebar-dark-danger d-none elevation-2" id="menu_fiscal">
    <div class="switcher-icon">
        <div class="col-sm-12"> Menu </div>
        <div class="col-sm-12"> Fiscal </div>
    </div>
    <!-- Sidebar -->
    <div class="sidebar">
        <!-- Sidebar Menu -->
        <nav class="mt-2">
            <ul class="nav nav-pills nav-sidebar flex-column flecha nav-compact" data-widget="treeview" role="menu" data-accordion="false" id="menu_direita">
                <li class="nav-items" style="text-align:center!important;color:white!important;font-weight:bold!important;">
                    <i class="nav-icon fas fa-info"></i>
                    <p>
                        Menu Fiscal
                    </p>
                </li>
                <li class="nav-item leituraX">
                    <a onclick="realizaLeituraX()" class="nav-link">
                        <!-- <i class="nav-icon fas fa-home"></i> -->
                        <h7>
                            LX - Leitura X
                        </h7>
                    </a>
                </li>
                <li class="nav-item reducaoZ">
                    <a onclick="realizaReducaoZ()" class="nav-link">
                        <!-- <i class="nav-icon fas fa-home"></i> -->
                        <h7>
                            RZ - Redução Z
                        </h7>
                    </a>
                </li>
                <li id="menu_sistema" class="nav-item has-treeview LMF">
                    <a href="#" class="nav-link">
                        <!-- <i class="nav-icon fas fa-laptop"></i> -->
                        <h7>
                            LMF - Leitura de Memória Fiscal
                            <i class="fas fa-angle-left right"></i>
                        </h7>
                    </a>
                    <ul id="" class="nav nav-treeview">
                        <li class="nav-item">
                            <a onclick="abreLMF('simples')" class="nav-link">
                                <i class="fas fa-arrow-right nav-icon"></i>
                                <h7>LMFS - Simples</h7>
                            </a>
                        </li>
                    </ul>
                    <ul id="" class="nav nav-treeview">
                        <li class="nav-item">
                            <a onclick="abreLMF('completa')" class="nav-link">
                                <i class="fas fa-arrow-right nav-icon"></i>
                                <h7>LMFC - Completa</h7>
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="nav-item MF">
                    <a onclick="geraArquivo('MF')" class="nav-link">
                        <!-- <i class="nav-icon fas fa-home"></i> -->
                        <h7>
                            Arquivo MF
                        </h7>
                    </a>
                </li>
                <li class="nav-item MFD">
                    <a onclick="geraArquivo('MFD')" class="nav-link">
                        <!-- <i class="nav-icon fas fa-home"></i> -->
                        <h7>
                            Arquivo MFD
                        </h7>
                    </a>
                </li>
                <li class="nav-item arquivoAC">
                    <a onclick="abreArqMFD()" class="nav-link">
                        <!-- <i class="nav-icon fas fa-home"></i> -->
                        <h7>
                            Arquivo AC 17/04
                        </h7>
                    </a>
                </li>
                <li class="nav-item abreVendas">
                    <a onclick="abreVendas()" class="nav-link">
                        <!-- <i class="nav-icon fas fa-home"></i> -->
                        <h7>
                            Vendas Identificadas pelo CPF/CNPJ
                        </h7>
                    </a>
                </li>
                <li class="nav-item abreTitp">
                    <a onclick="AbreTITP()" class="nav-link">
                        <!-- <i class="nav-icon fas fa-home"></i> -->
                        <h7>
                            Tab. Índice Técnico Produção
                        </h7>
                    </a>
                </li>
                <li class="nav-item parametrosConfiguracao">
                    <a onclick="ParametrosConfiguracao()" class="nav-link">
                        <!-- <i class="nav-icon fas fa-home"></i> -->
                        <h7>
                            Parâmetros de Configuração
                        </h7>
                    </a>
                </li>
                <li class="nav-item abreReg">
                    <a onclick="AbreREG()" class="nav-link">
                        <!-- <i class="nav-icon fas fa-home"></i> -->
                        <h7>
                            Registros do PAF-ECF
                        </h7>
                    </a>
                </li>
                <li id="" class="nav-item has-treeview envioFiscal">
                    <a href="#" class="nav-link">
                        <h7>
                            Envio ao Fisco
                            <i class="fas fa-angle-left right"></i>
                        </h7>
                    </a>
                    <ul id="menu_libera_acesso" class="nav nav-treeview">
                        <li class="nav-item">
                            <a onclick="AbreArqBlocoX('RZ')" class="nav-link">
                                <i class="fas fa-arrow-right nav-icon"></i>
                                <h7>REDUÇÃO Z</h7>
                            </a>
                        </li>
                    </ul>
                    <ul id="menu_libera_registro" class="nav nav-treeview">
                        <li class="nav-item">
                            <a onclick="AbreArqBlocoX('EST')" class="nav-link">
                                <i class="fas fa-arrow-right nav-icon"></i>
                                <h7>ESTOQUE</h7>
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="nav-item identificaPaf">
                    <a onclick="identificaPAF()" class="nav-link">
                        <h7>
                            Identificação do PAF-ECF
                        </h7>
                    </a>
                </li>
                <li class="nav-item">
                    <a onclick="AbreTITP('req')" class="nav-link">
                        <h7>
                            Requisições Externas Registradas
                        </h7>
                    </a>
                </li>
                <li class="nav-item mesaAberta">
                    <a onclick="MesasAbertas()" class="nav-link">
                        <h7>
                            Mesas Abertas
                        </h7>
                    </a>
                </li>
            </ul>
        </nav>
        <div style="bottom: 0;right: 0; position: absolute; width: 100%;" class="row">
            <div class="col-sm-6">
                <ul style="font-size:15px;font-weight:bold" class="navbar-nav">
                    <li class="nav-item">
                        Impressora Fiscal
                    </li>
                    <li class="nav-item" style="font-size:12px;">
                        <p style="margin-bottom:0!important;color:white!important">Status: <span style="padding-left: 4px; padding-right: 4px;" id="txtStatusECF"></span></p>
                        <p style="margin-bottom:0!important;color:white!important">Estado: <span style="padding-left: 4px;padding-right:4px;" id="txtEstadoECF"></span></p>

                    </li>
                </ul>
            </div>
            <div class="col-sm-6" style="text-align: center;vertical-align: middle;margin-top: 5%;">
                <button title="Reconectar" id="btn-reconectar" class="btn btn-sm btn-danger"><i class="fas fa-sync-alt"></i></button>
            </div>
        </div>
    </div>
</aside>



<div class="modal fade" id="modal-lmf" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog ">
        <div class="modal-content">
            <div class="modal-header">
                <h4 id="modalLMF-titulo" class="modal-title">LMF</h4>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-4">
                        <div class="form-group">
                            <label data-error="wrong" data-success="right" id="rgTipoEmissao" for="rgTipoEmissao">Tipo
                                Emissão</label>
                            <div class="form-check">
                                <input class="form-check-input" id="rgTipoEmissao1" value="0" type="radio" name="rgTipoEmissao">
                                <label class="form-check-label">Arquivo/Serial</label>
                            </div>
                            <div class="form-check">
                                <input class="form-check-input" id="rgTipoEmissao2" value="1" type="radio" name="rgTipoEmissao" checked="">
                                <label class="form-check-label">Impresso</label>
                            </div>
                        </div>
                    </div>
                    <div class="col-8">

                        <label>Intervalo: </label>
                        <div class="row form-group">
                            <div class="col-6">
                                <div class="group-default form-group">
                                    <label data-error="wrong" data-success="right" for="txtIntDe">De</label>
                                    <input type="text" placeholder="Int. De" class="input-default" id="txtIntDe" name="txtIntDe">
                                </div>
                            </div>
                            <div class="col-6">
                                <div class="group-default form-group">
                                    <label data-error="wrong" data-success="right" for="txtIntAte">Ate</label>
                                    <input type="text" placeholder="Int. Até" class="input-default" id="txtIntAte" name="txtIntAte">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-4">
                        <div class="form-group">
                            <label data-error="wrong" data-success="right" for="rgTipo">Tipo</label>
                            <div class="form-check">
                                <input class="form-check-input" value="0" type="radio" name="rgTipo">
                                <label class="form-check-label">Data</label>
                            </div>
                            <div class="form-check">
                                <input class="form-check-input" value="1" type="radio" name="rgTipo" checked="">
                                <label class="form-check-label">Intervalo</label>
                            </div>
                        </div>
                    </div>
                    <div class="col-8">
                        <label>Data: </label>
                        <div class="row form-group">
                            <div class="col-6">
                                <div class="group-default form-group">
                                    <label data-error="wrong" data-success="right" for="txtDataLMFDe">De</label>
                                    <input type="date" placeholder="Data De" disabled class="input-default" id="txtDataLMFDe" name="txtDataLMFDe">
                                </div>
                            </div>
                            <div class="col-6">
                                <div class="group-default form-group">
                                    <label data-error="wrong" data-success="right" for="txtDataLMFAte">Ate</label>
                                    <input type="date" placeholder="Data Até" disabled class="input-default" id="txtDataLMFAte" name="txtDataLMFAte">
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- <div class="col-12">
                        <div class="icheck-danger">
                            <input type="checkbox" name="cbAtoCotepe" id="cbAtoCotepe">
                            <label for="cbAtoCotepe">
                                Gerar Ato Cotepe 17/04
                            </label>
                        </div>
                    </div> -->
                    <!-- <div class="col-12" id="espelho_dll">
                        <div class="icheck-danger">
                            <input type="checkbox" name="cbEspelhoDLL" id="cbEspelhoDLL">
                            <label for="cbEspelhoDLL">
                                Espelho DLL
                            </label>
                        </div>
                    </div> -->
                </div>
            </div>
            <div class="modal-footer">
                <div class="row">
                    <div class="col-sm-12">
                        <button id="btn_confirmar_lmf" class="btn btn-danger"> Confirmar</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="modal-titp" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog ">
        <div class="modal-content">
            <div class="modal-header">
                <h4 id="modaltitp-titulo" class="modal-title">Tab. Indíce Técnico de Produção</h4>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-12">
                        <p id="modaltitp-conteudo">
                        </p>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <div class="row">
                    <div class="col-sm-12">
                        <button id="btn_confirmar_titp" class="btn btn-danger">Ok</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<div class="modal fade" id="modal-blocox" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h4 id="modal-blocox-titulo" class="modal-title">Gerar Arquivos Bloco X</h4>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-5">
                        <div class="col-12">
                            <label for="txtBlocoXInicio">Início</label>
                            <input type="date" placeholder="Início" class="input-default" id="txtBlocoXInicio" name="txtBlocoXInicio">
                        </div>
                        <div class="col-12">
                            <label data-error="wrong" data-success="right" for="txtBlocoXFim">Fim</label>
                            <input type="date" placeholder="Fim" class="input-default" id="txtBlocoXFim" name="txtBlocoXFim">
                        </div>
                    </div>
                    <div class="col-3">
                        <div class="form-group" style="margin-top: 20px;">
                            <div class="form-check">
                                <input class="form-check-input" value="0" type="radio" name="rg_status_bloco_x" checked="">
                                <label class="form-check-label">Todas</label>
                            </div>
                            <div class="form-check">
                                <input class="form-check-input" value="1" type="radio" name="rg_status_bloco_x">
                                <label class="form-check-label">Emitidos</label>
                            </div>
                            <div class="form-check">
                                <input class="form-check-input" value="2" type="radio" name="rg_status_bloco_x">
                                <label class="form-check-label">Pendentes</label>
                            </div>
                        </div>
                    </div>
                    <div class="col-4">
                        <div class="form-group" style="margin-top: 20px;">
                            <h1 style="font-size: 15px;">Status:</h1>
                            <p style="margin-top: -8px;">
                                N = Não transmitido<br>
                                A = Aguardando resposta (SEFAZ)<br>
                                S = Transmitido
                            </p>
                        </div>
                    </div>
                    <div class="col-12">
                        <div class="form-group">
                            <label for="selectImpressoras">Impressora Fiscal</label>
                            <select name="" class="form-control input-default" id="selectImpressoras">
                            </select>
                        </div>
                    </div>
                    <div class="col-12">
                        <button style="margin-top:10px" id="btn_consultar_blocox" class="btn btn-danger">Consultar</button>
                        <button style="margin-top:10px" id="btnConfiguracaoBlocoX" class="btn btn-danger"><i class="fas fa-cogs"></i> Config</button>
                    </div>
                    <div class="col-12 table-responsive">
                        <table id="tabela-blocox-redz" style="width:100%" width="100%" class="table table-sm table-condensed table-select">
                            <thead>
                            </thead>
                            <tbody>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <div class="row">
                    <button id="btn_blocox_transmitir" class="btn btn-primary d-none">Transmitir</button>
                    <button style="margin-left:5px" id="btn_blocox_consultar" class="btn btn-secondary d-none">Consultar</button>
                    <button style="margin-left:5px" id="btn_blocox_fechar" class="btn btn-danger">Fechar</button>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="modal-vendas" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h4 id="modal-vendas-titulo" class="modal-title">Vendas Identificadas pelo CPF/CNPJ</h4>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-6">
                        <div class="row">
                            <div class="col-3">
                                <label for="txtVendasAno">Ano</label>
                            </div>
                            <div class="col-9">
                                <input type="year" placeholder="Ano" class="input-default" id="txtVendasAno" name="txtVendasAno">
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-3">
                                <label data-error="wrong" data-success="right" for="txtVendasMes">Mês</label>
                            </div>
                            <div class="col-9">
                                <input type="text" placeholder="Mês" class="input-default" id="txtVendasMes" name="txtVendasMes">
                            </div>
                        </div>
                    </div>
                    <div class="col-6">
                        <div class="row">
                            <div class="col-6">
                                <input class="d-none" id="txtListaCNPJ" type="text" />
                                <button id="btn_filtra_cnpj" class="btn btn-sm btn-block btn-primary">
                                    Filtra CNPJ
                                </button>
                            </div>
                            <div class="col-6">
                                <button id="btn_limpa_cnpj" class="btn btn-sm btn-block btn-danger">
                                    Limpar
                                </button>
                            </div>
                            <div style="margin-top:5px;" class="col-12">
                                <table id="tabela_cnpjs" class="table table-sm table-condensed table-select">
                                    <thead>
                                        <tr>
                                            <th>CNPJ</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <div class="row">
                    <div class="col-sm-12">
                        <button id="btn_confirmar_vendas" class="btn btn-danger">Confirmar</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="modal-ConfigBlocoX" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h4 id="modal-ConfigBlocoX-titulo" class="modal-title">Gerar Arquivos Bloco X</h4>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">

                <div class="card">
                    <div class="card-body">

                        <div class="row">
                            <div class="col-12 d-flex justify-content-end" style="font-size:25px; color: red;">
                                <span id="txtTipoAmbiente"></span>
                            </div>

                            <div class="col-12">
                                <label for="txtAmbiente">
                                    Ambiente
                                </label>
                                <div class="relative">
                                    <input type="text" class="input-group input-default" id="txtAmbiente" placeholder="Ambiente">
                                </div>
                            </div>
                        </div>

                    </div>
                </div>

            </div>
            <div class="modal-footer">
                <button class="btn btn-primary" id="btnConfirmarConfig">
                    Confirmar
                </button>
            </div>
        </div>
    </div>
</div>


<div class="modal fade" id="modal-reg" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog ">
        <div class="modal-content">
            <div class="modal-header">
                <h4 id="modalreg-titulo" class="modal-title">Registros do PAF-ECF</h4>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-12">
                        <label>Data: </label>
                        <div class="row form-group">
                            <div class="col-6">
                                <div class="group-default form-group">
                                    <label data-error="wrong" data-success="right" for="txtVendasDataDe">Inicial</label>
                                    <input type="date" placeholder="Inicial" class="input-default" id="txtVendasDataDe" name="txtVendasDataDe">
                                </div>
                            </div>
                            <div class="col-6">
                                <div class="group-default form-group">
                                    <label data-error="wrong" data-success="right" for="txtVendasDataAte">Final</label>
                                    <input type="date" placeholder="Final" class="input-default" id="txtVendasDataAte" name="txtVendasDataAte">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-12">
                        <div class="row">
                            <div class="col-6">
                                <input class="d-none" id="txtListaPRODS" type="text" />
                                <button id="btn_filtra_prods" class="btn btn-sm btn-block btn-primary">
                                    Filtra Produtos
                                </button>
                            </div>
                            <div class="col-6">
                                <button id="btn_limpa_prods" class="btn btn-sm btn-block btn-danger">
                                    Limpar
                                </button>
                            </div>
                            <div style="margin-top:5px;" class="col-12">
                                <table id="tabela_prods" class="table table-sm table-condensed table-select">
                                    <thead>
                                        <tr>
                                            <th>Código</th>
                                            <th>Descrição</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <div class="row">
                    <div class="col-sm-12">
                        <button id="btn_confirmar_reg" class="btn btn-danger">Confirmar</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="modal-identificao" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog ">
        <div class="modal-content">
            <div class="modal-header">
                <h4 id="modalreg-titulo" class="modal-title">Identificação do PAF-ECF</h4>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-12">
                        <label>CNPJ: 04.071.299/0001-26</label>
                    </div>
                    <div class="col-12">
                        <label>Razão Social: Sisplan Sistemas e Planejamentos Eireli</label>
                    </div>
                    <div class="col-12">
                        <label>R: 21 de Abril, 214 sala 01 - Indaial - SC</label>
                    </div>
                    <div class="col-12">
                        <label>Telefone: 47 3380-6100</label>
                    </div>
                    <div class="col-12">
                        <label>Email: suporte@sisplansistemas.com.br</label>
                    </div>
                    <div class="col-12">
                        <label>Contato: Osmar Schwartz</label>
                    </div>
                    <br>
                    <div class="col-12">
                        <label>Nome Comercial do PAF: Sisplan LojaPAF</label>
                    </div>
                    <div class="col-12">
                        <label>Versão do PAF NFC-e: 21.07.20</label>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <div class="row">
                    <div class="col-sm-12">
                        <button id="btn_confirmar_identificacao" class="btn btn-danger">Confirmar</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="modal-mesaAberta" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog ">
        <div class="modal-content">
            <div class="modal-header">
                <h4 id="modalreg-titulo" class="modal-title">Mesas Abertas</h4>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-12">
                        <label>
                            Este PAF-NFCE não executa funções de Mesas Abertas
                            não podendo ser utilizado
                            por estabelecimento que necessite deste recurso.
                        </label>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <div class="row">
                    <div class="col-sm-12">
                        <button id="btn_confirmar_mesaAberta" class="btn btn-danger">Confirmar</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(document).ready(async function() {
        if (await EscondeCamposMenuFiscal()) {
            $('.leituraX').addClass('d-none');
            $('.reducaoZ').addClass('d-none');
            $('.LMF').addClass('d-none');
            $('.MF').addClass('d-none');
            $('.MFD').addClass('d-none');
            $('.arquivoAC').addClass('d-none');
            $('.abreTitp').addClass('d-none');
            $('.parametrosConfiguracao').addClass('d-none');
            $('.envioFiscal').addClass('d-none');
            $('.mesaAberta').removeClass('d-none');
        } else {
            $('.leituraX').removeClass('d-none');
            $('.reducaoZ').removeClass('d-none');
            $('.LMF').removeClass('d-none');
            $('.MF').removeClass('d-none');
            $('.MFD').removeClass('d-none');
            $('.arquivoAC').removeClass('d-none');
            $('.abreTitp').removeClass('d-none');
            $('.parametrosConfiguracao').removeClass('d-none');
            $('.envioFiscal').removeClass('d-none');
            $('.mesaAberta').addClass('d-none');
        }

        async function EscondeCamposMenuFiscal() {
            try {
                const estado = await BuscaEstadoEmpresa();
                const temImpressoraMaquina = ((getCookie('serie_ecf')) && (getCookie('serie_ecf') !== ''));
                const usaNFCE = await CopiaParametro('VENDA', 6) == 1;
                if ((estado == "SC") && (usaNFCE) && (!temImpressoraMaquina)) {
                    return true
                } else if (await CopiaParametro('VENDA', 6) == 1) {
                    return false
                } else {
                    return false;
                }
            } catch (error) {
                console.error(error);
            }
        }

        async function BuscaEstadoEmpresa() {
            const url = '/sisplan/menufiscal/v1/menufiscal?'
            const response = await requisicao('GET', url, '', null, 15000);

            if (!response) {
                return;
            }

            const jsonStr = await response.text();
            if (response.status != 200) {
                msgErro('Erro ao buscar as informações');
                return;
            };
            return jsonStr;
        }
    });
</script>