<?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;
}
//	
$StrGT="";
$VP_RegXPag=10;
$LStrMsg="";
$LStrFoc="";
$LStrMM="";
$LStrPag=V($_POST['TxtPag']);	
include("transferencias_fun.php");
$IT=0;
?>
<!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>Transferencias</title>
<!--CSS_NEW------------------------------------->
<link rel="stylesheet" type="text/css" href="estiloss.css"  />
<link rel="stylesheet" type="text/css" href="basic.css"  />
<!--CSS_NEW------------------------------------->
<?php AddJs();?>
<script type="text/javascript" src="fe/transferencias.js"></script>
<script type="text/javascript" src="fe/funcionez.js"></script>
<script>
var myVar=setInterval(function(){myTimer()},500);
function myTimer(){
	t=GetHora();
	tt=document.getElementById("TxtHora").value;
	if(tt>0){
		if(t-tt>=1){
			document.getElementById("TxtHora").value=0;
			fGetTabla();			
		}
	}
}
function myStopFunction(){
	clearInterval(myVar);
}

</script>
<script>
$(document).ready(function(){
	$("#TxtFec").mask("99-99-99");
	if(jVal(gv("TxtId"))==0){
	   //EM_OC();	  
   }  
});
</script>
<style type="text/css">
<!--
.estilo888 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #003366;
	font-weight: bold;
}
#TAB_CAPTION .estilo888 {
	color: #000;
}
-->
</style>
<style type="text/css">
<!--
.estilo777 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #003366;
}
-->
</style>
<style type="text/css">
<!--
body {
	background-color: #CCC;
	background-image: url();
}
#Layer1 {
	position:absolute;
	left:345px;
	top:115px;
	width:123px;
	height:35px;
	z-index:1;
}
.centrarFrm{
	width:900px;
	height:600px;
	position:absolute;
	left:<?php echo "50%";?>;
	top:<?php echo "50%";?>;
	background-color:#006699;
	margin:<?php echo "-300px";?> 0 0 <?php echo "-450px";?>;
}
#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;}
.z4 {color: #000099}
.Estilo5 {color: #000000}
#Frm center #DivFRM #layer .Estilo1 strong {
	color: #900;
}
#Frm center #DivFRM #layer3 .f2 table tr td {
	color: #000;
}
#Frm center #DivFRM #layer3 .f2 table {
	color: #999;
}

-->
</style>

</head>
<body  <?php echo $LStrMsg;?> onunload="myStopFunction();">
<form id="Frm" name="Frm" method="post" action="transferenciasv.php"  autocomplete="off">
<center> 
  <div Id="DivFRM"  class="centrarFrm" >
    <div id="layer4" style="position:absolute; left: 42px; top: 85px; width: 672px; height: 26px;">
      <div align="left" class="f2">
        <input name="CmdB" type="button" id="CmdC" value="Nuevo" onclick="fCancelarPHP();"  tabindex="18"/>
        
        <input name="CmdB" type="button" id="CmdA" value="Validar" onclick="fValidar();"
		<?php
		if(strlen($StrId)==0){
			echo "disabled=\"disabled\"";
		}else{
			$_OK=0;
			$StrAnu=gs("anu","transferencias","id_trans=$StrId");
			if($StrAnu=="S"){
				echo " disabled=\"disabled\"";
				$_OK=1;
			}
			if($_OK==0){
			$StrAnu=gs("val","transferencias","id_trans=$StrId");
			if($StrAnu=="S"){
				echo " disabled=\"disabled\"";
				$_OK=1;
			}
				
			}
		}
		?>
		tabindex="19"/>
        <input name="CmdB" type="button" id="CmdB" 
value="Buscar" onclick="fBuscar('transferenciasv_buscar.php');"  tabindex="21"/>
<input name="CmdB" type="button" id="CmdZ" 
        value="Menu" onclick="fBuscar('menu.php');"  tabindex="23"/>
      </div>
  </div>

<div id="layer3" style="position:absolute; left: 42px; top: 195px; width: 818px; height: 327px; overflow:auto">
<div align="left" class="f2">
<table width="815" height="19" border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="30" bgcolor="#999999"><span class="z4">Nº</span></td>
<td width="306" bgcolor="#999999"><span class="z4">CODIGO</span></td>
<td width="271" bgcolor="#999999"><span class="z4">DESCRIPCION</span></td>
<td width="75" bgcolor="#999999"><span class="z4">LINEA</span></td>
<td width="40" bgcolor="#999999" align="right"><span class="z4">CANT</span></td>
<td width="49" bgcolor="#999999" align="right"><span class="z4">PIEZAS</span></td>
<td width="28" bgcolor="#999999" align="center">&nbsp;</td>
</tr>

