<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Sisplan Web | MDF-e</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="../dist/css/adminlte.min.css?versao=3.265.7.1">
  <link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css?versao=3.265.7.1">
  <link href='https://fonts.googleapis.com/css?family=Roboto:400,300,500,600,700,400italic' rel='stylesheet' type='text/css'>
  <link rel="stylesheet" type="text/css" href="../dist/css/dataTables.bootstrap4.min.css?versao=3.265.7.1" />
  <link href='dist/css/bootstrap.min.css?versao=3.265.7.1'>
  <link rel="stylesheet" href="../dist/css/custom.css?versao=3.265.7.1">
  <link rel="stylesheet" href="../dist/css/sisplan.css?versao=3.265.7.1">
  <link rel="stylesheet" type="text/css" href="../plugins/datatables-keytable/css/keyTable.bootstrap4.min.css?versao=3.265.7.1">
  <link rel="stylesheet" type="text/css" href="../dist/css/responsive.bootstrap.min.css?versao=3.265.7.1">
  <link rel="shortcut icon" href="../favicon.ico">
  <link rel="stylesheet" href="../plugins/toastr/toastr.min.css?versao=3.265.7.1">
  <link rel="stylesheet" type="text/css" href="../dist/css/driver.min.css?versao=3.265.7.1" />
  <link rel="stylesheet" href="../dist/css/jquery-ui.css?versao=3.265.7.1">
  <link rel="stylesheet" href="../dist/css/cadastro.css?versao=3.265.7.1">
  <!-- <link rel="stylesheet" href="../plugins/select2/css/select2.min.css?versao=3.265.7.1">
  <link rel="stylesheet" href="../plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css?versao=3.265.7.1">
  <link rel="stylesheet" href="../plugins/datatables-colreorder/css/colReorder.bootstrap4.min.css?versao=3.265.7.1"> -->
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">

  <style>
    .form-control:disabled,
    .form-control[readonly] {
      background-color: #f7f7f7;
      opacity: 1;
    }

    #progressbar li {
      list-style-type: none;
      font-size: 12px;
      width: 100%;
      float: left;
      position: relative
    }

    fieldset {
      text-align: start;
      position: relative;
    }

    /* .card {
      box-shadow: none !important;
      border-radius: 0 !important;
      margin-bottom: 0 !important;
    } */

    .card-header {
      box-shadow: 0px 1px rgb(0 0 0 / 20%) !important;
    }

    .card-header {
      border-bottom: 1px dashed #ddd;
      box-shadow: none !important;
    }

    .card-body {
      padding-left: 1.25rem !important;
      padding-top: 0px;
      padding-bottom: 0px;
      padding-right: 1.25rem !important;
    }

    .card {
      padding: 1.5rem;
      border-top: 2px outset #ddd;
      box-shadow: none !important;
      /* margin-top: 20px; */
      padding-top: 20px;
    }

    .fa-angle-right,
    .fa-angle-down {
      color: #343a40;
    }

    .header-content-page .title-page,
    .title-content-page .title,
    .title-page {
      font-size: 20px;
      line-height: normal;
      font-weight: 500;
      color: var(--font-color);
      margin: 0;
      font-family: Roboto, Arial, sans-serif;
    }

    #btnRepresentante {
      background-color: #3ca2d3 !important;
    }

    #btnTransportadora {
      background-color: #5F9EA0 !important;
    }

    #Totalizadores {
      margin-bottom: 7px;
    }

    .radioStyle {
      border: solid #e0e4e6;
      border-radius: 4px;
      border-width: 2px;
      padding: 6px;
    }

    .bordaRadio {
      border: 2px solid #e0e4e6;
      border-radius: 4px;
      height: 38px;
      padding-right: 50px;
    }

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

    .border-Field {
      border: 1px solid var(--font-color) !important;
      padding: 0 0 0 1.0em !important;
      margin: 0 0 1.0em 0 !important;
      -webkit-box-shadow: 0px 0px 0px 0px #000;
      box-shadow: 0px 0px 0px 0px #000;
      border-radius: 3px;
    }

    .container {
      padding: 0 7px
    }

    #tabelaDocumentos_wrapper .table.dataTable tbody td,
    #tabelaDocumentos_wrapper .table.dataTable thead th {
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
    }
  </style>


