<?php
include("cls_conexion.php");$CNN=new ClsMySQL();include("conexion23.php");
?>
<html>
<head>
<style type="text/css">
.EX {font-family: "Courier New";color: #000;font-size:14px;position:absolute; height:0.4cm}
.EX2 {font-family: "Courier New";color: #000;font-size:10px;position:absolute; height:0.4cm}
</style>
</head>
<body   >
<div id="HOJA" onDblClick="print();" style="position:absolute; top:0cm; left:0cm; width:24.686cm; height:30cm"  >
<?php
$_TIENDA=0;
$bx=0;
$by=0;
$Id=V($_GET['TxtId']);
$_TIENDA=gn("id_alm","ventas","id_venta=$Id"); //2=LOR 1=NIC
if(strlen($Id)==0) $Id="0";
if(!is_numeric($Id))$Id="0";
//
$w="ID=$Id";
$StrSerNum=gs("CONCAT(SER,'-',NUM)","vventas",$w);
$StrDoc=gs("COM","vventas",$w);
$StrTdp=gs("TDP","vventas",$w);
$StrGuia=gs("VEN_COM_REF","vventas",$w);
$StrFec=gs("DATE_FORMAT(FEC,'%d-%m-%y')","vventas",$w);
$StrDia=gs("DATE_FORMAT(FEC,'%d')","vventas",$w);
$StrMes=gs("DATE_FORMAT(FEC,'%m')","vventas",$w);
$StrAni=gs("DATE_FORMAT(FEC,'%y')","vventas",$w);
$StrCli=gs("CLI","vventas",$w);
$StrRuc=gs("RUC","vventas",$w);
$StrDir=gs("DIR","vventas",$w);
$StrTot=number_format(gn("TOT","vventas",$w),2,'.','');
$StrIgv=number_format(gn("IGV","vventas",$w),2,'.','');
$StrImp=number_format(gn("ST","vventas",$w),2,'.','');
$StrN2L=n2l($StrTot);
//
xy($bx+20.00,$by+03.60,$StrDia,10,0);	
xy($bx+22.00,$by+03.60,$StrMes,10,0);	
xy($bx+24.00,$by+03.60,$StrAni,10,0);
//	
xy($bx+05.50,$by+04.90,$StrCli,10,0);
xy($bx+05.50,$by+05.70,$StrDir,13,0);
xy($bx+20.50,$by+05.70,$StrRuc,10,0);
//
$byy=$by+07.30;$ss=00.60;
$s="SELECT CO,DE,CA,PR,IM,UNI FROM vventas_d WHERE ID=$Id ORDER BY CX";
$result = grs($s);				
while ($row = $result->fetch_row()){
	$StrCod=$row[0]."x".$row[5];
	xy($bx+03.70,$byy,$row[2],1.5,1);
	xy($bx+04.50,$byy,$StrCod." / ".vbmid($row[1],1,50),10,0);
	xy($bx+20.50,$byy,number_format($row[3],2,'.',''),1.5,1);
	xy($bx+24.00,$byy,number_format($row[4],2,'.',''),2,1);
	$byy=$byy+$ss;
}
xy(24.00,18.20,$StrTot,1.5,1);
?>
</div>
</body>
</html>