
<?php

include("modalcliente.php");
include("modafactClien.php"); 
include("modalSucurFactura.php");

?>



<div id="factura" class="col-md-12 container-fluid">
    <title class="titulosModulos text-center">Módulo Facturación</title>
   

 <form action=""  id="ffactura"  >
  <div class="conteinerModulo1" >

  
        <div id="cliente" style=" border:solid 2px #EEEEEE; border-radius:10px; background-color:none; width:100%; padding:7px;">
  
            <label class="col-md-2 col-xl-1 col-sm-2 col-4"  for="">Cliente  <input id="nit" name="cliente" class="form-control form-control-sm" value="222222222222" type="search" placeholder=""></label>
            <input id="busprovedor"  class="puntos btn  btn-sm searchIcon"  value="" type="button">
            <label  class="col-6 col-sm-4 col-md-3 col-xl-2" for="">Nombre Cliente
            <button type="button" hidden id="verventasfrecuentes" class="btn btn-danger position-relative" data-bs-toggle="modal" data-bs-target="#modalVentClien">
             
              <span id="cantidadFactiras" class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger">
                                          
              </span>
            </button>
             
             
             <input id="nombre" disabled="disabled" class="form-control form-control-sm" type="text" value="CONSUMIDOR FINAL">
            
            
            </label>
            <label class="col-5 col-sm-5 col-sm-4 col-xl-2 col-md-2"  for="">Direccion
              
            <button type="button"  id="" value="Sucursales" class="btn-sm btn-info position-relative" data-bs-toggle="modal" data-bs-target="#sucuarsalesCline">
             Sucursales
            
           </button>
            
            
            
            
            <input id="diree" disabled="disabled" class="form-control form-control-sm" type="text" value="General" >
          
          
          </label>
            <label class="col-3 col-md-2 col-xl-1 " for="">Telefono<input id="telCli" disabled="disabled" class="form-control form-control-sm" type="text" value="222222222222" ></label>
            <label class="col-3 col-md-2 col-xl-1" for="" <?php  if($_SESSION["TipoEmpresa"]==3){echo("hidden");} ?>>Email<input id="Correoc" disabled="disabled" class="form-control form-control-sm" type="text" value="notiene@gmail.com" ></label>
            <label  for="" hidden>Dto<input id="dtoclie" disabled="disabled" class="form-control form-control-sm" type="text" value="0" ></label>
            <label  class="col-2 col-sm-2 col-md-2 col-xl-1"  >Dto<input id="dtoclieVer" disabled="disabled" class="form-control form-control-sm" type="text" value="0" ></label>
            <label class="col-3 col-sm-2 col-md-2 col-xl-1" <?php  if($_SESSION["TipoEmpresa"]==3){echo("hidden");} ?> >📅 Fecha<input id="fecha" disabled="disabled"  class="form-control form-control-sm" value="<?php echo date('Y-m-d');?>" type="datetime"></label>
            <label class="col-md-2" hidden="true"  for="">Nombre_elect<input id="Nombre_elect" disabled="disabled" class="form-control form-control-sm" type="text" value="CONSUMIDOR" ></label>
            <label class="col-md-2" hidden="true"  for="">Apellido_elect<input id="Apellido_elect" disabled="disabled" class="form-control form-control-sm" type="text" value="FINAL" ></label>
            <label class="col-md-2" hidden="true"  for="">Naturaleza_elect<input id="Naturaleza_elect" disabled="disabled" class="form-control form-control-sm" type="text" value="NATURALES" ></label>
            <label class="col-md-2" hidden="true"  for="">Regimen_elect<input id="Regimen_elect" disabled="disabled" class="form-control form-control-sm" type="text" value="NO_APLICA" ></label>
            <label class="col-md-2" hidden="true"  for="">tipoIdentificacion_elect<input id="tipoIdentificacion_elect" disabled="disabled" class="form-control form-control-sm" type="text" value="NI" ></label>
            <label class="col-md-2" hidden="true"  for="">Responsabilidad_elec<input id="responsabilidad_elec" disabled="disabled" class="form-control form-control-sm" type="text" value="O-13" ></label>
            <label class="col-md-2" hidden="true"  for="">Ciudad<input id="ciudad_elec" disabled="disabled" class="form-control form-control-sm" type="text" value="66001" ></label>

            <label class="col-2 col-md-2 col-xl-1" <?php  if($_SESSION["TipoEmpresa"]==3){echo("hidden");} ?>   for="">Bono<input id="bonoPuntos" disabled="disabled" class="form-control form-control-sm" type="text" value="0" ></label>
            <label class="col-2 col-md-2 col-xl-1" hidden="true"  for="">sucursal<input id="sucursalClienteF" disabled="disabled" class="form-control form-control-sm" type="text" value="0" ></label>
            <label class="col-md-2" hidden="true"  for="">listaPrec<input id="listaPreciF" disabled="disabled" class="form-control form-control-sm" type="text" value="" ></label>
             &nbsp;&nbsp;
            <label id="crearc" type="button" class=" crearCliente">&nbsp;Crear Cliente&nbsp;</label> 
            
            
            <?php if($_SESSION["TipoEmpresa"] == 3): ?>
    <label class="col-2 col-sm-2 col-md-1 col-xl-1" name="cvendedor" style="width: 60px;" for="">
        Vendedor  
        <input id="vendedorr" class="form-control form-control-sm" value="<?php echo($_SESSION["codeVendedor"]); ?>" type="search" placeholder="">
    </label>

    <label class="col-5 col-sm-3 col-md-3 col-xl-2" for="">
        Nombre 
        <input id="nvende" disabled="disabled" class="form-control form-control-sm" value="vendedor general" type="search">
    </label>

    <label class="col-1" for="" style="width: 50px;">
        IVA
        <input id="iva" disabled="disabled" class="form-control form-control-sm limpiarDatoP" value="" type="search">
    </label>
