<?
session_start();
if ($_SESSION['estado'] != "ON")
		{
		?>
		<script>
			parent.location.href = 'index.php';
		</script>
		<? 
		exit();
		}
$id_empresa = $_SESSION['ss_empresa'];
$id_user = $_SESSION['ss_user'];

include("../conex.php");


// cabeza 
       $sql_in = "SELECT sum(sub_total) as net, salida.id FROM pasofactura1, salida, movimiento WHERE salida.id=id_soe AND num=num_dcto group by num";	
		
		$res_in = mysql_query($sql_in,$enlace);	
		$row=0;
		while (mysql_fetch_object ($res_in))
          {
		  $neto=mysql_result($res_in, $row, "net");
		$id_soe=mysql_result($res_in, $row, "salida.id");
	
	        $iva=round($neto*.19);
		    $total=$neto+$iva;
			
	$up_dcto = "UPDATE salida SET neto = $neto, iva=$iva, total=$total WHERE id = $id_soe";
	$res_up_dcto = mysql_query($up_dcto,$enlace);	
		 	  
		  $row+=1;
	  }





	
		?>
<script>
	alert("Traspaso realizado con exito");
	window.top.open('','_parent','');window.top.close();
</script>
		
	
	
