
<div id="entrada" class="col-md-12 container-fluid">
<title class="titulosModulos42 text-center">Entrada Productos</title>
        
       
       
        
    
     <div  style="background-color:none; display:flex; align-content:stretch; padding:7px; align-items:center; flex-wrap:wrap;">

         <label type="button" class="ConFact" id="consultartem">⏳Factura Pendiente </label> &nbsp;
         <label style="width:21vh;"  for=""><input id="fechacargue" disabled="disabled"  class="form-control form-control-sm" value="<?php echo date('Y-m-d H:i:s');?>" type="datetime" ></label>&nbsp;
         &nbsp;&nbsp;<b>FECHA RECEPCION</b> &nbsp;
         <label style="width:25vh;"  for=""><input id="fechaActaRecep"   class="form-control form-control-sm" value="" type="datetime-local" ></label>&nbsp;

         <label class="col-md-2 col-2 "  for=""><b> Aplicar Precios Todos</b>
                <select id="preciosTodos" class="form-control-sm selectStyle" >                   

                                  <option   value="no">no</option>
                                <option   value="si">si</option>
                                
                        

                </select>

         </label>
       <label  class="col-md-2">Basado En Orden
        <select name="" id="ordecompra"  class="form-control-sm selectStyle">
                        <option value="No">No</option>
                        <option value="Si">Si</option>
        </select>

         </label>
       

         <label  class="col-md-1">
         <input   id="generarOrdenCompr" type="button" class="form-control-sm btn btn-info" value="Imprimi Orden_Compr"></input>

         </label>
     </div>
       
        <div style="background-color:none; display:flex; padding:8px; flex-wrap:wrap;" id="entradaproducto" >
            <label style="width:15vh;"  > <input id="numfact" class="form-control form-control-sm" value="" type="text" onkeyup="this.value = this.value.toUpperCase();" placeholder="No.Factura"></label>&nbsp;&nbsp;
          


            <label style="width:15vh;" ><input id="buscprovedor"  class="form-control form-control-sm" value=""  type="search" placeholder="Nit provedor" ></label>&nbsp;
            
            
            <label id="busprovedor" type="button" value="." class=" busProv">&nbsp;📞 Buscar Proveedor&nbsp; </label>&nbsp;&nbsp;
            <label id="crearprovedor" type="button" value="." class=" crearCliente">&nbsp;👨‍💻 Crear Proveedor &nbsp; </label>&nbsp;&nbsp;
            
            
            <label style="width:28vh;"> 
            <input id="nomprovedor" disabled="disabled" class="form-control form-control-sm " value="" type="search" placeholder="" ></label>&nbsp;&nbsp;
            <div style="width:auto; ">

            <label class="" >  
                <select id="tipocargue" class="form-control-sm selectStyle" >
                        
                        <option id="comp" value="compra">Compra</option>

                        <?php
                        if($_SESSION["ActivarPermiSaliEditarprod"]==0 &&  $_SESSION["tipo"]==1){
                                echo(" <option id='sali' value='salida'>salida</option>");

                        }else{
                              
                           echo(" <option id='sali' ". $_SESSION["permitirSalidad"]. " value='salida'>salida</option>");
                        }
                       
                        ?>
                        <option id="ent"  value="entrada">entrada</option>
                        <option id="ord"  value="ordenc">orden Compra</option>
                        <option id="obs"  value="obs">en.obsequios</option>
                     

                </select>
            </label>

            <label style="width:auto;"> 
               <input type="text" id="tipodetalle" placeholder="Nota o Comentario">
            </label>

            <label class="" >  
                <select id="tipocarguec" class="form-control-sm selectStyle" >

                        <option id=""style="background-color: white;">Contado</option>
                        <option id=""style="background-color: white;">Credito</option>
                        <option id=""style="background-color: white;">Banco</option>
                        <option id=""style="background-color: white;">Aft_Cuadre</option>

                     

                </select>
            </label>

        </div>
           
        </div>
        <div style="border: 1px solid #DADCE0; background-color:#FFFFFF; ">
        <div id="produstosenrada" style="background-color:none; display:flex; padding:8px; flex-wrap:wrap;"> 
                <label class="col-md-1">⠀<input id="buscarpro" class="form-control  form-control-sm" value="" type="search" placeholder="Producto" ></label>
                <input id="busss" style="margin-top:20px;" value="" class="puntos btn  btn-sm searchIcon" type="button"   >&nbsp;&nbsp;
                <label class=" col-md-3" >⠀<input disabled="disabled" id="nomcarge" class="form-control col-md-1 form-control-sm" value=""  ></label>

                <label  class="col-3 col-md-1" >Inv.Caja <input id="InventarioCajaAc"   disabled="disabled" class="form-control form-control-sm" value=""  ></label>
                <label class="col-3 col-md-1 form-control-sm" >Inv.Frcc <input id="InventarioFrccAc"  disabled="disabled" class="form-control form-control-sm " value=""  ></label>



                <label  class="col-3 col-md-1" hidden>Costo caja An <input id="costocargueCal" inputmode="numeric" class="form-control form-control-sm" value=""  ></label>
                <label class="col-3 col-md-1 " hidden>Costo Frcc An <input id="costofcargueCal" inputmode="numeric" class="form-control form-control-sm f" value=""  ></label>

                <label  class="col-3 col-md-1" >Costo caja <input <?php echo($vercostosPro);?> id="costocargue" inputmode="numeric" class="form-control form-control-sm" value=""  ></label>
                <label class="col-3 col-md-1 " >Costo Frcc <input  <?php echo($vercostosPro);?> id="costofcargue" inputmode="numeric" class="form-control form-control-sm f" value=""  ></label>
                <label class="col-3 col-md-1 " hidden >factor <input id="costofactorr" class="form-control form-control-sm f" value=""  ></label>
                <label class="col-3 col-md-1 " ><span class="bg-success">Cant.Caja</span > <input id="cajacargue" inputmode="numeric" class="form-control form-control-sm" value="" type="number" ></label>
                <label class="col-3 col-md-1 " ><span class="bg-warning">Cant.Frcc</span > <input id="frcccargue" inputmode="numeric" class="form-control form-control-sm f" value=""  type="number" ></label>
              
                <label class="col-3 col-md-1 " style="text-align: center;">Total $<input id="totalcarg" disabled="disabled" class="form-control form-control-sm " value=""  ></label>
  
                
               
            
        </div>    
        <div class="col-md-12 " style="background-color:none; display:flex; padding:8px; flex-wrap:wrap;" > 
                <label class="col-3 col-md-1 m-0">
                        <label class="col-md-12 m-0  border" >Vent.Caja &nbsp;<label class="" type="button"id="pf1cr" value="">💱</label><input id="vtcaja" <?php echo($_SESSION["modificarPrecioCargue"]); ?>  class="form-control col-md-12 form-control-sm" value=""  inputmode="numeric"></label>
                        <label class="col-md-12 m-0 border"> <input id="utcaja" inputmode="numeric" class="form-control col-md-12 form-control-sm" value="" <?php echo($_SESSION["modificarPrecioCargue"]); ?>  >%-Caja</label>
                        
                </label>&nbsp;
                <label class="col-3 col-md-1  m-0 " <?php echo($Activo);?>>
                         <label class="col-md-12 border " >Vent.Caja2&nbsp;<label class="" type="button"id="pf2cr" value="">💱</label><input id="vtcaja2" inputmode="numeric"  <?php echo($_SESSION["modificarPrecioCargue"]); ?> class="form-control col-md-12 Venta_Caja 2 form-control-sm" value="0"  ></label>
                        <label class="col-md-12 m-0 border" ><input id="utcaja2" inputmode="numeric" class="form-control col-md-12 form-control-sm" value="" <?php echo($_SESSION["modificarPrecioCargue"]); ?>   >%-Caja2</label>
                       
                
                        
                </label>&nbsp;
                <label class="col-3 col-md-1 m-0 border" <?php echo($Activo);?>>
                         <label class="col-md-12 border" >Vent.Caja3<label class="" type="button"id="pf3cr" value="">💱</label><input id="vtcaja3" inputmode="numeric" <?php echo($_SESSION["modificarPrecioCargue"]); ?> class="form-control col-md-12 Venta_Caja 2 form-control-sm" value="0"  ></label>
                         <label class="col-md-12 m-0 border" > <input id="utcaja3" inputmode="numeric" class="form-control col-md-12 form-control-sm" value="" <?php echo($_SESSION["modificarPrecioCargue"]); ?> >%-Caja3</label>
                        

                </label>&nbsp;<br>
                <label class="col-3 col-md-1 m-0 ">
                        <label class="col-md-12 border " >Vent-Frcc <input id="vtfrcc" inputmode="numeric"  class="form-control col-md-12 form-control-sm f" <?php echo($_SESSION["modificarPrecioCargue"]); ?> value=""  ></label>  
                        <label class="col-md-12 border" > <input id="utfrcc" inputmode="numeric"  class="form-control col-md-12 form-control-sm f"  value="" <?php echo($_SESSION["modificarPrecioCargue"]); ?> >%-Frcc</label>
                       
                  
                </label>&nbsp;
                <label class="col-3 col-md-1 m-0 " <?php echo($Activo);?>>
                          <label class="col-md-12 border"  >Venta_Frcc2 <input id="vtfrcc2" inputmode="numeric" class="form-control col-md-12 form-control-sm f" value="0" <?php echo($_SESSION["modificarPrecioCargue"]); ?> ></label> 
                          <label class="col-md-12 border "  > <input id="utfrcc2"  inputmode="numeric" class="form-control col-md-12 form-control-sm f"  value="" <?php echo($_SESSION["modificarPrecioCargue"]); ?> >%-Frcc2</label>
                 </label>&nbsp;

                 <label class="col-3 col-md-1 m-0 " <?php echo($Activo);?>>
                         
                         <label class="col-md-12 border"  >Venta_Frcc3 <input id="vtfrcc3"  inputmode="numeric" class="form-control col-md-12 form-control-sm f" value="0" <?php echo($_SESSION["modificarPrecioCargue"]); ?> ></label> 
                         <label class="col-md-12 border"  > <input id="utfrcc3" inputmode="numeric" class="form-control col-md-12 form-control-sm f"  value="" <?php echo($_SESSION["modificarPrecioCargue"]); ?> >%-Frcc3</label>
                 </label>&nbsp;
                <label class="col-3 col-md-1 " >Venta_Blister<input id="vtfrccBlister" inputmode="numeric" class="form-control col-md-12 form-control-sm " value="" <?php echo($_SESSION["modificarPrecioCargue"]); ?> ></label>&nbsp;
                <label class="col-3 col-md-1 m-0 " >
                        <label class="col-md-12 border "  >Lote <input id="lote"   class="form-control   form-control-sm" value=""  ></label>
                        <label  class="col-md-12 border " ><input id="fechVencimi" type="date"   class="form-control   form-control-sm" value=""  >F-Vencimi..</label>
                 </label>&nbsp; 
                 <label class="col-3 col-md-1 m-0 " >
                        <label  class="col-md-12 border " >Reg_Invim<input id="R_invim"     class="form-control   form-control-sm" value=""  ></label>
                        <label  class="col-md-12 border" <?php echo($actaRecep);?> ><input id="es_invim" class="form-control    form-control-sm" value=""  >Est_Registro</label>
                 </label>&nbsp;       
                       
                <label class="col-3 col-md-1 m-0 " >      
                        <label class="col-md-12 border " >Ubicacion
                                <select id="ubicacionn" name="ubicacionn" class="form-control   form-control-sm">
                                        <option value="sin"  selected> </option>
                                        <?php
                                               
                                        $marcar= new marcacategoria();
                                        $dtos=$marcar->ubicacion();
                                        while($fila=mysqli_fetch_object($dtos)){
                                        
                                        echo("<option value='$fila->nombreUbica' >$fila->nombreUbica</option> ");
                                        }                          
                                                
                                        ?> 
                                
                                 </select>
                         </label>  
                         <label <?php echo($actaRecep);?> class="col-md-12 border "  ><input id="Observaciones"  class="form-control   form-control-sm" value=""  >Observacion</label> 
                </label>&nbsp;   
                
                <label class="col-3 col-md-1 " >Iva <input id="ivacarge" disabled="disabled"class="form-control form-control-sm" value=""  ></label>
              <label for="" class="col-3 col-md-1"><br>
              <input   id="agregarproduc" type="button" class="cotizacion   form-control-sm" value="✖️Agregar"></input>
              </label>
                       
        </div>
      