<?php endif; ?>
                        

        </div>
        <style>
    /* Estilos CSS para la línea horizontal */
    #linea-horizontal {
      border: 1px solid black; /* Grosor y color de la línea */
      /* Margen arriba y abajo para separarla de otros elementos */
    }
  </style>
   <?php if($_SESSION["TipoEmpresa"] != 3): ?>
        <div class="col-12 bg-primary" id="linea-horizontal">
         
        </div>

        <?php endif; ?>

        <div id="vendedor" class=" " style="margin-bottom: 0;" style=" border:solid 2px #EEEEEE; border-radius:10px; background-color:none; width:100%; padding:7px;">
        <?php if($_SESSION["TipoEmpresa"] != 3): ?>
            <label class="col-3 col-sm-2 col-md-1 col-xl-1" name="cvendedor"  for="">Vendedor  <input id="vendedorr"  class="form-control form-control-sm" value="<?php echo($_SESSION["codeVendedor"]); ?>" type="search" placeholder=""></label>
         
            <label class="col-7 col-sm-5 col-md-3 col-xl-2"  for="">Nombre Vendedor<input id="nvende" disabled="disabled"  class="form-control form-control-sm" value="vendedor general" type="search" ></label>
        <?php endif; ?> 
            <label class="col-3  col-sm-2 col-md-1"  <?php  if($_SESSION["TipoEmpresa"]==3){echo("hidden");} ?>  for="">Saldo_Caja<input id="saldo" disabled="disabled"  class="form-control form-control-sm limpiarDatoP" value="" type="search" ></label>
            <label class="col-3 col-sm-2 col-md-1"  <?php  if($_SESSION["TipoEmpresa"]==3){echo("hidden");} ?> for="">Saldo_Frcc<input id="saldof" disabled="disabled"  class="form-control form-control-sm limpiarDatoP" value="" type="search" ></label>
            
            <?php if($_SESSION["TipoEmpresa"] != 3): ?>
             <label class="col-3 col-sm-2 col-md-1"  for="">IVA<input id="iva" disabled="disabled"  class="form-control form-control-sm limpiarDatoP" value="" type="search" ></label>
            <?php endif; ?> 

            <label class="col-3 col-md-1 " <?php  if($_SESSION["TipoEmpresa"]==3){echo("hidden");} ?> >Prox.Dosis<input id="diasDosis" value="0" class="form-control col-md-10 form-control-sm" value="" type="search" placeholder=""></label>
     
            <label class="" <?php  if($_SESSION["TipoEmpresa"]==3){echo("hidden");} ?>><button id="temp" type="button" class="btn  btn-sm temperatureIcon" value="T"></button></label> 
            <label <?php  if($_SESSION["TipoEmpresa"]==3){echo("hidden");} ?> id="cotizacionF" type="button" class="cotizacion campoDes " value="C" >Cotizacion</label> 
            <label class="col-md-1 col-3" for="" <?php  if($_SESSION["TipoEmpresa"]==3){echo("hidden");} ?>>Partici..   
                                      
                                      <input type="text"   list="Participantes" id="idParticipantes" name="clientes" value="1" class="form-control ">
                                      
                                              <datalist id="Participantes" >
                                              
                                                  <option value="1"></option> 
                                                                                  
                                                      
                                              </datalist>
                                          
               </label> 
            <!-- <label class="col-4 col-md-1" >F.Pago
                    <select name="mpgo" id="mpago" class="form-control-sm selectStyle" aria-label="Default select example">
                    
                        <option value="1" >Contado</option>
                        <option value="2" >Credito</option>
                            
                    </select>
            </label> -->
          

            <!-- <label class="col-md-1">Fecha_Venc<input id="fechaV"   class="form-control form-control-sm"  type="datetime" value="<?php echo date('Y-m-d').'T'.date('H:i');?>"></label> -->


            <!-- <label class="col-4 col-md-1" >M.Pago
                    <select name="mpgo" id="mediopago" class="form-control-sm selectStyle" aria-label="Default select example">
                  
                        <option value="10" >Efectivo</option>
                        <option value="49" >Tarjetas</option>
                        <option value="47" >Transfe..</option>
                        
                            
                    </select>
            </label> -->

                         
                                
        </div>
    </div>
    <?php if($_SESSION["TipoEmpresa"] != 3): ?>
    <div class="col-12 bg-primary" id="linea-horizontal">
         
         </div>

        <?php endif; ?>  
    <div id="buscar"   class="col-12 border border-info">


    <!-- nueva forma mesas -->



    <?php $tipoEmpresa = $_SESSION["TipoEmpresa"]; ?>
