<?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");
include("conexion_funciones.php");
//-------------------------++++
$USER_EMP=V($_SESSION['SYS_USER_EMP']);	
$USER_PDV=V($_SESSION['SYS_USER_PDV']);	
//-------------------------
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;
}
//
$M_S=true;
$M_C=true;
//
$IdU=vbval($_SESSION['SYS_USER_ID']);
$PRO_ID_ALM=gn("pro_id_alm","usuarios","id_usuario=$IdU");
//
$StrGT="";
$VP_RegXPag=10;
$LStrMsg="";
$LStrFoc="";
$LStrMM="";
$LStrPag=V($_POST['TxtPag']);	
//
$POL_USU_EV=gs("ev","usuarios","id_usuario=$IdU");
$POL_USU_MV=gs("mv","usuarios","id_usuario=$IdU");
$POL_USU_AV=gs("av","usuarios","id_usuario=$IdU");
//
$CLS="";
$ERROR_MSG="";
include("cotizaciones_fun.php");
include("cotizaciones_b_fun.php");
include("cotizaciones_fun_g.php");
//
$StrHWND_COT=V($_SESSION['SYS_HW']."_COT");
/////////////////////////////////////////
if(strlen($StrId)>0 && $StrCmd=="AR_PLUS"){
	$StrNew="NO";
	$Id=$StrId;
	$vv="vcotizaciones";
	$cc="ID=$Id";
	$StrEmp=gs("EMPC",$vv,$cc);
	$StrAlm=gs("ALM",$vv,$cc);
	$StrFec=gs("DATE_FORMAT(FEC,'%d-%m-%y')",$vv,$cc);		
	$StrSer=gs("SER",$vv,$cc);
	$StrNum=gs("NUM",$vv,$cc);
	$StrMon=gs("MON",$vv,$cc);
	if($StrMon=="S") $StrMon="SOLES";
	if($StrMon=="D") $StrMon="DOLARES";
	$StrIdCliente=gn("IDCLI",$vv,$cc);
	$StrCliente=gs("CLI",$vv,$cc);
	$StrRuc=gs("RUC",$vv,$cc);
	if(strlen($StrRuc)==0){
		$StrRuc=gs("DNI",$vv,$cc);
	}
	
	$StrNPed=gs("NPED",$vv,$cc);
	$StrContacto=gs("CONT",$vv,$cc);
	$StrN_INC=gs("IIG",$vv,$cc);
	$Str_PRI=gs("cot_pri","cotizaciones","id_cotizacion=$Id");
	$Str_DES=gs("cot_des","cotizaciones","id_cotizacion=$Id");
	$Str_VER=gs("cot_ver","cotizaciones","id_cotizacion=$Id");
	$StrSto_=gn("cot_id_alm","cotizaciones","id_cotizacion=$Id");
	$StrVen=gs("VEN","vcotizaciones","ID=$Id");
	$StrTdp=gs("TDP","vcotizaciones","ID=$Id");
	$StrAcu=gn("ACU","vcotizaciones","ID=$Id");		
	$StrVue=gn("VUE","vcotizaciones","ID=$Id");
	$StrSal=gn("SAL","vcotizaciones","ID=$Id");	
	$StrMod=gs("MODAL","vcotizaciones","ID=$Id");
	$StrTReal=gn("TOT_DES","vcotizaciones","ID=$Id");
	$StrTDes=gn("TOT_DES","vcotizaciones","ID=$Id");
	$StrNumR="";
	$STR_DR="";
	$StrDocR=gs("COM_DOC","vcotizaciones","ID=$Id");
	$StrEmpR=gs("COM_EMP","vcotizaciones","ID=$Id");
	$CueEmp=gn("cue_id_emp","cotizaciones","id_cotizacion=$Id");
	$CueEmp=gs("emp_nomc","empresas","id_emp=$CueEmp");
	//
	if(strlen($StrDocR)>0){
		$StrNumR=gs("CONCAT(COM_SER,'-',COM_NUM)","vcotizaciones","ID=$Id");
		$STR_DR=$StrDocR;
	}
	
	if(strlen($StrMod)==0)$StrMod="EFECTIVO";		
	ejt("DELETE FROM temp_compras2 WHERE cod_temc='$StrHWND_COT'");
	$s="SELECT * FROM cotizaciones_det WHERE id_cotizacion=$Id ORDER BY cx";		
	$cx=0;
	$rs = grs($s);			
	while ($row = $rs->fetch_assoc()){
		$cx++;
		$AR_ID=$row['id_producto'];
		$AR_CA=$row['ca'];
		$AR_PR=$row['pr'];
		$AR_IM=$row['im'];
		$AR_DT=$row['dt'];
		$AR_CO=$row['cod'];
		$AR_DE=$row['des'];
		$AR_CU=$row['can_uni'];
		$bit_stock=$row['bit_stock'];
		$bit_stock_usu=$row['bit_stock_usu'];
		$bit_precio=$row['bit_precio'];
		$bit_precio_usu=$row['bit_precio_usu'];
		$s="INSERT INTO temp_compras2 VALUES ('$StrHWND_COT',
		   $AR_ID,$AR_CA,$AR_PR,$AR_IM,$cx,
		   '$AR_CO','$AR_DE',$AR_DT,$AR_CU,
		   $bit_stock,$bit_stock_usu,$bit_precio,$bit_precio_usu)";			
		ejt($s);
		//echo $s."<br>";
		//++
	}
	$_ID=gn("count(*)","ventas","ven_id_com=-3 AND ven_id_ven=$Id AND anu='N'");
	if($_ID>0){
		$DR=$_ID;
	}else{
		$_ID=gn("count(*)","ginterna","gi_id_cotizacion=$Id AND gi_anu='N'");
		if($_ID>0){
			$DR=$_ID;
		}else{
			$_ID=gn("count(*)","guias","id_comr=-3 AND id_ref=$Id AND anu='N'");
		}
	}
	if(COT_V_MR($Id)){
		$M_S=false;				
	}
	if(COT_V_CR($Id)){
		$M_C=false;
		$M_S=false;		
	}
	
}
//+++++++++++++++++++
if($CLS=="S"){
	$StrId="";
	$StrNew="NO";
	$StrFec=date("d-m-y");
	$StrSer="";
	$StrNum="";
	$StrCliente="";
	$StrIdCliente="0";
	$StrRuc="";
	$StrN_INC="";
	$StrCod="";
	$StrDes="";
	$StrPre="";
	$StrCant="";
	$StrImp="";
	$StrTotal="";
	$StrContacto="";
	$StrNPed="";
	$StrDscto="";
	$StrCUni="";
	$Pro_TxtDes="";
	$Pro_TxtPre="";
	$Pro_TxtPreM="";
	$Pro_TxtCod="";
	$Pro_TxtMarca="";	
	$Str_DES="";
	$Str_VER="";
	$StrSto="";	
	$StrAcu="";
	$StrTdp="CONTADO";
	$StrMon="SOLES";
	$StrVue="0.0";
	$StrSal="0.0";
	$DR="0";
	$StrTReal="";
	$StrTDes="";
	$StrDocR="";
	$StrEmpR="";
	$StrNumR="";
	$STR_DR="";
	$StrVen="";
	$CueEmp="";
	//
	if($PRO_ID_ALM==0){
		if(strlen($StrEmp)==0)$StrEmp=GE("N");
		if(strlen($StrAlm)==0)$StrAlm=GA($StrEmp,"N");	
	}else{
		$StrEmp=gs("ENC","vis_almacenes","IDA=$PRO_ID_ALM");
		$StrAlm=gs("ANC","vis_almacenes","IDA=$PRO_ID_ALM");
	}
	
}
/////////////////////////////////////////+++
if($StrGT=="S"){
if(strlen($LStrMsg)>0){
if(strlen($LStrFoc)==0){
if($StrN_AUTO=="0"){
$LStrMsg="onload=\"alert('$LStrMsg');\"";
}else{
$LStrMsg="onload=\"alert('$LStrMsg');AutoNumeracion(2);\"";
}
}else{
if($StrN_AUTO=="0"){
$LStrMsg="onload=\"alert('$LStrMsg');$LStrFoc;\"";
}else{
$LStrMsg="onload=\"alert('$LStrMsg');$LStrFoc;AutoNumeracion(2);\"";
}
}
}else{
if(strlen($LStrFoc)>0){
if($StrN_AUTO=="0"){
$LStrMsg="onload=\"$LStrFoc;\"";
}else{
$LStrMsg="onload=\"$LStrFoc;AutoNumeracion(2);\"";
}
}
}
}else{
if($StrN_AUTO=="1"){
$LStrMsg="onload=\"document.getElementById('CboEmp').focus();AutoNumeracion(2);\"";
}else{
$LStrMsg="onload=\"document.getElementById('CboEmp').focus();\"";
}
}
/////////////////////////////////////////+++
$PRO_NL=gn("nl","doc_nl","doc='P'");
?>
<!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>Proformas</title>
<link rel="stylesheet" type="text/css" href="estiloss.css"  />
<link rel="stylesheet" type="text/css" href="basic.css"  />
<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/cotizaciones12.js"></script>
<script type="text/javascript" src="fe/funcionez.js"></script>
<script type="text/javascript" src="fe/leo.js"></script>
<script>
$(document).ready(function(){
   $("#TxtFec").mask("99-99-99");     
   CalcularVuelto(); 
});
</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);
}

