<?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 Material</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.263.17.1">

  <!-- Theme style -->
  <link rel="stylesheet" href="../dist/css/adminlte.min.css?versao=3.263.17.1">
  <link rel="stylesheet" href="../dist/css/custom.css?versao=3.263.17.1">
  <link rel="stylesheet" href="../dist/css/sisplan.css?versao=3.263.17.1">
  <link rel="stylesheet" type="text/css" href="../plugins/datatables-keytable/css/keyTable.bootstrap4.min.css?versao=3.263.17.1">
  <!-- Toastr -->
  <link rel="stylesheet" href="../plugins/toastr/toastr.min.css?versao=3.263.17.1">
  <link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css?versao=3.263.17.1">
  <link rel="shortcut icon" href="../favicon.ico">
  <link rel="stylesheet" type="text/css" href="../dist/css/driver.min.css?versao=3.263.17.1" />
  <link rel="stylesheet" href="../dist/css/jquery-ui.css?versao=3.263.17.1">

  <!-- Google Font: Source Sans Pro -->
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
  <link rel="stylesheet" type="text/css" href="../dist/css/sisplan.newColorsButtons.css?versao=3.263.17.1" />
  <link rel="stylesheet" href="https://cdn.datatables.net/select/1.6.0/css/select.dataTables.min.css">

  <style>
    .form-control:disabled,
    .form-control[readonly] {
      background-color: #f7f7f7;
      opacity: 1;
    }

    #msform {
      text-align: start;
      position: relative;
    }

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

    #bordaImagem {
      width: 100%;
      height: 350px;
      border: solid #e0e4e6;
      border-radius: 4px;
      border-width: 2px;
    }

    #infoprodimagem {
      max-width: 100%;
      max-height: 345px;
      width: auto;
      height: auto;

    }

    #divImg {
      margin-left: 3%;
    }

    .check-todos {
      background-color: var(--buttonCheckMedidas);
      border: 0px;
    }

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

    .table.dataTable tbody td,
    .table.dataTable thead {
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
    }

    .pagination {
      display: flex;
      justify-content: end;
    }

    .dataTables_wrapper>div:nth-child(3)>div:nth-child(2) {
      padding-right: .5rem !important;
    }

    .dataTables_wrapper>div:nth-child(2)>div:first {
      padding-right: 0 !important;
    }

    /* #tabelaControleItens tbody{
      height: 1px;
    } */

    /* #tabelaControleItens thead {
      display: table;
      width: 100%;
      table-layout: fixed;
    } */
  </style>


</head>

