<script>
function eliminar_linea(codfacturatmp,numlinea,importe)
{
	if (confirm(" Desea eliminar esta linea ? "))

	
		document.getElementById("frame_datos").src="eliminar_linea.php?codfacturatmp="+codfacturatmp+"&numlinea=" + numlinea;
}

function pon_prefijo(filas,preciotot) {
	parent.document.formulario_lineas.filas.value=filas;
	parent.document.formulario_lineas.preciotot.value=preciotot;
    
}

function nobackbutton(){	
   window.location.hash="no-back-button";	
   window.location.hash="Again-No-back-button" //chrome	
   window.onhashchange=function(){window.location.hash="no-back-button";}	
}

</script>

<html>
<link href="../estilos/estilos.css" type="text/css" rel="stylesheet">
<body onLoad="nobackbutton();">
<?php 
include ("../conectar.php");
 $codfactura=$_POST["numfac"];
?>
<div id="xdetalleAW">
  <iframe id="frame_datos" name="frame_datos" width="0%" height="0" frameborder="0">
  <ilayer width="0" height="0" id="frame_datos" name="frame_datos"></ilayer>
  </iframe>
  <table class="fuente8" width="100%" cellspacing=0 cellpadding=0 border=0 ID="Table1">
<?php
$sel_lineas="SELECT pedidos_lineas.*,web_1001.* FROM pedidos_lineas,web_1001 WHERE pedidos_lineas.codfactura='$codfactura' AND pedidos_lineas.codigo=web_1001.cdgbar ORDER BY pedidos_lineas.numlinea ASC";
$rs_lineas=mysql_query($sel_lineas);
for ($i = 0; $i < mysql_num_rows($rs_lineas); $i++) {
	$numlinea=mysql_result($rs_lineas,$i,"numlinea");
	//$codfamilia=mysql_result($rs_lineas,$i,"codfamilia");
	//$nombrefamilia=mysql_result($rs_lineas,$i,"nombrefamilia");
	//$referencia=mysql_result($rs_lineas,$i,"referencia");
	$cdgbar=mysql_result($rs_lineas,$i,"cdgbar");
	$dscart=mysql_result($rs_lineas,$i,"dscart");
	$cantidad=mysql_result($rs_lineas,$i,"cantidad");
	$preivi=mysql_result($rs_lineas,$i,"preivi");
	$importe=mysql_result($rs_lineas,$i,"importe");
	$impuesto=mysql_result($rs_lineas,$i,"impuesto");
	$mondes=mysql_result($rs_lineas,$i,"mondes");
	$baseimp=$importe+$baseimp;
	$baseiva=$impuesto+$baseiva;
	$basedescuento=$basedescuento+$mondes;
	$descuento=mysql_result($rs_lineas,$i,"dcto");
	if ($i % 2) { $fondolinea="itemParTabla"; } else { $fondolinea="itemImparTabla"; } ?>
			<tr class="<? echo $fondolinea?>">
				<td width="14%"><? echo $cdgbar?></td>
				<td width="43%"><? echo $dscart?></td>
				<td width="7%" class=""><div align="right"><? echo $cantidad?></div></td>
				<td width="9%"><div align="right"><? echo number_format($preivi,2,".",",")?></div></td>
				<td width="11%" class=""><div align="right"><? echo number_format($descuento,2,".",",")?></td>
				<td width="9%"><div align="right"><? echo number_format($importe,2,".",",")?></div></td>
			</tr>
					
					

			
<? 

$preciotot=$baseimp+$baseiva-$basedescuento;
$preciotot=round($preciotot);


}


?>



</table>
<blockquote>&nbsp;	</blockquote>
</div>

<div id="ztotalesaw" align="right">
			<table width="98%" border=0 align="right" cellpadding=0 cellspacing=0 class="fuente8">
			  <tr>
			    <td width="65%" class="busqueda"><b>Sub-total</b></td>
				<td width="35%" align="right"><div align="right"><? echo $simbolomoneda ?>
			      <input class="cajaTotales" name="baseimponible" type="text" id="baseimponible" size="12" value="<? echo number_format($baseimp,2,",",".");?>" align="right" readonly> 
		        </div></td>																					 
	

			  </tr>
			  <tr>
			    <td class="busqueda"><b>Descuento</b></td>
			    <td align="right"><div align="right"><? echo $simbolomoneda ?>
			      <input class="cajaTotales" name="basedescuento2" type="text" id="basedescuento2" size="12" value="<? echo number_format($basedescuento,2,",",".");?>" align="right" readonly>
		        </div></td>
		      </tr>
			  <tr>
				<td class="busqueda"><b>IVA</b></td>
				<td align="right"><div align="right"><? echo $simbolomoneda ?>
			      <input class="cajaTotales" name="baseimpuestos" type="text" id="baseimpuestos" size="12" align="right" value="<? echo number_format($baseiva,2,",",".");?>" readonly> 
		        </div></td>
			  </tr>
			  <tr>
				<td class="busqueda"><b>Precio Total</b></td>
			
				<td align="right"><div align="right"><? echo $simbolomoneda ?>
			      <input class="cajaTotales" name="preciototal" type="text" id="preciototal" size="12" align="right" value="<? echo number_format($preciotot,2,",",".");?>" readonly> 
							  

		        </div></td>
			  </tr>
			</table>
			
</div>

	</body>
</html>