modifiche per adeguare i tracciati alle richieste della commissione informatica nazionale
git-svn-id: svn://10.65.10.50/trunk@3988 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
364e3b63f6
commit
aa008393bc
@ -43,7 +43,7 @@ class TSospesi_application : public TPrintapp
|
||||
ts _tipo_stampa;
|
||||
TString16 _codsez, _codsot;
|
||||
|
||||
static bool filter_func_sospesi(const TRelation *);
|
||||
static bool filter_func_sospesi(const TRelation* rel);
|
||||
|
||||
protected:
|
||||
virtual bool user_create();
|
||||
@ -129,11 +129,9 @@ void TSospesi_application::set_page(int file, int cnt)
|
||||
|
||||
bool TSospesi_application::filter_func_sospesi(const TRelation* rel)
|
||||
{
|
||||
|
||||
bool filtrato = TRUE;
|
||||
|
||||
TLocalisamfile& sog = rel->lfile();
|
||||
|
||||
// filtro per categorie
|
||||
TAssoc_array categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
|
@ -31,7 +31,7 @@ public:
|
||||
|
||||
class TPereta_application : public TPrintapp
|
||||
{
|
||||
static bool filter_func_pereta(const TRelation *);
|
||||
static bool filter_func_pereta(const TRelation* rel);
|
||||
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
@ -135,8 +135,7 @@ bool TPereta_application::filter_func_pereta(const TRelation* rel)
|
||||
{
|
||||
bool filtrato = TRUE;
|
||||
TLocalisamfile& sog = rel->lfile();
|
||||
|
||||
// fiiltro per categorie
|
||||
// filtro per categorie
|
||||
TAssoc_array categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
|
@ -31,7 +31,7 @@ public:
|
||||
|
||||
class TEsclusi_application : public TPrintapp
|
||||
{
|
||||
static bool filter_func_esclusi(const TRelation *);
|
||||
static bool filter_func_esclusi(const TRelation* rel);
|
||||
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
@ -127,8 +127,7 @@ void TEsclusi_application::set_page(int file, int cnt)
|
||||
bool TEsclusi_application::filter_func_esclusi(const TRelation * rel)
|
||||
{
|
||||
bool filtrato = TRUE;
|
||||
TLocalisamfile sog = rel->lfile();
|
||||
|
||||
TLocalisamfile& sog = rel->lfile();
|
||||
//filtro per categorie
|
||||
TAssoc_array categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
class TBenem_application : public TPrintapp
|
||||
{
|
||||
static bool filter_func_benem(const TRelation *);
|
||||
static bool filter_func_benem(const TRelation* rel);
|
||||
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
|
@ -130,13 +130,15 @@ void TIdonei_application::set_page(int file, int cnt)
|
||||
bool TIdonei_application::filter_func_idonei(const TRelation * rel)
|
||||
{
|
||||
bool filtrato = TRUE;
|
||||
TLocalisamfile sog = rel->lfile();
|
||||
TLocalisamfile& sog = rel->lfile();
|
||||
// filtro per categorie
|
||||
TAssoc_array categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
TString16 catsog = sog.get(SOG_CATDON);
|
||||
filtrato = categorie.is_key((const char*) catsog);
|
||||
}
|
||||
// filtro per idoneità
|
||||
if (filtrato)
|
||||
{
|
||||
TAssoc_array idoneita;
|
||||
|
@ -126,13 +126,15 @@ void TIscritti_application::set_page(int file, int cnt)
|
||||
bool TIscritti_application::filter_func_iscritti(const TRelation * rel)
|
||||
{
|
||||
bool filtrato = TRUE;
|
||||
TLocalisamfile sog = rel->lfile();
|
||||
TLocalisamfile& sog = rel->lfile();
|
||||
// filtro per categorie
|
||||
TAssoc_array categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
TString16 cat = sog.get(SOG_CATDON);
|
||||
filtrato = categorie.is_key((const char*) cat);
|
||||
}
|
||||
// filtrp per date iscrizione/dimissione
|
||||
if (filtrato)
|
||||
{
|
||||
if (app()._tipo_iscdim == ISCRITTI)
|
||||
|
@ -16,8 +16,8 @@
|
||||
|
||||
#define STATO_IDONEO 'I' // IDONEITA'
|
||||
#define STATO_FINESO 'F' // FINE SOSPENSIONE
|
||||
|
||||
enum ts { undefined = 0, elenco = 1, etichette = 2, cartoline = 3 }; //tipi di stampe
|
||||
// tpi di stampa
|
||||
enum ts { undefined = 0, elenco = 1, etichette = 2, cartoline = 3 };
|
||||
|
||||
// definizione form per etichette e cartoline
|
||||
class TConv_form : public TForm
|
||||
@ -35,7 +35,7 @@ public:
|
||||
|
||||
class TConv_application : public TPrintapp
|
||||
{
|
||||
static bool filter_func_conv(const TRelation *);
|
||||
static bool filter_func_conv(const TRelation* rel);
|
||||
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
@ -147,15 +147,12 @@ void TConv_application::set_page(int file, int cnt)
|
||||
}
|
||||
}
|
||||
|
||||
bool TConv_application::filter_func_conv (const TRelation * rel)
|
||||
bool TConv_application::filter_func_conv (const TRelation* rel)
|
||||
{
|
||||
TLocalisamfile& sog = rel->lfile();
|
||||
TDate dataprossi = sog.get_date(SOG_DATAPROSSI);
|
||||
|
||||
const char stato = rel->curr(-ALIAS_TABTCS).get_char("S6");
|
||||
const bool dimesso = rel->curr(-ALIAS_TABCTD).get_char("B0");
|
||||
|
||||
|
||||
//TDate dataultconv = sog.curr().get_date(SOG_DATAULTCONV);
|
||||
if (dataprossi.ok())
|
||||
{
|
||||
@ -163,7 +160,6 @@ bool TConv_application::filter_func_conv (const TRelation * rel)
|
||||
long intconvsi = app()._dataconv - dataprossi;
|
||||
// intervallo tra data convocazione e data ultima convocazione
|
||||
//long intultconvsi = app()._data - dataultconv;
|
||||
|
||||
if ((intconvsi >= 0) && (intconvsi < app()._intmax) && ((stato == STATO_IDONEO) || (stato == STATO_FINESO)) && (dimesso != 'X'))
|
||||
return TRUE;
|
||||
else
|
||||
|
@ -40,7 +40,7 @@ class TTessere_application : public TPrintapp
|
||||
ts _tipo_stampa;
|
||||
TString _riepilogodon;
|
||||
|
||||
static bool filter_func_tessere(const TRelation *);
|
||||
static bool filter_func_tessere(const TRelation* rel);
|
||||
|
||||
protected:
|
||||
virtual bool user_create();
|
||||
|
@ -31,7 +31,7 @@ public:
|
||||
|
||||
class TUrgenze_application : public TPrintapp
|
||||
{
|
||||
static bool filter_func_urgenze(const TRelation *);
|
||||
static bool filter_func_urgenze(const TRelation* rel);
|
||||
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
@ -130,12 +130,10 @@ void TUrgenze_application::set_page(int file, int cnt)
|
||||
}
|
||||
}
|
||||
|
||||
bool TUrgenze_application::filter_func_urgenze(const TRelation * rel)
|
||||
bool TUrgenze_application::filter_func_urgenze(const TRelation* rel)
|
||||
{
|
||||
bool filtrato = TRUE;
|
||||
|
||||
TLocalisamfile& sog = rel->lfile();
|
||||
|
||||
//filtro per categorie
|
||||
TAssoc_array& categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
@ -154,12 +152,10 @@ bool TUrgenze_application::filter_func_urgenze(const TRelation * rel)
|
||||
{
|
||||
long giorni_sez = rel->lfile(LF_SEZIONI).get_long(SEZ_INTMINCONV);
|
||||
long giorni = (giorni_sez > app()._giorni) ? giorni_sez : app()._giorni;
|
||||
TRectype from = sog.curr();
|
||||
from.zero();
|
||||
TDate data(TODAY);
|
||||
data = data - (const long) giorni;
|
||||
from.put(SOG_DATAULTDON, data);
|
||||
filtrato = (sog.curr()<= from);
|
||||
TDate dataultdon = sog.get(SOG_DATAULTDON);
|
||||
filtrato = (dataultdon <= data);
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
@ -196,7 +192,6 @@ bool TUrgenze_application::preprocess_page(int file, int counter)
|
||||
TString16 codsot = current_cursor()->curr().get(SOG_CODSOT);
|
||||
if ((_codsez!=codsez)||(_codsot!=codsot))
|
||||
{
|
||||
//if (!_codsez.blank())
|
||||
if (_codsez != "**")
|
||||
printer().formfeed();
|
||||
_codsez = codsez;
|
||||
@ -237,8 +232,6 @@ bool TUrgenze_application::set_print(int)
|
||||
{
|
||||
case F_ELENCO:
|
||||
_tipo_stampa = elenco;
|
||||
//_codsez.spaces(2);
|
||||
//_codsot.spaces(2);
|
||||
_codsez = "**";
|
||||
_codsot = "**";
|
||||
break;
|
||||
@ -251,7 +244,6 @@ bool TUrgenze_application::set_print(int)
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
filtra_sezioni();
|
||||
|
||||
// filtro per categorie
|
||||
TString16 catpri = _msk->get(F_CAT1);
|
||||
TString16 catsec = _msk->get(F_CAT2);
|
||||
@ -271,7 +263,6 @@ bool TUrgenze_application::set_print(int)
|
||||
_categorie.add((const char*) catqui);
|
||||
if (catses.not_empty() && catses.ok())
|
||||
_categorie.add((const char*) catses);
|
||||
|
||||
// filtro per tipizzazione
|
||||
_sangue->zero();
|
||||
TString16 gruppoab0 = _msk->get(F_GRUPPOAB0);
|
||||
@ -289,9 +280,7 @@ bool TUrgenze_application::set_print(int)
|
||||
_sangue->put(SOG_FENOTIPORH, fenotiporh);
|
||||
if ((du.ok()) && (du.not_empty()))
|
||||
_sangue->put(SOG_DU, du);
|
||||
|
||||
long giorni = _msk->get_long(F_GIORNI);
|
||||
|
||||
_giorni = _msk->get_long(F_GIORNI);
|
||||
// filtra solo idonei
|
||||
current_cursor()->setfilter("TCS->S6 == \"I\"", TRUE);
|
||||
// filtra per categorie, tipizzazione e data donazione
|
||||
|
@ -31,7 +31,7 @@ public:
|
||||
|
||||
class TModificati_application : public TPrintapp
|
||||
{
|
||||
static bool filter_func_modificati(const TRelation *);
|
||||
static bool filter_func_modificati(const TRelation* rel);
|
||||
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
@ -126,12 +126,10 @@ void TModificati_application::set_page(int file, int cnt)
|
||||
}
|
||||
}
|
||||
|
||||
bool TModificati_application::filter_func_modificati(const TRelation * rel)
|
||||
bool TModificati_application::filter_func_modificati(const TRelation* rel)
|
||||
{
|
||||
bool filtrato = TRUE;
|
||||
|
||||
TLocalisamfile sog = rel->lfile();
|
||||
|
||||
TLocalisamfile& sog = rel->lfile();
|
||||
//filtro per categorie
|
||||
TAssoc_array& categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
@ -257,7 +255,7 @@ bool TModificati_application::set_print(int)
|
||||
if (catses.not_empty() && catses.ok())
|
||||
_categorie.add((const char*) catses);
|
||||
|
||||
current_cursor()->set_filterfunction (filter_func_modificati);
|
||||
current_cursor()->set_filterfunction(filter_func_modificati);
|
||||
reset_print();
|
||||
crea_intestazione();
|
||||
return TRUE;
|
||||
|
111
at/at3500.cpp
111
at/at3500.cpp
@ -36,16 +36,17 @@ class TScadenze_application : public TPrintapp
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TScadenze_form* _form_eti;
|
||||
TAssoc_array _categorie;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome;
|
||||
TDate _data_stampa;
|
||||
TDate _dataini, _datafin;
|
||||
TString _procdon;
|
||||
TString16 _procdon;
|
||||
ts _tipo_stampa;
|
||||
TString _codsez, _codsot;
|
||||
TString16 _codsez, _codsot;
|
||||
|
||||
static bool filter_func_scadenze(const TRelation *);
|
||||
static bool filter_func_scadenze(const TRelation* rel);
|
||||
|
||||
protected:
|
||||
virtual bool user_create();
|
||||
@ -57,7 +58,7 @@ protected:
|
||||
public:
|
||||
void crea_intestazione();
|
||||
void filtra_sezioni();
|
||||
void header_sezione(TString codsez, TString codsot);
|
||||
void header_sezione(TString16 codsez, TString16 codsot);
|
||||
TMask& app_mask() { return *_msk; }
|
||||
TScadenze_application() : _data_stampa(TODAY), _cognome_nome("",25) {}
|
||||
};
|
||||
@ -70,10 +71,10 @@ TRelation* TScadenze_form::relation() const { return cursor()->relation(); }
|
||||
|
||||
void TScadenze_application::filtra_sezioni()
|
||||
{
|
||||
TString sezini = _msk->get(F_SEZINI);
|
||||
TString sotini = _msk->get(F_SOTINI);
|
||||
TString sezfin = _msk->get(F_SEZFIN);
|
||||
TString sotfin = _msk->get(F_SOTFIN);
|
||||
TString16 sezini = _msk->get(F_SEZINI);
|
||||
TString16 sotini = _msk->get(F_SOTINI);
|
||||
TString16 sezfin = _msk->get(F_SEZFIN);
|
||||
TString16 sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
|
||||
TRectype da(fl.curr());
|
||||
@ -128,49 +129,22 @@ void TScadenze_application::set_page(int file, int cnt)
|
||||
}
|
||||
}
|
||||
|
||||
bool TScadenze_application::filter_func_scadenze(const TRelation * rel)
|
||||
bool TScadenze_application::filter_func_scadenze(const TRelation* rel)
|
||||
{
|
||||
|
||||
bool filtrato = TRUE;
|
||||
|
||||
TLocalisamfile* sog = &(rel->lfile(LF_SOGGETTI));
|
||||
|
||||
TAssoc_array categorie;
|
||||
|
||||
TMask& msk = app().app_mask();
|
||||
|
||||
TString cat = msk.get(F_CAT1);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
cat = msk.get(F_CAT2);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
cat = msk.get(F_CAT3);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
cat = msk.get(F_CAT4);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
cat = msk.get(F_CAT5);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
cat = msk.get(F_CAT6);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
|
||||
TLocalisamfile& sog = rel->lfile();
|
||||
// filtro per categorie
|
||||
TAssoc_array categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
TString catsog = sog->curr().get(SOG_CATDON);
|
||||
if (categorie.is_key((const char*) catsog))
|
||||
filtrato = TRUE;
|
||||
else
|
||||
filtrato = FALSE;
|
||||
TString16 cat = sog.get(SOG_CATDON);
|
||||
filtrato = categorie.is_key((const char*) cat);
|
||||
}
|
||||
// filtro per data di prossima donazione
|
||||
if (filtrato)
|
||||
{
|
||||
// filtro per età
|
||||
TRectype from (sog->curr());
|
||||
TRectype to (sog->curr());
|
||||
TRectype from = sog->curr();
|
||||
TRectype to = sog->curr();
|
||||
from.zero();
|
||||
to.zero();
|
||||
if (app()._dataini.ok())
|
||||
@ -187,11 +161,7 @@ bool TScadenze_application::filter_func_scadenze(const TRelation * rel)
|
||||
else
|
||||
to.put(SOG_DATAPROSAF, app()._datafin);
|
||||
}
|
||||
if ((sog->curr() >= from) && (sog->curr() <= to))
|
||||
filtrato = TRUE;
|
||||
else
|
||||
filtrato = FALSE;
|
||||
|
||||
filtrato = (sog->curr() >= from) && (sog->curr() <= to);
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
@ -202,14 +172,14 @@ bool TScadenze_application::preprocess_page(int file, int counter)
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
TString80 nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
|
||||
// salto pagina se cambio sezione
|
||||
TString codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
TString codsot = current_cursor()->curr().get(SOG_CODSOT);
|
||||
TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
TString16 codsot = current_cursor()->curr().get(SOG_CODSOT);
|
||||
if ((_codsez!=codsez)||(_codsot!=codsot))
|
||||
{
|
||||
if (_codsez != "**")
|
||||
@ -222,11 +192,11 @@ bool TScadenze_application::preprocess_page(int file, int counter)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void TScadenze_application::header_sezione(TString codsez, TString codsot)
|
||||
void TScadenze_application::header_sezione(TString16 codsez, TString16 codsot)
|
||||
{
|
||||
TString densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
TString densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString intestazione(132);
|
||||
TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString256 intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << codsez;
|
||||
intestazione << "/";
|
||||
@ -268,16 +238,33 @@ bool TScadenze_application::set_print(int m)
|
||||
_dataini = _msk->get(F_DATAINI);
|
||||
_datafin = _msk->get(F_DATAFIN);
|
||||
_procdon = _msk->get(F_PROCDON1);
|
||||
|
||||
// filtro per sezioni selezionati
|
||||
filtra_sezioni();
|
||||
|
||||
// filtro per categorie
|
||||
TString16 catpri = _msk->get(F_CAT1);
|
||||
TString16 catsec = _msk->get(F_CAT2);
|
||||
TString16 catter = _msk->get(F_CAT3);
|
||||
TString16 catqua = _msk->get(F_CAT4);
|
||||
TString16 catqui = _msk->get(F_CAT5);
|
||||
TString16 catses = _msk->get(F_CAT6);
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
_categorie.add((const char*) catpri);
|
||||
if (catsec.not_empty() && catsec.ok())
|
||||
_categorie.add((const char*) catsec);
|
||||
if (catter.not_empty() && catter.ok())
|
||||
_categorie.add((const char*) catter);
|
||||
if (catqua.not_empty() && catqua.ok())
|
||||
_categorie.add((const char*) catqua);
|
||||
if (catqui.not_empty() && catqui.ok())
|
||||
_categorie.add((const char*) catqui);
|
||||
if (catses.not_empty() && catses.ok())
|
||||
_categorie.add((const char*) catses);
|
||||
// filtro per idoneo e non escluso
|
||||
current_cursor()->setfilter("((TCS->S6 == \"I\" ) || (TCS->S6 == \"F\")) && (ESCLUSO == \"\")", TRUE);
|
||||
|
||||
// filtro per procedura di donazione (controllo che abbia la data)
|
||||
/* questo filtro è nella filter_function
|
||||
TString procdon = _msk->get(F_PROCDON1);
|
||||
TString16 procdon = _msk->get(F_PROCDON1);
|
||||
if (procdon == IDON_SI)
|
||||
current_cursor()->setfilter("(DATAPROSSI == \"\")", TRUE);
|
||||
else
|
||||
@ -299,9 +286,9 @@ void TScadenze_application::crea_intestazione()
|
||||
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString sep(132);
|
||||
TString256 sep(132);
|
||||
sep = "SCADENZE DI DONAZIONE ";
|
||||
TString procdon = _msk->get(F_PROCDON1);
|
||||
TString16 procdon = _msk->get(F_PROCDON1);
|
||||
sep << procdon ;
|
||||
TDate data = _msk->get(F_DATAINI);
|
||||
if (data.ok())
|
||||
@ -317,7 +304,7 @@ void TScadenze_application::crea_intestazione()
|
||||
}
|
||||
sep.center_just();
|
||||
set_header(2, "@0g%s", (const char*) sep);
|
||||
TString data_stampa = _data_stampa.string();
|
||||
TString16 data_stampa = _data_stampa.string();
|
||||
set_header(2,"@0g%10s", (const char*) data_stampa);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
|
Loading…
x
Reference in New Issue
Block a user