<?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="";
$StrHWND=V($_SESSION['SYS_HW']);
$LStrPag=V($_POST['TxtPag']);	
include("compras_fun.php");
include("compras_pdf.php");

?>
<!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>Compras</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/compras3.js"></script>
<script type="text/javascript" src="fe/leo.js"></script>
<link rel="stylesheet" type="text/css" href="css/multi.css"  />
<script>
function lqe(lpIndex){
	var hw=gv("TxtHW");
	Ow("compras_editar.php?I="+lpIndex+"&H="+hw,550*ZO(),280*ZO());	
}
$(document).ready(function(){
   $("#TxtFec").mask("99-99-99"); 
   if(jVal(gv("TxtId"))==0){
	   //EM_OC();
   }
});
function TUX(s){
	try{
		return s.trim().toUpperCase();
	}catch(e){
		return "";
	}
}
</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>
<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:1100px;
	height:600px;
	position:absolute;
	left:<?php echo "50%";?>;
	top:<?php echo "50%";?>;
	background-color:#006699;
	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;
}



.s2 {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;
	font-weight: bold;
}

.Estilo5 {color: #000000}
#Frm center #DivFRM #layer .Estilo1 strong {
	color: #900;
}
#Frm center #DivFRM #layer3 .s2 table tr td {
	color: #000;
}

.EV {
	position:absolute;
	font-family: Arial, Helvetica, sans-serif;
	color:#FF0;
	font-size: 12px;
	text-align:left;
	cursor:pointer;
}

.EL {
	position:absolute;
	font-family: Arial, Helvetica, sans-serif;
	color:#FF0;
	font-size: 12px;
	text-align:left;
	cursor:pointer;
}
-->
</style>

</head>
<body  <?php echo $LStrMsg;?> onunload="myStopFunction();">
<div Id="DivFRM"  class="centrarFrm" >
<form id="Frm" name="Frm" method="post" action="compras.php" autocomplete="off">
    <div style="position:absolute; left: 32px; top: 85px; width: 672px; height: 26px;">
      <div align="left" class="s2">
        <input name="CmdB" type="button" id="CmdG"
		<?php
		if(strlen($StrId)==0){
			echo "value=\"Guardar\"";
		}else{			
			echo "value=\"Modificar\"";
			
			$StrAnu=gs("anulado","compras","id_compra=$StrId");
			if($StrAnu=="S"){
				echo " disabled=\"disabled\"";
			}
		}
		?>
		onclick="fGuardar();" style="width:80px" tabindex="18"/>
		<input name="CmdB" type="button" id="CmdC" value="Nuevo" onclick="fCancelarPHP();"  tabindex="19"/>
        
        <input name="CmdB" type="button" id="CmdA" value="Anular" onclick="flAnular();"
		<?php
		if(strlen($StrId)==0){
			echo "disabled=\"disabled\"";
		}else{
			$StrAnu=gs("anulado","compras","id_compra=$StrId");
			if($StrAnu=="S"){
				echo "disabled=\"disabled\"";
			}
		}
		?>
		tabindex="20"/>
        
		<input name="CmdB" type="button" id="CmdE" value="Eliminar" onclick="flEliminar();"
		<?php
		if(strlen($StrId)==0){
			echo "disabled=\"disabled\"";
		}else{
			$StrAnu=gs("anulado","compras","id_compra=$StrId");
			if($StrAnu=="S"){
				echo "disabled=\"disabled\"";
			}
		}
		?>
		tabindex="21"/>
<input name="CmdB" type="button" id="CmdB" 
value="Buscar" onclick="fBuscar('compras_buscar.php');"  tabindex="22"/>
<input name="CmdB" type="button" id="CmdB" 
value="Buscar detallado" onclick="fBuscar('compras_buscar_det.php');"  tabindex="22"/>

<input name="CmdPDF" type="button" id="CmdPDF" 
value="Generar PDF" onclick="fGenPDF('PDF_P');" 
<?php
if(strlen($StrId)==0){
	echo "disabled=\"disabled\"";
}
?>
tabindex="<?php echo ++$TI;?>" />

        <input name="CmdB" type="button" id="CmdZ" 

        value="Menu" onclick="fBuscar('menu.php');"  tabindex="23"/>
      </div>
  </div>