<?php if ($tipoEmpresa != 3): ?>
  <!-- Mostrar SELECT como normalmente -->
  <label for="" <?php echo($mesass); ?> style="width:9vh;">
    Puestos
    <select name="" id="mesas"  class="form-control form-control-sm selectStyle">
      <option value="m0" selected>table0</option>
      <?php for ($i = 1; $i <= 50; $i++): ?>
        <option value="m<?= $i ?>">Table<?= $i ?></option>
      <?php endfor; ?>
      <?php for ($i = 1; $i <= 7; $i++): ?>
        <option value="b<?= $i ?>">Barra<?= $i ?></option>
      <?php endfor; ?>
    </select>
  </label>

<?php else: ?>
  <!-- Si TipoEmpresa == 3: Mostrar los botones -->
  <label style="width:100%;">
    <select name="" id="mesas" class="mesasN" style="opacity:0; position:absolute; pointer-events:none;">
      <option value="m0" selected>table0</option>
      <?php for ($i = 1; $i <= 50; $i++): ?>
        <option value="m<?= $i ?>">Table<?= $i ?></option>
      <?php endfor; ?>
      <?php for ($i = 1; $i <= 7; $i++): ?>
        <option value="b<?= $i ?>">Barra<?= $i ?></option>
      <?php endfor; ?>
    </select>
    <div class="botones-mesas d-flex flex-wrap gap-2 mt-2" id="botonesMesas"></div>
  </label>

  <style>
    .botones-mesas {
      max-height: 15vh;
      overflow-y: auto;
      border: 1px solid #dee2e6;
      padding: 10px;
      border-radius: 12px;
      background: #f8f9fa;
    }

    .mesa-button {
      padding: 10px 16px;
      border: none;
      border-radius: 25px;
      font-weight: 500;
      transition: 0.3s;
      min-width: 90px;
      background-color: #e9f5ff;
      color: #0d6efd;
      box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .mesa-button.barra {
      background-color: #e6ffee;
      color: #198754;
    }

    .mesa-button:hover {
      transform: scale(1.05);
      cursor: pointer;
      opacity: 0.9;
    }

    .mesa-button.selected {
      background-color: #0d6efd !important;
      color: white !important;
      box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.3);
    }
  </style>

 
