<?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_cobrar_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 cobrar</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_cobrar.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 COBRAR</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","");?>
</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;">CLIENTE</div>
<input name="TxtPro" type="text" id="TxtPro" 
class="lt" style="left: 417px; top: 134px; width: 243px" 
value="<?php echo $StrPro;?>"  
tabindex="<?php echo ++$TI;?>"/>

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


<div class="s1" style="left: 782px; top: 117px; width: 81px;">COBRADO</div>
<select name="CboSN" id="CboSN" 
class="lt" style="position: absolute; left: 785px; top: 134px; width: 82px;"
tabindex="<?php echo ++$TI;?>">
<?php
if($StrSN=="" || $StrSN=="TODOS"){
AD("TODOS",1);AD("NO",0);AD("SI",0);
}
if($StrSN=="NO"){
AD("TODOS",0);AD("NO",1);AD("SI",0);
}
if($StrSN=="SI"){
AD("TODOS",0);AD("NO",0);AD("SI",1);
}

?>
</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="18%">F. PAGO</th>
<th width="9%">NUMERO</th>
<th width="21%">BANCO</th>
<th width="8%">FEC.VEN.</th>
<th width="9%">TOTAL</th>
<th width="35%">CLIENTE</th>
</tr>
</thead>
<tbody>



<?php	
$TOT=0;	  		

$s="SELECT FPAGO,NUMF,DATE_FORMAT(FECVEN,'%d-%m-%y'),TOT,CLI,BAN ".
"FROM vcobros ".
"WHERE (ID>0 AND FPAGO<>'EFECTIVO' )AND	".
"FPAGO LIKE '$StrFdp_' AND ".
"NUMF LIKE '$StrNum_' AND ".
"FECVEN >= '$StrDex_' AND ".
"FECVEN <= '$StrHax_' AND ".
"CLI LIKE '$StrPro_' AND MON LIKE '$StrMon_' AND PAG LIKE '$StrSN_' ".
"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="3" bgcolor="#FFFFFF">
</td>
<td bgcolor="#FFFFFF" >TOTAL</td>
<td bgcolor="#FFFFFF" style="text-align:right" ><?php echo NF2($TOT,2);?></td>
<td bgcolor="#FFFFFF" ></td>

</tr>

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

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

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