<?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 | Zera Estoque Produto</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css?versao=3.263.17.1">
  <link rel="stylesheet" href="dist/css/adminlte.min.css?versao=3.263.17.1">
  <link href='https://fonts.googleapis.com/css?family=Roboto:400,300,500,600,700,400italic' rel='stylesheet' type='text/css'>
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
  <link rel="stylesheet" href="dist/css/custom.css?versao=3.263.17.1">
  <link rel="stylesheet" href="dist/css/sisplan.css?versao=3.263.17.1">
  <link rel="stylesheet" type="text/css" href="dist/css/dataTables.bootstrap4.min.css?versao=3.263.17.1" />
  <link rel="shortcut icon" href="favicon.ico">
  <link rel="stylesheet" href="plugins/toastr/toastr.min.css?versao=3.263.17.1">
  <link rel="stylesheet" type="text/css" href="dist/css/driver.min.css?versao=3.263.17.1" />
  <link rel="stylesheet" href="dist/css/jquery-ui.css?versao=3.263.17.1">
  <link rel="stylesheet" href="plugins/icheck-bootstrap/icheck-bootstrap.min.css?versao=3.263.17.1">
  <link rel="stylesheet" href="plugins/select2/css/select2.min.css?versao=3.263.17.1">
  <link rel="stylesheet" href="plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css?versao=3.263.17.1">
  <link rel="stylesheet" href="dist/css/PesquisaVariosSelect2.css?versao=3.263.17.1">
  <link rel="stylesheet" href="plugins/datatables-colreorder/css/colReorder.bootstrap4.min.css?versao=3.263.17.1">
  <style>
    .radioStyle {
      border: solid #e0e4e6;
      border-radius: 4px;
      border-width: 2px;
      padding: 7.25px;
      height: 136px;
    }

    .campoSel {
      display: inline-block;
      position: absolute;
      width: 22px;
      height: 22px;
      border: 1px solid #D3CFC8;
      border-radius: 0;
    }

    .content-wrapper {
      margin-left: 0px !important;
    }

    .main-header,
    .main-sidebar {
      display: none;
    }
  </style>
</head>

