unit datosalumnos;

interface

uses
  Data.DB,bde.dbtables,

  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.Menus, Vcl.ExtCtrls,
  Vcl.Grids, Vcl.DBGrids, ZAbstractRODataset, ZAbstractDataset,
  ZDataset, Vcl.Tabs, Vcl.ComCtrls, Vcl.Mask, Vcl.DBCtrls, ZAbstractConnection,
  ZConnection, ZAbstractTable, Vcl.ExtDlgs, Vcl.Imaging.jpeg, frxClass, frxDBSet,
  frxExportPDF, frxBarcode, Vcl.Buttons;

type
  Tdmalumnos = class(TDataModule)
    qalumnos: TZReadOnlyQuery;
    dsqalumnos: TDataSource;
    qfaltas: TZQuery;
    alumnos: TZQuery;
    dsalumnos: TDataSource;
    imagenes_alumnos: TZQuery;
    dsimg_alumnos: TDataSource;
    qclientes: TZReadOnlyQuery;
    dsqclientes: TDataSource;
    alumnosid: TIntegerField;
    alumnoside: TIntegerField;
    alumnosidc: TIntegerField;
    alumnosnombre: TWideStringField;
    alumnosapellidos: TWideStringField;
    alumnosnombre_completo: TWideStringField;
    alumnosfecha_nacimiento: TDateField;
    alumnosob_medicas: TWideStringField;
    alumnosob_varias: TWideStringField;
    alumnosdireccion: TWideStringField;
    alumnospoblacion: TWideStringField;
    alumnoscod_post: TWideStringField;
    alumnosprovincia: TWideStringField;
    alumnoscentroescolar: TWideStringField;
    alumnosfecha_alta: TDateField;
    alumnosprueba_nivel: TWideStringField;
    alumnostelefono1: TWideStringField;
    alumnosob_telefono1: TWideStringField;
    alumnostelefono2: TWideStringField;
    alumnosob_telefono2: TWideStringField;
    alumnosnombre_padre_madre: TWideStringField;
    alumnospersona_autorizada: TWideStringField;
    alumnosdescuento: TFloatField;
    alumnosactivo: TIntegerField;
    alumnosetiqueta: TIntegerField;
    alumnospromociona: TWideStringField;
    alumnostelefono_alumno: TWideStringField;
    alumnoscorreo_alumno: TWideStringField;
    alumnosautomatico: TIntegerField;
    qalumnosid: TIntegerField;
    qalumnoside: TIntegerField;
    qalumnosnombre_completo: TWideStringField;
    qclientesid: TIntegerField;
    qclienteside: TIntegerField;
    qclientesnif: TWideStringField;
    qclientesnombre: TWideStringField;
    qclientesapellidos: TWideStringField;
    qclientesnombre_completo: TWideStringField;
    qclientesdireccion: TWideStringField;
    qclientespoblacion: TWideStringField;
    qclientescodpost: TWideStringField;
    qclientesprovincia: TWideStringField;
    qclientestelefono1: TWideStringField;
    qclientestelefono2: TWideStringField;
    qclientesemail: TWideStringField;
    qclientesformapago: TWideStringField;
    qclientesentidad: TWideStringField;
    qclientesiban: TWideStringField;
    qclientescuenta: TWideStringField;
    qclientesswift: TWideStringField;
    qclientesactivo: TIntegerField;
    qclientesdescuento: TIntegerField;
    qclientesidfp: TIntegerField;
    notas: TZQuery;
    dsnotas: TDataSource;
    qgrupos: TZReadOnlyQuery;
    asistir: TZQuery;
    dsasistir: TDataSource;
    notasid: TIntegerField;
    notaside: TIntegerField;
    notasida: TIntegerField;
    notasidg: TIntegerField;
    notasfechaeval1: TDateField;
    notaslistening1: TFloatField;
    notasspeaking1: TFloatField;
    notasreading1: TFloatField;
    notaswriting1: TFloatField;
    notasvocabulary1: TFloatField;
    notasdesarrollo1: TFloatField;
    notasfechaeval2: TDateField;
    notaslistenig2: TFloatField;
    notasspeaking2: TFloatField;
    notasreading2: TFloatField;
    notaswriting2: TFloatField;
    notasvocabulary2: TFloatField;
    notasdesarrollo2: TFloatField;
    notasobservaciones: TWideMemoField;
    notasobservaciones2: TWideMemoField;
    notaspromocionar_a: TWideStringField;
    notasnota1eval: TFloatField;
    notasnota2eval: TFloatField;
    notasnotafinal: TFloatField;
    notaslistening3: TFloatField;
    notasreading3: TFloatField;
    notaswriting3: TFloatField;
    notasspeaking3: TFloatField;
    notasvocabulary3: TFloatField;
    notasdesarrollo3: TFloatField;
    notasobservaciones3: TWideMemoField;
    qfaltaside: TIntegerField;
    qfaltasidp: TIntegerField;
    qfaltasidg: TIntegerField;
    qfaltasfecha: TDateField;
    qfaltasida: TIntegerField;
    qfaltasnombre: TWideStringField;
    qfaltasasiste: TIntegerField;
    qfaltasf_justificada: TIntegerField;
    qfaltasobservaciones: TWideStringField;
    qfaltasedad: TIntegerField;
    qfaltasnomgrupo: TStringField;
    qfaltasnomprofesor: TStringField;
    qaux2: TZReadOnlyQuery;
    dsqcursos2: TDataSource;
    qcursos2: TZReadOnlyQuery;
    dsqgrupos: TDataSource;
    qcursos2id: TIntegerField;
    qcursos2ide: TIntegerField;
    qcursos2nombre: TWideStringField;
    qcursos2fechainicio: TDateField;
    qcursos2fechafin: TDateField;
    qcursos2precio_material: TFloatField;
    qcursos2activo: TIntegerField;
    qcursos2precio_curso: TFloatField;
    qcursos2precio_mes: TFloatField;
    qcursos2anyo_escolar: TWideStringField;
    qgruposid: TIntegerField;
    qgruposide: TIntegerField;
    qgruposidcurso: TIntegerField;
    qgruposidaula: TIntegerField;
    qgruposcurso: TWideStringField;
    qgruposnombre: TWideStringField;
    qgruposfechainicio: TDateField;
    qgruposfechafin: TDateField;
    qgrupospreciototal: TFloatField;
    qgrupospreciomensual: TFloatField;
    qgruposnum_dias: TIntegerField;
    qgruposdias: TWideStringField;
    qgruposhorainicio: TTimeField;
    qgruposhorafin: TTimeField;
    qgruposhorassemanales: TIntegerField;
    qgruposmasdias: TWideStringField;
    qgruposhorainicio2: TTimeField;
    qgruposhorafin2: TTimeField;
    qgruposplazas: TIntegerField;
    qgruposactivo: TIntegerField;
    qgruposfechabaja: TDateField;
    qgruposmotivobaja: TWideStringField;
    qgruposdocumentacion: TBlobField;
    qgruposplazas_ocupadas: TIntegerField;
    qgruposplazas_libres: TIntegerField;
    qgruposnota_minima: TFloatField;
    qgruposseleccionado: TIntegerField;
    qgruposaula: TWideStringField;
    qgruposprofesor: TWideStringField;
    asistirid: TIntegerField;
    asistiride: TIntegerField;
    asistirida: TIntegerField;
    asistiridg: TIntegerField;
    asistirfechainicio: TDateField;
    asistirfechafin: TDateField;
    asistirfechabaja: TDateField;
    asistirmotivo_baja: TWideStringField;
    asistirdevoluciones: TSmallintField;
    asistirimporte_abono: TFloatField;
    asistirfecha_abono: TDateField;
    qrecibosalumno: TZQuery;
    qrecibosalumnoid: TIntegerField;
    qrecibosalumnoide: TIntegerField;
    qrecibosalumnoidc: TIntegerField;
    qrecibosalumnoida: TIntegerField;
    qrecibosalumnoidg: TIntegerField;
    qrecibosalumnofecharecibo: TDateField;
    qrecibosalumnofechacobro: TDateField;
    qrecibosalumnoconcepto: TWideStringField;
    qrecibosalumnoimporte: TFloatField;
    qrecibosalumnoentrega: TFloatField;
    qrecibosalumnopagado: TIntegerField;
    qrecibosalumnodomiciliado: TIntegerField;
    qrecibosalumnomaterial: TIntegerField;
    dsqrecibosalumno: TDataSource;
    qasistiralumno: TZReadOnlyQuery;
    qasistiralumnoid: TIntegerField;
    qasistiralumnoide: TIntegerField;
    qasistiralumnoida: TIntegerField;
    qasistiralumnoidg: TIntegerField;
    qasistiralumnofechainicio: TDateField;
    qasistiralumnofechafin: TDateField;
    qasistiralumnofechabaja: TDateField;
    qasistiralumnomotivo_baja: TWideStringField;
    qasistiralumnodevoluciones: TSmallintField;
    qasistiralumnoimporte_abono: TFloatField;
    qasistiralumnofecha_abono: TDateField;
    qasistiralumnocurso: TWideStringField;
    qasistiralumnonombre: TWideStringField;
    qasistiralumnoidp: TIntegerField;
    qasistiralumnonomprofesor: TWideStringField;
    dsqasistiralumno: TDataSource;
    imagenes_alumnosid: TIntegerField;
    imagenes_alumnoside: TIntegerField;
    imagenes_alumnosidalumno: TIntegerField;
    imagenes_alumnosidempleado: TIntegerField;
    imagenes_alumnosidlibro: TWideStringField;
    imagenes_alumnosimagen: TBlobField;
    imagenes_alumnostipo: TWideStringField;
    imagenes_alumnosarchivo: TWideStringField;
    dsqdocumentosal: TDataSource;
    qdocumentosal: TZQuery;
    qdocumentosalid: TIntegerField;
    qdocumentosalide: TIntegerField;
    qdocumentosalfecha: TDateField;
    qdocumentosaldescripcion: TWideStringField;
    qdocumentosalarchivo: TBlobField;
    qdocumentosalnomarchivo: TWideStringField;
    qdocumentosalextension: TWideStringField;
    qdocumentosalida: TIntegerField;
    qdocumentosalidc: TIntegerField;
    qdocumentosalidp: TIntegerField;
    qdocumentosalidplan: TIntegerField;
    qdocumentosalidcurso: TIntegerField;
    dsqdocumentosemp: TDataSource;
    qdocumentosemp: TZQuery;
    qdocumentosempid: TIntegerField;
    qdocumentosempide: TIntegerField;
    qdocumentosempfecha: TDateField;
    qdocumentosempdescripcion: TWideStringField;
    qdocumentosemparchivo: TBlobField;
    qdocumentosempnomarchivo: TWideStringField;
    qdocumentosempextension: TWideStringField;
    qdocumentosempida: TIntegerField;
    qdocumentosempidc: TIntegerField;
    qdocumentosempidp: TIntegerField;
    qdocumentosempidplan: TIntegerField;
    qdocumentosempidcurso: TIntegerField;
    procedure qgruposBeforeOpen(DataSet: TDataSet);
    procedure alumnosBeforeOpen(DataSet: TDataSet);
    procedure notasBeforeOpen(DataSet: TDataSet);
    procedure qfaltasCalcFields(DataSet: TDataSet);
    procedure qcursos2BeforeOpen(DataSet: TDataSet);
    procedure qrecibosalumnoBeforeOpen(DataSet: TDataSet);
    procedure qasistiralumnoBeforeOpen(DataSet: TDataSet);
    procedure imagenes_alumnosBeforeOpen(DataSet: TDataSet);
    procedure dsalumnosStateChange(Sender: TObject);
    procedure dsasistirStateChange(Sender: TObject);
    procedure dsnotasStateChange(Sender: TObject);
    procedure dsimg_alumnosDataChange(Sender: TObject; Field: TField);
    procedure qgruposBeforeRefresh(DataSet: TDataSet);
    procedure qcursos2BeforeRefresh(DataSet: TDataSet);
    procedure notasBeforeRefresh(DataSet: TDataSet);
    procedure qclientesBeforeRefresh(DataSet: TDataSet);
    procedure qclientesBeforeOpen(DataSet: TDataSet);
    procedure imagenes_alumnosBeforeRefresh(DataSet: TDataSet);
    procedure qasistiralumnoBeforeRefresh(DataSet: TDataSet);
    procedure qrecibosalumnoBeforeRefresh(DataSet: TDataSet);
    procedure alumnosBeforeRefresh(DataSet: TDataSet);
    procedure dsqalumnosDataChange(Sender: TObject; Field: TField);
    procedure asistirAfterPost(DataSet: TDataSet);
    procedure asistirAfterDelete(DataSet: TDataSet);
    procedure asistirAfterInsert(DataSet: TDataSet);
    procedure dsqasistiralumnoDataChange(Sender: TObject; Field: TField);
    procedure asistirfechainicioValidate(Sender: TField);
    procedure asistirfechafinValidate(Sender: TField);
    procedure asistirfechabajaValidate(Sender: TField);
    procedure asistirfecha_abonoValidate(Sender: TField);
  private
    { Private declarations }
  public
    { Public declarations }
  var
     pid,pida,pidc:integer;
  end;

  var
     dmalumnos: Tdmalumnos;


