<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Sisplan Web | Relatório de Terceiros</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css?versao=3.245.9.1">

    <link rel="stylesheet" href="dist/css/adminlte.min.css?versao=3.245.9.1">
    <link rel="stylesheet" href="dist/css/custom.css?versao=3.245.9.1">
    <link rel="stylesheet" href="dist/css/sisplan.css?versao=3.245.9.1">
    <link rel="stylesheet" href="dist/css/PesquisaVariosSelect2.css?versao=3.245.9.1">
    <link rel="stylesheet" type="text/css" href="plugins/datatables-keytable/css/keyTable.bootstrap4.min.css?versao=3.245.9.1">
    <link rel="stylesheet" href="plugins/toastr/toastr.min.css?versao=3.245.9.1">
    <link rel="stylesheet" href="plugins/icheck-bootstrap/icheck-bootstrap.min.css?versao=3.245.9.1">
    <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css?versao=3.245.9.1">
    <link rel="shortcut icon" href="favicon.ico">
    <link rel="stylesheet" type="text/css" href="dist/css/driver.min.css?versao=3.245.9.1" />
    <link rel="stylesheet" href="dist/css/jquery-ui.css?versao=3.245.9.1">
    <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
    <link rel="stylesheet" href="plugins/select2/css/select2.min.css?versao=3.245.9.1">
    <link rel="stylesheet" href="plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css?versao=3.245.9.1">
    <link rel="stylesheet" href="plugins/datatables-colreorder/css/colReorder.bootstrap4.min.css?versao=3.245.9.1">

    <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">

    <style>
        #nav-tab a:hover,
        #nav-tab a {
            color: var(--font-color);
        }

        .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 .5em 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;
        }

        .col-md-1,
        .col-md-10,
        .col-md-11,
        .col-md-12,
        .col-md-2,
        .col-md-3,
        .col-md-4,
        .col-md-5,
        .col-md-6,
        .col-md-7,
        .col-md-8,
        .col-md-9 {
            padding-right: 7.5px;
            padding-left: 7.5px;
        }

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

        #tabelaFaccaoRelFaccao_wrapper .table.dataTable tbody td {
            white-space: nowrap;
            overflow: hidden;
        }

        #tabelaConsumosRelFaccao_wrapper .table.dataTable tbody td {
            white-space: nowrap;
            overflow: hidden;
        }

    </style>


</head>

