<?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 | Lançamento de Terceiros</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../dist/css/adminlte.min.css?versao=3.263.17.1">
    <link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css?versao=3.263.17.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.263.17.1" />
    <link href='../dist/css/bootstrap.min.css?versao=3.263.17.1'>
    <link rel="stylesheet" href="../dist/css/custom.css?versao=3.263.17.1">
    <link rel="stylesheet" href="../dist/css/sisplan.css?versao=3.263.17.1">
    <link rel="stylesheet" type="text/css" href="../plugins/datatables-keytable/css/keyTable.bootstrap4.min.css?versao=3.263.17.1">
    <link rel="stylesheet" type="text/css" href="../dist/css/responsive.bootstrap.min.css?versao=3.263.17.1">
    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" href="../dist/css/cadastro.css?versao=3.263.17.1">
    <link rel="stylesheet" href="../plugins/icheck-bootstrap/icheck-bootstrap.min.css?versao=3.263.17.1">


    <!-- Toastr -->
    <link rel="stylesheet" href="../plugins/toastr/toastr.min.css?versao=3.263.17.1">
    <link rel="stylesheet" type="text/css" href="../dist/css/driver.min.css?versao=3.263.17.1" />
    <link rel="stylesheet" href="../dist/css/jquery-ui.css?versao=3.263.17.1">
    <!-- Google Font: Source Sans Pro -->
    <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
    <style>
        .table.dataTable tbody td,
        th {
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
        }

        .textoBorda {
            font-size: 1.0em !important;
            text-align: left !important;
            width: auto;
            padding: 0 10px;
            font-weight: 700;
            margin-bottom: 5px;
        }

        .border-Field {
            border: 1.0px solid var(--font-color) !important;
            padding: 0 1.0em 1.0em 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;
            padding-bottom: 0px !important;
        }
    </style>
</head>

