with Qtemp do
begin
Close;
SQL.Clear;
SQL.Text := 'INSERT INTO Factura (CodFactura, fecha, CodCliente, Nombre, Terminos, CodVendedor, PorcDescuento, TasaImpuesto, ' +
'Subtotal, Descuento, Impuesto, Total, MntContado, MntTarjeta, MntCheque, MntOtro, Pagado, Saldo) ' +
'Values (:CodFactura, :Fecha, :codCliente, :NombreCliente, :Tipo, :Vendedor, :PorcDescuento, :Impuesto, :SubTotal, escuento, '+
':Impuesto, :Total, :Contado, :tarjeta, :Cheque, :Otro, :Pagado, :Saldo)';
Parameters.ParamByName('CodFactura').Value := CODFact;
Parameters.ParamByName('Fecha').Value := lfecha.Caption;
Parameters.ParamByName('CodCliente').Value := Ecodigo.Text;
Parameters.ParamByName('NombreCliente').Value := lnombrecliente.Caption;
Parameters.ParamByName('Tipo').Value := CBtipo.Text;
Parameters.ParamByName('Vendedor').Value := Lvendedor.Caption;
Parameters.ParamByName('PorcDescuento').Value := FLEPorcDesc.Text;
Parameters.ParamByName('Impuesto').Value := 18;
Parameters.ParamByName('SubTotal').Value :=Subtotal;
Parameters.ParamByName('Descuento').Value := Descuent;
Parameters.ParamByName('Impuesto').Value := Impuesto;
Parameters.ParamByName('Total').Value := Total;
Parameters.ParamByName('Contado').Value := Mntcontado;
Parameters.ParamByName('Tarjeta').Value := Mnttarjeta;
Parameters.ParamByName('Cheque').Value := MntCheque;
Parameters.ParamByName('Otro').Value := Mntotro;
Parameters.ParamByName('Pagado').Value := MntPagado;
Parameters.ParamByName('Saldo').Value := Mntsaldo;
ExecSQL;
end;