<?php include_once('../../config.php') ?>
<?php
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
?>


<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Sisplan Web | NFC-e</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css?versao=3.263.17.1">
  <!-- Ionicons -->
  <!-- Ionicons -->
  <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="dist/css/adminlte.min.css?versao=3.263.17.1">
  <!-- overlayScrollbars -->
  <link rel="stylesheet" href="plugins/overlayScrollbars/css/OverlayScrollbars.min.css?versao=3.263.17.1">
  <!-- Daterange picker -->
  <link href='https://fonts.googleapis.com/css?family=Roboto:400,300,500,600,700,400italic' rel='stylesheet' type='text/css'>

  <link rel="stylesheet" href="dist/css/custom.css?versao=3.263.17.1">
  <link rel="stylesheet" href="dist/css/sisplan.css?versao=3.263.17.1">
  <link rel="stylesheet" type="text/css" href="plugins/datatables-keytable/css/keyTable.bootstrap4.min.css?versao=3.263.17.1">
  <link rel="stylesheet" type="text/css" href="dist/css/dataTables.bootstrap4.min.css?versao=3.263.17.1" />
  <!-- iCheck for checkboxes and radio inputs -->
  <link rel="stylesheet" href="plugins/icheck-bootstrap/icheck-bootstrap.min.css?versao=3.263.17.1">
  <link rel="shortcut icon" href="favicon.ico">
  <link rel="stylesheet" href="dist/css/select.bootstrap.min.css?versao=3.263.17.1">
  <!-- Google Font: Source Sans Pro -->
  <!-- AutoComplete -->
  <link rel="stylesheet" href="dist/css/jquery-ui.css?versao=3.263.17.1">

  <link rel="stylesheet" type="text/css" href="dist/css/driver.min.css?versao=3.263.17.1" />

  <style>
    .ui-autocomplete-loading {
      background: white url("dist/img/ui-anim_basic_16x16.gif") center center no-repeat;
    }

    .content-wrapper {
      margin-left: 0px !important;
    }

    #legendas {
      flex-direction: row;
      flex-wrap: wrap;
    }

    .border-Field {
      border: 1px groove #ddd !important;
      -webkit-box-shadow: 0px 0px 0px 0px #000;
      box-shadow: 0px 0px 0px 0px #000;
    }

    .border-Field .textoBorda {
      font-size: 1.2em !important;
      text-align: left !important;
      width: auto;
      padding: 0 10px;
      border-bottom: none;
    }

    .quadrado {
      width: 20px;
      margin-right: 5px;
      height: 20px;
    }

    .main-header,
    .main-sidebar {
      display: none;
    }

    .input-group button,
    .input-group input {
      height: 40px;
    }

    .input-group button {
      min-width: 45px;
    }

    .btn.bg-danger {
      border: 1px solid white;
    }

    .info-box-text {
      font-size: 20px;
      font-weight: bold;
      color: grey;
    }

    .botoesMenu {
      height: 100%;
      padding-left: auto;
      padding-right: auto;
      color: white !important;
      min-width: 150px;
      font-weight: bold;
      margin-left: -4px !important;
      font-size: 1rem !important;
      background-color: #343a40;
      cursor: pointer !important;
    }

    .select2-container--default .select2-selection--single {
      height: 38px !important;
    }

    .opcoesImpressao {
      border-top: 0px;
      background-color: transparent !important;
      color: #869099;
      padding: 1rem;
    }

    @media (max-width: 575px) {
      body.zoom-80 #ajusteAlturaTela {
        min-height: calc(100vh - 769px) !important;
      }

      body.zoom-90 #ajusteAlturaTela {
        min-height: calc(100vh - 854px) !important;
      }

      body.zoom-100 #ajusteAlturaTela {
        min-height: calc(100vh - 854px) !important;
      }

      body.zoom-110 #ajusteAlturaTela {
        min-height: calc(100vh - 854px) !important;
      }
    }

    @media (min-width: 576px) and (max-width: 767px) {
      body.zoom-80 #ajusteAlturaTela {
        min-height: calc(100vh - 694px) !important;
      }

      body.zoom-90 #ajusteAlturaTela {
        min-height: calc(100vh - 694px) !important;
      }

      body.zoom-100 #ajusteAlturaTela {
        min-height: calc(100vh - 854px) !important;
      }

      body.zoom-110 #ajusteAlturaTela {
        min-height: calc(100vh - 854px) !important;
      }
    }

    @media (min-width: 768px) and (max-width: 991px) {
      body.zoom-80 #ajusteAlturaTela {
        min-height: calc(119vh - 312px) !important;
      }

      body.zoom-90 #ajusteAlturaTela {
        min-height: calc(111vh - 272px) !important;
      }

      body.zoom-100 #ajusteAlturaTela {
        min-height: calc(100vh - 272px) !important;
      }

      body.zoom-110 #ajusteAlturaTela {
        min-height: calc(91vh - 272px) !important;
      }
    }

    @media (min-width: 992px) and (max-width: 1199px) {
      body.zoom-80 #ajusteAlturaTela {
        min-height: calc(124vh - 242px) !important;
      }

      body.zoom-90 #ajusteAlturaTela {
        min-height: calc(111vh - 272px) !important;
      }

      body.zoom-100 #ajusteAlturaTela {
        min-height: calc(100vh - 272px) !important;
      }

      body.zoom-110 #ajusteAlturaTela {
        min-height: calc(91vh - 272px) !important;
      }
    }

    @media (min-width: 1200px) and (max-width: 1679px) {
      body.zoom-80 #ajusteAlturaTela {
        min-height: calc(129vh - 272px) !important;
      }

      body.zoom-90 #ajusteAlturaTela {
        min-height: calc(111vh - 270px) !important;
      }

      body.zoom-100 #ajusteAlturaTela {
        min-height: calc(100vh - 270px) !important;
      }

      body.zoom-110 #ajusteAlturaTela {
        min-height: calc(91vh - 270px) !important;
      }
    }

    @media (min-width: calc(1680px - 250px)) {
      body.zoom-80 #ajusteAlturaTela {
        min-height: calc(125vh - 230px) !important;
      }

      body.zoom-90 #ajusteAlturaTela {
        min-height: calc(111vh - 230px) !important;
      }

      body.zoom-100 #ajusteAlturaTela {
        min-height: calc(100vh - 230px) !important;
      }

      body.zoom-110 #ajusteAlturaTela {
        min-height: calc(85vh - 230px) !important;
      }
    }
  </style>
  <!-- Toastr -->
  <link rel="stylesheet" href="plugins/toastr/toastr.min.css">