<div style="position:absolute; left: 32px; top: 296px; width: 1061px; height: 242px; overflow:auto">
<div align="left" class="s2">
<table width="1038" height="160" border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="25" bgcolor="#999999" ><span class="s4">Nº</span></td>
<td width="94" bgcolor="#999999" ><span class="s4">CODIGO</span></td>
<td width="496" bgcolor="#999999"><span class="s4">DESCRIPCION</span></td>
<td width="129" bgcolor="#999999"><span class="s4">LINEA</span></td>
<td width="41" bgcolor="#999999" align="right"><span class="s4">CANT</span></td>
<td width="41" bgcolor="#999999" align="right"><span class="s4">PIEZAS</span></td>
<td width="51" bgcolor="#999999" align="right"><span class="s4">PRECIO</span></td>
<td width="78" bgcolor="#999999" align="right"><span class="s4">IMPORTE</span></td>
<td width="21" bgcolor="#999999" align="center">&nbsp;</td>
<td width="18" bgcolor="#999999" align="center">&nbsp;</td>
<td width="20" bgcolor="#999999" align="center">
<a href="javascript:void(0)" onclick="ChK();" >
<img src="img/eliminar.png" width="16" height="16" >
</a>
</td>
</tr>
<?php
$_IT=0;
$_TP=0;
$s="SELECT * FROM temp_compras WHERE cod_temc='$StrHWND' ORDER BY temc_index";
$result = grs($s);
$X_IMPORTE=0;
$X_ST=0;
$X_IG=0;
$X_TO=0;
$SEPARADOR=gs("aux_des","auxiliares","aux_tip='SIM'");
if(strlen($SEPARADOR)==0){$SEPARADOR="-";}
//
while ($row = $result->fetch_row()){
	$X_ID=$row[1];
	$X_CO=VV(gs("COD","vproductos","ID=$X_ID"));
	$X_DE=VV(gs("DESCRIPCION","vproductos","ID=$X_ID"));
	$X_MAR=VV(gs("LINEA","vproductos","ID=$X_ID"));
	$X_CA=$row[2];
	$X_CAU=$row[8];
	$_TP=$_TP + $X_CA;
	$X_PR=$row[3];	
	$X_IM=$row[4];	
	$X_IMPORTE=$X_IMPORTE+$X_IM;
	$X_IM=$X_IM;	
	$CH="ZH".vbr("00000".$row[5],5);
	$_IT++;
?>
<tr>
	<td width="25" bgcolor="#FFFFFF" style="color:#000"><?php echo $_IT;?></td>
	<td width="94" bgcolor="#FFFFFF" style="color:#000"><?php echo $X_CO.$SEPARADOR.$X_CAU;?></td>
	<td width="496" bgcolor="#FFFFFF" style="color:#000"><?php echo $X_DE;?></td>
	<td width="129" bgcolor="#FFFFFF" style="color:#000"><?php echo $X_MAR;?></td>
	<td width="41" bgcolor="#FFFFFF" align="right" style="color:#000"><?php echo $X_CA;?></td>
	<td width="41" bgcolor="#FFFFFF" align="right" style="color:#000"><?php echo $X_CAU;?></td>
	<td width="51" bgcolor="#FFFFFF" align="right" style="color:#000"><?php echo $X_PR;?></td>
	<td width="78" bgcolor="#FFFFFF" align="right" style="color:#000"><?php echo $X_IM;?></td>
	<td width="21" bgcolor="#FFFFFF" align="center">
	<a href="javascript:void(0)" onclick="fKiller('<?php echo $row[5];?>');" >
	<img src="img/eliminar.png" width="16" height="16" />
	</a>
	</td>
	<td width="18" bgcolor="#FFFFFF" align="center">
	<a href="javascript:void(0)" onclick="lqe('<?php echo $row[5];?>');" >
	<img src="img/b_edit.png"  border="0"/>
	</a>
	</td>
    <td width="20" bgcolor="#FFFFFF" align="center">
	<input name="<?php echo $CH;?>" id="<?php echo $CH;?>" type="checkbox" value="" />
	</td>
	</tr>	
<?php
}	
if($StrN_INC=="1"){
	$X_ST=$X_IMPORTE;
	$X_IG=round($X_ST * 0.18,2);
	$X_TO=$X_ST + $X_IG;		
}else{
//$X_UNO=round($X_IMPORTE / 118,2);
	$X_UNO=$X_IMPORTE / 118;
	$X_IG=round($X_UNO * 18,2);
	$X_ST=$X_IMPORTE - $X_IG;
	$X_TO=$X_ST + $X_IG;	
}
?>
<tr>
<td colspan="5" bgcolor="#CCCCCC">
<table width="100%" border="0">
  <tr>
    <td width="72%">&nbsp;</td>
    <td width="28%"><span class="s4">TOT. CAJAS : <?php echo $_TP;?></span></td>
  </tr>
