<?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 | Preço</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css?versao=3.264.22.1">
    <!-- Theme style -->
    <link rel="stylesheet" href="dist/css/adminlte.min.css?versao=3.264.22.1">

    <!-- Google Font: Source Sans Pro -->
    <link href='https://fonts.googleapis.com/css?family=Roboto:400,300,500,600,700,400italic' rel='stylesheet' type='text/css'>
    <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">


    <link rel="stylesheet" href="dist/css/custom.css?versao=3.264.22.1">
    <link rel="stylesheet" href="dist/css/sisplan.css?versao=3.264.22.1">
    <link rel="stylesheet" type="text/css" href="dist/css/dataTables.bootstrap4.min.css?versao=3.264.22.1" />
    <link rel="stylesheet" href="plugins/toastr/toastr.min.css?versao=3.264.22.1">
    <link rel="stylesheet" href="dist/css/PesquisaVariosSelect2.css?versao=3.264.22.1">
    <link rel="shortcut icon" href="favicon.ico">
    <link rel="stylesheet" type="text/css" href="dist/css/driver.min.css?versao=3.264.22.1" />
    <link rel="stylesheet" href="dist/css/jquery-ui.css?versao=3.264.22.1">
    <link rel="stylesheet" href="plugins/select2/css/select2.min.css?versao=3.264.22.1">
    <link rel="stylesheet" href="plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css?versao=3.264.22.1">
    <style>
        #tabelaPreco td div button {
            padding: .0rem .5rem;
            margin-top: .1rem;
            margin-bottom: .2rem;
        }

        #tabelaPreco td {
            padding: 0 !important;
            padding-left: 10px !important;
        }

        #progressbar li {
            list-style-type: none;
            font-size: 12px;
            width: 400px;
            float: left;
            position: relative
        }

        #progressbar #account:before {
            font-family: "Font Awesome 5 Free";
            content: "\f15c";
            font-weight: 900;
        }

        #progressbar #payment:before {
            font-family: "Font Awesome 5 Free";
            content: "\f0cb";
            font-weight: 900;
        }

        #progressbar li:after {
            content: "";
            width: 100%;
            height: 3px;
            background: lightgray;
            position: absolute;
            left: 0;
            top: 25px;
            z-index: -1;
        }

        #progressbar li:before {
            width: 50px;
            line-height: 16px;
            display: block;
            font-size: 20px;
            color: #ffffff;
            background: lightgray;
            border-radius: 50%;
            margin: 0 auto 17px auto;
            padding: 16px;
        }

        td.ajustePrazo {
            /* padding-left: 36px; */
        }

        td.ajusteQtdeEstoque {
            /* padding-left: 38px; */
        }

        td.ajustePrecoAtual {
            /* padding-left: 34px; */
        }

        td.ajustePrecoPromocional {
            /* padding-left: 65px; */
        }

        .campoDesconto {
            width: 93%;
            margin-left: 21px;
        }

        .campoValorDesconto {
            width: 85%;
            margin-left: 15px;
        }

        .campoPrecoFinal {
            width: 80%;
        }

        .campoDtIni,
        .campoDtFim {
            width: 90%;
        }

        .border-Field .textoBorda {
            font-size: 1.1em !important;
            text-align: left !important;
            width: auto;
            padding: 0 10px;
            border-bottom: none;
        }

        .border-Field {
            border: 1px solid var(--font-color) !important;
            padding: 0 1.0em 0 1.0em !important;
            margin: 0 0 0 0 !important;
            -webkit-box-shadow: 0px 0px 0px 0px #000;
            box-shadow: 0px 0px 0px 0px #000;
            border-radius: 3px !important;
        }
    </style>
</head>

