![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#5
|
|||
|
|||
|
buen dia ya encontre la solucion que fue esta
Código:
var
C,A,res,x, Valor:REAL;
flg : boolean;
begin
a:=StrToFloat(cantidad);
flg := False;
ADOQuery1.First;
While not adoquery1.eof do
begin
b:=StrToFloat(ADOQUERY1.FieldByName('pendiente').Value);
if (a > b) then
Valor := 0
else
if a>0 then
begin
Valor := b-a;
flg := True;
end;
a := a-b;
ABONO.Close;
ABONO.SQL.Clear;
ABONO.SQL.Add('UPDATE FACTURA SET PENDIENTE=:VALOR WHERE NUMVENTA=:NUMVENTA');
ABONO.Parameters.ParamByName('NUMVENTA').Value:=ADOQuery1.Fields.FieldByNumber(1).Value;
ABONO.Parameters.ParamByName('valor').Value:=valor;
ABONO.ExecSQL;
if Not flg then
adoquery1.next
else
break;
end;
end;
clubdelphi.com/foros/showthread.php?t=74911 muchas gracias por su ayuda espero no romper alguna regla del foro. |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Como descontar cantidad de stock en tabla de Articulos. | ilchicho | Firebird e Interbase | 28 | 18-04-2012 18:05:42 |
| descontar mercancia de una tabla a otra | elsamurai | Conexión con bases de datos | 11 | 15-12-2010 04:21:44 |
| Descontar pedazos de un todo | Caral | Varios | 27 | 08-04-2008 17:26:55 |
| Ayuda con sql para descontar articulo. | Petolansa | Varios | 15 | 16-11-2007 00:04:27 |
| Obtención de Saldo | maestri | Firebird e Interbase | 1 | 26-03-2007 21:37:34 |
|