<?php endif; ?>
 <script>
    document.addEventListener('DOMContentLoaded', () => {
      verMesasOcupadas();
      const select = document.getElementById('mesas');
      const container = document.getElementById('botonesMesas');

      if (select && container) {
        Array.from(select.options).forEach(opt => {
          const btn = document.createElement('button');
          btn.type = 'button';
          btn.className = 'mesa-button' + (opt.value.startsWith('b') ? ' barra' : '');
          btn.textContent = opt.textContent;

          btn.onclick = () => {
            select.value = opt.value;

            document.querySelectorAll('.mesa-button').forEach(b => b.classList.remove('selected'));
            btn.classList.add('selected');

            const event = new Event('change', { bubbles: true });
            select.dispatchEvent(event);
          };

          container.appendChild(btn);
        });

        // Selección inicial
        const selectedValue = select.value;
        container.querySelectorAll('.mesa-button').forEach((btn, i) => {
          if (select.options[i].value === selectedValue) {
            btn.classList.add('selected');
          }
        });
      }




      
document.addEventListener('click', function (e) {
  
  if (e.target.classList.contains('card-img-top')) {
    const original = e.target;
    console.log(original)
    // Eliminar cualquier zoom anterior
    const existing = document.querySelector('.zoomed-img');
    if (existing) existing.remove();

    // Clonar la imagen
    const clone = original.cloneNode(true);
    clone.classList.add('zoomed-img');
    document.body.appendChild(clone);

    // Quitar la imagen al hacer clic en cualquier parte
    setTimeout(() => {
      document.addEventListener('click', removeZoom, { once: true });
    }, 50);

    function removeZoom() {
      clone.remove();
    }
  }
});




    });
  </script>

    <!-- fin nueva forma mesas -->

    <!-- <label for="" <?php echo($mesass);  ?> <?php  if($_SESSION["TipoEmpresa"]==3){echo("hidden");} ?>  style="width:9vh;" >Puestos
          <select name="" id="mesas" class="form-control  form-control-sm selectStyle" >
            <option value="m0" selected>table0</option>
            <option value="m1">Table1</option>
            <option value="m2">Table2</option>
            <option value="m3">Table3</option>
            <option value="m4">Table4</option>
            <option value="m5">Table5</option>
            <option value="m6">Table6</option>
            <option value="m7">Table7</option>
            <option value="m8">Table8</option>
            <option value="m9">Table9</option>
            <option value="m10">Table10</option>
            <option value="m11">Table11</option>
            <option value="m12">Table12</option>
            <option value="m13">Table13</option>        
            <option value="m14">Table14</option>
            <option value="m15">Table15</option>
            <option value="m16">Table16</option>
            <option value="m17">Table17</option>
            <option value="m18">Table18</option>
            <option value="m19">Table19</option>
            <option value="m20">Table20</option>
            <option value="m21">Table21</option>
            <option value="m22">Table22</option>
            <option value="m23">Table23</option>
            <option value="m24">Table24</option>
            <option value="m25">Table25</option>
            <option value="m26">Table26</option>
            <option value="m27">Table27</option>
            <option value="m28">Table28</option>
            <option value="m29">Table29</option>
            <option value="m30">Table30</option>
            <option value="m31">Table31</option>
            <option value="m32">Table32</option>
            <option value="m33">Table33</option>
            <option value="m34">Table34</option>
            <option value="m35">Table35</option>
            <option value="m36">Table36</option>
            <option value="m37">Table37</option>
            <option value="m38">Table38</option>
            <option value="m39">Table39</option>
            <option value="m40">Table40</option>
            <option value="m41">Table41</option>
            <option value="m42">Table42</option>
            <option value="m43">Table43</option>
            <option value="m44">Table44</option>
            <option value="m45">Table45</option>
            <option value="m46">Table46</option>
            <option value="m47">Table47</option>
            <option value="m48">Table48</option>
            <option value="m49">Table49</option>
            <option value="m50">Table50</option>
            <option value="b1">Barra1</option>
            <option value="b2">Barra2</option>
            <option value="b3">Barra3</option>
            <option value="b4">Barra4</option>
            <option value="b5">Barra5</option>
            <option value="b6">Barra6</option>
            <option value="b7">Barra7</option>


         
          </select>
        </label> -->

        <!-- style="width:15vh; padding-left:8px;" -->
        <label  style=" padding-left:8px;" class="col-sm-2 col-5  col-md-2 col-xl-1 " for="">Producto<input id="producto"  class="form-control form-control-sm" value="" type="search" placeholder=""></label>
        
        <input id="bus"  value="" type="button" class="btn  btn-sm iconButton productIcon">
        <!-- style="width:33vh;" -->
        <label  class="col-10 col-sm-4 col-md-3 col-xl-2"  for="">Nombre Pro.
            <label for=""   class="form-control-sm" style="" <?php echo($Activo);?> >
              <select name="" id="listaPr" class="form-control-sm selectStyle" >
                <option value="lista1">list-1</option>
                <option value="lista2">list-2</option>
                <option value="lista3">list-3</option>
              </select>
            </label>
           <input id="nproducto" disabled="disabled" class="form-control  form-control-sm limpiarDatoP" value="" type="search" placeholder=""></label>
       
 <!-- cocina -->

