<?php
include("cls_conexion.php");$CNN=new ClsMySQL();include("conexion23.php");
return;
$s="SELECT * FROM ventas ORDER BY fec DESC ";
$rs = grs($s);		
while ($r = $rs->fetch_assoc()){
	$VEN_KOD=$r['id_venta'];
	$SUM=gn("SUM(im)","ventas_det","id_venta=$VEN_KOD");
	//
	$X_UNO=$SUM / 118;
	$X_IG=round($X_UNO * 18,2);
	$X_ST=$SUM - $X_IG;
	$X_TO=$X_ST + $X_IG;
	$s="UPDATE ventas SET st=$X_ST,igv=$X_IG,tot=$X_TO WHERE id_venta=$VEN_KOD";
	ejt($s);
	echo $s."<br>";
}
?>