</table>

</td>
<td colspan="2" bgcolor="#CCCCCC"><span class="s4">TOT.IMPORTE</span></td>
<td bgcolor="#CCCCCC"
align="right"
>
<input type="text" name="T_Importe" 
id="T_Importe"  
value="<?php echo number_format($X_IMPORTE,2,'.','');?>" 
style="width:78px; border:none; text-align:right; background-color:transparent"
readonly="readonly"
/>
</td>
<td bgcolor="#CCCCCC" align="center">&nbsp;</td>
<td bgcolor="#CCCCCC" align="center">&nbsp;</td>
<td bgcolor="#CCCCCC" align="center">&nbsp;</td>
</tr>
<tr>
<td colspan="11" bgcolor="#006699"></td>
</tr>
<tr>
<td colspan="5" rowspan="3" bgcolor="#CCCCCC"></td>
<td colspan="2" bgcolor="#CCCCCC"><span class="s4">SUB. TOTAL</span></td>
<td bgcolor="#CCCCCC">
<input type="text" name="T_ST" 
id="T_ST"  
value="<?php echo number_format($X_ST,2,'.','');?>"
style="width:78px; border:none; text-align:right; background-color:transparent"
readonly="readonly"
/>
</td>
<td rowspan="3" align="center" bgcolor="#CCCCCC">&nbsp;</td>
<td rowspan="3" align="center" bgcolor="#CCCCCC">&nbsp;</td>
<td rowspan="3" align="center" bgcolor="#CCCCCC">&nbsp;</td>
</tr>
<tr>
<td colspan="2" bgcolor="#CCCCCC"><span class="s4">IGV (
<?php 
$a=GetIGV();
echo $a."%";
?>
)</span></td>
<td bgcolor="#CCCCCC">
<input type="text" name="T_IG" 
id="T_IG"  
value="<?php echo number_format($X_IG,2,'.','');?>"
style="width:78px; border:none; text-align:right; background-color:transparent"
readonly="readonly"
/>
</td>
</tr>
<tr>
<td colspan="2" bgcolor="#CCCCCC"><span class="s4">TOTAL($)</span></td>
<td bgcolor="#CCCCCC">
<input type="text" name="T_TO" 
id="T_TO"  
value="<?php echo number_format($X_TO,2,'.','');?>"
style="width:78px; border:none; text-align:right; background-color:transparent"
readonly="readonly"
/>
</td>
</tr>
</table>
</div>
</div>

<script>
	function O_Z1(){
		var hw=gv("TxtHW");
		Ow('lq_com_xls_01.php?Z=1&HW='+hw,920*ZO(),490*ZO());
	}
</script>	
<input type="button" name="CmdXls1" id="CmdXls1" value="Importar desde excel" 
onClick="O_Z1()" style="position:absolute; left: 32px; top: 548px; width: 162px;"
/>

<div style="position:absolute; padding-top:3px; left: 207px; top: 548px; width: 213px; background-color: #FFCC00; layer-background-color: #FFCC00; border: 1px none #000000; height: 20px;">
<div align="center" class="s2"> <a target="_blank" href="formato_compras.xlsx">DESCARGAR PLANTILLA EXCEL</a></div>
</div>




<input type="button" name="CmdUP" id="CmdUP" value="UP" 
onclick="fLoad();" 
style="position:absolute; left: 83px; top: -282px; width: 49px; visibility:hidden"/>
<input name="TxtHW" type="hidden" id="TxtHW" value="<?php echo $StrHWND;?>"/>
<input name="TXT_TI" type="hidden" id="TXT_TI" value="<?php echo $_IT;?>"/>
<input name="TxtDAT" type="hidden" id="TxtDAT" value="" />
<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");?>"/>       
<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_TxtCod" type="hidden" id="Pro_TxtMarca" value=""/>
</div>