//
function Verificar(){
	var DATA="";
	document.getElementById("TxtDAT").value="";
	frm = document.getElementById("Frm");
	if (!frm) return;
	for(i=0; i<frm.elements.length; i++)
	{
		if (frm.elements[i].type == "checkbox")	{
			if(frm.elements[i].name.substring(0,1)=="Z"){
				if(frm.elements[i].checked==true){
					var ok=frm.elements[i].name;
					ok=ok.substring(2,7);
					DATA=DATA+ok+",";
				}
			}
		}
	}	
	if(jLen(DATA)==0){
		alert("Ningun registro seleccionado, seleccione un registro marcando el check correspondiente");
		return 0;
	}else{		
		document.getElementById("TxtDAT").value=DATA;
		return 1;
	}
}
function ChK(){
	var DR=gv("TxtDR");
	if(jVal(DR)>0){
		alert("El presente registro ha sido tomando "+
			  "como referencia, por lo tanto NO SE PUEDE ELIMINAR");		
	}else{
		if(Verificar()==1){		
			document.getElementById("TxtAc").value="KCH";
			document.getElementById("Frm").submit();	
		}
	}
}
//

</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:1040px;
height:800px;
position:absolute;
left:<?php echo "50%";?>;
top:<?php echo "30%";?>;

background-color:#006699;

margin:<?php echo "-200px";?> 0 0 <?php echo "-520px";?>;
}
#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;
}
.s22 {font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #FFFFFF; font-size: 12px; }
.sFA {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
color: #FF3;
font-size: 12px;
}
.Estilo3 {color: #FFFFFF; font-size: 12px; font-family: Arial, Helvetica, sans-serif;}
.s4 {color: #000099}
.Estilo5 {color: #000000}
#Frm center #DivFRM #layer .Estilo1 strong {
color: #900;
}
#Frm center #DivFRM #layer3 .s2 table tr td {
color: #000;
}
#Frm center #DivFRM #layer3 .s2 table tr td table tr td {
color: #FFF;
}
#Frm center #DivFRM #layer3 .s2 table {
color: #000;
}

-->
</style>

</head>
<body  <?php echo $LStrMsg;?> onunload="myStopFunction();">
<form id="Frm" name="Frm" method="post" action="cotizaciones.php" autocomplete="off">

<input name="POL_MP" type="hidden" id="POL_MP" value="<?php echo LIST_U_MP();?>" />
<input name="POL_MB" type="hidden" id="POL_MB" value="<?php echo LIST_U_MB();?>" />
<input name="TxtDR" type="hidden" id="TxtDR" value="<?php echo $DR;?>" />

<input name="BIT_AUTOR" type="hidden" id="BIT_AUTOR" value="" />

