<!DOCTYPE html>
<html>

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

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

<style>
    .checkOpcoes {
        font-size: 120%;
        margin-top: 14px;
    }

    .checkTop {
        margin-left: 2%;
        margin-top: 2%;
    }

    .checkStyle {
        margin-top: 2%;
        padding: 1%;
        border: solid #e0e4e6;
        border-radius: 4px;
        border-width: 2px;
        margin-left: 0%;
    }

    .checkboxNota {
        border: solid #e0e4e6;
        border-radius: 4px;
        border-width: 2px;
        padding: .8%;
    }
</style>

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

        <?php
        include_once('../../menu.php');
        ?>

        <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">Relatório de Minuta</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">
                            <ol class="breadcrumb float-sm-right">
                                <li class="breadcrumb-item"><a href="./index">Início</a></li>
                                <li class="breadcrumb-item active">Relatório de Minuta</li>
                            </ol>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-12">
                            <fieldset>
                                <div class="row">
                                    <div class="col-12">
                                        <div class="buttons">
                                            <button class="btn btn-success btn-sisp" id="btnFiltros" type="button"><span class="fas fa-filter"></span> Filtros</button>
                                            <button id="btnImprimir" class="btn-sisp btn btn-danger"><i class="fas fa-print"></i> Imprimir</button>
                                        </div>
                                    </div>
                                </div>
                                <div class="card-body">
                                    <div class="card">
                                        <div class="col-sm-12 table-responsive card-body">
                                            <table id="tabelaRelMinuta" class="table table-sm table-select table-hover" width="100%"></table>
                                            <thead>
                                                <tr></tr>
                                            </thead>
                                            <tbody>
                                                <tr></tr>
                                            </tbody>
                                        </div>
                                    </div>
                                </div>
                            </fieldset>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div id="modal-filtros" class="modal" tabindex="-1" role="dialog">
            <div class="modal-dialog modal-lg" 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="row">

                            <div class="col-sm-12 col-md-12" style="margin-left: -0.7%; margin-right:0.7%;padding-right:0;">
                                <div class="col-sm-6 col-md-6" style="padding-left:5px; padding-bottom: 5px;">
                                    <label class="labelGeral" style="font-size: 116%;" for="divTipo" data-error="wrong" data-success="right">Tipo</label>
                                    <div id="divTipo" class="checkboxNota" style="margin-top: -.5%">
                                        <label class="container">
                                            <input type="radio" checked id="radioEtiqueta">
                                            <span class="checkmark"></span>
                                              Etiqueta</label>
                                        <label class="container">
                                            <input type="radio" id="radioMinuta">
                                            <span class="checkmark"></span>
                                              Minuta</label>
                                    </div>
                                </div>
                                <div class="col-sm-6 col-md-6" style="padding-left:13px; padding-bottom: 5px;">
                                    <label class="labelGeral" style="font-size: 116%;" for="divTipoNatureza" data-error="wrong" data-success="right">Tipo Natureza</label>
                                    <div id="divTipoNatureza" class="checkboxNota" style="margin-top: -.5%">
                                        <label class="container">
                                            <input type="radio" checked id="radioSaidaEntrada">
                                            <span class="checkmark"></span>
                                              Saída/Entrada</label>
                                        <label class="container">
                                            <input type="radio" id="radioSaida">
                                            <span class="checkmark"></span>
                                              Saída</label>
                                        <label class="container">
                                            <input type="radio" id="radioEntrada">
                                            <span class="checkmark"></span>
                                              Entrada</label>
                                    </div>
                                </div>
                            </div>


                            <div class="col-12 col-md-6">
                                <label data-error="wrong" data-success="right" for="txtDtEmissaoDe">Emissao De:</label>
                                <div class="input-group">
                                    <input type="date" autocomplete="off" value="1200-01-01" class="input-default focus form-control" id="txtDtEmissaoDe" class="form-control">
                                </div>
                            </div>

                            <div class="col-12 col-md-6">
                                <label data-error="wrong" data-success="right" for="txtDtEmissaoAte">Até:</label>
                                <div class="input-group">
                                    <input type="date" autocomplete="off" value="2500-12-31" class="input-default focus form-control" id="txtDtEmissaoAte" class="form-control">
                                </div>
                            </div>

                            <div class="col-12 col-md-6">
                                <label data-error="wrong" data-success="right" for="txtDtSaidaDe">Saída De:</label>
                                <div class="input-group">
                                    <input type="date" autocomplete="off" value="1200-01-01" class="input-default focus form-control" id="txtDtSaidaDe" class="form-control">
                                </div>
                            </div>

                            <div class="col-12 col-md-6">
                                <label data-error="wrong" data-success="right" for="txtDtSaidaAte">Até:</label>
                                <div class="input-group">
                                    <input type="date" autocomplete="off" value="2500-12-31" class="input-default focus form-control" id="txtDtSaidaAte" class="form-control">
                                </div>
                            </div>

                            <div class="col-12 col-md-6">
                                <label data-error="wrong" data-success="right" for="txtDtEmbarqueDe">Embarque De:</label>
                                <div class="input-group">
                                    <input type="date" autocomplete="off" value="1200-01-01" class="input-default focus form-control" id="txtDtEmbarqueDe" class="form-control">
                                </div>
                            </div>

                            <div class="col-12 col-md-6">
                                <label data-error="wrong" data-success="right" for="txtDtEmbarqueAte">Até:</label>
                                <div class="input-group">
                                    <input type="date" autocomplete="off" value="2500-12-31" class="input-default focus form-control" id="txtDtEmbarqueAte" class="form-control">
                                </div>
                            </div>

                            <div class="col-md-6 col-sm-6 col-12">
                                <label style="margin-bottom: .1rem;" data-error="wrong" data-success="right" id="labelTransportadora" for="txtTransportadora">Transportadora: </label>
                                <div class="relative" style="margin-top: 5px;">
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control" id="txtTransportadora" class="form-control" placeholder="Transportadora">
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnTransportadora" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnLimpaTransportadora" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="col-md-6 col-sm-6 col-12">
                                <label style="margin-bottom: .1rem;" data-error="wrong" data-success="right" id="labelTransportadora2" for="txtTransportadora2">Trnasportadora2: </label>
                                <div class="relative" style="margin-top: 5px;">
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control" id="txtTransportadora2" class="form-control" placeholder="Transportadora2">
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnTransportadora2" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnLimpaTransportadora2" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="col-md-6 col-sm-6 col-12">
                                <label style="margin-bottom: .1rem;" data-error="wrong" data-success="right" id="labelTipoCliente" for="txtTipoCliente">Tipo Cliente: </label>
                                <div class="relative" style="margin-top: 5px;">
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control" id="txtTipoCliente" class="form-control" placeholder="Tipo Cliente">
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnTipoCliente" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnLimpaTipoCliente" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="col-md-6 col-sm-6 col-12">
                                <label style="margin-bottom: .1rem;" data-error="wrong" data-success="right" id="labelRepresentante" for="txtRepresentante">Representante: </label>
                                <div class="relative" style="margin-top: 5px;">
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control" id="txtRepresentante" class="form-control" placeholder="Representante">
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnRepresentante" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnLimpaRepresentante" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="col-md-6 col-sm-6 col-12">
                                <label style="margin-bottom: .1rem;" data-error="wrong" data-success="right" id="labelCliente" for="txtCliente">Cliente: </label>
                                <div class="relative" style="margin-top: 5px;">
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control" id="txtCliente" class="form-control" placeholder="Cliente">
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnCliente" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnLimpaCliente" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                        <!-- <div class="input-group-bottom" style="display: contents;">
                                            <textarea type="text" disabled="" wrap="hard" style="height: 22px !important;"class="col-lg-12 col-6 input-default focus form-control d-none" id="listaVendas" placeholder="Lista de Vendas"></textarea>
                                        </div> -->
                                    </div>
                                </div>
                            </div>

                            <div class="col-md-6 col-sm-6 col-12">
                                <label style="margin-bottom: .1rem;" data-error="wrong" data-success="right" for="txtUF">UF: </label>
                                <div class="relative" style="margin-top: 5px;">
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control" id="txtUF" class="form-control" placeholder="UF">
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnUF" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnLimpaUF" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="col-md-6 col-sm-6 col-12">
                                <label style="margin-bottom: .1rem;" data-error="wrong" data-success="right" for="txtOperFiscal">Operação Fiscal: </label>
                                <div class="relative" style="margin-top: 5px;">
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control" id="txtOperFiscal" class="form-control" placeholder="Operação Fiscal">
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnOperFiscal" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnLimpaOperFiscal" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="col-md-6 col-sm-6 col-12">
                                <label style="margin-bottom: .1rem;" data-error="wrong" data-success="right" for="txtListaNotas">Lista Notas: </label>
                                <div class="relative" style="margin-top: 5px;">
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control" id="txtListaNotas" class="form-control" placeholder="Notas">
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnListaNotas" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnLimpaListaNotas" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                            </div>


                        </div>

                        <div class="checkOpcoes col-sm-12">
                            <div class="fiscal col-12">
                                <div class="row">
                                    <div class="col-sm-12">
                                        <b>
                                            <p class="pOpcoes" style="margin-bottom:5px;">Opções</p>
                                        </b>
                                        <div class="checkStyle checkTop">
                                            <label class="labelCheck" for="cbTodasEmpresas">   <input type="checkbox" class="configCheck" id="cbTodasEmpresas">    Todas Empresas</label> <br>
                                            <label class="labelCheck" for="cbNotasDenegadas">   <input type="checkbox" class="configCheck" id="cbNotasDenegadas">    Notas Denegadas</label> <br>
                                            <label class="labelCheck" for="cbTipoNatVendas">   <input type="checkbox" class="configCheck" id="cbTipoNatVendas">    Tipo Nat. Vendas</label> <br>
                                            <label class="labelCheck" for="cbImpressoraTermica">   <input type="checkbox" class="configCheck" id="cbImpressoraTermica">    Impres. Térmica</label> <br>
                                            <label class="labelCheck" for="cbExpedicao">   <input type="checkbox" class="configCheck" id="cbExpedicao">    Expedição</label> <br>
                                            <label class="labelCheck" for="cbEmbalagem">   <input type="checkbox" class="configCheck" id="cbEmbalagem">    Embalagem</label> <br>
                                            <label class="labelCheck" for="cbSemDtEmbarque">   <input type="checkbox" class="configCheck" id="cbSemDtEmbarque">    Sem Dt Embarque</label> <br>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>
                    <div class="modal-footer">
                        <div class="row">
                            <button id="btnConsultar" class='btn btn-primary btn-sisp' type='button'><span class="fas fa-search"></span> Consultar </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!-- Control Sidebar -->
        <aside class="control-sidebar control-sidebar-dark">
            <!-- Control sidebar content goes here -->
        </aside><!-- /.control-sidebar -->
        <?php include_once('../../footer.php'); ?>
    </main><!-- /.wrapper -->


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

            sArquivo = `${BASE_URI}/pages/relminuta/relminuta.js?versao=2.5.4`;
            const nomeTela = ('<?php echo basename(__FILE__) ?>').replace('.php', '');
            // nomeTela


            await insereJavaScriptPagina(sArquivo);

            habilitaCamposObrigatoriosTela(nomeTela);
        });
    </script>

</body>

</html>