<div  class="csCOMBann">
	<img src="img/compras.png" width="56" height="52" 
    class="csPS"  style="top: 15px;left: 31px;" >
    <div class="cs2" style="left: 118px; top: 30px; width: 284px; color:#000">
    COMPRAS</div>
</div>


<div class="cs2" style="left: 681px; top: 170px; width: 132px;">
TIPO DE PAGO</div>
<select name="CboTdp" id="CboTdp" style="position:absolute; left: 680px; top:190px; width: 190px;" 
onkeydown="return SoloTextoEx(event,'FecLle');" tabindex="13">
<?php
echo FCBO_("tipp_nombre","tipos_pagos","",$StrTdp,"N","S");
?>
</select>


<div class="cs2" style="left: 884px; top: 170px; width: 132px;">
FECHA LLEGADA</div>
<input name="FecLle" type="text" id="FecLle" style="position:absolute; left: 884px; top: 190px; width: 180px;" 
value="<?php echo $FecLle;?>"  
onkeydown="return SoloFec(this,event,'TxtCod');" 
tabindex="3" />

<div class="cs2" style="left: 539px; top: 170px; width: 73px;">
RUC +</div>
<input name="TxtRuc" type="text" id="TxtRuc" style="position:absolute; left: 537px; top: 190px; width: 129px;" 
value="<?php echo $StrRuc;?>"  
onkeydown="return SoloEnterosEx(this,event,'CboTdp');"
onblur="fGetProveedor(this.value,'CboPro');"
tabindex="12" />

<div class="cs2" style="left:32px; top: 124px; width: 96px;">
EMPRESA</div>
<select name="CboEmp" id="CboEmp" 
style="position:absolute; left:32px; top:143px; width:100px;" 
onchange="EM_OC();"
onkeydown="return SoloTextoEx(event,'CboAlm');" tabindex="1">
<?php 
	echo LE($StrEmp,"N","N"); 
?>
</select>


<div class="cs2" style="left:143px; top: 124px; width: 96px;">
ALMACEN</div>
<select name="CboAlm" id="CboAlm" style="position:absolute; left: 141px; top: 143px; width:100px;" 
onkeydown="return SoloTextoEx(event,'TxtFec');" tabindex="2">
<?php 
	echo LA($StrEmp,$StrAlm,"N","N"); 
?>
</select>

<div class="cs2" style="left:256px; top: 109px; width: 54px;">
FECHA</div>
<div class="EV" style="left:256px; top: 124px; width: 88px; color:#FF0"><u><a onclick="fFecServer('TxtFec')">(dd-mm-yy) +</a></u></div>

<?php if(strlen($StrFec)==0)$StrFec=date("d-m-y");?>
<input name="TxtFec" type="text" id="TxtFec" style="position:absolute; left: 256px; top: 143px; width: 79px;" 
value="<?php echo $StrFec;?>"  
onkeydown="return SoloFec(this,event,'CboCom');" 
tabindex="3" />


<div class="cs2" style="left: 353px; top: 124px; width: 100px;">
COMPROBANTE</div>
<select name="CboCom" id="CboCom" style="position:absolute; left: 351px; top: 143px; width: 141px;" 
onkeydown="return SoloTextoEx(event,'TxtSer');" tabindex="4">
<?php
echo FCBO_("com_nombre","comprobantes","com_nombre IN ('FACTURA','BOLETA','CONTENEDOR')",$StrCom,"N","S");
?>
</select>

<div class="cs2" style="left:506px; top: 124px; width: 49px;">
SERIE</div>
<input name="TxtSer" type="text" id="TxtSer" style="position:absolute; left:505px; top: 143px; width: 58px;" 
value="<?php echo $StrSer;?>"  
onkeydown="return SoloTextoEx(event,'TxtNum');" 
tabindex="5" />

<div class="cs2" style="left: 583px; top: 124px; width: 76px;">
NUMERO</div>
<input name="TxtNum" type="text" id="TxtNum" style="position:absolute; left: 582px; top: 143px; width: 79px;" 
value="<?php echo $StrNum;?>"  
onkeydown="return SoloTextoEx(event,'TxtDam');" 
tabindex="6" />