</head>

<body class="hold-transition sidebar-mini layout-fixed">
  <div class="wrapper">
    <?php
    include_once('../../menu.php');
    ?>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper" id="ajusteAlturaTela">
      <!-- Content Header (Page header) -->
      <div class="content-header">
        <div class="container-fluid">
          <div class="row mb-2">
            <div class="col-sm-6 row flex">
              <h4 class="m-0 text-dark">Envio e Impressão de NFC-e</h4>
              <button title="Tutorial" type="button" class="btn btn-info btn-sm ml-2" style="color: white;" id="tutorial">
                <i class="fas fa-question-circle"></i>
              </button>
            </div><!-- /.col -->
            <div class="col-sm-6">
              <!-- <ol class="breadcrumb float-sm-right">
                <li class="breadcrumb-item active">Loja</li>
                <li class="breadcrumb-item active">Impressão NFC-e</li>
              </ol> -->
            </div><!-- /.col -->
          </div><!-- /.row -->
        </div><!-- /.container-fluid -->
      </div>
      <!-- /.content-header -->

      <!-- Main content -->
      <section class="content">

        <div class="card">
          <div class="card-body">
            <div class="container-fluid p-2">
              <div class="row pb-2">
                <div class="col-sm-8">
                  <button id="btn-filtros" class="btn btn-success btn-sisp" type="button" data-toggle="modal" data-target="#modal-filtros">
                    <span class="fas fa-filter"></span> Filtros
                  </button>
                  <button id="btn-Config" class="btn btn-danger btn-sisp" type="button" data-toggle="modal">
                    <i class="fas fa-cogs"></i> Config.
                  </button>
                  <button id="btnInutilizar" class=" btn btn-danger text-white btn-sisp">
                    <span class="fas fa-arrow-up"></span> Inutilizar
                  </button>

                  <label id="btnUploadXML" for="fileXml" class=" btn btn-danger text-white btn-sisp mb-0 d-none" style="font-weight: 400;">
                    <i class="fas fa-file-upload"></i>
                    Upload XML
                  </label>
                  <input type="file" id="fileXml" accept="text/xml" style="display: none;">
                </div>
                <div class="col-sm-4" id="tipos">
                  <fieldset class="border-Field px-2 pb-2" style="max-width: 530px; margin-left: auto; margin-right: 0">
                    <legend class="textoBorda mb-0">Legendas</legend>
                    <div class="d-flex" id="legendas">
                      <div style="margin: 5px 10px 0px 0px" class="d-flex align-items-center">
                        <div class="quadrado" style="background: var(--hover-color);">
                        </div>
                        <span>Não Impressa </span>
                      </div>
                      <div style="margin: 5px 10px 0px 0px" class="d-flex align-items-center">
                        <div class="quadrado" style="background: #3CB371;">
                        </div>
                        <span> Emitida </span>
                      </div>
                      <div style="margin: 5px 10px 0px 0px" class="d-flex align-items-center">
                        <div class="quadrado" style="background: #fd6f53;">
                        </div>
                        <span> Cancelada </span>
                      </div>
                      <div style="margin: 5px 10px 0px 0px" class="d-flex align-items-center">
                        <div class="quadrado" style="background: #fbb728;">
                        </div>
                        <span> Devolvida </span>
                      </div>
                      <div style="margin: 5px 0px 0px 0px" class="d-flex align-items-center">
                        <div class="quadrado" style="background: #BC8F8F;">
                        </div>
                        <span> Denegada </span>
                      </div>
                    </div>
                  </fieldset>
                </div>
              </div>
              <div class="row">
                <div class="col-sm-12">
                  <h5>Notas Fiscais</h5>
                </div>
                <div class="col-sm-12 pb-0" id="divCheckTodos">
                  <div class="col-sm-4 icheck-primary d-none pb-2 ml-2 justify-content-between" id="mostrarCheckTodos" style=" height:30px; margin-left: 15px !important;">
                    <input class="form-check-input" type="checkbox" id="checkTodosItens" value="option1">
                    <label class="form-check-label" for="checkTodosItens">Selecionar todos</label>
                  </div>
                  <div class="col-sm-4 icheck-primary d-inline pb-2 justify-content-between" style="margin-right: 15px; height:30px;">
                    <input class="form-check-input" type="checkbox" id="checkPermiteGerarMaisDeUmaNFCE" value="option1">
                    <label class="form-check-label" for="checkPermiteGerarMaisDeUmaNFCE">Permite gerar mais de uma NFC-e</label>
                  </div>
                </div>
                <div class="col-sm-3" id="divCheckPermiteGerarMaisDeUmaNFCE">

                </div>
                <div class="col-sm-12 table-responsive pt-2">
                  <table id="tabelaNotas" class="table table-sm table-select table-hover" width="100%">
                  </table>
                </div>
              </div>
            </div>
          </div>
        </div>
      </section>
      <section class="content">
        <div class="modal fade" id="modal-itens">
          <div class="modal-dialog modal-xl">
            <div class="modal-content">
              <div class="modal-header">
                <h4 id="modal-itens-title" class="modal-title">Itens da Nota</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-sm-12">
                    <input type="text" placeholder="Nota" class="d-none" id="txtNotaItens" name="txtNotaItens" readonly>
                    <input type="text" placeholder="Serie" class="d-none" id="txtSerieItens" name="txtSerieItens" readonly>
                  </div>
                  <div class="col-sm-12 table-responsive">
                    <table id="tabelaItens" style="width:100%" class="table table-sm table-select table-hover" width="100%">
                      <thead>
                      </thead>
                      <tbody>
                      </tbody>
                    </table>
                  </div>
                </div>
              </div>
              <div class="modal-footer justify-content-between">
                <button type="button" class="btn bg-gradient-danger btn-sisp" data-dismiss="modal">Fechar</button>
                <button id="confirmar_dados" type="button" class="btn bg-gradient-success btn-sisp">Confirmar</button>
              </div>
            </div>
            <!-- /.modal-content -->
          </div>
          <!-- /.modal-dialog -->
        </div>
        <div class="modal fade" id="modal-inutilizar">
          <div class="modal-dialog modal-xl">
            <div class="modal-content">
              <div class="modal-header">
                <h4 id="modal-inutilizar-title" class="modal-title">Inutilizar Numerações</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-sm-4 d-none">
                    <input type="text" placeholder="Série" id="txtNotaSerie" name="txtNotaSerie" class="input-default focus form-control">
                  </div>
                  <div class="col-sm-6">
                    <div class="group-default form-group">
                      <label for="txtNotaIni">Numeração Inicial:</label>
                      <div class="relative">
                        <input type="number" class="input-default focus form-control validate" id="txtNotaIni" name="txtNotaIni">
                      </div>
                    </div>
                  </div>
                  <div class="col-sm-6">
                    <div class="group-default form-group">
                      <label for="txtNotaFim">Numeração Final:</label>
                      <div class="relative">
                        <input type="number" class="input-default focus form-control validate" id="txtNotaFim" name="txtNotaFim">
                      </div>
                    </div>
                  </div>
                  <div class="col-sm-12">
                    <div class="group-default form-group">
                      <label data-error="wrong" data-success="right" for="txtJustificativa">Justificativa</label>
                      <textarea type="textarea" style="resize: none" placeholder="Justificativa" class="input-default focus form-control validate" id="txtJustificativa" name="txtJustificativa" required="required" rows="3"></textarea>
                    </div>
                  </div>
                  <div class="col-lg-12  col-12 form-group" style="margin-top: 20px;">
                    <label for="tabelaNotasInutilizacao">Notas pendentes de inutilização</label>
                    <table id="tabelaNotasInutilizacao" class="table table-sm table-hover table-select table-condensed">
                    </table>
                  </div>
                </div>
              </div>
              <div class="modal-footer justify-content-between">
                <button id="btn-confirmar-inutilizacao" type="button" class="btn bg-gradient-success btn-sisp">Confirmar</button>
                <button type="button" class="btn bg-gradient-danger btn-sisp" data-dismiss="modal">Fechar</button>
              </div>
            </div>
            <!-- /.modal-content -->
          </div>
          <!-- /.modal-dialog -->
        </div>

        <div class="modal fade" id="modal-gerar-offline">
          <div class="modal-dialog modal-xl">
            <div class="modal-content">
              <div class="modal-header">
                <h4 id="modal-gerar-offline-title" class="modal-title">Justificativa Off-line</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-sm-12">
                    <div class="group-default form-group">
                      <label data-error="wrong" data-success="right" for="txtJustificativaOffline">Justificativa</label>
                      <textarea type="textarea" style="resize: none" placeholder="Justificativa" class="input-default focus form-control validate" id="txtJustificativaOffline" name="txtJustificativaOffline" required="required" rows="3"></textarea>
                    </div>
                  </div>
                </div>
              </div>
              <div class="modal-footer justify-content-between">
                <button id="btn-gerar-offline" type="button" class="btn bg-gradient-success btn-sisp">Confirmar</button>
                <button type="button" class="btn bg-gradient-danger btn-sisp" data-dismiss="modal">Fechar</button>
              </div>
            </div>
            <!-- /.modal-content -->
          </div>
          <!-- /.modal-dialog -->
        </div>
        <div class="modal fade" id="modal-cancelamento">
          <div class="modal-dialog modal-xl">
            <div class="modal-content">
              <div class="modal-header">
                <h4 id="modal-cancelamento-title" class="modal-title">Cancelar NFC-e</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-sm-6">
                    <div class="group-default form-group">
                      <label for="txtCancFatura">Fatura:</label>
                      <div class="relative">
                        <input type="number" class="input-default focus form-control validate" id="txtCancFatura" name="txtCancFatura" readonly>
                      </div>
                    </div>
                  </div>
                  <div class="col-sm-6">
                    <div class="group-default form-group">
                      <label for="txtCancSerie">Série:</label>
                      <div class="relative">
                        <input type="number" class="input-default focus form-control validate" id="txtCancSerie" name="txtCancSerie" readonly>
                      </div>
                    </div>
                  </div>
                  <div class="col-sm-12">
                    <div class="group-default form-group">
                      <label data-error="wrong" data-success="right" for="txtCancJustificativa">Justificativa</label>
                      <textarea type="textarea" style="resize: none" placeholder="Justificativa" class="input-default focus form-control validate" id="txtCancJustificativa" name="txtCancJustificativa" required="required" rows="3"></textarea>
                    </div>
                  </div>
                </div>
              </div>
              <div class="modal-footer justify-content-between">
                <button id="btn-confirmar-cancelamento" type="button" class="btn bg-gradient-success btn-sisp">Confirmar</button>
                <button type="button" class="btn bg-gradient-danger btn-sisp" data-dismiss="modal">Fechar</button>
              </div>
            </div>
            <!-- /.modal-content -->
          </div>
          <!-- /.modal-dialog -->
        </div>
      </section>
      <!-- /.content -->
    </div>
    <div id="modal-filtros" class="modal" tabindex="-1" role="dialog">
      <div class="modal-dialog modal-xl" role="document">
        <div class="modal-content" id="modalBody">
          <div class="modal-header">
            <h4 class="modal-title">Filtros</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-lg-6 col-12">
                <div class="row">
                  <div class="col-6">
                    <div class="group-default form-group">
                      <label for="dtIni">Data De:</label>
                      <div class="relative">
                        <input type="date" max="2500-12-31" value="" class="input-default focus form-control validate" id="txtDataDe" name="txtDataDe">
                      </div>
                    </div>
                  </div>
                  <div class="col-6">
                    <div class="group-default form-group">
                      <label for="dtFim">Data Até:</label>
                      <div class="relative">
                        <input type="date" max="2500-12-31" value="" class="input-default focus form-control validate" id="txtDataAte" name="txtDataAte">
                      </div>
                    </div>
                  </div>
                  <div class="col-6">
                    <label data-error="wrong" data-success="right" for="txtCliente">Cliente</label>
                    <div class="input-group">
                      <input type="text" class="input-default focus form-control" id="txtCliente" name="txtCliente" class="form-control" placeholder="Cliente">
                      <div class="input-group-append">
                        <button class="btn bg-danger" id="btn-cliente" name="btn-cliente" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                        <button class="btn bg-danger" id="btn-limpa-cliente" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                      </div>
                    </div>
                  </div>
                  <div class="col-6">
                    <label data-error="wrong" data-success="right" for="txtNota">Fatura</label>
                    <div class="input-group">
                      <input type="text" class="input-default focus form-control" id="txtNota" name="txtNota" class="form-control" placeholder="Fatura">
                      <div class="input-group-append">
                        <button class="btn bg-danger" id="btn-nota" name="btn-nota" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                        <button class="btn bg-danger" id="btn-limpa-nota" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                      </div>
                    </div>
                  </div>
                  <div class="col-12">
                    <label style="margin-top: .8rem!important;" data-error="wrong" data-success="right" for="txtVenda">Venda</label>
                    <div class="input-group">
                      <input type="text" class="input-default focus form-control" id="txtVenda" name="txtVenda" class="form-control" placeholder="Venda">
                      <div class="input-group-append">
                        <button class="btn bg-danger" id="btn-venda" name="btn-venda" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                        <button class="btn bg-danger" id="btn-limpa-venda" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <div class="col-lg-2 col-12">
                <div class="form-group clearfix">
                  <h6>Status: </h6>
                  <div class="icheck-primary">
                    <input type="radio" id="radioPrimary1" value="0" name="rg_status" checked>
                    <label for="radioPrimary1">Todas
                    </label>
                  </div>
                  <div class="icheck-primary">
                    <input type="radio" id="radioPrimary2" value="1" name="rg_status">
                    <label for="radioPrimary2">Impressa
                    </label>
                  </div>
                  <div class="icheck-primary">
                    <input type="radio" id="radioPrimary3" value="2" name="rg_status">
                    <label for="radioPrimary3">Não Impressa</label>
                  </div>
                  <div class="icheck-primary">
                    <input type="radio" id="radioPrimary4" value="3" name="rg_status">
                    <label for="radioPrimary4">Canceladas
                    </label>
                  </div>
                  <div class="icheck-primary">
                    <input type="radio" id="radioPrimary5" value="4" name="rg_status">
                    <label for="radioPrimary5">Denegadas
                    </label>
                  </div>
                </div>
              </div>
              <div class="col-lg-2 col-12">
                <div class="form-group clearfix">
                  <h6>Protocolo: </h6>
                  <div class="icheck-primary">
                    <input type="radio" id="radioProtocolo1" value="0" name="rg_protocolo" checked>
                    <label for="radioProtocolo1">Todas
                    </label>
                  </div>
                  <div class="icheck-primary">
                    <input type="radio" id="radioProtocolo2" value="1" name="rg_protocolo">
                    <label for="radioProtocolo2">Com Protocolo
                    </label>
                  </div>
                  <div class="icheck-primary">
                    <input type="radio" id="radioProtocolo3" value="2" name="rg_protocolo">
                    <label for="radioProtocolo3">Sem Protocolo</label>
                  </div>
                </div>
              </div>
              <div class="col-lg-2 col-12">
                <div class="form-group clearfix">
                  <h6>Tipo Transmissão: </h6>
                  <div class="icheck-primary">
                    <input type="radio" id="rg_tipo_transmissao_op_0" value="0" name="rg_tipo_transmissao" checked>
                    <label for="rg_tipo_transmissao_op_0">Todos
                    </label>
                  </div>
                  <div class="icheck-primary">
                    <input type="radio" id="rg_tipo_transmissao_op_1" value="1" name="rg_tipo_transmissao">
                    <label for="rg_tipo_transmissao_op_1">Normal
                    </label>
                  </div>
                  <div class="icheck-primary">
                    <input type="radio" id="rg_tipo_transmissao_op_2" value="2" name="rg_tipo_transmissao">
                    <label for="rg_tipo_transmissao_op_2">Off-line</label>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="modal-footer">
            <div class="row">
              <button id="btn-consultar" class="btn btn-primary btn-sisp" type="button">
                <span class="fas fa-search"></span> Consultar
              </button>
            </div>
          </div>
        </div>
      </div>
    </div>

    <div class="modal fade" id="modal-Config">
      <div class="modal-dialog modal-lg">
        <div class="modal-content">
          <div class="modal-header">
            <h4 id="modal-Configuração-title" class="modal-title">Configurações Nota Fiscal do Consumidor Eletrônica - NFCE</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="collapse show" id="cfe">
              <div class="card card-body">
                <div class="row">
                  <div class="col-12">
                    <label style="color: red">
                      Necessário baixar o arquivo AJUSTA_SEQUENCIAL_NOTANUMERO.TXT que está na ApiExterna e pegar o comando que está nesse arquivo para ajustar o sequencial da tabela NOTA_NUMERO.
                    </label>
                  </div>
                  <div class="col-6">
                    <label for="txtVersao">
                      Versão
                    </label>
                    <div class="relative">
                      <input type="text" class="input-group input-default" id="txtVersao">
                    </div>
                  </div>
                  <div class="col-6">
                    <label for="txtIDCSC">
                      IDCSC
                    </label>
                    <div class="relative">
                      <input type="text" class="input-group input-default" id="txtIDCSC">
                    </div>
                  </div>
                </div>
                <div class="row">
                  <div class="col-12">
                    <label for="txtDiretorioLog">
                      Diretorio Log
                    </label>
                    <div class="relative">
                      <input type="text" class="input-group input-default" id="txtDiretorioLog">
                    </div>
                  </div>
                </div>
                <div class="row">
                  <div class="col-12">
                    <label for="txtCSC">
                      CSC
                    </label>
                    <div class="relative">
                      <input type="text" class="input-group input-default" id="txtCSC">
                    </div>
                  </div>
                </div>
                <div class="row">
                  <div class="col-6">
                    <label for="txtSincrono">Sincrono</label>
                    <select id="txtSincrono" class="input-default focus custom-select">
                      <option value="S">Sim</option>
                      <option value="N">Não</option>
                    </select>
                  </div>
                  <div class="col-6">
                    <label for="txtAmbiente">Ambiente</label>
                    <select id="txtAmbiente" class="input-default focus custom-select">
                      <option value="1">Produção</option>
                      <option value="2">Homologação</option>
                    </select>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="modal-footer float-right">
            <button id="btn-confirmar-config" type="button" class="btn bg-gradient-danger btn-sisp">Gravar INI</button>
          </div>
        </div>
      </div>
    </div>
    <aside class="control-sidebar control-sidebar-dark">
    </aside>
    <div class="opcoesImpressao pt-0">
      <div class="row">
        <div class="col-12">
          <div id="dadosnota" class="row">
            <div class="col-sm-3">
              <div class="group-default form-group">
                <label data-error="wrong" data-success="right" for="txtNumeroNF">Numero NF</label>
                <div class="relative">
                  <input type="text" placeholder="Numero NF" class="input-default focus form-control validate" id="txtNumeroNF" name="txtNumeroNF" readonly>
                </div>
              </div>
            </div>
            <div class="col-sm-3">
              <div class="group-default form-group">
                <label data-error="wrong" data-success="right" for="txtSerieNF">Série NF</label>
                <div class="relative">
                  <input type="text" placeholder="Série NF" class="input-default focus form-control validate" id="txtSerieNF" name="txtSerieNF" readonly>
                </div>
              </div>
            </div>
            <div class="col-sm-3">
              <div class="group-default form-group">
                <label data-error="wrong" data-success="right" for="txtEmissaoNF">Emissão</label>
                <div class="relative">
                  <input type="text" placeholder="Emissão" class="input-default focus form-control validate" id="txtEmissaoNF" name="txtEmissaoNF" readonly>
                </div>
              </div>
            </div>
            <div class="col-sm-3">
              <div class="form-group">
                <label>Tipo Transmissão</label>
                <select class="form-control select2 select2-danger" id="tipo_transmissao" name="tipo_transmissao" data-dropdown-css-class="select2-danger" style="width: 100%; border-color: #a9a9a9">
                  <option value="0" selected="selected">Normal</option>
                  <option value="1">Contingência Off-line</option>
                </select>
              </div>
            </div>
            <div class="col-sm-3">
              <div class="group-default form-group">
                <label data-error="wrong" data-success="right" for="txtChaveNF">Chave</label>
                <div class="relative">
                  <input type="text" placeholder="Chave" class="input-default focus form-control validate" id="txtChaveNF" name="txtChaveNF" readonly>
                </div>
              </div>
            </div>
            <div class="col-sm-3">
              <div class="group-default form-group">
                <label data-error="wrong" data-success="right" for="txtChaveOffline">Chave Off-line</label>
                <div class="relative">
                  <input type="text" placeholder="Chave Off-line" class="input-default focus form-control validate" id="txtChaveOffline" name="txtChaveOffline" readonly>
                </div>
              </div>
            </div>
            <div class="col-sm-3">
              <div class="group-default form-group">
                <label data-error="wrong" data-success="right" for="txtReciboNF">Recibo</label>
                <div class="relative">
                  <input type="text" placeholder="Recibo" class="input-default focus form-control validate" id="txtReciboNF" name="txtReciboNF" readonly>
                </div>
              </div>
            </div>
            <div class="col-sm-3">
              <div class="group-default form-group">
                <label data-error="wrong" data-success="right" for="txtProtocoloNF">Protocolo</label>
                <div class="relative">
                  <input type="text" placeholder="Protocolo" class="input-default focus form-control validate" id="txtProtocoloNF" name="txtProtocoloNF" readonly>
                </div>
              </div>
            </div>
          </div>
        </div>
        <!-- <div class="col-12">
          <button id="btnGerar" style="font-size:20px!important;color:white!important;font-weight:bold;" class="btn btn-primary text-white btn-sisp">Gerar</button>
          <button id="btnImprimir" style="font-size:20px!important;color:white!important;font-weight:bold;" class="btn btn-info text-white btn-sisp">Imprimir</button>
          <input type="submit" id="btnCancelar" style="font-size:20px!important;color:white!important;font-weight:bold;" class=" btn btn-secondary text-white btn-sisp" value="Cancelar">
          <button id="btnExcluir" style="font-size:20px!important;color:white!important;font-weight:bold;" class=" btn btn-danger text-white btn-sisp">Excluir</button>
          <button id="btnConsultar" style="font-size:20px!important;color:white!important;font-weight:bold;" class="btn btn-primary text-white btn-sisp">Consultar</button>
          <button id="btnEmail" style="font-size:20px!important;color:white!important;font-weight:bold;" class="btn btn-info text-white btn-sisp">Enviar Email</button>
        </div> -->
        <div class="col-12 text-center">
          <div class="btn-group flex-wrap btn-group-justified btn-group-lg" role="group" aria-label="Basic example">
            <button id="btnGerar" class="btn btn-secondary text-white btn-sisp botoesMenu"><span class="fas fa-cogs pr-1"></span>Gerar</button>
            <button id="btnImprimir" class="btn btn-secondary text-white btn-sisp botoesMenu"><span class="fas fa-print pr-1" style="color: white!important"></span>Imprimir</button>
            <button id="btnCancelar" class="btn btn-secondary text-white btn-sisp botoesMenu"><span class="fas fa-ban pr-1"></span>Cancelar</button>
            <button id="btnExcluir" class="btn btn-secondary text-white btn-sisp botoesMenu"><span class="fas fa-trash pr-1"></span>Excluir</button>
            <button id="btnConsultar" class="btn btn-secondary text-white btn-sisp botoesMenu"><span class="fas fa-search pr-1"></span>Consultar</button>
            <button id="btnVisualizar" class="btn btn-secondary text-white btn-sisp botoesMenu dropdown-toggle">
              <span class="fas fa-print pr-1" style="color: white!important"></span>Visualizar</button>
            <div class="dropdown-menu" style="margin-left: 71%; top: -84px;" id="dropdownVisualizar">
              <button id="btnVisualizarXML" class="dropdown-item" href="">Visualizar XML</button>
              <button id="btnBaixarXML" class="dropdown-item" href="">Baixar XML</button>
            </div>
            <button id="btnEmail" class="btn btn-secondary text-white btn-sisp botoesMenu"><span class="fas fa-envelope pr-1"></span>Enviar Email</button>
            <button id="btnWhatsApp" class="btn btn-secondary text-white btn-sisp botoesMenu"><span class="fas fa-comments pr-1"></span> Enviar WhatsApp</button>
          </div>
        </div>
      </div>
    </div>
    <?php include_once('../../modais.php'); ?>


    <!-- /.control-sidebar -->
  </div>
  <!-- ./wrapper -->

  <script src="plugins/jquery/jquery.min.js?versao=3.263.17.1"></script>

  <script type="text/javascript" src="dist/js/jquery.dataTables.js?versao=3.263.17.1"></script>
  <script type="text/javascript" src="dist/js/dataTables.bootstrap4.min.js?versao=3.263.17.1"></script>
  <script type="text/javascript" src="dist/js/loadingoverlay.min.js?versao=3.263.17.1"></script>

  <!-- jQuery UI 1.11.4 -->
  <script src="plugins/jquery-ui/jquery-ui.min.js?versao=3.263.17.1"></script>
  <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
  <script>
    $.widget.bridge('uibutton', $.ui.button)
  </script>
  <!-- Bootstrap 4 -->
  <script src="plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.263.17.1"></script>
  <!-- AdminLTE App -->
  <script src="dist/js/adminlte.min.js?versao=3.263.17.1"></script>

  <script src="dist/js/sisplan.js?versao=3.263.17.1"></script>
  <script type="text/javascript" src="utils/funcoes.js?versao=3.263.17.1"></script>
  <!-- SweetAlert2 -->
  <script src="plugins/sweetalert2/sweetalert2.min.js?versao=3.263.17.1"></script>
  <script src="plugins/toastr/toastr.min.js?versao=3.263.17.1"></script>
  <script src="dist/js/requisicoes.js?versao=3.263.17.1"></script>
  <script type="text/javascript" src="dist/js/sum().js?versao=3.263.17.1"></script>
  <script src="utils/cookies.js?versao=3.263.17.1"></script>
  <script src="dist/js/jquery.maskMoney.min.js?versao=3.263.17.1"></script>
  <script src="pages/loja/js/rotinas.js?versao=3.263.17.1"></script>
  <script src="dist/js/dataTables.keyTable.js?versao=3.263.17.1"></script>
  <script src="dist/js/xml2json.js?versao=3.263.17.1"></script>
  <script src="dist/js/driver.min.js?versao=3.263.17.1"></script>
  <script type="text/javascript" src="config.js?versao=3.263.17.1"></script>
  <script src="dist/js/FileSaver.min.js?versao=3.263.17.1"></script>
  <script>
    $(document).ready(async function() {
      if (getCookie('usuario') == "") {
        window.location.href = `${BASE_URI}/login`;
        return;
      }

      let usuario = getCookie('usuario');
      let empresa = getCookie('empresa');

      ipInterno = IP_INTERNO;
      ipExterno = IP_EXTERNO;
      basicAuth = BASIC_AUTH;

      const temAcesso = await temAcessoTela('IMPRIMIR_NFCE');
      if (!temAcesso.resultado) {
        toastrAcesso(temAcesso, BASE_URI);
        return;
      }

    });
  </script>
  <script type=" text/javascript" src="pages/nfce/js/nfce.js?versao=3.263.17.1"></script>

</body>

</html>