implementation

{%CLASSGROUP 'Vcl.Controls.TControl'}

{$R *.dfm}
 uses principal;

procedure Tdmalumnos.alumnosBeforeOpen(DataSet: TDataSet);
begin
  alumnos.Prepare;
  alumnos.ParamByName('PIDA').AsInteger:=pida;
  alumnos.ParamByName('PCENTRO').AsInteger:=centro;
end;

procedure Tdmalumnos.alumnosBeforeRefresh(DataSet: TDataSet);
begin
  alumnos.Prepare;
  alumnos.ParamByName('PIDA').AsInteger:=pida;
  alumnos.ParamByName('PCENTRO').AsInteger:=centro;
end;

procedure Tdmalumnos.asistirAfterDelete(DataSet: TDataSet);
begin
  qasistiralumno.refresh;
end;

procedure Tdmalumnos.asistirAfterInsert(DataSet: TDataSet);
begin
  qasistiralumno.refresh;
end;

procedure Tdmalumnos.asistirAfterPost(DataSet: TDataSet);
begin
  qasistiralumno.refresh;
end;

procedure Tdmalumnos.asistirfechabajaValidate(Sender: TField);
begin
   if asistirfechabaja.asstring='  /  /  ' then
   begin
      asistirfechabaja.value := null;
   end;

