<?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 | Formação de Custos de Produto</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css?versao=3.258.28.1">
  <link rel="stylesheet" href="dist/css/adminlte.min.css?versao=3.258.28.1">
  <link href='https://fonts.googleapis.com/css?family=Roboto:400,300,500,600,700,400italic' rel='stylesheet' type='text/css'>
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">

  <link rel="stylesheet" href="dist/css/PesquisaVariosSelect2.css?versao=3.258.28.1">
  <link rel="stylesheet" href="plugins/select2/css/select2.min.css?versao=3.258.28.1">
  <link rel="stylesheet" href="plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css?versao=3.258.28.1">
  <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css?versao=3.258.28.1">
  <link rel="stylesheet" href="dist/css/adminlte.min.css?versao=3.258.28.1">
  <link href='https://fonts.googleapis.com/css?family=Roboto:400,300,500,600,700,400italic' rel='stylesheet' type='text/css'>
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">

  <link rel="stylesheet" href="dist/css/custom.css?versao=3.258.28.1">
  <link rel="stylesheet" href="dist/css/sisplan.css?versao=3.258.28.1">
  <link rel="stylesheet" type="text/css" href="dist/css/dataTables.bootstrap4.min.css?versao=3.258.28.1" />
  <link rel="shortcut icon" href="favicon.ico">
  <link rel="stylesheet" href="plugins/toastr/toastr.min.css?versao=3.258.28.1">
  <link rel="stylesheet" type="text/css" href="dist/css/driver.min.css?versao=3.258.28.1" />
  <link rel="stylesheet" href="plugins/datatables-colreorder/css/colReorder.bootstrap4.min.css?versao=3.258.28.1">
  <link rel="stylesheet" type="text/css" href="dist/css/sisplan.newColorsButtons.css?versao=3.258.28.1" />
  <link rel="stylesheet" href="https://cdn.datatables.net/select/1.6.0/css/select.dataTables.min.css">
  <style>
    .campoFinalizacao {
      max-width: 12.0625% !important;
      width: 12.0625% !important;
    }
  </style>