<div class="cs2" style="left:674px; top: 124px; width: 59px;">
DAM</div>
<input name="TxtDam" type="text" id="TxtDam" 
style="position:absolute; left:673px; top: 143px; width: 96px;" 
value="<?php echo $StrDam;?>"  
onkeydown="return SoloTextoEx(event,'CboMon');" 
tabindex="7" />

<div class="cs2" style="left: 783px; top: 124px; width: 86px;">
MONEDA</div>
<select name="CboMon" id="CboMon" style="position:absolute; left: 780px; top: 143px; width: 92px;" 
onkeydown="return SoloTextoEx(event,'CboET');" tabindex="8">
<?php
echo FCBOOD_("mon_nombre","monedas","mon_nombre='DOLARES'",$StrMon,"N","S","mon_nombre");
?>
</select>

<div class="cs2" style="left: 886px; top: 124px; width: 74px;">
T. CAMBIO</div>
<input name="TxtTC" type="text" id="TxtTC" 
style="position:absolute; left: 884px; top: 143px; width: 72px; background-color:#CCC" 
value="<?php echo $StrTC;?>"  
onkeydown="return SoloEnterosEx(this,event,'CboPro');" 
tabindex="9" readonly="readonly" />

<div class="cs2" style="left: 974px; top: 124px; width: 90px;">
EN TRANSITO</div>
<select name="CboET" id="CboET" 
style="position:absolute; left: 970px; top: 143px; width: 97px;" 
onkeydown="return SoloTextoEx(event,'CboPro');" tabindex="10">
<?php
echo FCBO_("au_item","auxiliar","au_tab='SI_NO'",$StrET,"N","N");
?>
</select>

<div class="cs2" style="left: 32px; top: 170px; width: 93px;">
PROVEEDOR</div>
<select name="CboPro" id="CboPro" style="position:absolute; left: 32px; top: 190px; width: 490px;" 
onkeydown="return SoloTextoEx(event,'TxtRuc');"  
onchange="fGetRuc(this.value,'TxtRuc');" tabindex="11">
<?php
echo FCBO_("NOMBRE","vproveedores","",$StrPro,"N","N");
?>
</select>


<div style="position:absolute; left: 32px; top: 217px; width: 193px; height: 25px;">
<div align="left" class="s2">
<input name="ChN_INC" tabindex="14" type="checkbox" 
id="ChN_INC" value="1"  onclick="CalcularIMPORTE();" 
<?php
if($StrN_INC=="1"){
    echo "checked=\"checked\"";
}
?>
/>
EL PRECIO NO INCLUYE IGV</div>
</div>

<div class="EL" style="left: 33px; top: 249px; width: 84px;"><u><a onclick="fLimDet()">CODIGO +</a></u></div>

<input name="TxtCod" type="text" id="TxtCod"  style="position:absolute; left: 32px; top: 267px; width: 100px;" 
value="<?php echo $StrCod;?>"  
onkeydown="return SoloTextoEx(event,'TxtDes');"
onkeyup="document.getElementById('TxtHora').value=GetHora();"
tabindex="15" />

<div class="cs2" style="left: 144px; top: 249px; width: 100px;">
DESCRIPCION</div>
<input name="TxtDes" type="text" id="TxtDes" style="position:absolute; left: 143px; top: 267px; width: 391px;" 
value="<?php echo $StrDes;?>"  
onkeydown="return SoloTextoEx(event,'TxtMarca');"
onkeyup="document.getElementById('TxtHora').value=GetHora();" 
tabindex="16" />

<div class="cs2" style="left: 685px; top: 249px; width: 68px;">
PRECIO $</div>
<input name="TxtPre" type="text" id="TxtPre" style="position:absolute; left: 683px; top: 267px; width: 64px; text-align:right" 
value="<?php echo $StrPre;?>"  
onkeydown="return SoloNum(this,event,'TxtCant');"
onkeyup="fImporte();"
onfocus="selecciona_value(this);" 
tabindex="18" />