end;

procedure Tdmalumnos.asistirfechafinValidate(Sender: TField);
begin
   if asistirfechafin.asstring='  /  /  ' then
   begin
      asistirfechafin.value := null;
   end;

end;

procedure Tdmalumnos.asistirfechainicioValidate(Sender: TField);
begin
   if asistirfechainicio.asstring='  /  /  ' then
   begin
      asistirfechainicio.value := null;
   end;
end;

procedure Tdmalumnos.asistirfecha_abonoValidate(Sender: TField);
begin
   if asistirfecha_abono.asstring='  /  /  ' then
   begin
      asistirfecha_abono.value := null;
   end;

end;

procedure Tdmalumnos.dsalumnosStateChange(Sender: TObject);
begin
   if alumnos.State in [dsedit,dsinsert] then
   begin
       menu.btAnuevo.Enabled:=false;
       menu.btAborrar.Enabled:=false;
       menu.btAmodificar.Enabled:=false;
       menu.btAguardar.Enabled:=true;
       menu.btAcancelar.Enabled:=true;
       menu.Palumnosdatos.Enabled:=true;
   end else
   begin
       menu.btAnuevo.Enabled:=true;
       menu.btAborrar.Enabled:=true;
       menu.btAmodificar.Enabled:=true;
       menu.btAguardar.Enabled:=false;
       menu.btAcancelar.Enabled:=false;
       menu.Palumnosdatos.Enabled:=false;
   end;
