<?php include_once('../../../config.php') ?>

<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Sisplan Web | Integração Cartão</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="dist/css/adminlte.min.css?versao=3.258.7.1">
  <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css?versao=3.258.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.258.7.1" />
  <link href='dist/css/bootstrap.min.css?versao=3.258.7.1'>
  <link rel="stylesheet" href="dist/css/custom.css?versao=3.258.7.1">
  <link rel="stylesheet" href="dist/css/sisplan.css?versao=3.258.7.1">
  <link rel="stylesheet" type="text/css" href="plugins/datatables-keytable/css/keyTable.bootstrap4.min.css?versao=3.258.7.1">
  <link rel="stylesheet" type="text/css" href="dist/css/responsive.bootstrap.min.css?versao=3.258.7.1">
  <link rel="shortcut icon" href="favicon.ico">
  <link rel="stylesheet" href="dist/css/cadastro.css?versao=3.258.7.1">
  <link rel="stylesheet" href="dist/css/PesquisaVariosSelect2.css?versao=3.258.7.1">
  <link rel="stylesheet" href="plugins/select2/css/select2.min.css?versao=3.258.7.1">
  <link rel="stylesheet" href="plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css?versao=3.258.7.1">
  <!-- Toastr -->
  <link rel="stylesheet" href="plugins/toastr/toastr.min.css?versao=3.258.7.1">
  <link rel="stylesheet" type="text/css" href="dist/css/driver.min.css?versao=3.258.7.1" />
  <link rel="stylesheet" href="<?php echo BASE_URI; ?>/plugins/icheck-bootstrap/icheck-bootstrap.min.css?versao=3.258.7.1">
  <link rel="stylesheet" href="dist/css/jquery-ui.css?versao=3.258.7.1">
  <!-- Google Font: Source Sans Pro -->
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
  <style>
    #progressbar li {
      list-style-type: none;
      font-size: 12px;
      width: 50%;
      float: left;
      position: relative
    }

    .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 1.0em 0 1.0em !important;
      margin: 0 0 0 0 !important;
      -webkit-box-shadow: 0px 0px 0px 0px #000;
      box-shadow: 0px 0px 0px 0px #000;
    }

    .square {
      height: 25px;
      width: 25px;
    }

    .square-container {
      display: flex;
      align-items: center;
      white-space: nowrap;
    }

    .square-label {
      padding-left: 2%;
      padding-top: 4%;
    }

    #tabelaRetorno thead th {
      background-color: #343a40;
      color: white;
      position: sticky;
      top: 0;
      z-index: 99999 !important;
    }

    #tabelaRetorno tbody,
    #tabelaRetorno thead {
      white-space: nowrap !important;
      text-overflow: ellipsis !important;
      overflow: hidden !important;
      text-align: left;
    }

    #btnCheckSaldo {
      background-color: var(--buttonCheckMedidas);
      border: 0px;
      margin-left: 4px;
    }

    .totais {
      width: 13.9%;
      margin-right: 0.5%;
    }

    #msform .action-button-additional {
      background-color: #3CA2D3;
      font-weight: bold;
      color: white;
      border: 0 none;
      border-radius: 0px;
      cursor: pointer;
      padding: 10px 10px;
      margin: 10px 7px 10px 5px;
      float: right;
    }
  </style>
</head>