<?php
$_IT=0;
$_TP=0;
$StrHWND_T=$_SESSION['SYS_HW']."_T";
$s="SELECT * FROM temp_compras WHERE cod_temc='$StrHWND_T' ORDER BY temc_index";
$result = grs($s);
while ($row = $result->fetch_row()){
$_IT++;
$X_ID=$row[1];
$X_CO=VV(gs("COD","vproductos","ID=$X_ID"));
$X_DE=VV(gs("DESCRIPCION","vproductos","ID=$X_ID"));
$X_MA=VV(gs("LINEA","vproductos","ID=$X_ID"));
$X_CA=$row[2];	
$X_UN=$row[8];	
echo "<tr>";
echo "<td width=\"83\" bgcolor=\"#FFFFFF\">$_IT</td>";
echo "<td width=\"83\" bgcolor=\"#FFFFFF\">$X_CO</td>";
echo "<td width=\"511\" bgcolor=\"#FFFFFF\">$X_DE</td>";
echo "<td width=\"129\" bgcolor=\"#FFFFFF\">$X_MA</td>";
echo "<td width=\"52\" bgcolor=\"#FFFFFF\" align=\"right\">$X_CA</td>";
echo "<td width=\"52\" bgcolor=\"#FFFFFF\" align=\"right\">$X_UN</td>";
echo "<td width=\"28\" bgcolor=\"#FFFFFF\" align=\"center\">";
echo "<a href=\"javascript:void(0)\" onclick=\"fKiller('$row[5]');\" >";
echo "<img src=\"img/eliminar.png\" width=\"16\" height=\"16\" />";
echo "</a>";
echo "</td>";
echo "</tr>";	
$_TP=$_TP + $X_CA;
}	
?>
<tr>
<td width="30" bgcolor="#CCCCCC">&nbsp;</td>
<td width="30" bgcolor="#CCCCCC">&nbsp;</td>
<td width="306" bgcolor="#CCCCCC">&nbsp;</td>
<td width="271" bgcolor="#CCCCCC" align="right">TOTAL CAJAS</td>
<td width="75" bgcolor="#CCCCCC" align="center"><?php echo NF4($_TP);?></td>
<td width="40" bgcolor="#CCCCCC" align="center">&nbsp;</td>
<td width="49" bgcolor="#CCCCCC" align="center">&nbsp;</td>
</tr>
<tr>

</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="TxtAc" type="hidden" id="TxtAc" value="" />
        <input name="TxtHora" type="hidden" id="TxtHora" value="0" />
		<input name="TxtPag" type="hidden" id="TxtPag" value="<?php echo $LStrPag; ?>" />
        <input name="TxtRuc_" type="hidden" id="TxtRuc_"  /> 
<input name="FEC_SERVER" type="hidden" id="FEC_SERVER" value="<?php echo date("d-m-y");?>"/>         
      <strong>VALIDAR TRANSFERENCIA</strong></div>
      <div id="DivDatosProd">
      	<input name="Pro_TxtId" type="hidden" id="Pro_TxtId" value=""/>
        <input name="Pro_TxtDes" type="hidden" id="Pro_TxtDes" value=""/>
        <input name="Pro_TxtPre" type="hidden" id="Pro_TxtPre" value=""/>
        <input name="Pro_TxtCod" type="hidden" id="Pro_TxtCod" value=""/>
        <input name="Pro_TxtMarca" type="hidden" id="Pro_TxtMarca" value=""/>
      </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/transferencias.png" width="56" height="52" / onclick="fGetProdDatos_Id('2');"></div>
</div>
    <div id="layer8" style="position:absolute; left: 0px; top: 0px; width: 900px; height: 79px; background-color: #FFFFFF; layer-background-color: #FFFFFF; border: 1px none #000000; z-index: 0;">
      <div align="left" class="Estilo1">        
      </div>
</div>

<div style="position:absolute; left: 42px; top: 121px; width: 54px;">
<div align="left" class="f2">FECHA </div>
</div>
<div class="EV" style="left: 42px; top: 137px; 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: 42px; top: 156px; width: 76px;" 
value="<?php echo $StrFec;?>"  
onkeydown="return SoloFec(this,event,'CboAlm');" 
tabindex="<?php echo ++$IT;?>" />

<div style="position:absolute; left: 131px; top: 137px; width: 102px;">
<div align="left" class="f2">EMP. ORIGEN</div>
</div>
<select name="CboEmp" id="CboEmp" 
style="position:absolute; left:131px; top:156px; width: 96px;" 
onchange="EM_OC();"
onkeydown="return SoloTextoEx(event,'CboAlm');" tabindex="1">
<?php 
	echo LE($StrEmp,"N","S"); 