end;

procedure Tdmalumnos.dsasistirStateChange(Sender: TObject);
begin
   if asistir.State in [dsedit,dsinsert] then
   begin
       menu.btAsnuevo.Enabled:=false;
       menu.btAsborrar.Enabled:=false;
       menu.btAsmodificar.Enabled:=false;
       menu.btAsguardar.Enabled:=true;
       menu.btAscancelar.Enabled:=true;
       menu.Pestudiosalumno.Enabled:=true;
   end else
   begin
       menu.btAsnuevo.Enabled:=true;
       menu.btAsborrar.Enabled:=true;
       menu.btAsmodificar.Enabled:=true;
       menu.btAsguardar.Enabled:=false;
       menu.btAscancelar.Enabled:=false;
       menu.Pestudiosalumno.Enabled:=false;
   end;
end;

procedure Tdmalumnos.dsimg_alumnosDataChange(Sender: TObject; Field: TField);
begin
      if (imagenes_alumnos.recordcount>0) and (imagenes_alumnos.State in [dsbrowse]) then
      begin
        If not DirectoryExists('c:\formagest\tmp') then CreateDir('c:\formagest\tmp');
        Deletefile('c:\formagest\tmp\empimg.jpg');//+temp_fotosextension.AsString);
        Deletefile('c:\formagest\tmp\empimg.jpeg');//+temp_fotosextension.AsString);
        menu.imgfoto2.Picture:=nil;
        imagenes_alumnosimagen.savetofile('c:\formagest\tmp\empimg'+imagenes_alumnostipo.asstring);
        menu.imgfoto2.Picture.LoadFromFile('c:\formagest\tmp\empimg'+imagenes_alumnostipo.AsString);
      end;