<body class="hold-transition sidebar-mini layout-fixed">
    <div class="wrapper">
        <?php
        include_once('../../../menu.php');
        ?>
        <div id="myModal" class="modal" tabindex="-1" role="dialog">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 id="myModalLabel" class="modal-title"></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">
                                <!-- <ol class="breadcrumb float-sm-right">
                                    <li class="breadcrumb-item"><a href="../grupomaterial">Acesso Preço Facção</a></li>
                                    <li class="breadcrumb-item active">Cadastro Preço Facção</li>
                                </ol> -->
                            </div><!-- /.col -->
                        </div><!-- /.row -->
                    </div>
                    <div class="row justify-content-center">
                        <div class="col-11 text-center">
                            <div class="card">
                                <div class="row card-body d-flex" id="abaGeral">
                                    <nav class="col-12 d-flex justify-content-center">
                                        <div class="nav nav-tabs d-flex flex-nowrap" id="nav-tab" role="tablist" style="text-decoration: none; max-width: none!important; white-space: nowrap!important; overflow-x: auto!important; overflow-y: hidden">
                                            <a class="nav-link abaLink active" id="tabLancto" data-toggle="tab" href="#divLancto" role="tab" aria-controls="divLancto" aria-selected="true">Lançamento de Terceiros</a>
                                            <a class="nav-link abaLink" id="tabDesconto" data-toggle="tab" href="#divDesconto" role="tab" aria-controls="divDesconto" aria-selected="false">Desconto</a>
                                        </div>
                                    </nav>
                                    <div class="tab-content col-lg-12" id="nav-tabContent">
                                        <div class="tab-pane fade show active" id="divLancto" role="tabpanel" aria-labelledby="tabLancto">
                                            <div class="card-header text-center flex mt-3 pb-0">
                                                <h2>Lançamento de Terceiros</h2>
                                                <div class="form-group col-lg-3 col-12 ml-3 d-none" id="divTipoCodigo">
                                                    <fieldset class="form border-Field" style="margin-bottom: 0px!important; padding-left: 0px!important; margin-left: 0px!important">
                                                        <div class="d-flex justify-content-around mt-2 mb-1">
                                                            <div class="icheck-primary">
                                                                <input type="radio" name="rdTipo" id="rdProduto" value="P" checked>
                                                                <label class="form-check-label" for="rdProduto">Produto</label>
                                                            </div>
                                                            <div class="icheck-primary">
                                                                <input type="radio" name="rdTipo" id="rdMaterial" value="M">
                                                                <label class="form-check-label" for="rdMaterial">Material</label>
                                                            </div>
                                                        </div>
                                                    </fieldset>
                                                </div>
                                            </div>
                                            <div class="row" id="campostour">
                                                <div class="col-lg-12 mx-0 mb-3">
                                                    <form id="msform">
                                                        <fieldset class="row justify-content-center mt-3">
                                                            <div class="row col-lg-11 col-12 text-left">
                                                                <div class="col-lg-2 col-12">
                                                                    <label data-error="wrong" data-success="right" for="txtLancamento">Lançamento:</label>
                                                                    <input type="text" class="input-default focus form-control" disabled id="txtLancamento" aria-describedby="codError" name="txtLancamento" class="form-control" placeholder="Lançamento" maxlength="10">
                                                                </div>
                                                                <div class="col-lg-2 col-12">
                                                                    <label data-error="wrong" data-success="right" for="txtNumero">Número OF:</label>
                                                                    <input type="text" class="input-default focus form-control" id="txtNumero" aria-describedby="codError" name="txtNumero" class="form-control" placeholder="Número OF">
                                                                </div>
                                                                <div class="col-lg-3 col-12">
                                                                    <label data-error="wrong" data-success="right" for="txtCodigo">Código:</label>
                                                                    <div class="input-group">
                                                                        <input type="text" class="input-default focus form-control" disabled id="txtCodigo" aria-describedby="codError" name="txtCodigo" class="form-control" placeholder="Código">
                                                                        <div class="input-group-append">
                                                                            <button class="btn bg-danger" id="btnCodigo" disabled name="btnCodigo" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                                            <button class="btn bg-danger" id="btnLimpaCodigo" disabled name="btnLimpaCodigo" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="col-lg-5 col-12">
                                                                    <label data-error="wrong" data-success="right" for="txtDescricao">Descrição:</label>
                                                                    <input type="text" class="input-default focus form-control" id="txtDescricao" aria-describedby="codError" name="txtDescricao" class="form-control" placeholder="Descrição">
                                                                </div>
                                                                <div class="col-lg-4 col-12">
                                                                    <label data-error="wrong" data-success="right" for="txtEntidade">Terceiro:</label>
                                                                    <div class="input-group">
                                                                        <input type="text" class="input-default focus form-control" id="txtEntidade" aria-describedby="codError" name="txtEntidade" class="form-control" placeholder="Terceiro">
                                                                        <div class="input-group-append">
                                                                            <button class="btn bg-danger" id="btnEntidade" name="btnEntidade" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                                            <button class="btn bg-danger" id="btnLimpaEntidade" name="btnLimpaEntidade" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="col-lg-4 col-12">
                                                                    <label data-error="wrong" data-success="right" for="txtSetor">Setor:</label>
                                                                    <div class="input-group">
                                                                        <input type="text" class="input-default focus form-control" id="txtSetor" aria-describedby="codError" name="txtSetor" class="form-control" placeholder="Setor">
                                                                        <div class="input-group-append">
                                                                            <button class="btn bg-danger" id="btnSetor" name="btnSetor" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                                            <button class="btn bg-danger" id="btnLimpaSetor" name="btnLimpaSetor" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="col-lg-4 col-12">
                                                                    <label data-error="wrong" data-success="right" for="txtMotivo">Motivo:</label>
                                                                    <div class="input-group">
                                                                        <input type="text" class="input-default focus form-control" id="txtMotivo" aria-describedby="codError" name="txtMotivo" class="form-control" placeholder="Motivo">
                                                                        <div class="input-group-append">
                                                                            <button class="btn bg-danger" id="btnMotivo" name="btnMotivo" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                                            <button class="btn bg-danger" id="btnLimpaMotivo" name="btnLimpaMotivo" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="col-lg-5 col-12">
                                                                    <label data-error="wrong" data-success="right" for="txtObs">Observação:</label>
                                                                    <input type="text" class="input-default focus form-control" id="txtObs" aria-describedby="codError" name="txtObs" class="form-control" placeholder="Observação">
                                                                </div>
                                                                <div class="col-lg-1 col-12">
                                                                    <label data-error="wrong" data-success="right" for="txtUnidade">Un:</label>
                                                                    <input type="text" class="input-default focus form-control" id="txtUnidade" aria-describedby="codError" name="txtUnidade" class="form-control" placeholder="Un">
                                                                </div>
                                                                <div class="col-lg-2 col-12">
                                                                    <label data-error="wrong" data-success="right" for="txtEmissao">Emissão:</label>
                                                                    <input type="date" class="input-default focus form-control" id="txtEmissao" aria-describedby="codError" name="txtEmissao" class="form-control">
                                                                </div>
                                                                <div class="col-lg-2 col-12">
                                                                    <label data-error="wrong" data-success="right" for="txtVencimento">Vencimento:</label>
                                                                    <input type="date" class="input-default focus form-control" id="txtVencimento" aria-describedby="codError" name="txtVencimento" class="form-control">
                                                                </div>
                                                                <div class="col-lg-2 col-12">
                                                                    <label data-error="wrong" data-success="right" for="txtQuantidade">Quantidade:</label>
                                                                    <input type="text" class="input-default focus form-control apenasFloat" id="txtQuantidade" aria-describedby="codError" name="txtQuantidade" class="form-control" placeholder="Quantidade">
                                                                </div>
                                                                <div class="col-lg-2 col-12">
                                                                    <label data-error="wrong" data-success="right" for="txtPreco">Preço:</label>
                                                                    <input type="text" class="input-default focus form-control apenasFloat" id="txtPreco" aria-describedby="codError" name="txtPreco" class="form-control" placeholder="Preço">
                                                                </div>
                                                                <div class="col-lg-2 col-12">
                                                                    <label data-error="wrong" data-success="right" for="txtValor">Valor:</label>
                                                                    <input type="text" class="input-default focus form-control apenasFloat" id="txtValor" aria-describedby="codError" name="txtValor" class="form-control" placeholder="Valor">
                                                                </div>
                                                                <div class="form-group col-lg-2 col-12">
                                                                    <label class="labelGeral" for="txtOperacao">Operação:</label>
                                                                    <select class="drilldown-item form-control select2 select2-danger focus" data-dropdown-css-class="select2-danger" id="txtOperacao" style="border-color: #a9a9a9">
                                                                        <option class="drilldown-item" value="A">Acréscimo</option>
                                                                        <option class="drilldown-item" value="D" selected>Desconto</option>
                                                                    </select>
                                                                </div>
                                                                <div class="form-group col-lg-6 col-12">
                                                                    <legend class="textoBorda">Opções:</legend>
                                                                    <fieldset class="form border-Field" style="margin-bottom: 0px!important; padding-left: 0px!important; margin-left: 0px!important">
                                                                        <div class="d-flex justify-content-around mt-2 mb-1 mx-0">
                                                                            <div class="icheck-primary">
                                                                                <input type="checkbox" class="form-check-input" name="cbLanctoEspecial" id="cbLanctoEspecial">
                                                                                <label class="form-check-label" for="cbLanctoEspecial">Lançamento especial</label>
                                                                            </div>
                                                                            <div class="icheck-primary">
                                                                                <input type="checkbox" class="form-check-input" name="cbQtdePreco" id="cbQtdePreco">
                                                                                <label class="form-check-label" for="cbQtdePreco">Buscar qtde e preço</label>
                                                                            </div>
                                                                        </div>
                                                                    </fieldset>
                                                                </div>
                                                            </div>
                                                        </fieldset>
                                                        <div class="col-12 d-flex justify-content-center">
                                                            <div class="col-lg-11 row d-flex">
                                                                <button type="button" id="btnGravar" class="btn btn-sisp btn-danger">Gravar</button>
                                                                <button type="button" id="btnDuplicar" class="btn btn-sisp btn-secondary ml-1">Duplicar</button>
                                                                <button type="button" id="btnVoltar" class="btn btn-sisp btn-secondary ml-auto">Voltar</button>
                                                            </div>
                                                        </div>
                                                    </form>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="tab-pane fade show" id="divDesconto" role="tabpanel" aria-labelledby="tabDesconto">
                                            <div class="card-header text-center flex mt-3 pb-0">
                                                <h2>Desconto</h2>
                                            </div>
                                            <div class="row" id="campostour">
                                                <div class="col-lg-12 mx-0 mb-3">
                                                    <form id="msform">
                                                        <fieldset class="row justify-content-center mt-3">
                                                            <div class="row col-lg-11 col-12 text-left">
                                                                <div class="form-group col-lg-4 col-12">
                                                                    <label data-error="wrong" data-success="right" for="dtLancamentoDeDesc">Lançamento de/até: </label>
                                                                    <div class="relative">
                                                                        <div class="input-group">
                                                                            <input type="date" max="2500-12-31" class="input-default focus form-control mr-1" id="dtLancamentoDeDesc" value="1200-01-01" name="dtLancamentoDeDesc" class="form-control">
                                                                            <input type="date" max="2500-12-31" class="input-default focus form-control ml-1" id="dtLancamentoAteDesc" value="2500-12-31" name="dtLancamentoAteDesc" class="form-control">
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="form-group col-lg-4 col-12">
                                                                    <label data-error="wrong" data-success="right" for="txtNumeroDesc">Número:</label>
                                                                    <div class="input-group">
                                                                        <select class="js-example-programmatic js-states form-control" id="txtNumeroDesc" name="txtNumeroDesc" multiple="multiple"></select>
                                                                        <!-- <input type="text" class="input-default focus form-control" id="txtNumeroDesc" aria-describedby="codError" name="txtNumeroDesc" class="form-control" placeholder="Número"> -->
                                                                        <div class="input-group-append">
                                                                            <button class="btn bg-danger" id="btnNumeroDesc" name="btnNumeroDesc" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                                            <button class="btn bg-danger" id="btnLimpaNumeroDesc" name="btnLimpaNumeroDesc" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="form-group col-lg-4 col-12">
                                                                    <label data-error="wrong" data-success="right" for="txtSetorDesc">Setor:</label>
                                                                    <div class="input-group">
                                                                        <input type="text" class="input-default focus form-control" id="txtSetorDesc" aria-describedby="codError" name="txtSetorDesc" class="form-control" placeholder="Setor">
                                                                        <div class="input-group-append">
                                                                            <button class="btn bg-danger" id="btnSetorDesc" name="btnSetorDesc" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                                            <button class="btn bg-danger" id="btnLimpaSetorDesc" name="btnLimpaSetorDesc" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="form-group col-lg-4 col-12">
                                                                    <label data-error="wrong" data-success="right" for="txtFaccaoDesc">Facção:</label>
                                                                    <div class="input-group">
                                                                        <input type="text" class="input-default focus form-control" id="txtFaccaoDesc" aria-describedby="codError" name="txtFaccaoDesc" class="form-control" placeholder="Facção">
                                                                        <div class="input-group-append">
                                                                            <button class="btn bg-danger" id="btnFaccaoDesc" name="btnFaccaoDesc" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                                                            <button class="btn bg-danger" id="btnLimpaFaccaoDesc" name="btnLimpaFaccaoDesc" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="form-group col-lg-2 col-12">
                                                                    <label data-error="wrong" data-success="right" for="txtMovimentoDesc">Movimento:</label>
                                                                    <input type="text" class="input-default focus form-control" id="txtMovimentoDesc" aria-describedby="codError" name="txtMovimentoDesc" class="form-control" placeholder="Movimento">
                                                                </div>
                                                                <div class="form-group col-lg-2 col-12">
                                                                    <label data-error="wrong" data-success="right" for="txtDescontoDesc">% Desconto:</label>
                                                                    <input type="text" class="input-default focus form-control apenasFloat2" id="txtDescontoDesc" aria-describedby="codError" name="txtDescontoDesc" class="form-control" placeholder="% Desconto">
                                                                </div>
                                                                <div class="form-group col-lg-2 col-12">
                                                                    <label class="labelGeral" for="txtOperacaoDesc">Operação:</label>
                                                                    <select class="drilldown-item form-control select2 select2-danger focus" data-dropdown-css-class="select2-danger" id="txtOperacaoDesc" style="border-color: #a9a9a9">
                                                                        <option class="drilldown-item" value="A">Acréscimo</option>
                                                                        <option class="drilldown-item" value="D" selected>Desconto</option>
                                                                    </select>
                                                                </div>
                                                                <div class="form-group col-lg-2 col-12">
                                                                    <label data-error="wrong" data-success="right" for="txtLancamentoDesc">Lançamento:</label>
                                                                    <input type="date" class="input-default focus form-control" id="txtLancamentoDesc" aria-describedby="codError" name="txtLancamentoDesc" class="form-control">
                                                                </div>
                                                                <div class="form-group col-lg-5 col-12">
                                                                    <label data-error="wrong" data-success="right" for="txtObsDesc">Observação:</label>
                                                                    <input type="text" class="input-default focus form-control apenasFloat" id="txtObsDesc" aria-describedby="codError" name="txtObsDesc" class="form-control" placeholder="Observação">
                                                                </div>
                                                                <div class="form-group col-lg-5 col-12">
                                                                    <legend class="textoBorda">Descontar:</legend>
                                                                    <fieldset class="form border-Field" style="margin-bottom: 0px!important; padding-left: 0px!important; margin-left: 0px!important">
                                                                        <div class="d-flex justify-content-around mt-2 mb-1 mx-0">
                                                                            <div class="icheck-primary">
                                                                                <input type="checkbox" class="form-check-input" name="cbPerdida" id="cbPerdida">
                                                                                <label class="form-check-label" for="cbPerdida">Perdida</label>
                                                                            </div>
                                                                            <div class="icheck-primary">
                                                                                <input type="checkbox" class="form-check-input" name="cbSegunda" id="cbSegunda">
                                                                                <label class="form-check-label" for="cbSegunda">Segunda</label>
                                                                            </div>
                                                                            <div class="icheck-primary">
                                                                                <input type="checkbox" class="form-check-input" name="cbIncompleta" id="cbIncompleta">
                                                                                <label class="form-check-label" for="cbIncompleta">Incompleta</label>
                                                                            </div>
                                                                        </div>
                                                                    </fieldset>
                                                                </div>
                                                                <div class="form-group col-lg-2 col-12 d-flex justify-content-end align-items-end">
                                                                    <button type="button" id="btnConsultarDesc" class="btn btn-sisp btn-primary">Consultar</button>
                                                                </div>
                                                                <div class="form-group col-lg-12 col-12">
                                                                    <div class="col-lg-12 table-responsive card-body" style="max-height: 320px">
                                                                        <table id="tabelaDesconto" class="table table-sm table-select table-hover" width="100%">
                                                                            <thead>
                                                                            </thead>
                                                                            <tbody>
                                                                            </tbody>
                                                                        </table>
                                                                    </div>
                                                                </div>
                                                                <div class="form-row mr-auto col-lg-6 col-12">
                                                                    <div class="col-lg-3 col-12">
                                                                        <label data-error="wrong" data-success="right" for="txtTotalDescontoDesc">Total Desconto:</label>
                                                                        <input type="text" class="input-default focus form-control apenasFloat2" disabled id="txtTotalDescontoDesc" aria-describedby="codError" name="txtTotalDescontoDesc" class="form-control" placeholder="0,00">
                                                                    </div>
                                                                    <div class="col-lg-3 col-12 mr-auto">
                                                                        <label data-error="wrong" data-success="right" for="txtTotalPecasDesc">Total Peças:</label>
                                                                        <input type="text" class="input-default focus form-control" disabled id="txtTotalPecasDesc" aria-describedby="codError" name="txtTotalPecasDesc" class="form-control" placeholder="0">
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </fieldset>
                                                        <div class="col-12 d-flex justify-content-center">
                                                            <div class="col-lg-11 row d-flex">
                                                                <button type="button" id="btnGravarDesc" class="btn btn-sisp btn-danger">Gravar</button>
                                                                <button type="button" id="btnAtualizarDesc" class="btn btn-sisp btn-primary ml-auto mr-1">Atualizar Valores</button>
                                                                <button type="button" id="btnVoltarDesc" class="btn btn-sisp btn-secondary">Voltar</button>
                                                            </div>
                                                        </div>
                                                    </form>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        </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.263.17.1"></script>
    <script src="../plugins/jquery-ui/jquery-ui.min.js?versao=3.263.17.1"></script>
    <script type="text/javascript" src="../dist/js/jquery.dataTables.js?versao=3.263.17.1"></script>
    <script type="text/javascript" src="../dist/js/dataTables.bootstrap4.min.js?versao=3.263.17.1"></script>
    <script src="../plugins/sweetalert2/sweetalert2.min.js?versao=3.263.17.1"></script>
    <script src="../plugins/toastr/toastr.min.js?versao=3.263.17.1"></script>
    <script>
        $.widget.bridge('uibutton', $.ui.button);
    </script>
    <script src="../plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.263.17.1"></script>
    <script src="../dist/js/adminlte.min.js?versao=3.263.17.1"></script>
    <script src="../dist/js/requisicoes.js?versao=3.263.17.1"></script>
    <script src="../dist/js/cliente/entidade.js?versao=3.263.17.1"></script>
    <script src="../dist/js/loadingoverlay.min.js?versao=3.263.17.1"></script>
    <script src="../dist/js/valida_cpf_cnpj.js?versao=3.263.17.1"></script>
    <script src="../plugins/jquery-validation/jquery.validate.min.js?versao=3.263.17.1"></script>
    <script src="../dist/js/sisplan.js?versao=3.263.17.1"></script>
    <script src="../utils/funcoes.js?versao=3.263.17.1"></script>
    <script src="../dist/js/driver.min.js?versao=3.263.17.1"></script>
    <script src="../dist/js/jquery.maskMoney.min.js?versao=3.263.17.1"></script>
    <script src="../utils/cookies.js?versao=3.263.17.1"></script>
    <script src="../dist/js/dataTables.keyTable2.js?versao=3.263.17.1"></script>
    <script type="text/javascript" src="../config.js?versao=3.263.17.1"></script>
    <script>
        $(document).ready(async function() {
            if (getCookie('usuario') == "") {
                window.location.href = `${BASE_URI}/login`;
                return;
            }

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

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

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

            const permissaoUsuarioLogado = await permissaoAcessos("FACLANCA");

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

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

            sArquivo = `${BASE_URI}/pages/faclanca/cadastro_faclanca/faclanca.js?versao=3.263.17.1`;
            insereJavaScriptPagina(sArquivo);

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

</html>