1996-07-30 14:46:52 +00:00
|
|
|
#include <form.h>
|
1997-03-20 10:33:28 +00:00
|
|
|
#include <mask.h>
|
1998-02-04 13:46:27 +00:00
|
|
|
#include <prefix.h>
|
1996-07-30 14:46:52 +00:00
|
|
|
#include <printapp.h>
|
1998-02-04 13:46:27 +00:00
|
|
|
#include <progind.h>
|
1997-03-20 10:33:28 +00:00
|
|
|
#include <recarray.h>
|
|
|
|
#include <tabutil.h>
|
|
|
|
#include <utility.h>
|
1996-07-30 14:46:52 +00:00
|
|
|
|
|
|
|
#include "at1.h"
|
1997-03-20 10:33:28 +00:00
|
|
|
|
|
|
|
// nomi campi maschera
|
1996-07-30 14:46:52 +00:00
|
|
|
#include "at1200a.h"
|
1997-03-20 10:33:28 +00:00
|
|
|
|
|
|
|
// nomi dei campi
|
|
|
|
#include "soggetti.h"
|
|
|
|
#include "donaz.h"
|
|
|
|
#include "benem.h"
|
1997-12-05 16:26:15 +00:00
|
|
|
#include "sezioni.h"
|
1998-02-04 13:46:27 +00:00
|
|
|
#include "atopera.h"
|
|
|
|
#include "atropera.h"
|
1997-12-05 16:26:15 +00:00
|
|
|
|
|
|
|
#define ALIAS_GAZ 300
|
1996-07-30 14:46:52 +00:00
|
|
|
|
1997-08-01 14:49:53 +00:00
|
|
|
class TAttribuzioneBenemerenze : public TPrintapp
|
1996-07-30 14:46:52 +00:00
|
|
|
{
|
1997-03-20 10:33:28 +00:00
|
|
|
TMask* _msk;
|
|
|
|
TRelation* _rel;
|
|
|
|
TLocalisamfile* _donaz;
|
|
|
|
TLocalisamfile* _benem;
|
1998-02-04 13:46:27 +00:00
|
|
|
TLocalisamfile* _atopera;
|
|
|
|
TLocalisamfile* _atropera;
|
|
|
|
TLocalisamfile* _sezioni;
|
1997-03-20 10:33:28 +00:00
|
|
|
TRecord_array* _sdonazioni;
|
|
|
|
TRecord_array* _sbenemerenze;
|
1998-02-04 13:46:27 +00:00
|
|
|
TCursor* _cur;
|
1997-12-05 16:26:15 +00:00
|
|
|
TAssoc_array _catdon;
|
1998-02-04 13:46:27 +00:00
|
|
|
TAssoc_array _tabben;
|
|
|
|
TString16 _gruppoazie, _oldben;
|
1998-02-23 08:23:18 +00:00
|
|
|
int _bonus;
|
1997-12-05 16:26:15 +00:00
|
|
|
TDate _dataela, _datapre;
|
1998-10-16 14:15:16 +00:00
|
|
|
bool _attgruppi,_anchegruppi;
|
1997-12-05 16:26:15 +00:00
|
|
|
bool _definitiva;
|
1997-03-20 10:33:28 +00:00
|
|
|
TParagraph_string _cognome_nome;
|
1997-12-05 16:26:15 +00:00
|
|
|
int _contatore;
|
2000-03-03 11:47:59 +00:00
|
|
|
int _progope;
|
1997-03-20 10:33:28 +00:00
|
|
|
protected:
|
|
|
|
virtual bool user_create();
|
|
|
|
virtual bool user_destroy();
|
|
|
|
virtual bool set_print(int m);
|
|
|
|
virtual void set_page(int file, int cnt);
|
|
|
|
virtual bool preprocess_page(int file, int counter);
|
2000-03-03 11:47:59 +00:00
|
|
|
virtual void postclose_print();
|
1997-03-20 10:33:28 +00:00
|
|
|
|
1996-07-30 14:46:52 +00:00
|
|
|
public:
|
|
|
|
void crea_intestazione();
|
1998-02-04 13:46:27 +00:00
|
|
|
void header_ben(const TString16 tipoben);
|
|
|
|
TAttribuzioneBenemerenze() : _cognome_nome("",25) {}
|
1996-07-30 14:46:52 +00:00
|
|
|
};
|
|
|
|
|
1997-08-01 14:49:53 +00:00
|
|
|
HIDDEN inline TAttribuzioneBenemerenze& app() { return (TAttribuzioneBenemerenze&) main_app(); }
|
1996-07-30 14:46:52 +00:00
|
|
|
|
2000-03-03 11:47:59 +00:00
|
|
|
void TAttribuzioneBenemerenze::postclose_print()
|
|
|
|
{
|
|
|
|
TLocalisamfile atropera(LF_ATROPERA);
|
|
|
|
atropera.setkey(1);
|
|
|
|
atropera.zero();
|
|
|
|
atropera.put(ROP_PROGOPE, _progope);
|
|
|
|
TRectype r(atropera.curr());
|
|
|
|
for (atropera.read(); !atropera.eof(); atropera.next())
|
|
|
|
{
|
|
|
|
if (atropera.curr() != r) break;
|
|
|
|
atropera.remove();
|
|
|
|
}
|
|
|
|
if (!_definitiva)
|
|
|
|
{
|
|
|
|
TLocalisamfile atopera(LF_ATOPERA);
|
|
|
|
atopera.setkey(1);
|
|
|
|
atopera.zero();
|
|
|
|
atopera.put(OPE_PROGOPE, _progope);
|
|
|
|
if (atopera.read() == NOERR)
|
|
|
|
atopera.remove();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1997-08-01 14:49:53 +00:00
|
|
|
bool TAttribuzioneBenemerenze::preprocess_page(int file, int counter)
|
1997-03-20 10:33:28 +00:00
|
|
|
{
|
1998-02-23 08:23:18 +00:00
|
|
|
if (file==LF_ATROPERA)
|
1996-07-30 14:46:52 +00:00
|
|
|
{
|
1998-02-23 08:23:18 +00:00
|
|
|
TRectype& recsog = current_cursor()->curr(LF_SOGGETTI);
|
|
|
|
TString80 nome = recsog.get(SOG_COGNOME);
|
|
|
|
nome << " ";
|
|
|
|
nome << recsog.get(SOG_NOME);
|
|
|
|
_cognome_nome = nome;
|
|
|
|
// salto pagina se cambio benemerenza
|
|
|
|
const TString16 tipoben = current_cursor()->curr().get(ROP_S0);
|
|
|
|
if (tipoben!=_oldben)
|
|
|
|
{
|
|
|
|
if (_oldben != "**")
|
|
|
|
printer().formfeed();
|
|
|
|
_oldben = tipoben;
|
|
|
|
header_ben(tipoben);
|
|
|
|
}
|
1998-10-16 14:15:16 +00:00
|
|
|
if (_definitiva)
|
1998-02-23 08:23:18 +00:00
|
|
|
{
|
|
|
|
const long codice = recsog.get_long(SOG_CODICE);
|
|
|
|
TRectype* key = new TRectype(LF_BENEM);
|
|
|
|
key->put(BEN_CODICE, codice);
|
1998-10-16 14:15:16 +00:00
|
|
|
int err = _sbenemerenze->read(key);
|
2001-10-22 09:07:33 +00:00
|
|
|
int r = _sbenemerenze->rows();
|
|
|
|
TRectype& rec = _sbenemerenze->row(r+1,TRUE);
|
1998-02-23 08:23:18 +00:00
|
|
|
|
2001-10-22 09:07:33 +00:00
|
|
|
TString16 codsez = recsog.get(SOG_CODSEZ);
|
|
|
|
TString16 codsot = recsog.get(SOG_CODSOT);
|
|
|
|
TString16 gruppoazie = recsog.get(SOG_GRUPPOAZIE);
|
1998-02-23 08:23:18 +00:00
|
|
|
|
2001-10-22 09:07:33 +00:00
|
|
|
rec.put(BEN_TIPOBEN, tipoben);
|
|
|
|
rec.put(BEN_DATAMAT, recsog.get(SOG_DATAULTDON));
|
|
|
|
rec.put(BEN_BONUS, recsog.get(SOG_TOTDON));
|
|
|
|
rec.put(BEN_DATABEN, _dataela);
|
|
|
|
rec.put(BEN_DATACON, _datapre);
|
|
|
|
if (_attgruppi)
|
|
|
|
rec.put(BEN_GRUPPOAZIE, gruppoazie);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
rec.put(BEN_CODSEZ, codsez);
|
|
|
|
rec.put(BEN_CODSOT, codsot);
|
|
|
|
}
|
|
|
|
err = _sbenemerenze->rewrite();
|
1998-02-23 08:23:18 +00:00
|
|
|
}
|
|
|
|
}
|
1997-03-20 10:33:28 +00:00
|
|
|
return TRUE;
|
1996-07-30 14:46:52 +00:00
|
|
|
}
|
|
|
|
|
1997-08-01 14:49:53 +00:00
|
|
|
void TAttribuzioneBenemerenze::set_page(int file, int cnt)
|
1998-02-04 13:46:27 +00:00
|
|
|
{
|
|
|
|
if (file == LF_SOGGETTI)
|
|
|
|
{
|
|
|
|
set_row(1,"@0g#a", &_cognome_nome);
|
|
|
|
set_row(1,"@26g@S", FLD(LF_SOGGETTI,SOG_CATDON));
|
|
|
|
set_row(1,"@29g@S", FLD(LF_SOGGETTI,SOG_TESSAVIS));
|
|
|
|
set_row(1,"@39g@pn", FLD(LF_SOGGETTI,SOG_TOTDON,"###"));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
set_row(1,"");
|
1997-03-20 10:33:28 +00:00
|
|
|
}
|
|
|
|
|
1998-02-04 13:46:27 +00:00
|
|
|
void TAttribuzioneBenemerenze::header_ben(const TString16 tipoben)
|
1996-07-30 14:46:52 +00:00
|
|
|
{
|
1997-03-20 10:33:28 +00:00
|
|
|
TString intestazione(132);
|
1998-02-04 13:46:27 +00:00
|
|
|
intestazione = "Benemerenza ";
|
|
|
|
intestazione << tipoben;
|
|
|
|
intestazione << " ";
|
2002-10-24 09:03:56 +00:00
|
|
|
intestazione << cache().get("BNZ", tipoben).get("S0");
|
1997-03-20 10:33:28 +00:00
|
|
|
intestazione.center_just();
|
|
|
|
set_header(1,"@0g%s", (const char*) intestazione);
|
|
|
|
return;
|
1996-07-30 14:46:52 +00:00
|
|
|
}
|
|
|
|
|
1997-08-01 14:49:53 +00:00
|
|
|
bool TAttribuzioneBenemerenze::set_print(int)
|
1996-07-30 14:46:52 +00:00
|
|
|
{
|
|
|
|
KEY tasto;
|
|
|
|
tasto = _msk->run();
|
1997-03-20 10:33:28 +00:00
|
|
|
if (tasto == K_ENTER)
|
|
|
|
{
|
1998-02-04 13:46:27 +00:00
|
|
|
_oldben = "**";
|
1997-12-05 16:26:15 +00:00
|
|
|
_contatore = 0;
|
|
|
|
_dataela = _msk->get(F_DATAELA);
|
|
|
|
_datapre = _msk->get(F_DATAPRE);
|
1998-10-16 14:15:16 +00:00
|
|
|
_attgruppi = _msk->get_bool(F_ATTGRUPPI);
|
1997-12-05 16:26:15 +00:00
|
|
|
_gruppoazie = _msk->get(F_GRUPPOAZIE);
|
|
|
|
_anchegruppi = _msk->get_bool(F_ANCHEGRUPPI);
|
|
|
|
_definitiva = _msk->get_bool(F_DEFINITIVA);
|
1998-02-04 13:46:27 +00:00
|
|
|
_catdon.destroy();
|
1997-12-05 16:26:15 +00:00
|
|
|
const TString16 catpri = _msk->get(F_CAT1);
|
|
|
|
const TString16 catsec = _msk->get(F_CAT2);
|
|
|
|
const TString16 catter = _msk->get(F_CAT3);
|
|
|
|
const TString16 catqua = _msk->get(F_CAT4);
|
|
|
|
const TString16 catqui = _msk->get(F_CAT5);
|
|
|
|
const TString16 catses = _msk->get(F_CAT6);
|
2000-10-10 08:36:57 +00:00
|
|
|
if (catpri.not_empty())
|
1997-12-05 16:26:15 +00:00
|
|
|
_catdon.add((const char*) catpri);
|
2000-10-10 08:36:57 +00:00
|
|
|
if (catsec.not_empty())
|
1997-12-05 16:26:15 +00:00
|
|
|
_catdon.add((const char*) catsec);
|
2000-10-10 08:36:57 +00:00
|
|
|
if (catter.not_empty())
|
1997-12-05 16:26:15 +00:00
|
|
|
_catdon.add((const char*) catter);
|
2000-10-10 08:36:57 +00:00
|
|
|
if (catqua.not_empty())
|
1997-12-05 16:26:15 +00:00
|
|
|
_catdon.add((const char*) catqua);
|
2000-10-10 08:36:57 +00:00
|
|
|
if (catqui.not_empty())
|
1997-12-05 16:26:15 +00:00
|
|
|
_catdon.add((const char*) catqui);
|
2000-10-10 08:36:57 +00:00
|
|
|
if (catses.not_empty())
|
1997-12-05 16:26:15 +00:00
|
|
|
_catdon.add((const char*) catses);
|
1998-02-04 13:46:27 +00:00
|
|
|
_tabben.destroy();
|
|
|
|
TTable ben("BNZ");
|
|
|
|
for(ben.first(); !ben.eof(); ben.next())
|
|
|
|
{
|
|
|
|
TString16 codben = ben.get("CODTAB");
|
|
|
|
int numdonben = ben.get_int("I0");
|
|
|
|
real* oggetto = new real(numdonben);
|
|
|
|
_tabben.add((const char*)codben, (TObject*) oggetto);
|
|
|
|
}
|
1999-01-26 13:53:35 +00:00
|
|
|
TString80 filtro;
|
1998-10-16 14:15:16 +00:00
|
|
|
if (_attgruppi)
|
|
|
|
{
|
|
|
|
if (_gruppoazie.not_empty())
|
|
|
|
filtro.format("(90->GRUPPOAZIE == \"%s\")",(const char*)_gruppoazie);
|
|
|
|
else
|
|
|
|
filtro.format("(90->GRUPPOAZIE != \"\")");
|
|
|
|
}
|
1998-02-04 13:46:27 +00:00
|
|
|
else
|
|
|
|
if (!_anchegruppi)
|
|
|
|
filtro.format("(90->GRUPPOAZIE == \"\")");
|
1999-01-26 13:53:35 +00:00
|
|
|
if (filtro.not_empty())
|
|
|
|
filtro << " && ";
|
|
|
|
filtro << "(90->BENEM == \"X\")";
|
1998-02-04 13:46:27 +00:00
|
|
|
// filtro per sezioni
|
|
|
|
const TString16 sezini = _msk->get(F_SEZINI);
|
|
|
|
const TString16 sotini = _msk->get(F_SOTINI);
|
|
|
|
TRectype da(LF_SOGGETTI);
|
|
|
|
if (sezini.not_empty())
|
|
|
|
da.put(SOG_CODSEZ, sezini);
|
|
|
|
if (sotini.not_empty())
|
|
|
|
da.put(SOG_CODSOT, sotini);
|
|
|
|
_cur = new TCursor(_rel, "", 3, &da, &da);
|
|
|
|
_cur->setfilter(filtro, TRUE);
|
|
|
|
|
|
|
|
TLocalisamfile atopera(LF_ATOPERA);
|
|
|
|
atopera.last();
|
2000-03-03 11:47:59 +00:00
|
|
|
_progope = atopera.get_int(OPE_PROGOPE);
|
|
|
|
_progope++;
|
1998-02-04 13:46:27 +00:00
|
|
|
atopera.zero();
|
2000-03-03 11:47:59 +00:00
|
|
|
atopera.put(OPE_PROGOPE, _progope);
|
1998-02-04 13:46:27 +00:00
|
|
|
atopera.put(OPE_CODSEZ,sezini);
|
|
|
|
atopera.put(OPE_CODSOT,sotini);
|
|
|
|
atopera.put(OPE_GRUPPOAZIE,_gruppoazie);
|
|
|
|
atopera.put(OPE_DATA1,_dataela);
|
|
|
|
atopera.put(OPE_DATA2,_datapre);
|
|
|
|
atopera.put(OPE_FLAG1,_anchegruppi);
|
1998-10-16 14:15:16 +00:00
|
|
|
atopera.put(OPE_FLAG2,_attgruppi);
|
1998-02-04 13:46:27 +00:00
|
|
|
atopera.put(OPE_UTENTE,user());
|
2000-03-03 11:47:59 +00:00
|
|
|
atopera.put(OPE_TIPOOPE,'B');
|
1998-02-04 13:46:27 +00:00
|
|
|
atopera.write();
|
|
|
|
TLocalisamfile atropera(LF_ATROPERA);
|
|
|
|
// cancelliamo l'elaborazione precedente
|
2000-03-03 11:47:59 +00:00
|
|
|
// NO! non la cancelliamo piu' cosi' perche ci possono essere le righe di altre elaborazioni (es. tessere!)
|
|
|
|
//for (atropera.first(); !atropera.eof(); atropera.next())
|
|
|
|
// atropera.remove();
|
1998-02-04 13:46:27 +00:00
|
|
|
TRectype& sog = _cur->curr();
|
|
|
|
long last = _cur->items();
|
|
|
|
_benem->setkey(3);
|
|
|
|
TProgind prg (last, "Elaborazione in corso... Prego attendere", FALSE, TRUE, 30);
|
|
|
|
for ( *_cur=0; _cur->pos() < last; ++(*_cur) )
|
|
|
|
{
|
|
|
|
prg.addstatus(1);
|
|
|
|
// controllare la categoria
|
|
|
|
bool filtrato = TRUE;
|
|
|
|
|
|
|
|
long codice = sog.get_long(SOG_CODICE);
|
|
|
|
if (_catdon.items() != 0)
|
|
|
|
{
|
|
|
|
const TString16 cat = sog.get(SOG_CATDON);
|
|
|
|
filtrato = _catdon.is_key((const char*) cat);
|
|
|
|
}
|
|
|
|
if (filtrato)
|
|
|
|
{
|
|
|
|
TRectype* key = new TRectype(LF_DONAZ);
|
|
|
|
key->put(DON_CODICE, codice);
|
|
|
|
int err = _sdonazioni->read(key);
|
|
|
|
if (err == NOERR)
|
|
|
|
{
|
|
|
|
int precsi = sog.get_int(SOG_DONPRECSI);
|
|
|
|
int precaf = sog.get_int(SOG_DONPRECAF);
|
1998-10-16 14:15:16 +00:00
|
|
|
//int numdon = 0;
|
|
|
|
//if (precsi!=0)
|
|
|
|
//numdon = numdon+precsi;
|
|
|
|
//if (precaf!=0)
|
|
|
|
// numdon = numdon+precaf;
|
|
|
|
int numdon = precsi + precaf;
|
1998-02-04 13:46:27 +00:00
|
|
|
for (int r=1; r<=_sdonazioni->rows(); r++)
|
|
|
|
{
|
|
|
|
const TRectype& riga = _sdonazioni->row(r);
|
|
|
|
TDate datadon = riga.get_date(DON_DATADON);
|
|
|
|
if (datadon<=_dataela)
|
|
|
|
numdon++;
|
|
|
|
}
|
|
|
|
TString16 ultben = "**";
|
|
|
|
TRectype* key = new TRectype(LF_BENEM);
|
|
|
|
key->put(BEN_CODICE, codice);
|
|
|
|
int err = _sbenemerenze->read(key);
|
|
|
|
if (err == NOERR)
|
|
|
|
{
|
|
|
|
for (int r=1; r<=_sbenemerenze->rows(); r++)
|
|
|
|
{
|
|
|
|
const TRectype& riga = _sbenemerenze->row(r);
|
|
|
|
ultben = riga.get(BEN_TIPOBEN);
|
1998-09-25 13:07:50 +00:00
|
|
|
if (ultben.empty())
|
|
|
|
ultben = "**";
|
1998-02-04 13:46:27 +00:00
|
|
|
}
|
|
|
|
}
|
1998-02-06 15:44:00 +00:00
|
|
|
long bonusctrl = 0;
|
1998-02-04 13:46:27 +00:00
|
|
|
if (ultben != "**")
|
|
|
|
{
|
|
|
|
real& ndonult = (real&) _tabben.find((const char*) ultben);
|
|
|
|
bonusctrl = ndonult.integer();
|
|
|
|
}
|
|
|
|
_tabben.restart();
|
|
|
|
real* c;
|
|
|
|
for (c = (real*) _tabben.first_item(); c != NULL; c = (real*) _tabben.succ_item())
|
|
|
|
{
|
|
|
|
const char* tipoben = _tabben.get_hashobj()->key();
|
1998-02-06 15:44:00 +00:00
|
|
|
long bonus = c->integer();
|
1998-02-04 13:46:27 +00:00
|
|
|
if (bonus > bonusctrl)
|
|
|
|
{
|
|
|
|
if (numdon >= bonus)
|
|
|
|
{
|
|
|
|
// controllo che non abbia ricevuto la benemerenza
|
|
|
|
//const char* tipoben = _tabben.get_hashobj()->key();
|
|
|
|
_benem->zero();
|
|
|
|
_benem->put(BEN_CODICE, codice);
|
|
|
|
_benem->put(BEN_TIPOBEN, tipoben);
|
|
|
|
_benem->read();
|
|
|
|
if (_benem->bad())
|
|
|
|
{
|
|
|
|
atropera.zero();
|
2000-03-03 11:47:59 +00:00
|
|
|
atropera.put(ROP_PROGOPE, _progope);
|
1998-02-04 13:46:27 +00:00
|
|
|
atropera.put(ROP_CODICE, codice);
|
|
|
|
atropera.put(ROP_S0, tipoben);
|
|
|
|
atropera.write();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
reset_files();
|
|
|
|
TRelation* relope = new TRelation(LF_ATROPERA);
|
|
|
|
relope->add(LF_SOGGETTI, "CODICE==CODICE");
|
|
|
|
TString80 chiave = "131->S0|UPPER(90->COGNOME)|UPPER(90->NOME)";
|
2000-03-03 11:47:59 +00:00
|
|
|
TString80 filtroope = format("131->PROGOPE==%d", _progope);
|
1998-02-04 13:46:27 +00:00
|
|
|
int curope = add_cursor(new TSorted_cursor(relope, (const char*) chiave, "", 1));
|
2000-03-03 11:47:59 +00:00
|
|
|
current_cursor()->setfilter((const char*) filtroope, TRUE);
|
1998-02-04 13:46:27 +00:00
|
|
|
add_file(LF_ATROPERA);
|
|
|
|
add_file(LF_SOGGETTI,LF_ATROPERA);
|
1997-03-20 10:33:28 +00:00
|
|
|
reset_print();
|
1996-07-30 14:46:52 +00:00
|
|
|
crea_intestazione();
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
1997-08-01 14:49:53 +00:00
|
|
|
void TAttribuzioneBenemerenze::crea_intestazione()
|
1996-07-30 14:46:52 +00:00
|
|
|
{
|
1997-03-20 10:33:28 +00:00
|
|
|
reset_header();
|
|
|
|
|
|
|
|
TString sep(132);
|
1998-02-04 13:46:27 +00:00
|
|
|
sep = "ATTRIBUZIONE BENEMERENZE ";
|
1999-01-26 13:53:35 +00:00
|
|
|
if (_definitiva)
|
|
|
|
sep << "DEFINITIVA";
|
|
|
|
else
|
|
|
|
sep << "PROVVISORIA";
|
1997-03-20 10:33:28 +00:00
|
|
|
sep << " ALLA DATA ";
|
1998-02-04 13:46:27 +00:00
|
|
|
sep << _dataela.string();;
|
1997-03-20 10:33:28 +00:00
|
|
|
sep.center_just();
|
|
|
|
set_header(2, "@0g%s", (const char*) sep);
|
|
|
|
sep = "";
|
|
|
|
sep << "Pag. @#";
|
|
|
|
set_header(2, "@120g%s", (const char*) sep);
|
|
|
|
|
|
|
|
sep = "";
|
|
|
|
sep.fill('-');
|
|
|
|
set_header(3, (const char *) sep);
|
1998-02-04 13:46:27 +00:00
|
|
|
set_header(4,"@0gCognome e nome@26gC.@29gTessera@39gTot.don.");
|
|
|
|
set_header(5,"@0-------------------------@26g--@29g--------@39g--------");
|
1996-07-30 14:46:52 +00:00
|
|
|
}
|
|
|
|
|
1997-08-01 14:49:53 +00:00
|
|
|
bool TAttribuzioneBenemerenze::user_create()
|
1998-02-04 13:46:27 +00:00
|
|
|
{
|
1997-03-20 10:33:28 +00:00
|
|
|
_msk = new TMask("at1200a");
|
|
|
|
_rel = new TRelation(LF_SOGGETTI);
|
|
|
|
_rel->add(LF_SEZIONI,"CODSEZ==CODSEZ|CODSOT==CODSOT");
|
1997-12-05 16:26:15 +00:00
|
|
|
_rel->add("GAZ", "CODTAB==GRUPPOAZIE",1,0,ALIAS_GAZ);
|
1997-03-20 10:33:28 +00:00
|
|
|
_donaz = new TLocalisamfile(LF_DONAZ);
|
|
|
|
_benem = new TLocalisamfile(LF_BENEM);
|
|
|
|
_sdonazioni = new TRecord_array(LF_DONAZ,DON_PROGDON);
|
|
|
|
_sbenemerenze = new TRecord_array(LF_BENEM, BEN_PROGBEN);
|
1998-02-04 13:46:27 +00:00
|
|
|
_atopera = new TLocalisamfile(LF_ATOPERA);
|
|
|
|
_atropera = new TLocalisamfile(LF_ATROPERA);
|
|
|
|
_sezioni = new TLocalisamfile(LF_SEZIONI);
|
1997-03-20 10:33:28 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
1996-07-30 14:46:52 +00:00
|
|
|
|
1997-08-01 14:49:53 +00:00
|
|
|
bool TAttribuzioneBenemerenze::user_destroy()
|
1996-07-30 14:46:52 +00:00
|
|
|
{
|
1998-08-07 09:48:37 +00:00
|
|
|
delete _sezioni;
|
|
|
|
delete _atropera;
|
|
|
|
delete _atopera;
|
|
|
|
delete _sbenemerenze;
|
|
|
|
delete _sdonazioni;
|
|
|
|
delete _benem;
|
|
|
|
delete _donaz;
|
1997-03-20 10:33:28 +00:00
|
|
|
delete _rel;
|
|
|
|
delete _msk;
|
|
|
|
return TRUE;
|
1996-07-30 14:46:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int at1200(int argc, char* argv[])
|
|
|
|
{
|
1997-08-01 14:49:53 +00:00
|
|
|
TAttribuzioneBenemerenze a;
|
1998-08-07 09:48:37 +00:00
|
|
|
a.run(argc, argv, "Attribuzione complessiva");
|
1997-03-20 10:33:28 +00:00
|
|
|
return 0;
|
|
|
|
}
|