<? 
require_once('../conf/connection.php');

$numero =$_GET["numero"];
$des =$_GET["descuento"];
$fecha =$_GET["fecha"];
$hora=date("H:i:s");
$fecha_ft=date('Y-m-d');
//suma total de ventas boletas = "1" y faturas="2" 

  $query_sum="SELECT sum(valor_total) AS total_venta FROM detalles_pedido  WHERE numero='$numero'";
  $res_sum=mysql_query($query_sum); 
  $total=mysql_result($res_sum,0,"total_venta");
  
  $descuento=$total*($des/100);
  $total_final=$total-$descuento;
?>
 

<html>
	<head>
		<title></title>
		<link href="../../estilos/estilos.css" type="text/css" rel="stylesheet">	
		<script>
		
		var cursor;
		if (document.all) {
		// Está utilizando EXPLORER
		cursor='hand';
		} else {
		// Está utilizando MOZILLA/NETSCAPE
		cursor='pointer';
		}
		
		 function imprimir() {
			location.href="../informe.php";	
		 }
		</script>
        <script language="javascript">
function imprimir() {
	window.print();
	window.close();

	
}
</script>
	</head>

	<body onLoad="imprimir()">	
	
    <table width="248" border=0 cellpadding=3 cellspacing=0 >					
					 
					  <tr>
					    <td align="center" >Fernelly EIRL</td>
      </tr>
					  <tr>
					    <td align="center" >Materiales de Construcci&oacute;n</td>
      </tr>
					  <tr>
					    <td align="center" >76.976.937-4</td>
      </tr>
					  <tr>
					    <td align="center" >Belisario Prat 1324 - Traiguen</td>
      </tr>
					 
					  <tr>
					    <td align="center" >* COMPROBANTE DE VENTA *</td>
      </tr>
					
					  
					  <tr>
					    <td >Hora: <? echo $hora ?></td>
      </tr>
					  
					  <tr>
					    <td >Fecha: <? echo $fecha_ft?></td>
      </tr>
					  <tr>
					    <td >Numero de venta: <? echo $numero ?> </td>
      </tr>
					  
					  
                      </table>
    <tr>
      <td><table width="248">
        <tr>
          <td width="44" height="4">&nbsp;</td>
          <td width="124" height="4" align="right">Subtotal: </td>
          <td width="64" height="4" align="right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<? echo $total ?></td>
        </tr>
        <? if($des==0){}
					else{ ?>
        <tr>
          <td height="4">&nbsp;</td>
          <td height="4" align="right">Descuento(<? echo $des ?>%): </td>
          <td height="4" align="right">&nbsp;&nbsp;&nbsp;&nbsp;<? echo $descuento ?></td>
        </tr>
        <? } ?>
        <tr>
          <td height="4">&nbsp;</td>
          <td height="4" align="right">Total:</td>
          <td height="4" align="right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<? echo $total_final ?></td>
        </tr>
        <tr>
          <td height="1" colspan="3" align="center">&nbsp;</td>
        </tr>
        <tr>
          <td height="1" colspan="3" align="center"> Gracias por su compra </td>
        </tr>
        <tr>
          <td height="10" colspan="3" align="center"> * +56964061428*</td>
        </tr>
</table>      