end;

procedure Tdmalumnos.dsnotasStateChange(Sender: TObject);
begin
   if notas.State in [dsedit,dsinsert] then
   begin
       menu.btnotasmodificar.Enabled:=false;
       menu.btnotasguardar.Enabled:=true;
       menu.btnotascancelar.Enabled:=true;
       menu.Panelnotas2.Enabled:=true;
       menu.btsnotasmodificar.Enabled:=false;
       menu.btsnotasguardar.Enabled:=true;
       menu.btsnotascancelar.Enabled:=true;
       menu.Panelnotassesiones.Enabled:=true;
   end else
   begin
       menu.btsnotasmodificar.Enabled:=true;
       menu.btsnotasguardar.Enabled:=false;
       menu.btsnotascancelar.Enabled:=false;
       menu.Panelnotassesiones.Enabled:=false;
       menu.btnotasmodificar.Enabled:=true;
       menu.btnotasguardar.Enabled:=false;
       menu.btnotascancelar.Enabled:=false;
       menu.Panelnotas2.Enabled:=false;
   end;
end;

procedure Tdmalumnos.dsqalumnosDataChange(Sender: TObject; Field: TField);
var pide:integer;
begin
    pida:=qalumnosid.AsInteger;
    if alumnos.Active then alumnos.Refresh else alumnos.Open;
    pidc:=alumnosidc.Asinteger;
    pide:=alumnoside.AsInteger;
    if qclientes.active then qclientes.refresh else qclientes.OPEN;
//    if qclienteslista.active then qclienteslista.refresh else qclienteslista.OPEN;
    if qgrupos.Active then qgrupos.Refresh else qgrupos.Open;
    if qcursos2.Active then qcursos2.Refresh else qcursos2.Open;
    if qasistiralumno.Active then qasistiralumno.Refresh else qasistiralumno.Open;
    if notas.Active then notas.Refresh else notas.Open;
    menu.LEedad.Caption:='Edad: '+inttostr(trunc((date()-alumnosfecha_nacimiento.AsDateTime)/365))+' aņos';
    if qalumnos.RecordCount>0 then
    begin
      imagenes_alumnos.Close;
      imagenes_alumnos.ParamByName('PCENTRO').AsInteger:=pide;
      imagenes_alumnos.ParamByName('PIDA').AsInteger:=pida;
      imagenes_alumnos.Open;
      If not DirectoryExists('c:\formagest\tmp') then CreateDir('c:\formagest\tmp');
      Deletefile('c:\formagest\tmp\empimg.*');//+temp_fotosextension.AsString);
      menu.imgfoto2.Picture:=nil;
      if imagenes_alumnos.RecordCount>0 then
      begin
        imagenes_alumnosimagen.savetofile('c:\formagest\tmp\empimg'+imagenes_alumnostipo.asstring);
        menu.imgfoto2.Picture.LoadFromFile('c:\formagest\tmp\empimg'+imagenes_alumnostipo.AsString);
      end;


    end;





 //  if imagenes_alumnos.active then imagenes_alumnos.refresh else imagenes_alumnos.Open;
   qdocumentosal.Close;
   qdocumentosal.Prepare;
   qdocumentosal.ParamByName('PEMPRESA').AsInteger:=pida;
   qdocumentosal.ParamByName('PALUMNO').AsInteger:=centro;
   qdocumentosal.open;


end;

procedure Tdmalumnos.dsqasistiralumnoDataChange(Sender: TObject; Field: TField);
begin
    pid:=qasistiralumnoid.AsInteger;
end;