<body class="hold-transition sidebar-mini layout-fixed">
  <div class="wrapper">
    <?php
    include_once('../../menu.php');
    ?>
    <div class="content-wrapper">
      <div class="content-header">
        <div class="container-fluid">
          <div class="row mb-2">
            <div class="col-sm-6 flex">
              <h1 class="m-0 text-dark">Zera Estoque Produto</h1>
              <button type="button" class="btn btn-info btn-sm ml-2" title="Tutorial" style="color: white;" id="tutorial">
                <i class="fas fa-question-circle"></i>
              </button>
            </div>
            <div class="col-sm-6">

            </div>
          </div>
        </div>
        <div class="card col-12 mt-5 container-fluid">
          <div class="row card-body d-flex justify-content-start" id="abaGeral">
            <div class="infFiltros row card-body d-flex justify-content-start">
              <div class="col-md-3 col-sm-3 col-12 form-group">
                <label data-error="wrong" data-success="right" for="txtMovimento">Movimento</label>
                <div class="input-group">
                  <input type="text" class="input-default focus form-control" disabled id="txtMovimento" name="txtMovimento" placeholder="Movimento" disabled>
                </div>
              </div>

              <div class="col-md-3 col-sm-3 col-12 form-group">
                <label data-error="wrong" data-success="right" for="txtDeposito">Depósito</label>
                <div class="relative">
                  <div class="input-group">
                    <select class="js-example-programmatic js-states form-control" id="txtDeposito" name="txtDeposito" multiple="multiple" required>
                    </select>
                    <div class="input-group-append">
                      <button class="btn bg-danger" id="btnDeposito" name="btnDeposito" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                      <button class="btn bg-danger" id="btnLimpaDeposito" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                    </div>
                  </div>
                </div>
              </div>

              <div class="col-md-3 col-sm-3 col-12 form-group">
                <label data-error="wrong" data-success="right" for="txtQualidade">Qualidade</label>
                <div class="relative">
                  <div class="input-group">
                    <select class="js-example-programmatic js-states form-control" id="txtQualidade" name="txtQualidade" multiple="multiple">
                    </select>
                    <div class="input-group-append">
                      <button class="btn bg-danger" id="btnQualidade" name="btnQualidade" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                      <button class="btn bg-danger" id="btnLimpaQualidade" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                    </div>
                  </div>
                </div>
              </div>

              <div class="col-md-3 col-sm-3 col-12 form-group">
                <label data-error="wrong" data-success="right" for="txtProduto">Produto</label>
                <div class="relative">
                  <div class="input-group">
                    <select class="js-example-programmatic js-states form-control" id="txtProduto" name="txtProduto" multiple="multiple">
                    </select>
                    <div class="input-group-append">
                      <button class="btn bg-danger" id="btnProduto" name="btnProduto" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                      <button class="btn bg-danger" id="btnLimpaProduto" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                    </div>
                  </div>
                </div>
              </div>

              <div class="col-md-3 col-sm-3 col-12 form-group">
                <label data-error="wrong" data-success="right" for="txtColecao">Coleção</label>
                <div class="relative">
                  <div class="input-group">
                    <select class="js-example-programmatic js-states form-control" id="txtColecao" name="txtColecao" multiple="multiple">
                    </select>
                    <div class="input-group-append">
                      <button class="btn bg-danger" id="btnColecao" name="btnColecao" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                      <button class="btn bg-danger" id="btnLimpaColecao" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                    </div>
                  </div>
                </div>
              </div>

              <div class="col-md-3 col-sm-3 col-12 form-group">
                <label data-error="wrong" data-success="right" for="txtLinha">Linha</label>
                <div class="relative">
                  <div class="input-group">
                    <select class="js-example-programmatic js-states form-control" id="txtLinha" name="txtLinha" multiple="multiple">
                    </select>
                    <div class="input-group-append">
                      <button class="btn bg-danger" id="btnLinha" name="btnLinha" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                      <button class="btn bg-danger" id="btnLimpaLinha" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                    </div>
                  </div>
                </div>
              </div>

              <div class="col-md-3 col-sm-3 col-12 form-group">
                <label data-error="wrong" data-success="right" for="txtMarca">Marca</label>
                <div class="relative">
                  <div class="input-group">
                    <select class="js-example-programmatic js-states form-control" id="txtMarca" name="txtMarca" multiple="multiple">
                    </select>
                    <div class="input-group-append">
                      <button class="btn bg-danger" id="btnMarca" name="btnMarca" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                      <button class="btn bg-danger" id="btnLimpaMarca" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                    </div>
                  </div>
                </div>
              </div>

              <div class="col-md-3 col-sm-3 col-12 form-group">
                <label data-error="wrong" data-success="right" for="txtCor">Cor</label>
                <div class="relative">
                  <div class="input-group">
                    <select class="js-example-programmatic js-states form-control" id="txtCor" name="txtCor" multiple="multiple">
                    </select>
                    <div class="input-group-append">
                      <button class="btn bg-danger" id="btnCor" name="btnCor" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                      <button class="btn bg-danger" id="btnLimpaCor" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                    </div>
                  </div>
                </div>
              </div>

              <div class="col-md-3 col-sm-3 col-12 form-group">
                <label data-error="wrong" data-success="right" for="txtTamanho">Tamanho</label>
                <div class="relative">
                  <div class="input-group">
                    <select class="js-example-programmatic js-states form-control" id="txtTamanho" name="txtTamanho" multiple="multiple">
                    </select>
                    <div class="input-group-append">
                      <button class="btn bg-danger" id="btnTamanho" name="btnTamanho" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                      <button class="btn bg-danger" id="btnLimpaTamanho" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                    </div>
                  </div>
                </div>
              </div>

              <div class="col-md-3 col-sm-3 col-12 form-group">
                <label data-error="wrong" data-success="right" for="txtTipoProduto">Tipo Produto</label>
                <div class="relative">
                  <div class="input-group">
                    <select class="js-example-programmatic js-states form-control" id="txtTipoProduto" name="txtTipoProduto" multiple="multiple">
                    </select>
                    <div class="input-group-append">
                      <button class="btn bg-danger" id="btnTipoProduto" name="btnTipoProduto" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                      <button class="btn bg-danger" id="btnLimpaTipoProduto" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                    </div>
                  </div>
                </div>
              </div>

              <div class="col-md-3 col-sm-3 col-12 form-group">
                <label data-error="wrong" data-success="right" for="txtLote">Lote</label>
                <div class="input-group">
                  <input type="text" class="input-default focus form-control" id="txtLote" name="txtLote" placeholder="Lote">
                </div>
              </div>

              <div class="col-md-3 col-sm-3 col-12 form-group">
                <label data-error="wrong" data-success="right" for="txtGrupo">Grupo</label>
                <div class="relative">
                  <div class="input-group">
                    <select class="js-example-programmatic js-states form-control" id="txtGrupo" name="txtGrupo" multiple="multiple">
                    </select>
                    <div class="input-group-append">
                      <button class="btn bg-danger" id="btnGrupo" name="btnGrupo" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                      <button class="btn bg-danger" id="btnLimpaGrupo" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                    </div>
                  </div>
                </div>
              </div>

              <div class="col-md-3 col-sm-3 col-12 form-group">
                <label data-error="wrong" data-success="right" for="txtEtiqueta">Etiqueta</label>
                <div class="relative">
                  <div class="input-group">
                    <select class="js-example-programmatic js-states form-control" id="txtEtiqueta" name="txtEtiqueta" multiple="multiple">
                    </select>
                    <div class="input-group-append">
                      <button class="btn bg-danger" id="btnEtiqueta" name="btnEtiqueta" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                      <button class="btn bg-danger" id="btnLimpaEtiqueta" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                    </div>
                  </div>
                </div>
              </div>

              <div class="col-md-3 col-sm-3 col-12 form-group">
                <label data-error="wrong" data-success="right" for="txtTipoMov">Tipo Baixa*</label>
                <div class="input-group">
                  <input type="text" class="input-default focus form-control validate" id="txtTipoMov" name="txtTipoMov" placeholder="Tipo Baixa">
                  <div class="input-group-append">
                    <button class="btn bg-danger" id="btnTipoMov" name="btnTipoMov" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                    <button class="btn bg-danger" id="btnLimpaTipoMov" name="btnLimpaTipoMov" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                  </div>
                </div>
              </div>

              <div class="col-md-3 col-sm-3 col-12 form-group">
                <label class="col-12 mt-2" for="cbDescontarReserva" style="margin: 0px; padding: 0px"><input type="checkbox" id="cbDescontarReserva">&nbsp;&nbsp;Descontar Reserva&nbsp;</label>
                <label class="col-12" for="cbDescontarExpedicao" style="margin: 0px; padding: 0px"><input type="checkbox" id="cbDescontarExpedicao">&nbsp;&nbsp;Descontar Expedição&nbsp;</label>
                <label class="col-12" for="cbEstoqueNegativo" style="margin: 0px; padding: 0px"><input type="checkbox" id="cbEstoqueNegativo">&nbsp;&nbsp;Estoque Negativo&nbsp;</label>
              </div>

              <div class="col-sm-3" style="margin-top: 28px;">
                <div class="input-group d-flex justify-content-end">
                  <button class=" btn btn-primary btn-sisp" id="btnConsultar"><span class="fas fa-search"></span> Consultar</button>
                </div>
              </div>
            </div>
            <div class="icheck-primary" style="margin-left: 27px;">
              <input class="form-check-input" type="checkbox" id="check_todos" value="option1">
              <label class="form-check-label" for="check_todos" id="check_todosTourNFE">Selecionar Todos</label>
            </div>
            <div class="col-sm-12 table-responsive card-body">
              <table id="tabelaEstoque" class="table table-responsive-sm table-select table-hover" width="100%">
                <thead>
                </thead>
                <tbody>
                </tbody>
              </table>
            </div>
          </div>
          <div class="col-sm-12 d-flex justify-content-end">
            <div class="col-lg-1 form-group">
              <label data-error="wrong" data-success="right" for="txtQuantidade">Quantidade</label>
              <div class="input-group">
                <input type="text" class="input-default focus form-control text-right" id="txtQuantidade" name="txtQuantidade" placeholder="Quantidade" disabled>
              </div>
            </div>
            <div class="col-lg-1 form-group" style="padding-top: 28px">
              <button id="btnGravar" class="btn btn-danger btn-sisp">Gravar</button>
            </div>
          </div>
        </div>
      </div>

    </div>
  </div>
  <?php
  include_once('../../modais.php');
  ?>
  <aside class="control-sidebar control-sidebar-dark">
  </aside>
  </div>
  <script src="plugins/jquery/jquery.min.js?versao=3.263.17.1"></script>
  <script type="text/javascript" src="dist/js/jquery.dataTables.js?versao=3.263.17.1"></script>
  <script type="text/javascript" src="dist/js/dataTables.bootstrap4.min.js?versao=3.263.17.1"></script>
  <script src="plugins/jquery-ui/jquery-ui.min.js?versao=3.263.17.1"></script>
  <script>
    $.widget.bridge('uibutton', $.ui.button);
  </script>
  <script src="plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.263.17.1"></script>
  <script src="dist/js/adminlte.min.js?versao=3.263.17.1"></script>
  <script src="dist/js/sisplan.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/requisicoes.js?versao=3.263.17.1"></script>
  <script src="dist/js/loadingoverlay.min.js?versao=3.263.17.1"></script>
  <script src="dist/js/driver.min.js?versao=3.263.17.1"></script>
  <script src="plugins/toastr/toastr.min.js?versao=3.263.17.1"></script>
  <script src="plugins/select2/js/select2.full.min.js?versao=3.263.17.1"></script>
  <script type="text/javascript" src="dist/js/sum().js?versao=3.263.17.1"></script>
  <script type="text/javascript" src="config.js?versao=3.263.17.1"></script>
  <script src="plugins/datatables-colreorder/js/dataTables.colReorder.min.js?versao=3.263.17.1"></script>
  <script>
    $(document).ready(async function() {
      if (getCookie('usuario') == "") {
        window.location.href = `${BASE_URI}/login`;
        return;
      }

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

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

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

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

    });
  </script>
</body>

</html>