<?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 | Pedido B2B</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="cache-control" content="max-age=0" />
  <meta http-equiv="cache-control" content="no-cache" />
  <meta http-equiv="expires" content="0" />
  <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
  <!-- Theme style -->
  <link rel="stylesheet" href="../dist/css/adminlte.min.css?versao=3.2512.9.1">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="../plugins/fontawesome-free/css/all.min.css?versao=3.2512.9.1">
  <!-- Google Font: Source Sans Pro -->
  <link href='https://fonts.googleapis.com/css?family=Roboto:400,300,500,600,700,400italic' rel='stylesheet' type='text/css'>
  <link href='../dist/css/bootstrap.min.css'>
  <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="../plugins/datatables-keytable/css/keyTable.bootstrap4.min.css?versao=3.2512.9.1">
  <link rel="stylesheet" type="text/css" href="../dist/css/responsive.bootstrap.min.css">
  <link rel="shortcut icon" href="../favicon.ico">
  <!-- Toastr -->
  <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="../plugins/select2/css/select2.min.css?versao=3.2512.9.1">
  <link rel="stylesheet" href="../plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css?versao=3.2512.9.1">
  <link rel="stylesheet" href="../dist/css/animate.min.css?versao=3.2512.9.1">
  <link rel="stylesheet" href="../plugins/owl/assets/owl.carousel.min.css?versao=3.2512.9.1">
  <link rel="stylesheet" href="../plugins/owl/assets/owl.theme.default.min.css?versao=3.2512.9.1">
  <link rel="stylesheet" href="../dist/css/normalize.css?versao=3.2512.9.1">
  <link rel="stylesheet" href="../plugins/icheck-bootstrap/icheck-bootstrap.min.css?versao=3.2512.9.1">
  <link rel="stylesheet" href="../pages/pedidosb2b/css/pedidosb2b.css?versao=3.2512.9.1">
  <link rel="stylesheet" href="../dist/css/cards-financeiro.css">
</head>
<style>
  .mostrarMaisInformativo {
    color: var(--font-color);
    text-decoration: none !important;
  }
</style>

