<?php
ini_set("session.cookie_lifetime",60*60*10);
ini_set("session.gc_maxlifetime", 60*60*10);
session_start();
include("cls_conexion.php");$CNN=new ClsMySQL();include("conexion23.php");
if(strlen($_SESSION['SYS_USER_ID'])==0){JsDir("login.php");	return;}
//+++
if(vbval($_SESSION['SYS_USER_GI'])!=USU_GET_GI($_SESSION['SYS_USER_ID'])){
JsDir("cerrar.php");	
return;
}
//+++++++
$POL_USU_PER_ELI=USU_PER_GET_EX("ELI_COB_TRA");
//++++++++++++++++	
$StrGT="";
$LStrMsg="";
$LStrFoc="";
$LStrMM="";
//
include("cobrox_fun.php");
//
$w="ID>0";
//
$LStrTR=gn("count(*)","vis_cobrox",$w);
$LStrPag=V($_POST['TxtPag']);	
if($StrCmd=="F"){$LStrPag="1";}
$VP_RegXPag=15;	
$LStrPag=PagGet($LStrPag,$StrCmd,$LStrTR,$VP_RegXPag);	
$LStrFoc="document.getElementById('CboEmp').focus();";
$LStrMsg="onload=\"$LStrFoc;\"";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cobros Transferencia</title>
<script src="jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="jquery.maskedinput.min.js" type="text/javascript"></script>
<script type="text/javascript" src="fe/funcionez.js"></script>
<script type="text/javascript" src="fe/cobrox7.js"></script>
<script>
$(document).ready(function(){
   $("#TxtFec").mask("99-99-99");     
   //
   var pol_usu_per_eli=gv("POL_USU_PER_ELI");
   if(jVal(pol_usu_per_eli)==0){
	   document.getElementById("CmdE").disabled=true;
   }     
});
</script>
<link rel="stylesheet" type="text/css" href="basic.css"  />
<style type="text/css">
<!--
body {
	background-color: #CCC;
}
#Layer1 {
	position:absolute;
	left:345px;
	top:115px;
	width:123px;
	height:35px;
	z-index:1;
}
.centrarFrm{
	width:1100px;
	height:600px;
	position:absolute;
     left:<?php echo "50%";?>;
     top:<?php echo "50%";?>;
	background-color:#666666;
	 margin:<?php echo "-300px";?> 0 0 <?php echo "-550px";?>;

}
#Layer2 {
	position:absolute;
	left:409px;
	top:205px;
	width:82px;
	height:24px;
	z-index:1;
}
.Estilo1 {
	font-family: Arial, Helvetica, sans-serif;
	font-weight: bold;
	color: #FFFFFF;
}
.f2 {font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #FFFFFF; font-size: 12px; }
.Estilo3 {color: #FFFFFF; font-size: 12px; font-family: Arial, Helvetica, sans-serif;}
.s4 {color: #000099}
.s5 {color: #000000}
#Frm center #DivFRM #layer .Estilo1 strong {
	color: #900;
}

-->
</style>

</head>
<body  <?php echo $LStrMsg;?>>
<form id="Frm" name="Frm" method="post" action="cobrox.php" autocomplete="off">
<center> 
  <div Id="DivFRM"  class="centrarFrm" >
    <div id="layer4" style="position:absolute; left: 30px; top: 85px; width: 442px; height: 26px;">
      <div align="left" class="f2">
<input name="CmdB" type="button" id="CmdG" value="Guardar" 
<?php
if(strlen($StrId)>0){
	echo " disabled=\"disabled\" ";
}
?>
onclick="fGuardar();" style="width:80px" tabindex="20"/>

		<input name="CmdB" type="button" id="CmdC" value="Nuevo" 
        onclick="fCancelar();"  tabindex="21"/>
        
		<input name="CmdB" type="button" id="CmdE" value="Eliminar" onclick="flEliminar();"
		<?php
		$CMD_ANU=0;
		if(strlen($StrId)==0){
			$CMD_ANU=1;
			echo " disabled=\"disabled\" ";
		}
		if($StrId>0 && $CMD_ANU==0){
			$TMP=gs("cx_anu","cobrox","id_cx=$StrId");
			if($TMP=="SI"){
				echo " disabled=\"disabled\" ";
			}
		}
		?>
		 tabindex="22"/>
         
        <input name="CmdB" type="button" id="CmdA" value="Anular" onclick="flAnular();"
		<?php
		$CMD_ANU=0;
		if(strlen($StrId)==0){
			$CMD_ANU=1;
			echo " disabled=\"disabled\" ";
		}
		if($StrId>0 && $CMD_ANU==0){
			$TMP=gs("cx_anu","cobrox","id_cx=$StrId");
			if($TMP=="SI"){
				echo " disabled=\"disabled\" ";
			}
		}
		?>
		tabindex="23"/>
         
		<input name="CmdB" type="button" id="CmdB" 
value="Buscar" onclick="fBuscar('cobrox_buscar.php');"  tabindex="24"/>
<input name="CmdB" type="button" id="CmdZ" 
value="Menu" onclick="fBuscar('menu.php');"  tabindex="25"/>
      </div>
    </div>

<div id="layer3" style="position:absolute; left: 30px; top: 283px; width: 1039px; height: 283px;">
<div align="left" class="f2">
<table width="1042" height="19" border="1" cellpadding="0" cellspacing="0">

<tr>
<td height="18" colspan="10" bgcolor="#666666" align="center"><?php echo PagBtn($LStrTR,$VP_RegXPag,$LStrPag);?></td>
</tr>

<tr>
<td width="56" bgcolor="#999999" style="color:#000">FECHA</td>
<td width="117" bgcolor="#999999" style="color:#000">COMPROBANTE</td>
<td width="98" bgcolor="#999999" style="color:#000">SERIE - NUMERO</td>
<td width="458" bgcolor="#999999" style="color:#000">CLIENTE</td>
<td width="88" bgcolor="#999999" style="text-align:right; color:#000">TOTAL</td>
<td width="76" bgcolor="#999999" style="color:#000">TIPO</td>
<td width="81" bgcolor="#999999" style="text-align:right; color:#000">SALDO</td>
<td width="24" bgcolor="#999999" style="color:#000">ANU</td>
<td width="24" bgcolor="#999999" style="color:#000">USUARIO</td>
<td width="24" bgcolor="#999999">&nbsp;</td>
</tr>
<?php

$s="SELECT ID,DATE_FORMAT(FEC,'%d-%m-%y'),COM,CSER,CNUM,
	TOTAL,TIPO,SALDO,SUBSTRING(CLI,1,50),ANU,USU 
	FROM vis_cobrox 
	WHERE $w 
	ORDER BY ID DESC ";

$s=PagSql($s,$LStrPag,$VP_RegXPag,$LStrTR);  	  				
$result = grs($s);
while ($row = $result->fetch_row()){
if(strlen($row[3])>0 && strlen($row[4])>0 ){
$_NUM=$row[3]."-".$row[4];
}else{
$_NUM=$row[4];
}

echo "<tr ondblclick=\"fActivar($row[0]);\">";
echo "<td bgcolor=\"#FFFFFF\">

<span class=\"s5\">$row[1]</span></td>";
echo "<td bgcolor=\"#FFFFFF\">
<span class=\"s5\">$row[2]</span></td>";
echo "<td bgcolor=\"#FFFFFF\">
<span class=\"s5\">$_NUM</span></td>";

echo "<td bgcolor=\"#FFFFFF\">
<span class=\"s5\">$row[8]</span></td>";
echo "<td bgcolor=\"#FFFFFF\" style=\"text-align:right\">
<span class=\"s5\" 
>".NF3($row[5])."</span></td>";
echo "<td bgcolor=\"#FFFFFF\" >
<span class=\"s5\" 
>$row[6]</span></td>";

echo "<td bgcolor=\"#FFFFFF\" style=\"text-align:right\">
<span class=\"s5\" 
>".NF3($row[7])."</span></td>";

echo "<td bgcolor=\"#FFFFFF\" style=\"text-align:right\">
<span class=\"s5\" 
>".$row[9]."</span></td>";

echo "<td bgcolor=\"#FFFFFF\">
<span class=\"s5\">$row[10]</span></td>";

echo "<td bgcolor=\"#FFFFFF\" align=\"center\">
<a href=\"javascript:void(0)\" onclick=\"fActivar($row[0]);\">
<img src=\"img/b_edit.png\"  border=\"0\"/>
</a>
</td>";

echo "</tr>";
}

?>		  
</table>
</div>
</div>


<div id="layer" style="position:absolute; left: 116px; top: 21px; width: 412px; height: 45px; z-index: 100;">
<div align="left" class="Estilo1">
<input name="TxtId" type="hidden" id="TxtId" value="<?php echo $StrId;?>"/>
<input name="POL_USU_PER_ELI" type="hidden" id="POL_USU_PER_ELI" value="<?php echo $POL_USU_PER_ELI;?>"/>
<input name="TxtAc" type="hidden" id="TxtAc" value="" />
<input name="TxtPag" type="hidden" id="TxtPag" value="<?php echo $LStrPag; ?>" />
<input name="FEC_SERVER" type="hidden" id="FEC_SERVER" value="<?php echo date("d-m-y");?>"/>  
<strong>COBROS TRANSFERENCIA</strong> </div>
</div>



<div id="LblTit" style="position:absolute; left: 52px; top: 15px; width: 64px; z-index: 100;">
<div align="left" class="Estilo1"><img src="img/marcas.gif" width="48" height="48" /></div>
</div>
<div id="layer8" 
style="position:absolute; left: 0px; top: 0px; width: 1100px; height: 79px; background-color: #FFFFFF; layer-background-color: #FFFFFF; border: 1px none #000000; z-index: 0;">
<div align="left" class="Estilo1">        
</div>
</div>


<div id="DivNUM" class="s1" style="left: 30px; top: 117px; width: 266px;">
NUMERO DE COBRO : <?php echo $StrNUM;?>
</div>


<div class="s1" style="left:30px; top: 156px; width: 90px;">
EMPRESA
</div>
<select name="CboEmp" id="CboEmp" 
style="position:absolute; left:30px; top:174px; width: 101px;" 
onkeydown="return SoloTextoEx(event,'TxtFec');" 
onchange="EM_OC();" tabindex="1">
<?php 
	echo LE($StrEmp,"N","N");
?>
</select>

<div class="s1" style="position:absolute; left: 149px; top: 156px; width: 106px;">
PUNTO DE VENTA</div>
<select name="CboAlm" id="CboAlm" 
style="left: 147px; top: 174px; width:100px;" 
onkeydown="return SoloTextoEx(event,'TxtFec');" 
tabindex="2" >
<?php
	echo LA($StrEmp,$StrAlm,"N","S");
?>
</select>



<?php if(strlen($StrFec)==0)$StrFec=date("d-m-y");?>
<div class="s1" style="left: 258px; top: 140px; width: 87px;">
FECHA
</div>
<div class="EV" style="left: 258px; top: 156px; ; width: 88px; color:#FF0"><u><a onclick="fFecServer('TxtFec')">(dd-mm-yy) +</a></u></div>
<input name="TxtFec" type="text" id="TxtFec" style="position:absolute; left: 258px; top: 175px; width: 76px; background-color:#CCC" 
value="<?php echo $StrFec;?>"  readonly="readonly" 
onkeydown="return SoloFec(this,event,'CboCom');" 
tabindex="3" />

<div class="s1" style="left: 347px; top: 156px; width: 107px;">
COMPROBANTE
</div>
<select name="CboCom" id="CboCom" 
style="position:absolute; left: 347px; top: 175px; width: 93px;" 
onkeydown="return SoloTextoEx(event,'TxtSer');" tabindex="4">
<?php 
echo FCBOOD_("com_nombre","comprobantes",
"com_nombre IN ('FACTURA','BOLETA','PROFORMA','FACT. ELEC.','BOL. ELEC.')",$StrCom,"N","S","com_nombre");
?>
</select>


<div class="s1" style="left: 457px; top: 156px; width: 52px;">
SERIE
</div>
<input name="TxtSer" type="text" id="TxtSer" 
style="left: 456px; top: 175px; width: 48px;" 
tabindex="3"  onblur="_S(this);"
onkeydown="return SoloEnterosEx(this,event,'TxtNum');" 
value="<?php echo $StrSer;?>" maxlength="5" />

<div class="s1" style="left: 520px; top: 156px; width: 81px;">
NUMERO +
</div>
<input name="TxtNum" type="text" id="TxtNum" 
style="left: 521px; top: 175px; width: 67px;" 
tabindex="4" onblur="_N(this);" 
onkeydown="return snNum(this,event,'CboTip');" 
value="<?php echo $StrNum;?>" maxlength="6" />

<div class="s1" style="left: 605px; top: 143px; width: 81px;">
TOT. VENTA (S/.)
</div>
<input name="TxtTve" type="text" id="TxtTve" 
style="left:605px; top:175px; width:78px; background-color:#CCCCCC; text-align:right" 
value="<?php echo $StrTve;?>"  
onkeydown="return SoloEnterosEx(this,event,'TxtTot');"
readonly="readonly" 
tabindex="7" />


<div class="s1" style="left: 700px; top: 143px; width: 71px;">
TOT. A CUENTA
</div>
<input name="TxtAcu" type="text" id="TxtAcu" 
style="left: 702px; top: 175px; width: 92px; background-color:#CCCCCC; text-align:right" 
value="<?php echo $StrAcu;?>"  
onkeydown="return SoloEnterosEx(this,event,'TxtTot');"
readonly="readonly" 
tabindex="8" />


<div class="z1" style="left: 814px; top: 138px; width: 156px;">
TRANSFERENCIA</div>
<div class="z1" style="left: 814px; top: 157px; width: 67px;">
TIPO </div>
<select name="CboTip" id="CboTip" 
style="width:123px; position:absolute; left: 814px; top: 175px;" 
onkeydown="return SoloTextoEx(event,'TxtNumT');" 
tabindex="9" 
>
<?php
echo FCBO_("au_item","auxiliar","au_tab='TDT'",$StrTip,"N","S");
?>
</select>


<div class="z1" style="left: 955px; top: 155px; width: 115px;">
NUMERO +
</div>
<input name="TxtNumT" type="text" id="TxtNumT" 
style="left: 955px; top: 175px; width: 119px;" 
value="<?php echo $StrNumT;?>"  
onkeydown="return snNumT(this,event,'TxtTot');" 
tabindex="10" />

<div class="z1" style="left: 30px; top: 229px; width: 83px;">
FECHA
</div>
<input name="TxtFecDev" type="text" id="TxtFecDev" 
style="left:30px; top:250px; width:85px; background-color:#CCCCCC" 
value="<?php echo $StrFecDev;?>"  
onkeydown="return SoloEnterosEx(this,event,'TxtTot');"
readonly="readonly" 
tabindex="11" />


<div class="z1" style="left: 135px; top: 229px; width: 61px;">
DOCUMENTO
</div>
<input name="TxtDocVen" type="text" id="TxtDocVen" 
style="left:135px; top:250px; width:93px; background-color:#CCCCCC;" 
value="<?php echo $StrDocVen;?>"  
onkeydown="return SoloEnterosEx(this,event,'TxtTot');"
readonly="readonly" 
tabindex="12" />


<div class="z1" style="left: 248px; top: 214px; width: 64px;">
DOC. NUMERO
</div>
<input name="TxtDocNum" type="text" id="TxtDocNum" 
style="left:247px; top:250px; width:75px; background-color:#CCCCCC;" 
value="<?php echo $StrDocNum;?>"  
onkeydown="return SoloEnterosEx(this,event,'TxtTot');"
readonly="readonly" 
tabindex="13" />


<div class="z1" style="left: 341px; top: 214px; width: 69px;">
DOC. FEC. EMI.
</div>
<input name="TxtFecEmi" type="text" id="TxtFecEmi" 
style="left:339px; top:250px; width:79px; background-color:#CCCCCC;" 
value="<?php echo $StrFecEmi;?>"  
onkeydown="return SoloEnterosEx(this,event,'TxtTot');"
readonly="readonly" 
tabindex="14" />

<div class="z1" style="left: 436px; top: 229px; width: 80px;">
TOTAL 
</div>
<input name="TxtTotT" type="text" id="TxtTotT" 
style="left:436px; top:250px; width:99px; background-color:#CCCCCC; text-align:right" 
value="<?php echo $StrTotT;?>"  
onkeydown="return SoloEnterosEx(this,event,'TxtTot');"
readonly="readonly" 
tabindex="15" />


<div class="z1" style="left: 551px; top: 214px; width: 61px;">
SALDO DISPONIBLE
</div>
<input name="TxtDisT" type="text" id="TxtDisT" 
style="left:551px; top:250px; width:77px; background-color:#CCCCCC; text-align:right" 
value="<?php echo $StrDisT;?>"  
onkeydown="return SoloEnterosEx(this,event,'TxtTot');"
readonly="readonly" 
tabindex="16" />


<div class="s1" style="left: 646px; top: 229px; width: 60px;">
TOT. COB.</div>
<input name="TxtTot" type="text" id="TxtTot" 
style="position:absolute; left: 645px; top: 250px; width: 88px; text-align:right" 
value="<?php echo $StrTot;?>"  
onkeydown="return SoloNum(this,event,'TxtObs');" 
onkeyup="CalSaldo();"
tabindex="17" 
onfocus="selecciona_value(this);"
/>


<div class="s1" style="left: 750px; top: 229px; width: 80px;">
  SALDO
</div>
<input name="TxtSal" type="text" id="TxtSal" 
style="left: 748px; top: 250px; width: 96px; background-color:#CCCCCC; text-align:right" 
value="<?php echo $StrSal;?>"  
onkeydown="return SoloEnterosEx(this,event,'TxtObs');"
readonly="readonly" 
tabindex="18" />


<div class="s1" style="left: 857px; top: 229px; width: 162px;">
OBSERVACION</div>
<input name="TxtObs" type="text" id="TxtObs"  
style="position:absolute; left: 859px; top: 250px; width: 215px;" 
value="<?php echo $StrObs;?>"  
onKeyDown="return SoloTextoEx(event,'CmdG');" 
tabindex="19" />




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