<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">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">Modal body text goes here.</p>
          </div>
          <div class="modal-footer">
            <button id="btnYes" type="button" class="btn btn-primary btn-sisp">Sim</button>
            <button id="btnNo" type="button" class="btn btn-secondary btn-sisp" data-dismiss="modal">Não</button>
          </div>
        </div>
      </div>
    </div>
    <!-- Content Wrapper. Contains page content -->

    <div class="content-wrapper">
      <section class="content">
        <div class="py-0">
          <div class="container-fluid">
            <div class="row mb-2">
              <div class="col-sm-6 flex">
              </div>
              <div class="col-sm-6">
              </div>
            </div>
          </div>
          <div class="row justify-content-center mt-0">
            <div class="col-12 p-0 mt-3 mb-2">
              <div class="container-fluid">
                <div class="row mb-2 ml-2">
                  <div class="col-sm-6 flex pl-1">
                    <h1 class="m-0 text-dark font-semibold" style="font-size: 1.8rem; font-weight: 500; line-height: 1.2;">Cadastro de Preço Material</h1>
                    <button class="btnTutorial" id="tutorial">
                      <i class="fas fa-question-circle"></i>
                    </button>
                  </div>
                </div>
              </div>
              <fieldset>
                <div class="card-body">
                  <form style="text-align:left!important;" id="msform" name="msform">
                    <div class="card card-header" role="tab" id="geral">
                      <a style="width:100%;" data-toggle="collapse" data-parent="#multiCollapseExample1" href="#multiCollapseExample1" aria-expanded="true" aria-controls="collapseOne1">
                        <div class="row">
                          <div style="max-width:20px;margin-top:auto; margin-bottom: auto" class="col-1">
                            <i class="fas fa-angle-down"></i>
                          </div>
                          <div class="col-11">
                            <h4 class="title-page">
                              Geral
                            </h4>
                          </div>
                        </div>
                      </a>
                    </div>
                    <div class="collapse show" id="multiCollapseExample1">
                      <div class="tab-pane fade show active" role="tabpanel" aria-labelledby="geral-tab">
                        <div class="form-row pt-2 pl-2">
                          <div class="form-group form-check icheck-primary">
                            <input type="checkbox" class="form-check-input" id="cbProduzido">
                            <label class="form-check-label pr-4" for="cbProduzido">Produzido</label>
                          </div>
                        </div>
                        <div class="form-row">
                          <div class="col-8" id="infoGerais">
                            <div class="form-row">
                              <div class="col-xl-2 col-6 form-group" id="tourcodigo">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtCodigo">Código:</label>
                                <div class="input-group">
                                  <input type="text" class="input-default focus form-control campoForm" id="txtCodigo" aria-describedby="codError" name="txtCodigo" class="form-control" placeholder="Código">
                                  <div class="input-group-append">
                                    <button class="btn bg-danger" id="btnCodigo" name="btnCodigo" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>

                                  </div>
                                </div>
                              </div>
                              <div class="col-xl-5 col-6 form-group" id="tourdesc">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtDescricao">Descrição:</label>
                                <input type="text" maxlength="100" class="input-default focus form-control validate create campoForm" id="txtDescricao" required aria-describedby="descError" name="txtDescricao" class="form-control" placeholder="Descrição">
                              </div>
                              <div class="col-xl-1 col-2 form-group" id="tourdesc">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtUnidade">Unidade:</label>
                                <input type="text" maxlength="100" class="input-default focus form-control validate create campoForm" id="txtUnidade" required aria-describedby="descError" name="txtUnidade" class="form-control" placeholder="UN">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label>Data:</label>
                                <input type="date" class="input-default focus form-control" id="txtData" disabled value="<?php echo date('Y-m-d'); ?>">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label>Atualizado em:</label>
                                <input type="date" class="input-default focus form-control" disabled id="txtDataUltimaAtualizacao" value="<?php echo date('Y-m-d'); ?>">
                              </div>
                              <div class="col-xl-4 col-6 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtGrupo">Grupo:</label>
                                <div class="input-group">
                                  <input type="text" class="input-default focus form-control create campoForm" id="txtGrupo" required aria-describedby="uError" name="txtGrupo" class="form-control" placeholder="Grupo">
                                  <div class="input-group-append">
                                    <button class="btn bg-danger create" 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 create" id="btnLimpaGrupo" type="button">
                                      <i class="m-0 p-0 fas fa-trash"></i>
                                    </button>
                                  </div>
                                </div>
                              </div>
                              <div class="col-xl-4 col-6 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtSetor">Setor:</label>
                                <div class="input-group">
                                  <input type="text" class="input-default focus form-control create campoForm" id="txtSetor" required aria-describedby="uError" name="txtSetor" class="form-control" placeholder="Setor">
                                  <div class="input-group-append">
                                    <button class="btn bg-danger create" id="btnSetor" name="btnSetor" data-button="absolute" type="button">
                                      <i class="m-0 p-0 fas fa-search"></i>
                                    </button>
                                    <button class="btn bg-danger create" id="btnLimpaSetor" type="button">
                                      <i class="m-0 p-0 fas fa-trash"></i>
                                    </button>
                                  </div>
                                </div>
                              </div>
                              <div class="col-xl-4 col-6 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtParte">Parte:</label>
                                <div class="input-group">
                                  <input type="text" class="input-default focus form-control create campoForm" id="txtParte" required aria-describedby="uError" name="txtParte" class="form-control" placeholder="Parte">
                                  <div class="input-group-append">
                                    <button class="btn bg-danger create" id="btnParte" name="btnParte" data-button="absolute" type="button">
                                      <i class="m-0 p-0 fas fa-search"></i>
                                    </button>
                                    <button class="btn bg-danger create" id="btnLimpaParte" type="button">
                                      <i class="m-0 p-0 fas fa-trash"></i>
                                    </button>
                                  </div>
                                </div>
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtPrecoCompra">Preço Compra:</label>
                                <input type="text" class="input-default focus form-control create seisCasasDecimaisQuantityFormat text-right campoForm campoRecalcularCusto" id="txtPrecoCompra" name="txtPrecoCompra" class="form-control" placeholder="0,000000">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtCreditoIPI">Crédito IPI %:</label>
                                <div class="flex w-100 align-items-center">
                                  <input type="text" class="input-default focus form-control create duasCasasDecimaisQuantityFormat text-right campoForm campoRecalcularCusto" id="txtCreditoIPI" name="txtCreditoIPI" class="form-control" placeholder="0,00">
                                  <div class="form-group form-check icheck-primary" style="margin-bottom: 0 !important">
                                    <input type="checkbox" class="form-check-input cbRecalcularCusto" id="cbCreditoIPI" />
                                    <label class="form-check-label" for="cbCreditoIPI"></label>
                                  </div>
                                </div>
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtCreditoICMS">Crédito ICMS %:</label>
                                <div class="flex w-100 align-items-center">
                                  <input type="text" class="input-default focus form-control create duasCasasDecimaisQuantityFormat text-right campoForm campoRecalcularCusto" id="txtCreditoICMS" name="txtCreditoICMS" class="form-control" placeholder="0,00">
                                  <div class="form-group form-check icheck-primary" style="margin-bottom: 0 !important">
                                    <input type="checkbox" class="form-check-input cbRecalcularCusto" id="cbCreditoICMS" />
                                    <label class="form-check-label" for="cbCreditoICMS"></label>
                                  </div>
                                </div>
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtCreditoPIS">Crédito PIS %:</label>
                                <div class="flex w-100 align-items-center">
                                  <input type="text" class="input-default focus form-control create duasCasasDecimaisQuantityFormat text-right campoForm campoRecalcularCusto" id="txtCreditoPIS" name="txtCreditoPIS" class="form-control" placeholder="0,00">
                                  <div class="form-group form-check icheck-primary" style="margin-bottom: 0 !important">
                                    <input type="checkbox" class="form-check-input cbRecalcularCusto" id="cbCreditoPIS" />
                                    <label class="form-check-label" for="cbCreditoPIS"></label>
                                  </div>
                                </div>
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtCreditoCOFINS">Crédito COFINS %:</label>
                                <div class="flex w-100 align-items-center">
                                  <input type="text" class="input-default focus form-control create duasCasasDecimaisQuantityFormat text-right campoForm campoRecalcularCusto" id="txtCreditoCOFINS" name="txtCreditoCOFINS" class="form-control" placeholder="0,00">
                                  <div class="form-group form-check icheck-primary" style="margin-bottom: 0 !important">
                                    <input type="checkbox" class="form-check-input cbRecalcularCusto" id="cbCreditoCOFINS" />
                                    <label class="form-check-label" for="cbCreditoCOFINS"></label>
                                  </div>
                                </div>
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtDespesasIPI">Despesas IPI %:</label>
                                <input type="text" class="input-default focus form-control create duasCasasDecimaisQuantityFormat text-right campoForm campoRecalcularCusto" id="txtDespesasIPI" name="txtDespesasIPI" class="form-control" placeholder="0,00">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtFrete">Frete %:</label>
                                <input type="text" class="input-default focus form-control create duasCasasDecimaisQuantityFormat text-right campoForm campoRecalcularCusto" id="txtFrete" name="txtFrete" class="form-control" placeholder="0,00">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtValorFrete">Valor Frete:</label>
                                <input type="text" class="input-default focus form-control create duasCasasDecimaisQuantityFormat text-right campoForm campoRecalcularCusto" id="txtValorFrete" name="txtValorFrete" class="form-control" placeholder="0,00">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtFatorConversao">Fator de Conversão:</label>
                                <input type="text" class="input-default focus form-control campoForm" id="txtFatorConversao" name="txtFatorConversao" class="form-control" placeholder="0,00" disabled>
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtAproveitamento">Aproveitamento:</label>
                                <input type="text" class="input-default focus form-control create duasCasasDecimaisQuantityFormat text-right campoForm" id="txtAproveitamento" name="txtAproveitamento" class="form-control" placeholder="0,00">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtPrecoAnterior">Preço Anterior:</label>
                                <input type="text" class="input-default focus form-control text-right campoForm" id="txtPrecoAnterior" name="txtPrecoAnterior" class="form-control" disabled placeholder="0.00">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtMVA">MVA:</label>
                                <input type="text" class="input-default focus form-control create duasCasasDecimaisQuantityFormat text-right campoForm campoRecalcularCusto" id="txtMVA" name="txtMVA" class="form-control" placeholder="0,00">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtPreco1">Preço 1:</label>
                                <input type="text" class="input-default focus form-control create seisCasasDecimaisQuantityFormat text-right campoForm" id="txtPreco1" name="txtPreco1" class="form-control" placeholder="0,000000">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtPreco2">Preço 2:</label>
                                <input type="text" class="input-default focus form-control create seisCasasDecimaisQuantityFormat text-right campoForm" id="txtPreco2" name="txtPreco2" class="form-control" placeholder="0,000000">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtPreco3">Preço 3:</label>
                                <input type="text" class="input-default focus form-control create seisCasasDecimaisQuantityFormat text-right campoForm" id="txtPreco3" name="txtPreco3" class="form-control" placeholder="0,000000">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtLarguraMalha">Largura Malha:</label>
                                <input type="text" class="input-default focus form-control create duasCasasDecimaisQuantityFormat text-right campoForm" id="txtLarguraMalha" name="txtLarguraMalha" class="form-control" placeholder="0,00">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtGramatura">Gramatura:</label>
                                <input type="text" class="input-default focus form-control create duasCasasDecimaisQuantityFormat text-right campoForm" id="txtGramatura" name="txtGramatura" class="form-control" placeholder="0,00">
                              </div>
                              <div class="col-xl-2 col-3 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtLIndicePeso">Índice de Peso:</label>
                                <input type="text" class="input-default focus form-control create duasCasasDecimaisQuantityFormat text-right campoForm" id="txtIndicePeso" name="txtIndicePeso" class="form-control" placeholder="0,00">
                              </div>
                              <div class="col-12 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtInfoCompl">Informações Complementares:</label>
                                <input type="text" class="input-default focus form-control create campoForm" id="txtInfoCompl" name="txtInfoCompl" class="form-control" placeholder="Informações Complementares">
                              </div>
                              <div class="col-12 form-group">
                                <label data-error="wrong" class="labelGeral" data-success="right" for="txtObs">Observações:</label>
                                <textarea class="input-default focus form-control create campoForm" id="txtObs" name="txtObs" placeholder="Observações" rows="4" cols="50" style="resize: none;"></textarea>
                              </div>
                            </div>
                          </div>
                          <div class="col-4 pl-2" id="divImagem">
                            <div id="divImg">
                              <label class="labelGeral" data-success="right" for="imgMat">Imagem do Material</label>
                              <div class="d-flex justify-content-center" id="bordaImagem" style="height: 100%">
                                <label id="btnEscolherFoto" class="btnEnviarFoto" for="fileimagem" data-button="absolute" type="button">
                                  <img class="pop img img-fluid imagem" id="imagemMat" src="./dist/img/prod-1.png">
                                </label>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                    <div class="card card-header" role="tab" id="itens">
                      <a style="width:100%;" data-toggle="collapse" data-parent="#multiCollapseExample2" href="#multiCollapseExample2" aria-expanded="true" aria-controls="collapseOne1">
                        <div class="row">
                          <div style="max-width:20px;margin-top:auto; margin-bottom: auto" class="col-1">
                            <i class="fas fa-angle-down"></i>
                          </div>
                          <div class="col-11">
                            <h4 class="title-page">
                              Itens/Cores
                            </h4>
                          </div>
                        </div>
                      </a>
                    </div>
                    <div class="collapse hide" id="multiCollapseExample2">
                      <div class="tab-pane fade show active" role="tabpanel" aria-labelledby="cores-tab">
                        <div id="tabelacorestour" class="col-12 table-responsive">
                          <table id="tabelaCores" class="table table-select table-hover" style="width: 100%">
                            <thead>
                            </thead>
                            <tbody>
                            </tbody>
                          </table>
                        </div>
                        <div class="col-12 d-none">
                          <table id="tabelaQuebrasGravar" class="table table-select table-hover" style="width: 100%">
                            <thead>
                            </thead>
                            <tbody>
                            </tbody>
                          </table>
                        </div>
                        <div class="form-row col-12">
                          <div class="col-12 my-2 d-flex flex-row-reverse">
                            <button type="button" id="btnCustoMalhas" style="font-size:15px;" class="btn btn-secondary btn-sisp ml-2 create" data-dismiss="modal">Custo Malhas</button>
                            <button type="button" id="btnPrecoTinturaria" style="font-size:15px;" class="btn btn-secondary btn-sisp ml-2 create" data-dismiss="modal">Preço Tinturaria</button>
                            <button type="button" id="btnQuebras" style="font-size:15px;" class="btn btn-primary btn-sisp ml-2 create" data-dismiss="modal">Quebras</button>
                            <button type="button" id="btnControleItens" style="font-size:15px;" class="btn btn-primary btn-sisp ml-2 create" data-dismiss="modal">Controle de Itens</button>
                          </div>
                        </div>
                      </div>
                    </div>
                    <div class="card card-header" role="tab" id="aviamentos">
                      <a style="width:100%;" data-toggle="collapse" data-parent="#multiCollapseExample3" href="#multiCollapseExample3" aria-expanded="true" aria-controls="collapseOne1">
                        <div class="row">
                          <div style="max-width:20px;margin-top:auto; margin-bottom: auto" class="col-1">
                            <i class="fas fa-angle-down"></i>
                          </div>
                          <div class="col-11">
                            <h4 class="title-page">
                              Aviamentos
                            </h4>
                          </div>
                        </div>
                      </a>
                    </div>
                    <div class="collapse hide" id="multiCollapseExample3">
                      <div class="tab-pane fade show active" role="tabpanel" aria-labelledby="aviamentos-tab">
                        <div class="flex flex-wrap w-100">
                          <div class="d-flex flex-column col-12 px-0" style="gap: 8px" id="divTabelaItens">
                            <div class="table-responsive" style="overflow-x: hidden">
                              <table id="tabelaAviamentos" class="table table-sm table-select table-hover" width="100%">
                                <thead>
                                </thead>
                                <tbody>
                                </tbody>
                              </table>
                            </div>
                          </div>
                          <div class="flex w-100 flex-wrap justify-content-end" style="gap: 8px">
                            <button type="button" id="btnAviamentos" class="btn btn-primary btn-sisp create">Aviamentos</button>
                          </div>
                        </div>
                      </div>
                    </div>
                    <div class="card card-header" role="tab" id="compras">
                      <a style="width:100%;" data-toggle="collapse" data-parent="#multiCollapseExample4" href="#multiCollapseExample4" aria-expanded="true" aria-controls="collapseOne1">
                        <div class="row">
                          <div style="max-width:20px;margin-top:auto; margin-bottom: auto" class="col-1">
                            <i class="fas fa-angle-down"></i>
                          </div>
                          <div class="col-11">
                            <h4 class="title-page">
                              Últimas Compras
                            </h4>
                          </div>
                        </div>
                      </a>
                    </div>
                    <div class="collapse hide" id="multiCollapseExample4">
                      <div class="flex flex-wrap w-100">
                        <div class="tab-pane fade show active flex justify-content-center w-100" id="cardbody-compras" role="tabpanel" aria-labelledby="compras-tab">
                        </div>
                      </div>
                    </div>
                    <div class="flex w-100 justify-content-end mt-2" style="gap: 8px">
                      <button type="button" class="btn btn-secondary btn-sisp" id="btnVoltar" style="max-height: 40px">Voltar</button>
                      <button type="button" class="btn btnVerde btn-sisp" id="btnGravar" style="max-height: 40px">Gravar</button>
                    </div>
                  </form>
                </div>
              </fieldset>
            </div>
          </div>
        </div>
      </section>

      <div class="modal fade" id="modalControleItens" tabindex="-1" data-backdrop="static" role="dialog" aria-labelledby="modalControleItens" aria-hidden="true">
        <div class="modal-dialog modal-xl" style="min-width: 95%; min-height: 100%">
          <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title" id="tituloControleItens">Controle de Itens</h4>
              <div class="ml-2 pt-2 d-flex icheck-primary">
                <input type="checkbox" class="form-check-input" id="cbAtivoCI">
                <label class="form-check-label pr-4" for="cbAtivoCI">Ativo</label>
              </div>
              <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
            <div class="modal-body pb-0">
              <div class="row">
                <div class="form-row col-12">
                  <div class="col-1">
                    <div class="group-default form-group">
                      <label data-error="wrong" data-success="right" for="txtIdCI">ID</label>
                      <div class="relative">
                        <input type="text" placeholder="ID" class="input-default focus form-control validate" id="txtIdCI" name="txtIdCI" disabled>
                      </div>
                    </div>
                  </div>
                  <div class="col-5">
                    <div class="group-default form-group">
                      <label data-error="wrong" data-success="right" for="txtCorCI">Cor</label>
                      <div class="relative">
                        <div class="input-group-append">
                          <input type="text" placeholder="Cor" class="input-default focus form-control validate" id="txtCorCI" name="txtCorCI" disabled>
                          <button class="btn bg-danger" id="btnCorCI" name="btnCorCI" data-button="absolute" type="button" disabled>
                            <i class="m-0 p-0 fas fa-search"></i>
                          </button>
                        </div>
                      </div>
                    </div>
                  </div>
                  <div class="col-6">
                    <div class="group-default form-group">
                      <label data-error="wrong" data-success="right" for="txtPantoneCI">Pantone</label>
                      <div class="relative">
                        <input type="text" placeholder="Pantone" class="input-default focus form-control validate" id="txtPantoneCI" name="txtPantoneCI" disabled>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <div class="row">
                <div class="form-row col-9 d-none" id="precosCI">
                  <div class="col-3">
                      <label data-error="wrong" data-success="right" for="txtPrecoTingimentoCI">Preço Tingimento</label>
                      <div class="relative">
                        <div class="input-group-append">
                          <input type="text" placeholder="0.00" class="input-default focus form-control validate quatroCasasDecimaisQuantityFormat text-right" id="txtPrecoTingimentoCI" name="txtPrecoTingimentoCI">
                      </div>
                    </div>
                  </div>
                  <div class="col-3">
                      <label data-error="wrong" data-success="right" for="txtPrecoCompraCI">Preço Compra</label>
                      <div class="relative">
                        <input type="number" placeholder="0.00" class="input-default focus form-control validate quatroCasasDecimaisQuantityFormat text-right" id="txtPrecoCompraCI" name="txtPrecoCompraCI">
                      </div>
                  </div>
                  <div class="col-3">
                      <label data-error="wrong" data-success="right" for="txtPercDespCI">% Desperdício</label>
                      <div class="relative">
                        <input type="number" placeholder="0,00" class="input-default focus form-control validate quatroCasasDecimaisQuantityFormat text-right" id="txtPercDespCI" name="txtPercDespCI">
                      </div>
                  </div>
                  <div class="col-3">
                      <label data-error="wrong" data-success="right" for="txtPrecoCI">Preço</label>
                      <div class="relative">
                        <input type="number" placeholder="0.00" class="input-default focus form-control validate quatroCasasDecimaisQuantityFormat text-right" id="txtPrecoCI" name="txtPrecoCI" disabled>
                      </div>
                  </div>
                </div>
                <div class="form-row col-9" id="precosTodosCI">
                  <div class="col-3 form-group pr-0">
                    <label data-error="wrong" data-success="right" for="txtPrecoTingimentoTodosCI">Preço Tingimento</label>
                    <div class="input-group">
                      <input type="text" placeholder="0.00" class="input-default focus form-control validate col-10 quatroCasasDecimaisQuantityFormat text-right" id="txtPrecoTingimentoTodosCI" name="txtPrecoTingimentoTodosCI">
                      <div class="input-group-append">
                        <button id="btnPrecoTingimentoTodosCI" class="btn bg-danger check-todos col-2">
                          <i class="fas fa-check ml-1" style="color: red; font-size: 1.2em"></i>
                        </button>
                      </div>
                    </div>
                  </div>
                  <div class="col-3 form-group px-0">
                    <label data-error="wrong" data-success="right" for="txtPrecoCompraTodosCI">Preço Compra</label>
                    <div class="input-group">
                      <input type="text" placeholder="0.00" class="input-default focus form-control validate col-10 quatroCasasDecimaisQuantityFormat text-right" id="txtPrecoCompraTodosCI" name="txtPrecoCompraTodosCI">
                      <div class="input-group-append">
                        <button id="btnPrecoCompraTodosCI" class="btn bg-danger check-todos col-2">
                          <i class="fas fa-check ml-1" style="color: red; font-size: 1.2em"></i>
                        </button>
                      </div>
                    </div>
                  </div>
                  <div class="col-3 form-group px-0">
                    <label data-error="wrong" data-success="right" for="txtPercDesperdicioTodosCI">% Desperdício</label>
                    <div class="input-group">
                      <input type="text" placeholder="0.00" class="input-default focus form-control validate col-10 quatroCasasDecimaisQuantityFormat text-right" id="txtPercDesperdicioTodosCI" name="txtPercDesperdicioTodosCI">
                      <div class="input-group-append">
                        <button id="btnPercDesperdicioTodosCI" class="btn bg-danger check-todos col-2">
                          <i class="fas fa-check ml-1" style="color: red; font-size: 1.2em"></i>
                        </button>
                      </div>
                    </div>
                  </div>
                  <div class="col-3 form-group px-0">
                    <label data-error="wrong" data-success="right" for="txtPrecoTodosCI">Preço</label>
                    <div class="input-group">
                      <input type="text" placeholder="0.00" class="input-default focus form-control validate col-10 quatroCasasDecimaisQuantityFormat text-right" id="txtPrecoTodosCI" name="txtPrecoTodosCI">
                      <div class="input-group-append">
                        <button id="btnPrecoTodosCI" class="btn bg-danger check-todos col-2">
                          <i class="fas fa-check ml-1" style="color: red; font-size: 1.2em"></i>
                        </button>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="col-3 form-group px-0">
                  <div class="icheck-primary">
                    <input type="checkbox" class="form-check-input ml-0" id="cbUtilizaFatConv" disabled>
                    <label data-error="wrong" class="labelGeral" data-success="right" for="cbUtilizaFatConv" disabled>Utilizar Fator de Conv. no Cálculo</label>
                  </div>
                  <div class="input-group">
                    <input type="text" placeholder="0.00" class="input-default focus form-control validate col-8" id="txtUtilizaFatConv" name="txtUtilizaFatConv" disabled>
                  </div>
                </div>
              </div>
              <div class="row">
                <div class="form-row col-12">
                  <div class="form-row col-9" id="grupoCI">
                    <div class="col-6 form-group">
                      <label data-error="wrong" class="labelGeral" data-success="right" for="txtGrupoCI">Grupo</label>
                      <div class="input-group">
                        <input type="text" class="input-default focus form-control" id="txtGrupoCI" required aria-describedby="uError" name="txtGrupoCI" class="form-control" placeholder="Grupo">
                        <div class="input-group-append">
                          <button class="btn bg-danger" id="btnGrupoCI" name="btnGrupoCI" data-button="absolute" type="button">
                            <i class="m-0 p-0 fas fa-search"></i>
                          </button>
                          <button class="btn bg-danger" id="btnAGrupoCI" type="button">
                            <i class="m-0 p-0 fas fa-trash"></i>
                          </button>
                        </div>
                      </div>
                    </div>
                    <div class="form-group col-2 pt-4 mt-1">
                      <button class="btn btn-primary btn-sisp" id="btnConsultarCI" name="btnConsultarCI" data-button="absolute" type="button">Filtrar
                        <i class="m-0 p-0 fas fa-search"></i>
                      </button>
                    </div>
                  </div>
                </div>
              </div>
              <div class="form-row col-12">
                <div class="form-group col-12 d-flex mt-2">
                  <button class="btn btn-secondary btn-sisp" id="btnIncluirCI">Incluir</button>
                  <button class="btn btn-primary btn-sisp d-none" id="btnConfirmarCI">Confirmar</button>
                  <button class="btn bg-gradient-danger btn-sisp ml-2 d-none" id="btnDesistirCI">Desistir</button>
                  <button class="btn btn-secondary btn-sisp ml-2" id="btnAtualizarCoresCI">Atualizar Cores</button>
                </div>
              </div>
              <div class="form-row col-12 mt-2 table-responsive">
                <div class="col-12 pl-0 ml-0">
                  <div class="col-12">
                    <table id="tabelaControleItens" class="pl-0 ml-0 table table-select table-hover" style="width: 100%">
                      <thead>
                      </thead>
                      <tbody>
                      </tbody>
                    </table>
                  </div>
                </div>
              </div>
            </div>
            <div class="modal-footer">
              <button class="btn btn-primary btn-sisp mr-auto" id="btnGravarControleItens"> Confirmar</button>
              <button class="btn bg-gradient-danger btn-sisp" id="btnFecharControleItens"> Fechar</button>
            </div>
          </div>
        </div>
      </div>

      <div class="modal fade" id="modalQuebras" tabindex="-1" data-backdrop="static" role="dialog" aria-labelledby="modalQuebras" aria-hidden="true">
        <div class="modal-dialog modal-xl">
          <div class="modal-content">
            <div class="modal-header">
              <h4 class="modal-title" id="tituloQuebras"></h4>
              <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
            <div class="modal-body pb-0 bodyModal">
              <div class="form-row col-12">
                <div class="group-default form-group col-1">
                  <label data-error="wrong" data-success="right" for="txtOrdemQuebras">Ordem</label>
                  <div class="relative">
                    <input type="text" placeholder="Ordem" class="input-default focus form-control validate" id="txtOrdemQuebras" name="txtOrdemQuebras" disabled>
                  </div>
                </div>
                <div class="col-9 form-group">
                  <label data-error="wrong" class="labelGeral" data-success="right" for="txtCodigoQuebras">Código</label>
                  <div class="input-group">
                    <input type="text" class="input-default focus form-control" id="txtCodigoQuebras" required aria-describedby="uError" name="txtCodigo" class="form-control" placeholder="Código" disabled>
                    <div class="input-group-append">
                      <button class="btn bg-danger" id="btnCodigoQuebras" name="btnCodigoQuebras" data-button="absolute" type="button" disabled>
                        <i class="m-0 p-0 fas fa-search"></i>
                      </button>
                      <button class="btn bg-danger" id="btnACodigoQuebras" type="button" disabled>
                        <i class="m-0 p-0 fas fa-trash"></i>
                      </button>
                    </div>
                  </div>
                </div>
                <div class="group-default form-group col-1">
                  <label data-error="wrong" data-success="right" for="txtUnidadeQuebras" disabled>Unidade</label>
                  <div class="relative">
                    <input type="text" placeholder="UN" class="input-default focus form-control validate" id="txtUnidadeQuebras" name="txtUnidadeQuebras" disabled>
                  </div>
                </div>
                <div class="group-default form-group col-1">
                  <label data-error="wrong" data-success="right" for="txtQuebraQuebras">Quebra</label>
                  <div class="relative">
                    <input type="number" placeholder="0.00" class="input-default focus form-control validate quatroCasasDecimaisQuantityFormat text-right" id="txtQuebraQuebras" name="txtQuebraQuebras" disabled>
                  </div>
                </div>
              </div>
              <div class="form-row col-12">
                <div class="group-default form-group ml-1">
                  <button class="btn btn-secondary btn-sisp" id="btnIncluirQuebras">Incluir</button>
                  <button class="btn btn-primary btn-sisp d-none" id="btnConfirmarQuebras">Confirmar</button>
                  <button class="btn bg-gradient-danger btn-sisp ml-2 d-none" id="btnDesistirQuebras">Desistir</button>
                </div>
              </div>
              <div class="form-row col-12">
                <div class="col-12 form-group pr-0">
                  <div class="col-12 pr-0">
                    <table id="tabelaQuebras" class="table table-select table-hover" style="width: 100%">
                      <thead>
                      </thead>
                      <tbody>
                      </tbody>
                    </table>
                  </div>
                </div>
              </div>
            </div>
            <div class="modal-footer">
              <button class="btn btn-primary btn-sisp mr-auto" id="btnGravarQuebras"> Confirmar</button>
              <button class="btn bg-gradient-danger btn-sisp" id="btnFecharQuebras"> Fechar</button>
            </div>
          </div>
        </div>
      </div>

      <div class="modal fade" id="modalPrecoTin" tabindex="-1" data-backdrop="static" role="dialog" aria-labelledby="modalPrecoTin" aria-hidden="true">
        <div class="modal-dialog modal-xl">
          <div class="modal-content">
            <div class="modal-header">
              <h4 class="modal-title" id="tituloPrecoTin"></h4>
              <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
            <div class="modal-body pb-0 bodyModal">
              <div class="form-row col-8">
                <div class="form-group col-10">
                  <label data-error="wrong" class="labelGeral" data-success="right" for="txtTinturariaPrecoTin">Tinturaria</label>
                  <div class="input-group">
                    <input type="text" class="input-default focus form-control" id="txtTinturariaPrecoTin" required aria-describedby="uError" name="txtTinturariaPrecoTin" class="form-control" placeholder="Tinturaria">
                    <div class="input-group-append">
                      <button class="btn bg-danger" id="btnTinturariaPrecoTin" name="btnTinturariaPrecoTin" data-button="absolute" type="button">
                        <i class="m-0 p-0 fas fa-search"></i>
                      </button>
                      <button class="btn bg-danger" id="btnATinturariaPrecoTin" type="button">
                        <i class="m-0 p-0 fas fa-trash"></i>
                      </button>
                    </div>
                  </div>
                </div>
                <div class="form-group col-2 pt-4 mt-1">
                  <button class="btn btn-primary" style="width: 160px;" id="btnConsultarPrecoTin" name="btnConsultarPrecoTin" data-button="absolute" type="button">Consultar
                    <i class="m-0 p-0 fas fa-search"></i>
                  </button>
                </div>
              </div>
              <div class="form-row col-12">
                <div class="col-2">
                  <div class="group-default form-group">
                    <label data-error="wrong" data-success="right" for="txtPrecoNovoPrecoTin">Preço Novo</label>
                    <div class="relative">
                      <input type="number" placeholder="0.00" class="input-default focus form-control validate" id="txtPrecoNovoPrecoTin" name="txtPrecoNovoPrecoTin" disabled>
                    </div>
                  </div>
                </div>
                <div class="col-2 pt-4 mt-1">
                  <button class="btn btn-primary d-none" style="width: 160px;" id="btnConfirmarPrecoTin" name="btnConfirmarPrecoTin" data-button="absolute" type="button">Confirmar
                  </button>
                </div>
                <div class="col-2 pt-4 mt-1">
                  <button class="btn bg-gradient-danger d-none" style="width: 160px;" id="btnDesistirPrecoTin" name="btnDesistirPrecoTin" data-button="absolute" type="button">Desistir
                  </button>
                </div>
              </div>
              <div class="form-row col-12">
                <div class="form-row col-12">
                  <div class="col-12 form-group">
                    <div class="col-12">
                      <table id="tabelaPrecoTin" class="table table-select table-hover" style="width: 100%">
                        <thead>
                        </thead>
                        <tbody>
                        </tbody>
                      </table>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div class="modal-footer">
              <button class="btn btn-primary btn-sisp mr-auto" id="btnGravarPrecoTin"> Confirmar</button>
              <button class="btn bg-gradient-danger btn-sisp" id="btnFecharPrecoTin"> Fechar</button>
            </div>
          </div>
        </div>
      </div>

      <div class="modal fade" id="modalCustoMalhas" tabindex="-1" data-backdrop="static" role="dialog" aria-labelledby="modalCustoMalhas" aria-hidden="true">
        <div class="modal-dialog modal-xl">
          <div class="modal-content">
            <div class="modal-header">
              <h4 class="modal-title" id="tituloCustoMalhas"></h4>
              <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>

            <div class="modal-body bodyModal p-0">
              <div id="divMalhasRotativas">
                <div class="card card-header" role="tab" id="modalCustoMalhasRotativas">
                  <a style="width:100%;" data-toggle="collapse" data-parent="#collapseMalhaRotativa" href="#collapseMalhaRotativa" aria-expanded="true" aria-controls="collapseOne1">
                    <div class="row">
                      <div style="max-width:20px;margin-top:auto; margin-bottom: auto" class="col-1">
                        <i class="fas fa-angle-down"></i>
                      </div>
                      <div class="col-11">
                        <h4 class="title-page">
                          Malhas Rotativas
                        </h4>
                      </div>
                    </div>
                  </a>
                </div>
                <div class="collapse show" id="collapseMalhaRotativa">
                  <div class="card card-body">
                    <div class="tab-pane fade show active" role="tabpanel" aria-labelledby="geral-tab">
                      <div class="col-12" id="gridMalhaRotativa">
                        <div class="form-row col-12">
                          <div class="form-group col-3">
                            <label data-error="wrong" class="labelGeral" data-success="right" for="txtAviamentoCustoMalhas">Aviamento</label>
                            <div class="relative">
                              <input type="text" class="input-default focus form-control" id="txtAviamentoCustoMalhas" required aria-describedby="uError" name="txtAviamentoCustoMalhas" class="form-control" placeholder="Código" disabled>
                            </div>
                          </div>
                        </div>
                        <div class="form-row col-12">
                          <div class="form-row col-12 mt-2">
                            <div class="col-12 form-group">
                              <div class="col-12 table-responsive">
                                <table id="tabelaCustoMalhaRotativa" class="table table-select table-hover" style="width: 100%">
                                  <thead>
                                  </thead>
                                  <tbody>
                                  </tbody>
                                </table>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <div style="background-color: white; height: 1px; margin-bottom: 10px;">
              </div>
              <div id="divMalhaBase">
                <div class="card card-header" role="tab" id="modalCustoMalhaBase">
                  <a style="width:100%;" data-toggle="collapse" data-parent="#collapseMalhaBase" href="#collapseMalhaBase" aria-expanded="true" aria-controls="collapseOne1">
                    <div class="row">
                      <div style="max-width:20px;margin-top:auto; margin-bottom: auto" class="col-1">
                        <i class="fas fa-angle-down"></i>
                      </div>
                      <div class="col-11">
                        <h4 class="title-page">
                          Malhas Base
                        </h4>
                      </div>
                    </div>
                  </a>
                </div>
                <div class="collapse show" id="collapseMalhaBase">
                  <div class="card card-body">
                    <div class="tab-pane fade show active" role="tabpanel" aria-labelledby="geral-tab">

                      <div class="col-12" id="gridMalhaBase">
                        <div class="form-row col-12">
                          <div class="form-group col-3">
                            <label data-error="wrong" class="labelGeral" data-success="right" for="txtMalhaBase">Código</label>
                            <div class="relative">
                              <input type="text" class="input-default focus form-control" id="txtMalhaBase" required aria-describedby="uError" name="txtMalhaBase" class="form-control" placeholder="Código" disabled>
                            </div>
                          </div>
                          <div class="form-group col-2 pt-4 mt-1 ml-auto">
                            <button class="btn btn-primary" style="width: 160px;" id="btnConsultarCustoMalhas" name="btnConsultarCustoMalhas" data-button="absolute" type="button">Buscar Custo
                              <i class="m-0 p-0 fas fa-search"></i>
                            </button>
                          </div>
                        </div>
                        <div class="form-row col-12">
                          <div class="form-row col-12 mt-2">
                            <div class="col-12 form-group">
                              <div class="col-12 table-responsive">
                                <table id="tabelaCustoMalhaBase" class="table table-select table-hover" style="width: 100%">
                                  <thead>
                                  </thead>
                                  <tbody>
                                  </tbody>
                                </table>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <div style="background-color: white; height: 1px; margin-bottom: 10px;">
              </div>
              <div id="divMalhaCrua">
                <div class="card card-header" role="tab" id="modalCustoMalhaCrua">
                  <a style="width:100%;" data-toggle="collapse" data-parent="#collapseMalhaCrua" href="#collapseMalhaCrua" aria-expanded="true" aria-controls="collapseOne1">
                    <div class="row">
                      <div style="max-width:20px;margin-top:auto; margin-bottom: auto" class="col-1">
                        <i class="fas fa-angle-down"></i>
                      </div>
                      <div class="col-11">
                        <h4 class="title-page">
                          Malhas Cruas
                        </h4>
                      </div>
                    </div>
                  </a>
                </div>
                <div class="collapse show" id="collapseMalhaCrua">
                  <div class="card card-body">
                    <div class="tab-pane fade show active" role="tabpanel" aria-labelledby="geral-tab">

                      <div class="col-12" id="gridMalhaCrua">
                        <div class="form-row col-12">
                          <div class="form-group col-3">
                            <label data-error="wrong" class="labelGeral" data-success="right" for="txtMalhaCrua">Código</label>
                            <div class="relative">
                              <input type="text" class="input-default focus form-control" id="txtMalhaCrua" required aria-describedby="uError" name="txtMalhaCrua" class="form-control" placeholder="Código" disabled>
                            </div>
                          </div>
                          <div class="form-group col-2 ml-auto">
                            <label data-error="wrong" class="labelGeral" data-success="right" for="txtCustoTec">Custo Tec</label>
                            <div class="relative">
                              <input type="text" class="input-default focus form-control" id="txtCustoTec" required aria-describedby="uError" name="txtCustoTec" class="form-control" placeholder="0.00">
                            </div>
                          </div>
                        </div>
                        <div class="form-row col-12">
                          <div class="form-row col-12 mt-2">
                            <div class="col-12 form-group">
                              <div class="col-12 table-responsive">
                                <table id="tabelaCustoMalhaCrua" class="table table-select table-hover" style="width: 100%">
                                  <thead>
                                  </thead>
                                  <tbody>
                                  </tbody>
                                </table>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div class="modal-footer">
              <button class="btn btn-primary btn-sisp mr-auto" id="btnGravarModalCusto"> Confirmar</button>
              <button class="btn bg-gradient-danger btn-sisp" id="btnFecharModalCusto"> Fechar</button>
            </div>
          </div>
        </div>
      </div>

      <div class="modal fade" id="modalAviamentos" tabindex="-1" data-backdrop="static" role="dialog" aria-labelledby="modalAviamentos" aria-hidden="true">
        <div class="modal-dialog" style="min-width: 95%; min-height: 100%">
          <div class="modal-content">
            <div class="modal-header">
              <h4 class="modal-title" id="tituloModalAviamentos"></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="flex flex-wrap align-items-end mb-2" style="gap: 8px">
                <button class="btn btn-primary btn-sisp" id="btnIncluirModalAviamentos">Incluir</button>
                <button class="btn btn-danger btn-sisp" id="btnExcluirModalAviamentos">Excluir</button>
                <button class="btn btn-secondary btn-sisp ml-auto" id="btnComposicaoModalAviamentos">Composição</button>
                <!-- <div class="flex flex-column">
                  <label>Preço:</label>
                  <select class="drilldown-item form-control select2 select2-danger focus" data-dropdown-css-class="select2-danger" id="selectBuscarPrecoModalAviamentos" style="border-color: #a9a9a9; font-size: 15px">
                    <option class="drilldown-item" value="M">Preço Máximo</option>
                    <option class="drilldown-item" value="P">Preço Padrão</option>
                  </select>
                </div> -->
              </div>
              <div class="table-responsive" style="overflow-x: hidden">
                <table id="tabelaModalAviamentos" class="table table-sm table-select table-hover" width="100%">
                  <thead>
                  </thead>
                  <tbody>
                  </tbody>
                </table>
              </div>
            </div>
            <div class="modal-footer">
              <button class="btn btnVerde btn-sisp mr-auto" id="btnConfirmarModalAviamentos"> Confirmar</button>
              <button class="btn btn-danger btn-sisp" data-dismiss="modal" id="btnFecharModalAviamentos"> Fechar</button>
            </div>
          </div>
        </div>
      </div>

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

      <!-- Control Sidebar -->
      <aside class="control-sidebar control-sidebar-dark">
        <!-- Control sidebar content goes here -->
      </aside>
      <!-- /.control-sidebar -->
    </div>
  </div>
  <!-- ./wrapper -->
  <script>
    function formatar(mascara, documento) {
      var i = documento.value.length;
      var saida = mascara.substring(0, 1);
      var texto = mascara.substring(i);

      if (texto.substring(0, 1) != saida) {
        documento.value += texto.substring(0, 1);
      }

    }
  </script>

  <!-- jQuery -->
  <script src="../plugins/jquery/jquery.min.js?versao=3.263.17.1"></script>
  <!-- jQuery UI 1.11.4 -->
  <script src="../plugins/jquery-ui/jquery-ui.min.js?versao=3.263.17.1"></script>
  <script type="text/javascript" src="../dist/js/jquery.dataTables.js?versao=3.263.17.1"></script>
  <script type="text/javascript" src="../dist/js/dataTables.bootstrap4.min.js?versao=3.263.17.1"></script>
  <!-- SweetAlert2 -->
  <script src="../plugins/sweetalert2/sweetalert2.min.js?versao=3.263.17.1"></script>
  <script src="../plugins/toastr/toastr.min.js?versao=3.263.17.1"></script>

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

  <script src="../plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.263.17.1"></script>

  <script src="../dist/js/adminlte.min.js?versao=3.263.17.1"></script>

  <script src="../dist/js/requisicoes.js?versao=3.263.17.1"></script>
  <script src="../dist/js/sisplan.js?versao=3.263.17.1"></script>
  <script src="../dist/js/cliente/entidade.js?versao=3.263.17.1"></script>
  <script src="../dist/js/loadingoverlay.min.js?versao=3.263.17.1"></script>
  <script src="../dist/js/valida_cpf_cnpj.js?versao=3.263.17.1"></script>
  <script src="../plugins/jquery-validation/jquery.validate.min.js?versao=3.263.17.1"></script>
  <script src="../dist/js/dataTables.keyTable.js?versao=3.263.17.1"></script>
  <script src="../utils/funcoes.js?versao=3.263.17.1"></script>
  <script src="../utils/cookies.js?versao=3.263.17.1"></script>
  <script src="../dist/js/jquery.maskMoney.min.js?versao=3.263.17.1"></script>
  <script src="../dist/js/jquery.mask.min.js?versao=3.263.17.1"></script>
  <script src="../dist/js/driver.min.js?versao=3.263.17.1"></script>
  <script type="text/javascript" src="../config.js?versao=3.263.17.1"></script>
  <script src="https://cdn.datatables.net/select/1.6.0/js/dataTables.select.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('CADMATPRECO');
      // if (!temAcesso.resultado) {
      //   toastrAcesso(temAcesso, BASE_URI);
      //   return;
      // }

      // const permissaoUsuarioLogado = await permissaoAcessos("CADMATPRECO");

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

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

      // // $(window).on("beforeunload", function(e) {
      // //   // e.preventDefault();
      // //   e.stopPropagation();
      // //   if (material != 'create') {
      // //     deletaRegistro("CADMATPRECO", getCookie("usuario"), material, getCookie("usuario"));
      // //   }
      // //   return undefined;
      // // });

      // // if (material != 'create') {
      // //   await liberarRegistro("CADMATPRECO", material);
      // // }

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

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

</html>