</head>

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

    <div id="myModal" class="modal" tabindex="-1" role="dialog">
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <h5 id="myModalLabel" class="modal-title">Modal title</h5>
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">&times;</span>
            </button>
          </div>
          <div class="modal-body">
            <p id="myModalText">Modal body text goes here.</p>
          </div>
          <div class="modal-footer">
            <button id="btnYes" type="button" class="btn btn-primary btn-sisp">Sim</button>
            <button id="btnNo" type="button" class="btn btn-secondary btn-sisp" data-dismiss="modal">Não</button>
          </div>
        </div>
      </div>
    </div>
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper" id="jo316">
      <!-- Content Header (Page header) -->
      <div class="content-header">
        <div class="container-fluid">
          <div class="row mb-2">
            <div class="col-sm-6 col-12">
            </div><!-- /.col -->
            <div class="col-sm-6 col-12">
              <!-- <ol class="breadcrumb float-sm-right">
                <li class="breadcrumb-item"><a href="./index">Início</a></li>
                <li class="breadcrumb-item active">Cadastro</li>
              </ol> -->
            </div><!-- /.col -->
          </div><!-- /.row -->
        </div><!-- /.container-fluid -->
      </div>

      <section class="content">
        <div class="container-fluid">
          <div class="row">
            <div class="col-12">
              <div style="height:auto;min-height:715px">
                <div class="card-header text-center flex" style="border: none!important;box-shadow:none!important;">
                  <h2 class="ml-2">Cadastro de MDF-e
                    <button type="button" class="btn btn-info btn-sm ml-2" title="Tutorial" style="color: white;" id="tutorial">
                      <i class="fas fa-question-circle"></i>
                    </button>
                  </h2>
                </div>
                <div class="row">
                  <div class="col-md-12 mx-0">
                    <form id="msform">
                      <ul id="progressbar">
                        <li class="active" id="account"><strong>Geral</strong></li>
                      </ul>
                      <!-- <p>Preencha os dados e clique em avançar até a conclusão da ordem de compra</p> -->
                      <fieldset>
                        <div class="form-card" id="tourGeral">
                          <div class="card-body">
                            <div class="card card-body">
                              <div class=" tab-pane fade show active" role="tabpanel" aria-labelledby="geral-tab">

                                <div class="form-row" id="dadosGerais">
                                  <div class="form-group col-md-2 col-12">
                                    <label>Emissão</label>
                                    <input type="date" max="2500-12-31" class="input-default focus form-control" id="txtDtEmissao">
                                  </div>
                                  <div class="col-md-2  col-12 form-group">
                                    <label>RNTRC</label>
                                    <input type="text" class="input-default focus form-control" id="txtRNTRC" name="txtRNTRC" placeholder="RNTRC">
                                  </div>
                                  <div class="col-md-2  col-12 form-group">
                                    <label>CIOT</label>
                                    <input type="text" class="input-default focus form-control" id="txtCIOT" name="txtCIOT" placeholder="CIOT">
                                  </div>
                                  <div class="form-group col-12 col-md-3">
                                    <label data-error="wrong" data-success="right" for="txtVeiculo">Veículo *
                                    </label>
                                    <div class="input-group">
                                      <input type="text" class="input-default focus form-control validate" id="txtVeiculo" name="txtVeiculo" placeholder="Veículo *">
                                      <div class="input-group-append">
                                        <button class="btn bg-danger" id="btnVeiculo" name="btnVeiculo" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                        <button class="btn bg-danger" id="btnLimpaVeiculo" name="btnLimpaVeiculo" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                      </div>
                                    </div>
                                  </div>
                                  <div class="col-md-3  col-12 form-group">
                                    <label>Capac. (KG)</label>
                                    <input type="text" class="input-default focus form-control maskDecimais" id="txtCapacKG" name="txtCapacKG" placeholder="CapacKG">
                                  </div>
                                  <div class="col-5">
                                    <label data-error="wrong" data-success="right" for="txtReboque">Reboque
                                    </label>
                                    <div class="input-group">
                                      <!-- <input type="text" autocomplete="off" class="input-default focus form-control validate" id="txtReboque" name="txtReboque" required placeholder="Reboque"> -->
                                      <select class="js-example-programmatic js-states form-control" id="txtReboque" name="txtReboque" multiple="multiple">
                                      </select>
                                      <div class="input-group-append">
                                        <button class="btn bg-danger" id="btnReboque" name="btnReboque" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                        <button class="btn bg-danger" id="btnLimpaReboque" name="btnLimpaReboque" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                      </div>
                                    </div>
                                  </div>
                                  <div class="form-group col-3">
                                    <label data-error="wrong" data-success="right" for="txtMotorista">Motorista *
                                    </label>
                                    <div class="input-group">
                                      <input type="text" autocomplete="off" class="input-default focus form-control validate" id="txtMotorista" name="txtMotorista" required placeholder="Motorista">
                                      <div class="input-group-append">
                                        <button class="btn bg-danger" id="btnMotorista" name="btnMotorista" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                        <button class="btn bg-danger" id="btnLimpaMotorista" name="btnLimpaMotorista" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                      </div>
                                    </div>
                                  </div>
                                  <div class="col-lg-4  col-4 form-group">
                                    <label data-error="wrong" data-success="right" for="txtTipoTransporte">Tipo Transporte</label>
                                    <div class="input-group bordaRadio px-1">
                                      <input type="radio" checked="checked" id="radioCargaPropria" name="radioTipoTransporte">
                                      <label class="container ml-2 mr-0 pl-0" for="radioCargaPropria">Transporte carga própria</label>
                                      <input type="radio" id="radioTransportadora" name="radioTipoTransporte">
                                      <label class="container ml-2 mr-0 pl-0" for="radioTransportadora">Transportadora</label>
                                    </div>
                                  </div>
                                  <div class="col-lg-5  col-12 form-group">
                                    <label data-error="wrong" data-success="right" for="txtTipoTransportador">Tipo Transportador</label>
                                    <div class="input-group bordaRadio px-1">
                                      <input type="radio" checked="checked" id="radioNenhum" name="radioTipoTransportador">
                                      <label class="container ml-2 mr-0 pl-0" for="radioNenhum">0 - Nenhum</label>
                                      <input type="radio" id="radioECT" name="radioTipoTransportador">
                                      <label class="container ml-2 mr-0 pl-0" for="radioECT">1 - ECT</label>
                                      <input type="radio" id="radioTAC" name="radioTipoTransportador">
                                      <label class="container ml-2 mr-0 pl-0" for="radioTAC">2 - TAC</label>
                                      <input type="radio" id="radioCTC" name="radioTipoTransportador">
                                      <label class="container ml-2 mr-0 pl-0" for="radioCTC">3 - CTC</label>
                                    </div>
                                  </div>
                                  <div class="form-group col-3">
                                    <label data-error="wrong" data-success="right" for="txtUFCarregamento">UF carregamento *
                                    </label>
                                    <div class="input-group">
                                      <input type="text" autocomplete="off" class="input-default focus form-control validate" id="txtUFCarregamento" name="txtUFCarregamento" required placeholder="UF Carregamento">
                                      <div class="input-group-append">
                                        <button class="btn bg-danger" id="btnUFCarregamento" name="btnUFCarregamento" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                        <button class="btn bg-danger" id="btnLimpaUFCarregamento" name="btnLimpaUFCarregamento" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                      </div>
                                    </div>
                                  </div>
                                  <div class="form-group col-4">
                                    <label data-error="wrong" data-success="right" for="txtUFDescarregamento">UF descarregamento *
                                    </label>
                                    <div class="input-group">
                                      <input type="text" autocomplete="off" class="input-default focus form-control validate" id="txtUFDescarregamento" name="txtUFDescarregamento" required placeholder="UF descarregamento">
                                      <div class="input-group-append">
                                        <button class="btn bg-danger" id="btnUFDescarregamento" name="btnUFDescarregamento" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                        <button class="btn bg-danger" id="btnLimpaUFDescarregamento" name="btnLimpaUFDescarregamento" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                      </div>
                                    </div>
                                  </div>
                                  <div class="form-group col-4">
                                    <label data-error="wrong" data-success="right" for="txtMunicipiosCarregamento">Municípios carregamento
                                    </label>
                                    <div class="input-group">
                                      <!-- <input type="text" autocomplete="off" class="input-default focus form-control validate" id="txtMunicipiosCarregamento" name="txtMunicipiosCarregamento" required placeholder="Municípios carregamento"> -->
                                      <select class="js-example-programmatic js-states form-control" id="txtMunicipiosCarregamento" name="txtMunicipiosCarregamento" multiple="multiple">
                                      </select>
                                      <div class="input-group-append">
                                        <button class="btn bg-danger" id="btnMunicipiosCarregamento" name="btnMunicipiosCarregamento" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                        <button class="btn bg-danger" id="btnLimpaMunicipiosCarregamento" name="btnLimpaMunicipiosCarregamento" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                      </div>
                                    </div>
                                  </div>
                                  <div class="form-group col-4">
                                    <label data-error="wrong" data-success="right" for="txtUFPercurso">UF's percurso
                                    </label>
                                    <div class="input-group">
                                      <select class="js-example-programmatic js-states form-control" id="txtUFPercurso" name="txtUFPercurso" multiple="multiple">
                                      </select>
                                      <!-- <input type="text" autocomplete="off" class="input-default focus form-control" id="txtUFPercurso" name="txtUFPercurso" placeholder="UF's percurso"> -->
                                      <div class="input-group-append">
                                        <button class="btn bg-danger" id="btnUFPercurso" name="btnUFPercurso" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                        <button class="btn bg-danger" id="btnLimpaUFPercurso" name="btnLimpaUFPercurso" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                      </div>
                                    </div>
                                  </div>
                                  <div class="form-group col-4">
                                    <label data-error="wrong" data-success="right" for="txtMotoristaVeiculo">Demais motoristas veículo
                                    </label>
                                    <div class="input-group">
                                      <!-- <input type="text" autocomplete="off" class="input-default focus form-control validate" id="txtMotoristaVeiculo" name="txtMotoristaVeiculo" required placeholder="Demais motoristas veículo"> -->
                                      <select class="js-example-programmatic js-states form-control" id="txtMotoristaVeiculo" name="txtMotoristaVeiculo" multiple="multiple">
                                      </select>
                                      <div class="input-group-append">
                                        <button class="btn bg-danger" id="btnMotoristaVeiculo" name="btnMotoristaVeiculo" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                        <button class="btn bg-danger" id="btnLimpaMotoristaVeiculo" name="btnLimpaMotoristaVeiculo" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                      </div>
                                    </div>
                                  </div>
                                  <div class="col-lg-3 mt-2">
                                    <input type="checkbox" id="checkCargaPosterior"> <label for="checkCargaPosterior">Carga posterior</label>        
                                  </div>
                                </div>
                              </div>
                              <div class="card-header" role="tab">
                                <a style="width:100%;" id="ObservacoesAba" data-toggle="collapse" data-parent="#multiCollapseExample3" href="#multiCollapseExample3" aria-expanded="true" aria-controls="collapseOne1">
                                  <div class="row">
                                    <div style="max-width:20px;margin-top:auto; margin-bottom: auto" class="col-1">
                                      <i class="fas fa-angle-right"></i>
                                    </div>
                                    <div class="col-11">
                                      <h4 class="title-page">
                                        Observações
                                      </h4>
                                    </div>
                                  </div>
                                </a>
                              </div>

                              <div class="collapse" id="multiCollapseExample3">
                                <div class="card-body">
                                  <div class="form-group">
                                    <label>Informações adicionais de interesse do fisco</label>
                                    <textarea style="resize: none" id="txtObsFisco" placeholder="Informações adicionais de interesse do fisco" class="input-default focus form-control" rows="3"></textarea>
                                  </div>
                                </div>
                                <div class="card-body">
                                  <div class="form-group">
                                    <label>Informações complementares de interesse do contribuinte</label>
                                    <textarea style="resize: none" id="txtObsContribuinte" placeholder="Informações complementares de interesse do contribuinte" class="input-default focus form-control" rows="3"></textarea>
                                  </div>
                                </div>
                              </div>

                              <div class="card-header" role="tab">
                                <a style="width:100%;" id="Totais" data-toggle="collapse" data-parent="#multiCollapseExample4" href="#multiCollapseExample4" aria-expanded="true" aria-controls="collapseOne1">
                                  <div class="row">
                                    <div style="max-width:20px;margin-top:auto; margin-bottom: auto" class="col-1">
                                      <i class="fas fa-angle-right"></i>
                                    </div>
                                    <div class="col-11">
                                      <h4 class="title-page">
                                        Totalizadores
                                      </h4>
                                    </div>
                                  </div>
                                </a>
                              </div>

                              <div class="collapse" id="multiCollapseExample4">
                                <div class="card card-body">
                                  <div class="form-row" id="Totalizadores">
                                    <div class="form-group col-md-4 col-12">
                                      <label data-error="wrong" data-success="right" for="txtTotQtdeNotas">Qtde notas </label>
                                      <div class="input-group">
                                        <input type="text" class="input-default focus form-control maskDecimais" id="txtTotQtdeNotas" name="txtTotQtdeNotas" class="form-control" disabled>
                                      </div>
                                    </div>
                                    <div class="form-group col-md-4 col-12">
                                      <label data-error="wrong" data-success="right" for="txtTotValorCarga">Valor da carga </label>
                                      <div class="input-group">
                                        <input type="text" class="input-default focus form-control maskDecimais" id="txtTotValorCarga" name="txtTotValorCarga" class="form-control" disabled>
                                      </div>
                                    </div>
                                    <div class="form-group col-md-4 col-12">
                                      <label data-error="wrong" data-success="right" for="txtTotPesoBruto">Peso bruto (kg) </label>
                                      <div class="input-group">
                                        <input type="text" class="input-default focus form-control maskDecimais" id="txtTotPesoBruto" name="txtTotPesoBruto" class="form-control" disabled>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                              <div class="col-lg-12 col-12 card-header" role="tab">
                                <a style="width:100%;" id="Itens" data-toggle="collapse" data-parent="#multiCollapseExample5" href="#multiCollapseExample5" aria-expanded="true" aria-controls="collapseOne1">
                                  <div class="row">
                                    <div style="max-width:20px;margin-top:auto; margin-bottom: auto" class="col-1">
                                      <i class="fas fa-angle-right"></i>
                                    </div>
                                    <div class="col-11">
                                      <h4 class="title-page">
                                        Documentos vinculados
                                      </h4>
                                    </div>
                                  </div>
                                </a>
                              </div>
                              <div class="col-lg-12 col-12 collapse" id="multiCollapseExample5">
                                <div class="card-body mt-3">
                                  <nav>
                                    <div class="nav nav-tabs justify-content-start" id="nav-tab" role="tablist" style="text-decoration: none">
                                      <a class="nav-link abaLink active" id="tabNFe" data-toggle="tab" href="#divNFe" role="tab" aria-controls="divNFe" aria-selected="true">NF-e</a>
                                      <a class="nav-link abaLink" id="tabCTe" data-toggle="tab" href="#divCTe" role="tab" aria-controls="divCTe" aria-selected="false">CT-e</a>
                                      <a class="nav-link abaLink" id="tabNFMod1" data-toggle="tab" href="#divNFMod1" role="tab" aria-controls="divNFMod1" aria-selected="false">NF - Nota fiscal mod. 1/1A</a>
                                      <a class="nav-link abaLink" id="tabConheTransp" data-toggle="tab" href="#divConheTransp" role="tab" aria-controls="divConheTransp" aria-selected="false">CT - Conhecimento Transporte</a>
                                      <a class="nav-link abaLink" id="tabSeguradora" data-toggle="tab" href="#divSeguradora" role="tab" aria-controls="divSeguradora" aria-selected="false">Seguradora</a>
                                      <a class="nav-link abaLink" id="tabProdPredo" data-toggle="tab" href="#divProdPredo" role="tab" aria-controls="divProdPredo" aria-selected="false">Prod. Predominante</a>
                                    </div>
                                  </nav>
                                  <div class="tab-content" id="nav-tabContent">
                                    <!-- <div class="row">
                                      <div class="col-lg-12 mt-2">
                                        <input type="checkbox" id="checkNaoVinculados"> <label for="checkNaoVinculados">Buscar Somente Documentos não vinculados a MDF-e.</label>        
                                      </div>
                                    </div> -->
                                    <div class="tab-pane fade show active card" id="divNFe" role="tabpanel" aria-labelledby="tabNFe">
                                      <div class="card-body">
                                        <div class="row pt-2">
                                          <div class="form-group col-sm-3">
                                            <label>Chave</label>
                                            <input type="text" class="form-control" id="txtChaveNFe">
                                          </div>
                                        </div>
                                        <div class="row mt-2" id="botoesTabelaNFe">
                                          <!-- <div class="form-group col-sm-12"> -->
                                          <input id="btnSelecionarNFe" type="button" style="font-size:15px;" class="ml-auto btn btn-danger btn-lg action-button btn-sisp" value="Selecionar vários">
                                          <!-- </div> -->
                                        </div>
                                        <div class="row pt-2">
                                          <div class="col-sm-12 table-responsive">
                                            <table id="tabelaNFe" class="table table-sm table-select table-hover" width="100%">
                                              <thead>
                                              </thead>
                                              <tbody>
                                              </tbody>
                                            </table>
                                          </div>
                                        </div>
                                      </div>
                                    </div>

                                    <div class="tab-pane fade show card" id="divCTe" role="tabpanel" aria-labelledby="tabCTe">
                                      <div class="card-body">
                                        <div class="row pt-2">
                                          <div class="form-group col-sm-3">
                                            <label data-error="wrong" data-success="right" for="txtChaveCTe">Chave
                                            </label>
                                            <div class="input-group">
                                              <input type="text" autocomplete="off" class="input-default focus form-control validate" id="txtChaveCTe" name="txtChaveCTe" placeholder="Chave">
                                            </div>
                                          </div>
                                        </div>
                                        <div class="row mt-2" id="botoesTabelaCTe">
                                          <!-- <div class="form-group col-sm-12"> -->
                                          <input id="btnSelecionarCte" type="button" style="font-size:15px;" class="ml-auto btn btn-danger btn-lg action-button btn-sisp" value="Selecionar vários">
                                          <!-- </div> -->
                                        </div>
                                        <div class="row pt-2">
                                          <div class="col-sm-12 table-responsive">
                                            <table id="tabelaCTe" class="table table-sm table-select table-hover" width="100%">
                                              <thead>
                                              </thead>
                                              <tbody>
                                              </tbody>
                                            </table>
                                          </div>
                                        </div>
                                      </div>
                                    </div>

                                    <div class="tab-pane fade show card" id="divNFMod1" role="tabpanel" aria-labelledby="tabNFMod1">
                                      <div class="card-body">
                                        <div class="row pt-2">
                                          <div class="form-group col-sm-3">
                                            <label data-error="wrong" data-success="right" for="txtMunicipioNFMod1">Município *
                                            </label>
                                            <div class="input-group">
                                              <input type="text" autocomplete="off" class="input-default focus form-control validate" id="txtMunicipioNFMod1" name="txtMunicipioNFMod1" required placeholder="Município">
                                              <div class="input-group-append">
                                                <button class="btn bg-danger" id="btn-MunicipioNFMod1" name="btn-MunicipioNFMod1" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                <button class="btn bg-danger" id="btn-limpar-MunicipioNFMod1" name="btn-limpar-MunicipioNFMod1" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                              </div>
                                            </div>
                                          </div>
                                          <div class="form-group col-sm-3">
                                            <label>Nota *</label>
                                            <input type="text" class="form-control" required id="txtNotaNFMod1">
                                          </div>
                                          <div class="form-group col-sm-3">
                                            <label>Série *</label>
                                            <input type="text" class="form-control" required id="txtSerieNFMod1">
                                          </div>
                                          <div class="form-group col-sm-3">
                                            <label>CNPJ - Emitente *</label>
                                            <input type="text" class="form-control" required id="txtCNPJNFMod1">
                                          </div>
                                          <div class="form-group col-sm-3">
                                            <label>UF destino *</label>
                                            <input type="text" class="form-control" required id="txtUFDestinoNFMod1" maxlength="2">
                                          </div>
                                          <div class="form-group col-sm-3">
                                            <label>Data emissão *</label>
                                            <input type="date" class="form-control" required id="txtDataEmissaoNFMod1">
                                          </div>
                                          <div class="form-group col-sm-3">
                                            <label>Peso bruto (kg) *</label>
                                            <input type="text" class="form-control maskDecimais" required id="txtPesoBrutoNFMod1">
                                          </div>
                                          <div class="form-group col-sm-3">
                                            <label>Valor *</label>
                                            <input type="text" class="form-control maskDecimais" required id="txtValorNFMod1">
                                          </div>
                                        </div>
                                        <div class="row mt-2" id="botoesTabelaNFMod1">
                                          <!-- <div class="form-group col-sm-12"> -->
                                          <input id="btnIncluirNFMod1" type="button" style="font-size:15px;" class="ml-auto btn btn-danger btn-lg action-button btn-sisp" value="Incluir">
                                          <!-- </div> -->
                                        </div>
                                        <div class="row pt-2">
                                          <div class="col-sm-12 table-responsive">
                                            <table id="tabelaNFMod1" class="table table-sm table-select table-hover" width="100%">
                                              <thead>
                                              </thead>
                                              <tbody>
                                              </tbody>
                                            </table>
                                          </div>
                                        </div>
                                      </div>
                                    </div>

                                    <div class="tab-pane fade show card" id="divConheTransp" role="tabpanel" aria-labelledby="tabConheTransp">
                                      <div class="card-body">
                                        <div class="row pt-2">
                                          <div class="form-group col-sm-3">
                                            <label data-error="wrong" data-success="right" for="txtMunicipioConheTransp">Município *
                                            </label>
                                            <div class="input-group">
                                              <input type="text" autocomplete="off" class="input-default focus form-control validate" id="txtMunicipioConheTransp" name="txtMunicipioConheTransp" required placeholder="Município">
                                              <div class="input-group-append">
                                                <button class="btn bg-danger" id="btn-MunicipioConheTransp" name="btn-MunicipioConheTransp" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                <button class="btn bg-danger" id="btn-limpar-MunicipioConheTransp" name="btn-limpar-MunicipioConheTransp" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                              </div>
                                            </div>
                                          </div>
                                          <div class="form-group col-sm-3">
                                            <label>Nota *</label>
                                            <input type="text" class="form-control" required id="txtNotaConheTransp">
                                          </div>
                                          <div class="form-group col-sm-3">
                                            <label>Série *</label>
                                            <input type="text" class="form-control" required id="txtSerieConheTransp">
                                          </div>
                                          <div class="form-group col-sm-3">
                                            <label>Sub-série *</label>
                                            <input type="text" class="form-control" required id="txtSubSerieConheTransp">
                                          </div>
                                          <div class="form-group col-sm-3">
                                            <label>Data emissão *</label>
                                            <input type="date" class="form-control" required id="txtDataEmissaoConheTransp">
                                          </div>
                                          <div class="form-group col-sm-3">
                                            <label>Peso bruto (kg) *</label>
                                            <input type="text" class="form-control maskDecimais" required id="txtPesoBrutoConheTransp">
                                          </div>
                                          <div class="form-group col-sm-3">
                                            <label>Valor *</label>
                                            <input type="text" class="form-control maskDecimais" required id="txtValorConheTransp">
                                          </div>
                                        </div>
                                        <div class="row mt-2" id="botoesTabelaConheTransp">
                                          <!-- <div class="form-group col-sm-12"> -->
                                          <input id="btnIncluirConheTransp" type="button" style="font-size:15px;" class="ml-auto btn btn-danger btn-lg action-button btn-sisp" value="Incluir">
                                          <!-- </div> -->
                                        </div>
                                        <div class="row pt-2">
                                          <div class="col-sm-12 table-responsive">
                                            <table id="tabelaConheTransp" class="table table-sm table-select table-hover" width="100%">
                                              <thead>
                                              </thead>
                                              <tbody>
                                              </tbody>
                                            </table>
                                          </div>
                                        </div>
                                      </div>
                                    </div>

                                    <div class="tab-pane fade show card" id="divSeguradora" role="tabpanel" aria-labelledby="tabSeguradora">
                                      <div class="card-body">
                                        <nav>
                                          <div class="nav nav-tabs justify-content-start" id="nav-tab" role="tablist" style="text-decoration: none">
                                            <a class="nav-link abaLink active" id="tabRespSeguro" data-toggle="tab" href="#divRespSeguro" role="tab" aria-controls="divRespSeguro" aria-selected="true">Responsável pelo seguro</a>
                                            <a class="nav-link abaLink" id="tabInfSeguradora" data-toggle="tab" href="#divInfSeguradora" role="tab" aria-controls="divInfSeguradora" aria-selected="false">Informações da seguradora</a>
                                            <a class="nav-link abaLink" id="tabAverbacoes" data-toggle="tab" href="#divAverbacoes" role="tab" aria-controls="divAverbacoes" aria-selected="false">Averbações</a>
                                          </div>
                                        </nav>

                                        <div class="tab-content" id="nav-tabContent">
                                          <div class="tab-pane fade show active" id="divRespSeguro" role="tabpanel" aria-labelledby="tabRespSeguro">
                                            <div class="card-body">
                                              <div class="row pt-2">
                                                <div class="form-group col-sm-3">
                                                  <label>Tipo</label>
                                                  <select id="rgTipoRespSeguro" class="custom-select">
                                                    <option value="0" selected>1 - Emitente</option>
                                                    <option value="1">2 - Contratante</option>
                                                  </select>
                                                </div>
                                                <div class="form-group col-sm-3">
                                                  <label>CNPJ</label>
                                                  <input type="text" class="form-control" id="txtCNPJRespSeguro">
                                                </div>
                                                <div class="form-group col-sm-3">
                                                  <label>CPF</label>
                                                  <input type="text" class="form-control" id="txtCPFRespSeguro">
                                                </div>
                                              </div>
                                            </div>
                                          </div>
                                          <div class="tab-pane fade show" id="divInfSeguradora" role="tabpanel" aria-labelledby="tabInfSeguradora">
                                            <div class="card-body">
                                              <div class="row pt-2">
                                                <div class="form-group col-sm-3">
                                                  <label>Nome</label>
                                                  <input type="text" class="form-control" id="txtNomeInfSeguradora">
                                                </div>
                                                <div class="form-group col-sm-3">
                                                  <label>CNPJ</label>
                                                  <input type="text" class="form-control" id="txtCNPJInfSeguradora">
                                                </div>
                                                <div class="form-group col-sm-3">
                                                  <label>Apólice</label>
                                                  <input type="text" class="form-control" id="txtApoliceInfSeguradora">
                                                </div>
                                              </div>
                                            </div>
                                          </div>
                                          <div class="tab-pane fade show" id="divAverbacoes" role="tabpanel" aria-labelledby="tabAverbacoes">
                                            <div class="card-body">
                                              <div class="row pt-2">
                                                <div class="form-group col-sm-3">
                                                  <label>Número</label>
                                                  <input type="text" class="form-control" id="txtNumeroAverbacoes" maxlength="40">
                                                </div>
                                              </div>
                                              <div class="row mt-2" id="botoesTabelaAverbacoes">
                                                <!-- <div class="form-group col-sm-12"> -->
                                                <!-- <input id="btnIncluirAverbacoes" type="button" style="font-size:15px;" class="ml-auto btn btn-danger btn-lg action-button btn-sisp" value="Incluir"> -->
                                                <!-- </div> -->
                                              </div>
                                              <div class="row pt-2">
                                                <div class="col-sm-12 table-responsive">
                                                  <table id="tabelaAverbacoes" class="table table-sm table-select table-hover" width="100%">
                                                    <thead>
                                                    </thead>
                                                    <tbody>
                                                    </tbody>
                                                  </table>
                                                </div>
                                              </div>
                                            </div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>

                                    <div class="tab-pane fade show card" id="divProdPredo" role="tabpanel" aria-labelledby="tabProdPredo">
                                      <div class="card-body">
                                        <div class="row pt-2">
                                          <div class="form-group col-sm-3">
                                            <label>Tipo Carga</label>
                                            <select id="rgTipoCargaProdPredo" class="custom-select">
                                              <option value="00">00-Nenhum</option>
                                              <option value="01">01-Granel sólido</option>
                                              <option value="02">02-Granel líquido</option>
                                              <option value="03">03-Frigorificada</option>
                                              <option value="04">04-Conteinerizada</option>
                                              <option value="05">05-Carga Geral</option>
                                              <option value="06">06-Neogranel</option>
                                              <option value="07">07-Perigosa (granel sólido)</option>
                                              <option value="08">08-Perigosa (granel líquido)</option>
                                              <option value="09">09-Perigosa (carga frigorificada)</option>
                                              <option value="10">10-Perigosa (conteinerizada)</option>
                                              <option value="11">11-Perigosa (carga geral)</option>
                                            </select>
                                          </div>
                                          <div class="form-group col-sm-3">
                                            <label>Desc. prod. predominante</label>
                                            <input type="text" class="form-control" id="txtDescProdPredomiProdPredo">
                                          </div>
                                          <div class="form-group col-sm-3">
                                            <label data-error="wrong" data-success="right" for="txtCEPCarregamentoProdPredo">CEP carregamento MDF-e
                                            </label>
                                            <div class="input-group">
                                              <input type="text" autocomplete="off" class="input-default focus form-control validate" id="txtCEPCarregamentoProdPredo" name="txtCEPCarregamentoProdPredo" required placeholder="CEP">
                                              <div class="input-group-append">
                                                <button class="btn bg-danger" id="btn-CEPCarregamentoProdPredo" name="btn-CEPCarregamentoProdPredo" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                <button class="btn bg-danger" id="btn-limpar-CEPCarregamentoProdPredo" name="btn-limpar-CEPCarregamentoProdPredo" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                              </div>
                                            </div>
                                          </div>
                                          <div class="form-group col-sm-3">
                                            <label data-error="wrong" data-success="right" for="txtCEPDescarregamentoProdPredo">CEP descarregamento MDF-e
                                            </label>
                                            <div class="input-group">
                                              <input type="text" autocomplete="off" class="input-default focus form-control validate" id="txtCEPDescarregamentoProdPredo" name="txtCEPDescarregamentoProdPredo" required placeholder="CEP">
                                              <div class="input-group-append">
                                                <button class="btn bg-danger" id="btn-CEPDescarregamentoProdPredo" name="btn-CEPDescarregamentoProdPredo" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                <button class="btn bg-danger" id="btn-limpar-CEPDescarregamentoProdPredo" name="btn-limpar-CEPDescarregamentoProdPredo" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                              </div>
                                            </div>
                                          </div>
                                          <div class="form-group col-sm-3">
                                            <label>Latitude carregamento</label>
                                            <input type="number" class="form-control" id="txtLatitudeCarregamentoProdPredo">
                                          </div>
                                          <div class="form-group col-sm-3">
                                            <label>Latitude descarregamento</label>
                                            <input type="number" class="form-control" id="txtLatitudeDescarregamentoProdPredo">
                                          </div>
                                          <div class="form-group col-sm-3">
                                            <label>Longitude carregamento</label>
                                            <input type="number" class="form-control" id="txtLongitudeCarregamentoProdPredo">
                                          </div>
                                          <div class="form-group col-sm-3">
                                            <label>Longitude descarregamento</label>
                                            <input type="number" class="form-control" id="txtLongitudeDescarregamentoProdPredo">
                                          </div>
                                        </div>
                                      </div>
                                    </div>

                                  </div>
                                </div>
                              </div>
                              <div class="row ml-auto">
                                <input type="button" name="btnGravar" class="action-button float-right" value="Gravar" id="btnGravar" />
                              </div>
                            </div>
                          </div>
                        </div>
                      </fieldset>
                    </form>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </section>
    </div>
  </div>
  <div id="modal-Selecionar" 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">Consulta Documentos</h4>
          <label style="margin-top: 12px; margin-left: 15px;" for="checkTodasEmpresas"><input type="checkbox" id="checkTodasEmpresas"> Todas Empresas</label>
          <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="group-default form-group col-3">
              <label for="txtDataEmiDe">Emissão De: </label>
              <div class="relative">
                <input type="date" max="2500-12-31" value="1200-01-01" class="input-default focus form-control validate" id="txtDataEmiDe" name="DataDe">
              </div>
            </div>
            <div class="group-default form-group col-3">
              <label for="txtDataEmiAte">Até: </label>
              <div class="relative">
                <input type="date" max="2500-12-31" value="2500-12-01" class="input-default focus form-control validate" id="txtDataEmiAte" name="DataDe">
              </div>
            </div>
            <div class="group-default form-group col-3">
              <label for="txtDataEntregaDe">Entrada/Saída De: </label>
              <div class="relative">
                <input type="date" max="2500-12-31" value="1200-01-01" class="input-default focus form-control validate" id="txtDataEntradaSaidaDe" name="DataDe">
              </div>
            </div>
            <div class="group-default form-group col-3">
              <label for="txtDataEntradaSaidaAte">Até: </label>
              <div class="relative">
                <input type="date" max="2500-12-31" value="2500-12-01" class="input-default focus form-control validate" id="txtDataEntradaSaidaAte" name="DataDe">
              </div>
            </div>
          </div>
          <div class="form-row">
            <div class="col-3">
              <label data-error="wrong" data-success="right" for="txtTransportadora">Transportadora
              </label>
              <div class="input-group">
                <!-- <input type="text" autocomplete="off" class="input-default focus form-control validate" id="txtTransportadora" name="txtTransportadora" required placeholder="Transportadora"> -->
                <select class="js-example-programmatic js-states form-control" id="txtTransportadora" name="txtTransportadora" multiple="multiple">
                </select>
                <div class="input-group-append">
                  <button class="btn bg-danger" id="btnTransportadora" name="btnTransportadora" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                  <button class="btn bg-danger" id="btnLimpaTransportadora" name="btnLimpaTransportadora" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                </div>
              </div>
            </div>
            <div class="col-3">
              <label data-error="wrong" data-success="right" for="txtGrupoCli">Grupo cliente
              </label>
              <div class="input-group">
                <!-- <input type="text" autocomplete="off" class="input-default focus form-control validate" id="txtGrupoCli" name="txtGrupoCli" required placeholder="GrupoCli"> -->
                <select class="js-example-programmatic js-states form-control" id="txtGrupoCli" name="txtGrupoCli" multiple="multiple">
                </select>
                <div class="input-group-append">
                  <button class="btn bg-danger" id="btnGrupoCli" name="btnGrupoCli" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                  <button class="btn bg-danger" id="btnLimpaGrupoCli" name="btnLimpaGrupoCli" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                </div>
              </div>
            </div>
            <div class="col-3">
              <label data-error="wrong" data-success="right" for="txtPlaca">Placa
              </label>
              <div class="input-group">
                <!-- <input type="text" autocomplete="off" class="input-default focus form-control validate" id="txtPlaca" name="txtPlaca" required placeholder="Placa"> -->
                <select class="js-example-programmatic js-states form-control" id="txtPlaca" name="txtPlaca" multiple="multiple">
                </select>
                <div class="input-group-append">
                  <button class="btn bg-danger" id="btnPlaca" name="btnPlaca" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                  <button class="btn bg-danger" id="btnLimpaPlaca" name="btnLimpaPlaca" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                </div>
              </div>
            </div>
            <div class="col-3">
              <label data-error="wrong" data-success="right" for="txtNumCargaConsulta">Nº Carga </label>
              <div class="input-group">
                <input type="text" autocomplete="off" class="input-default focus form-control" id="txtNumCargaConsulta" name="txtNumCargaConsulta" class="form-control" placeholder="Nº Carga">
                <div class="input-group-append">
                  <button class="btn bg-danger" id="btn-NumCargaConsulta" name="btn-NumCargaConsulta" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                  <button class="btn bg-danger" id="btn-limpa-NumCargaConsulta" name="btn-limpa-NumCargaConsulta" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                </div>
              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-3">
              <label data-error="wrong" data-success="right" for="txtFaturaConsulta">Fatura </label>
              <div class="input-group">
                <input type="text" autocomplete="off" class="input-default focus form-control" id="txtFaturaConsulta" name="txtFaturaConsulta" class="form-control" placeholder="Fatura">
              </div>
            </div>
            <div class="col-md-3 col-3 form">
              <fieldset class="form border-Field mb-0 pb-0" title="Opções disponíveis conforme (Tipo Transporte) selecionado na tela anterior.">
                <legend class="textoBorda mb-0 pb-0">Tipo dados</legend>
                <div class="form-row">
                  <div class="radio-group form-radio">
                    <label class="container">
                      <input type="radio" checked="checked" id="radioTipoDadosNFe" name="tipoDados">
                      <span class="checkmark"></span> NF-e</label>
                  </div>
                  <div class="radio-group form-radio">
                    <label class="container">
                      <input type="radio" id="radioTipoDadosCTe" name="tipoDados">
                      <span class="checkmark"></span> CT-e</label>
                  </div>
                  <div class="radio-group form-radio">
                    <label class="container">
                      <input type="radio" id="radioTipoDadosNFeRadar" name="tipoDados">
                      <span class="checkmark"></span> NF-e radar</label>
                  </div>
                </div>
              </fieldset>
            </div>
            <div class="col-md-3 col-3 form">
              <fieldset class="form border-Field mb-0 pb-0">
                <legend class="textoBorda mb-0 pb-0">Existe MDF-e</legend>
                <div class="form-row">
                  <div class="radio-group form-radio">
                    <label class="container">
                      <input type="radio" id="radioExiteMDFeTodos" name="existeMDFe">
                      <span class="checkmark"></span> Todos</label>
                  </div>
                  <div class="radio-group form-radio">
                    <label class="container">
                      <input type="radio" id="radioExiteMDFeSim" name="existeMDFe">
                      <span class="checkmark"></span> Sim</label>
                  </div>
                  <div class="radio-group form-radio">
                    <label class="container">
                      <input type="radio" checked="checked" id="radioExiteMDFeNao" name="existeMDFe">
                      <span class="checkmark"></span> Não</label>
                  </div>
                </div>
              </fieldset>
            </div>
            <div class="col-md-3 col-3 form">
              <fieldset class="form border-Field mb-0 pb-0">
                <legend class="textoBorda mb-0 pb-0">Tipo nota</legend>
                <div class="form-row">
                  <div class="radio-group form-radio">
                    <label class="container">
                      <input type="radio" checked="checked" id="radioTipoNotaTodas" name="tipoNota">
                      <span class="checkmark"></span> Todas</label>
                  </div>
                  <div class="radio-group form-radio">
                    <label class="container">
                      <input type="radio" id="radioTipoNotaEntrada" name="tipoNota">
                      <span class="checkmark"></span>Entrada</label>
                  </div>
                  <div class="radio-group form-radio">
                    <label class="container">
                      <input type="radio" id="radioTipoNotaSaida" name="tipoNota">
                      <span class="checkmark"></span>Saída</label>
                  </div>
                </div>
              </fieldset>
            </div>
            <div class="col-md-3 col-3 form">
              <fieldset class="form border-Field mb-0 pb-0">
                <legend class="textoBorda mb-0 pb-0">Tipo natureza</legend>
                <div class="form-row">
                  <div class="radio-group form-radio">
                    <label class="container">
                      <input type="radio" checked="checked" id="radioTipoNaturezaTodas" name="tipoNatureza">
                      <span class="checkmark"></span> Todas</label>
                  </div>
                  <div class="radio-group form-radio">
                    <label class="container">
                      <input type="radio" id="radioTipoNaturezaEntrada" name="tipoNatureza">
                      <span class="checkmark"></span>Entrada</label>
                  </div>
                  <div class="radio-group form-radio">
                    <label class="container">
                      <input type="radio" id="radioTipoNaturezaSaida" name="tipoNatureza">
                      <span class="checkmark"></span>Saída</label>
                  </div>
                </div>
              </fieldset>
            </div>
          </div>
          <div class="form_group">
            <div class="div">
              <button class="btn float-right  btn-primary btn-sisp" id="btnConsultarDocumentos" style="margin-bottom: 1%">Consultar</button>
            </div>
          </div>
          <div class="row">
            <label class="form-check-label" for="check_todos" id="check_todosTour" style="margin-left: 20px">
              <input class="form-check-input" type="checkbox" id="check_todos" value="">Marcar/Desmarcar Todos
            </label>
          </div>
          <div class="col-sm-12 table-responsive card-body">
            <table id="tabelaDocumentos" class="table table-responsive-sm table-select table-hover" width="100%">
              <thead>
              </thead>
              <tbody>
              </tbody>
            </table>
          </div>
          <div class="modal-footer">
            <div class="div">
              <button id="btnConfirmarDocumentos" class="btn float-right btn-danger btn-sisp" title="Selecione alguma solicitação para confirmar" style="margin-right: -14%">Confirmar</button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <?php
  include_once('../../../modais.php');
  ?>

  <!-- Control Sidebar -->
  <aside class="control-sidebar control-sidebar-dark">
    <!-- Control sidebar content goes here -->
  </aside>
  <!-- /.control-sidebar -->
  </div>
  <!-- ./wrapper -->
  <script>
    function formatar(mascara, documento) {
      var i = documento.value.length;
      var saida = mascara.substring(0, 1);
      var texto = mascara.substring(i);

      if (texto.substring(0, 1) != saida) {
        documento.value += texto.substring(0, 1);
      }

    }
  </script>

  <!-- jQuery -->
  <script src="../plugins/jquery/jquery.min.js?versao=3.265.7.1"></script>
  <!-- jQuery UI 1.11.4 -->
  <script src="../plugins/jquery-ui/jquery-ui.min.js?versao=3.265.7.1"></script>
  <script type="text/javascript" src="../dist/js/jquery.dataTables.js?versao=3.265.7.1"></script>
  <script type="text/javascript" src="../dist/js/dataTables.bootstrap4.min.js?versao=3.265.7.1"></script>
  <!-- SweetAlert2 -->
  <script src="../plugins/sweetalert2/sweetalert2.min.js?versao=3.265.7.1"></script>
  <script src="../plugins/toastr/toastr.min.js?versao=3.265.7.1"></script>

  <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
  <script>
    $.widget.bridge('uibutton', $.ui.button);
  </script>

  <script src="../plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.265.7.1"></script>
  <script src="../dist/js/adminlte.min.js?versao=3.265.7.1"></script>
  <script src="../dist/js/requisicoes.js?versao=3.265.7.1"></script>
  <script src="../dist/js/cliente/entidade.js?versao=3.265.7.1"></script>
  <script src="../dist/js/loadingoverlay.min.js?versao=3.265.7.1"></script>
  <script src="../plugins/jquery-validation/jquery.validate.min.js?versao=3.265.7.1"></script>
  <script src="../dist/js/valida_cpf_cnpj.js?versao=3.265.7.1"></script>
  <script src="../dist/js/dataTables.keyTable.js?versao=3.265.7.1"></script>
  <script src="../dist/js/sisplan.js?versao=3.265.7.1"></script>
  <script src="../utils/funcoes.js?versao=3.265.7.1"></script>
  <script src="../utils/cookies.js?versao=3.265.7.1"></script>
  <script src="../dist/js/driver.min.js?versao=3.265.7.1"></script>
  <script src="../dist/js/jquery.mask.min.js?versao=3.265.7.1"></script>
  <script src="../dist/js/jquery.maskMoney.min.js?versao=3.265.7.1"></script>
  <!-- <script src="../plugins/select2/js/select2.full.min.js?versao=3.265.7.1"></script> -->
  <script type="text/javascript" src="../config.js?versao=3.265.7.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('MDFE');
      if (!temAcesso.resultado) {
        toastrAcesso(temAcesso, BASE_URI);
        return;
      }

      const permissaoUsuarioLogado = await permissaoAcessos("MDFE");

      if (permissaoUsuarioLogado.INCLUI == 'N') {
        await criaMensagemErro("Sem permissão para incluir!", () => {
          window.location.href = `${BASE_URI}/index`
        });
        return;
      }

      sArquivo = `${BASE_URI}/pages/mdfe/criarmdfe/mdfe.js?versao=3.265.7.1`;
      insereJavaScriptPagina(sArquivo);
    });
  </script>
</body>

</html>