unit frmListCompras;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, FIBDataSet, pFIBDataSet, FIBDatabase, pFIBDatabase, Grids,
  Wwdbigrd, Wwdbgrid, StdCtrls, ExtCtrls;

type
  TfmListCompras = class(TForm)
    Panel1: TPanel;
    GroupBox1: TGroupBox;
    Panel2: TPanel;
    Button1: TButton;
    dbgArticulos: TwwDBGrid;
    dsCompras: TpFIBDataSet;
    dsoCompras: TDataSource;
    dsComprasHIST_COMPRA_ID: TFIBIntegerField;
    dsComprasFECHA: TFIBDateTimeField;
    dsComprasFARMACIA: TFIBStringField;
    dsComprasCLAVE_ARTICULO: TFIBStringField;
    dsComprasARTICULO: TFIBStringField;
    dsComprasPIEZAS_COMPRADAS: TFIBIntegerField;
    dsComprasPIEZAS_REGALADAS: TFIBIntegerField;
    dsComprasPIEZAS_PEND_ENTREGAR: TFIBIntegerField;
    dsComprasIMPTE_DSCTO: TFIBBCDField;
    dsComprasPCTJE_DSCTO: TFIBBCDField;
    dsComprasPROMOCION: TFIBStringField;
    dsComprasSESION: TFIBStringField;
    dsComprasNO_TARJETA: TFIBStringField;
    procedure FormShow(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    FSesion, FTarjeta:String;
    procedure Inicio();
  end;

var
  fmListCompras: TfmListCompras;

implementation
uses frmComprasPaciente;

{$R *.dfm}

procedure TfmListCompras.Button1Click(Sender: TObject);
begin
  Close;
end;

procedure TfmListCompras.FormShow(Sender: TObject);
begin
  Inicio();
end;

procedure TfmListCompras.Inicio();
begin
   dsCompras.Close;
   dsCompras.ParamByName('SESION').AsString:=FSesion;
   dsCompras.ParamByName('NO_TARJETA').AsString:=FTarjeta;
   dsCompras.Open;

   if dbgArticulos.CanFocus then
    dbgArticulos.SetFocus;
end;

end.
