<?php
include_once '../php/config.php';
$id = $_POST["id_pago"];
$id_venta = $_POST["id_venta"];
$sql_ = mysql_query("select * from pagos_credito where id='$id'") or die (mysql_error());
$monto = @mysql_result($sql_,0,"monto");
         
		mysql_query("update ventas set balance = balance + '$monto' where id_venta='$id_venta'") or die(mysql_error());
		 mysql_query("delete from pagos_credito where id='$id'") or die(mysql_error());
		

			echo 1;
?>