<input name="BIT_STOCK" type="hidden" id="BIT_STOCK" value="" />
<input name="BIT_STOCK_USU" type="hidden" id="BIT_STOCK_USU" value="" />
<input name="BIT_PRECIO" type="hidden" id="BIT_PRECIO" value="" />
<input name="BIT_PRECIO_USU" type="hidden" id="BIT_PRECIO_USU" value="" />

<center> 
<?php
$DIV_CSS="";
if(strlen($ERROR_MSG)>0){
	$DIV_CSS=' style="background-color:#F90" ';
}
?>
<div Id="DivFRM"  class="centrarFrm" <?php echo $DIV_CSS;?>  >

<div class="s1 " style="position:absolute; left: 33px; top: 85px; width: 995px;">

<input name="CmdB" type="button" id="CmdG"
<?php
if(strlen($StrId)==0){
	echo "value=\"Guardar\"";
}else{
	echo "value=\"Modificar\"";
	$_YA="";
	if($M_S==false && $M_C==false){		
		echo " disabled=\"disabled\"";
			$_YA="S";
	}
	if(strlen($_YA)==0){
		$StrAnu=gs("anu","cotizaciones","id_cotizacion=$StrId");
		if($StrAnu=="S"){
			echo " disabled=\"disabled\"";
			$_YA="S";
		}
		if($POL_USU_AV=="0" && strlen($_YA)==0){
			echo " disabled=\"disabled\"";
		}
	}
}
?>

<?php
	$ECHO="";
	if(($M_S && $M_C)){		
		$ECHO=" onclick=\"fGuardar();\" ";
	}
	if(strlen($ECHO)==0){
		if($M_C==true && $M_S==false){
			$ECHO=" onclick=\"fGuardarEX();\" ";			
		}
	}
	echo $ECHO;
?>

style="width:80px" tabindex="31"/>

<input name="CmdB" type="button" id="CmdC" 
value="Nuevo" onclick="fCancelarPHP();"  tabindex="32"/>

<input name="CmdB" type="button" id="CmdA" 
value="Imprimir" 
onclick="fImprimirEXE()"
<?php
	if(strlen($StrId)==0){
		echo "disabled=\"disabled\"";
	}else{
		$StrAnu=gs("anu","ventas","id_venta=$StrId");
		if($StrAnu=="S"){
			echo "disabled=\"disabled\"";
		}
	}
?>
tabindex="33"/>

<script>
function fImprimirEXE(){
    var cod=gv("TxtId");
    if(jVal(cod)==0){
        alert("No se puede determinar el ID del registro activo");
        return;
    }
	document.getElementById("LNK_PRINTER").click();
}
</script>
<a id="LNK_PRINTER" style="display:none" href="ACCapp://COT-<?php echo vbval($StrId);?>">PLEASE RUN MS Access exe file</a>


<input name="CmdB" type="button" id="CmdA" value="Anular" onclick="flAnular();"
<?php
if(strlen($StrId)==0){
	echo "disabled=\"disabled\"";
}else{
	$_YA="";
	if($M_S==false || $M_C==false){
		echo " disabled=\"disabled\"";
		$_YA="S";
	}
	//
	$StrAnu=gs("anu","cotizaciones","id_cotizacion=$StrId");
	if($StrAnu=="S" && strlen($_YA)==0){
		echo " disabled=\"disabled\"";
		$_YA="S";
	}
	if($POL_USU_AV=="0" && strlen($_YA)==0){
		echo " disabled=\"disabled\" ";
	}
}
?>
tabindex="34"/>

<input name="CmdB" type="button" id="CmdE" value="Eliminar" 
onclick="flEliminar();"
<?php
if(strlen($StrId)==0){
	echo "disabled=\"disabled\"";
}else{
	$_YA="";
	if($M_S==false || $M_C==false){
		echo " disabled=\"disabled\"";
		$_YA="S";
	}
	$StrAnu=gs("anu","cotizaciones","id_cotizacion=$StrId");
	if($StrAnu=="S" && strlen($_YA)==0){
		echo " disabled=\"disabled\"";
		$_YA="S";
	}
	if($POL_USU_EV=="0" && strlen($_YA)==0){
		echo " disabled=\"disabled\"";
	}
}
?>
tabindex="35"/>
<input name="CmdB" type="button" id="CmdB" 
value="Buscar" onclick="fBuscar('cotizaciones_buscar.php');"  
tabindex="37"/>
<input name="CmdB" type="button" id="CmdB"  style="background-color:#FF9"
value="Buscar(X)" onclick="fBuscar('cotizaciones_buscar_express.php');"  
tabindex="37"/>

<input name="CmdB" type="button" id="CmdB" 
value="Buscar detallado" 
onclick="fBuscar('cotizaciones_buscar_det.php');"  tabindex="38"/>

<input name="CmdB" type="button" id="CmdB"  style="background-color:#FF9"
value="Buscar Det.(X)" onclick="fBuscar('cotizaciones_buscar_det_express.php');"  
tabindex="37"/>



<input name="CmdB" type="button" id="CmdE" value="Env. por email" onclick="fEnviarPDF();"
<?php
if(strlen($StrId)==0){
echo "disabled=\"disabled\"";
}else{
$StrAnu=gs("anu","cotizaciones","id_cotizacion=$StrId");
if($StrAnu=="S"){
echo " disabled=\"disabled\"";
}
}
?>
tabindex="36"/>

<input name="CmdPDF" type="button" id="CmdPDF" 
value="Gen. PDF" onclick="fGenPDF();" tabindex="19"
<?php
	if(strlen($StrId)==0){
		echo " disabled=\"disabled\" ";
	}else{
		$StrAnu=gs("anu","cotizaciones","id_cotizacion=$StrId");
		if($StrAnu=="S"){
			echo "disabled=\"disabled\"";
		}
	}
?>
/>

<input name="CmdCP" type="button" id="CmdCP" 
value="Copiar" onclick="CProf();"  
<?php echo _D_($M_S && $M_C);?>
tabindex="32"/>

<input name="CmdB" type="button" id="CmdZ" 
value="Menu" onclick="fBuscar('menu.php');"  tabindex="39"/>
</div>