</div>
<table id="tablaentrada" class="table-responsive table table-striped table-hover  " >
<thead class="table-primary" style="position: sticky;
      top: 0;">  
                    <tr class="cabeceratabla" >
                        <th scope="col" 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%">costocaja</th>
                        <th scope="col" class="text-center "  style="width:5%">costofrcc</th>                    
                        
                        <th scope="col" class="text-center"  style="width:7%">total</th>

                        <th scope="col" class="text-center"  hidden="true" style="width:2%">utilcaja</th>
                        <th scope="col" class="text-center"  hidden="true" style="width:2%">utilifrcc</th>
                        <th scope="col" class="text-center"  hidden="true" style="width:2%">lote</th>
                        <th scope="col" class="text-center"  hidden="true" style="width:2%">FVencimiento</th>
                        <th scope="col" class="text-center"  hidden="true" style="width:2%">Rinvima</th>
                        <th scope="col" class="text-center"  hidden="true" style="width:2%">Einvima</th>
                        <th scope="col" class="text-center"  hidden="true" style="width:2%">Observac</th>
                        <th scope="col" class="text-center"   style="width:7%">ventaCaja</th>
                        <th scope="col" class="text-center"   style="width:7%">ventaFrcc</th>
                        <th scope="col" class="text-center"  hidden="true" style="width:7%">ventaCaja2</th>
                        <th scope="col" class="text-center"  hidden="true" style="width:2%">ventaFrcc2</th>
                        <th scope="col" class="text-center"  hidden="true" style="width:2%">ubicacion</th>
                        <th scope="col" class="text-center"  hidden="true" style="width:2%">precioblister</th>

                        <th scope="col" class="text-center"  hidden="true" style="width:2%">utilidadCaja2</th>
                        <th scope="col" class="text-center"  hidden="true" style="width:2%">utilidadFrcc2</th>

                        <th scope="col" class="text-center"  hidden="true" style="width:2%">precioCaja3</th>
                        <th scope="col" class="text-center"  hidden="true" style="width:2%">precioFrcc3</th>
                        
                        <th scope="col" class="text-center"  hidden="true" style="width:2%">utilidadCaja3</th>
                        <th scope="col" class="text-center"  hidden="true" style="width:2%">utilidadFrcc3</th>

                        <th scope="col" class="text-center"  style="width:5%">opcion</th>
                                        
                  
                    </tr>
               
                    </thead>
        <tbody id="tablacargar"  class="col-md-7 table table-bordered table-striped" >
                     
        


        </tbody>


            </table>

    <div id="base" class="row  justify-content:space-between; footFact" >
       <div class="row col-md-8" style="zoom:80%;">  
        
       <div class="col nombreTotales" >
        <p class=" nombreTotales sub"><b>Registros</b></p><label  id="l"></label><input type="text" id="registrosid"  class="cuadrobases totalC"  value="0" disabled="gc_disable">