procedure Tdmalumnos.imagenes_alumnosBeforeOpen(DataSet: TDataSet);
begin
{   imagenes_alumnos.Prepare;
   imagenes_alumnos.ParamByName('PCENTRO').AsInteger:=centro;
   imagenes_alumnos.ParamByName('PIDA').AsInteger:=pida;}
end;

procedure Tdmalumnos.imagenes_alumnosBeforeRefresh(DataSet: TDataSet);
begin
{   imagenes_alumnos.Prepare;
   imagenes_alumnos.ParamByName('PCENTRO').AsInteger:=centro;
   imagenes_alumnos.ParamByName('PIDA').AsInteger:=pida;}
end;

procedure Tdmalumnos.notasBeforeOpen(DataSet: TDataSet);
begin
   notas.Prepare;
   notas.ParamByName('PCENTRO').AsInteger:=centro;
   notas.ParamByName('PIDA').AsInteger:=pida;
end;

procedure Tdmalumnos.notasBeforeRefresh(DataSet: TDataSet);
begin
   notas.Prepare;
   notas.ParamByName('PCENTRO').AsInteger:=centro;
   notas.ParamByName('PIDA').AsInteger:=pida;
end;

procedure Tdmalumnos.qasistiralumnoBeforeOpen(DataSet: TDataSet);
begin
   qasistiralumno.Prepare;
   qasistiralumno.ParamByName('PCENTRO').AsInteger:=centro;
   qasistiralumno.ParamByName('PIDA').AsInteger:=pida;
end;

procedure Tdmalumnos.qasistiralumnoBeforeRefresh(DataSet: TDataSet);
begin
   qasistiralumno.Prepare;
   qasistiralumno.ParamByName('PCENTRO').AsInteger:=centro;
   qasistiralumno.ParamByName('PIDA').AsInteger:=pida;
end;

procedure Tdmalumnos.qclientesBeforeOpen(DataSet: TDataSet);
begin
   qclientes.prepare;
   qclientes.ParamByName('PCENTRO').AsInteger:=centro;
end;

procedure Tdmalumnos.qclientesBeforeRefresh(DataSet: TDataSet);
begin
   qclientes.prepare;
   qclientes.ParamByName('PCENTRO').AsInteger:=centro;
end;

procedure Tdmalumnos.qcursos2BeforeOpen(DataSet: TDataSet);
begin
   qcursos2.Prepare;
   qcursos2.ParamByName('PCENTRO').AsInteger:=centro;
end;

procedure Tdmalumnos.qcursos2BeforeRefresh(DataSet: TDataSet);
begin
   qcursos2.Prepare;
   qcursos2.ParamByName('PCENTRO').AsInteger:=centro;
end;

procedure Tdmalumnos.qfaltasCalcFields(DataSet: TDataSet);
begin
    qaux2.SQL.Clear;
    qaux2.SQL.Add('select nombre from grupos where ide='+inttostr(centro)+' and id='+qfaltasidg.AsString);
    qaux2.Open;
    qfaltasnomgrupo.Value:=qaux2.Fields[0].AsString;
    qaux2.SQL.Clear;
    qaux2.SQL.Add('select nombre_completo from empleados where ide='+inttostr(centro)+' and id='+qfaltasidp.AsString);
    qaux2.Open;
    qfaltasnomprofesor.Value:=qaux2.Fields[0].AsString;
end;

procedure Tdmalumnos.qgruposBeforeOpen(DataSet: TDataSet);
begin
   qgrupos.Prepare;
   qgrupos.ParamByName('PCENTRO').AsInteger:=centro;
end;

procedure Tdmalumnos.qgruposBeforeRefresh(DataSet: TDataSet);
begin
   qgrupos.Prepare;
   qgrupos.ParamByName('PCENTRO').AsInteger:=centro;
end;

procedure Tdmalumnos.qrecibosalumnoBeforeOpen(DataSet: TDataSet);
begin
   qrecibosalumno.Prepare;
   qrecibosalumno.ParamByName('PCENTRO').AsInteger:=centro;
   qrecibosalumno.ParamByName('PIDA').AsInteger:=pida;
end;

procedure Tdmalumnos.qrecibosalumnoBeforeRefresh(DataSet: TDataSet);
begin
   qrecibosalumno.Prepare;
   qrecibosalumno.ParamByName('PCENTRO').AsInteger:=centro;
   qrecibosalumno.ParamByName('PIDA').AsInteger:=pida;
end;

end.