<div id="layer3" style="position:absolute; left: 34px; top: 345px; width: 990px; height: 400px; overflow:auto">
<div align="left" class="s22">
<table width="971" height="45" border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="36" height="17" bgcolor="#999999" style="color:#000000">Nط&cent;ط&rsaquo;</td>
<td width="120" height="17" bgcolor="#999999" style="color:#000000">CODIGO</td>
<td width="403" bgcolor="#999999" style="color:#000000">DESCRIPCION</td>
<td width="136" bgcolor="#999999" style="color:#000000">LINEA</td>
<td width="36" bgcolor="#999999" align="right" style="color:#000000">CANT</td>
<td width="42" bgcolor="#999999" align="right" style="color:#000000">PIEZAS</td>
<td width="48" bgcolor="#999999" align="right" style="color:#000000">PRECIO</td>

<td width="61" bgcolor="#999999" align="right" style="color:#000000">IMPORTE</td>
<td width="21" bgcolor="#999999" align="center" style="color:#000000">&nbsp;</td>
<td width="17" bgcolor="#999999" align="center" style="color:#000000">&nbsp;</td>
<td width="25" bgcolor="#999999" align="center" style="color:#000000">
<?php 
	if($M_S){
?>
	<a href="javascript:void(0)" onclick="ChK();" >
	<img src="img/eliminar.png" width="16" height="16" >
    </a>
<?php		
	}
?>
</td>
</tr>
<?php
$_TP=0;
$s="SELECT * FROM temp_compras2 WHERE cod_temc='$StrHWND_COT' 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="-";}
$TOT_NL=0;
$_IT=0;
while ($row = $result->fetch_row()){
	$TOT_NL++;
	$X_ID=$row[1];
	$X_CO=gs("COD","vproductos","ID=$X_ID");
	if(strlen($X_CO)==0)$X_CO=$row[6];
	$X_CO=VV($X_CO);
	$X_DE=gs("DESCRIPCION","vproductos","ID=$X_ID");
	if(strlen($X_DE)==0)$X_DE=$row[7];
	$X_DE=VV($X_DE);
	$X_MA=VV(gs("LINEA","vproductos","ID=$X_ID"));
	$X_CA=VV($row[2]);
	$X_CAU=VV($row[9]);
	$X_PR=NF(VV($row[3]),3);	
	$X_IM=NF(VV($row[4]),3);	
	//$X_DT=NF(VV($row[8]),1);
	$X_IMPORTE=$X_IMPORTE+$X_IM;
	$X_IM=number_format($X_IM,3,'.','');
	$CH="ZH".vbr("00000".$row[5],5);
	$_TP=$_TP + $X_CA;	
	$_IT++;
?>
    <tr>
    <td style="color:#000000" bgcolor="#FFFFFF"><?php echo $_IT;?></td>
    <td style="color:#000000" bgcolor="#FFFFFF"><?php echo $X_CO.$SEPARADOR.$X_CAU;?></td>
    <td style="color:#000000" bgcolor="#FFFFFF"><?php echo $X_DE;?></td>
    <td style="color:#000000" bgcolor="#FFFFFF"><?php echo $X_MA;?></td>
    <td style="color:#000000" bgcolor="#FFFFFF" align="right"><?php echo $X_CA;?></td>
    <td style="color:#000000" bgcolor="#FFFFFF" align="right"><?php echo $X_CAU;?></td>
    <td style="color:#000000" bgcolor="#FFFFFF" align="right"><?php echo $X_PR;?></td>
    <td style="color:#000000" bgcolor="#FFFFFF" align="right" ><?php echo $X_IM;?></td>
    <td style="color:#000000" bgcolor="#FFFFFF" align="center">
    <?php 
	if($M_S){
	?>
		<a href="javascript:void(0)" 
	    onclick="fKiller('<?php echo $row[5];?>');" >
    	<img src="img/eliminar.png" width="16" height="16" />
	    </a>
    <?php		
		}
	?>

    
    </td>
    <td bgcolor="#FFFFFF" align="center">
    <?php 
	if($M_S){
	?>
		<a href="javascript:void(0)" onclick="fEditar('<?php echo $row[5];?>');" >
	    <img src="img/b_edit.png"  border="0"/>
    	</a>
    <?php		
		}
	?>    
    </td>
    <td width="25" bgcolor="#FFFFFF" align="center">
    <?php 
	if($M_S){
	?>
		<input name="<?php echo $CH;?>" id="<?php echo $CH;?>" type="checkbox" value="" />
    <?php		
		}
	?>	
	</td>
    </tr>
<?php
}
//LQ_FIN
$N=round($X_IMPORTE,2);
$M=round($X_IMPORTE,1);
if($N>$M){
	$X_IMPORTE=$M+0.1;	
}else{
	$X_IMPORTE=$M;	
}
?>
<tr>

<td colspan="7" bgcolor="#CCCCCC" 
align="right" style="color:#000000">
<table width="100%" border="0">
  <tr>
    <td width="64%">&nbsp;</td>
    <td width="23%">TOT. CAJAS : <?php echo NF4($_TP);?></td>
    <td width="13%">TOT.IMPORTE</td>
  </tr>
</table>


</td> 
<td bgcolor="#CCCCCC"
align="right">
<input type="text" name="T_Importe" 
id="T_Importe"  
value="<?php echo number_format($X_IMPORTE,3,'.','');?>"
style="width:60px; border:none; text-align:right;position:inherit" 
readonly="readonly"
/>
<?php
	$StrTReal=$X_IMPORTE - vbval($StrTDes);
?>
</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="#CCCCCC" align="right">&nbsp;</td>
  </tr>
<tr>
  <td colspan="11" bgcolor="#CCCCCC" align="right">
  <table width="100%" border="0">
    <tr>
      <td width="11%" style="color:#000">TOTAL IMPORTE</td>
      <td width="10%"  style="color:#000">TOT. DSCTO</td>
      <td width="11%" style="color:#000">TIPO DE PAGO</td>
      <td width="9%"  style="color:#000">A CUENTA</td>
      <td width="10%"  style="color:#000">MONEDA</td>
      <td width="11%" style="color:#000">MODALIDAD</td>
      <td width="9%" style="color:#000">VUELTO (S/.)</td>
      <td width="9%" style="color:#000">SALDO (S/.)</td>
      <td width="1%" style="color:#000">&nbsp;</td>
      <td width="19%" style="color:#000">IMPRIMIR Nro DE CUENTA</td>
     
    </tr>
    <tr>