<body class="sidebar-mini layout-fixed sidebar-closed sidebar-collapse">

  <header>
    <div class="card-header" id="menu_top">
      <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
        <div class="d-flex">
          <h6 style="color:white!important;margin-top:auto;margin-bottom:auto;margin-right:10px">PedidoB2B
          </h6>

          <!-- <button title="Tutorial" type="button" class="btn btn-info btn-sm" style="color: white;margin-right:10px;" id="tutorial">
            <i class="fas fa-question-circle"></i>
          </button> -->


        </div>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
          <span class="navbar-toggler-icon"></span>
        </button>

        <div class="collapse navbar-collapse" id="navbarSupportedContent">
          <ul class="navbar-nav mr-auto ml-auto">
            <li class="nav-item text-align-center text-center">
              <div class="d-flex justify-content-center">
                <div class="row" id="txtAtendimento" style="width: 160px; min-width: 160px; max-width: 160px;">
                  <div class="col-12">
                    <h6 style="color:white!important;margin:0;padding:0;">Atendimento</h6>
                  </div>
                  <div class="col-12">
                    <h6 style="color:green!important;" id="txt_atendimento_atual"></h6>
                  </div>
                </div>
                <div class="caixa_card" style="border-left: 1px solid #CDCDCD; min-width: 180px; max-width: 180px;" class="row">
                  <div class="col-12">
                    <h6 style="color:white!important;margin:0;padding:0;">Usuário</h6>
                  </div>
                  <div class="col-12">
                    <h6 style="color:white!important;" id="txt_usuario_logado"></h6>
                  </div>
                </div>
              </div>
            </li>
          </ul>
          <button type="button" class="btn btn-info float-right mr-2" style="color: white;" id="contador">
            <i class="fa fa-play" aria-hidden="true"></i>
            <input type="text" value="00:00:00" disabled="true" style="color: white;" class="inputContador" id="txtContador">
          </button>
          <button type="button" class="btn btn-info float-right mr-2" style="color: white;" id="btn-sair">
            <i class="fas fa-sign-out-alt"></i> Sair B2B
          </button>
        </div>
      </nav>
    </div>
  </header>
  <main>
    <div class="wrappers" id="principal">
      <!-- Content Wrapper. Contains page content -->
      <div class="content-wrappers">
        <section class="content">
          <div class="container-fluid">
            <div class="row">
              <div class="col-12">
                <div class="card" style="height:auto;">
                  <div class="card-body" style="padding-bottom: 0px!important;">
                    <form id="msform" name="msform">

                      <fieldset id="fieldset_info" class="pb-0" style="display:none">
                        <div class="form-card">
                          <div class="card" style="height:auto;">
                            <div class="card-body container-box ">

                              <div class="row">
                                <div class="col-md-6 col-12">
                                  <div class="row">
                                    <div class="col-sm-12 col-12" id="divResponsavel">
                                      <label data-error="wrong" data-success="right" for="txtResponsavel">Responsável</label>
                                      <div class="input-group">
                                        <input type="text" data-selecionado="false" class="input-default focus form-control" id="txtResponsavel" name="txtResponsavel" class="form-control" placeholder="Responsavel">
                                        <div class="input-group-append">
                                          <button class="btn bg-danger" id="btn-Responsavel" name="btn-Responsavel" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                          <button class="btn bg-danger" id="btn-limpa-Responsavel" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                  <input type="text" data-selecionado="false" class="d-none" id="txtCoordenador" name="txtCoordenador" class="form-control">

                                  <div class="row">
                                    <div class="col-12" id="divVendedor">
                                      <label data-error="wrong" class="mt-2" data-success="right" for="txtVendedor">Vendedor</label>
                                      <div class="input-group">
                                        <input type="text" data-selecionado="false" class="input-default focus form-control" id="txtVendedor" name="txtVendedor" class="form-control" placeholder="Vendedor" required>
                                        <div class="input-group-append">
                                          <button class="btn bg-danger" id="btn-Vendedor" name="btn-Vendedor" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                          <button class="btn bg-danger" id="btn-limpa-vendedor" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                  <div class="row">
                                    <div class="col-12" id="divCliente">
                                      <label data-error="wrong" class="mb-0 mt-2" data-success="right" for="txtCliente">Cliente
                                        <label style="font-size: 83%" data-error="wrong" data-success="right" for="txtCliente">- [F3 - Consulta Cliente]</label>
                                      </label>
                                      <div class="input-group">
                                        <input type="text" data-selecionado="false" class="input-default focus form-control" id="txtCliente" name="txtCliente" class="form-control" placeholder="Cliente">
                                        <div class="input-group-append">
                                          <button class="btn bg-danger" id="btn-cliente" name="btn-cliente" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                          <button class="btn bg-danger" id="btn-limpa-cliente" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                  <div class="row">
                                    <div class="col-12" id="divFormaContato">
                                      <label data-error="wrong" class="mt-2" data-success="right" for="txtFormaContato">Forma de Contato</label>
                                      <div class="input-group">
                                        <input type="text" data-selecionado="false" class="input-default focus form-control" id="txtFormaContato" name="txtFormaContato" class="form-control" placeholder="Forma de Contato">
                                        <div class="input-group-append">
                                          <button class="btn bg-danger" id="btn-FormaContato" name="btn-FormaContato" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                          <button class="btn bg-danger" id="btn-limpa-FormaContato" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                  <div class="row">
                                    <div class="col-12" id="divTabelaPreco">
                                      <label data-error="wrong" class="mt-2" data-success="right" for="txtTabela">Tabela</label>
                                      <div class="input-group">
                                        <input type="text" data-selecionado="false" class="input-default focus form-control" id="txtTabela" name="txtTabela" class="form-control" placeholder="Tabela">
                                        <div class="input-group-append">
                                          <button class="btn bg-danger" id="btn-tabela" name="btn-tabela" data-button="absolute" type="button"><i class="m-0 p-0 fas fa-search"></i></button>
                                          <button class="btn bg-danger" id="btn-limpa-tabela" type="button"><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                  <div class="row d-none">
                                    <div class="col-12" id="divDesigner">
                                      <label data-error="wrong" class="mt-2" data-success="right" for="txtDesigner">Designer</label>
                                      <div class="input-group">
                                        <input type="text" data-selecionado="false" class="input-default focus form-control" id="txtDesigner" name="txtDesigner" class="form-control" placeholder="Designer" disabled>
                                        <div class="input-group-append">
                                          <button class="btn bg-danger" id="btn-Designer" name="btn-Designer" data-button="absolute" type="button" disabled><i class="m-0 p-0 fas fa-search"></i></button>
                                          <button class="btn bg-danger" id="btn-limpa-Designer" type="button" disabled><i class="m-0 p-0 fas fa-trash"></i></button>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </div>

                                <div class="col-md-6 col-12">

                                  <div class="row mt-2">
                                    <div class="col-4" id="divCNPJ">
                                      <label data-error="wrong" data-success="right" for="txtCNPJ">CPF / CNPJ</label>
                                      <div class="input-group">
                                        <input type="text" placeholder="CPF / CNPJ" class="input-default focus form-control" id="txtCNPJ" name="txtCNPJ">
                                      </div>
                                    </div>
                                    <div class="col-4">
                                      <label data-error="wrong" data-success="right" for="txtLimiteCreditoCli">Limite Crédito</label>
                                      <div class="input-group">
                                        <input type="number" data-selecionado="false" class="input-default form-control" id="txtLimiteCreditoCli" name="txtLimiteCreditoCli" class="form-control" placeholder="Limite Crédito" readonly>
                                      </div>
                                    </div>
                                    <div class="col-4">
                                      <label data-error="wrong" data-success="right" for="txtLimiteCreditoConsignado">Crédito Grupo</label>
                                      <div class="input-group">
                                        <input type="number" data-selecionado="false" class="input-default form-control" id="txtLimiteCreditoConsignado" name="txtLimiteCreditoConsignado" title="Este campo busca o valor do (Crédito Grupo) informado no cadastro do cliente, validando o campo histórico do cliente. Se o cadastro do histórico estiver marcado o check (Utiliza Crédito Grupo), desconta do (Crédito Grupo) o valor das duplicatas em aberto do cliente." class="form-control" placeholder="Crédito Grupo" readonly>
                                      </div>
                                    </div>
                                  </div>

                                  <div class="row mt-2">
                                    <div class="col-4" id="divTelefone">
                                      <label data-error="wrong" data-success="right" for="txtTelefoneInfoCliente">Telefone</label>
                                      <input type="text" readonly class="input-default focus form-control" id="txtTelefoneInfoCliente" name="txtTelefoneInfoCliente" placeholder="Telefone">
                                    </div>
                                    <div class="col-4">
                                      <label data-error="wrong" data-success="right" for="txtLimiteCreditoCliDispDisp">Limite Crédito Disponível</label>
                                      <div class="input-group">
                                        <input type="number" data-selecionado="false" class="input-default form-control" id="txtLimiteCreditoCliDispDisp" name="txtLimiteCreditoCliDispDisp" class="form-control" placeholder="Limite Crédito" readonly>
                                      </div>
                                    </div>
                                    <div class="col-4">
                                      <label data-error="wrong" data-success="right" for="txtLimiteCreditoConsignadoDisp">Crédito Grupo Disponível</label>
                                      <div class="input-group">
                                        <input type="number" data-selecionado="false" class="input-default form-control" id="txtLimiteCreditoConsignadoDisp" name="txtLimiteCreditoConsignadoDisp" title="Este campo busca o valor do (Crédito Grupo) informado no cadastro do cliente, validando o campo histórico do cliente. Se o cadastro do histórico estiver marcado o check (Utiliza Crédito Grupo), desconta do (Crédito Grupo) o valor das duplicatas em aberto do cliente." class="form-control" placeholder="Crédito Grupo" readonly>
                                      </div>
                                    </div>
                                  </div>

                                  <div class="row mt-2">
                                    <div class="col-8">
                                      <label data-error="wrong" data-success="right" for="txtEnderecoInfo">Endereço</label>
                                      <div class="input-group">
                                        <input type="text" data-selecionado="false" class="input-default form-control" id="txtEnderecoInfo" name="txtEnderecoInfo" class="form-control" placeholder="Endereço" readonly>
                                      </div>
                                    </div>
                                    <div class="col-4">
                                      <label data-error="wrong" data-success="right" for="txtBairroInfo">Bairro</label>
                                      <div class="input-group">
                                        <input type="text" data-selecionado="false" class="input-default form-control" id="txtBairroInfo" name="txtBairroInfo" class="form-control" placeholder="Bairro" readonly>
                                      </div>
                                    </div>
                                  </div>

                                  <div class="row mt-2">
                                    <div class="col-4">
                                      <label data-error="wrong" data-success="right" for="txtCidadeEstadoInfo">Cidade/Estado</label>
                                      <div class="input-group">
                                        <input type="text" data-selecionado="false" class="input-default form-control" id="txtCidadeEstadoInfo" name="txtCidadeEstadoInfo" class="form-control" placeholder="Cidade/Estado" readonly>
                                      </div>
                                    </div>
                                    <div class="col-4">
                                      <label data-error="wrong" data-success="right" for="txtCEPClienteInfo">CEP</label>
                                      <div class="input-group">
                                        <input type="text" data-selecionado="false" class="input-default form-control" id="txtCEPClienteInfo" name="txtCEPClienteInfo" class="form-control" placeholder="CEP" readonly>
                                      </div>
                                    </div>
                                    <div class="col-4">
                                      <label data-error="wrong" data-success="right" for="txtClassificacaoCliente">Classificação</label>
                                      <div class="input-group">
                                        <input type="text" data-selecionado="false" class="input-default form-control" id="txtClassificacaoCliente" name="txtClassificacaoCliente" class="form-control" placeholder="Classificação" readonly>
                                      </div>
                                    </div>
                                  </div>

                                  <div class="row mt-2 d-none">
                                    <div class="col-12">
                                      <label for="textDescricaoPedido">Observação</label>
                                      <input type="text" id="textDescricaoPedido" placeholder="Descrição Pedido" class="input-default focus form-control">
                                      </input>
                                    </div>
                                  </div>
                                </div>
                              </div>

                            </div>
                          </div>
                        </div>
                        <div class="form-card d-none" id="informativos">

                        </div>



                        <div id="informativo" class="informativos">
                          <div class="card card-header collapseHeader mb-0 col-12" role="tab">
                            <a style="width:100%;" class="collapseInformativos" data-toggle="collapse" data-parent="#collapseInformativos" href="#collapseInformativos" aria-expanded="true" aria-controls="collapseOne1">
                              <div class="col-12 d-flex align-items-center justify-content-center pointer" id="btn-mostrar-informativos">
                                <span class="mostrarMaisInformativo">Mostrar Mais <i class="fas fa-angle-down"></i></span>
                              </div>
                            </a>
                          </div>

                          <div class="collapse" id="collapseInformativos">
                            <div class="card" style="height:auto;">
                              <div class="card-body container-box pb-0">

                                <div class="row">

                                  <div class="col-lg-3 col-12">
                                    <div class="small-box bg-secondary ">
                                      <div class="inner">
                                        <h3 id="txt_titulos_vencer">
                                          R$ 0,00
                                        </h3>
                                        <div class="d-flex" style="align-items:baseline; justify-content: space-between;">
                                          <p class="p-0 m-0">Titulos a Vencer</p>
                                          <div class="pointer" id="btn-VerInformativoTitulosVencer" style="text-decoration: underline;">Ver mais</div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>

                                  <div class="col-lg-3 col-12">
                                    <div class="small-box bg-secondary ">
                                      <div class="inner">
                                        <h3 id="txt_titulos_vencidos">
                                          R$ 0,00
                                        </h3>
                                        <div class="d-flex" style="align-items:baseline; justify-content: space-between;">
                                          <p class="p-0 m-0">Titulos Vencidos</p>
                                          <div class="pointer" id="btn-VerInformativoTitulosVencidos" style="text-decoration: underline;">Ver mais</div>
                                        </div>
                                      </div>
                                      <div class="icon">
                                        <i class="ion ion-bag"></i>
                                      </div>
                                    </div>
                                  </div>

                                  <div class="col-lg-3 col-12">
                                    <div class="small-box bg-secondary ">
                                      <div class="inner">
                                        <h3 id="txt_titulosGrupo_vencer">
                                          R$ 0,00
                                        </h3>
                                        <div class="d-flex" style="align-items:baseline; justify-content: space-between;">
                                          <p class="p-0 m-0">Titulos Grupo a vencer</p>
                                          <div class="pointer" id="btn-VerInformativoGrupoVencer" style="text-decoration: underline;">Ver mais</div>
                                        </div>
                                      </div>
                                      <div class="icon">
                                        <i class="ion ion-stats-bars"></i>
                                      </div>
                                    </div>
                                  </div>

                                  <div class="col-lg-3 col-12">
                                    <div class="small-box bg-secondary ">
                                      <div style="color:white!important;" class="inner">
                                        <h3 id="txt_titulosGrupo_vencidos">
                                          R$ 0,00
                                        </h3>
                                        <div class="d-flex" style="align-items:baseline; justify-content: space-between;">
                                          <p class="p-0 m-0">Titulos Grupo Vencidos</p>
                                          <div class="pointer" id="btn-VerInformativoGrupoVencidos" style="text-decoration: underline;">Ver mais</div>
                                        </div>
                                      </div>
                                      <div class="icon">
                                        <i class="ion ion-pie-graph"></i>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                                <div class="row">
                                  <div class="col-lg-3 col-12">
                                    <div class="small-box bg-secondary ">
                                      <div class="inner">
                                        <h3 id="txt_cheques_vencer">
                                          R$ 0,00
                                        </h3>
                                        <div class="d-flex" style="align-items:baseline; justify-content: space-between;">
                                          <p class="p-0 m-0">Cheques a Vencer</p>
                                          <div class="pointer" id="btn-VerInformativoChequesVencer" style="text-decoration: underline;">Ver mais</div>
                                        </div>
                                      </div>
                                      <div class="icon">
                                        <i class="ion ion-bag"></i>
                                      </div>
                                    </div>
                                  </div>

                                  <div class="col-lg-3 col-12">
                                    <div class="small-box bg-secondary ">
                                      <div class="inner">
                                        <h3 id="txt_cheques_vencidos">
                                          R$ 0,00
                                        </h3>
                                        <div class="d-flex" style="align-items:baseline; justify-content: space-between;">
                                          <p class="p-0 m-0">Cheques Vencidos</p>
                                          <div class="pointer" id="btn-VerInformativoChequesVencidos" style="text-decoration: underline;">Ver mais</div>
                                        </div>
                                      </div>
                                      <div class="icon">
                                        <i class="ion ion-bag"></i>
                                      </div>
                                    </div>
                                  </div>

                                  <div class="col-lg-3 col-12">
                                    <div class="small-box bg-secondary ">
                                      <div class="inner">
                                        <h3 id="txt_credito_antecipacao">
                                          R$ 0,00
                                        </h3>
                                        <div class="d-flex" style="align-items:baseline; justify-content: space-between;">
                                          <p class="p-0 m-0">Credito / Antecipação</p>
                                          <div class="pointer" id="btn-VerInformativoCreditoAntecipacao" style="text-decoration: underline;">Ver mais</div>
                                        </div>
                                      </div>
                                      <div class="icon">
                                        <i class="ion ion-stats-bars"></i>
                                      </div>
                                    </div>
                                  </div>

                                  <div class="col-lg-3 col-12">
                                    <div class="small-box bg-secondary ">
                                      <div style="color:white!important;" class="inner">
                                        <h3 id="txt_pedidos_pendentes">
                                          R$ 0,00
                                        </h3>
                                        <div class="d-flex" style="align-items:baseline; justify-content: space-between;">
                                          <p class="p-0 m-0">Pedidos Pendentes</p>
                                          <div class="pointer" id="btn-VerInformativoPedidosPendentes" style="text-decoration: underline;">Ver mais</div>
                                        </div>
                                      </div>
                                      <div class="icon">
                                        <i class="ion ion-pie-graph"></i>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </fieldset>

                      <fieldset id="fieldset_produto" class="pb-0" style="display:none;">
                        <div class="form-card">
                          <div class="row" id="itensPedido">
                            <div class="col-lg-6 col-md-12 col-sm-12 col-12 pl-0 pr-1" id="addItemTour">
                              <div class="card" style="height: 100%">
                                <div class="card-body container-box" id="card-prod">
                                  <div class="row mb-2 d-flex align-items-center" style="border-bottom: 1px solid #dee2e6">
                                    <div class="col-sm-4">
                                      <h5>Adicionar Itens</h5>
                                    </div>
                                    <div class="col-sm-8 d-flex align-items-center justify-content-end mb-1" title="Integração RFID">
                                      <i title='desativar som bipagem' style="font-size: 20px" class="fas fa-volume-up somAtivo d-none"></i>
                                      <i title='ativar som bipagem' style="font-size: 20px" class="fas fa-volume-mute somInativo"></i>
                                    </div>
                                  </div>
                                  <div style="margin-bottom:15px" class="row">

                                    <div class="col-lg-8 col-12">

                                      <div class="" id="divItem">
                                        <div class="group-default form-group">
                                          <div class="input-group">
                                            <input type="text" id="txtIdItem" class="d-none" name="txtIdItem">
                                            <input style="margin-top:9px;" type="text" placeholder="Item" class="input-default form-control validate focus" id="txtCodigo" name="txtCodigo">
                                            <div class="input-group-append" style="margin-top: 9px;">
                                              <button type="button" class="btn-icon btn-icon-normal bg-danger" id="btn-codigo" name="btn-codigo">
                                                <i style="color: white;font-size:20px;margin-left:-10px;padding:0px" class="fas fa-search"></i>
                                              </button>
                                            </div>
                                          </div>
                                        </div>
                                      </div>

                                      <div class="row d-flex align-items-center px-2" style="justify-content: space-between; flex-wrap: nowrap; grid-gap: 5px">
                                        <div style="width: 100%;">
                                          <div class="form-group">
                                            <label for="infoprodUnidade">UN</label>
                                            <div class="relative">
                                              <input type="text" class="input-default focus form-control" id="infoprodUnidade" name="infoprodUnidade" readonly>
                                            </div>
                                          </div>
                                        </div>
                                        <div style="width: 100%;">
                                          <div class="form-group">
                                            <label for="infoprodMedia">Media</label>
                                            <div class="relative">
                                              <input type="text" class="input-default focus form-control" id="infoprodMedia" name="infoprodMedia" readonly>
                                            </div>
                                          </div>
                                        </div>
                                        <div style="width: 100%;">
                                          <div class="form-group">
                                            <label for="infoprodLargura">Largura</label>
                                            <div class="relative">
                                              <input type="text" class="input-default focus form-control" id="infoprodLargura" name="infoprodLargura" readonly>
                                            </div>
                                          </div>
                                        </div>
                                        <div style="width: 100%;">
                                          <div class="form-group">
                                            <label for="infoprodGramatura">Gramatura</label>
                                            <div class="relative">
                                              <input type="text" class="input-default focus form-control" id="infoprodGramatura" name="infoprodGramatura" readonly>
                                            </div>
                                          </div>
                                        </div>
                                        <div style="width: 100%;">
                                          <div class="form-group">
                                            <label for="infoprodpreco">Preço</label>
                                            <div class="relative">
                                              <input type="text" class="input-default focus form-control" id="infoprodpreco" name="infoprodpreco" readonly>
                                            </div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>

                                    <div class="col-lg-4 col-12 d-flex align-items-center justify-content-center">
                                      <div class="form-group" style="text-align:center">
                                        <div class="relative" style="display: flex;justify-content: center;align-items: center;">
                                          <img class="pop img img-fluid" id="infoFotoItem" style="max-height:150px;max-width:150px;margin-left: auto;margin-right: auto;" src="<?php echo BASE_URI; ?>/dist/img/prod-1.png">
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>

                            <div class="col-lg-6 col-md-12 col-sm-12 col-12 pr-0 pl-1" id="listaItemTour">
                              <div class="card" style="height: 100%">
                                <div class="card-body container-box">
                                  <div class="row mb-1">
                                    <div class="col-lg-4 col-12 d-flex align-items-center">
                                      <h5>Itens na Mesa</h5>
                                    </div>
                                    <div class="col-lg-8 col-12 d-flex align-items-end justify-content-end">
                                      <div class="mr-2">Atendidos: <span id="comparativoAtendido"></span></div>
                                      <div class="mr-2">Venda: <span id="comparativoVenda"></span> </div>
                                      <div class="">Aprov.: <span id="comparativoAproveitamento"></span> </div>
                                    </div>

                                    <div class="col-12 table-responsive">
                                      <table id="tabelaItensMesa" style="width:100%;" width="100%" class="table table-sm table-select">
                                        <thead>
                                        </thead>
                                        <tbody></tbody>
                                      </table>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>

                            <table id="tabelaItensCompletos" style="width:100%;" width="100%" class="table table-sm table-select d-none">
                              <thead>
                              </thead>
                              <tbody></tbody>
                            </table>
                          </div>

                          <div class="row my-2">
                            <div class="col-12 table-responsive">
                              <table id="tabelaCor" width="100%" class="table table-sm table-select">
                                <thead>
                                </thead>
                                <tbody></tbody>
                              </table>
                            </div>
                            <div class="col-12 d-flex align-items-end justify-content-end">
                              <button type="button" class="btn btn-sisp btn-danger d-none mt-2" id="btnGravarCor">Gravar Cores</button>
                            </div>
                          </div>

                          <div class="row">
                            <div class="info-box " style="background-color: var(--blue-color)!important;justify-content: flex-end;">
                              <div class="row" style="width: 100%; display: flex; justify-content: space-between; align-items: center; grid-gap: 10px;">
                                <div class="d-flex pointer" id="btnCarrinho">
                                  <div class="flex">
                                    <span class="info-box-icon"><i class="fas fa-cart-plus text-white" style="font-size: 20px;"></i></span>
                                    <div class="info-box-content">
                                      <span class="info-box-text text-white" style="font-size:15px">Carrinho.</span>
                                      <span id="total_itensCarrinhos" class="info-box-number text-white" style="font-size:15px">0</span>
                                    </div>
                                  </div>
                                </div>
                                <div class="">
                                  <div class="flex">
                                    <span class="info-box-icon"><i class="fas fa-luggage-cart text-white" style="font-size: 20px;"></i></span>
                                    <div class="info-box-content">
                                      <span class="info-box-text text-white" style="font-size:15px">Total Qtde.</span>
                                      <span id="total_itensQuantidades" class="info-box-number text-white" style="font-size:15px">0</span>
                                    </div>
                                  </div>
                                </div>
                                <div class="">
                                  <div class="flex">
                                    <span class="info-box-icon"><i class="fas fa-dollar-sign text-green" style="font-size: 20px;"></i></span>
                                    <div class="info-box-content">
                                      <span class="info-box-text text-white" style="font-size:15px">Total Orig.</span>
                                      <span id="total_orig" class="info-box-number text-white" style="font-size:15px">0</span>
                                    </div>
                                  </div>
                                </div>
                                <div class="">
                                  <div class="flex">
                                    <span class="info-box-icon"><i class="fas fa-dollar-sign text-red" style="font-size: 20px;"></i></span>
                                    <div class="info-box-content">
                                      <span class="info-box-text text-white" style="font-size:15px">Total Desc.</span>
                                      <span id="total_desc" class="info-box-number text-white" style="font-size:15px">0</span>
                                    </div>
                                  </div>
                                </div>
                                <div class="">
                                  <div class="flex">
                                    <span class="info-box-icon"><i class="fas fa-shopping-cart text-white" style="font-size: 20px;"></i></span>
                                    <div class="info-box-content ">
                                      <span class="info-box-text text-white" style="font-size:15px">SubTotal</span>
                                      <span id="subtotal_Pedido" class="info-box-number text-white" style="font-size:15px">R$&nbsp;0,00</span>
                                    </div>
                                  </div>
                                </div>
                                <div class="">
                                  <div class="flex">
                                    <span class="info-box-icon credito_cliente"><i class="fas fa-hand-holding-usd text-white" style="font-size: 20px;"></i></span>
                                    <div class="info-box-content credito_cliente">
                                      <span class="info-box-text text-white" style="font-size:15px">Crédito</span>
                                      <span id="credito_cliente" class="info-box-number text-white" style="font-size:15px">R$&nbsp;0,00</span>
                                      <div class="d-flex">
                                        <span class="info-box-number text-white" style="font-size:13px">Saldo:&nbsp;</span>
                                        <span id="credito_cliente_saldo" class="info-box-number text-green" style="font-size:13px">R$&nbsp;0,00</span>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                                <div class="">
                                  <div class="flex">
                                    <span class="info-box-icon"><i class="fas fa-equals text-white" style="font-size: 25px;"></i></span>
                                    <div class="info-box-content">
                                      <span class="info-box-text text-white" style="font-size:15px">Saldo</span>
                                      <span id="saldo_geral" class="info-box-number text-white" style="font-size:15px">R$&nbsp;0,00</span>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </fieldset>

                      <fieldset id="fieldset_finalizaPedido" style="display:none">
                        <div class="card">
                          <div class="card-body container-box">
                            <div style="border-bottom: 1px solid #dee2e6" class="mb-4">
                              <h5>Finalizar Pedido</h5>
                            </div>

                            <div id="collapsePedidos"></div>

                          </div>
                          <div class="d-flex mt-3" style="justify-content: space-between; align-items: center;">

                            <div class="d-flex">
                              <h5>Valor Total Pedidos: <span id="txtValorTotalPedidos" class="ml-1"></span></h5>
                            </div>
                            <div>
                              <button id="btnDeixarPendente" type="button" class="btn btn-lg btn-sisp btn-success">Carrinho</button>
                              <button id="btnFinalizarPedido" type="button" class="btn btn-lg btn-sisp btn-success">Finalizar Pedido</button>
                            </div>
                          </div>
                        </div>

                      </fieldset>
                    </form>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </section>

      </div>
      <footer class="footer">
        <div class="row text-center">
          <div class="col-12">
            <div class="btn-group flex-wrap btn-group-justified btn-group-lg mb-1" role="group" aria-label="Basic example">
              <button type="button" id="btnCancelarPedido" class="botoesMenu btn btn-secondary">Cancelar</button>
              <button type="button" id="btnInfo" class="botoesMenu btn btn-secondary">Informações (F5)</button>
              <button type="button" id="btnItens" class="botoesMenu btn btn-secondary">Itens (F6)</button>
              <button type="button" id="btnFinalizaPedido" class="botoesMenu btn btn-secondary">Finaliza Pedido (F7)</button>
            </div>
          </div>
        </div>
      </footer>
    </div>
  </main>

  <div class="modal fade" id="imagemodal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-body">
          <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
          <img src="" class="imagepreview" style="width: 100%;">
          <div class="corMaterialPreview mt-3"></div>
        </div>
      </div>
    </div>
  </div>

  <div class="modal fade" id="modal-carrinho" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-xl">
      <div class="modal-content">
        <div class="modal-header" style="border:none">
          <h4 id="modal-simular-titulo" class="modal-title">Carrinho</h4>
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body">
          <div class="row">

            <div class="col-12 table-responsive ">
              <table id="tabelaCarrinho" style="width:100%;" width="100%" class="table table-sm table-select">
                <thead></thead>
                <tbody></tbody>
              </table>
            </div>

          </div>
        </div>
        <!-- <div class="col-sm-4">
          <button name="btn-confirmarduplicata" class="btn btn-info btn-block text-white" id="btn-confirmarduplicata" value="">Confirmar <small>(ALT + S)</small></button>
        </div> -->

      </div>
    </div>
  </div>

  <div class="modal fade" id="modal-informativo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-xl">
      <div class="modal-content">
        <div class="modal-header" style="border:none">
          <h4 id="modal-simular-titulo" class="modal-title">Débitos do Cliente</h4>
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body">
          <div class="row">

            <div class="col-12 table-responsive ">
              <table id="tabelaInformativo" style="width:100%;" width="100%" class="table table-sm table-select">
                <thead></thead>
                <tbody></tbody>
              </table>
            </div>

          </div>
        </div>
        <div class="col-sm-12 my-4 pr-4 d-flex justify-content-end">
          <button name="btn-fecharInformativo" class="btn btn-info btn-sisp" id="btn-fecharInformativo" value="">Fechar</button>
        </div>

      </div>
    </div>
  </div>

  <div class="modal fade" id="modalItem" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-xl">
      <div class="modal-content">
        <div class="modal-header">
          <h4 id="modalItem-titulo" class="modal-title">Pesquisa Itens
            <label style="font-size: 60%" class="container escondeRadio d-none">
              <input type="radio" checked="checked" id="radioProduto" name="radioPesquisaProduto">
              <span class="checkmark"></span>
              Produto
            </label>
            <label style="font-size: 60%; margin-left: -2.5%" class="container escondeRadio">
              <input type="radio" id="radioMaterial" name="radioPesquisaProduto">
              <span class="checkmark"></span>
              Material
            </label>
          </h4>
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body">
          <div class="row">
            <div class="col-sm-2">
              <label for="selectFiltros">Filtros </label>
              <div class="relative" id="selectFiltrosItens">
                <select class="input-default select2 select2-danger" name="selectFiltros" id="selectFiltros">
                  <option value="CODIGO">CODIGO</option>
                  <option value="CODIGO2">CODIGO2</option>
                  <option value="DESCRICAO">DESCRICAO</option>
                  <option value="COR">COR</option>
                  <option value="DESCOR">DESCCOR</option>
                  <option value="GRUPO">GRUPO</option>
                  <option value="SUBGRUPO">SUBGRUPO</option>
                  <option value="TAM">TAMANHO</option>
                  <option value="BARRA">BARRA</option>
                  <option value="DESC_ECOMMERCE">DESC_ECOMMERCE</option>
                  <option value="LOTE">LOTE</option>
                </select>
              </div>
            </div>

            <div class="col-sm-4">
              <label for="txtCampoConsulta" id="nomeFiltro">Campo Consulta </label>
              <div class="relative">
                <input type="text" placeholder="Campo Consulta" class="input-default focus" id="txtCampoConsulta" name="txtCampoConsulta">
              </div>
            </div>
            <div class="col-sm-3 d-flex align-items-end" style="text-align:center;">
              <button type="button" style="width: 100%; align-self: center; margin-bottom: 12px;" class="btn btn-info focus" id="btnConsultarItens" name="btnConsultarItens">
                <i class='fas fa-search'></i> Consultar
              </button>
            </div>
            <div class="col-sm-3">
              <div>Buscar </div>
              <div class="form-check">
                <input class="form-check-input" value="0" type="radio" name="rgPesquisaTipo" id="rgPesquisaTipo1">
                <label class="form-check-label" for="rgPesquisaTipo1">
                  Iniciando
                </label>
              </div>
              <div class="form-check">
                <input class="form-check-input" value="1" type="radio" name="rgPesquisaTipo" id="rgPesquisaTipo2" checked>
                <label class="form-check-label" for="rgPesquisaTipo2">
                  Contendo a(s) Palavra(s)
                </label>
              </div>
              <div class="form-check">
                <input class="form-check-input" value="2" type="radio" name="rgPesquisaTipo" id="rgPesquisaTipo3">
                <label class="form-check-label" for="rgPesquisaTipo3">
                  Contendo a Expressão
                </label>
              </div>
              <div class="form-check">
                <input class="form-check-input" value="3" type="radio" name="rgPesquisaTipo" id="rgPesquisaTipo4">
                <label class="form-check-label" for="rgPesquisaTipo4">
                  Igual
                </label>
              </div>

            </div>
            <div class="col-sm-12 table-responsive mt-2 px-0">
              <table style="width:100%" width="100%" id="tabelaItens" class="table table-sm table-select table-hover table-condensed">
                <thead>
                  <tr id="colunas">
                  </tr>
                </thead>
                <tbody>
                </tbody>
              </table>
            </div>
          </div>
        </div>
        <div class="modal-footer">
          <div class="row">
            <div class="col-sm-12">
              <button type="button" id="btn_confirmar_item" class="btn btn-danger"> Confirmar </button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>

  <div class="modal fade" id="modalDesistir" tabindex="-1">
    <div class="modal-dialog modal-lg modal-dialog-centered">
      <div class="modal-content" id="modal-content-DesistirItem">
        <div class="modal-header">
          <h5 class="modal-title" id="exampleModalToggleLabel">Especifique a Desistência do Item: <span id="txtItemDesistencia"></span></h5>
          <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="col-6 d-flex align-items-center">
            <h5>Lista Desistências</h5>
          </div>
          <div class="col-12 mt-2 form-group">
            <div class="input-group">
              <input type="text" class="input-default focus form-control" id="txtDesistencia" name="txtDesistencia" placeholder="Selecione a Desistência">
              <div class="input-group-append">
                <button class="btn bg-danger" id="btn-Desistencia" name="btn-Desistencia" data-button="absolute" type="button">
                  <i class="m-0 p-0 fas fa-search"></i>
                </button>
                <button class="btn bg-danger" id="btn-limpa-Desistencia" type="button">
                  <i class="m-0 p-0 fas fa-trash"></i>
                </button>
              </div>
            </div>
          </div>
          <div class="col-12 table-responsive ">
            <!-- <table id="tabelaItensMesa" style="width:100%;" width="100%" class="table table-sm table-select"> -->
            <table id="tabelaDesistenciaItem" width="100%" class="table table-sm table-select">
              <thead></thead>
              <tbody></tbody>
            </table>
          </div>

          <div class="col-sm-12" style="margin-top:5px">
            <button id="btnAdicionarDesistencia" type="button" class="btn btn-primary btn-block">
              Adicionar
            </button>
          </div>
        </div>
        <div class="modal-footer" style="justify-content: flex-end; align-items: center;">
          <div>
            <button id="btnCancelarDesistenciaItem" type="button" data-dismiss='modal' class="btn btn-lg btn-danger"> Cancelar </button>
            <button id="btnGravarDesistenciaItem" type="button" class="btn btn-lg btn-primary">Confirmar</button>
          </div>
        </div>
      </div>
    </div>
  </div>

  <div class="modal fade" id="modalOpcoesCorSelecionada" style="z-index: 9999;" tabindex="-1">
    <div class="modal-dialog modal-lg modal-dialog-centered">
      <div class="modal-content" id="modal-content-alterarInfoCor">
        <div class="modal-header">
          <h5 class="modal-title" id="exampleModalToggleLabel">Alterar dados do Item</h5>
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body">

          <div class="row">
            <div class="col-sm-4">
              <label for="txtTotalItemOpcoes" class="col-sm-12">Total: </label>
              <div class="col-sm-12">
                <input type="text" class="form-control input-default focus" id="txtTotalItemOpcoes" placeholder="Total" disabled>
              </div>
            </div>
            <div class="col-sm-4">
              <label for="txtPrecoItem" class="col-sm-12">Preço: </label>
              <div class="col-sm-12">
                <input type="text" class="form-control input-default focus" id="txtPrecoItem" placeholder="Preço Item" disabled>
              </div>
            </div>
            <div class="col-sm-4">
              <label for="txtPrecoItemNovo" class="col-sm-12">Novo Preço: </label>
              <div class="col-sm-12">
                <input type="text" class="form-control input-default focus" id="txtPrecoItemNovo" placeholder="Novo Preço">
              </div>
            </div>
          </div>

          <div class="row">
            <div class="col-sm-4">
              <label for="txtQuantidadeItemOp" class="col-sm-12">Quantidade: </label>
              <div class="col-sm-12">
                <input type="text" class="form-control input-default focus" id="txtQuantidadeItemOp" value="0" placeholder="Quantidade">
              </div>
            </div>
            <div class="col-sm-4">
              <label for="txtValorDescontoItem" class="col-sm-12">Valor Desconto: </label>
              <div class="col-sm-12">
                <input type="text" class="form-control input-default focus" id="txtValorDescontoItem" value="0" placeholder="Desconto Item">
              </div>
            </div>
            <div class="col-sm-4">
              <label for="txtPercDescontoItem" class="col-sm-12">Perc. Desconto: </label>
              <div class="col-sm-12">
                <input type="text" class="form-control input-default focus" id="txtPercDescontoItem" placeholder="Desconto Item">
              </div>
            </div>
          </div>
        </div>
        <div class="modal-footer" style="justify-content: flex-end; align-items: center;">
          <div>
            <button id="btnCancelarOpcoes" type="button" data-dismiss='modal' class="btn btn-lg btn-danger"> Cancelar </button>
            <button id="btnConfirmarOpcoes" type="button" class="btn btn-lg btn-primary">Confirmar</button>
          </div>
        </div>
      </div>
    </div>
  </div>

  <div class="modal fade" id="modalAutoAvaliacao" tabindex="1">
    <div class="modal-dialog modal-md modal-dialog-centered">
      <div class="modal-content" id="modal-content-AutoAvaliacao">
        <div class="modal-body">
          <div class="iconsAtendimento">
            <i nota="1" class="reacaoAtendimento fas fa-sad-cry"></i>
            <i nota="2" class="reacaoAtendimento fas fa-sad-tear"></i>
            <i nota="3" class="reacaoAtendimento selectedReacaoAtendimento fas fa-smile"></i>
            <i nota="4" class="reacaoAtendimento fas fa-smile-wink"></i>
            <i nota="5" class="reacaoAtendimento fas fa-smile-beam"></i>
          </div>
          <label for="avaliacao">Avalie seu atendimento!</label>
          <textarea name="" class="input-default focus form-control" id="avaliacao" cols="30" rows="5"></textarea>

        </div>
        <div class="modal-footer" style="justify-content: flex-end; align-items: center;">
          <div>
            <button id="btnFinalizarAtendimento" type="button" class="btn btn-lg btn-primary">Finalizar Pedido</button>
          </div>
        </div>
      </div>
    </div>
  </div>

  <div class="modal fade" id="modalAdicionarItem" tabindex="-1">
    <div class="modal-dialog modal-xl modal-dialog-centered">
      <div class="modal-content" id="modal-content-adicionarItem">
        <div class="modal-header">
          <h5 class="modal-title" id="exampleModalToggleLabel">Adicionar Item</h5>
          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-header">
          <div class="col-6">
            <div>Item: <span id="itemCodigoDescricao"></span></div>
          </div>
          <div class="col-6 d-flex align-items-end flex-column">
            <div>Desconto Max: <span id="itemDescMaximo"></span></div>
          </div>
        </div>
        <div class="modal-body">
          <h5>Aplicar valores nas cores:</h5>
          <div class="row">
            <div class="col-md-4 col-6 form-group" id="tourQtdeCoresTotal">
              <label data-error="wrong" id="labelQtdeCoresTotal" data-success="right" for="txtQtdeCoresTotal">Qtde.:</label>
              <input type="text" value="0" class="input-default focus form-control" id="txtQtdeCoresTotal" aria-describedby="codError" name="txtQtdeCoresTotal" class="form-control" placeholder="Desc">
            </div>

            <div class="col-md-4 col-6 form-group" id="tourDesconto">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtDescontoItens">Valor Desc.:
              </label>
              <input type="text" value="0.00" class="input-default focus form-control" id="txtDescontoItens" aria-describedby="codError" name="txtDescontoItens" class="form-control" placeholder="Desc">
            </div>
            <div class="col-md-4 col-6" id="tourDesconto">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPercDescontoItens">% Desc.:
              </label>
              <input type="text" min="0" max="99" value="0.00" class="input-default  form-control" id="txtPercDescontoItens" aria-describedby="codError" name="txtPercDescontoItens" class="form-control" placeholder="Desc">
            </div>
          </div>

          <div class="row">
            <div class="col-12 table-responsive">
              <!-- <div class="row  d-flex justify-content-center">
                <div class="form-group d-flex align-items-center" style="margin-left: -45px;" id="tourQtdeCoresTotal">
                  <label data-error="wrong" id="labelQtdeCoresTotal" class="labelGeral mt-1" data-success="right" for="txtQtdeCoresTotal">Quantidade Cores:
                  </label>
                  <input type="text" value="0" style="max-width: 100px;" class="input-default focus form-control" id="txtQtdeCoresTotal" aria-describedby="codError" name="txtQtdeCoresTotal" class="form-control" placeholder="Desc">
                </div>
              </div> -->
              <table id="tabelaCorAdicionarItem" width="100%" class="table table-sm table-select">
                <thead></thead>
                <tbody></tbody>
              </table>

            </div>
          </div>
          <div class="row">
            <div class="col-md-2 col-6 form-group" id="tourComissao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtPercComissaoItens">% Comissão:
              </label>
              <input type="text" disabled="true" class="input-default focus form-control" id="txtPercComissaoItens" aria-describedby="codError" name="txtPercComissaoItens" class="form-control" placeholder="Comissao">
            </div>
            <div class="col-md-2 col-6 form-group" id="tourComissao">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtComissaoItens">Comissão:
              </label>
              <input type="text" disabled="true" class="input-default focus form-control" id="txtComissaoItens" aria-describedby="codError" name="txtComissaoItens" class="form-control" placeholder="Comissão">
            </div>
            <div class="col-md-2 col-6 form-group" id="tourVolumePrevItens">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtVolumePrevItens">Volume Prev.:
              </label>
              <input type="text" disabled="true" class="input-default focus form-control" id="txtVolumePrevItens" aria-describedby="codError" name="txtVolumePrevItens" class="form-control" placeholder="Volume Prev.">
            </div>
            <div class="col-md-3 col-6 form-group" id="tourTotal">
              <label data-error="wrong" class="labelGeral" data-success="right" for="txtTotalItens">Total:
              </label>
              <input type="text" disabled="true" class="input-default focus form-control" id="txtTotalItens" aria-describedby="codError" name="txtTotalItens" class="form-control" placeholder="Total">
            </div>
            <div class="col-md-3  col-12 form-group">
              <label for="txtTpVenda">Tipo Venda</label>
              <div class="input-group">
                <input type="text" class="input-default focus form-control" id="txtTpVenda" name="txtTpVenda" placeholder="Tipo Venda">
                <div class="input-group-append">
                  <button class="btn bg-danger" id="btn-TpVenda" name="btn-TpVenda" data-button="absolute" type="button">
                    <i class="m-0 p-0 fas fa-search"></i>
                  </button>
                  <button class="btn bg-danger" id="btn-limpa-TpVenda" type="button">
                    <i class="m-0 p-0 fas fa-trash"></i>
                  </button>
                </div>
              </div>
            </div>
          </div>

        </div>
        <div class="modal-footer" style="justify-content: space-between; align-items: center;">
          <div>
            <label data-error="wrong" data-success="right" for="txtDtEntregaPrev" style="margin-bottom: 0px;">Entrega Prev.:</label>
            <input disabled="true" type="date" placeholder="Fim" class="input-default" id="txtDtEntregaPrev" name="txtDtEntregaPrev">
          </div>
          <div>
            <button id="btnCancelarItemPedido" type="button" data-dismiss='modal' class="btn btn-lg btn-danger"> Cancelar </button>
            <button id="btnGravarItemPedido" type="button" class="btn btn-lg btn-primary">Gravar</button>
          </div>
        </div>
      </div>
    </div>
  </div>

  <div style="z-index:999999999999999!important;" class="modal fade bd-example-modal-lg" id="condicaoModal" tabindex="-1" role="dialog" aria-labelledby="condicaoModalLabel">
    <div class="modal-dialog modal-xl" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <h4 class="modal-title" id="condicaoModalLabel">Pesquisa Condição - Saldo: <span id="txtSaldoPedido"></span></h4>
          <button type="button" class="close" data-dismiss="modal">&times;</button>
        </div>
        <div class="modal-body p-4 row">
          <div class="col-12">

            <div class="row">
              <div class="col-sm-6 flex">
                <h4> Moeda selecionada: <span id="txtMoedaSelecionada"></span> </h4>
              </div>
              <div class="col-sm-6 d-flex justify-content-end">
                <h4> Parcela Min: <span id="txtSaldoMinimoCondicao"></span></h4>
              </div>
            </div>
          </div>
          <div class="col-sm-12 table-responsive">
            <div id="condicaoModalBody"></div>
          </div>
        </div>
        <div class="modal-footer">
          <button type="button" id="condicaoModalSelecionar" class="btn btn-primary btn-sisp">Selecionar</button>
        </div>
        <input type="text" class="d-none" id="txtTabelaCondicao" name="txtTabelaCondicao">
      </div>
    </div>
  </div>

  <div style="z-index:999999999999999!important;" class="modal fade bd-example-modal-lg" id="itensPedidoModal" tabindex="-1" role="dialog" aria-labelledby="itensPedidoModalLabel">
    <div class="modal-dialog modal-xl" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <h4 class="modal-title" id="itensPedidoModalLabel">Itens Pedido
            <button type="button" class="close" data-dismiss="modal">&times;</button>
        </div>
        <div class="modal-body p-4 row">
          <div class="col-sm-12 table-responsive">
            <div id="itensPedidoModalBody"></div>
          </div>
        </div>
        <div class="modal-footer">
          <button type="button" id="itensPedidoModalFechar" class="btn btn-primary btn-sisp">Fechar</button>
        </div>
      </div>
    </div>
  </div>


  <script src="<?php echo BASE_URI; ?>/plugins/jquery/jquery.min.js?versao=3.2512.9.1"></script>

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

  <script>
    ipInterno = '<?php echo IP_INTERNO; ?>';
    ipExterno = '<?php echo IP_EXTERNO; ?>';
    basicAuth = '<?php echo BASIC_AUTH; ?>';
  </script>
  <script src="../dist/js/highlight.min.js?versao=3.2512.9.1"></script>
  <script src="https://unpkg.com/phosphor-icons"></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 type="text/javascript" src="../dist/js/loadingoverlay.min.js?versao=3.2512.9.1"></script>
  <script src="../dist/js/valida_cpf_cnpj.js?versao=3.2512.9.1"></script>

  <!-- jQuery UI 1.11.4 -->
  <script src="../plugins/jquery-ui/jquery-ui.min.js?versao=3.2512.9.1"></script>
  <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
  <script>
    $.widget.bridge('uibutton', $.ui.button)
  </script>
  <!-- Bootstrap 4 -->
  <script src="../plugins/bootstrap/js/bootstrap.bundle.min.js?versao=3.2512.9.1"></script>
  <!-- AdminLTE App -->
  <script src="../dist/js/adminlte.min.js?versao=3.2512.9.1"></script>
  <script src="../dist/js/adminltemenu.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 type="text/javascript" src="../utils/funcoes.js?versao=3.2512.9.1"></script>
  <script src="../pages/loja/js/rotinas.js?versao=3.2512.9.1"></script>
  <script src="../pages/pedidosb2b/js/arrayColunasDatatablePedido.js?versao=3.2512.9.1"></script>
  <!-- SweetAlert2 -->
  <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>
  <!-- jquery-validation -->
  <script src="../plugins/jquery-validation/jquery.validate.min.js?versao=3.2512.9.1"></script>
  <script src="../plugins/jquery-validation/additional-methods.min.js?versao=3.2512.9.1"></script>
  <script src="../dist/js/requisicoes.js?versao=3.2512.9.1"></script>
  <script type="text/javascript" src="../dist/js/sum().js?versao=3.2512.9.1"></script>
  <script src="../utils/cookies.js?versao=3.2512.9.1"></script>
  <script src="../dist/js/jquery.maskMoney.min.js?versao=3.2512.9.1"></script>
  <script src="../dist/js/driver.min.js?versao=3.2512.9.1"></script>
  <script src="../dist/js/jquery.mask.min.js?versao=3.2512.9.1"></script>
  <script src="../plugins/select2/js/select2.full.min.js?versao=3.2512.9.1"></script>
  <script src="../plugins/owl/owl.carousel.min.js?versao=3.2512.9.1"></script>
  <script src="../plugins/moment/moment.min.js?versao=3.2512.9.1"></script>
  <script src="../pages/cfe/cfe.js?versao=3.2512.9.1"></script>
  <script src="../dist/js/jquery.inputmask.js"></script>
  <script type="text/javascript" src="../config.js?versao=3.2512.9.1"></script>
  <script type="text/javascript" src="../dist/js/datadog-logs-v4.js?versao=3.2512.9.1"></script>
  <script src="../modals/modal_estatisticas_entidade.js"></script>
  <script src="../dist/js/quagga.min.js?versao=3.2512.9.1"></script>
  <script>
    let enviarLogs = true;
    try {
      enviarLogs = ENVIAR_LOGS;
    } catch (error) {
      enviarLogs = true;
    }

    if (enviarLogs) {
      window.DD_LOGS &&
        DD_LOGS.init({
          clientToken: 'pub22c993c7a1e62229227b490bbdc2613f',
          forwardErrorsToLogs: true,
          sampleRate: 100,
          beforeSend: (log) => {
            if (log.http && log.http.status_code === 0) {
              return false;
            }
            log.usuario = {
              usuario: getCookie('usuario') ?? '',
              empresa: sessionStorage.getItem('g_nome_empresa_logada') ?? '',
              ipExterno: '<?php echo IP_EXTERNO; ?>',
              versao: VERSAO,
            }
          },
        })
    }
  </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('PEDIDOSB2B');
      if (!temAcesso.resultado) {
        toastrAcesso(temAcesso, BASE_URI);
        return;
      }

      sArquivo = `${BASE_URI}/pages/pedidosb2b/js/pedidob2b.js`;
      const nomeTela = ('<?php echo basename(__FILE__) ?>').replace('.php', '');
      await insereJavaScriptPagina(sArquivo);

      habilitaCamposObrigatoriosTela(nomeTela);

    })
  </script>
</body>

</html>