procedure TFfactura.btn3Click(Sender: TObject);
begin
if wfactura_a_imprimir<>0 then
begin
Application.CreateForm(TFticket, Fticket);
Fticket.Dataset:= Qry_ticket;
with Fticket.Qry_ticket do
begin
sql.Clear;
SQL.Text:= 'select * from facturaItem where nofac = :Tfactura';
Parameters.ParamByName('Tfactura').Value:=wfactura_a_imprimir;
Open;
try
if not Fticket.Qry_ticket.IsEmpty then
begin
Fticket.txtcantidad.Caption:= FieldByname('cantidad').Value;
Fticket.Preview;
finally
Fticket.Free;
end;
except
on E:EOleException do
begin
MessageDlg(Format('Error: %s Codigo: %d', [E.Message, E.ErrorCode]), mtError, [mbOK], 0);
end;
end;
end;