<label for="" class="col-md-1" hidden>
           <input id="controlinventarioF"   class="form-control col-md-12 limpiarDatoP" value=""  disabled="disabled" type="text" placeholder="">
        </label> 

 <label for="" class="col-md-1" hidden>
           <input id="cocina"   class="form-control col-md-12 limpiarDatoP" value=""  disabled="disabled" type="text" placeholder="">
        </label> 


         <!-- precio venta caja 3 -->
         <label for="" class="col-md-1" hidden>
           <input id="pcajaValor3"   class="form-control col-md-12 limpiarDatoP" value=""  disabled="disabled" type="text" placeholder="">
        </label> 

          <!-- precio venta caja 2 -->
          <label for="" class="col-md-1" hidden>
           <input id="pcajaValor2"   class="form-control col-md-12 limpiarDatoP" value=""  disabled="disabled" type="text" placeholder="">
        </label>  

        <label for="" class="col-md-1" hidden>
           <input id="pcajaValor1"   class="form-control col-md-12 limpiarDatoP" value=""  disabled="disabled" type="text" placeholder="">
        </label>  
       <!-- lista de precios -->
       
      
       
       
       
        <label class=" flex-column col-md-1 col-xl-1 col-sm-2 col-4"  >
        <!-- style="width:13vh;" -->
          <label  class="col-12">Precio caja  <input   id="pcaja" disabled="disabled" class="form-control  form-control-sm limpiarDatoP" value="0" type="text" placeholder="" style="color:#A20101 ;"></label>
          
          <label  for="" class="col-12"><input id="caja" inputmode="numeric" class="form-control  form-control-sm " value="" type="number" placeholder="Caja"></label>
        </label> 

        <label class=" flex-column col-md-1 col-xl-1 col-sm-2 col-4"  style="background-color:none;"> 

        
            <label class="col-12">Precio frcc<input   id="pfrcc" disabled="disabled" class="form-control  form-control-sm limpiarDatoP" value="0" type="text" placeholder="" style="color:#A20101 ;"></label>
            
            <!-- precio venta fraccion 2 -->
            <label for="" class="col-md-1" hidden>
              <input id="pfrccValor2"   class="form-control col-md-12 limpiarDatoP" value=""  disabled="disabled" type="text" placeholder="">
            </label> 

            <label for="" class="col-md-1" hidden>
              <input id="pfrccValor1"   class="form-control col-md-12 limpiarDatoP" value=""  disabled="disabled" type="text" placeholder="">
            </label>

                 <!-- precio venta fraccion 3 -->
                 <label for="" class="col-md-1" hidden>
              <input id="pfrccValor3"   class="form-control col-md-12 limpiarDatoP" value=""  disabled="disabled" type="text" placeholder="">
            </label> 

                    
        
        
        
        
        
             <label  for="" class="col-12"  ><input  id="frcc" inputmode="numeric"  class="form-control  form-control-sm limpiarDatoP" value="" type="number" placeholder="frcc"></label>
        </label> 

        <label class=" flex-column col-md-1 col-xl-1 col-sm-2 col-4" style="background-color:none;" >

            <label class="col-12">Precio_Blis  <input   id="pblister" disabled="disabled" class="form-control  form-control-sm limpiarDatoP" value="0" type="text" placeholder="" style="color:#A20101 ;"></label>

            <label  class="col-12"><input id="canblister"  class="form-control  form-control-sm limpiarDatoP" value="" type="number" placeholder="Blister"></label>

            <label for="" class="col-md-1" hidden>
              <input id="factorblister"   class="form-control col-md-12 limpiarDatoP" value=""  disabled="disabled" type="text" placeholder="">
            </label>  

            <label for="" class="col-md-1" hidden>
              <input id="dteMaximi"   class="form-control col-md-12 limpiarDatoP" value="0"  disabled="disabled" type="text" placeholder="">
            </label>
