<?php
session_start();
include("cls_conexion.php");$CNN=new ClsMySQL();include("conexion23.php");
//
if(strlen($_SESSION['SYS_USER_ID'])==0){JsDir("login.php");	return;}
//
include("deos_lt_xpagar_bx.php");

$IdUsu=$_SESSION['SYS_USER_ID'];
$AT=gs("at","usuarios","id_usuario=$IdUsu");

?>

<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Letras / Cheques por pagar</title>
<!----------------------------------------->
<?php AddJs(); ?>
<script type="text/javascript" src="ja/funciones.js"></script>

<!----------------------------------------->
<link rel="stylesheet" type="text/css" href="css/estiloss.css"  />
<link rel="stylesheet" type="text/css" href="css/basic.css"  />
<link rel="stylesheet" type="text/css" href="css/mnu.css"  />
<!----------------------------------------->
<style type="text/css">
.cF {height:600px;width:1250px;position:relative;top:0px}
.mM {height:34px;width:1250px;position:relative;top:0px;background-color:#09C; z-index:500;}

</style>

<!----------------------------------------->
<script>
$(document).ready(function(){  
   Inicializar();
   jF("CboFdp");
});

$(document).keydown(function(e){
	var AT=gv("TxtAT");

	if(e.which==66 && e.altKey){
		if(AT=="1"){	
		document.getElementById("CmdB").click();
		return;
		}
	}

	if(e.which==86 && e.altKey){
		if(AT=="1"){
		document.getElementById("CmdZ").click();
		return;
		}
	}
  
});
  
</script>
<!----------------------------------------->

<body  <?php echo $LStrMsg;?>  >
<div align="center">

<div class="mM" align="left" style="font-size:12px">
<?php
$HTM=file_get_contents("http://inversionessounduniversal.com/ventas/phpmnu.php?USER_ID=$IdUsu");
echo $HTM;
?>
</div>

<div Id="DivFRM"  class="cF" style="background-color:#FFFFFF;" >
<form id="Frm" name="Frm" method="post" action="letras_x_pagar.php" style="margin:0px; padding:0px; display:inline;" onSubmit="return false;">

<!----------------------------------------->
<div id="DivT" class="dT"  style="width:1250px;">
<img src="b.png" class="iT" />
<div class="tT">LETRAS / CHEQUES POR PAGAR</div>
</div>
<!----------------------------------------->
  
<div class="s1" style="left: 35px; top: 117px; width: 128px;">FORMA DE PAGO</div>
<select name="CboFdp" id="CboFdp" 
class="lt" style="left: 34px; top: 134px; width:130px" 
tabindex="<?php echo ++$TI;?>">
<?php echo FCBO_("nombre","fpagos","id_fpago>0",$StrFdp,"S","N");?>
</select>


<div class="s1" style="left: 171px; top: 117px; width: 74px;">NUMERO</div>
<input name="TxtNum" type="text" id="TxtNum" 
class="lt" style="left: 170px; top: 134px; width:90px" 
value="<?php echo $StrNum;?>"  
tabindex="<?php echo ++$TI;?>"/>

<div class="s1" style="left: 268px; top: 100px; width: 151px;">FEC. VENCIMIENTO</div>
<div class="s1" style="left: 268px; top: 117px; width: 45px;">DESDE</div>
<input name="TxtDex" type="text" id="TxtDex" 
class="fe" style="left: 268px; top: 134px; width:65px" 
value="<?php echo $StrDex;?>"  
tabindex="<?php echo ++$TI;?>"/>

<div class="s1" style="left: 346px; top: 117px; width: 60px;">HASTA</div>
<input name="TxtHax" type="text" id="TxtHax" 
class="fe" style="left: 344px; top: 134px; width:65px" 
value="<?php echo $StrHax;?>"  
tabindex="<?php echo ++$TI;?>"/>

<div class="s1" style="left: 417px; top: 117px; width: 100px;">PROVEEDOR</div>
<input name="TxtPro" type="text" id="TxtPro" 
class="lt" style="left: 417px; top: 134px; width:190px" 
value="<?php echo $StrPro;?>"  
tabindex="<?php echo ++$TI;?>"/>

<div class="s1" style="left: 618px; top: 117px; width: 100px;">MONEDA</div>
<select name="CboMon" id="CboMon" 
class="lt" style="left: 618px; top: 134px; width:95px" 
tabindex="<?php echo ++$TI;?>">
<?php echo FCBO_("mon_nombre","monedas","id_moneda<>'X'",$StrMon,"","");?>
</select>

<!----------------------------------------->
<div id="DivBtn" align="left" style="position:absolute; left: 33px; top: 71px; width: 551px; height: 26px;">
<input name="CmdB" type="button" id="CmdB" class="btm"
value="Buscar" onClick="fFiltrar();"  
tabindex="<?php echo ++$TI;?>" />

</div>

<!-----------------------------------------> 

<div class="datagrid" style="position: absolute; left: 35px; top: 165px; width: 1180px; height: 416px; overflow: auto">
<table width="100%">
<thead>
<tr>
<td colspan="13" align="center"><?php echo PagBtn($LStrTR,$VP_RegXPag,$LStrPag);?></td>
</tr>

<tr>
<th width="11%">F. PAGO</th>
<th width="11%">NUMERO</th>
<th width="13%">FEC.VEN.</th>
<th width="10%">TOTAL</th>
<th width="50%">PROVEEDOR</th>
</tr>
</thead>
<tbody>


<?php	
$TOT=0;	  		

$s="SELECT FPAGO,NUMF,DATE_FORMAT(FECVEN,'%d-%m-%y'),TOT,PROV
 FROM vpagos 
 WHERE 
 (ID>0 AND FPAGO<>'EFECTIVO' )AND			
 FPAGO LIKE '$StrFdp_' AND 
 NUMF LIKE '$StrNum_' AND 
 FECVEN >= '$StrDex_' AND 
 FECVEN <= '$StrHax_' AND 
 PROV LIKE '$StrPro_' AND MON LIKE '$StrMon_' 
 ORDER BY FECVEN,FPAGO,NUMF ";
 
$result = grs($s);				
while ($r = $result->fetch_row()){
	?>	
	<tr >
	<!----------------------------------------------->
	<td><?php echo $r[0];?></td>
    <td><?php echo $r[1];?></td>
    <td><?php echo $r[2];?></td>
    <td style="text-align:right;"><?php echo $r[3];?></td>
    <td><?php echo $r[4];?></td>
	<!----------------------------------------------->
	</tr>
	<?php
	//
	$TOT=$TOT + $r[3];
}

?>	

	  
<tr  >
<td height="17" colspan="2" bgcolor="#FFFFFF"></td>
<td bgcolor="#FFFFFF" >TOTAL</td>
<td bgcolor="#FFFFFF" style="text-align:right" ><?php echo $TOT;?></td>
<td bgcolor="#FFFFFF" ></td>

</tr>

</tbody>
</table>
</div>

<!----------------------------------------->    
<?php include("ocultos.php");?>

</form>
</div>
</div>
</body>
</html>
