<?php
session_start();
date_default_timezone_set('America/Lima');
$y=date('Y');
$m=date('m');
$d=date('d');

$fec1="$d-$m-$y";
$fec2="$d-$m-$y";

$fec1gra="01-$m-$y";

if($_SESSION['usuariogrupo_id']==1 || $_SESSION['usuariogrupo_id']==2){
		
	}
	else{
 //	$punven_id = $_SESSION['puntoventa_id'];
 	}
	



?>



<section class="content">
	<div class="container-fluid">
	<div class="row">
	    <div class="col-lg-12 col-md-12 col-sm-12 col-12">
		    <div class="card">
		        <div class="card-header">
				
					
						
						<form id="for_fil_caja" action="POST">
														
				<div class="row">
				
							<div class="col-lg-3 col-sm-6 col-sm-3 col-6">				
								<label for="cmb_fil_puntoventa_id">Punto Venta:</label>
								<select name="cmb_fil_puntoventa_id" id="cmb_fil_puntoventa_id" class="form-control input-sm">
								</select>
													
							</div>
							
							<div class="col-lg-3 col-sm-6 col-6">
								<label for="cmb_fil_mon_id">Moneda:</label>
								<select name="cmb_fil_mon_id" id="cmb_fil_mon_id" class="form-control input-sm">
								</select>    
							</div>
						
							<div  class="col-lg-2 col-sm-5 col-6" style="display: inline-block; white-space: nowrap;padding-top:30px;">								
									<span onClick="caja_tabla()" style="cursor:pointer" class="btn btn-primary "><i class="fas fa-search"></i></span>									
									<span onClick="caja_filtro()" style="cursor:pointer" class="btn btn-default">RESTABLECER</span>																
							</div> 
							
							</div> 
							
						</form>	
						
				
				
				
				</div>
			</div>
		</div>
	</div>
	</div>
</section>

<script type="text/javascript">



function cmb_fil_puntoventa_id(punven){
		$.ajax({
 					type: "POST",
 					url: "../puntoventa/cmb_punven_id.php",
 					async:true,
 					dataType: "html",                      
 					data: ({						
 						emp_id:'',
						punven_id :punven,
 						vista:	''
 					}),
 					beforeSend: function() {
 						$('#cmb_fil_puntoventa_id').html('<option value="">Cargando...</option>');
 					},
 					success: function(html){			
 						$('#cmb_fil_puntoventa_id').html(html);
 					},
 					complete: function(){
 						$('#txt_punven_id').val($('#cmb_fil_puntoventa_id').val());
						
						caja_tabla();
 						}
 					});
}

	function cmb_fil_mon_id(moneid)
	{	
		$.ajax({
			type: "POST",
			url: "../moneda/cmb_mon_id.php",
			async:true,
			dataType: "html",                      
			data: ({
				mon_id: moneid
			}),
			beforeSend: function(){
				$('#cmb_fil_mon_id').html('<option value="">Cargando...</option>');
			},
			success: function(html){
				$('#cmb_fil_mon_id').html(html);
				venta_tabla();
			}
		});
	}
	
		
	$(function(){


	cmb_fil_mon_id();
	
	
cmb_fil_puntoventa_id(<?php echo $punven_id; ?>);
		
	
		
		$('#cmb_fil_puntoventa_id, #cmb_fil_mon_id').change(function(){
			
		});
	
});	
</script>