<td>
<input type="text" name="TxtTReal" 
id="TxtTReal"   tabindex="27"
style="width:100px; text-align:right;position:inherit; "
onkeydown="return SoloNum(this,event,'TxtTDes');"
onfocus="selecciona_value(this);"
<?php echo _D_($M_C);?> onblur="OC_1();TReal();"
onkeyup="TReal();" value="<?php echo NF($StrTReal,1);?>" 
/>
</td>
<td>
<input type="text" name="TxtTDes" 
id="TxtTDes"   tabindex="27"
style="width:90px; text-align:right;position:inherit"
onkeydown="return SoloNum(this,event,'CboTdp');"
onfocus="selecciona_value(this);"
onkeyup="TDes();" onblur="OC_2();TDes();"
<?php echo _D_($M_C);?>
value="<?php echo NF(vbval($StrTDes),1);?>" 
/>
</td>
<td>
<select name="CboTdp" id="CboTdp" 
style="width:100px;position:inherit" 
onkeydown="return SoloTextoEx(event,'TxtACuenta');"
onchange="CalcularVuelto();" <?php echo _D_($M_C);?>
tabindex="26" >
<?php
echo FCBO_("tipp_nombre","tipos_pagos","tipp_nombre IN ('CREDITO')",$StrTdp,"N","N");
?>
</select></td>
<td>

<input type="text" name="TxtACuenta" 
id="TxtACuenta"   tabindex="27" style="width:80px; text-align:right;position:inherit; background-color:#CCC" readonly="readonly"
onkeydown="return SoloNum(this,event,'CboMon');"
onfocus="selecciona_value(this);"
<?php echo _D_($M_C);?>
value="<?php echo $StrAcu;?>" 
/>
</td>
<td>
<select name="CboMon" id="CboMon" 
style="width:90px;position:inherit" 
onkeydown="return SoloTextoEx(event,'CboMod');"  
<?php echo _D_($M_C);?> tabindex="28" onchange="CalcularVuelto();">
  <?php
echo FCBOOD_("mon_nombre","monedas","",$StrMon,"N","S","mon_nombre");
?>
</select>
</td>
<td>
<select name="CboMod" id="CboMod" 
style="width:100px;position:inherit" 
onkeydown="return SoloTextoEx(event,'CmdG');" 
<?php echo _D_($M_C);?> tabindex="28" onchange="CalcularVuelto();">
  <?php
echo FCBOO_("au_item","auxiliar","au_tab='MODA'",$StrMod,"N","N","au_orden");
?>
</select></td>
<td>
<input type="text" name="TxtVuelto" 
<?php echo _D_($M_C);?>
id="TxtVuelto"  style="width:80px; text-align:right;position:inherit"
onkeydown="return SoloNum(this,event,'CboMon');"
onfocus="selecciona_value(this);" tabindex="29"
readonly="readonly"
value="<?php echo $StrVue;?>" 
/></td>
<td>
<input type="text" name="TxtSal" 
id="TxtSal"  style="width:80px; text-align:right;position:inherit"
readonly="readonly" tabindex="30"
<?php echo _D_($M_C);?>
value="<?php echo $StrSal;?>" 
/>
</td>
<td>&nbsp;</td>
<td>
<select name="CueEmp" id="CueEmp" 
style="width:100%;position:inherit" 
onkeydown="return SoloTextoEx(event,'CboMod');"  
tabindex="31"  <?php echo _D_($M_S && $M_C);?>>
<?php
echo FCBO("emp_nomc","empresas","id_emp>0",$CueEmp,"N","S");
?>
</select>
</td>
    </tr>
    <tr>
      <td colspan="7" style="color:#F00">IMPORTANTE : LOS TOTALES SERAN REDONDEADOS A UN DECIMAL</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
  </table></td>
</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 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_COT;?>"/>
<?php
$CLAVE=gs("valor","valores","dato='CLAVE_PRECIO'");
?>
<input name="TxtId" type="hidden" id="TxtId" value="<?php echo $StrId;?>"/>
<input name="TxtPAS" type="hidden" id="TxtPAS" value="<?php echo $CLAVE;?>"/>

<input name="TxtDAT" type="hidden" id="TxtDAT" value="" />
<input name="TxtAc" type="hidden" id="TxtAc" value="" />
<input name="TXT_DR" type="hidden" id="TXT_DR" value="<?php echo $STR_DR;?>" />

<input name="TxtPRO_NL" type="hidden" id="TxtPRO_NL" value="<?php echo $PRO_NL;?>" />
<input name="TxtTOT_NL" type="hidden" id="TxtTOT_NL" value="<?php echo $TOT_NL;?>" />

<input name="TxtDIR" type="hidden" id="TxtDIR" 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="SerNum" type="hidden" id="SerNum"/>      
<input name="TxtIdCliente" type="hidden" id="TxtIdCliente" value="<?php echo $StrIdCliente; ?>"/>        
<input name="FEC_SERVER" type="hidden" id="FEC_SERVER" value="<?php echo date("d-m-y");?>"/>  
<strong>PROFORMAS</strong></div>
    <div id="DivDatosProd">
    <input name="Pro_TxtId" type="hidden" id="Pro_TxtId" value="<?php echo $StrPro_ID; ?>"/>
    <input name="Pro_TxtDes" type="hidden" id="Pro_TxtDes" value="<?php echo $Pro_TxtDes; ?>"/>
    <input name="Pro_TxtPre" type="hidden" id="Pro_TxtPre" value="<?php echo $Pro_TxtPre; ?>"/>
    <input name="Pro_TxtPreM" type="hidden" id="Pro_TxtPreM" value="<?php echo $Pro_TxtPreM; ?>"/>
    <input name="Pro_TxtCod" type="hidden" id="Pro_TxtCod" value="<?php echo $Pro_TxtCod; ?>"/>
    <input name="Pro_TxtMarca" type="hidden" id="Pro_TxtMarca" value="<?php echo $Pro_TxtMarca; ?>"/>
    </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/cotizaciones.png" width="64" height="53" / ></div>
