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)+')', '+QuotedStr(DBMemo1.Text)+')';
Qfacturacion.Parameters.ParamByName('FechaFactura').Value:= DateToStr(DateTimePicker1.Date);
Qfacturacion.ExecSQL;
end;