<?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("nota_de_debito_bx.php");
?>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Nota de debito - Buscar</title>
<!--INI_SCRIPT------------------------------------------------------------------------------>
<?php AddJs(); ?>
<script type="text/javascript" src="yy/funcionexx.js"></script>
<!--FIN_SCRIPT------------------------------------->
<link rel="stylesheet" type="text/css" href="estiloss.css"  />
<link rel="stylesheet" type="text/css" href="basixx.css"  />
<style type="text/css">
.cF {height:700px;width:1100px;position:relative;top:0px}
</style>
<script>
$(document).ready(function(){  
   Inicializar();
   jF("Cod");
});
</script>
</head>

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

<div Id="DivFRM"  class="cF" style="background-color:#FFFFFF;" >
<form id="Frm" name="Frm" method="post" action="nota_de_debito_b.php">
<!--INI_TITULO-->
<div id="DivT" class="dT" style="width:1100px;background-color:#066;" >
<img src="img/buscar.png" width="56" height="52" class="iT" />
<div class="tT">NOTA DE DEBITO - BUSCAR</div>
</div>
<!--FIN_TITULO-->
<div class="s1" style="left: 116px; top: 41px; width: 140px; height: 16px; color:#FFF">
USUARIO: </div>

<div class="s1" style="left:35px; top: 117px; width: 103px; height: 18px;">
EMPRESA</div>
<select name="Emp" id="Emp" 
class="lt" style="left:35px; top:134px; width: 106px;"
tabindex="<?php echo ++$TI;?>" >
<?php
echo FCBO("alm_nombre","almacenes","id_almacen>0 ",$Suc,"S","N");
?>
</select>

<div class="s1" style="left:147px; top: 117px; width: 121px; height: 18px;">PUNTO DE EMISION</div>
<select name="Alm" id="Alm" 
class="lt" style="left:147px; top:134px; width: 122px;"
tabindex="<?php echo ++$TI;?>" >
<?php
echo FCBO("alm_nombre","almacenes","id_almacen>0 ",$Suc,"S","N");
?>
</select>

<div class="s1" style="left:276px; top: 117px; width: 96px; height: 15px;">
DOCUMENTO</div>
<select name="Doc" id="Doc" 
class="lt" style="left:275px; top:134px; width: 98px;"
tabindex="<?php echo ++$TI;?>" >
<?php
echo FCBO("com_nombre","comprobantes",
		 "id_comprobante>0 AND com_nombre IN ('ND. ELEC.')",$Doc,"N","N");
?>
</select>

<div class="s1" style="left:377px; top: 117px; width: 47px; height: 18px;">
SERIE</div>
<input name="Ser" type="text" id="Ser" 
class="lt"  style="left:377px; top: 134px; width: 44px;"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Ser;?>" />

<div class="s1" style="left:429px; top: 117px; width: 60px;">
NUMERO</div>
<input name="Num" type="text" id="Num" 
class="lt"  style="left:427px; top: 134px; width: 65px;"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Num;?>" />

<div class="s1" style="left:501px; top: 117px; width: 60px;">
DESDE</div>
<input name="Dex" type="text" id="Dex" 
class="fe"  style="left:501px; top: 134px; width: 71px;"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Dex;?>" />

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

<div class="s1" style="left:655px; top: 117px; width: 60px;">
CLIENTE</div>
<input name="Cli" type="text" id="Cli" 
class="lt"  style="left:655px; top: 134px; width: 122px;"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Cli;?>" />

<div class="s1" style="left:781px; top: 103px; width: 44px; height: 27px;"> ANU- LADO
</div>
<select name="Anu" id="Anu" 
class="lt" style="left:781px; top:134px; width: 51px;"
tabindex="<?php echo ++$TI;?>" >
<?php
echo FCBO_("au_item","auxiliar","au_tab='SI_NO'",$Anu,"S","N");
?>
</select>



<div class="s1b" style="left:839px; top: 100px; width: 186px;">
DOCUMENTO QUE MODIFICA</div>

<div class="s1" style="left:839px; top: 117px; width: 87px; height: 18px;">
DOCUMENTO</div>
<select name="DocM" id="DocM" 
class="lt" style="left:839px; top:134px; width: 110px;"
tabindex="<?php echo ++$TI;?>" >
<?php
echo FCBO("com_nombre","comprobantes",
		  "id_comprobante>0 AND com_nombre IN ('FACT. ELEC.','BOL. ELEC.','FACTURA','BOLETA')",$DocM,"S","N");
?>
</select>

<div class="s1" style="left:955px; top: 117px; width: 47px; height: 18px;">
SERIE</div>
<input name="SerM" type="text" id="SerM" 
class="lt"  style="left:955px; top: 134px; width: 42px;"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $SerM;?>" />

<div class="s1" style="left:1006px; top: 117px; width: 60px;">
NUMERO</div>
<input name="NumM" type="text" id="NumM" 
class="lt"  style="left:1006px; top: 134px; width: 58px;"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $NumM;?>" />




<!--INI_BOTONES----->
<?php 
	$VOLVER="nota_de_debito.php";
?>
<?php include("botones_b.php");?>;
<!--FIN_BOTONES-->
<!--INI_TABLA----->
<div class="datagrid"  
style="position:absolute; left:35px; top: 166px; width: 1036px; height: 503px;overflow:auto">
<table width="75%">
<thead>
<tr>
<td colspan="13" height="18" align="center"><?php echo PagBtn($LStrTR,$VP_RegXPag,$LStrPag);?></td>
</tr>
<tr>
<th width="7%">FECHA</th>
<th width="8%">EMPRESA</th>
<th width="6%">PDE</th>
<th width="8%">DOCUMENTO</th>
<th width="5%">SERIE</th>
<th width="6%">NUMERO</th>
<th width="32%">CLIENTE</th>
<th width="10%">DOC.MODIF</th>
<th width="6%">SERIE</th>
<th width="6%">NUMERO</th>
<th width="3%">ANU</th>
<th width="3%">&nbsp;</th>
</tr>
</thead>
<tbody>
<?php
$s="SELECT * FROM vis_fe_ventaz WHERE ".$FF." ORDER BY ID DESC";
$s=PagSql($s,$LStrPag,$VP_RegXPag,$LStrTR);	
$rs = grs($s);
while ($r = $rs->fetch_assoc()){
?>
	<tr onDblClick="location.href='nota_de_debito.php?Id=<?php echo $r['ID'];?>&Pag=0'">
	<!----------------------------------------------->
    <td><?php echo $r['FEC_'];?></td>   
    <td><?php echo $r['EMP_NC'];?></td>   
	<td><?php echo $r['ALM_NC'];?></td>   
    <td><?php echo $r['COM'];?></td>
    <td><?php echo $r['SER'];?></td>
    <td><?php echo $r['NUM'];?></td>
    <td><?php echo $r['CLI'];?></td>
    <td><?php echo $r['COM_M'];?></td>
    <td><?php echo $r['SER_M'];?></td>
    <td><?php echo $r['NUM_M'];?></td>
    <td><?php echo $r['ANU'];?></td>
	<!----------------------------------------------->
	<td bgcolor="#FFFFFF" align="center">
	<a href="nota_de_debito.php?Id=<?php echo $r['ID'];?>&Pag=0">
	<img src="img/b_edit.png"  border="0"/></a></td>
	</tr>
<?php
}
?>
</tbody>
</table>
</div>
<!--FIN_TABLA----->
<?php include("ocultos.php");?>
</form>
</div>
</div>
</body>
</html>