<div class="cs2" style="left: 759px; top: 249px; width: 60px;">
CANT</div>
<input name="TxtCant" type="text" id="TxtCant" style="position:absolute; left: 759px; top: 267px; width: 54px; text-align:right" 
value="<?php echo $StrCant;?>"  
onkeydown="return SoloNum(this,event,'TxtCUni');" 
onkeyup="fImporte();"
onfocus="selecciona_value(this);"          
tabindex="19" />

<div class="cs2" style="left: 828px; top: 249px; width: 69px;">
PIEZAS</div>
<input name="TxtCUni" type="text" id="TxtCUni" style="position:absolute; left: 827px; top: 267px; width: 63px; text-align:right" 
value="<?php echo $StrCUni;?>"  
onkeydown="return SoloNum(this,event,'CmdAdd');" 
onkeyup="fImporte();"
onfocus="selecciona_value(this);"          
tabindex="20" />

<div class="cs2" style="left: 907px; top: 249px; width: 81px;">
IMPORTE</div>
<input name="TxtImp" type="text" id="TxtImp" 
style="position:absolute; left: 905px; top:267px; width: 79px; background-color:#CCC; text-align:right" 
value="<?php echo $StrImp;?>"  
onkeydown="return SoloNum(this,event,'TxtTel');" 
tabindex="21" readonly="readonly" />

<input type="button" name="CmdAdd" 
style="position:absolute; left: 996px; top: 267px; width: 34px;"
id="CmdAdd" value="+" onclick="fAgregar();" tabindex="22"/>

<input type="button" name="CmdKil" 
style="position:absolute; left: 1036px; top: 267px; width: 34px;"
id="CmdKil" value="X" onclick="fLimDet();" tabindex="23"/>


<div id="TAB_AJAX" 
style="visibility: hidden;height:200px; width:810px; overflow-x:hidden; position:absolute; left: 31px; top: 310px; 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:768px; position:absolute; left: 31px; top: 294px; color: #0FF; background-color: #CCCCCC; layer-background-color: #CCCCCC; border: 1px none #000000;" align="left">
<table width="747" border="1" cellpadding="0" cellspacing="0" bgcolor="#d4e3e5" class="estilo888">
    <tbody>
      <tr  height="10 px">
        <td width="136" bgcolor="#CCCCCC">CODIGO</td>
        <td width="362" bgcolor="#CCCCCC">DESCRIPCION</td>
        <td width="119" bgcolor="#CCCCCC">LINEA</td>
        <td width="63" align="right" bgcolor="#CCCCCC">PC DOL</td>
        <td width="45" align="right" bgcolor="#CCCCCC">PC SOL</td>
      </tr>
    </tbody>
  </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 class="cs2" style="left: 547px; top: 251px; width: 120px;">
LINEA</div>
<input name="TxtMarca" type="text" id="TxtMarca" style="position:absolute; left: 546px; top: 267px; width: 121px;" 
value="<?php echo $StrMARCA;?>"  
onkeydown="return SoloTextoEx(event,'TxtPre');"
onkeyup="document.getElementById('TxtHora').value=GetHora();"  
tabindex="17" />

<div style="position:absolute; left: 239px; top: 248px; width: 125px; background-color: #FFCC00; layer-background-color: #FFCC00; border: 1px none #000000; height: 17px;">
<div align="center" class="s2"> <a target="_blank" href="productos.php">NUEVO PRODUCTO</a></div>
</div>

<script>
	function O_Z2(){
		var hw=gv("TxtHW");
		Ow('transformaciones_2.php?Z=2&HW='+hw,905*ZO(),390*ZO());
	}
</script>	

<input type="button" name="CmdSel" id="CmdSel" value="Trasformaciones" 
onClick="O_Z2();"
style="position:absolute; left: 239px; top: 218px; width: 126px;"
/>

<?php
if(strlen($StrPDFP)>0){
echo "<div id=\"layer51\" 
	  style=\"position:absolute; left: 485px; top: 110px; 
	  width: 90px; background-color: #FFCC00; layer-background-color: #FFCC00; 
	  border: 1px none #000000; height: 17px;\">";
echo "<div align=\"center\" class=\"f2\"> ";
echo " <a href=\"$StrPDFP\" download>Descarga.PDF</a> ";
echo "</div>";
echo "</div>";
}
?>


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