?>
</select>

<div id="layer25" style="position:absolute; left: 236px; top: 135px; width: 111px; height: 17px;">
<div align="left" class="f2">ALMACEN ORIGEN</div>
</div>
<select name="CboAlm" id="CboAlm" style="position:absolute; left: 237px; top: 156px; width: 112px;" 
onkeydown="return SoloTextoEx(event,'TxtNum');" tabindex="<?php echo ++$IT;?>">
<?php echo LA($StrEmp,$StrAlm,"N","N"); ?>     
</select>

<div style="position:absolute; left: 363px; top: 123px; width: 102px;">
<div align="left" class="f2">NUMERO AUTOGENERADO</div>
</div>
<input name="TxtNum" type="text" id="TxtNum" style="position:absolute; left: 361px; top: 156px; width: 103px; background:#CCC" 
value="<?php echo $StrNum;?>"  
onkeydown="return SoloTextoEx(event,'CboAlmD');" 
tabindex="<?php echo ++$IT;?>" readonly="readonly" />

<div style="position:absolute; left: 474px; top: 137px; width: 102px;">
<div align="left" class="f2">EMP. DESTINO</div>
</div>
<select name="CboEmpD" id="CboEmpD" 
style="position:absolute; left:474px; top:156px; width: 98px;" 
onchange="EM_OCD();"
onkeydown="return SoloTextoEx(event,'CboAlm');" tabindex="1">
<?php 
	echo FCBO_("emp_nomc","empresas","id_emp>0",$StrEmpD,"N","S");
?>
</select>

<div style="position:absolute; left: 579px; top: 137px; width: 121px;">
<div align="left" class="f2">ALMACEN DESTINO</div>
</div>

<select name="CboAlmD" id="CboAlmD" style="position:absolute; left: 579px; top: 156px; width: 127px;" 
onkeydown="return SoloTextoEx(event,'CmdA');" tabindex="<?php echo ++$IT;?>">
<?php 
	echo FCBO_("ANC","vis_almacenes","IDA>0 AND ENC='$StrEmpD'",$StrAlmD,"N","N");
?>
</select>

<div style="position:absolute; left: 715px; top: 122px; width: 111px;">
<div align="left" class="f2">TRANSFERENCIA</div>
</div>
<div style="position:absolute; left: 715px; top: 138px; width: 49px;">
<div align="left" class="f2">SERIE</div>
</div>
<input name="TraSer" type="text" id="TraSer" 
style="position:absolute; left:715px; top: 156px; width: 43px; background:#CCC" 
value="<?php echo $StrTSer;?>"  
onkeydown="return SoloTextoEx(event,'TraNum');" 
tabindex="<?php echo ++$IT;?>" readonly="readonly" />

<div style="position:absolute; left: 768px; top: 138px; width: 49px;">
<div align="left" class="f2">NUMERO</div>
</div>
<input name="TraNum" type="text" id="TraNum" 
style="position:absolute; left:768px; top: 156px; width: 54px; background:#CCC" 
value="<?php echo $StrTNum;?>"  
onkeydown="return SoloTextoEx(event,'CboAlmD');" 
tabindex="<?php echo ++$IT;?>" readonly="readonly" />



<div id="TAB_AJAX" style="visibility: hidden; height:200px; width:814px; overflow-x:hidden; position:absolute; left: 42px; top: 261px; overflow-y:scroll; color: #0FF; background-color: #FFFFFF; layer-background-color: #CCCCCC; border: 1px none #000000;" align="left">
</div>
<div id="TAB_CAPTION" 
style="visibility: hidden; height:20px; width:814px; position:absolute; left: 42px; top: 242px; color: #0FF; background-color: #CCCCCC; layer-background-color: #CCCCCC; border: 1px none #000000;" align="left">
<table width="743" border="1" cellpadding="0" cellspacing="0" bgcolor="#d4e3e5" class="estilo888">   
<tr  height="10 px">
<td width="136" bgcolor="#CCCCCC">CODIGO</td>
<td width="365" bgcolor="#CCCCCC">DESCRIPCION</td>
<td width="121" bgcolor="#CCCCCC">MARCA</td>
<td width="56" align="right" bgcolor="#CCCCCC">PC SOL</td>
<td width="53" align="right" bgcolor="#CCCCCC">PC DOL</td>
</tr>   
</table>
<div style="position:absolute; top:0px; left:758px"><input name="CmdClose" type="button" value="Cerrar" onclick="CerrarDIV();" style="background-color:#F90" /></div>
</div>





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