<body class="hold-transition sidebar-mini layout-fixed">
    <div class="wrapper">
        <div class="content-wrapper">
            <div class="content-header">
                <div class="container-fluid">
                    <div class="row mb-2">
                        <div class="col-sm-6 flex">
                            <h1 class="m-0 text-dark">Preço</h1>
                            <button type="button" class="btn btn-info btn-sm ml-2" title="Tutorial" style="color: white;" id="tutorial">
                                <i class="fas fa-question-circle"></i></button>
                        </div>
                        <div class="col-sm-6">

                        </div><!-- /.col -->
                    </div><!-- /.row -->
                </div>
                <div class="container-fluid" id="tabelaPrecoForne">
                    <div class="row card">
                        <div class="col-sm-12 mt-3 d-flex" style="gap: 8px">
                            <button class="btn btn-success btn-sisp" id="btnFiltros"><span class="fas fa-search"></span> Filtros</button>
                            <button class="btn btn-secondary btn-sisp" id="btnImprimir"><i class="fas fa-print"></i> Imprimir</button>
                            <button class="btn btn-danger btn-sisp" id="btnNovoPreco"><span class="fas fa-plus"></span> Incluir</button>
                            <button class="btn btn-danger btn-sisp" id="btnAlterarPreco"> Alterar Preço Promocional</button>
                            <button class="btn btn-danger btn-sisp" id="btnRecalcularPreco"> Recalcular</button>
                            <button class="btn btn-secondary btn-sisp" id="btnDuplicar"> Duplicar</button>
                            <button class="btn btn-secondary btn-sisp" id="btnImportar"><span class="fas fa-arrowdown"></span> Importar</button>
                        </div>
                        <div class="col-sm-12 table-responsive card-body">
                            <h5>Lista de Preços </h5>
                            <table id="tabelaPreco" class="table table-sm table-select table-hover" width="100%">
                                <thead>
                                    <tr>
                                        <th class="th-sm" style="max-width: 40px">
                                            <div class="icheck-primary d-inline">
                                                <input type="checkbox" id="cbSelAll">
                                                <label for="cbSelAll"></label>
                                            </div>
                                        </th>
                                        <th class="th-sm">Código Produto
                                        </th>
                                        <th class="th-sm">Descrição Produto
                                        </th>
                                        <th class="th-sm">Tabela de Preço
                                        </th>
                                        <th class="th-sm">Descrição tabela
                                        </th>
                                    </tr>
                                </thead>
                                <tbody>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>

            <div id="modal-filtros" class="modal" tabindex="-1" role="dialog">
                <div class="modal-dialog modal-xl" role="document">
                    <div class="modal-content" id="modalBody">
                        <div class="modal-header">
                            <h4 class="modal-title">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 col-xl-12 col-12">
                                <div class="form-group col-xl-12 col-12">
                                    <label data-error="wrong" data-success="right" for="txtTabPreco">Tabela de Preço *</label>
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control" id="txtTabPreco" name="txtTabPreco" placeholder="Tabela de Preço">
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnTabPreco" name="btnTabPreco" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnExcluiTabPreco"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group col-xl-3 col-12">
                                    <label data-error="wrong" data-success="right" for="rgTipoItemConsulta">Tipo</label>
                                    <select style="width:100%;" class="form-control select2 select2-danger focus" data-dropdown-css-class="select2-danger" id="rgTipoItemConsulta" class="custom-select focus">
                                        <option value="PRODUTO">0 - Produto</option>
                                        <option value="MATERIAL">1 - Material</option>
                                    </select>
                                </div>
                                <div class="col-lg-6 col-12 form-group" id="ProdutoInfoTour">
                                    <label id="labelProdutoMaterialP" data-error="wrong" data-success="right" for="txtProdutoMaterialP">Produto:</label>
                                    <div class="input-group">
                                        <select class="js-example-programmatic js-states form-control" id="txtProdutoMaterialP" name="txtProdutoMaterialP" multiple="multiple">
                                        </select>
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnProdutoMaterialP" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnLimpaProdutoMaterialP" name="btnLimpaProdutoMaterialP" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group col-xl-3 col-12">
                                    <label data-error="wrong" data-success="right" for="txtPrazo">Prazo</label>
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control" id="txtPrazo" name="txtPrazo" placeholder="Prazo">
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnPrazo" name="btnPrazo" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnLimpaPrazo" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group col-xl-3 col-12">
                                    <label data-error="wrong" data-success="right" for="txtColecao">Coleção</label>
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control" id="txtColecao" name="txtColecao" placeholder="Coleção">
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnColecao" name="btnColecao" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnLimpaColecao" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group col-xl-3 col-12">
                                    <label data-error="wrong" data-success="right" for="txtGrupo">Grupo</label>
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control" id="txtGrupo" name="txtGrupo" placeholder="Grupo">
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnGrupo" name="btnGrupo" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnLimpaGrupo" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group col-xl-3 col-12">
                                    <label data-error="wrong" data-success="right" for="txtMarca">Marca</label>
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control" id="txtMarca" name="txtMarca" placeholder="Marca">
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnMarca" name="btnMarca" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnLimpaMarca" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group col-xl-3 col-12">
                                    <label data-error="wrong" data-success="right" for="txtLinha">Linha</label>
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control" id="txtLinha" name="txtLinha" placeholder="Linha">
                                        <div class="input-group-append">
                                            <button class="btn bg-danger" id="btnLinha" name="btnLinha" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                            <button class="btn bg-danger" id="btnLimpaLinha" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <div class="row col-12">
                                <div class="col-lg-4 col-sm-12 col-12">
                                    <label for="txtOrdem">Opção de Relatório:</label>
                                    <div class="relative d-flex align-items-center">
                                        <select id="txtOrdem" class="input-default focus custom-select">
                                        </select>
                                        <button class="btn btn-sm btn-success ml-2 btnEdicaoRelatorio" title="Edição de ordenações">
                                            <i class="fas fa-check"></i>
                                        </button>
                                    </div>
                                </div>
                                <div class="col-lg-8 d-flex justify-content-end align-items-end pr-0">
                                    <div class="d-flex">
                                        <button class="btn btn-primary btn-sisp mr-2" id="btnLimparFiltros" style="background-color: #B22222; border-color: #B22222">
                                            <span class="fas fa-trash"></span> Limpar Filtros
                                        </button>
                                        <button id="btnConsultar" class="btn btn-primary btn-sisp" type="button">
                                            <span class="fas fa-search"></span> Consultar
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div id="modal-alterarpreco" class="modal" tabindex="-1" role="dialog">
        <div class="modal-dialog modal-xl" role="document">
            <div class="modal-content" id="modalBody">
                <div class="modal-header">
                    <h4 class="modal-title">Alterar Preço Promocional</h4>
                    <button class="btn btn-success btn-sisp ml-2" id="btnFiltrosPreco"><span class="fas fa-filter"></span> Filtros</button>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body" id="bodyPrincipal">
                    <ul id="progressbar" style="margin-left: 3px;">
                        <li class="active" id="account" style="font-size: 100%; width: 540px;"><strong style="padding-left: 252px;">Geral</strong></li>
                        <li id="payment" style="font-size: 100%; width: 540px;"><strong style="padding-left: 214px;">Tabelas de Preço</strong></li>
                    </ul>
                    <div class="row col-xl-12 col-12 mt-4">
                        <div class="form-group col-xl-2 col-12">
                            <label data-error="wrong" data-success="right" for="txtDataIni">Data Inicial *</label>
                            <div class="input-group">
                                <input type="date" max="2500-12-31" class="input-default focus form-control" id="txtDataIni" name="txtDataIni">
                            </div>
                        </div>
                        <div class="form-group col-xl-2 col-12">
                            <label data-error="wrong" data-success="right" for="txtDataFim">Data Final *</label>
                            <div class="input-group">
                                <input type="date" max="2500-12-31" class="input-default focus form-control" id="txtDataFim" name="txtDataFim">
                            </div>
                        </div>
                        <div class="form-group col-xl-2 col-12">
                            <label data-error="wrong" data-success="right" for="txtDescontoPreco">Desconto %</label>
                            <div class="input-group">
                                <input type="text" class="input-default focus form-control text-right" id="txtDescontoPreco" name="txtDescontoPreco" placeholder="Desconto %">
                            </div>
                        </div>
                        <div class="form-group col-xl-2 col-12 d-flex justify-content-start align-items-end">
                            <button class="btn btn-primary btn-sisp" id="btnConfirmarPreco"> Confirmar</button>
                        </div>
                        <div class="form-group col-xl-12 col-12 mt-4" id="tabelatuto">
                            <table id="tabelaAlterarPreco" class="table table-sm table-select table-hover">
                                <thead>
                                    <tr>
                                        <th>Tabela</th>
                                        <th class="d-none">CDProduto</th>
                                        <th class="d-none">DescProduto</th>
                                        <th>Item</th>
                                        <th>Coleção</th>
                                        <th>Data Inicial *</th>
                                        <th>Data Final *</th>
                                        <th>Prazo</th>
                                        <th>Estoque</th>
                                        <th>Preço Atual</th>
                                        <th>Preço Promocional</th>
                                        <th>Desconto %</th>
                                        <th>Valor Desconto</th>
                                        <th>Preço Final</th>
                                    </tr>
                                </thead>
                                <tbody>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="modal-body d-none" id="bodyTabelasPreco">
                    <ul id="progressbar" style="margin-left: 3px;">
                        <li class="active" id="account" style="font-size: 100%; width: 540px;"><strong style="padding-left: 252px;">Geral</strong></li>
                        <li class="active" id="payment" style="font-size: 100%; width: 540px;"><strong style="padding-left: 214px;">Tabelas de Preço</strong></li>
                    </ul>
                    <div class="row col-xl-12 col-12">
                        <div class="d-grid gap-3 col-xl-6 col-12">
                            <fieldset class="form-row border-Field mb-0 pb-0 col-xl-12 col-12">
                                <legend class="textoBorda mb-0 pb-0">Alterar Preço</legend>
                                <div class="form-group col-xl-4 col-12">
                                    <label data-error="wrong" data-success="right" for="txtPrecoAlterarPreco">Preço</label>
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control text-right" id="txtPrecoAlterarPreco" name="txtPrecoAlterarPreco" placeholder="0.00">
                                    </div>
                                </div>
                                <div class="form-group col-xl-4 col-12">
                                    <label data-error="wrong" data-success="right" for="txtPrecoAlterarPrecoSeg">Preço 2º qual.</label>
                                    <div class="input-group">
                                        <input type="text" class="input-default focus form-control text-right" id="txtPrecoAlterarPrecoSeg" name="txtPrecoAlterarPrecoSeg" placeholder="0.00">
                                    </div>
                                </div>
                                <div class="form-group col-xl-4 col-12 d-flex justify-content-center align-items-end">
                                    <button class="btn btn-danger btn-sisp" id="btnGravarAlterarPreco"> Gravar</button>
                                </div>
                            </fieldset>
                        </div>
                        <div class="col-xl-12 col-12" style="margin-top: 1%;" id="tabelatuto">
                            <label data-error="wrong" data-success="right" for="tabelaTabelasPreco" required="required">Tabelas de Preço</label>
                            <table id="tabelaTabelasPreco" class="table table-sm table-select table-hover">
                                <thead>
                                    <tr>
                                        <th>SEL</th>
                                        <th>Tabela de Preço</th>
                                    </tr>
                                </thead>
                                <tbody>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <div class="row">
                        <button class="btn btn-danger btn-sisp" id="btnLimparCamposAlterarPreco"><span class="fas fa-trash"></span> Limpar Campos</button>    
                        <button class="btn btn-danger btn-sisp" id="btnAvancar"> Avançar</button>
                        <button class="btn btn-danger btn-sisp d-none" style="background: #616161;border-color: #616161; margin-right: 10px;" id="btnVoltar"> Voltar</button>
                        <button class="btn btn-danger btn-sisp d-none" id="btnGravarPreco"> Gravar</button>
                    </div>
                </div>
            </div>
        </div>
    </div>


    <div id="modal-recalcular-preco" class="modal" tabindex="-1" role="dialog">
        <div class="modal-dialog modal-xl" role="document">
            <div class="modal-content" id="modalBody">
                <div class="modal-header">
                    <h4 class="modal-title">Recalcular Preço</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 col-xl-12 col-12 mt-4">
                        <div class="form-group col-xl-3 col-12">
                            <label data-error="wrong" data-success="right" for="txtRecalcularTabelaPreco">Tabela de Preço *</label>
                            <div class="input-group">
                                <input type="text" class="input-default focus form-control" id="txtRecalcularTabelaPreco" name="txtRecalcularTabelaPreco" placeholder="Tabela de Preço">
                                <div class="input-group-append">
                                    <button class="btn bg-danger" id="btnRecalcularTabelaPreco" name="btnRecalcularTabelaPreco" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                    <button class="btn bg-danger" id="btnRecalcularLimpaTabelaPreco"><i class="m-0 p-0 fas fa-trash"></i></button>
                                </div>
                            </div>
                        </div>
                        <div class="col-xl-9 col-12"></div>
                        <div class="form-group col-xl-2 col-12">
                            <label data-error="wrong" data-success="right" for="rgTipoItemRecalcularPreco">Tipo</label>
                            <select style="width:100%;" class="form-control select2 select2-danger focus" data-dropdown-css-class="select2-danger" id="rgTipoItemRecalcularPreco" class="custom-select focus">
                                <option value="0">0 - Produto</option>
                                <option value="1">1 - Material</option>
                            </select>
                        </div>
                        <div class="col-lg-8 col-12 form-group" id="ProdutoInfoTour">
                            <label id="labelRecalcularProdutoMaterial" data-error="wrong" data-success="right" for="txtRecalcularProdutoMaterial">Produto:</label>
                            <div class="input-group">
                                <select class="js-example-programmatic js-states form-control" id="txtRecalcularProdutoMaterial" name="txtRecalcularProdutoMaterial" multiple="multiple">
                                </select>
                                <div class="input-group-append">
                                    <button class="btn bg-danger" id="btnRecalcularProdutoMaterial" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                    <button class="btn bg-danger" id="btnRecalcularLimpaProdutoMaterial" name="btnRecalcularLimpaProdutoMaterial" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                </div>
                            </div>
                        </div>
                        <div class="form-group col-xl-2 col-12 d-flex justify-content-start align-items-end">
                            <button class="btn btn-primary btn-sisp" id="btnRecalcularConsultar"> Consultar</button>
                        </div>
                        <div class="col-xl-10 col-12"></div>
                        <div class="form-group col-xl-2 col-12">
                            <label data-error="wrong" data-success="right" for="txtRecalcularDescontoPreco">Desconto %</label>
                            <div class="input-group">
                                <input type="text" class="input-default focus form-control text-right" id="txtRecalcularDescontoPreco" name="txtRecalcularDescontoPreco" placeholder="Desconto %">
                                <button title="Aplicar desconto nos itens abaixo" id="btnRecalcularAplicarDesconto" type="button" class="btn btn-sm btn-danger"><i class="fas fa-check"></i></button>
                            </div>
                        </div>
                        <div class="col-xl-12 col-12 mt-4 table-responsive">
                            <table id="tabelaRecalcularPreco" class="table table-sm table-select table-hover">
                                <thead>
                                    <tr>
                                        <th>Tabela</th>
                                        <th>Desc. Tabela</th>
                                        <th>Código</th>
                                        <th>Descrição</th>
                                        <th>Preço antigo</th>
                                        <th>Preço novo</th>
                                    </tr>
                                </thead>
                                <tbody>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <div class="row">
                        <button class="btn btn-danger btn-sisp" id="btnRecalcularGravar"> Gravar</button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div id="modal-filtrosAlterarPreco" class="modal" tabindex="-1" role="dialog">
        <div class="modal-dialog modal-xl" role="document">
            <div class="modal-content" id="modalBody">
                <div class="modal-header">
                    <h4 class="modal-title">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 col-xl-12 col-12">
                        <div class="form-group col-xl-12 col-12">
                            <label data-error="wrong" data-success="right" for="txtTabelaPrecoAltera">Tabela de Preço *</label>
                            <div class="input-group">
                                <input type="text" class="input-default focus form-control" id="txtTabelaPrecoAltera" name="txtTabelaPrecoAltera" placeholder="Tabela de Preço">
                                <div class="input-group-append">
                                    <button class="btn bg-danger" id="btnTabelaPreco" name="btnTabelaPreco" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                    <button class="btn bg-danger" id="btnLimpaTabelaPreco"><i class="m-0 p-0 fas fa-trash"></i></button>
                                </div>
                            </div>
                        </div>
                        <div class="form-group col-xl-3 col-12">
                            <label data-error="wrong" data-success="right" for="txtTipoItemPreco">Tipo</label>
                            <select style="width:100%;" class="form-control select2 select2-danger focus" data-dropdown-css-class="select2-danger" id="rgTipoItemPreco" class="custom-select focus">
                                <option value="0">0 - Produto</option>
                                <option value="1">1 - Material</option>
                            </select>
                        </div>
                        <div class="form-group col-xl-6 col-12">
                            <label data-error="wrong" data-success="right" id="labelProdutoMaterial" for="txtProdutoMaterial">Produto</label>
                            <div class="input-group">
                                <input type="text" class="input-default focus form-control" id="txtProdutoMaterial" name="txtProdutoMaterial" placeholder="Produto">
                                <div class="input-group-append">
                                    <button class="btn bg-danger" id="btnProdutoMaterial" name="btnProdutoMaterial" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                    <button class="btn bg-danger" id="btnLimpaProdutoMaterial" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                </div>
                            </div>
                        </div>
                        <div class="form-group col-xl-3 col-12">
                            <label data-error="wrong" data-success="right" for="txtPrazoPreco">Prazo</label>
                            <div class="input-group">
                                <input type="text" class="input-default focus form-control" id="txtPrazoPreco" name="txtPrazoPreco" placeholder="Prazo">
                                <div class="input-group-append">
                                    <button class="btn bg-danger" id="btnPrazoPreco" name="btnPrazoPreco" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                    <button class="btn bg-danger" id="btnLimpaPrazoPreco" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                </div>
                            </div>
                        </div>
                        <div class="form-group col-xl-3 col-12">
                            <label data-error="wrong" data-success="right" for="txtColecaoPreco">Coleção</label>
                            <div class="input-group">
                                <input type="text" class="input-default focus form-control" id="txtColecaoPreco" name="txtColecaoPreco" placeholder="Coleção">
                                <div class="input-group-append">
                                    <button class="btn bg-danger" id="btnColecaoPreco" name="btnColecaoPreco" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                    <button class="btn bg-danger" id="btnLimpaColecaoPreco" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                </div>
                            </div>
                        </div>
                        <div class="form-group col-xl-3 col-12">
                            <label data-error="wrong" data-success="right" for="txtGrupoPreco">Grupo</label>
                            <div class="input-group">
                                <input type="text" class="input-default focus form-control" id="txtGrupoPreco" name="txtGrupoPreco" placeholder="Grupo">
                                <div class="input-group-append">
                                    <button class="btn bg-danger" id="btnGrupoPreco" name="btnGrupoPreco" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                    <button class="btn bg-danger" id="btnLimpaGrupoPreco" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                </div>
                            </div>
                        </div>
                        <div class="form-group col-xl-3 col-12">
                            <label data-error="wrong" data-success="right" for="txtMarcaPreco">Marca</label>
                            <div class="input-group">
                                <input type="text" class="input-default focus form-control" id="txtMarcaPreco" name="txtMarcaPreco" placeholder="Marca">
                                <div class="input-group-append">
                                    <button class="btn bg-danger" id="btnMarcaPreco" name="btnMarcaPreco" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                    <button class="btn bg-danger" id="btnLimpaMarcaPreco" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                </div>
                            </div>
                        </div>
                        <div class="form-group col-xl-3 col-12">
                            <label data-error="wrong" data-success="right" for="txtLinhaPreco">Linha</label>
                            <div class="input-group">
                                <input type="text" class="input-default focus form-control" id="txtLinhaPreco" name="txtLinhaPreco" placeholder="Linha">
                                <div class="input-group-append">
                                    <button class="btn bg-danger" id="btnLinhaPreco" name="btnLinhaPreco" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                    <button class="btn bg-danger" id="btnLimpaLinhaPreco" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <div class="row">     
                        <button class="btn btn-primary btn-sisp" id="btnConsultarPreco"><span class="fas fa-search"></span> Consultar</button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div id="modal-duplicar" 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">Duplicar Preços</h4>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="form-row col-xl-12 col-12">
                        <label data-error="wrong" data-success="right" for="txtNovaTabelaPreco">Tabela de Preço:</label>
                        <div class="input-group">
                            <input type="text" class="input-default focus form-control" id="txtNovaTabelaPreco" name="txtNovaTabelaPreco" placeholder="Tabela de Preço">
                            <div class="input-group-append">
                                <button class="btn bg-danger" id="btnNovaTabelaPreco" name="btnNovaTabelaPreco" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                <button class="btn bg-danger" id="btnLimpaNovaTabelaPreco" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer px-3">
                    <div class="row col-12 justify-content-start">
                        <button class="btn btn-primary btn-sisp" id="btnConfirmarDuplicar"> Confirmar</button>
                        <button class="btn bg-gradient-danger btn-sisp ml-auto" id="btnFecharDuplicar"> Fechar</button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div id="modal-importar" class="modal" tabindex="-1" role="dialog">
        <div class="modal-dialog modal-xl" role="document">
            <div class="modal-content" id="modalBody">
                <div class="modal-header">
                    <h4 class="modal-title">Duplicar Preços</h4>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="form-row col-xl-12 col-12">
                        <div class="form-group col-xl-3 col-6">
                            <label data-error="wrong" data-success="right" for="dtPromocaoIniImportar">Data Promoção de/até: </label>
                            <div class="input-group" style="gap: 8px">
                                <input type="date" max="2500-12-31" class="input-default focus form-control" id="dtPromocaoIniImportar" name="dtPromocaoIniImportar" class="form-control">
                                <input type="date" max="2500-12-31" class="input-default focus form-control" id="dtPromocaoFimImportar" name="dtPromocaoFimImportar" class="form-control">
                            </div>
                        </div>
                        <div class="form-group col-xl-2 col-6">
                            <label for="selectTipoImportar">Tipo:</label>
                            <select id="selectTipoImportar" class="input-default focus custom-select">
                                <option id="optionProduto" selected value="P">Produto</option>
                                <option id="optionMaterial" value="M">Material</option>
                            </select>
                        </div>
                        <div class="form-group col-xl-5 col-10">
                            <label data-error="wrong" data-success="right" for="txtArquivoImportar">Arquivo: </label>
                            <div class="input-group">
                                <input type="text" class="input-default focus form-control" id="txtArquivoImportar" name="txtArquivoImportar" placeholder="Arquivo" disabled>
                                <input type="file" id="mdModalUpload" class="d-none">
                                <div class="input-group-append">
                                    <button class="btn bg-danger" id="btnArquivoImportar" name="btnArquivoImportar" type="file" for="txtArquivoImportar"><i class="m-0 p-0 fas fa-folder-plus"></i> </button>
                                </div>
                            </div>
                        </div>
                        <div class="form-group col-xl-2 col-2 d-flex pr-0 justify-content-end align-items-end">
                            <button class="btn btn-primary w-100" style="max-width: 120px" id="btnCarregarImportar"> Carregar</button>
                        </div>
                        <div class="col-xl-12 col-12 table-responsive card-body">
                            <table id="tabelaImportar" class="table table-sm table-select table-hover" width="100%">
                                <thead>
                                </thead>
                                <tbody>
                                </tbody>
                            </table>
                        </div>
                        <div class="d-none">
                            <pre id="fileContent"></pre>
                        </div>
                    </div>
                </div>
                <div class="modal-footer px-3">
                    <div class="row col-12 justify-content-start">
                        <button class="btn btn-primary btn-sisp" id="btnConfirmarImportar"> Confirmar</button>
                        <button class="btn bg-gradient-danger btn-sisp ml-auto" id="btnFecharImportar"> Fechar</button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <?php
    include_once('../../../modais.php');
    ?>
    <aside class="control-sidebar control-sidebar-dark">
    </aside>
    </div>
    <script src="plugins/jquery/jquery.min.js?versao=3.264.22.1"></script>
    <script type="text/javascript" src="dist/js/jquery.dataTables.js?versao=3.264.22.1"></script>
    <script type="text/javascript" src="dist/js/dataTables.bootstrap4.min.js?versao=3.264.22.1"></script>
    <script src="plugins/jquery-ui/jquery-ui.min.js?versao=3.264.22.1"></script>
    <script>
        $.widget.bridge('uibutton', $.ui.button);
    </script>
    <script src="plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.264.22.1"></script>
    <script src="dist/js/adminlte.min.js?versao=3.264.22.1"></script>
    <script src="plugins/jquery-validation/jquery.validate.min.js?versao=3.264.22.1"></script>
    <script src="dist/js/sisplan.js?versao=3.264.22.1"></script>
    <script src="utils/funcoes.js?versao=3.264.22.1"></script>
    <script src="utils/cookies.js?versao=3.264.22.1"></script>
    <script src="dist/js/requisicoes.js?versao=3.264.22.1"></script>
    <script src="dist/js/loadingoverlay.min.js?versao=3.264.22.1"></script>
    <script src="dist/js/driver.min.js?versao=3.264.22.1"></script>
    <script src="plugins/toastr/toastr.min.js?versao=3.264.22.1"></script>
    <script type="text/javascript" src="dist/js/sum().js?versao=3.264.22.1"></script>
    <script type="text/javascript" src="config.js?versao=3.264.22.1"></script>
    <script src="dist/js/jquery.maskMoney.min.js?versao=3.264.22.1"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.8.0/jszip.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.8.0/xlsx.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.17.4/xlsx.full.min.js"></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('TABELAPRECO');
            if (!temAcesso.resultado) {
                toastrAcesso(temAcesso, BASE_URI);
                return;
            }

            sArquivo = `${BASE_URI}/pages/preco/acesso_preco/acesso_preco.js?versao=3.264.22.1`;
            insereJavaScriptPagina(sArquivo);

        });
    </script>
</body>

</html>