</label> 
        
        <?php
    
    print("<input type='text' id='idUsuario' disabled='disabled' hidden='true' value=".$_SESSION["descuentos"].">");
    if($_SESSION["descuentos"]==1){
     
       echo('<label class="flex-column  " style="background-color:none;width:10vh; " >');
        echo('<label style="width:10vh;">Descue..</label>');
       
        echo('<label  for="" class="izq" >  <input style="width:10vh;" inputmode="numeric" id="DescuPor"  class="form-control  form-control-sm" value="" type="search" placeholder="%"></label>');
        
        echo('<label  for=""   > <input style="width:10vh;" id="DescuValor" inputmode="numeric" class="form-control  form-control-sm" value="" type="search" placeholder="$ "></label>');
    echo('</label> ');
        
    }else{

      echo('<label class="flex-column  " style="background-color:none;width:10vh; " >');
        echo('<label style="width:10vh;">Descue..</label>');
       
        echo('<label  for="" class="izq" >  <input style="width:10vh;" inputmode="numeric" id="DescuPor" disabled="disabled" class="form-control  form-control-sm" value="" type="search" placeholder="%"></label>');
        
        echo('<label  for=""   > <input style="width:10vh;" id="DescuValor" inputmode="numeric" disabled="disabled"  class="form-control  form-control-sm" value="" type="search" placeholder="$ "></label>');
    echo('</label> ');

      

    }


    
?>

<label for="" class=" form-control-sm " <?php  if($_SESSION["TipoEmpresa"]==3){echo("hidden");} ?> >Lote
<input type="text" list="venciemintosid"  id="lotevencimiento" class="form-control  form-control-sm " style="width:15vh;color:#A20101 ;">
<datalist id="venciemintosid">
<option value="0" selected ></option>
   
  </datalist>