<label  id="l"></label><input type="text" id="iditem"  class="cuadrobases totalC"  value="0" disabled="gc_disable">

</div>
                <div class="col nombreTotales" ><p class=" nombreTotales sub"><b>Exento</b></p><label  id="l"></label><input type="text" id="baseexentoc"  class="cuadrobases totalC"  value="0" disabled="gc_disable"></div>
                <div class="col nombreTotales" ><p class=" nombreTotales"><b>Excluido</b></p><label  id="l"></label><input type="text" id="dbaseexcluidoc"  class="cuadrobases totalC"  value="0" disabled="gc_disable"></div>
                <div class="col nombreTotales" ><p class="nombreTotales"><b>5%</b></p><label  id="l"> </label><input type="text" id="totaliva5c"  class="cuadrobases totalC"  value="0" disabled="gc_disable"><input type="text" id="base5c"  class="cuadrobases totalC"  value="0" disabled="gc_disable"></div>
                <div class="col nombreTotales" ><p class="nombreTotales"><b>19%</b></p><label  id="l"><input type="text" id="totaliva19c"  class="cuadrobases totalC" value="0" disabled="gc_disable"><input type="text" id="base19c"  class="cuadrobases totalC" value="0" disabled="gc_disable"></div>
                <div class="col nombreTotales" ><p class="nombreTotales"><b>Otro</b></p><label  id="l"><input type="text" id="civaotro"  class="cuadrobases totalC" value="0" disabled="gc_disable"><input type="text" id="cbaseotro"  class="cuadrobases totalC" value="0" disabled="gc_disable"></div>
                
                
                
                <div class="col nombreTotales">

                         <label class="" > Rete
                        <select id="tipoRete" class="form-control-sm selectStyle" >
                        <option value="0">0</option>
                        <option value="1.25">1.25</option>
                        <option value="2.5">2.5</option>
                                <option value="3.5">3.5</option>
                               
                        

                        

                        </select>

        
                         </label>

                         <input type="text" disabled class="cuadrobases" id="valorRetenc" value="0" >

                         <div class="col nombreTotales">

                                <label class="" > Des Comp
                                        <input type="number"  class="cuadrobases " id="descuCompra" value="0" >

                                </label>


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

      






                

                <div class="col  col-md-4  " id="totales">

              

                       <h2  id="dos" class="col-3 ">💰 Total</h2></label>
                       <input type="text" id="totalcargue"  style="height:50px;  font-size: 20px;"  name="totalfactura" class="col-6 col-md-5 "  disabled="gc_disable" ></input>
                     
                       <button style="height:50px;" type="button" id="grabar" class="col-6 btn btn-primary col-md-5 " value="GRABAR" ><strong>✅  GUARDAR</strong></button>
                
                
                </div>

        </div>


</form>

 </div>


<?php

include("modalcrearproducto.php"); 
include("facturacion/modalcliente.php");
include("facturacion/modalproductos.php"); 
include("inventario/modalbuscarprov.php");    
   
?>