Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Conexión con bases de datos
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Conexión con bases de datos

 
 
Herramientas Buscar en Tema Desplegado
  #9  
Antiguo 02-09-2008
Yensis22 Yensis22 is offline
Miembro
 
Registrado: feb 2008
Posts: 78
Poder: 19
Yensis22 Va por buen camino
Question Ok Por las sugerencias

Ok Por las sugerencias..

Cita:
Ese error me lo manda cuando lo ejecuto y le doy clic en el botón cálculo pero no me marca ninguna línea. Aquí de bajo esta la imagen del from de factura y el código del proyecto completo. Por si lo quiere chequear.
Código Delphi [-]
procedure TFFacturacion.BitBtn1Click(Sender: TObject);
var

a,b,c,d,e,f,g,h :real;

begin
 a:= StrTofloat(Editcantidad.Text);
 b:= StrTofloat(EMonto.Text);
 d:= StrTofloat(EDesc.Text);
 f:= StrTofloat(EImp.Text);
 c:= a * b;
 e:= c * d / 100;
 g:= (c - e) * f / 100;
 h:= c - e + g;
 ESTotal.Text:= floatToStr(c);
 EDescuento.Text:=floatToStr(e);
 EImpuesto.Text:=floatToStr(g);
 ETotal.Text:= floatToStr(Round(h));
 Qfacturacion.SQL.Text := 'Insert into Facturacion Values ('+QuotedStr(ECodFactura.Text)+', '+
 QuotedStr(EdiCliente.Text)+ ', '+ LabDireccion.Caption+ ' :FechaFactura, '+QuotedStr(Editequipo.Text)+ ', '+
 QuotedStr(EditRNC.Text)+ ', '+QuotedStr(DBComboBox2.Text)+', '+QuotedStr(EMonto.Text)+', '+
 QuotedStr(Editcantidad.Text)+', '+QuotedStr(ETotal.Text)+', '+QuotedStr(EImp.Text)+', '+
 QuotedStr(EDesc.Text)+', '+QuotedStr(DBComboBox3.Text)+ ', '+QuotedStr(ESTotal.Text)+ ', '+
 QuotedStr(EDescuento.Text)+', '+QuotedStr(EImpuesto.Text)+')';
 Qfacturacion.Parameters.ParamByName('FechaFactura').Value:= DateToStr(DateTimePicker1.Date);
 Qfacturacion.ExecSQL;

end;


Imagen http://www.4shared.com/file/61462793...cturacion.html

Código fuente http://www.4shared.com/file/61464202...5/sistema.html

Cita:
Por otra parte de este mismo from de factura yo tengo un botón busca, que lo que yo quiero que el me realice es que cunado yo lo llame me traiga otro from eso el me lo hace bien, pero que cuando yo le de le de clic a un cliente este me lo inserte en el edit de cliente de la factura esto lo que no me esta haciendo este es el código que tengo es este botón esta variable Nom_Cliente esta de clarada como publica Nom_Cliente: string; en el otro from que se llama FRegistroclient.


Código Delphi [-]
 
FRegistroclient:=TFRegistroclient.Create(self);
   try
    FRegistroclient.ShowModal;
   finally
   If FRegistroclient.Nom_Cliente <> '' then
   EdiCliente.Text := FRegistroclient.Nom_Cliente;
   LabDireccion.Caption:= QuotedStr(FRegistroclient.Direccion);
   FRegistroclient.Free;
   end;

end;




Cita:
Código completo del from
Código Delphi [-]
unit FFactura;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, StdCtrls, Buttons, DBCtrls, Grids, DBGrids, Mask, ExtCtrls,
  ComCtrls, ADODB;