</div>
<div id="layer8" 
style="position:absolute; left: 0px; top: 0px; width: 1040px; height: 79px; background-color: #FFFFFF; layer-background-color: #FFFFFF; border: 1px none #000000; z-index: 0;">
<div align="left" class="Estilo1">        
</div>
</div>

<div class="s1" style="position:absolute; left: 256px; top: 143px; width: 54px;">FECHA </div>
<input name="TxtFec" type="text" id="TxtFec"
style="left: 255px; top: 177px; width: 74px;" 
value="<?php echo $StrFec;?>"  
onkeydown="return SoloFec(this,event,'CboCom');"  <?php echo _D_($M_S && $M_C);?>
tabindex="3" />

<input name="TxtRuc" type="text" id="TxtRuc" 
style="left: 848px; top: 177px; width: 88px; ; background-color:#CCC" 
value="<?php echo $StrRuc;?>"  
onkeydown="return SoloEnterosEx(this,event,'CmdSel');"
tabindex="11" readonly="readonly" />

<input name="TxtNum" type="text" id="TxtNum" 
style="left: 509px; top: 177px; width: 63px;" 
value="<?php echo $StrNum;?>"  onblur="_N(this);"
<?php echo _D_($M_S && $M_C);?>   maxlength="6"
onkeydown="return SoloEnterosEx(this,event,'CmdSel');" 
tabindex="7" />

<div class="s1" style="left: 33px; top: 118px; width: 186px; height: 25px;">
<input name="Ch_PRI" type="checkbox" 
id="Ch_PRI" tabindex="1"  <?php echo _D_($M_S && $M_C);?>
value="1"
<?php
if($Str_PRI==1){
echo "checked=\"checked\"";
}
?>
/> 
DOCUMENTO PRINCIPAL
</div>

<?php
if(strlen($ERROR_MSG)>0){
	echo '<div class="s1" style="position:absolute; left: 256px; top: 116px; width:450px; background-color:#F30; padding:0.2rem 0.2rem 0.2rem 0.2rem">'.$ERROR_MSG.'</div>';
}
?>


<div class="s1" style="position:absolute; left:32px; top: 158px; width: 106px; ">EMPRESA</div>
<select name="CboEmp" id="CboEmp" 
style="position:absolute; left:32px; top:177px; width:100px;" 
onchange="EM_OC();"
onkeydown="return SoloTextoEx(event,'CboAlm');" 
tabindex="1" <?php echo _D_($M_S && $M_C);?>>
<?php 
	//if($PRO_ID_ALM==0){
		echo LE($StrEmp,"N","N");
	//}else{
	//	echo "<option value=\"$StrEmp\" selected>$StrEmp</option>";
	//}
?>
</select>


<div class="s1" style="position:absolute; left: 144px; top: 158px; width: 106px;">
PUNTO EMISION</div>
<select name="CboAlm" id="CboAlm" 
style="left: 144px; top: 177px; width:100px;" 
onkeydown="return SoloTextoEx(event,'TxtFec');" 
tabindex="2" <?php echo _D_($M_S && $M_C);?>  >
<?php
	//if($PRO_ID_ALM==0){
		echo LA($StrEmp,$StrAlm,"N","N"); 
	//}else{
	//	echo "<option value=\"$StrAlm\" selected>$StrAlm</option>";
	//}		
?>
</select>


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

<div class="s1" style="left: 340px; top: 158px; width: 109px;">COMPROBANTE</div>

<select name="CboCom" id="CboCom"
style="left: 339px; top: 177px; width: 105px;" 
<?php echo _D_($M_S && $M_C);?>
onkeydown="return SoloTextoEx2(event,'TxtSer','CmdSel');" tabindex="4">
<option value="PROFORMA">PROFORMA</option>
</select>
<div class="s1" style="left: 511px; top: 158px; width: 64px;">NUMERO</div>


<div class="s1" style="left: 637px; top: 157px; width: 90px;">CLIENTE</div>

<input type="text" name="TxtCliente" id="TxtCliente" 
value="<?php echo $StrCliente;?>" 
style="left: 635px; top: 177px; width: 206px; background-color:#CCC" readonly="readonly" 
onkeydown="return SoloTextoEx(event,'TxtRuc');"  tabindex="10"
/>
<div class="s1" style="left: 850px; top: 158px; width: 153px;">RUC / DNI</div>

<div class="EL" style="left: 33px; top: 292px; width: 84px;"><u><a onclick="fLimDet()">CODIGO +</a></u></div>
<input name="TxtCod" type="text" id="TxtCod" 
style="left: 33px; top: 314px; width: 99px;" 
value="<?php echo $StrCod;?>"  
onkeydown="return SoloTextoEx(event,'TxtDes');"
onkeyup="document.getElementById('TxtHora').value=GetHora();" 
<?php echo _D_($M_S);?>
tabindex="17" />

<div class="s1" style="left: 148px; top: 292px; width: 192px;">DESCRIPCION</div>
<input name="TxtDes" type="text" id="TxtDes" style="left: 145px; top: 314px; width: 329px;" 
value="<?php echo $StrDes;?>"  
onkeydown="return SoloTextoEx(event,'TxtMarca');"
onkeyup="document.getElementById('TxtHora').value=GetHora();"
<?php echo _D_($M_S);?>
tabindex="18" />

<div class="s1" style="left: 559px; top: 292px; width: 45px;">PRECIO</div>
<input name="TxtPre" type="text" id="TxtPre" 
class="ps" style="left: 560px; top: 314px; width: 57px; text-align:right" 
value="<?php echo $StrPre;?>"  
onkeydown="return SoloNum(this,event,'TxtCant');" 
onkeyup="fImporte();"
onfocus="selecciona_value(this);"
<?php echo _D_($M_S);?>
tabindex="20" />