<body class="hold-transition sidebar-mini layout-fixed">
    <div class="wrapper" id="semPermissao">
    </div>
    <div class="content-wrapper">
        <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">
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.container-fluid -->
        </div>
        <section class="content">
            <div class="card-header text-center flex" style="padding-top: 0px;">
                <h2 class="m-0">Relatório de Terceiros</h2>
                <button title="Tutorial" class="btn btn-info btn-sm ml-2" id="tutorial">
                    <i class="fas fa-question-circle"></i>
                </button>
            </div>
            <div class="container-fluid card">
                <div class="form-row borda" id="lotes">
                    <div class="col-12">
                        <div class="form-row">
                            <div class="col-lg-3 col-sm-6 col-12">
                                <label style="margin-bottom: .1rem;" data-error="wrong" data-success="right" id="labelNumeroRelFaccao" for="txtNumeroRelFaccao">Número*: </label>
                                <div class="relative" style="margin-top: 5px;">
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control" id="txtOrdemProducaoRelFaccao" class="form-control" placeholder="Número">
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnOrdemProducaoRelFaccao" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnLimpaOrdemProducaoRelFaccao" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-3 col-sm-6 col-12 form-group">
                                <div class="">
                                    <label for="labelDataSaidaRelFaccao">Data Saída*:</label>
                                    <div class="relative">
                                        <input type="date" max="2500-12-31" value="1200-01-01" class="input-default focus form-control validate" id="txtDataSaidaRelFaccao">
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-3 col-sm-6 col-12">
                                <label style="margin-bottom: .1rem;" data-error="wrong" data-success="right" id="labelMovimentoRelFaccao" for="txtMovimentoRelFaccao">Movimento: </label>
                                <div class="relative" style="margin-top: 5px;">
                                    <div class="input-group">
                                        <select class="js-example-programmatic js-states form-control" id="txtMovimentoRelFaccao" multiple="multiple" disabled>
                                        </select>
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnMovimentoRelFaccao" data-button="absolute" type="button" disabled><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnLimpaMovimentoRelFaccao" type="button" disabled><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-3 col-sm-6 col-12">
                                <label style="margin-bottom: .1rem;" data-error="wrong" data-success="right" id="labelSetorRelFaccao" for="txtSetorRelFaccao">Setor*: </label>
                                <div class="relative" style="margin-top: 5px;">
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control" id="txtSetorRelFaccao" class="form-control" placeholder="Setor">
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnSetorRelFaccao" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnLimpaSetorRelFaccao" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="form-row">
                            <div class="col-lg-4 col-sm-6 col-12">
                                <label data-error="wrong" data-success="right" for="labelParteRelFaccao">Parte:</label>
                                <select style="width:100%;" class="form-control select2 select2-danger focus" data-dropdown-css-class="select2-danger" id="txtParteRelFaccao" aria-invalid="false">
                                    <option value="">Selecione uma opção</option>
                                </select>
                            </div>
                            <div class="col-lg-3 col-sm-6 col-12">
                                <label style="margin-bottom: .1rem;" data-error="wrong" data-success="right" id="labelFaccaoRelFaccao" for="txtFaccaoRelFaccao">Facção: </label>
                                <div class="relative" style="margin-top: 5px;">
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control" id="txtFaccaoRelFaccao" class="form-control" placeholder="Facção">
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnFaccaoRelFaccao" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnLimpaFaccaoRelFaccao" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-1 col-sm-6 col-12">
                                <label style="margin-bottom: .1rem;" data-error="wrong" data-success="right" id="labelPrecoInvisivelRelFaccao" for="txtPrecoCertoRelFaccao">Preço: </label>
                                <div class="relative" style="margin-top: 5px;">
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control" id="txtPrecoCertoRelFaccao" class="form-control" placeholder="Preço" disabled>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-1 col-sm-6 col-12">
                                <label style="margin-bottom: .1rem;" data-error="wrong" data-success="right" id="labelPrecoRelFaccao" for="txtPrecoRelFaccao">Preço: </label>
                                <div class="relative" style="margin-top: 5px;">
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control" id="txtPrecoRelFaccao" class="form-control" placeholder="Preço">
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-3 col-sm-6 col-12">
                                <label style="margin-bottom: .1rem;" data-error="wrong" data-success="right" id="labelCorRelFaccao" for="txtCorRelFaccao">Cor: </label>
                                <div class="relative" style="margin-top: 5px;">
                                    <div class="input-group">
                                        <select class="js-example-programmatic js-states form-control" id="txtCorRelFaccao" multiple="multiple">
                                        </select>
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnCorRelFaccao" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnLimpaCorRelFaccao" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="form-row mt-0 mt-sm-3">
                            <div class="col-lg-3 col-sm-6 col-12" id="divGrupoRelFaccao">
                                <label style="margin-bottom: .1rem;" data-error="wrong" data-success="right" id="labelGrupoRelFaccao" for="txtGrupoRelFaccao">Grupo: </label>
                                <div class="relative" style="margin-top: 5px;">
                                    <div class="input-group">
                                        <select class="js-example-programmatic js-states form-control" id="txtGrupoRelFaccao" multiple="multiple">
                                        </select>
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnGrupoRelFaccao" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnLimpaGrupoRelFaccao" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-1 col-sm-6 col-12">
                                <label style="margin-bottom: .1rem;" data-error="wrong" data-success="right" id="labelPesoRelFaccao" for="txtPesoRelFaccao">Peso: </label>
                                <div class="relative" style="margin-top: 5px;">
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control" id="txtPesoRelFaccao" class="form-control" placeholder="Peso">
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-3 col-sm-6 col-12">
                                <label style="margin-bottom: .1rem;" data-error="wrong" data-success="right" id="labelLancamentoRelFaccao" for="txtLancamentoRelFaccao">Lançamento: </label>
                                <div class="relative" style="margin-top: 5px;">
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control" id="txtLancamentoRelFaccao" class="form-control" placeholder="Lançamento">
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnLancamentoRelFaccao" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnLimpaLancamentoRelFaccao" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-5 col-sm-6 col-12">
                                <label style="margin-bottom: .1rem;" data-error="wrong" data-success="right" id="labelObservacaoRelFaccao" for="txtObservacaoRelFaccao">Observação: </label>
                                <div class="relative" style="margin-top: 5px;">
                                    <div class="input-group">
                                        <textarea id="txtObservacaoRelFaccao" style="resize: none;" class="autoExpand forumPost form-control" rows="2"></textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="form-row mt-0 mt-sm-3">
                            <div class="col-12" style="margin-top: 10px;">
                                <fieldset class="form border-Field p-0 d-sm-flex d-block">
                                    <legend class="textoBorda pb-0 mb-0">Filtros Consumos</legend>
                                    <!-- <div class="form-row ml-1 mt-1"> -->
                                    <div class="col-12 col-sm-4 form-group mt-3 mt-lg-2">
                                        <div class="icheck-primary d-flex"><input type="checkbox" class="checkfiltros" id="cbSetorConsumosRelFaccao" data-placement="top"><label for="cbSetorConsumosRelFaccao" data-toggle="tooltip" data-placement="top"></label>
                                            <label style="padding-left: 0 !important;" data-error="wrong" id="labelSetorConsumosRelFaccao" data-success="right" for="txtSetorConsumosRelFaccao">Setor </label>
                                        </div>
                                        <div class="relative d-none" id="divSetorConsumosRelFaccao">
                                            <div class="input-group">
                                                <select class="js-example-programmatic js-states form-control" id="txtSetorConsumosRelFaccao" multiple="multiple"></select>
                                                <div class="input-group-append">
                                                    <button class="btn bg-danger" id="btnSetorConsumosRelFaccao" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                    <button class="btn bg-danger" id="btnLimpaSetorConsumosRelFaccao" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-12 col-sm-4 form-group mt-3 mt-lg-2">
                                        <div class="icheck-primary d-flex"><input type="checkbox" class="checkfiltros" id="cbParteConsumosRelFaccao" data-placement="top"><label for="cbParteConsumosRelFaccao" data-toggle="tooltip" data-placement="top"></label>
                                            <label style="padding-left: 0 !important;" data-error="wrong" id="labelParteConsumosRelFaccao" data-success="right" for="txtParteConsumosRelFaccao">Parte </label>
                                        </div>
                                        <div class="relative d-none" id="divParteConsumosRelFaccao">
                                            <div class="input-group">
                                                <select class="js-example-programmatic js-states form-control" id="txtParteConsumosRelFaccao" multiple="multiple"></select>
                                                <div class="input-group-append">
                                                    <button class="btn bg-danger" id="btnParteConsumosRelFaccao" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                    <button class="btn bg-danger" id="btnLimpaParteConsumosRelFaccao" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-12 col-sm-4 form-group mt-3 mt-lg-2">
                                        <div class="icheck-primary d-flex"><input type="checkbox" class="checkfiltros" id="cbAplicacaoConsumosRelFaccao" data-placement="top"><label for="cbAplicacaoConsumosRelFaccao" data-toggle="tooltip" data-placement="top"></label>
                                            <label style="padding-left: 0 !important;" data-error="wrong" id="labelAplicacaoConsumosRelFaccao" data-success="right" for="txtAplicacaoConsumosRelFaccao">Aplicação </label>
                                        </div>
                                        <div class="relative d-none" id="divAplicacaoConsumosRelFaccao">
                                            <div class="input-group">
                                                <select class="js-example-programmatic js-states form-control" id="txtAplicacaoConsumosRelFaccao" multiple="multiple"></select>
                                                <div class="input-group-append">
                                                    <button class="btn bg-danger" id="btnAplicacaoConsumosRelFaccao" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                    <button class="btn bg-danger" id="btnLimpaAplicacaoConsumosRelFaccao" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <!-- <label class="labelCheck" for="cbSetorRelFaccao">   <input type="checkbox" class="configCheck" id="cbSetorRelFaccao">  Setor </label> -->
                                    <!-- <label class="labelCheck" for="cbParteRelFaccao">   <input type="checkbox" class="configCheck" id="cbParteRelFaccao">  Parte </label> -->
                                    <!-- <label class="labelCheck" for="cbAplicacaoRelFaccao">   <input type="checkbox" class="configCheck" id="cbAplicacaoRelFaccao">  Aplicação </label> -->

                                    <!-- </div> -->
                                </fieldset>
                            </div>
                            <div class="col-12 text-center text-xl-right mb-2" id="botaoConsultaLimpa">
                                <button type="button" class="btn bg-gradient-primary btn-sisp mr-2" id="btnConsultarRelFaccao" style="margin-top: 10px;">Consultar</button>
                                <button type="button" class="btn bg-gradient-danger btn-sisp mr-2" id="btnImprimirRelFaccao" style="margin-top: 10px;">Imprimir</button>
                                <!-- <button type="button" class="btn bg-gradient-danger btn-sisp mr-2" id="btnLimparTela" style="margin-top: 10px;">Limpar Tela</button> -->
                                <button type="button" class="btn bg-gradient-success btn-sisp mr-2" id="btnGravarPrecoRelFaccao" style="margin-top: 10px;">Gravar Preço</button>
                                <button type="button" class="btn bg-gradient-success  btn-sisp mr-2" id="btnGravarObservacaoRelFaccao" style="margin-top: 10px;">Gravar Observação</button>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="border-bottom border-secondary">
                    <div class="card card-header" role="tab" id="cardFaccaoRelFaccao" style="border-top: 0px;">
                        <a style="width:100%;" data-toggle="collapse" data-parent="#abaFaccaoRelFaccao" href="#abaFaccaoRelFaccao" 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-down"></i>
                                </div>
                                <div class="col-11">
                                    <h4 class="title-page">
                                        Facção
                                    </h4>
                                </div>
                            </div>
                        </a>
                    </div>
                    <div class="collapse show col-12 mx-auto py-3" id="abaFaccaoRelFaccao">
                        <div class="row">
                            <div class="col-sm-12">
                                <table id="tabelaFaccaoRelFaccao" class="table table-sm table-select table-hover" width="100%">
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="border-bottom border-secondary">
                    <div class="card card-header" role="tab" id="cardConsumosRelFaccao" style="border-top: 0px;">
                        <a style="width:100%;" data-toggle="collapse" data-parent="#abaConsumosRelFaccao" href="#abaConsumosRelFaccao" 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-down"></i>
                                </div>
                                <div class="col-11">
                                    <h4 class="title-page">
                                        Consumos
                                    </h4>
                                </div>
                            </div>
                        </a>
                    </div>
                    <div class="collapse col-12 mx-auto py-3" id="abaConsumosRelFaccao">
                        <div class="row">
                            <div class="col-sm-12">
                                <table id="tabelaConsumosRelFaccao" class="table table-sm table-select table-hover" width="100%">
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
                <div>
                    <div class="card card-header" role="tab" id="cardComposicaoRelFaccao" style="border-top: 0px;">
                        <a style="width:100%;" data-toggle="collapse" data-parent="#abaComposicaoRelFaccao" href="#abaComposicaoRelFaccao" 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-down"></i>
                                </div>
                                <div class="col-11">
                                    <h4 class="title-page">
                                        Composição
                                    </h4>
                                </div>
                            </div>
                        </a>
                    </div>
                    <div class="collapse col-12 mx-auto py-3" id="abaComposicaoRelFaccao">
                        <div class="row">
                            <div class="col-sm-12">
                                <table id="tabelaComposicaoRelFaccao" class="table table-sm table-select table-hover" width="100%">
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>

    <?php
    include_once('../../footer.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.245.9.1"></script>
    <!-- jQuery UI 1.11.4 -->
    <script src="./plugins/jquery-ui/jquery-ui.min.js?versao=3.245.9.1"></script>
    <script type="text/javascript" src="./dist/js/jquery.dataTables.js?versao=3.245.9.1"></script>
    <script type="text/javascript" src="./dist/js/dataTables.bootstrap4.min.js?versao=3.245.9.1"></script>
    <!-- SweetAlert2 -->
    <script src="./plugins/sweetalert2/sweetalert2.min.js?versao=3.245.9.1"></script>
    <script src="./plugins/toastr/toastr.min.js?versao=3.245.9.1"></script>

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

    <script src="plugins/jquery/jquery.min.js?versao=3.245.9.1"></script>
    <script src="dist/js/jquery.maskMoney.min.js?versao=3.245.9.1"></script>
    <script src="plugins/jquery-ui/jquery-ui.min.js?versao=3.245.9.1"></script>
    <script type="text/javascript" src="dist/js/jquery.dataTables.js?versao=3.245.9.1"></script>
    <script type="text/javascript" src="dist/js/dataTables.bootstrap4.min.js?versao=3.245.9.1"></script>
    <script src="plugins/sweetalert2/sweetalert2.min.js?versao=3.245.9.1"></script>
    <script src="plugins/toastr/toastr.min.js?versao=3.245.9.1"></script>
    <script>
        $.widget.bridge('uibutton', $.ui.button);
    </script>
    <script src="plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.245.9.1"></script>
    <script src="dist/js/adminlte.min.js?versao=3.245.9.1"></script>
    <script src="dist/js/requisicoes.js?versao=3.245.9.1"></script>
    <script src="dist/js/loadingoverlay.min.js?versao=3.245.9.1"></script>
    <script src="dist/js/valida_cpf_cnpj.js?versao=3.245.9.1"></script>
    <script src="plugins/jquery-validation/jquery.validate.min.js?versao=3.245.9.1"></script>
    <script src="dist/js/dataTables.keyTable.js?versao=3.245.9.1"></script>
    <script src="dist/js/sisplan.js?versao=3.245.9.1"></script>
    <script src="utils/funcoes.js?versao=3.245.9.1"></script>
    <script src="utils/cookies.js?versao=3.245.9.1"></script>
    <script src="dist/js/driver.min.js?versao=3.245.9.1"></script>
    <script src="config.js?versao=3.245.9.1"></script>
    <script type="text/javascript" src="plugins/jszip/jszip.min.js?versao=3.245.9.1"></script>
    <script type="text/javascript" src="plugins/pdfmake/pdfmake.min.js?versao=3.245.9.1"></script>
    <script type="text/javascript" src="plugins/pdfmake/vfs_fonts.js?versao=3.245.9.1"></script>
    <script type="text/javascript" src="plugins/datatables-buttons/js/dataTables.buttons.min.js?versao=3.245.9.1"></script>
    <script type="text/javascript" src="plugins/datatables-buttons/js/buttons.html5.min.js?versao=3.245.9.1"></script>
    <script src="plugins/datatables-colreorder/js/dataTables.colReorder.min.js?versao=3.245.9.1"></script>
    <script src="plugins/select2/js/select2.full.min.js?versao=3.245.9.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("RELFACCAO");
            if (!temAcesso.resultado) {
                toastrAcesso(temAcesso, BASE_URI);
                return;
            }

            const permissaoUsuarioLogado = await permissaoAcessos("RELFACCAO");

            if (permissaoUsuarioLogado.INCLUI == 'N') {
                await criaMensagemErro("Sem permissão para utilizar esta tela!", () => {
                    $('#semPermissao').addClass('d-none');
                });
                return;
            }

            const queryString = window.location.href;
            const parametros = queryString.split("/");
            const cliente = parametros[parametros.length - 1];

            sArquivo = `${BASE_URI}/pages/relfaccao/relfaccao.js?versao=3.245.9.1`;
            insereJavaScriptPagina(sArquivo);

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

        });
    </script>
</body>

</html>