</head>

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

    <div class="content-wrapper">
      <div class="content-header">
        <div class="container-fluid">
          <div class="row mb-2">
            <div class="col-sm-6 flex">
              <h1 class="m-0 text-dark">Formação de Custos de Produto</h1>
              <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>
            </div>
            <div class="col-sm-6">

            </div>
          </div>
        </div>
        <div class="container-fluid">
          <div class="row card">
            <div class="col-sm-12 mt-3">
              <button class="btn btn-success btn-sisp" id="btnFiltros"><span class="fas fa-search"></span> Filtros</button>
              <button class="btn btn-danger btn-sisp" id="btnIncluir"><span class="fas fa-plus"></span> Incluir</button>
            </div>
            <div class="col-sm-12 table-responsive card-body">
              <h5>Lista de Produtos</h5>
              <table id="tabelaItens" class="table table-sm table-select table-hover" width="100%">
                <thead>
                </thead>
                <tbody>
                </tbody>
              </table>
            </div>
          </div>
        </div>
      </div>
      <div id="modal-filtros" class="modal" tabindex="-1" role="dialog">
        <div class="modal-dialog modal-md" role="document">
          <div class="modal-content" id="modalBody">
            <div class="modal-header">
              <h4 class="modal-title">Filtros</h4>
              <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
            <div class="modal-body">
              <div class="form-row col-12">
                <div class="form-group col-12">
                  <label data-error="wrong" class="labelGeral" data-success="right" for="txtProduto">Produto:</label>
                  <div class="input-group">
                    <select class="js-example-programmatic js-states form-control" id="txtProduto" name="txtProduto" multiple="multiple">
                    </select>
                    <div class="input-group-append">
                      <button class="btn bg-danger" id="btnProduto" name="btnProduto" data-button="absolute" type="button">
                        <i class="m-0 p-0 fas fa-search"></i>
                      </button>
                      <button class="btn bg-danger" id="btnLimpaProduto" name="btnLimpaProduto" type="button">
                        <i class="m-0 p-0 fas fa-trash"></i>
                      </button>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div class="modal-footer">
              <div class="row">
                <button class="btn btn-primary btn-sisp" id="btnLimparFiltros" style="background-color: #B22222; border-color: #B22222"><span class="fas fa-trash"></span> Limpar Filtros</button>     
                <button class="btn btn-primary btn-sisp" id="btnConsultar"><span class="fas fa-search"></span> Consultar</button>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>

  <div class="modal fade" id="modalFinalizacao" tabindex="-1" data-backdrop="static" role="dialog" aria-labelledby="modalFinalizacao" aria-hidden="true">
    <div class="modal-dialog" style="min-width: 95%; min-height: 100%">
      <div class="modal-content">
        <div class="modal-header">
          <h4 class="modal-title" id="tituloModalFinalizacao"></h4>
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body">
          <div class="flex flex-wrap align-items-end mb-2 col-12" style="gap: 0.5%">
            <input type="text" class="input-default focus form-control text-right d-none" disabled id="txtPrecoRealFinalizacao" name="txtPrecoRealFinalizacao" placeholder="0">
            <input type="text" class="input-default focus form-control text-right d-none" disabled id="txtPrecoDolarFinalizacao" name="txtPrecoDolarFinalizacao" placeholder="0">
            <input type="text" class="input-default focus form-control text-right d-none" disabled id="txtPrecoEuroFinalizacao" name="txtPrecoEuroFinalizacao" placeholder="0">
            <input type="text" class="input-default focus form-control text-right d-none" disabled id="txtIdPrecoFinalizacao" name="txtIdPrecoFinalizacao" placeholder="0">
            <input type="text" class="input-default focus form-control text-right d-none" disabled id="txtCodigoProdutoFinalizacao" name="txtCodigoProdutoFinalizacao" placeholder="0">
            <input type="text" class="input-default focus form-control text-right d-none" disabled id="txtDescricaoProdutoFinalizacao" name="txtDescricaoProdutoFinalizacao" placeholder="0">
            <div class="form-group" style="width: 24.625%; max-width: 24.625%">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtTabelaPrecoFinalizacao">Tabela de preço:</label>
              <div class="input-group">
                <input type="text" class="input-default focus form-control stepControl" id="txtTabelaPrecoFinalizacao" name="txtTabelaPrecoFinalizacao" placeholder="Tabela de preço">
                <div class="input-group-append">
                  <button class="btn bg-danger" id="btnTabelaPrecoFinalizacao" name="btnTabelaPrecoFinalizacao" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                  <button class="btn bg-danger" id="btnLimpaTabelaPrecoFinalizacao" name="btnLimpaTabelaPrecoFinalizacao" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                </div>
              </div>
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPedidoFinalizacao">Pedido:</label>
              <div class="input-group">
                <input type="text" class="input-default focus form-control stepControl" id="txtPedidoFinalizacao" name="txtPedidoFinalizacao" placeholder="Pedido">
                <div class="input-group-append">
                  <button class="btn bg-danger" id="btnPedidoFinalizacao" name="btnPedidoFinalizacao" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                  <button class="btn bg-danger" id="btnLimpaPedidoFinalizacao" name="btnLimpaPedidoFinalizacao" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                </div>
              </div>
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" data-success="right" for="selectRecalculoFinalizacao">Recálculo:</label>
              <select class="input-default focus form-control col-12" id="selectRecalculoFinalizacao">
                <option value="indice">Índice</option>
                <option value="percentual">Percentual</option>
                <option value="indiceMarkup">Índice Markup</option>
              </select>
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPercentualRecalcularFinalizacao">Percentual:</label>
              <input type="text" class="input-default focus form-control text-right duasCasasDecimaisCurrencyFormat" id="txtPercentualRecalcularFinalizacao" name="txtPercentualRecalcularFinalizacao" placeholder="0">
            </div>
            <div class="form-group campoFinalizacao">
              <button class="btn btn-primary btn-sisp" id="btnRecalcularFinalizacao"> Recalcular</button>
            </div>
            <div class="form-group campoFinalizacao">
              <div class="flex flex-column">
                <div class="form-check icheck-primary">
                  <input type="checkbox" class="form-check-input" id="cbGravarPrecosTabelaPrecoFinalizacao">
                  <label class="form-check-label pr-4" for="cbGravarPrecosTabelaPrecoFinalizacao">Gravar Preço Tabela</label>
                </div>
              </div>
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" data-success="right" for="selectTipoPrecoFinalizacao">Preço:</label>
              <select class="input-default focus form-control col-12" id="selectTipoPrecoFinalizacao">
                <option value="real">Real</option>
                <option value="dolar">Dólar</option>
                <option value="euro">Euro</option>
              </select>
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPrazoAVistaFinalizacao">À Vista:</label>
              <input type="text" class="input-default focus form-control text-right" disabled id="txtPrazoAVistaFinalizacao" value="À vista" name="txtPrazoAVistaFinalizacao" placeholder="0">
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPrazo07Finalizacao">Prazo 07:</label>
              <input type="text" class="input-default focus form-control text-right" disabled id="txtPrazo07Finalizacao" name="txtPrazo07Finalizacao" placeholder="0">
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPrazo14Finalizacao">Prazo 14:</label>
              <input type="text" class="input-default focus form-control text-right" disabled id="txtPrazo14Finalizacao" name="txtPrazo14Finalizacao" placeholder="0">
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPrazo21Finalizacao">Prazo 21:</label>
              <input type="text" class="input-default focus form-control text-right" disabled id="txtPrazo21Finalizacao" name="txtPrazo21Finalizacao" placeholder="0">
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPrazo28Finalizacao">Prazo 28:</label>
              <input type="text" class="input-default focus form-control text-right" disabled id="txtPrazo28Finalizacao" name="txtPrazo28Finalizacao" placeholder="0">
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPrazo35Finalizacao">Prazo 35:</label>
              <input type="text" class="input-default focus form-control text-right" disabled id="txtPrazo35Finalizacao" name="txtPrazo35Finalizacao" placeholder="0">
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPrazo42Finalizacao">Prazo 42:</label>
              <input type="text" class="input-default focus form-control text-right" disabled id="txtPrazo42Finalizacao" name="txtPrazo42Finalizacao" placeholder="0">
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPrazo49Finalizacao">Prazo 49:</label>
              <input type="text" class="input-default focus form-control text-right" disabled id="txtPrazo49Finalizacao" name="txtPrazo49Finalizacao" placeholder="0">
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPrecoAVistaFinalizacao">Preço à vista:</label>
              <input type="text" class="input-default focus form-control text-right duasCasasDecimaisCurrencyFormat" id="txtPrecoAVistaFinalizacao" name="txtPrecoAVistaFinalizacao" placeholder="0,00">
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPreco1Finalizacao">Preço 1:</label>
              <input type="text" class="input-default focus form-control text-right duasCasasDecimaisCurrencyFormat" id="txtPreco1Finalizacao" name="txtPreco1Finalizacao" placeholder="0,00">
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPreco2Finalizacao">Preço 2:</label>
              <input type="text" class="input-default focus form-control text-right duasCasasDecimaisCurrencyFormat" id="txtPreco2Finalizacao" name="txtPreco2Finalizacao" placeholder="0,00">
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPreco3Finalizacao">Preço 3:</label>
              <input type="text" class="input-default focus form-control text-right duasCasasDecimaisCurrencyFormat" id="txtPreco3Finalizacao" name="txtPreco3Finalizacao" placeholder="0,00">
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPreco4Finalizacao">Preço 4:</label>
              <input type="text" class="input-default focus form-control text-right duasCasasDecimaisCurrencyFormat" id="txtPreco4Finalizacao" name="txtPreco4Finalizacao" placeholder="0,00">
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPreco5Finalizacao">Preço 5:</label>
              <input type="text" class="input-default focus form-control text-right duasCasasDecimaisCurrencyFormat" id="txtPreco5Finalizacao" name="txtPreco5Finalizacao" placeholder="0,00">
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPreco6Finalizacao">Preço 6:</label>
              <input type="text" class="input-default focus form-control text-right duasCasasDecimaisCurrencyFormat" id="txtPreco6Finalizacao" name="txtPreco6Finalizacao" placeholder="0,00">
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPreco7Finalizacao">Preço 7:</label>
              <input type="text" class="input-default focus form-control text-right duasCasasDecimaisCurrencyFormat" id="txtPreco7Finalizacao" name="txtPreco7Finalizacao" placeholder="0,00">
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPrecoOriginalAVistaFinalizacao">Preço original à vista:</label>
              <input type="text" class="input-default focus form-control text-right" disabled id="txtPrecoOriginalAVistaFinalizacao" name="txtPrecoOriginalAVistaFinalizacao" placeholder="0,00">
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPrecoOriginal1Finalizacao">Preço original 1:</label>
              <input type="text" class="input-default focus form-control text-right" disabled id="txtPrecoOriginal1Finalizacao" name="txtPrecoOriginal1Finalizacao" placeholder="0,00">
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPrecoOriginal2Finalizacao">Preço original 2:</label>
              <input type="text" class="input-default focus form-control text-right" disabled id="txtPrecoOriginal2Finalizacao" name="txtPrecoOriginal2Finalizacao" placeholder="0,00">
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPrecoOriginal3Finalizacao">Preço original 3:</label>
              <input type="text" class="input-default focus form-control text-right" disabled id="txtPrecoOriginal3Finalizacao" name="txtPrecoOriginal3Finalizacao" placeholder="0,00">
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPrecoOriginal4Finalizacao">Preço original 4:</label>
              <input type="text" class="input-default focus form-control text-right" disabled id="txtPrecoOriginal4Finalizacao" name="txtPrecoOriginal4Finalizacao" placeholder="0,00">
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPrecoOriginal5Finalizacao">Preço original 5:</label>
              <input type="text" class="input-default focus form-control text-right" disabled id="txtPrecoOriginal5Finalizacao" name="txtPrecoOriginal5Finalizacao" placeholder="0,00">
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPrecoOriginal6Finalizacao">Preço original 6:</label>
              <input type="text" class="input-default focus form-control text-right" disabled id="txtPrecoOriginal6Finalizacao" name="txtPrecoOriginal6Finalizacao" placeholder="0,00">
            </div>
            <div class="form-group campoFinalizacao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPrecoOriginal7Finalizacao">Preço original 7:</label>
              <input type="text" class="input-default focus form-control text-right" disabled id="txtPrecoOriginal7Finalizacao" name="txtPrecoOriginal7Finalizacao" placeholder="0,00">
            </div>
          </div>
          <div class="flex flex-wrap w-100">
            <div class="col-sm-12 table-responsive">
              <table id="tabelaItensPreco" class="table table-sm table-select table-hover" width="100%">
                <thead>
                </thead>
                <tbody>
                </tbody>
              </table>
            </div>
          </div>
        </div>
        <div class="modal-footer">
          <div class="col-12 flex align-items-end" style="gap: 8px">
            <button class="btn btnVerde btn-sisp ml-2" id="btnGravarFinalizacao" style="max-height: 40px"> Gravar</button>
            <div style="min-width: 8%">
              <label data-error="wrong" data-success="right" for="selectStatusFinalizacao">Status:</label>
              <select class="input-default focus form-control col-12" id="selectStatusFinalizacao">
                <option value="0">Aberto</option>
                <option value="1">Fechado</option>
              </select>
            </div>
            <button class="btn btn-danger btn-sisp ml-auto" data-dismiss="modal" id="btnFecharFinalizacao" style="max-height: 40px"> Fechar</button>
          </div>
        </div>
      </div>
    </div>
  </div>

  <div class="modal fade" id="modalMargem" tabindex="-1" data-backdrop="static" role="dialog" aria-labelledby="modalMargem" aria-hidden="true">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">
        <div class="modal-header">
          <h4 class="modal-title" id="tituloModalMargem"></h4>
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body p-1 flex flex-wrap align-items-end mb-2 w-100">
          <input type="text" class="input-default focus form-control text-right d-none" disabled id="txtIdPrecoMargem" name="txtIdPrecoMargem" placeholder="0">
          <input type="text" class="input-default focus form-control text-right d-none" disabled id="txtPrazoPadraoMargem" name="txtPrazoPadraoMargem" placeholder="0">
          <div class="form-group col-4">
            <label data-error="wrong" class="labelGeral" data-success="right" for="txtPercentualLucroAnteriorMargem">Percentual lucro anterior:</label>
            <input type="text" class="input-default focus form-control text-right" disabled id="txtPercentualLucroAnteriorMargem" name="txtPercentualLucroAnteriorMargem" placeholder="0,0000">
          </div>
          <div class="form-group col-4">
            <label data-error="wrong" class="labelGeral" data-success="right" for="txtPercentualLucroMargem">Percentual lucro:</label>
            <input type="text" class="input-default focus form-control text-right quatroCasasDecimaisCurrencyFormat" id="txtPercentualLucroMargem" name="txtPercentualLucroMargem" placeholder="0,0000">
          </div>
          <div class="form-group col-4">
            <label data-error="wrong" class="labelGeral custoIndustrialFixoMargem d-none" data-success="right" for="txtCustoIndustrialFixoMargem">Custo Industrial Fixo:</label>
            <input type="text" class="input-default focus form-control text-right quatroCasasDecimaisCurrencyFormat custoIndustrialFixoMargem d-none" id="txtCustoIndustrialFixoMargem" name="txtCustoIndustrialFixoMargem" placeholder="0,0000">
          </div>
          <div class="form-group col-4">
            <label data-error="wrong" class="labelGeral" data-success="right" for="txtPrecoVendaMargem">Preço de venda:</label>
            <input type="text" class="input-default focus form-control text-right quatroCasasDecimaisCurrencyFormat" id="txtPrecoVendaMargem" name="txtPrecoVendaMargem" placeholder="0,0000">
          </div>
          <div class="form-group col-4">
            <label data-error="wrong" class="labelGeral" data-success="right" for="txtPrazoMargem">Prazo:</label>
            <input type="text" class="input-default focus form-control text-right somenteInteirosFormat" id="txtPrazoMargem" name="txtPrazoMargem" placeholder="Prazo">
          </div>
          <div class="form-group col-4">
            <label data-error="wrong" class="labelGeral" data-success="right" for="txtPrecoAVistaMargem">À Vista:</label>
            <input type="text" class="input-default focus form-control text-right quatroCasasDecimaisCurrencyFormat" id="txtPrecoAVistaMargem" name="txtPrecoAVistaMargem" placeholder="0,0000">
          </div>
          <div class="form-group col-4">
            <label data-error="wrong" class="labelGeral" data-success="right" for="txtNovaMargemMargem">Nova Margem:</label>
            <input type="text" class="input-default focus form-control text-right" disabled id="txtNovaMargemMargem" name="txtNovaMargemMargem" placeholder="0,0000">
          </div>
        </div>
        <div class="modal-footer pl-1 pr-0">
          <div class="col-12 flex">
            <button class="btn btnVerde btn-sisp ml-1" id="btnGravarMargem" style="max-height: 40px"> Gravar</button>
            <button class="btn btn-danger btn-sisp ml-auto" data-dismiss="modal" id="btnFecharMargem" style="max-height: 40px"> Fechar</button>
          </div>
        </div>
      </div>
    </div>
  </div>
  <?php
  include_once('../../../modais.php');
  ?>
  <aside class="control-sidebar control-sidebar-dark">
  </aside>
  </div>
  <script src="plugins/jquery/jquery.min.js?versao=3.258.28.1"></script>
  <script type="text/javascript" src="dist/js/jquery.dataTables.js?versao=3.258.28.1"></script>
  <script type="text/javascript" src="dist/js/dataTables.bootstrap4.min.js?versao=3.258.28.1"></script>
  <script src="plugins/jquery-ui/jquery-ui.min.js?versao=3.258.28.1"></script>
  <script>
    $.widget.bridge('uibutton', $.ui.button);
  </script>
  <script src="plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.258.28.1"></script>
  <script src="dist/js/adminlte.min.js?versao=3.258.28.1"></script>
  <script src="dist/js/sisplan.js?versao=3.258.28.1"></script>
  <script src="utils/funcoes.js?versao=3.258.28.1"></script>
  <script src="utils/cookies.js?versao=3.258.28.1"></script>
  <script src="dist/js/requisicoes.js?versao=3.258.28.1"></script>
  <script src="dist/js/loadingoverlay.min.js?versao=3.258.28.1"></script>
  <script src="dist/js/driver.min.js?versao=3.258.28.1"></script>
  <script src="plugins/toastr/toastr.min.js?versao=3.258.28.1"></script>
  <script src="plugins/moment/moment.min.js?versao=3.258.28.1"></script>
  <script type="text/javascript" src="dist/js/sum().js?versao=3.258.28.1"></script>
  <script type="text/javascript" src="config.js?versao=3.258.28.1"></script>
  <script src="plugins/select2/js/select2.full.min.js?versao=3.258.28.1"></script>
  <script src="plugins/datatables-colreorder/js/dataTables.colReorder.min.js?versao=3.258.28.1"></script>
  <script src="https://cdn.datatables.net/select/1.6.0/js/dataTables.select.min.js"></script>
  <script src="dist/js/jquery.maskMoney.min.js?versao=3.258.28.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('FLUXO');
      if (!temAcesso.resultado) {
        toastrAcesso(temAcesso, BASE_URI);
        return;
      }

      sArquivo = `${BASE_URI}/pages/formacao_custos/acesso_formacao_custos/acesso_formacao_custos.js?versao=3.258.28.1`;
      insereJavaScriptPagina(sArquivo);

    });
  </script>
</body>

</html>