<div  class="s1" style="left: 635px; top: 292px; width: 41px;">CANT</div>
<input name="TxtCant" type="text" id="TxtCant" 
class="ps" style="left: 626px; top: 314px; width: 48px; text-align:right" 
value="<?php echo $StrCant;?>"  
onkeydown="return SoloNum(this,event,'TxtCUni');" 
onkeyup="fImporte();"
onfocus="selecciona_value(this);" 
<?php echo _D_($M_S);?>             
tabindex="22" />

<div class="s1" style="position:absolute; left: 685px; top: 292px; width: 41px;">PIEZAS</div>
<input name="TxtCUni" type="text" id="TxtCUni" 
class="ps" style="left: 681px; top: 314px; width: 52px; text-align:right" 
value="<?php echo $StrCUni;?>"  
onkeydown="return SoloNum(this,event,'CmdAdd');" 
onkeyup="fImporte();"
onfocus="selecciona_value(this);" 
<?php echo _D_($M_S);?>               
tabindex="23" />

<div class="s1" style="left: 742px; top: 292px; width: 46px;">IMPORTE</div>
<input name="TxtImp" type="text" id="TxtImp" 
class="ps" style="left: 741px; top: 314px; width: 76px; background-color:#CCC; text-align:right" 
value="<?php echo $StrImp;?>"  
onkeydown="return SoloNum(this,event,'CmdAdd');" 
tabindex="24" readonly="readonly" />

<input type="button" name="CmdAdd" 
class="ps" style="left: 826px; top: 315px; width: 30px;"
<?php echo _D_($M_S);?>
id="CmdAdd" value="+" onclick="fAgregar();" tabindex="25"/>


<div class="s1" style="left:860px; top: 273px; width: 155px;"><b>AUTORIZAR</b></div>
<div class="s1" style="left:860px; top: 292px; width: 71px;">USUARIO</div>
<input name="TxtUsu" type="text" id="TxtUsu" 
style=" position:absolute; left: 860px; top: 314px; width: 68px;"
tabindex="19" onkeydown="return SoloTextoEx(event,'TxtAut');" 
value="" maxlength="15"
<?php echo _D_($M_S);?>/>

<div class="s1" style="left:934px; top: 292px; width: 71px;">PASSWORD</div>
<input name="TxtAut" type="password" id="TxtAut" 
style=" position:absolute; left: 934px; top: 314px; width: 68px;"
tabindex="19" onkeydown="return SoloTextoEx(event,'CmdAdd');" 
value="" maxlength="15"
<?php echo _D_($M_S);?>/>



<div class="s1" style="left: 582px; top: 159px; width: 49px;">T. C</div>

<input name="TxtTC" type="text" id="TxtTC" 
style="left: 582px; top: 177px; width: 43px; background-color:#CCC; text-align:right" 
value="<?php echo $StrTC;?>"  أ¯طںآ½
onkeydown="return SoloEnterosEx(this,event,'TxtCliente');" 
tabindex="9" readonly="readonly" />

<div id="TAB_AJAX" 
style="visibility: hidden; height:308px; width:1400px; overflow-x:hidden; position:absolute; left: 33px; top: 364px; 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:1300px; position:absolute; left: 35px; top: 345px; color: #0FF; background-color: #CCCCCC; layer-background-color: #CCCCCC; border: 1px none #000000;" align="left">
<?php
$T=110+300+80+180+(gn("count(*)","almacenes","id_almacen>0")*60)+120;
?>
<table  style="width:<?php echo $T;?>px" border="1" cellpadding="0" cellspacing="0" bgcolor="#d4e3e5" class="estilo888">
<tr  height="10px">
<td style="width:110px" bgcolor="#CCCCCC">CODIGO</td>
<td style="width:300px" bgcolor="#CCCCCC">DESCRIPCION</td>
<td style="width:80px" bgcolor="#CCCCCC">LINEA</td>
<td style="width:60px" align="right" bgcolor="#CCCCCC">PV MIN</td>
<td style="width:60px" align="right" bgcolor="#CCCCCC">PV MAX</td>
<td style="width:60px" align="right" bgcolor="#CCCCCC">STOCK</td>
<?php
$s="";
$z="SELECT alm_obs FROM almacenes ".
   "WHERE id_almacen>0 ORDER BY alm_obs";
$result = grs($z);
while ($roww = $result->fetch_row()){		 
	$s=$s."<td  align=\"right\" style=\"width:60px\" bgcolor=\"#CCCCCC\">$roww[0]</td>";
}
echo $s;
?>
<td style="width:60px" align="right" bgcolor="#CCCCCC">SEP.</td>
<td style="width:60px" align="right" bgcolor="#CCCCCC">E.T.</td>
</tr>
</table>
<div style="position:absolute; top:0px; left:60px">
<input name="CmdClose" type="button" value="Cerrar" 
onclick="CerrarDIV();" style="background-color:#F90" /></div>
</div>

<div class="s1"style="position:absolute; left: 944px; top: 177px; width: 65px; height: 25px;">
<input type="button" name="CmdSel" id="CmdSel" value="..." 
onClick="Ow('ventas_clientes_buscar.php?W=P',800*ZO(),600*ZO())" 
style="width:30px" tabindex="12" >

<input type="button" name="CmdCls" id="CmdCls"  style="width:30px"
value="X" 
onclick="fCls();" tabindex="13"
/>
</div>


<div class="s1" style="left: 454px; top: 159px; width: 47px;">SERIE</div>

<input name="TxtSer" type="text" id="TxtSer" 
style="left: 454px; top: 177px; width: 47px;" 
tabindex="6"  onblur="_S(this);"
onkeydown="return SoloEnterosEx(this,event,'TxtNum');" 
value="<?php echo $StrSer;?>" maxlength="4"
<?php echo _D_($M_S && $M_C);?> />
<div class="s1" style="left: 452px; top: 135px; width: 145px; height: 25px;">

<input name="ChN_AUTO" type="checkbox" 
id="ChN_AUTO" tabindex="5"   
<?php echo _D_($M_S && $M_C);?>
onclick="AutoNumeracion(document.getElementById('ChN_AUTO').checked);" value="1"
<?php
if($StrN_AUTO=="1"){
echo "checked=\"checked\"";
}
?>
/>
NUM. AUTOMATICA
</div>


<div class="s1" style="left: 33px; top:205px; width: 189px;">CONTACTO</div>