type
  TFFacturacion = class(TForm)
    Label1: TLabel;
    Bevel2: TBevel;
    SpeedButton1: TSpeedButton;
    SpeedButton2: TSpeedButton;
    SpeedButton3: TSpeedButton;
    SpeedButton4: TSpeedButton;
    SpeedButton5: TSpeedButton;
    SpeedButton6: TSpeedButton;
    SpeedButton7: TSpeedButton;
    SpeedButton8: TSpeedButton;
    SpeedButton9: TSpeedButton;
    SpeedButton10: TSpeedButton;
    SpeedButton11: TSpeedButton;
    SpeedButton12: TSpeedButton;
    GroupBox1: TGroupBox;
    Panel2: TPanel;
    Label2: TLabel;
    Label15: TLabel;
    Label11: TLabel;
    Label3: TLabel;
    Label12: TLabel;
    Label13: TLabel;
    Label14: TLabel;
    Label16: TLabel;
    Label17: TLabel;
    Label18: TLabel;
    Label20: TLabel;
    DBText3: TDBText;
    DBComboBox2: TDBComboBox;
    DBComboBox3: TDBComboBox;
    DBGrid1: TDBGrid;
    DBMemo1: TDBMemo;
    GroupBox2: TGroupBox;
    DBNavigator1: TDBNavigator;
    DataSource1: TDataSource;
    DataSource3: TDataSource;
    DateTimePicker1: TDateTimePicker;
    Qfacturacion: TADOQuery;
    ECodFactura: TEdit;
    EdiCliente: TEdit;
    Editequipo: TEdit;
    Editcantidad: TEdit;
    EditRNC: TEdit;
    Panel1: TPanel;
    Label7: TLabel;
    Label8: TLabel;
    Label19: TLabel;
    Button2: TButton;
    EMonto: TEdit;
    EDescuento: TEdit;
    EImpuesto: TEdit;
    ETotal: TEdit;
    Button1: TButton;
    EDesc: TEdit;
    EImp: TEdit;
    ESTotal: TEdit;
    Label26: TLabel;
    Label4: TLabel;
    BSeleccionar: TSpeedButton;
    Label5: TLabel;
    LabDireccion: TLabel;
    BSeleccionarComercial: TSpeedButton;
    ADOQuery1: TADOQuery;
    ADOQuery2: TADOQuery;
    BitBtn1: TBitBtn;
    procedure FormCreate(Sender: TObject);
    procedure BSeleccionarClick(Sender: TObject);
    procedure SpeedButton7Click(Sender: TObject);
    procedure BSeleccionarComercialClick(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    { Private declarations }
  public
    { Public declarations }
  end;
var
  FFacturacion: TFFacturacion;
implementation
uses   FRegiclientes, FRegitequip;
                      
{$R *.dfm}
procedure TFFacturacion.FormCreate(Sender: TObject);
begin
DateTimePicker1.Date:= Now;
Qfacturacion.SQL.Text:='SELECT DISTINCTROW Max([Facturacion].[NumeroFactura])AS [NumeroFactura]FROM Facturacion';
   Qfacturacion.Open;
   ECodFactura.Text:= IntToStr(Qfacturacion.Fields[0].AsInteger+3);
end;
procedure TFFacturacion.BSeleccionarClick(Sender: TObject);
begin
FRegistroclient:=TFRegistroclient.Create(self);
   try
    FRegistroclient.ShowModal;
   finally
   If FRegistroclient.Nom_Cliente <> '' then
   EdiCliente.Text := FRegistroclient.Nom_Cliente;
   LabDireccion.Caption:= QuotedStr(FRegistroclient.Direccion);
   FRegistroclient.Free;
   end;
end;
procedure TFFacturacion.SpeedButton7Click(Sender: TObject);
begin
Close;
end;
procedure TFFacturacion.BSeleccionarComercialClick(Sender: TObject);
begin

 Fregequipos:=TFregequipos.Create(self);
   try
    Fregequipos.ShowModal;
   finally
   If Fregequipos.Dequipo <> '' then
   EdiCliente.Text := Fregequipos.Dequipo;
 //  LabDireccion.Caption:= QuotedStr(Fregequipos.Direccion);
   Fregequipos.Free;

      end;
   end;
procedure TFFacturacion.BitBtn1Click(Sender: TObject);
var
a,b,c,d,e,f,g,h :real;
begin
 a:= StrTofloat(Editcantidad.Text);
 b:= StrTofloat(EMonto.Text);
 d:= StrTofloat(EDesc.Text);
 f:= StrTofloat(EImp.Text);
 c:= a * b;
 e:= c * d / 100;
 g:= (c - e) * f / 100;
 h:= c - e + g;
 ESTotal.Text:= floatToStr(c);
 EDescuento.Text:=floatToStr(e);
 EImpuesto.Text:=floatToStr(g);
 ETotal.Text:= floatToStr(Round(h));
 Qfacturacion.SQL.Text := 'Insert into Facturacion Values ('+QuotedStr(ECodFactura.Text)+', '+
 QuotedStr(EdiCliente.Text)+ ', '+ LabDireccion.Caption+ ' :FechaFactura, '+QuotedStr(Editequipo.Text)+ ', '+
 QuotedStr(EditRNC.Text)+ ', '+QuotedStr(DBComboBox2.Text)+', '+QuotedStr(EMonto.Text)+', '+
 QuotedStr(Editcantidad.Text)+', '+QuotedStr(ETotal.Text)+', '+QuotedStr(EImp.Text)+', '+
 QuotedStr(EDesc.Text)+', '+QuotedStr(DBComboBox3.Text)+ ', '+QuotedStr(ESTotal.Text)+ ', '+
 QuotedStr(EDescuento.Text)+', '+QuotedStr(EImpuesto.Text)+')';
 Qfacturacion.Parameters.ParamByName('FechaFactura').Value:= DateToStr(DateTimePicker1.Date);
 Qfacturacion.ExecSQL;

end;
end.
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
factura josi Varios 0 06-06-2008 15:50:30
Calcular la fecha de vencimiento de una factura jjaen26 SQL 7 10-10-2006 21:33:01
Factura Stravinsky Conexión con bases de datos 5 10-10-2006 17:25:41
Calcular total factura jcheco Varios 1 19-04-2006 17:06:14
Fallo Nº Factura y Linea Factura CarmaZone Tablas planas 5 26-05-2005 11:17:19


La franja horaria es GMT +2. Ahora son las 20:07:07.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi