<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>Sisplan Web | Cadastro de Markup</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css?versao=3.2512.9.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.2512.9.1" />
  <link href='dist/css/bootstrap.min.css?versao=3.2512.9.1'>
  <link rel="stylesheet" href="../dist/css/adminlte.min.css?versao=3.2512.9.1">
  <link rel="stylesheet" href="../dist/css/custom.css?versao=3.2512.9.1">
  <link rel="stylesheet" href="../dist/css/sisplan.css?versao=3.2512.9.1">
  <link rel="stylesheet" type="text/css" href="../dist/css/responsive.bootstrap.min.css?versao=3.2512.9.1">
  <link rel="stylesheet" type="text/css" href="../plugins/datatables-keytable/css/keyTable.bootstrap4.min.css?versao=3.2512.9.1">
  <link rel="shortcut icon" href="../favicon.ico">
  <link rel="stylesheet" href="../plugins/toastr/toastr.min.css?versao=3.2512.9.1">
  <link rel="stylesheet" type="text/css" href="../dist/css/driver.min.css?versao=3.2512.9.1" />
  <link rel="stylesheet" href="../dist/css/jquery-ui.css?versao=3.2512.9.1">
  <link rel="stylesheet" href="../dist/css/cadastro.css?versao=3.2512.9.1">
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">

  <link rel="stylesheet" href="../plugins/icheck-bootstrap/icheck-bootstrap.min.css?versao=3.2512.9.1">

</head>
<style>
  .frete {
    margin-top: 2%;
    margin-left: 0.1%;
  }

  fieldset {
    text-align: start;
    position: relative;
  }

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

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

  .border-Field {
    border: 1px 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;
  }

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

  .card {
    box-shadow: none !important;
    border-radius: 0 !important;
    margin-bottom: 0 !important;
  }

  .card-header {
    box-shadow: 0px 1px rgb(0 0 0 / 20%) !important;
  }

  .card.card-header {
    border-bottom: 1px dashed #ddd;
    box-shadow: none !important;
  }

  .card-body {
    padding-left: 1.25rem !important;
    padding-top: 0px;
    padding-bottom: 0px;
    padding-right: 1.25rem !important;
  }

  .fa-angle-right,
  .fa-angle-down {
    color: #343a40;
  }

  .header-content-page .title-page,
  .title-content-page .title,
  .title-page {
    font-size: 20px;
    line-height: normal;
    font-weight: 500;
    color: var(--font-color);
    margin: 0;
    font-family: Roboto, Arial, sans-serif;
  }

  #formcard2 {
    padding-left: 0px !important;
    padding-right: 0px !important;
    margin-left: 0px !important;
    margin-left: 0px !important;
    width: 100% !important;
  }

  #tabelaIndiceMarkup tbody tr td {
    padding: .1rem;
  }

  .inputCurrencyPrazos {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
  }
</style>

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


    <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 px-2">
          <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="../cadmarkup">Acesso Markup</a></li>
                  <li class="breadcrumb-item active">Cadastro de Markup</li>
                </ol> -->
              </div><!-- /.col -->
            </div><!-- /.row -->
          </div>
          <div class="row justify-content-center mt-0">
            <div class="col-12 text-center p-0">
              <div class="card px-0 pt-2 pb-0">
                <div class="card-header text-center flex py-0" style="border: none!important;box-shadow:none!important;">
                  <h2>Cadastro de Markup
                    <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>
                  </h2>
                </div>
                <div class="row">
                  <div class="col-12 px-0 mx-0">
                    <form id="msform" class="m-0 p-0">
                      <fieldset>
                        <div class="pb-0 mb-0" id="formcard1">
                          <div class="card-body pt-0">
                            <div class="form-row col-12" id="divGeral">
                              <div class="col-xl-6 col-12">
                                <div class="flex flex-wrap">
                                  <div class="form-group col-3" id="codigoInfoTour">
                                    <label for="txtCodigoMarkup">Código: *</label>
                                    <input type="text" class="input-default focus form-control" maxlength="8" aria-describedby="ufError" required id="txtCodigoMarkup" name="txtCodigoMarkup" class="form-control" placeholder="Código">
                                  </div>
                                  <div class="form-group col-9" id="codigoInfoTour">
                                    <label for="txtDescricaoMarkup">Descrição: *</label>
                                    <input type="text" class="input-default focus form-control" aria-describedby="ufError" required id="txtDescricaoMarkup" name="txtDescricaoMarkup" class="form-control" placeholder="Descrição">
                                  </div>
                                  <div class="form-group col-xl-6 col-12">
                                    <label for="txtDescricao">Cliente Referência:</label>
                                    <div class="input-group">
                                      <input type="text" class="input-default focus form-control" aria-describedby="ufError" id="txtClienteRef" name="txtClienteRef" class="form-control" placeholder="Cliente">
                                      <div class="input-group-append">
                                        <button class="btn bg-danger" id="btnClienteRef" name="btnClienteRef" data-button="absolute" type="button">
                                          <i class="m-0 p-0 fas fa-search"></i>
                                        </button>
                                        <button class="btn bg-danger" id="btnLimpaClienteRef" type="button">
                                          <i class="m-0 p-0 fas fa-trash"></i>
                                        </button>
                                      </div>
                                    </div>
                                  </div>
                                  <div class="form-group col-xl-6 col-12">
                                    <label for="txtDescricao">Representante Referência:</label>
                                    <div class="input-group">
                                      <input type="text" class="input-default focus form-control" aria-describedby="ufError" id="txtRepresentanteRef" name="txtRepresentanteRef" class="form-control" placeholder="Representante">
                                      <div class="input-group-append">
                                        <button class="btn bg-danger" id="btnRepresentanteRef" name="btnRepresentanteRef" data-button="absolute" type="button">
                                          <i class="m-0 p-0 fas fa-search"></i>
                                        </button>
                                        <button class="btn bg-danger" id="btnLimpaRepresentanteRef" type="button">
                                          <i class="m-0 p-0 fas fa-trash"></i>
                                        </button>
                                      </div>
                                    </div>
                                  </div>
                                  <div class="form-group col-3">
                                    <label for="txtJuros">Juros:</label>
                                    <div class="input-group">
                                      <input type="text" class="input-default focus form-control text-right duasCasasDecimaisCurrencyFormat" aria-describedby="ufError" id="txtJuros" name="txtJuros" class="form-control" placeholder="0,00">
                                    </div>
                                  </div>
                                  <div class="form-group col-3">
                                    <label for="txtDiasPadrao">Dias Padrão:</label>
                                    <div class="input-group">
                                      <input type="text" class="input-default focus form-control text-right" aria-describedby="ufError" id="txtDiasPadrao" name="txtDiasPadrao" class="form-control" placeholder="0">
                                    </div>
                                  </div>
                                  <div class="form-group col-3">
                                    <label for="txtQuebra">Quebra:</label>
                                    <div class="input-group">
                                      <input type="text" class="input-default focus form-control text-right duasCasasDecimaisCurrencyFormat" aria-describedby="ufError" id="txtQuebra" name="txtQuebra" class="form-control" placeholder="0,00">
                                    </div>
                                  </div>
                                  <div class="form-group col-3">
                                    <label for="txtFrete">Frete:</label>
                                    <div class="input-group">
                                      <input type="text" class="input-default focus form-control text-right duasCasasDecimaisCurrencyFormat" aria-describedby="ufError" id="txtFrete" name="txtFrete" class="form-control" placeholder="0,00">
                                    </div>
                                  </div>
                                  <div class="form-group col-12" id="ObservacaoInfoTour">
                                    <label data-error="wrong" data-success="right" for="txtObservacao">Observação:</label>
                                    <div class="input-group">
                                      <textarea style="resize: none" id="txtObservacao" maxlength="1000" placeholder="Observação" class="input-default focus form-control" rows="2"></textarea>
                                    </div>
                                  </div>
                                  <div class="col-12 flex align-items-center justify-content-start">
                                    <div class="icheck-primary">
                                      <input type="checkbox" class="form-check-input" id="cbPadraoMarkup">
                                      <label class="form-check-label pr-2" for="cbPadraoMarkup">Padrão Markup</label>
                                    </div>
                                    <div class="icheck-primary">
                                      <input type="checkbox" class="form-check-input" id="cbConsumidorFinal">
                                      <label class="form-check-label pr-2" for="cbConsumidorFinal">Consumidor Final</label>
                                    </div>
                                    <div class="icheck-primary">
                                      <input type="checkbox" class="form-check-input" id="cbAtivo">
                                      <label class="form-check-label" for="cbAtivo">Ativo</label>
                                    </div>
                                  </div>
                                </div>
                              </div>
                              <div class="bordaProduto" style="max-width: 40%!important">
                                <h5 class="ml-2 text-bold">Prazos</h5>
                                <div class="form-row col-12 form mt-2 justify-content-center">
                                  <div class="col-12 flex justify-content-end" style="gap: 5px">
                                    <div class="flex flex-wrap">
                                      <div class="col-12 pb-1">
                                        <div class="input-group">
                                          <label for="txtPrazo1" class="mr-2">1º Prazo:</label>
                                          <input type="text" class="input-default focus form-control text-right cPrazo inputCurrencyPrazos" aria-describedby="ufError" id="txtPrazo1" name="txtPrazo1" class="form-control" placeholder="0,00">
                                        </div>
                                      </div>
                                      <div class="col-12 pb-1">
                                        <div class="input-group">
                                          <label for="txtPrazo2" class="mr-2">2º Prazo:</label>
                                          <input type="text" class="input-default focus form-control text-right cPrazo inputCurrencyPrazos" aria-describedby="ufError" id="txtPrazo2" name="txtPrazo2" class="form-control" placeholder="0,00">
                                        </div>
                                      </div>
                                      <div class="col-12 pb-1">
                                        <div class="input-group">
                                          <label for="txtPrazo3" class="mr-2">3º Prazo:</label>
                                          <input type="text" class="input-default focus form-control text-right cPrazo inputCurrencyPrazos" aria-describedby="ufError" id="txtPrazo3" name="txtPrazo3" class="form-control" placeholder="0,00">
                                        </div>
                                      </div>
                                      <div class="col-12 pb-1">
                                        <div class="input-group">
                                          <label for="txtPrazo4" class="mr-2">4º Prazo:</label>
                                          <input type="text" class="input-default focus form-control text-right cPrazo inputCurrencyPrazos" aria-describedby="ufError" id="txtPrazo4" name="txtPrazo4" class="form-control" placeholder="0,00">
                                        </div>
                                      </div>
                                      <div class="col-12 pb-1">
                                        <div class="input-group">
                                          <label for="txtPrazo5" class="mr-2">5º Prazo:</label>
                                          <input type="text" class="input-default focus form-control text-right cPrazo inputCurrencyPrazos" aria-describedby="ufError" id="txtPrazo5" name="txtPrazo5" class="form-control" placeholder="0,00">
                                        </div>
                                      </div>
                                      <div class="col-12 pb-1">
                                        <div class="input-group">
                                          <label for="txtPrazo6" class="mr-2">6º Prazo:</label>
                                          <input type="text" class="input-default focus form-control text-right cPrazo inputCurrencyPrazos" aria-describedby="ufError" id="txtPrazo6" name="txtPrazo6" class="form-control" placeholder="0,00">
                                        </div>
                                      </div>
                                      <div class="col-12 pb-1">
                                        <div class="input-group">
                                          <label for="txtPrazo7" class="mr-2">7º Prazo:</label>
                                          <input type="text" class="input-default focus form-control text-right cPrazo inputCurrencyPrazos" aria-describedby="ufError" id="txtPrazo7" name="txtPrazo7" class="form-control" placeholder="0,00">
                                        </div>
                                      </div>
                                    </div>
                                    <div class="flex flex-wrap">
                                      <div class="col-12 pb-1">
                                        <div class="input-group">
                                          <label for="txtComissao1" class="mr-2">1º Comissão:</label>
                                          <input type="text" class="input-default focus form-control text-right duasCasasDecimaisCurrencyFormat inputCurrencyPrazos" aria-describedby="ufError" id="txtComissao1" name="txtComissao1" class="form-control" placeholder="0,00">
                                        </div>
                                      </div>
                                      <div class="col-12 pb-1">
                                        <div class="input-group">
                                          <label for="txtComissao2" class="mr-2">2º Comissão:</label>
                                          <input type="text" class="input-default focus form-control text-right duasCasasDecimaisCurrencyFormat inputCurrencyPrazos" aria-describedby="ufError" id="txtComissao2" name="txtComissao2" class="form-control" placeholder="0,00">
                                        </div>
                                      </div>
                                      <div class="col-12 pb-1">
                                        <div class="input-group">
                                          <label for="txtComissao3" class="mr-2">3º Comissão:</label>
                                          <input type="text" class="input-default focus form-control text-right duasCasasDecimaisCurrencyFormat inputCurrencyPrazos" aria-describedby="ufError" id="txtComissao3" name="txtComissao3" class="form-control" placeholder="0,00">
                                        </div>
                                      </div>
                                      <div class="col-12 pb-1">
                                        <div class="input-group">
                                          <label for="txtComissao4" class="mr-2">4º Comissão:</label>
                                          <input type="text" class="input-default focus form-control text-right duasCasasDecimaisCurrencyFormat inputCurrencyPrazos" aria-describedby="ufError" id="txtComissao4" name="txtComissao4" class="form-control" placeholder="0,00">
                                        </div>
                                      </div>
                                      <div class="col-12 pb-1">
                                        <div class="input-group">
                                          <label for="txtComissao5" class="mr-2">5º Comissão:</label>
                                          <input type="text" class="input-default focus form-control text-right duasCasasDecimaisCurrencyFormat inputCurrencyPrazos" aria-describedby="ufError" id="txtComissao5" name="txtComissao5" class="form-control" placeholder="0,00">
                                        </div>
                                      </div>
                                      <div class="col-12 pb-1">
                                        <div class="input-group">
                                          <label for="txtComissao6" class="mr-2">6º Comissão:</label>
                                          <input type="text" class="input-default focus form-control text-right duasCasasDecimaisCurrencyFormat inputCurrencyPrazos" aria-describedby="ufError" id="txtComissao6" name="txtComissao6" class="form-control" placeholder="0,00">
                                        </div>
                                      </div>
                                    </div>
                                    <div class="flex flex-wrap">
                                      <div class="col-12 pb-1">
                                        <div class="input-group">
                                          <label for="txtMargem1" class="mr-2">1º Margem:</label>
                                          <input type="text" class="input-default focus form-control text-right duasCasasDecimaisCurrencyFormat inputCurrencyPrazos" aria-describedby="ufError" id="txtMargem1" name="txtMargem1" class="form-control" placeholder="0,00">
                                        </div>
                                      </div>
                                      <div class="col-12 pb-1">
                                        <div class="input-group">
                                          <label for="txtMargem2" class="mr-2">2º Margem:</label>
                                          <input type="text" class="input-default focus form-control text-right duasCasasDecimaisCurrencyFormat inputCurrencyPrazos" aria-describedby="ufError" id="txtMargem2" name="txtMargem2" class="form-control" placeholder="0,00">
                                        </div>
                                      </div>
                                      <div class="col-12 pb-1">
                                        <div class="input-group">
                                          <label for="txtMargem3" class="mr-2">3º Margem:</label>
                                          <input type="text" class="input-default focus form-control text-right duasCasasDecimaisCurrencyFormat inputCurrencyPrazos" aria-describedby="ufError" id="txtMargem3" name="txtMargem3" class="form-control" placeholder="0,00">
                                        </div>
                                      </div>
                                      <div class="col-12 pb-1">
                                        <div class="input-group">
                                          <label for="txtMargem4" class="mr-2">4º Margem:</label>
                                          <input type="text" class="input-default focus form-control text-right duasCasasDecimaisCurrencyFormat inputCurrencyPrazos" aria-describedby="ufError" id="txtMargem4" name="txtMargem4" class="form-control" placeholder="0,00">
                                        </div>
                                      </div>
                                      <div class="col-12 pb-1">
                                        <div class="input-group">
                                          <label for="txtMargem5" class="mr-2">5º Margem:</label>
                                          <input type="text" class="input-default focus form-control text-right duasCasasDecimaisCurrencyFormat inputCurrencyPrazos" aria-describedby="ufError" id="txtMargem5" name="txtMargem5" class="form-control" placeholder="0,00">
                                        </div>
                                      </div>
                                      <div class="col-12 pb-1">
                                        <div class="input-group">
                                          <label for="txtMargem6" class="mr-2">6º Margem:</label>
                                          <input type="text" class="input-default focus form-control text-right duasCasasDecimaisCurrencyFormat inputCurrencyPrazos" aria-describedby="ufError" id="txtMargem6" name="txtMargem6" class="form-control" placeholder="0,00">
                                        </div>
                                      </div>
                                      <div class="col-12 pb-1">
                                        <div class="input-group">
                                          <label for="txtMargem7" class="mr-2">7º Margem:</label>
                                          <input type="text" class="input-default focus form-control text-right duasCasasDecimaisCurrencyFormat inputCurrencyPrazos" aria-describedby="ufError" id="txtMargem7" name="txtMargem7" class="form-control" placeholder="0,00">
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                            <div class="card-body">
                              <div class="card card-header" role="tab">
                                <a style="width:100%;" id="dadosIndices" data-toggle="collapse" data-parent="#multiCollapseExample3" href="#multiCollapseExample3" aria-expanded="true" aria-controls="collapseOne2">
                                  <div class="row">
                                    <div style="max-width:20px;margin-top:auto; margin-bottom: auto" class="col-1">
                                      <i class="fas fa-angle-down"></i>
                                    </div>
                                    <div class="col-11">
                                      <h4 class="title-page">
                                        Índices
                                      </h4>
                                    </div>
                                  </div>
                                </a>
                              </div>
                              <div class="collapse show" id="multiCollapseExample3">
                                <div class="card">
                                  <div class="tab-pane fade show active" role="tabpanel" aria-labelledby="geral-tab">
                                    <div class="form-row px-2" id="divBusca">
                                      <div class="col-md-12 col-12 mt-2">
                                        <div class="flex flex-wrap align-items-center" style="gap: 10px">
                                          <div class="col-2 px-1">
                                            <div class="relative">
                                              <select id="selectTipoIndiceMarkup" class="input-default focus form-control validate" name="selectTipoIndiceMarkup">
                                              </select>
                                            </div>
                                          </div>
                                          <div style="margin-left: -8px!important">
                                            <button id="btnAbreCadIndice" style="font-size:15px" type="button" class="btn btn-lg btn-secondary focus py-1 px-2" title="Manutenção de índices">
                                              <span><i class="fas fa-solid fa-check"></i></span>
                                            </button>
                                          </div>
                                          <div>
                                            <div class="relative input-group">
                                              <label for="selectIndicePercentualMarkup" class="mr-2">Índice %:</label>
                                              <select id="selectIndicePercentualMarkup" class="input-default focus form-control validate" name="selectIndicePercentualMarkup">
                                                <option value="S" selected>Sim</option>
                                                <option value="N">Não</option>
                                              </select>
                                            </div>
                                          </div>
                                          <div class="">
                                            <button class="btn bg-danger btn-block" id="btnRemoverIndice" name="btnRemoverIndice" data-button="absolute" type="button" style="min-width: 100px">
                                              <label class="m-0 p-0">Remover</label>
                                            </button>
                                          </div>
                                          <div class="">
                                            <button class="btn bg-danger btn-block" id="btnIncluirIndiceMarkup" name="btnIncluirIndiceMarkup" data-button="absolute" type="button" style="min-width: 100px">
                                              <label class="m-0 p-0">Incluir</label>
                                            </button>
                                          </div>
                                        </div>
                                      </div>
                                      <div class="col-md-12 col-12 table-responsive" style="max-height: 500px">
                                        <table id="tabelaIndiceMarkup" class="table table-sm table-hover table-select table-condensed">
                                          <thead>
                                            <tr>
                                              <th>Código</th>
                                              <th>Descrição</th>
                                              <th>Nacional</th>
                                              <th>Exportação</th>
                                              <th>Tipo</th>
                                              <th>Índice %</th>
                                            </tr>
                                          </thead>
                                          <tbody>
                                          </tbody>
                                        </table>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                                <div class="flex w-100 justify-content-center">
                                  <div class="form-group col-2" id="codigoInfoTour">
                                    <label for="txtTotalNacional">Total Nacional:</label>
                                    <input type="text" class="input-default focus form-control text-right" disabled aria-describedby="ufError" id="txtTotalNacional" name="txtTotalNacional" class="form-control" placeholder="0,00" style="max-width: 120px">
                                  </div>
                                  <div class="form-group col-2" id="codigoInfoTour">
                                    <label for="txtTotalExportacao">Total Exportação:</label>
                                    <input type="text" class="input-default focus form-control text-right" disabled aria-describedby="ufError" id="txtTotalExportacao" name="txtTotalExportacao" class="form-control" placeholder="0,00" style="max-width: 120px">
                                  </div>
                                </div>
                              </div>
                            </div>
                            <div class="card-body">
                              <div class="card card-header" role="tab">
                                <a style="width:100%;" data-toggle="collapse" data-parent="#multiCollapseExample4" href="#multiCollapseExample4" aria-expanded="true" aria-controls="collapseOne2">
                                  <div class="row">
                                    <div style="max-width:20px;margin-top:auto; margin-bottom: auto" class="col-1">
                                      <i class="fas fa-angle-down"></i>
                                    </div>
                                    <div class="col-11">
                                      <h4 class="title-page">
                                        Vínculos
                                      </h4>
                                    </div>
                                  </div>
                                </a>
                              </div>
                              <div class="collapse" id="multiCollapseExample4">
                                <div class="card">
                                  <div class="tab-pane fade show active" role="tabpanel" aria-labelledby="geral-tab">
                                    <div class="form">
                                      <label for="divBusca">Vincular Grupo de Produto</label>
                                      <div class="form-row bordaProduto" id="divBusca">
                                        <div class="col-md-12 col-12">
                                          <div class="row">
                                            <div class="form-group col-md-4 col-4">
                                              <label for="txtGrupoProduto">Grupo Produto :</label>
                                              <div class="input-group">
                                                <input type="text" class="input-default focus form-control" aria-describedby="ufError" id="txtGrupoProduto" name="txtGrupoProduto" class="form-control" placeholder="Grupo Produto">
                                                <div class="input-group-append">
                                                  <button class="btn bg-danger" id="btnGrupoProduto" name="btnGrupoProduto" data-button="absolute" type="button">
                                                    <i class="m-0 p-0 fas fa-search"></i>
                                                  </button>
                                                  <button class="btn bg-danger" id="btnLimpaGrupoProduto" type="button">
                                                    <i class="m-0 p-0 fas fa-trash "></i>
                                                  </button>
                                                </div>
                                              </div>
                                            </div>
                                            <div class="form-group col-md-2 col-2">
                                              <label for="txtQtdeDe">De :</label>
                                              <div class="input-group">
                                                <input type="text" class="input-default focus form-control" aria-describedby="ufError" id="txtQtdeDe" name="txtQtdeDe" class="form-control" placeholder="De">
                                              </div>
                                            </div>
                                            <div class="form-group col-md-2 col-2">
                                              <label for="txtQtdeAte">Até :</label>
                                              <div class="input-group">
                                                <input type="text" class="input-default focus form-control" aria-describedby="ufError" id="txtQtdeAte" name="txtQtdeAte" class="form-control" placeholder="Até">
                                              </div>
                                            </div>
                                            <div class="col-12 col-lg-2 mt-4">
                                              <button class="btn bg-danger btn-block mt-1" id="btnRemoverGrupoProduto" name="btnRemoverGrupoProduto" data-button="absolute" type="button">
                                                <label class="m-0 p-0">Remover</label>
                                              </button>
                                            </div>
                                            <div class="col-12 col-lg-2 mt-4">
                                              <button class="btn bg-danger btn-block mt-1" id="btnIncluirGrupoProduto" name="btnIncluirGrupoProduto" data-button="absolute" type="button">
                                                <label class="m-0 p-0">Incluir</label>
                                              </button>
                                            </div>
                                          </div>
                                        </div>
                                        <div class="col-md-12 col-12 table-responsive">
                                          <table id="tabelaGrupoProduto" class="table table-sm table-hover table-select table-condensed">
                                            <thead>
                                              <tr>
                                                <th>Markup</th>
                                                <th>Grupo</th>
                                                <th>Desc_Grupo</th>
                                                <th>Qtde_De</th>
                                                <th>Qtde_Ate</th>
                                              </tr>
                                            </thead>
                                            <tbody>
                                            </tbody>
                                          </table>
                                        </div>
                                      </div>
                                      <label for="divBusca">Vincular Estados</label>
                                      <div class="form-row bordaProduto p-0" id="divBusca">
                                        <div class="col-md-12 col-12 table-responsive" style="max-height: 150px">
                                          <table id="tabelaEstados" class="table table-sm table-hover table-select table-condensed">
                                            <thead>
                                              <tr>
                                                <th>SEL</th>
                                                <th>Estado</th>
                                              </tr>
                                            </thead>
                                            <tbody>
                                            </tbody>
                                          </table>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                          <!-- <label for="divBusca" style="margin-top: 25px;">Usuário para Orçamento</label>
                        <div class="form-row bordaProduto p-0" id="divBusca">
                          <div class="col-md-12 col-12 table-responsive" style="transform: translateY(-7px)">
                            <table id="tabelaOrcamento" class="table table-sm table-hover table-select table-condensed">
                              <thead>
                                <tr>
                                  <th>Ação</th>
                                  <th>Código</th>
                                  <th>Nome</th>
                                </tr>
                              </thead>
                              <tbody>
                              </tbody>
                            </table>
                            <button id="btnAbrirOrcamento" style="font-size: 15px;" type="button" class="btn btn-lg btn-secondary float-right focus">
                              Adicionar
                            </button>
                          </div>
                        </div> -->
                          <!-- <input type="button" name="avancar1" class="btn-sisp next action-button" value="Avançar" id="avancar1" /> -->
                          <div class="flex mr-4 justify-content-end">
                            <button type="button" id="btnVoltar" style="font-size:15px;" class="btn-sisp action-button-previous" data-dismiss="modal">Voltar</button>
                            <button type="button" class="btn-sisp next action-button" id="btnGravarMarkup">Gravar</button>
                          </div>
                      </fieldset>
                      <!-- <fieldset>
                        <div class="form-card pt-0">
                          <label for="divBusca">Vincular Índices</label>
                          <div class="col-sm-12 bordaProduto pb-0">
                            <div class="form-row" id="divBusca">
                              <div class="col-md-12 col-12">
                                <div class="row">
                                  <div class="col-5 col-md-5 ml-2 px-1">
                                    <div class="relative">
                                      <select id="selectTipoIndiceMarkup" class="input-default focus form-control validate" name="selectTipoIndiceMarkup">
                                      </select>
                                    </div>
                                  </div>
                                  <button id="btnAbreCadIndice" style="font-size:15px" type="button" class="btn btn-lg btn-secondary focus ml-3">
                                    Cadastro de Índice
                                  </button>
                                  <div class="col-12 col-lg-2 ml-3">
                                    <button class="btn bg-danger btn-block" id="btnRemoverIndice" name="btnRemoverIndice" data-button="absolute" type="button">
                                      <label class="m-0 p-0">Remover</label>
                                    </button>
                                  </div>
                                  <div class="col-12 col-lg-2 ml-3">
                                    <button class="btn bg-danger btn-block" id="btnIncluirIndiceMarkup" name="btnIncluirIndiceMarkup" data-button="absolute" type="button">
                                      <label class="m-0 p-0">Incluir</label>
                                    </button>
                                  </div>
                                </div>
                              </div>
                              <div class="col-md-12 col-12 table-responsive">
                                <table id="tabelaIndiceMarkup" class="table table-sm table-hover table-select table-condensed">
                                  <thead>
                                    <tr>
                                      <th>Código</th>
                                      <th>Descrição</th>
                                      <th>Nacional</th>
                                      <th>Exportação</th>
                                      <th>Tipo</th>
                                    </tr>
                                  </thead>
                                  <tbody>
                                  </tbody>
                                </table>
                              </div>
                            </div>
                          </div>
                          <label for="divBusca" style="margin-top: 25px;">Usuário para Orçamento</label>
                          <div class="form-row bordaProduto p-0" id="divBusca">
                            <div class="col-md-12 col-12 table-responsive" style="transform: translateY(-7px)">
                              <table id="tabelaOrcamento" class="table table-sm table-hover table-select table-condensed">
                                <thead>
                                  <tr>
                                    <th>Ação</th>
                                    <th>Código</th>
                                    <th>Nome</th>
                                  </tr>
                                </thead>
                                <tbody>
                                </tbody>
                              </table>
                              <button id="btnAbrirOrcamento" style="font-size: 15px;" type="button" class="btn btn-lg btn-secondary float-right focus">
                                Adicionar
                              </button>
                            </div>
                          </div>
                        </div>
                        <input type="button" name="avancar2" class="next action-button" value="Avançar" id="avancar2" />
                        <input type="button" name="voltar" class="previous action-button-previous" value="Voltar" id="voltar" />
                      </fieldset> -->
                    </form>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </section>
    </div>
  </div>
  </div>
  <div class="modal fade" id="modalOrcamento" tabindex="-1" role="dialog" aria-labelledby="modalOrcamento" aria-hidden="true">
    <div class="modal-dialog modal-lg">
      <div class="modal-content">
        <div class="modal-header">
          <h4 id="modalOrcamento-titulo" class="modal-title">Adicionar Usuários para Orcamento</h4>
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body p-4">
          <div class="col-sm-12">
            <div class="row">
              <div class="form-group col-md-12 col-12">
                <label for="txtUsuarioOrc">Usuário:</label>
                <div class="input-group">
                  <input type="text" class="input-default focus form-control" aria-describedby="ufError" id="txtUsuarioOrc" name="txtUsuarioOrc" class="form-control" placeholder="Usuário">
                  <div class="input-group-append">
                    <button class="btn bg-danger" id="btnUsuarioOrc" name="btnUsuarioOric" data-button="absolute" type="button">
                      <i class="m-0 p-0 fas fa-search"></i>
                    </button>
                    <button class="btn bg-danger" id="btnLimpaUsuarioOrc" type="button">
                      <i class="m-0 p-0 fas fa-trash"></i>
                    </button>
                  </div>
                </div>
                <div class="col-sm-4">
                  <input type="text" class="input-default focus form-control d-none" id="txtTrIndex" name="txtTrIndex" class="form-control" value="" placeholder="index">
                </div>
              </div>
              <div class="col-sm-12" style="margin-top:5px">
                <button id="btnConfirmaUsuario" type="button" class="btn btn-primary btn-block mt-2">
                  Confirmar
                </button>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>


  <!-- >>>>>>>>>>>>>>>>>>>>>>>>>>TRIBUTACAO<<<<<<<<<<<<<<<<<<<<<<<<<<< -->


  <!-- <div class="tab-content" id="nav-tabContent">
    <div class="tab-pane fade active d-none" id="divCadTributacao" role="tabpanel" aria-labelledby="divCadTributacao">
      <div class="card-body" style="padding-left: 0rem!important; padding-right: 0rem!important;">
        <div class="card card-body" style="padding-top: 10px; padding-bottom: 15px;">
          <div class="tab-pane fade show active bordaProduto" role="tabpanel" aria-labelledby="dados-tab">
            <div class="col-md-8 col-8">
              <fieldset class="form border-Field mb-0 pb-0">
                <legend class="textoBorda mb-0 pb-0">Índices</legend>
                <div class="row">
                  <div class="col-6 col-lg-6 d-none">
                    <label for="txtId">Id:</label>
                    <div class="input-group">
                      <input type="number" class="input-default focus form-control" aria-describedby="ufError" id="txtId" name="txtId" class="form-control">
                    </div>
                  </div>
                  <div class="col-6 col-lg-6">
                    <label for="txtDolar">Dólar:</label>
                    <div class="input-group">
                      <input type="number" class="input-default focus form-control controlaEdicaoTrib" aria-describedby="ufError" disabled readonly id="txtDolar" name="txtDolar" class="form-control" placeholder="Dólar">
                      <div class="input-group-append">
                        <button class="btn bg-danger controlaEdicaoTrib" disabled readonly id="btnLimpaDolar" type="button">
                          <i class="m-0 p-0 fas fa-trash"></i>
                        </button>
                      </div>
                    </div>
                  </div>
                  <div class="col-6 col-lg-6">
                    <label for="txtEuro">Euro:</label>
                    <div class="input-group">
                      <input type="number" class="input-default focus form-control controlaEdicaoTrib" aria-describedby="ufError" disabled readonly id="txtEuro" name="txtEuro" class="form-control" placeholder="Euro">
                      <div class="input-group-append">
                        <button class="btn bg-danger controlaEdicaoTrib" disabled readonly id="btnLimpaEuro" type="button">
                          <i class="m-0 p-0 fas fa-trash"></i>
                        </button>
                      </div>
                    </div>
                  </div>
                  <div class="col-6 col-lg-6">
                    <label for="txtIndiceTrib">Indice:</label>
                    <div class="input-group">
                      <input type="number" class="input-default focus form-control controlaEdicaoTrib" aria-describedby="ufError" disabled readonly id="txtIndiceTrib" name="txtIndiceTrib" class="form-control" placeholder="Índice">
                      <div class="input-group-append">
                        <button class="btn bg-danger controlaEdicaoTrib" disabled readonly id="btnLimpaIndice" type="button">
                          <i class="m-0 p-0 fas fa-trash"></i>
                        </button>
                      </div>
                    </div>
                  </div>
                  <div class="col-6 col-lg-6">
                    <label for="txtFixo">Fixo:</label>
                    <div class="input-group">
                      <input type="number" class="input-default focus form-control controlaEdicaoTrib" aria-describedby="ufError" disabled readonly id="txtFixo" name="txtFixo" class="form-control" placeholder="Fixo">
                      <div class="input-group-append">
                        <button class="btn bg-danger controlaEdicaoTrib" disabled readonly id="btnLimpaFixo" type="button">
                          <i class="m-0 p-0 fas fa-trash"></i>
                        </button>
                      </div>
                    </div>
                  </div>
                </div>
              </fieldset>
            </div>
            <div class="col-md-4 col-4 mb-0">
              <fieldset class="form border-Field mb-0 pb-0">
                <legend class="textoBorda mb-0 pb-0">Crédito Tributação</legend>
                <div class="">
                  <div class="icheck-primary">
                    <input type="checkbox" class="form-check-input controlaEdicaoTrib" disabled readonly id="cbCOFINS">
                    <label class="form-check-label pr-2 mb-1" for="cbCOFINS">COFINS</label>
                  </div>
                  <div class="icheck-primary">
                    <input type="checkbox" class="form-check-input controlaEdicaoTrib" disabled readonly id="cbICMS">
                    <label class="form-check-label pr-2 mb-1" for="cbICMS">ICMS</label>
                  </div>
                  <div class="icheck-primary">
                    <input type="checkbox" class="form-check-input controlaEdicaoTrib" disabled readonly id="cbIPI">
                    <label class="form-check-label pr-2 mb-1" for="cbIPI">IPI</label>
                  </div>
                  <div class="icheck-primary">
                    <input type="checkbox" class="form-check-input controlaEdicaoTrib" disabled readonly id="cbPIS">
                    <label class="form-check-label pr-2 mb-1" for="cbPIS">PIS</label>
                  </div>
                </div>
              </fieldset>
            </div>
            <div class="col-md-12 col-12 table-responsive" style="margin-top: 5px">
              <table id="tabelaTributacao" style="width:100%;" class="table table-sm table-hover table-select table-condensed">
                <thead>
                  <th>DOLAR</th>
                  <th>FIXO</th>
                  <th>INDICE</th>
                  <th>EURO</th>
                  <th>ID</th>
                  </tr>
                </thead>
                <tbody>
                </tbody>
              </table>
            </div>
          </div>
          <div class="modal-footer modalFooterFixo">
            <button type="button" id="btnExcluirTrib" class="btn btn-sisp bg-gradient-danger">Excluir</button>
            <button type="button" id="btnIncluirTrib" class="btn btn-sisp bg-gradient-success">Incluir</button>
            <button type="button" id="btnAlterarTrib" class="btn btn-sisp bg-gradient-primary">Alterar</button>
            <button type="button" id="btnCancelarTrib" class="btn btn-sisp d-none bg-gradient-danger">Cancelar</button>
            <button type="button" id="btnGravarTrib" class="btn btn-sisp d-none bg-gradient-success">Gravar</button>
          </div>
        </div>
      </div>
    </div>
  </div> -->
  <div class="modal fade" id="modalCadIndice" tabindex="-1" role="dialog" aria-labelledby="modalOrcamento" aria-hidden="true">
    <div class="modal-dialog modal-xl">
      <div class="modal-content">
        <div class="modal-header">
          <h4 id="modalOrcamento-titulo" class="modal-title">Cadastro de Índice</h4>
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body p-4">
          <div class="col-sm-12">
            <div class="card card-body" style="padding-top: 10px; padding-bottom: 15px;">
              <div class="form-row bordaProduto">
                <div class="col-3 col-lg-3">
                  <label for="txtIndice">Código:</label>
                  <div class="input-group">
                    <input type="text" class="input-default focus form-control" readonly disabled aria-describedby="ufError" id="txtIndice" name="txtIndice" class="form-control" placeholder="Gerado automaticamente">
                  </div>
                </div>
                <div class="col-7 col-lg-7">
                  <label for="txtIndice">Descrição: *</label>
                  <div class="input-group">
                    <input type="text" class="input-default focus form-control text-uppercase" readonly disabled aria-describedby="ufError" id="txtDescricaoIndice" name="txtDescricaoIndice" class="form-control" placeholder="Descrição">
                  </div>
                </div>
                <div class="form-group col-md-2 col-2">
                  <label for="selectTipoIndice">Tipo</label>
                  <div class="relative">
                    <select id="selectTipoIndice" class="input-default focus form-control validate" readonly disabled name="selectTipoIndice">
                      <option value="0 - INDICE" selected>0 - INDICE</option>
                      <option value="1 - MRG_LUCRO">1 - MRG_LUCRO</option>
                      <option value="2 - ICMS">2 - ICMS</option>
                      <option value="3 - COMISSAO">3 - COMISSAO</option>
                      <option value="4 - FRETE">4 - FRETE</option>
                      <option value="5 - PIS">5 - PIS</option>
                      <option value="6 - COFINS">6 - COFINS</option>
                      <option value="7 - IPI">7 - IPI</option>
                      <option value="8 - D_VENDAS">8 - D_VENDAS</option>
                      <option value="9 - CUSTO_IND">9 - CUSTO_IND</option>
                      <option value="10 - FINANC">10 - FINANC</option>
                      <option value="11 - MARKET">11 - MARKET</option>
                      <option value="12 - CONTR_S">12 - CONTR_S</option>
                      <option value="13 - IRPJ">13 - IRPJ</option>
                    </select>
                  </div>
                </div>
                <div class="col-md-12 col-12 table-responsive" style="margin-top: 5px; width:100%;">
                  <table id="tabelaIndice" style="width:100%;" class="table table-sm table-condensed">
                    <thead>
                      <th>Código</th>
                      <th>Descrição</th>
                      <th>Tipo</th>
                      </tr>
                    </thead>
                    <tbody>
                    </tbody>
                  </table>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="modal-footer justify-content-start">
          <button type="button" id="btnIncluirIndice" class="btn btn-sisp bg-gradient-success">Incluir</button>
          <button type="button" id="btnAlterarIndice" class="btn btn-sisp bg-gradient-primary">Alterar</button>
          <button type="button" id="btnExcluirIndice" class="btn btn-sisp bg-gradient-danger">Excluir</button>
          <button type="button" id="btnGravarIndice" class="btn btn-sisp d-none bg-gradient-success">Gravar</button>
          <button type="button" id="btnCancelarIndice" class="btn btn-sisp d-none bg-gradient-danger">Cancelar</button>
        </div>
      </div>
    </div>
  </div>

  <?php include_once('../../../modais.php') ?>
  <?php include_once('../../../config.php') ?>

  <aside class="control-sidebar control-sidebar-dark">
  </aside>
  </div>

  <script src="../plugins/jquery/jquery.min.js?versao=3.2512.9.1"></script>
  <script src="../plugins/jquery-ui/jquery-ui.min.js?versao=3.2512.9.1"></script>
  <script type="text/javascript" src="../dist/js/jquery.dataTables.js?versao=3.2512.9.1"></script>
  <script type="text/javascript" src="../dist/js/dataTables.bootstrap4.min.js?versao=3.2512.9.1"></script>
  <script src="../plugins/sweetalert2/sweetalert2.min.js?versao=3.2512.9.1"></script>
  <script src="../plugins/toastr/toastr.min.js?versao=3.2512.9.1"></script>
  <script>
    $.widget.bridge('uibutton', $.ui.button);
  </script>
  <script src="../plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.2512.9.1"></script>
  <script src="../dist/js/adminlte.min.js?versao=3.2512.9.1"></script>
  <script src="../dist/js/requisicoes.js?versao=3.2512.9.1"></script>
  <script src="../dist/js/loadingoverlay.min.js?versao=3.2512.9.1"></script>
  <script src="../plugins/jquery-validation/jquery.validate.min.js?versao=3.2512.9.1"></script>
  <script src="../dist/js/dataTables.keyTable.js?versao=3.2512.9.1"></script>
  <script src="../dist/js/sisplan.js?versao=3.2512.9.1"></script>
  <script src="../utils/funcoes.js?versao=3.2512.9.1"></script>
  <script src="../utils/cookies.js?versao=3.2512.9.1"></script>
  <script src="../dist/js/driver.min.js?versao=3.2512.9.1"></script>
  <script type="text/javascript" src="../config.js?versao=3.2512.9.1"></script>
  <script src="../dist/js/jquery.maskMoney.min.js?versao=3.2512.9.1"></script>
  <script>
    $(document).ready(async function() {
      if (getCookie('usuario') == "") {
        window.location.href = `${BASE_URI}/login`;
        return;
      }

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

      ipInterno = IP_INTERNO;
      ipExterno = IP_EXTERNO;
      basicAuth = BASIC_AUTH;
      sArquivo = `${BASE_URI}/pages/cadmarkup/cadastro_cadmarkup/cadmarkup.js?versao=3.2512.9.1`;
      const nomeTela = ('<?php echo basename(__FILE__) ?>').replace('.php', '');

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

      const permissaoUsuarioLogado = await permissaoAcessos("CADMARKUP");

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

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

      $(window).on("beforeunload", function(e) {
        // e.preventDefault();
        e.stopPropagation();
        deletaRegistro('CADMARKUP', getCookie('usuario'), markup);
        return undefined;
      });

      insereJavaScriptPagina(sArquivo);

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

</html>