Bueno, yo para calcular las columnas DEBE,HABER y SALDO hago lo siguiente:
Código Delphi
[-]
if QCaja.FieldByName('movimiento').AsString='EGRESO'
then begin
if dxCheckbox2.Checked=True
then begin
QCajaDebe.Value:=QCaja.FieldByName('importe').AsCurrency/dolar;
QCajaHaber.Value:=0;
QCajaSaldo.Value:=QCajaHaber.Value-QCajaDebe.Value;
end
else begin
QCajaDebe.Value:=QCaja.FieldByName('importe').AsCurrency;
QCajaHaber.Value:=0;
QCajaSaldo.Value:=QCajaHaber.Value-QCajaDebe.Value;
end;
end
else begin
if dxCheckbox2.Checked=True
then begin
QCajaHaber.Value:=QCaja.FieldByName('importe').AsCurrency/dolar;
QCajaDebe.Value:=0;
QCajaSaldo.Value:=QCajaHaber.Value-QCajaDebe.Value;
end
else begin
QCajaHaber.Value:=QCaja.FieldByName('importe').AsCurrency;
QCajaDebe.Value:=0;
QCajaSaldo.Value:=QCajaHaber.Value-QCajaDebe.Value;
end;
end;
Lastima que no se como hacer el ARRASTRE de saldo anterior. No se me ocurre la forma.
__________________
Código Delphi
[-]
try
ProgramarMicro(80C52,'Intel',MnHex,True);
except
On Exception do
MicroChip.IsPresent(True);
end;