<body class="hold-transition sidebar-mini layout-fixed">
  <div class="wrapper">

    <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"></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"></p>
          </div>
          <div class="modal-footer">
            <button id="btnYes" type="button" class="btn btn-primary">Sim</button>
            <button id="btnNo" type="button" class="btn btn-secondary" data-dismiss="modal">Não</button>
          </div>
        </div>
      </div>
    </div>
    <div class="content-wrapper">
      <section class="content">
        <div class="content-header">
          <div class="container-fluid">
            <div class="row mb-2">
              <div class="col-sm-6 flex">
              </div>
              <div class="col-sm-6">
 
              </div><!-- /.col -->
            </div><!-- /.row -->
          </div>
          <div class="row justify-content-center mt-0">
            <div class="col-10 text-center p-0 mt-3 mb-2">
              <div class="card px-0 pt-4 pb-0 mt-3 mb-3">
                <div class="card-header text-center flex" style="border: none!important;box-shadow:none!important;">
                  <h2>Integração Cartão
                    <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">
                      <!-- progressbar -->
                      <ul id="progressbar">
                        <li class="active" id="account" style="font-size: 100%;"><strong>Geral</strong></li>
                        <li id="confirm" style="font-size: 100%;"><strong>Baixas</strong></li>
                      </ul> <!-- fieldsets -->
                      <fieldset class="abas" id="fieldset1">
                        <p>Preencha os dados e clique em avançar para realizar a consulta</p>
                        <div class="form-card" id="formcard1" style="height: 320px;">
                          <h2 class="fs-title">Dados Gerais</h2>
                          <div class="form-row col-lg-8 col-md-12 col-sm-12 mt-2">

                            <div class="form-group col-lg-3">
                              <div class="">
                                <label for="txtPagamentoIni">Pagamento de:</label>
                                <div class="relative">
                                  <input type="date" max="2500-12-31" value="1200-01-01" max="2500-12-31" class="input-default focus form-control validate" id="txtPagamentoIni" name="DataDe">
                                </div>
                              </div>
                            </div>
                            <div class="form-group col-lg-3">
                              <div class="">
                                <label for="dtEmifim">Até:</label>
                                <div class="relative">
                                  <input type="date" max="2500-12-31" value="2500-12-01" max="2500-12-31" class="input-default focus form-control validate" id="txtPagamentoFim" name="DataAte">
                                </div>
                              </div>
                            </div>

                            <div class="form-group col-lg-3">
                              <div class="">
                                <label for="txtEmissaoIni">Emissão de:</label>
                                <div class="relative">
                                  <input type="date" max="2500-12-31" value="1200-01-01" max="2500-12-31" class="input-default focus form-control validate" id="txtEmissaoIni" name="DataDe">
                                </div>
                              </div>
                            </div>
                            <div class="form-group col-lg-3">
                              <div class="">
                                <label for="txtEmissaoFim">Até:</label>
                                <div class="relative">
                                  <input type="date" max="2500-12-31" value="2500-12-01" max="2500-12-31" class="input-default focus form-control validate" id="txtEmissaoFim" name="DataAte">
                                </div>
                              </div>
                            </div>
                            <div class="form-group col-lg-6 col-md-12">
                              <label for="txtCliente">Cliente:</label>
                              <div class="input-group">
                                <select class="js-example-programmatic js-states form-control" id="txtCliente" name="txtCliente" multiple="multiple">
                                </select>
                                <div class="input-group-append">
                                  <button class="btn bg-danger create" id="btnCliente" name="btnCliente" type="button">
                                    <i class="m-0 p-0 fas fa-search"></i>
                                  </button>
                                  <button class="btn bg-danger create" id="btnLimpaCliente" type="button">
                                    <i class="m-0 p-0 fas fa-trash"></i>
                                  </button>
                                </div>
                              </div>
                            </div>
                            <div class="form-group col-lg-6 col-md-12">
                              <label for="txtMoeda">Moeda:</label>
                              <div class="input-group">
                                <select class="js-example-programmatic js-states form-control" id="txtMoeda" name="txtMoeda" multiple="multiple">
                                </select>
                                <div class="input-group-append">
                                  <button class="btn bg-danger create" id="btnMoeda" name="btnMoeda" type="button">
                                    <i class="m-0 p-0 fas fa-search"></i>
                                  </button>
                                  <button class="btn bg-danger create" id="btnLimpaMoeda" type="button">
                                    <i class="m-0 p-0 fas fa-trash"></i>
                                  </button>
                                </div>
                              </div>
                            </div>
                            <div class="form-group col-lg-6 col-md-12">
                              <label for="txtIntegracao">Integração:</label>
                              <div class="input-group">
                                <input type="text" class="input-default focus form-control validate" id="txtIntegracao" name="txtIntegracao" placeholder="Integração">
                                <div class="input-group-append">
                                  <button class="btn bg-danger create" id="btnIntegracao" name="btnIntegracao" type="button">
                                    <i class="m-0 p-0 fas fa-search"></i>
                                  </button>
                                  <button class="btn bg-danger create" id="btnLimpaIntegracao" type="button">
                                    <i class="m-0 p-0 fas fa-trash"></i>
                                  </button>
                                </div>
                              </div>
                            </div>
                            <div class="form-group col-lg-6 col-md-12 mt-4 pt-3 pl-3">
                              <label for="cbMostrar"><input type="checkbox" id="cbMostrar"> Mostrar registros processados</label>
                            </div>
                          </div>
                          <div class="form-group col-lg-4 col-md-12 col-sm-12">
                            <div class="col-12" id="tutInconsistencias">
                              <fieldset class="form border-Field mb-2 pb-0">
                                <legend class="textoBorda mb-0 pb-0">Inconsistências</legend>
                                <div id="tipoIncon" class="row">
                                  <div class="pl-2">
                                    <label for="rdTodos"><input type="radio" id="rdTodos" name="radioIncon" value="0" checked> Todos</label> <br>
                                    <label for="rdErroNSU"><input type="radio" id="rdErroNSU" name="radioIncon" value="1"> Erro NSU</label> <br>
                                    <label for="rdInfoDiv"><input type="radio" id="rdInfoDiv" name="radioIncon" value="2"> Informações divergentes</label> <br>
                                    <label for="rdDupliBai"><input type="radio" id="rdDupliBai" name="radioIncon" value="3"> Duplicata baixada</label> <br>
                                    <label for="rdErroVal"><input type="radio" id="rdErroVal" name="radioIncon" value="4"> Erro valores</label> <br>
                                  </div>
                                </div>
                              </fieldset>
                            </div>
                            <div class="col-12 col-md-12 px-2 mt-2">
                              <label for="txtInstrucao">Buscar Informações:</label>
                              <select class="drilldown-item form-control select2 select2-danger focus" style="border-color: #a9a9a9" data-dropdown-css-class="select2-danger" name="txtInstrucao" id="txtInstrucao">
                                <option value="" selected>Todos</option>
                                <option value="S">Com duplicata</option>
                                <option value="N">Sem duplicata</option>
                              </select>
                            </div>
                          </div>
                        </div>
                        <input type="button" name="verBaixas" id="verBaixas" class="btn-sisp next action-button" style="background-color: #3ca2d3" value="Ver Baixas" />
                        <!-- :<button type="button" name="voltar1" id="voltar1" style="font-size:15px;" class="btn-sisp action-button-previous" data-dismiss="modal">Voltar</button> -->
                      </fieldset>
                      <fieldset class="abas" id="fieldset2">
                        <div class="form-card" id="formcard2" style="height: 350px;">
                          <div class="form-group col-lg-6 col-md-12">
                            <label for="txtBanco">Banco:</label>
                            <div class="input-group">
                              <input type="text" class="input-default focus form-control validate" id="txtBanco" name="txtBanco" placeholder="Banco">
                              <div class="input-group-append">
                                <button class="btn bg-danger create" id="btnBanco" name="btnBanco" type="button">
                                  <i class="m-0 p-0 fas fa-search"></i>
                                </button>
                                <button class="btn bg-danger create" id="btnLimpaBanco" type="button">
                                  <i class="m-0 p-0 fas fa-trash"></i>
                                </button>
                              </div>
                            </div>
                          </div>
                          <div class="form-group col-lg-6 col-md-12">
                            <label for="txtConta">Conta:</label>
                            <div class="input-group">
                              <input type="text" class="input-default focus form-control validate" id="txtConta" name="txtConta" placeholder="Conta">
                              <div class="input-group-append">
                                <button class="btn bg-danger create" id="btnConta" name="btnConta" type="button">
                                  <i class="m-0 p-0 fas fa-search"></i>
                                </button>
                                <button class="btn bg-danger create" id="btnLimpaConta" type="button">
                                  <i class="m-0 p-0 fas fa-trash"></i>
                                </button>
                              </div>
                            </div>
                          </div>
                          <div class="form-group col-lg-6 col-md-12">
                            <label for="txtClasseBaixa">Classe Baixa:</label>
                            <div class="input-group">
                              <input type="text" class="input-default focus form-control validate" id="txtClasseBaixa" name="txtClasseBaixa" placeholder="Classe Baixa">
                              <div class="input-group-append">
                                <button class="btn bg-danger create" id="btnClasseBaixa" name="btnClasseBaixa" type="button">
                                  <i class="m-0 p-0 fas fa-search"></i>
                                </button>
                                <button class="btn bg-danger create" id="btnLimpaClasseBaixa" type="button">
                                  <i class="m-0 p-0 fas fa-trash"></i>
                                </button>
                              </div>
                            </div>
                          </div>
                          <div class="form-group col-lg-6 col-md-12">
                            <label for="txtClasseJuros">Classe Tarifa:</label>
                            <div class="input-group">
                              <input type="text" class="input-default focus form-control validate" id="txtClasseJuros" name="txtClasseJuros" placeholder="Classe Tarifa">
                              <div class="input-group-append">
                                <button class="btn bg-danger create" id="btnClasseJuros" name="btnClasseJuros" type="button">
                                  <i class="m-0 p-0 fas fa-search"></i>
                                </button>
                                <button class="btn bg-danger create" id="btnLimpaClasseJuros" type="button">
                                  <i class="m-0 p-0 fas fa-trash"></i>
                                </button>
                              </div>
                            </div>
                          </div>
                          <div class="form-group col-lg-6 col-md-12">
                            <label for="txtClasseDesconto">Classe Antecipação:</label>
                            <div class="input-group">
                              <input type="text" class="input-default focus form-control validate" id="txtClasseDesconto" name="txtClasseDesconto" placeholder="Classe Antecipação">
                              <div class="input-group-append">
                                <button class="btn bg-danger create" id="btnClasseDesconto" name="btnClasseDesconto" type="button">
                                  <i class="m-0 p-0 fas fa-search"></i>
                                </button>
                                <button class="btn bg-danger create" id="btnLimpaClasseDesconto" type="button">
                                  <i class="m-0 p-0 fas fa-trash"></i>
                                </button>
                              </div>
                            </div>
                          </div>
                          <div class="form-group col-lg-6 col-md-12">
                            <label for="txtHistorico">Histórico:</label>
                            <div class="input-group">
                              <input type="text" class="input-default focus form-control validate" id="txtHistorico" name="txtHistorico" placeholder="Histórico">
                              <div class="input-group-append">
                                <button class="btn bg-danger create" id="btnHistorico" name="btnHistorico" type="button">
                                  <i class="m-0 p-0 fas fa-search"></i>
                                </button>
                                <button class="btn bg-danger create" id="btnLimpaHistorico" type="button">
                                  <i class="m-0 p-0 fas fa-trash"></i>
                                </button>
                              </div>
                            </div>
                          </div>
                          <div class="form-group col-lg-2 col-md-12">
                            <label for="txtPagamento">Pagamento:</label>
                            <div class="relative">
                              <input type="date" min="1200-01-01" max="2500-12-31" class="input-default focus form-control validate" id="txtPagamento" name="txtPagamento">
                            </div>
                          </div>
                          <div class="form-group col-lg-4 col-md-12 mt-4 pt-3 pl-3">
                            <label for="cbGerarCC"><input type="checkbox" id="cbGerarCC"> Não gerar conta contábil e CC</label>
                          </div>
                        </div>
                        <div class="form-card mx-4" style="width: 96%!important">
                          <fieldset class="form border-Field">
                            <legend class="textoBorda mb-0 pb-0">Legenda</legend>
                            <!-- <h2 class="fs-title">Resultados</h2> -->
                            <div class="form-row col-lg-12 col-md-12 col-sm-12 d-flex justify-content-around mb-2">
                              <div class="square-container">
                                <div id="quadDuplSemNSU" class="square" style="background-color: #F46262"></div>
                                <label for="quadDuplSemNSU" class="square-label">Não encontrou duplicata com o NSU</label>
                              </div>
                              <div class="square-container">
                                <div id="quadDuplInfoDiv" class="square" style="background-color: #3C67B0"></div>
                                <label for="quadDuplInfoDiv" class="square-label">Informações divergentes</label>
                              </div>
                              <div class="square-container">
                                <div id="quadDuplBaixada" class="square" style="background-color: #90ee90"></div>
                                <label for="quadDuplBaixada" class="square-label">Duplicata baixada</label>
                              </div>
                              <div class="square-container pl-4">
                                <div id="quadDuplErroVal" class="square" style="background-color: #c673fe"></div>
                                <label for="quadDuplErroVal" class="square-label">Erro valores taxa</label>
                              </div>
                            </div>
                          </fieldset>
                        </div>
                        <div class="col-sm-12 table-responsive card-body" id="tabelaRetornoContainer" style="max-height: 527px; overflow-y: auto; padding-top: 0px">
                          <table id="tabelaRetorno" class="table table-sm table-select table-hover" width="100%">
                            <thead>
                              <tr>
                              </tr>
                            </thead>
                            <tbody>
                            </tbody>
                          </table>
                        </div>
                        <div class="col-sm-12 d-flex justify-content-between mt-2">
                          <div class="form-row col-12">
                            <div class="form-group totais" style="margin-left: 0.6%">
                              <label for="txtRegEnc">Encontrados:</label>
                              <input type="text" class="input-default focus form-control validate" id="txtRegEnc" name="txtRegEnc" placeholder="0" disabled>
                            </div>
                            <div class="form-group totais">
                              <label for="txtRegNao" style="color: red">Não encontrados:</label>
                              <input type="text" class="input-default focus form-control validate" id="txtRegNao" name="txtRegNao" placeholder="0" disabled style="color: red!important">
                            </div>
                            <div class="form-group totais">
                              <label for="txtRegTot">Total Geral:</label>
                              <input type="text" class="input-default focus form-control validate" id="txtRegTot" name="txtRegTot" placeholder="0" disabled>
                            </div>
                            <div class="form-group totais">
                              <label for="txtRegSel">Total Selecionados:</label>
                              <input type="text" class="input-default focus form-control validate" id="txtRegSel" name="txtRegSel" placeholder="0" disabled>
                            </div>
                            <div class="form-group totais">
                              <label for="txtRegBru">Total Bruto:</label>
                              <input type="text" class="input-default focus form-control validate" id="txtRegBru" name="txtRegBru" placeholder="0" disabled>
                            </div>
                            <div class="form-group totais">
                              <label for="txtRegDes">Total Descontos:</label>
                              <input type="text" class="input-default focus form-control validate" id="txtRegDes" name="txtRegDes" placeholder="0" disabled>
                            </div>
                            <div class="form-group" style="width: 13%">
                              <label for="txtRegLiq">Total Líquido:</label>
                              <input type="text" class="input-default focus form-control validate" id="txtRegLiq" name="txtRegLiq" placeholder="0" disabled>
                            </div>
                          </div>
                        </div>
                        <input type="button" name="gravar" class="action-button" value="Confirmar" id="btnConfirmar">
                        <input type="button" name="voltar2" class="previous action-button-previous" value="Voltar" id="voltar2" />
                        <input type="button" name="limparDados" class="action-button-additional" value="Limpar Dados" id="limparDados">
                      </fieldset>
                    </form>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </section>
    </div>
  </div>


  <div id="modalSelDupli" 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">Seleção de Duplicatas
          </h4>
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body pb-0">
          <div class="form-row">
            <div class="col-sm-12 table-responsive card-body">
              <table id="tabelaSelDupli" class="table table-sm table-select table-hover" width="100%">
                <thead>
                  <tr>
                    <th class="th-sm">Número</th>
                    <th class="th-sm">Codcli</th>
                    <th class="th-sm">Nome</th>
                    <th class="th-sm">Nr. Banco</th>
                    <th class="th-sm">Valor Pago</th>
                    <th class="th-sm">Saldo</th>
                    <th class="th-sm">Juros</th>
                    <th class="th-sm">Saldo (sem juros)</th>
                    <th class="th-sm">Data Vencimento</th>
                    <th class="th-sm">Fatura</th>
                    <th class="th-sm">Empresa</th>
                  </tr>
                </thead>
                <tbody>
                </tbody>
              </table>
            </div>
          </div>
          <div class="modal-footer ml-0 pl-0">
            <div class="col-12 d-flex justify-content-between ml-0 pl-0">
              <div class="col-2 d-flex jusitify-content-left ml-0 pl-0">
                <button class="btn btn-primary btn-sisp" id="btnConfirmarSelDupli"> Confirmar</button>
              </div>
              <div class="col-2 d-flex justify-content-left">
                <input type="text" class="input-default focus form-control validate" id="txtSaldoSelDupli" name="txtSaldoSelDupli" placeholder="Saldo">
                <button id="btnCheckSaldo">
                  <i class="fas fa-check ml-1" style="color: red; font-size: 1.2em"></i>
                </button>
              </div>
              <div class="col-8 d-flex justify-content-end">
              </div>
            </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>

  <!-- jQuery -->
  <script src="plugins/jquery/jquery.min.js?versao=3.258.7.1"></script>
  <script src="plugins/jquery-ui/jquery-ui.min.js?versao=3.258.7.1"></script>
  <script type="text/javascript" src="dist/js/jquery.dataTables.js?versao=3.258.7.1"></script>
  <script type="text/javascript" src="dist/js/dataTables.bootstrap4.min.js?versao=3.258.7.1"></script>
  <!-- SweetAlert2 -->
  <script src="plugins/sweetalert2/sweetalert2.min.js?versao=3.258.7.1"></script>
  <script src="plugins/toastr/toastr.min.js?versao=3.258.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.258.7.1"></script>
  <script src="dist/js/adminlte.min.js?versao=3.258.7.1"></script>
  <script src="dist/js/requisicoes.js?versao=3.258.7.1"></script>
  <script src="dist/js/cliente/entidade.js?versao=3.258.7.1"></script>
  <script src="dist/js/loadingoverlay.min.js?versao=3.258.7.1"></script>
  <script src="dist/js/valida_cpf_cnpj.js?versao=3.258.7.1"></script>
  <script src="plugins/jquery-validation/jquery.validate.min.js?versao=3.258.7.1"></script>
  <script src="utils/cookies.js?versao=3.258.7.1"></script>
  <script src="dist/js/driver.min.js?versao=3.258.7.1"></script>
  <script src="dist/js/jquery.maskMoney.min.js?versao=3.258.7.1"></script>
  <script src="dist/js/jquery.mask.min.js?versao=3.258.7.1"></script>
  <script src="dist/js/dataTables.keyTable2.js?versao=3.258.7.1"></script>
  <script type="text/javascript" src="config.js?versao=3.258.7.1"></script>
  <script type="text/javascript" src="plugins/select2/js/select2.full.min.js?versao=3.258.7.1"></script>
  <script src="utils/funcoes.js?versao=3.258.7.1"></script>
  <script src="dist/js/sisplan.js?versao=3.258.7.1"></script>
  <script>
    $(document).ready(async function() {
      if (getCookie('usuario') == "") {
        window.location.href = `${BASE_URI}/login`;
        return;
      }

      $('#txtContabilizacao').val(formataData(new Date()));

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

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

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

      const permissaoUsuarioLogado = await permissaoAcessos("INTEGRACAO_CARTAO");

      if (permissaoUsuarioLogado.INCLUI == 'N') {
        await criaMensagemErro("Sem permissão!", () => {
          parent.document.querySelector('#listaAbas > .active > a').click()
        });
        return;
      }

      $(window).on("beforeunload", function(e) {
        // e.preventDefault();
        e.stopPropagation();
        return undefined;
      });

      sArquivo = `${BASE_URI}/pages/escretorno/integracao_cartao/integracao_cartao.js?versao=3.258.7.1`;
      insereJavaScriptPagina(sArquivo);

      const nomeTela = ('<?php echo basename(__FILE__) ?>').replace('.php', '');
      habilitaCamposObrigatoriosTela(nomeTela);
    });
  </script>
</body>

</html>