                                                                                                                                                                                                                        
<html>
<head>
<link href="../estilos/estilos.css" type="text/css" rel="stylesheet">
</head>
<script language="javascript">

function pon_prefijo(vuelto,totalpago,efectivo,depositos,simpes,tarjetas,dolares,vuelto2) {
	parent.document.form_pagos.vuelto.value=vuelto;
	parent.document.form_pagos.pagacon.value=totalpago;
		parent.document.form_pagos.efectivo2.value=efectivo;
			parent.document.form_pagos.dolares2.value=dolares;
				parent.document.form_pagos.depositos2.value=depositos;
					parent.document.form_pagos.simpes2.value=simpes;
						parent.document.form_pagos.tarjetas2.value=tarjetas;
							parent.document.form_pagos.vuelto2.value=vuelto2;
													parent.document.form_pagos.pagacon2.value=totalpago;
												parent.document.getElementById("tarjetas").focus();
}


function limpiar() {


	parent.document.getElementById("numfac").focus();
	parent.document.getElementById("numfac").select();

}

</script>
<? include ("../conectar.php"); ?>
<body>
<?

 $query_parametros="SELECT * FROM web_0000 ";
 $rs_query_parametros=mysql_query($query_parametros);

   $tipcamdol= mysql_result($rs_query_parametros,0,"tipcamdol");
   
	$efectivo=$_GET["efectivo"];
 $efectivo = ereg_replace ("[,]","",$efectivo);
  $efectivo = ereg_replace ("[₡]","",$efectivo);

$dolares=$_GET["dolares"];
 $dolares = ereg_replace ("[,]","",$dolares);
 $dolares = ereg_replace ("[$]","",$dolares);
 
$tarjetas=$_GET["tarjetas"];
 $tarjetas = ereg_replace ("[,]","",$tarjetas);
  $tarjetas = ereg_replace ("[₡]","",$tarjetas);

$depositos=$_GET["depositos"];
 $depositos = ereg_replace ("[,]","",$depositos);
  $depositos = ereg_replace ("[₡]","",$depositos);

$simpes=$_GET["simpes"];
 $simpes = ereg_replace ("[,]","",$simpes);
  $simpes = ereg_replace ("[₡]","",$simpes);

$total=$_GET["total"];
 $total = ereg_replace ("[,]","",$total);



	
    $total_dolar=$dolares*$tipcamdol;
	
	$totalpago=$efectivo+$total_dolar+$depositos+$simpes+$tarjetas;
	
	$vuelto2=$totalpago-$total;
	$vuelto=number_format($vuelto2,2,".",",");
	$totalpago=number_format($totalpago,2,".",",");
		  	 
	
		 ?>
	
		 
		 		<script languaje="javascript">
 pon_prefijo("<? echo $vuelto ?>","<? echo $totalpago ?>","<? echo $efectivo ?>","<? echo $depositos ?>","<? echo $simpes ?>","<? echo $tarjetas ?>","<? echo $dolares ?>","<? echo $vuelto2 ?>");
 		</script>
         
	
	
	 <?

	 ?>
	 		
	
	