</label>




<label  for=""  class="" >PRECIO 
  
  <!-- <div class="form-check form-switch d-inline-block">
    <input class="form-check-input" type="checkbox" role="switch" id="impuestoConsumoCh" checked>
    <label class="form-check-label" for="impuestoConsumo">ImpC</label>
</div> -->


<input style="width:15vh;color:#A20101 ;" id="Tprecio" disabled="disabled" class="form-control  form-control-sm" value="" type="text" placeholder=""></label>







<label  for=""  class="izq" > <input  type="button" class="col-md agregar val" value="Agregar" id="agregar"  ></input></label> 

</div>   

        <label class="valoress" hidden="true" for="">costoCaja<input id="costoCaja" disabled="disabled" class="form-control col-md-12 limpiarDatoP" value="" type="text" ></label>
        <label class="valoress" hidden="true" for="">costoFrcc<input id="costoFrcc" disabled="disabled" class="form-control col-md-12 limpiarDatoP" value="" type="text" ></label>
        
          
        
    </div>


  <div >

  <table id="table" class="table-responsive table table-striped table-hover ">
  <thead class="table-primary" style="position: sticky;
      top: 0;">
    <tr  >
      
      <th class="text-center"  style="width:15%" >Codigo</th>
      <th scope="col" class="text-center "     style="width:30%">Nombre</th>     
      <th scope="col" class="text-center "  style="width:8%">Cantida_caja</th>
      <th scope="col" class="text-center "  style="width:8%">Cantida_frcc</th>
      <th scope="col" class="text-center"  style="width:5%">Base</th>
      <th scope="col" class="text-center"  style="width:5%">iva</th>   
      <th scope="col" class="text-center"  style="width:5%">tipo</th>    
      <th scope="col" class="text-center"  style="width:7%">precio</th>
      <th scope="col" class="text-center"  style="width:7%">Descu</th>
      <th scope="col" class="text-center "  style="width:3%">opcion</th>
      <th scope="col" class="text-center " hidden="true" style="width:3%">tratamiento</th>
      <th scope="col" class="text-center " hidden="true" style="width:3%">costoCaja</th>
      <th scope="col" class="text-center " hidden="true" style="width:3%">costoFrcc</th>
      <th scope="col" class="text-center " hidden="true" style="width:3%">preciounitarioCaja</th>
      <th scope="col" class="text-center " hidden="true" style="width:3%">preciounitariofrcc</th>
      <th scope="col" class="text-center " hidden="true" style="width:3%">idvencimeinto</th>
   <th scope="col" class="text-center " hidden="true" style="width:3%">detalleProducCocina</th>
    
      
     </tr>
    </thead>
    <tbody id="tabla"  class=" table-bordered mb-0 col-md-12 tablebody"  >


    </tbody>


  </table>