<input name="TxtCon" type="text" id="TxtCon" 
class="ps" style="left: 33px; top: 225px; width: 221px;" 
value="<?php echo $StrContacto;?>"  
onkeydown="return SoloTextoEx(event,'CboVen');" 
tabindex="14" />


<div class="s1"  style="left: 272px; top:205px; width: 103px;">VENDEDOR</div>
<select name="CboVen" id="CboVen" 
style="position:absolute; left: 269px; top: 225px; width: 183px;"
onkeydown="return SoloTextoEx(event,'TxtCod');" tabindex="15" >
<?php
echo FCBO_("NOMBRE","vpersonal","ID>0 AND CARGO='VENDEDOR'",$StrVen,"N","S");
?>
</select>


<div class="s1" style="left: 462px; top:205px; width: 161px;">
DOC. DE REFERENCIA
</div>

<select name="CboDocR" id="CboDocR" 
style="left: 459px; top: 225px; width: 167px;" 
onkeydown="return SoloTextoEx(event,'CboEmpR');" tabindex="16" <?php echo _D_($M_S && $M_C);?>>
<?php
if(strlen($STR_DR)==0){
	echo FCBO_("au_item","auxiliar",
			   "au_tab='VEN_REF' AND au_item='CONTENEDOR'",$StrDocR,"N","S");
}else{
	echo FCBO_("au_item","auxiliar",
			   "au_tab='VEN_REF' AND au_item='CONTENEDOR'",$StrDocR,"N","N");
}
?>
</select>

<div class="s1" style="left:639px; top:205px; width: 100px;">
EMPRESA
</div>

<select name="CboEmpR" id="CboEmpR" 
style="position:absolute; left:635px; top:225px; width: 102px;" 
onkeydown="return SoloTextoEx(event,'TxtNumR');" tabindex="1" 
<?php echo _D_($M_S && $M_C);?>
>  
<?php 
	if(strlen($STR_DR)>0){
		echo "<option value=\"$StrEmpR\">$StrEmpR</option> ";
	}else{
		echo FCBO_("emp_nomc","empresas","id_emp>0",$StrEmpR,"N","S");
	}
?>
</select>

<div class="s1" style="left: 748px; top:205px; width: 100px;">
SERIE - NUMERO
</div>

<input name="TxtNumR" type="text" id="TxtNumR" 
style="left: 748px; top: 225px; width: 102px;"  
<?php echo _D_($M_S && $M_C);?> value="<?php echo $StrNumR;?>"  
<?php
	if(strlen($STR_DR)==0){
		echo " ";		
	}else{
		echo " readonly=\"readonly\"  ";		
	}
?>
onkeydown="return SoloTextoEx(event,'CmdLoad');" 
tabindex="17" />

<input type="button" name="CmdLoad" id="CmdLoad" 
style="position:absolute; left: 860px; top: 225px; width: 150px;" 
<?php
	if(strlen($STR_DR)==0){
		echo " value=\"Cargar\"  ";		
	}else{
		echo " value=\"Deshacer referencia\"  ";		
	}
?>
onclick="fCargar();" <?php echo _D_($M_S && $M_C);?> tabindex="20"/>



<div class="s1" style="left:31px; top: 259px; width: 214px; height: 25px;">
<input name="ChN_INC" tabindex="16" type="checkbox" 
id="ChN_INC" value="1"   <?php echo _D_($M_S && $M_C);?>
<?php
if($StrN_INC=="1"){
echo "checked=\"checked\"";
}
?>
/>
EL PRECIO NO INCLUYE IGV</div>

<input type="button" name="CmdSel" id="CmdSel" value="Trasformaciones" 
onClick="Ow('transformaciones_2.php',905*ZO(),390*ZO());" tabindex="15"
style="position:absolute; left: 257px; top: 260px; width: 126px;" 
<?php echo _D_($M_S && $M_C);?> />

<div class="s1" style="position:absolute; left: 437px; top: 260px; width: 167px; background-color: #FFCC00; layer-background-color: #FFCC00; border: 1px none #000000; height: 17px;">
<div align="center">
<a target="_blank" href="ventas.php">IR A FACTURACION</a>
</div>
</div>


<div id="layer44" style="position:absolute; left: 307px; top: 292px; width: 83px;">
  <div align="left" class="sFA">PRECIO MIN :</div>
</div>
<div id="layer45" style="position:absolute; left: 393px; top: 292px; width: 77px;">
<div id="TxtPreM" align="right" class="sFA">0.00</div>
</div>
<script>
function fSelEditX(){
	var IdCli=document.getElementById("TxtIdCliente").value;
	//OpenWin("clientes.php?Id="+IdCli,900,600);	
	window.open("sis_clientes.php?Id="+IdCli);  
}
</script>
<div class="s1" style="position:absolute; left: 728px; top: 157px; width: 112px; background-color: #FFCC00; layer-background-color: #FFCC00; border: 1px none #000000; height: 17px;">
<div align="center"> <a target="_blank" class="Estilo5" onclick="fSelEditX()"><u>EDITAR CLIENTE</u></a> </div>
</div>

<div class="s1" style="left: 726px; top: 130px; width: 122px; background-color: #FFCC00; layer-background-color: #FFCC00; border: 1px none #000000; height: 17px;">
<center>
<a target="_blank" href="sis_clientes.php">NUEVO CLIENTE</a>
</center>
</div>

<div class="s1" style="left: 485px; top: 293px; width: 61px;">LINEA</div>
<input name="TxtMarca" type="text" id="TxtMarca" 
style="left: 484px; top: 314px; width: 69px;" 
value="<?php echo $StrMARCA;?>"  
onkeydown="return SoloTextoEx(event,'TxtPre');"
onkeyup="document.getElementById('TxtHora').value=GetHora();"
<?php echo _D_($M_S);?>
tabindex="19" />

<div class="s1" style="position:absolute; left: 859px; top: 118px; width: 168px; background-color: #FFCC00; layer-background-color: #FFCC00; border: 1px none #000000; height: 17px;">
<center>
<a target="_blank" href="coti_con.php">DATOS DE COTIZACION</a>
</center>
</div>

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

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