<div class="row footFact   " style="display: flex;  height:auto; padding:5px; margin:3px; bottom: 0; margin-right:3px; flex-wrap: wrap; ">
    
      <div class="col itemGrid  " style="display: flex; align-content:stretch; flex-wrap: wrap;  justify-content:space-between; zoom:80%;" >

            <div class="col" ><p><b>5%&nbsp;</b></p><label  id="l"> </label><input type="text" id="totaliva5"  class="cuadrobases totalC" value="0" disabled="gc_disable"><input type="text" id="base5"  class="cuadrobases totalC"  value="0" disabled="gc_disable"></div>
            <div class="col" ><p><b>19%&nbsp;</b></p><label  id="l"></label><input type="text" id="totaliva19"  class="cuadrobases totalC" value="0" disabled="gc_disable"><input type="text" id="base19"  class="cuadrobases totalC" value="0" disabled="gc_disable"></div>
            <div class="col" ><p><b>otro</b></p><label  id="l"> </label><input type="text" id="ivaotro"  class="cuadrobases totalC" value="0" disabled="gc_disable"><input type="text" id="baseotro"  class="cuadrobases totalC"  value="0" disabled="gc_disable"></div>
            <div class="col" ><p><b>Ipcons</b></p><label  id="l"> </label><input type="text" id="ivaipc"  class="cuadrobases totalC" value="0" disabled="gc_disable"><input type="text" id="baseipc"  class="cuadrobases totalC"  value="0" disabled="gc_disable"></div>                       
            <div class="col" ><p><b>Exento</b></p><label  id="l"></label><input type="text" id="baseexento"  class="cuadrobases totalC"  value="0" disabled="gc_disable"></div>
            <div class="col" ><p><b>Excluido</b></p><label  id="l"></label><input type="text" id="dbaseexcluido"  class="cuadrobases totalC"  value="0" disabled="gc_disable"></div>
            <div class="col" ><p><b>Des&nbsp;</b></p><label  id="l"> </label><input type="text" id="TotalDescu"  class="cuadrobases totalC" value="0" disabled="gc_disable"></div>
                  
         </div>

          <div class="col " style="display:flex; flex-direction: column; "  >   
                    <div class="itemGrid " id="totales" style="display:flex; align-items:center; flex-wrap:wrap;" >
                          <div>
                              
                                
                                <div class="row ">
                       



                                  <div class="row  justify-content-end" >
                                          <label class="col-md-3"><b>Vcto:Fact</b> <input class="form-control" type="number" id="vencimientoFactura" name="vencimientoFactura" value="" placeholder="En Dias" ></input></label>
                                          <label class="col-md-8 col-xl-6 col-sm-12 col-12"> <input class="totalCuadro col-12"  style=" height:55px;" type="text" id="totalfact" name="totalfactura" placeholder="$000.000.000" disabled="gc_disable"></input> </label>
                                          <input class="col-md-4 col-sm-6 col-12 col-xl-3 facturar"  type="button" style="font-size: 1.5rem;  height:55px; cursor: pointer;"   id="facturar" value="Facturar">    </input>                                                       
                                      <div>
                                          <label class="col-md-3" > <input class="form-control" type="number" id="DescuentoGeneralFact" name="" value="" placeholder="Dto Valores"  <?php  echo($_SESSION["DescuentoGeneral"]);?> ></input></label>
                                     
                                       <label id="pendientes" type="button" class="btn m-1"  style="color:#020202; background:#9CAC2C  ;">  PENDIENTES </label>
                      <label <?php  echo($cocinas);?>  id="enviarCocina" type="button" class="btn m-1 btn-primary"  style="">Cocina </label>
                      <label for="" class="col-md-8" >
                       <!-- <input id="detalleElectronico"   class="form-control col-md-12 limpiarDatoP" value=""  type="text" placeholder="Detalle Electronico"> -->
                     </label> 
                                     
                                        </div>
                                        
                                
                                        </div>
                                   <!--  -->
                                  <div class="col-md-1" >
                                     
                                  </div>
                                 
                                </div>
                                
                          </div> 
                            
                            
                    </div>

                  
                    <div class=" " style="display:flex;justify-content: center; flex-wrap:wrap;"  >
                  
                      <!-- <button class="btn btn-info m-1" id="guardarCotizacion" type="button"  value="Guardar_Cotizacion">&nbsp;Cotizar&nbsp;</button> -->
                      <!-- <button class="twobuttons m-1"  id="electro" type="button"  value="Generar_Factura_Electronica"  >&nbsp;Factura_Electronica&nbsp;</button> -->
                 
                       <!-- <input id="detalleElectronico"   class="form-control col-md-12 limpiarDatoP" value=""  type="text" placeholder="Detalle Electronico"> -->
                     </label> 
                  
                  </div>


              </div>


             


</div>







  
 
<?php
include("modalproductos.php");

 include("inventario/modalbuscarprov.php"); 
 include("formapago.php");

 
 

?>
