sviluppo nuove richieste e correzione errori

git-svn-id: svn://10.65.10.50/trunk@5021 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
cris 1997-08-01 14:49:53 +00:00
parent 5504f0c412
commit 07036fc2b0
97 changed files with 3757 additions and 1733 deletions

File diff suppressed because it is too large Load Diff

View File

@ -68,7 +68,7 @@ END
STRING F_LUOGOGEN 4
BEGIN
PROMPT 2 9 "Luogo don. "
PROMPT 2 9 "Punto prel."
FLAGS "U"
USE LDN
INPUT CODTAB F_LUOGOGEN
@ -77,8 +77,8 @@ BEGIN
OUTPUT F_LUOGOGEN CODTAB
OUTPUT F_D_LUOGOGEN S0
CHECKTYPE NORMAL
WARNING "Codice luogo donazione non presente"
HELP "Luogo donazione"
WARNING "Codice punto di prelievo non presente"
HELP "Punto di prelievo"
END
STRING F_D_LUOGOGEN 25
@ -97,7 +97,7 @@ BEGIN
PROMPT 50 2 ""
ITEM "Data@10"
ITEM "Tipo"
ITEM "Luogo"
ITEM "Punto"
END
ENDPAGE
@ -129,7 +129,7 @@ END
STRING F_G_LUOGO 4
BEGIN
PROMPT 2 5 "Luogo donazione "
PROMPT 2 5 "Punto prelievo "
FLAGS "U"
USE LDN
INPUT CODTAB F_G_LUOGO
@ -138,8 +138,8 @@ BEGIN
OUTPUT F_G_LUOGO CODTAB
OUTPUT F_G_D_LUOGO S0
CHECKTYPE NORMAL
WARNING "Codice luogo donazione non presente"
HELP "Luogo donazione"
WARNING "Codice punto di prelievo non presente"
HELP "Punto di prelievo"
END
STRING F_G_D_TIPO 25

View File

@ -27,7 +27,7 @@
#define ALIAS_CTD 100
class TDonaz_app : public TApplication
class TGiornalieroDC : public TApplication
{
TMask* _msk;
TRelation* _rel;
@ -40,6 +40,11 @@ class TDonaz_app : public TApplication
TRecord_array* _scontrolli;
TAssoc_array* _asoggetti; // array dei soggetti inseriti per controllare doppio ins.
bool _modified;
long _progins;
// parametri di sezione
int _numdon1, _numdon2;
TString16 _catini1, _catfin1, _catini2, _catfin2;
bool _sttess2, _dataisc;
protected:
@ -54,18 +59,19 @@ protected:
bool check_sog_sheet(const char* codsog);
static bool nome_handler(TMask_field& f, KEY k);
static bool codice_handler(TMask_field& f, KEY k);
static bool soggetti_notify(TSheet_field& s, int r, KEY k);
void add_rows_soggetti(TSheet_field& s, int count = 20, int start = 0);
static bool ins_controlli_handler(TMask_field& f, KEY k);
public:
TDonaz_app() {}
TGiornalieroDC() {}
};
HIDDEN inline TDonaz_app& app() { return (TDonaz_app&) main_app(); }
HIDDEN inline TGiornalieroDC& app() { return (TGiornalieroDC&) main_app(); }
bool TDonaz_app::ins_controlli_handler(TMask_field& f, KEY k)
bool TGiornalieroDC::ins_controlli_handler(TMask_field& f, KEY k)
{
if (k == K_SPACE)
{
@ -77,16 +83,17 @@ bool TDonaz_app::ins_controlli_handler(TMask_field& f, KEY k)
return TRUE;
}
void TDonaz_app::add_rows_soggetti(TSheet_field& s, int count, int start)
void TGiornalieroDC::add_rows_soggetti(TSheet_field& s, int count, int start)
{
if (start == 0)
s.destroy();
for (int r=start; r<=start+count-1; r++)
TToken_string& row = s.row(r);
s.row(r);
}
bool TDonaz_app::create()
bool TGiornalieroDC::create()
{
TApplication::create();
_modified = FALSE;
_msk = new TMask("at0200a");
_rel = new TRelation(LF_SOGGETTI);
@ -97,19 +104,29 @@ bool TDonaz_app::create()
_sdonazioni = new TRecord_array(LF_DONAZ,DON_PROGDON);
_scontrolli = new TRecord_array(LF_CONTSAN,CON_PROGCON);
_asoggetti = new TAssoc_array();
_msk->set_handler(F_INS_CONTROLLI,ins_controlli_handler);
TSheet_field& ss = (TSheet_field&)_msk->field(F_SOGGETTI);
ss.set_notify(soggetti_notify);
ss.sheet_mask().set_handler(F_S_NOME,nome_handler);
ss.sheet_mask().set_handler(F_S_CODICE,codice_handler);
TConfig config(CONFIG_STUDIO);
_numdon1 = config.get_int("NumDon1");
_numdon2 = config.get_int("NumDon2");
_catini1 = config.get("CatIni1");
_catfin1 = config.get("CatFin1");
_catini2 = config.get("CatIni2");
_catfin2 = config.get("CatFin2");
_sttess2 = config.get_bool("StTess2");
_dataisc = config.get_bool("DataIsc");
_donaz->setkey(3);
_donaz->last();
_progins = _donaz->get_long(DON_PROGINS);
_donaz->setkey(1);
dispatch_e_menu(BAR_ITEM(1));
return TRUE;
}
bool TDonaz_app::destroy()
bool TGiornalieroDC::destroy()
{
delete _rel;
delete _msk;
@ -119,10 +136,10 @@ bool TDonaz_app::destroy()
delete _sdonazioni;
delete _scontrolli;
delete _asoggetti;
return TRUE;
return TApplication::destroy();
}
bool TDonaz_app::menu(MENU_TAG m)
bool TGiornalieroDC::menu(MENU_TAG m)
{
TMask& msk = get_mask();
const TDate oggi(TODAY);
@ -130,8 +147,9 @@ bool TDonaz_app::menu(MENU_TAG m)
do
{
TSheet_field& s = (TSheet_field&)msk.field(F_SOGGETTI);
s.reset();
add_rows_soggetti(s);
//s.reset();
if (s.items() == 0)
add_rows_soggetti(s);
_asoggetti->destroy();
msk.set(F_DATADON,oggi);
tasto = msk.run();
@ -141,21 +159,23 @@ bool TDonaz_app::menu(MENU_TAG m)
{
if (_modified)
if (yesno_box("Registrare le modifiche?"))
TDonaz_app::write(s);
TGiornalieroDC::write(s);
_modified = FALSE;
msk.reset();
}
break;
case K_SAVE: // registra
{
TDonaz_app::write(s);
TGiornalieroDC::write(s);
_modified = FALSE;
msk.reset();
msk.reset(); //verificare se va tolta
}
break;
case K_INS: // nuovo
{
TDonaz_app::write(s);
if (_modified)
if (yesno_box("Registrare le modifiche?"))
TGiornalieroDC::write(s);
_modified = FALSE;
msk.reset();
}
@ -164,7 +184,7 @@ bool TDonaz_app::menu(MENU_TAG m)
{
if (_modified)
if (yesno_box("Registrare le modifiche?"))
TDonaz_app::write(s);
TGiornalieroDC::write(s);
msk.reset();
_modified = FALSE;
}
@ -175,7 +195,7 @@ bool TDonaz_app::menu(MENU_TAG m)
return FALSE;
}
int TDonaz_app::write(TSheet_field& s)
int TGiornalieroDC::write(TSheet_field& s)
{
const TMask& m = s.mask();
@ -186,17 +206,14 @@ int TDonaz_app::write(TSheet_field& s)
pi = new TProgind(items,"Registrazione donazioni e controlli", FALSE, TRUE, 10);
pi->setstatus(1);
TLocalisamfile& sog = get_relation()->lfile();
TLocalisamfile& rconv(LF_RCONVOC);
TLocalisamfile rconv(LF_RCONVOC);
for (int r=1; r<=s.items(); r++)
{
pi->addstatus(1);
TToken_string& row = s.row(r-1);
const long codsog = row.get_long(0);
if (codsog != 0)
{
//TLocalisamfile& sog = get_relation()->lfile();
sog.setkey(1);
sog.zero();
sog.put(SOG_CODICE, codsog);
@ -251,7 +268,7 @@ int TDonaz_app::write(TSheet_field& s)
if (!exist)
_scontrolli->write(TRUE);
}
_progins++;
TRectype* rec = new TRectype(LF_DONAZ);
rec->put(DON_CODICE, row.get(0));
rec->put(DON_DATADON, m.get(F_DATADON));
@ -261,6 +278,7 @@ int TDonaz_app::write(TSheet_field& s)
rec->put(DON_CODSEZ,sog.get(SOG_CODSEZ));
rec->put(DON_CODSOT,sog.get(SOG_CODSOT));
rec->put(DON_PROGINS,_progins);
bool insert = FALSE;
bool exist = FALSE;
@ -318,7 +336,7 @@ int TDonaz_app::write(TSheet_field& s)
int err = rconv.read();
if (err == NOERR)
{
rconv.put(RCV_ANNULLATO,TRUE)
rconv.put(RCV_ANNULLATO,TRUE);
rconv.rewrite();
}
sog.put(SOG_DATACONV, NULLDATE);
@ -440,7 +458,23 @@ int TDonaz_app::write(TSheet_field& s)
bool dimissione = ctd.get_bool("B0");
if (dimissione)
sog.put(SOG_CATDON,ctd.get("S6"));
else
{
if ((catdon == _catini1 || _catini1.empty()) && (totdon+1>=_numdon1) && _catfin1.not_empty())
sog.put(SOG_CATDON, _catfin1);
if ((catdon == _catini2 || _catini2.empty()) && (totdon+1>=_numdon2) && _catfin2.not_empty() && !_sttess2)
sog.put(SOG_CATDON, _catfin2);
}
// per bologna
// if (catdon == "06")
// sog.put(SOG_CATDON,"04");
}
TDate dataisc = sog.get_date(SOG_DATAISC);
if (dataisc.empty() && _dataisc)
{
const TRectype& riga = _sdonazioni->row(1);
sog.put(SOG_DATAISC,riga.get(DON_DATADON));
}
// aggiorno data e utente ultimo aggiornamento
sog.put(SOG_DATAULTAGG,TODAY);
@ -457,7 +491,7 @@ int TDonaz_app::write(TSheet_field& s)
return NOERR;
}
bool TDonaz_app::check_sog_sheet(const char* codsog)
bool TGiornalieroDC::check_sog_sheet(const char* codsog)
{
TAssoc_array& array_sogg = app().get_array_sogg();
if (array_sogg.is_key(codsog))
@ -466,7 +500,7 @@ bool TDonaz_app::check_sog_sheet(const char* codsog)
return TRUE;
}
bool TDonaz_app::soggetti_notify(TSheet_field& s, int r, KEY k)
bool TGiornalieroDC::soggetti_notify(TSheet_field& s, int r, KEY k)
{
bool ok = TRUE;
switch (k)
@ -479,24 +513,28 @@ bool TDonaz_app::soggetti_notify(TSheet_field& s, int r, KEY k)
break;
case K_TAB:
// entrata riga
{
if ((r == s.items()-1) && (r == s.first_empty()))
{
app().add_rows_soggetti(s,10,r+1);
s.select(r);
}
TToken_string& row = s.row(r);
if (row.empty_items())
s.set_focus_cell(r,1);
{
static bool entering = TRUE;
if (entering)
{
entering = FALSE;
if ((r == s.items()-1) && (r == s.first_empty()))
app().add_rows_soggetti(s,10,r+1);
TToken_string& row = s.row(r);
if (row.empty_items())
s.select(r);
entering = TRUE;
}
}
break;
case K_ENTER:
// uscita da riga modificata
case K_CTRL+K_TAB:
// uscita riga
{
app()._modified = TRUE;
{
TToken_string& row = s.row(r);
if (!row.empty_items())
app()._modified = TRUE;
const long codsog = row.get_long(0);
if (codsog != 0)
for (int i=s.items()-1; i>=0; i--)
@ -512,16 +550,8 @@ bool TDonaz_app::soggetti_notify(TSheet_field& s, int r, KEY k)
{
const char* cognome = row.get(1);
if ((cognome != NULL) && (cognome != "\0"))
{
s.sheet_mask().field(F_S_NOME).set_focusdirty();
s.set_focus_cell(r,2);
}
}
s.force_update(r);
if (r == s.items()-1)
{
app().add_rows_soggetti(s,10,r+1);
s.select(r);
//s.set_focus_cell(r,2);
}
}
break;
@ -529,10 +559,9 @@ bool TDonaz_app::soggetti_notify(TSheet_field& s, int r, KEY k)
return ok;
}
bool TDonaz_app::nome_handler(TMask_field& f, KEY k)
bool TGiornalieroDC::nome_handler(TMask_field& f, KEY k)
{
bool ok = TRUE;
//if (k == K_TAB && f.focusdirty())
if (f.to_check(k))
{
TMask& m = f.mask();
@ -543,10 +572,41 @@ bool TDonaz_app::nome_handler(TMask_field& f, KEY k)
return ok;
}
bool TGiornalieroDC::codice_handler(TMask_field& f, KEY k)
{
bool ok = TRUE;
if (f.to_check(k))
{
TMask& m = f.mask();
long codsog = m.get_long(F_S_CODICE);
if (codsog != 0)
{
TLocalisamfile& sog = app().get_relation()->lfile();
sog.setkey(1);
sog.zero();
sog.put(SOG_CODICE, codsog);
int err = sog.read();
if (err == NOERR)
{
m.set(F_S_COGNOME, sog.get(SOG_COGNOME));
m.set(F_S_NOME, sog.get(SOG_NOME));
m.set(F_S_DATANASC, sog.get(SOG_DATANASC));
m.set(F_S_TESSAVIS, sog.get(SOG_TESSAVIS));
m.set(F_S_CODSEZ, sog.get(SOG_CODSEZ));
m.set(F_S_CODSOT, sog.get(SOG_CODSOT));
m.set(F_S_CATDON, sog.get(SOG_CATDON));
}
else
ok = FALSE; // codice non esistente
}
}
return ok;
}
int at0200(int argc, char* argv[])
{
TDonaz_app a;
TGiornalieroDC a;
a.run(argc, argv, "Giornaliero donazioni/controlli");
return 0;
}

View File

@ -2,14 +2,14 @@
// GIORNALIERO DONAZIONI/CONTROLLI
// dati fissi
#define F_DATADON 101
#define F_TIPODON 102
#define F_LUOGODON 103
#define F_DESC_TIPODON 104
#define F_DESC_LUOGODON 105
#define F_INS_CONTROLLI 106
#define F_DATADON 201
#define F_TIPODON 202
#define F_LUOGODON 203
#define F_DESC_TIPODON 204
#define F_DESC_LUOGODON 205
#define F_INS_CONTROLLI 206
// spreadsheet
#define F_SOGGETTI 107
#define F_SOGGETTI 207
// pagina soggetti
#define F_S_CODICE 101

View File

@ -2,10 +2,10 @@
#include "lf.h"
TOOLBAR "" 0 20 0 2
BUTTON DLG_SAVEREC 10 2
BEGIN
PROMPT -14 -11 "~Registra"
PROMPT -15 -11 "~Registra"
MESSAGE EXIT,K_SAVE
PICTURE BMP_SAVEREC
PICTURE BMP_SAVERECDN
@ -13,7 +13,7 @@ END
BUTTON DLG_NEWREC 10 2
BEGIN
PROMPT -24 -11 "~Nuovo"
PROMPT -25 -11 "~Nuovo"
MESSAGE EXIT,K_INS
PICTURE BMP_NEWREC
PICTURE BMP_NEWRECDN
@ -21,14 +21,20 @@ END
BUTTON DLG_CANCEL 10 2
BEGIN
PROMPT -34 -11 "~Annulla"
PROMPT -35 -11 "~Annulla"
MESSAGE EXIT,K_ESC
PICTURE 102
END
BUTTON DLG_PRINT 10 2
BEGIN
PROMPT -45 -11 "~Stampa"
MESSAGE RUN,at6,-2
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT -44 -11 "~Fine"
PROMPT -55 -11 "~Fine"
MESSAGE EXIT,K_QUIT
PICTURE BMP_QUIT
PICTURE BMP_QUITDN
@ -38,7 +44,6 @@ ENDPAGE
PAGE "Giornaliero donazioni/controlli" -1 -1 78 20
GROUPBOX DLG_NULL 77 6
BEGIN
PROMPT 1 0 "Dati fissi"
@ -49,7 +54,6 @@ DATE F_DATADON
BEGIN
PROMPT 2 1 "Data donazione "
VALIDATE NOT_EMPTY_FUNC
CHECKTYPE REQUIRED
HELP "Data donazione"
END
@ -71,7 +75,7 @@ END
STRING F_LUOGODON 4
BEGIN
PROMPT 2 3 "Luogo donazione "
PROMPT 2 3 "Punto prelievo "
FLAGS "U"
USE LDN
INPUT CODTAB F_LUOGODON
@ -81,7 +85,7 @@ BEGIN
OUTPUT F_DESC_LUOGODON S0
CHECKTYPE NORMAL
WARNING "Codice non presente"
HELP "Luogo donazione"
HELP "Punto di prelievo"
END
STRING F_DESC_TIPODON 30
@ -142,6 +146,8 @@ BEGIN
DISPLAY "Sot." CODSOT
DISPLAY "C." CATDON
DISPLAY "Tessera" TESSAVIS
DISPLAY "Gr.AB0" GRUPPOAB0
DISPLAY "Rh " RHANTID
OUTPUT F_S_CODICE CODICE
OUTPUT F_S_COGNOME COGNOME
OUTPUT F_S_NOME NOME
@ -150,8 +156,8 @@ BEGIN
OUTPUT F_S_CODSOT CODSOT
OUTPUT F_S_CATDON CATDON
OUTPUT F_S_TESSAVIS TESSAVIS
CHECKTYPE NORMAL
ADD RUN at0 -0
// CHECKTYPE NORMAL
// ADD RUN at0 -0
END
STRING F_S_COGNOME 25
@ -159,7 +165,6 @@ BEGIN
PROMPT 2 2 "Cognome e nome "
USE LF_SOGGETTI KEY 2
INPUT COGNOME F_S_COGNOME
//INPUT NOME F_S_NOME
DISPLAY "Cognome@25" COGNOME
DISPLAY "Nome@25" NOME
DISPLAY "Nato il@10" DATANASC
@ -168,10 +173,19 @@ BEGIN
DISPLAY "Sot." CODSOT
DISPLAY "C." CATDON
DISPLAY "Tessera" TESSAVIS
COPY OUTPUT F_S_CODICE
CHECKTYPE SEARCH
DISPLAY "Gr.AB0" GRUPPOAB0
DISPLAY "Rh " RHANTID
OUTPUT F_S_CODICE CODICE
OUTPUT F_S_COGNOME COGNOME
OUTPUT F_S_NOME NOME
OUTPUT F_S_DATANASC DATANASC
OUTPUT F_S_CODSEZ CODSEZ
OUTPUT F_S_CODSOT CODSOT
OUTPUT F_S_CATDON CATDON
OUTPUT F_S_TESSAVIS TESSAVIS
HELP "Cognome del soggetto"
ADD RUN at0 -0
// CHECKTYPE NORMAL
// ADD RUN at0 -0
END
STRING F_S_NOME 25
@ -180,11 +194,27 @@ BEGIN
USE LF_SOGGETTI KEY 2
INPUT COGNOME F_S_COGNOME
INPUT NOME F_S_NOME
COPY DISPLAY F_S_COGNOME
COPY OUTPUT F_S_COGNOME
CHECKTYPE SEARCH
DISPLAY "Cognome@25" COGNOME
DISPLAY "Nome@25" NOME
DISPLAY "Nato il@10" DATANASC
DISPLAY "Codice@8" CODICE
DISPLAY "Sez." CODSEZ
DISPLAY "Sot." CODSOT
DISPLAY "C." CATDON
DISPLAY "Tessera" TESSAVIS
DISPLAY "Gr.AB0" GRUPPOAB0
DISPLAY "Rh " RHANTID
OUTPUT F_S_CODICE CODICE
OUTPUT F_S_COGNOME COGNOME
OUTPUT F_S_NOME NOME
OUTPUT F_S_DATANASC DATANASC
OUTPUT F_S_CODSEZ CODSEZ
OUTPUT F_S_CODSOT CODSOT
OUTPUT F_S_CATDON CATDON
OUTPUT F_S_TESSAVIS TESSAVIS
HELP "Nome del soggetto"
ADD RUN at0 -0
// CHECKTYPE NORMAL
// ADD RUN at0 -0
END
GROUPBOX DLG_NULL 77 9

View File

@ -26,7 +26,7 @@
#define ALIAS_CTD 100
class TContsan_app : public TApplication
class TGiornalieroC : public TApplication
{
TMask* _msk;
TRelation* _rel;
@ -51,27 +51,29 @@ protected:
bool check_sog_sheet(const char* codsog);
static bool nome_handler(TMask_field& f, KEY k);
static bool codice_handler(TMask_field& f, KEY k);
static bool tipocon_handler(TMask_field& f, KEY k);
static bool soggetti_notify(TSheet_field& s, int r, KEY k);
void add_rows_soggetti(TSheet_field& s, int count = 20, int start = 0);
public:
TContsan_app() {}
TGiornalieroC() {}
};
HIDDEN inline TContsan_app& app() { return (TContsan_app&) main_app(); }
HIDDEN inline TGiornalieroC& app() { return (TGiornalieroC&) main_app(); }
void TContsan_app::add_rows_soggetti(TSheet_field& s, int count, int start)
void TGiornalieroC::add_rows_soggetti(TSheet_field& s, int count, int start)
{
if (start == 0)
s.destroy();
for (int r=start; r<=start+count-1; r++)
TToken_string& row = s.row(r);
s.row(r);
}
bool TContsan_app::create()
bool TGiornalieroC::create()
{
TApplication::create();
_modified = FALSE;
_msk = new TMask("at0300a");
_rel = new TRelation(LF_SOGGETTI);
@ -86,6 +88,8 @@ bool TContsan_app::create()
ss.set_notify(soggetti_notify);
ss.sheet_mask().set_handler(F_S_NOME,nome_handler);
ss.sheet_mask().set_handler(F_S_CODICE,codice_handler);
//ss.sheet_mask().set_handler(F_S_TIPOCON,tipocon_handler);
dispatch_e_menu(BAR_ITEM(1));
@ -93,7 +97,7 @@ bool TContsan_app::create()
return TRUE;
}
bool TContsan_app::destroy()
bool TGiornalieroC::destroy()
{
delete _rel;
delete _msk;
@ -102,10 +106,10 @@ bool TContsan_app::destroy()
delete _sdonazioni;
delete _scontrolli;
delete _asoggetti;
return TRUE;
return TApplication::destroy();
}
bool TContsan_app::menu(MENU_TAG m)
bool TGiornalieroC::menu(MENU_TAG m)
{
TMask& msk = get_mask();
const TDate oggi(TODAY);
@ -113,8 +117,9 @@ bool TContsan_app::menu(MENU_TAG m)
do
{
TSheet_field& s = (TSheet_field&)msk.field(F_SOGGETTI);
s.reset();
add_rows_soggetti(s);
//s.reset();
if (s.items() == 0)
add_rows_soggetti(s);
_asoggetti->destroy();
msk.set(F_DATACON,oggi);
tasto = msk.run();
@ -124,21 +129,23 @@ bool TContsan_app::menu(MENU_TAG m)
{
if (_modified)
if (yesno_box("Registrare le modifiche?"))
TContsan_app::write(s);
TGiornalieroC::write(s);
_modified = FALSE;
msk.reset();
}
break;
case K_SAVE: // registra
{
TContsan_app::write(s);
TGiornalieroC::write(s);
_modified = FALSE;
msk.reset();
}
break;
case K_INS: // nuovo
{
TContsan_app::write(s);
{
if (_modified)
if (yesno_box("Registrare le modifiche?"))
TGiornalieroC::write(s);
_modified = FALSE;
msk.reset();
}
@ -147,7 +154,7 @@ bool TContsan_app::menu(MENU_TAG m)
{
if (_modified)
if (yesno_box("Registrare le modifiche?"))
TContsan_app::write(s);
TGiornalieroC::write(s);
msk.reset();
_modified = FALSE;
}
@ -158,7 +165,7 @@ bool TContsan_app::menu(MENU_TAG m)
return FALSE;
}
int TContsan_app::write(TSheet_field& s)
int TGiornalieroC::write(TSheet_field& s)
{
const TMask& m = s.mask();
@ -248,7 +255,7 @@ int TContsan_app::write(TSheet_field& s)
return NOERR;
}
bool TContsan_app::check_sog_sheet(const char* codsog)
bool TGiornalieroC::check_sog_sheet(const char* codsog)
{
TAssoc_array& array_sogg = app().get_array_sogg();
if (array_sogg.is_key(codsog))
@ -257,7 +264,7 @@ bool TContsan_app::check_sog_sheet(const char* codsog)
return TRUE;
}
bool TContsan_app::soggetti_notify(TSheet_field& s, int r, KEY k)
bool TGiornalieroC::soggetti_notify(TSheet_field& s, int r, KEY k)
{
bool ok = TRUE;
switch (k)
@ -271,16 +278,16 @@ bool TContsan_app::soggetti_notify(TSheet_field& s, int r, KEY k)
case K_TAB:
// entrata riga
{
if (r > 1)
static bool entering = TRUE;
if (entering)
{
entering = FALSE;
if ((r == s.items()-1) && (r == s.first_empty()))
{
app().add_rows_soggetti(s,10,r+1);
s.select(r);
}
TToken_string& row = s.row(r);
if (row.empty_items())
s.set_focus_cell(r,1);
if (row.empty_items())
s.select(r);
entering = TRUE;
}
}
break;
@ -289,8 +296,9 @@ bool TContsan_app::soggetti_notify(TSheet_field& s, int r, KEY k)
case K_CTRL+K_TAB:
// uscita riga
{
app()._modified = TRUE;
TToken_string& row = s.row(r);
if (!row.empty_items())
app()._modified = TRUE;
const long codsog = row.get_long(0);
if (codsog != 0)
for (int i=s.items()-1; i>=0; i--)
@ -306,16 +314,8 @@ bool TContsan_app::soggetti_notify(TSheet_field& s, int r, KEY k)
{
const char* cognome = row.get(1);
if ((cognome != NULL) && (cognome != "\0"))
{
s.sheet_mask().field(F_S_NOME).set_focusdirty();
s.set_focus_cell(r,2);
}
}
s.force_update(r);
if (r == s.items()-1)
{
app().add_rows_soggetti(s,10,r+1);
s.select(r);
//s.set_focus_cell(r,2);
}
}
break;
@ -323,10 +323,9 @@ bool TContsan_app::soggetti_notify(TSheet_field& s, int r, KEY k)
return ok;
}
bool TContsan_app::nome_handler(TMask_field& f, KEY k)
bool TGiornalieroC::nome_handler(TMask_field& f, KEY k)
{
bool ok = TRUE;
//if (k == K_TAB && f.focusdirty())
if (f.to_check(k))
{
TMask& m = f.mask();
@ -337,7 +336,38 @@ bool TContsan_app::nome_handler(TMask_field& f, KEY k)
return ok;
}
bool TContsan_app::tipocon_handler(TMask_field& f, KEY k)
bool TGiornalieroC::codice_handler(TMask_field& f, KEY k)
{
bool ok = TRUE;
if (f.to_check(k))
{
TMask& m = f.mask();
long codsog = m.get_long(F_S_CODICE);
if (codsog != 0)
{
TLocalisamfile& sog = app().get_relation()->lfile();
sog.setkey(1);
sog.zero();
sog.put(SOG_CODICE, codsog);
int err = sog.read();
if (err == NOERR)
{
m.set(F_S_COGNOME, sog.get(SOG_COGNOME));
m.set(F_S_NOME, sog.get(SOG_NOME));
m.set(F_S_DATANASC, sog.get(SOG_DATANASC));
m.set(F_S_TESSAVIS, sog.get(SOG_TESSAVIS));
m.set(F_S_CODSEZ, sog.get(SOG_CODSEZ));
m.set(F_S_CODSOT, sog.get(SOG_CODSOT));
m.set(F_S_CATDON, sog.get(SOG_CATDON));
}
else
ok = FALSE; // codice non esistente
}
}
return ok;
}
bool TGiornalieroC::tipocon_handler(TMask_field& f, KEY k)
{
bool ok = TRUE;
if (k == K_TAB && !f.focusdirty())
@ -360,7 +390,7 @@ bool TContsan_app::tipocon_handler(TMask_field& f, KEY k)
int at0300(int argc, char* argv[])
{
TContsan_app a;
TGiornalieroC a;
a.run(argc, argv, "Giornaliero controlli");
return 0;
}

View File

@ -2,15 +2,15 @@
// GIORNALIERO CONTROLLI
// dati fissi
#define F_DATACON 101
#define F_TIPOCON 102
#define F_PROSSTIPO 103
#define F_PROSSDATA 104
#define F_DESC_TIPOCON 105
#define F_DESC_PROSSTIPO 106
#define F_DATACON 201
#define F_TIPOCON 202
#define F_PROSSTIPO 203
#define F_PROSSDATA 204
#define F_DESC_TIPOCON 205
#define F_DESC_PROSSTIPO 206
// spreadsheet
#define F_SOGGETTI 107
#define F_SOGGETTI 207
// pagina soggetti
#define F_S_CODICE 101

View File

@ -151,8 +151,8 @@ BEGIN
OUTPUT F_S_CODSOT CODSOT
OUTPUT F_S_CATDON CATDON
OUTPUT F_S_TESSAVIS TESSAVIS
CHECKTYPE NORMAL
ADD RUN at0 -0
//CHECKTYPE NORMAL
//ADD RUN at0 -0
END
STRING F_S_COGNOME 25
@ -170,9 +170,9 @@ BEGIN
DISPLAY "C." CATDON
DISPLAY "Tessera" TESSAVIS
COPY OUTPUT F_S_CODICE
CHECKTYPE SEARCH
HELP "Cognome del soggetto"
ADD RUN at0 -0
//CHECKTYPE SEARCH
//ADD RUN at0 -0
END
STRING F_S_NOME 25
@ -183,9 +183,9 @@ BEGIN
INPUT NOME F_S_NOME
COPY DISPLAY F_S_COGNOME
COPY OUTPUT F_S_COGNOME
CHECKTYPE SEARCH
HELP "Nome del soggetto"
ADD RUN at0 -0
//CHECKTYPE SEARCH
//ADD RUN at0 -0
END
GROUPBOX DLG_NULL 77 9

View File

@ -24,7 +24,7 @@
#define IDON_SI "SI"
#define IDON_AF "AF"
class TConvoc_app: public TRelation_application
class TGestioneConvocazioni: public TRelation_application
{
static bool filter_func_convoc(const TRelation* rel);
@ -38,7 +38,7 @@ class TConvoc_app: public TRelation_application
long _lastcod; // progressivo convocazione da assegnare
long _numero; // numero convocazione
TDate _data; // data convocazione
TString16 _punto; // punto di raccolta
TString16 _punto; // punto di prelievo
TString16 _tipo; // tipo donazione
TString16 _codsez; // codice sezione convocata
TString16 _codsot; // codice sottogruppo
@ -64,13 +64,13 @@ protected:
static bool data_handler(TMask_field&f, KEY k);
public:
TConvoc_app() {}
TGestioneConvocazioni() {}
};
HIDDEN inline TConvoc_app& app() { return (TConvoc_app&) main_app(); }
HIDDEN inline TGestioneConvocazioni& app() { return (TGestioneConvocazioni&) main_app(); }
bool TConvoc_app::filter_func_convoc(const TRelation* rel)
bool TGestioneConvocazioni::filter_func_convoc(const TRelation* rel)
{
bool filtrato = FALSE;
TRectype& sog = rel->curr();
@ -130,7 +130,7 @@ bool TConvoc_app::filter_func_convoc(const TRelation* rel)
return filtrato;
}
bool TConvoc_app::data_handler(TMask_field& f, KEY k)
bool TGestioneConvocazioni::data_handler(TMask_field& f, KEY k)
{
if (f.to_check(k))
{
@ -166,13 +166,12 @@ bool TConvoc_app::data_handler(TMask_field& f, KEY k)
return TRUE;
}
bool TConvoc_app::esegui_handler(TMask_field& f, KEY k)
bool TGestioneConvocazioni::esegui_handler(TMask_field& f, KEY k)
{
if (k == K_SPACE)
{
TMask& m = f.mask();
TCursor* cur = app()._cur;
app()._numero = m.get_long(F_NUMERO);
app()._data = m.get(F_DATA);
app()._punto = m.get(F_PUNTO);
@ -182,10 +181,8 @@ bool TConvoc_app::esegui_handler(TMask_field& f, KEY k)
app()._dataini = m.get(F_DATAINI);
app()._ritarda = m.get_bool(F_RITARDA);
app()._maxrit = m.get_int(F_MAXRIT);
if (app()._numero == 0 || !app()._data.ok() || app()._punto.empty() || app()._tipo.empty())
return f.error_box("Mancano i dati fondamentali per la convocazione");
// filtro per sezione
//TRectype da(LF_SOGGETTI);
//if (app()._codsez.not_empty())
@ -198,7 +195,7 @@ bool TConvoc_app::esegui_handler(TMask_field& f, KEY k)
// filtro per categoria donatori non vuota e non dimessi
// e non escluso e idoneo
//filtro.format("(CATDON != \"\") && (%d->B0 == \"\") && (ESCLUSO == \"\") && ((%d->S6 == \"I\" ) || (%d->S6 == \"F\"))",ALIAS_CTD,ALIAS_TCS,ALIAS_TCS);
// filtro per punto di raccolta
// filtro per punto di prelievo
//filtro << " && ";
//if (app()._codsez.empty())
// filtro << format("(PUNTORACC == \"%s\")",(const char*)app()._punto);
@ -221,14 +218,11 @@ bool TConvoc_app::esegui_handler(TMask_field& f, KEY k)
da.put(SOG_DATAPROSSI,datalimite);
a.put(SOG_DATAPROSSI,data);
cur->setregion(da, a);
cur->set_filterfunction(filter_func_convoc, TRUE);
TSheet_field& s = (TSheet_field&)m.field(F_CONVOCATI);
s.destroy();
TRectype& rec = cur->curr();
TRectype& sez = cur->curr(LF_SEZIONI);
int nconv=0;
int nsoll=0;
int nrit=0;
@ -329,7 +323,7 @@ bool TConvoc_app::esegui_handler(TMask_field& f, KEY k)
return TRUE;
}
bool TConvoc_app::user_create()
bool TGestioneConvocazioni::user_create()
{
_msk = new TMask("at0400a");
_rel = new TRelation(LF_CONVOC);
@ -337,7 +331,8 @@ bool TConvoc_app::user_create()
_relsog->add("CTD", "CODTAB==CATDON",1,0,-ALIAS_CTD);
_relsog->add("TCS", "CODTAB==STATO",1,0,-ALIAS_TCS);
_relsog->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
_cur = new TCursor(_relsog, "", 6); //cursore ordinamento per data prossima donazione
// ordinamento per data prossima donazione
_cur = new TCursor(_relsog, "", 5);
_rconvoc = new TLocalisamfile(LF_RCONVOC);
_soggetti = new TLocalisamfile(LF_SOGGETTI);
_sconvocati = new TRecord_array(LF_RCONVOC,RCV_PROGCONV);
@ -345,13 +340,12 @@ bool TConvoc_app::user_create()
_msk->set_handler(F_DATA,data_handler);
TSheet_field& sc = (TSheet_field&)_msk->field(F_CONVOCATI);
sc.set_notify(convocati_notify);
//TMask& scmask = sc.sheet_mask();
_rel->lfile().last();
_lastcod = _rel->lfile().get_long(COV_NUMERO);
return TRUE;
}
bool TConvoc_app::user_destroy()
bool TGestioneConvocazioni::user_destroy()
{
delete _rel;
delete _relsog;
@ -363,13 +357,13 @@ bool TConvoc_app::user_destroy()
return TRUE;
}
const char* TConvoc_app::get_next_key()
const char* TGestioneConvocazioni::get_next_key()
{
// autonumerazione progressiva delle convocazioni
return format("%d|%ld", F_NUMERO, _lastcod+1 );
}
bool TConvoc_app::remove()
bool TGestioneConvocazioni::remove()
{
// cancella convocati
// cancella testata convocazione
@ -383,7 +377,7 @@ bool TConvoc_app::remove()
return (ok && err == NOERR);
}
int TConvoc_app::read(TMask& m)
int TGestioneConvocazioni::read(TMask& m)
{
int err = TRelation_application::read(m);
if (err == NOERR)
@ -423,19 +417,19 @@ int TConvoc_app::read(TMask& m)
return err;
}
int TConvoc_app::write(const TMask& m)
int TGestioneConvocazioni::write(const TMask& m)
{
long curcod = m.get_long(F_NUMERO);
if (curcod > _lastcod) _lastcod = curcod;
return TConvoc_app::scrivi(m, FALSE);
return TGestioneConvocazioni::scrivi(m, FALSE);
}
int TConvoc_app::rewrite(const TMask& m)
int TGestioneConvocazioni::rewrite(const TMask& m)
{
return TConvoc_app::scrivi(m, TRUE);
return TGestioneConvocazioni::scrivi(m, TRUE);
}
int TConvoc_app::scrivi(const TMask& m, bool ri)
int TGestioneConvocazioni::scrivi(const TMask& m, bool ri)
{
// questo trucco è autorizzato dal capo!
//TMask& hmask = (TMask&) m;
@ -483,7 +477,7 @@ int TConvoc_app::scrivi(const TMask& m, bool ri)
return err;
}
bool TConvoc_app::convocati_notify(TSheet_field& s, int r, KEY k)
bool TGestioneConvocazioni::convocati_notify(TSheet_field& s, int r, KEY k)
{
bool result = TRUE;
switch (k)
@ -509,7 +503,7 @@ bool TConvoc_app::convocati_notify(TSheet_field& s, int r, KEY k)
int at0400(int argc, char* argv[])
{
TConvoc_app a;
TGestioneConvocazioni a;
a.run(argc, argv, "Gestione convocazione");
return 0;
}

View File

@ -63,7 +63,7 @@ END
STRING F_PUNTO 4
BEGIN
PROMPT 2 3 "Punto di raccolta "
PROMPT 2 3 "Punto di prelievo "
FIELD PUNTO
FLAGS "U"
USE LDN
@ -74,7 +74,7 @@ BEGIN
OUTPUT F_D_PUNTO S0
CHECKTYPE REQUIRED
WARNING "Codice non presente"
HELP "Punto di raccolta per la convocazione"
HELP "Punto di prelievo per la convocazione"
VALIDATE NOT_EMPTY_FUNC
END

View File

@ -12,11 +12,11 @@
#include "at0.h"
#include "at0500a.h"
class TSpostamento_app : public TPrintapp
class TSpostamentoConv : public TPrintapp
{
TRelation* _rel;
TMask* _msk;
int _cur1;
int _cur;
TLocalisamfile* _rconvoc;
TLocalisamfile* _soggetti;
TDate _dataini, _datafin, _spostadal, _spostaal;
@ -36,12 +36,12 @@ protected:
public:
TMask& app_mask() { return *_msk; }
TSpostamento_app() {}
TSpostamentoConv() {}
};
HIDDEN inline TSpostamento_app& app() { return (TSpostamento_app&) main_app(); }
HIDDEN inline TSpostamentoConv& app() { return (TSpostamentoConv&) main_app(); }
void TSpostamento_app::set_page(int file, int cnt)
void TSpostamentoConv::set_page(int file, int cnt)
{
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"#########"));
@ -56,7 +56,7 @@ void TSpostamento_app::set_page(int file, int cnt)
set_row(3, "");
}
bool TSpostamento_app::preprocess_page(int file, int counter)
bool TSpostamentoConv::preprocess_page(int file, int counter)
{
TDate& data = app()._data;
app()._spostati++;
@ -76,7 +76,7 @@ bool TSpostamento_app::preprocess_page(int file, int counter)
return TRUE;
}
bool TSpostamento_app::set_print(int m)
bool TSpostamentoConv::set_print(int m)
{
KEY tasto;
tasto = _msk->run();
@ -91,7 +91,7 @@ bool TSpostamento_app::set_print(int m)
_spostadal = _msk->get(F_SPOSTADAL);
_spostaal = _msk->get(F_SPOSTAAL);
TString80 filtro = "";
// filtro per punto di raccolta
// filtro per punto di prelievo
if (_punto.not_empty())
{
if (filtro.not_empty())
@ -125,7 +125,7 @@ bool TSpostamento_app::set_print(int m)
da.put(RCV_DATACONV, _dataini);
if (_datafin.ok())
a.put(RCV_DATACONV, _datafin);
_cur1 = add_cursor(new TCursor(_rel,"", 2, &da, &a));
_cur = add_cursor(new TCursor(_rel,"", 2, &da, &a));
// non posso metterlo nel costruttore del tcursor perchè
// non c'è la possibilità di specificare il parametro TRUE che c'è
// nella setfilter
@ -146,7 +146,7 @@ bool TSpostamento_app::set_print(int m)
return FALSE;
}
bool TSpostamento_app::user_create()
bool TSpostamentoConv::user_create()
{
_rel = new TRelation(LF_RCONVOC);
_rel->add(LF_SOGGETTI, "CODICE==CODICE");
@ -161,7 +161,7 @@ bool TSpostamento_app::user_create()
return TRUE;
}
bool TSpostamento_app::user_destroy()
bool TSpostamentoConv::user_destroy()
{
delete _msk;
delete _rel;
@ -170,10 +170,7 @@ bool TSpostamento_app::user_destroy()
int at0500(int argc, char* argv[])
{
TSpostamento_app a;
a.run(argc, argv, "Spostamento convocazioni su punto di raccolta");
TSpostamentoConv a;
a.run(argc, argv, "Spostamento convocazioni");
return 0;
}

View File

@ -4,7 +4,7 @@ PAGE "Spostamento convocazioni" -1 -1 78 20
GROUPBOX DLG_NULL 77 8
BEGIN
PROMPT 1 1 "Convocoazioni da spostare"
PROMPT 1 1 "Convocazioni da spostare"
END
DATE F_DATAINI
@ -19,7 +19,7 @@ END
STRING F_PUNTO 4
BEGIN
PROMPT 2 4 "Punto raccolta "
PROMPT 2 4 "Punto prelievo "
FLAGS "U"
USE LDN
INPUT CODTAB F_PUNTO

View File

@ -16,17 +16,16 @@
#include "storico.h"
#include "sezioni.h"
class TChiusura_app : public TPrintapp
class TChiusuraPeriodica : public TPrintapp
{
static bool filter_func_chiusura(const TRelation* rel);
TMask* _msk;
TRelation* _rel;
int _cur;
TDate _data_chiusura;
TParagraph_string _operazione;
bool _definitiva;
protected:
virtual bool user_create();
@ -34,18 +33,17 @@ protected:
virtual bool set_print(int m);
virtual void set_page(int file, int cnt);
virtual bool preprocess_page(int file, int counter);
virtual TMask& get_mask() { return *_msk; }
public:
void filtra_sezioni();
void crea_intestazione();
TChiusura_app() : _data_chiusura(TODAY), _operazione("",30) {}
TChiusuraPeriodica() : _data_chiusura(TODAY), _operazione("",30) {}
};
HIDDEN inline TChiusura_app& app() { return (TChiusura_app&) main_app(); }
HIDDEN inline TChiusuraPeriodica& app() { return (TChiusuraPeriodica&) main_app(); }
void TChiusura_app::filtra_sezioni()
void TChiusuraPeriodica::filtra_sezioni()
{
const TString16 sezini = _msk->get(F_SEZINI);
const TString16 sotini = _msk->get(F_SOTINI);
@ -65,7 +63,7 @@ void TChiusura_app::filtra_sezioni()
}
bool TChiusura_app::preprocess_page(int file, int counter)
bool TChiusuraPeriodica::preprocess_page(int file, int counter)
{
_operazione = "Nulla";
@ -81,18 +79,27 @@ bool TChiusura_app::preprocess_page(int file, int counter)
const int donemer = recsez.get_int(SEZ_DONEMER);
const TString16 catsog = recsog.get(SOG_CATDON);
if (catsog==cat_estinti || catsog==cat_cancellati)
if ((catsog==cat_estinti && cat_estinti.not_empty())
|| (catsog==cat_cancellati && cat_cancellati.not_empty()))
{
const int totdon = recsog.get_int(SOG_TOTDON);
if (totdon >= donemer && donemer != 0)
{
_operazione = "Passaggio a emeriti";
recsog.put(SOG_CATDON,cat_emeriti);
filesog.rewrite();
if (_definitiva)
{
recsog.put(SOG_CATDON,cat_emeriti);
filesog.rewrite();
}
}
else
{
_operazione = "Cancellato";
filesog.remove();
if (_definitiva)
filesog.remove();
}
}
else
{
@ -103,8 +110,11 @@ bool TChiusura_app::preprocess_page(int file, int counter)
if (dataultdon < _data_chiusura)
{
_operazione = "Passaggio a estinti";
recsog.put(SOG_CATDON,cat_estinti);
filesog.rewrite();
if (_definitiva)
{
recsog.put(SOG_CATDON,cat_estinti);
filesog.rewrite();
}
}
else
_operazione = "Non doveva essere filtrato: data ancora valida";
@ -116,7 +126,7 @@ bool TChiusura_app::preprocess_page(int file, int counter)
}
void TChiusura_app::set_page(int file, int cnt)
void TChiusuraPeriodica::set_page(int file, int cnt)
{
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########"));
set_row(1,"@9g@S", FLD(LF_SOGGETTI,SOG_CATDON));
@ -125,7 +135,7 @@ void TChiusura_app::set_page(int file, int cnt)
set_row(1,"@65g#a", &_operazione);
}
bool TChiusura_app::filter_func_chiusura(const TRelation* rel)
bool TChiusuraPeriodica::filter_func_chiusura(const TRelation* rel)
{
bool filtrato = FALSE;
@ -138,7 +148,8 @@ bool TChiusura_app::filter_func_chiusura(const TRelation* rel)
const int intesti = recsez.get_int(SEZ_INTESTI);
const TString16 catsog = recsog.get(SOG_CATDON);
filtrato = (catsog == cat_estinti || catsog == cat_cancellati);
filtrato = ((catsog == cat_estinti && cat_estinti.not_empty()) ||
(catsog == cat_cancellati && cat_cancellati.not_empty()));
if (!filtrato && catsog != cat_emeriti)
{
TDate dataultdon = recsog.get(SOG_DATAULTDON);
@ -151,12 +162,13 @@ bool TChiusura_app::filter_func_chiusura(const TRelation* rel)
return filtrato;
}
bool TChiusura_app::set_print(int)
bool TChiusuraPeriodica::set_print(int)
{
KEY tasto;
tasto = _msk->run();
if (tasto == K_ENTER)
{
_definitiva = _msk->get_bool(F_DEFINITIVA);
_data_chiusura = _msk->get(F_DATA);
reset_files();
add_file(LF_SOGGETTI);
@ -171,7 +183,7 @@ bool TChiusura_app::set_print(int)
}
void TChiusura_app::crea_intestazione()
void TChiusuraPeriodica::crea_intestazione()
{
reset_header();
@ -184,27 +196,29 @@ void TChiusura_app::crea_intestazione()
sep << "Pag. @#";
sep.right_just(132);
set_header(2,(const char*) sep);
set_header(2,"@0gCHIUSURA PERIODICA ALLA DATA");
if (_definitiva)
set_header(2,"@0gCHIUSURA PERIODICA - DEFINITIVA - ALLA DATA");
else
set_header(2,"@0gCHIUSURA PERIODICA - PROVVISORIA - ALLA DATA");
data_stampa = _data_chiusura.string();
set_header(2,"@30g%10s", (const char*) data_stampa);
set_header(2,"@47g%10s", (const char*) data_stampa);
sep = "";
sep.fill('-');
set_header(3, (const char *) sep);
}
bool TChiusura_app::user_create()
bool TChiusuraPeriodica::user_create()
{
_msk = new TMask("at1100a");
_rel = new TRelation(LF_SOGGETTI);
_rel->add(LF_SEZIONI,"CODSEZ==CODSEZ|CODSOT==CODSOT");
_cur = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
//cursore ordinamento per sezione+sottogruppo+cognome+nome
_cur = add_cursor(new TCursor(_rel, "", 3));
return TRUE;
}
bool TChiusura_app::user_destroy()
bool TChiusuraPeriodica::user_destroy()
{
delete _rel;
delete _msk;
@ -213,7 +227,7 @@ bool TChiusura_app::user_destroy()
int at1100(int argc, char* argv[])
{
TChiusura_app a;
TChiusuraPeriodica a;
a.run(argc, argv, "Chiusura periodica");
return 0;
}

View File

@ -10,3 +10,4 @@
#define F_SOTFIN 107
#define F_D_SOTFIN 108
#define F_DATA 109
#define F_DEFINITIVA 110

View File

@ -1,6 +1,6 @@
#include "at1100a.h"
#include "lf.h"
PAGE "Chiusura annuale" -1 -1 78 20
PAGE "Chiusura Periodica" -1 -1 78 12
GROUPBOX DLG_NULL 77 4
BEGIN
@ -117,22 +117,32 @@ BEGIN
HELP "Sottogruppo finale"
END
GROUPBOX DLG_NULL 77 3
BEGIN
PROMPT 1 6 "Opzioni per la chiusura"
END
DATE F_DATA
BEGIN
PROMPT 2 5 "Data chiusura "
PROMPT 2 7 "Data di riferimento "
CHECKTYPE REQUIRED
HELP "Data di riferimento per i conteggi di chiusura"
END
BOOLEAN F_DEFINITIVA
BEGIN
PROMPT 43 7 "Chiusura definitiva"
HELP "Se chiusura definitiva, le operazioni stampate verranno registrate"
END
BUTTON DLG_OK 9 2
BEGIN
PROMPT -12 14 ""
PROMPT -12 10 ""
END
BUTTON DLG_QUIT 9 2
BEGIN
PROMPT -22 14 ""
PROMPT -22 10 ""
END
ENDPAGE
ENDMASK

View File

@ -17,16 +17,14 @@
#include "benem.h"
#include "sezioni.h"
class TAttriben_app : public TPrintapp
class TAttribuzioneBenemerenze : public TPrintapp
{
TMask* _msk;
TRelation* _rel;
TLocalisamfile* _donaz;
TLocalisamfile* _benem;
TRecord_array* _sdonazioni;
TRecord_array* _sbenemerenze;
int _cur;
TDate _data_attribuzione; // data attribuzione benemerenza
TDate _data_stampa;
@ -48,12 +46,12 @@ public:
void filtra_sezioni();
void crea_intestazione();
void header_sezione(const TString16 codsez, const TString16 codsot);
TAttriben_app() : _data_attribuzione(TODAY), _data_stampa(TODAY), _tipoben(""), _cognome_nome("",25) {}
TAttribuzioneBenemerenze() : _data_attribuzione(TODAY), _data_stampa(TODAY), _tipoben(""), _cognome_nome("",25) {}
};
HIDDEN inline TAttriben_app& app() { return (TAttriben_app&) main_app(); }
HIDDEN inline TAttribuzioneBenemerenze& app() { return (TAttribuzioneBenemerenze&) main_app(); }
void TAttriben_app::filtra_sezioni()
void TAttribuzioneBenemerenze::filtra_sezioni()
{
const TString16 sezini = _msk->get(F_SEZINI);
const TString16 sotini = _msk->get(F_SOTINI);
@ -72,7 +70,7 @@ void TAttriben_app::filtra_sezioni()
current_cursor()->setregion(da, a);
}
bool TAttriben_app::preprocess_page(int file, int counter)
bool TAttribuzioneBenemerenze::preprocess_page(int file, int counter)
{
TRectype& recsez = current_cursor()->curr(LF_SEZIONI);
TRectype& recsog = current_cursor()->curr();
@ -99,7 +97,7 @@ bool TAttriben_app::preprocess_page(int file, int counter)
return TRUE;
}
void TAttriben_app::set_page(int file, int cnt)
void TAttribuzioneBenemerenze::set_page(int file, int cnt)
{
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########"));
set_row(1,"@9g@S", FLD(LF_SOGGETTI,SOG_CATDON));
@ -108,7 +106,7 @@ void TAttriben_app::set_page(int file, int cnt)
set_row(1,"@49g@pn", FLD(LF_SOGGETTI,SOG_TOTDON,"###"));
}
bool TAttriben_app::filter_func_attriben(const TRelation* rel)
bool TAttribuzioneBenemerenze::filter_func_attriben(const TRelation* rel)
{
bool filtrato;
// filtro chi non ha già ricevuto la benemerenza richiesta
@ -125,7 +123,7 @@ bool TAttriben_app::filter_func_attriben(const TRelation* rel)
return filtrato;
}
void TAttriben_app::header_sezione(const TString16 codsez, const TString16 codsot)
void TAttribuzioneBenemerenze::header_sezione(const TString16 codsez, const TString16 codsot)
{
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
@ -146,7 +144,7 @@ void TAttriben_app::header_sezione(const TString16 codsez, const TString16 codso
return;
}
bool TAttriben_app::set_print(int)
bool TAttribuzioneBenemerenze::set_print(int)
{
KEY tasto;
tasto = _msk->run();
@ -176,7 +174,7 @@ bool TAttriben_app::set_print(int)
}
void TAttriben_app::crea_intestazione()
void TAttribuzioneBenemerenze::crea_intestazione()
{
reset_header();
@ -204,22 +202,21 @@ void TAttriben_app::crea_intestazione()
set_header(5,"@0g------@9g--@12g-------------------------@38g----------@49g--------");
}
bool TAttriben_app::user_create()
bool TAttribuzioneBenemerenze::user_create()
{
_msk = new TMask("at1200a");
_rel = new TRelation(LF_SOGGETTI);
_rel->add(LF_SEZIONI,"CODSEZ==CODSEZ|CODSOT==CODSOT");
_cur = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
//cursore ordinamento per sezione+sottogruppo+cognome+nome
_cur = add_cursor(new TCursor(_rel, "", 3));
_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);
return TRUE;
}
bool TAttriben_app::user_destroy()
bool TAttribuzioneBenemerenze::user_destroy()
{
delete _rel;
delete _msk;
@ -232,7 +229,7 @@ bool TAttriben_app::user_destroy()
int at1200(int argc, char* argv[])
{
TAttriben_app a;
TAttribuzioneBenemerenze a;
a.run(argc, argv, "Attribuzione benemerenze");
return 0;
}

View File

@ -20,21 +20,22 @@
#include "contsan.h"
#include "sezioni.h"
class TSbloccoSO_app : public TPrintapp
class TSbloccoSospesi : public TPrintapp
{
TMask* _msk;
TRelation* _rel;
TLocalisamfile* _contsan;
TRecord_array* _scontrolli;
int _cur;
TDate _data_sblocco; // data scadenza sospensione fino a _data_sblocco
TDate _data_stampa;
TString16 _tiposo; // tipo sospesione da sbloccare
TString16 _codsez, _codsot;
bool _definitiva;
TParagraph_string _cognome_nome;
TString16 _finesospensione;
static bool filter_func_sbloccoSO(const TRelation* rel);
static bool filter_func_sbloccosospesi(const TRelation* rel);
protected:
virtual bool user_create();
@ -47,12 +48,32 @@ public:
void filtra_sezioni();
void crea_intestazione();
void header_sezione(const TString16 codsez, const TString16 codsot);
TSbloccoSO_app() : _data_sblocco(TODAY), _data_stampa(TODAY), _tiposo("") {}
TSbloccoSospesi() : _data_sblocco(TODAY), _data_stampa(TODAY), _tiposo(""), _cognome_nome("",25) {}
};
HIDDEN inline TSbloccoSO_app& app() { return (TSbloccoSO_app&) main_app(); }
HIDDEN inline TSbloccoSospesi& app() { return (TSbloccoSospesi&) main_app(); }
void TSbloccoSO_app::filtra_sezioni()
HIDDEN bool printer_handler(TMask_field& f, KEY k)
{
if (k == K_SPACE)
{
TMask& m = f.mask();
if (!m.query_mode())
{
TString16 config;
config << "SBLOCCOSO";
TPrinter& p = printer();
p.set_printtype(normprinter); // Force configuration update
p.read_configuration(config);
if (p.set())
f.message_box("Stampante configurata per sblocco sospesi");
}
}
return TRUE;
}
void TSbloccoSospesi::filtra_sezioni()
{
const TString16 sezini = _msk->get(F_SEZINI);
const TString16 sotini = _msk->get(F_SOTINI);
@ -71,25 +92,31 @@ void TSbloccoSO_app::filtra_sezioni()
current_cursor()->setregion(da, a);
}
bool TSbloccoSO_app::preprocess_page(int file, int counter)
bool TSbloccoSospesi::preprocess_page(int file, int counter)
{
TRectype& recsog = current_cursor()->curr();
TRectype* key = new TRectype(LF_CONTSAN);
long codice = recsog.get_long(SOG_CODICE);
key->put(CON_CODICE, codice);
int err = _scontrolli->read(key);
int progcon = _scontrolli->rows()+1;
TRectype& reccon = _contsan->curr();
reccon.zero();
reccon.put(CON_CODICE, codice);
reccon.put(CON_PROGCON, progcon);
reccon.put(CON_DATACON, _data_stampa);
reccon.put(CON_TIPOCON, FINE_SOSPENSIONE);
_scontrolli->add_row(reccon);
_scontrolli->rewrite();
con_reord(recsog, _scontrolli);
current_cursor()->file().rewrite();
TString80 nome = recsog.get(SOG_COGNOME);
nome << " ";
nome << recsog.get(SOG_NOME);
_cognome_nome = nome;
if (_definitiva)
{
TRectype* key = new TRectype(LF_CONTSAN);
long codice = recsog.get_long(SOG_CODICE);
key->put(CON_CODICE, codice);
int err = _scontrolli->read(key);
int progcon = _scontrolli->rows()+1;
TRectype& reccon = _contsan->curr();
reccon.zero();
reccon.put(CON_CODICE, codice);
reccon.put(CON_PROGCON, progcon);
reccon.put(CON_DATACON, _data_stampa);
reccon.put(CON_TIPOCON, FINE_SOSPENSIONE);
_scontrolli->add_row(reccon);
_scontrolli->rewrite();
con_reord(recsog, _scontrolli);
current_cursor()->file().rewrite();
}
// salto pagina se cambio sezione
const TString16 codsez = recsog.get(SOG_CODSEZ);
const TString16 codsot = recsog.get(SOG_CODSOT);
@ -104,16 +131,19 @@ bool TSbloccoSO_app::preprocess_page(int file, int counter)
return TRUE;
}
void TSbloccoSO_app::set_page(int file, int cnt)
void TSbloccoSospesi::set_page(int file, int cnt)
{
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########"));
set_row(1,"@9g@S", FLD(LF_SOGGETTI,SOG_CATDON));
set_row(1,"@12g@S", FLD(LF_SOGGETTI,SOG_COGNOME));
set_row(1,"@38g@S", FLD(LF_SOGGETTI,SOG_NOME));
set_row(1,"@63g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
set_row(1,"@12g#a", &_cognome_nome);
set_row(1,"@38g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
set_row(1,"@49g@S", FLD(LF_SOGGETTI,SOG_TESSAVIS));
set_row(1,"@57g@S", FLD(LF_SOGGETTI,SOG_PROS_STATO));
set_row(1,"@68g@S", FLD(LF_SOGGETTI,SOG_STATO));
set_row(1,"@80g@ld", FLD(LF_SOGGETTI,SOG_DATA_PROS));
}
bool TSbloccoSO_app::filter_func_sbloccoSO(const TRelation* rel)
bool TSbloccoSospesi::filter_func_sbloccosospesi(const TRelation* rel)
{
bool filtrato = FALSE;
TRectype& recsog = rel->lfile().curr();
@ -136,7 +166,7 @@ bool TSbloccoSO_app::filter_func_sbloccoSO(const TRelation* rel)
if (modstato_tcs(prosstipo) == 'F')
{
TDate datafine = riga.get(CON_PROSSDATA);
filtrato = datafine <= app()._data_sblocco;
filtrato = (datafine.ok()) && (datafine <= app()._data_sblocco);
}
}
}
@ -144,11 +174,11 @@ bool TSbloccoSO_app::filter_func_sbloccoSO(const TRelation* rel)
return filtrato;
}
void TSbloccoSO_app::header_sezione(const TString16 codsez, const TString16 codsot)
void TSbloccoSospesi::header_sezione(const TString16 codsez, const TString16 codsot)
{
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
TString intestazione(132);
TString intestazione(100);
intestazione = "Sezione: ";
intestazione << codsez;
intestazione << "/";
@ -165,7 +195,7 @@ void TSbloccoSO_app::header_sezione(const TString16 codsez, const TString16 cods
return;
}
bool TSbloccoSO_app::set_print(int)
bool TSbloccoSospesi::set_print(int)
{
KEY tasto;
tasto = _msk->run();
@ -175,6 +205,7 @@ bool TSbloccoSO_app::set_print(int)
_codsot = "**";
_data_sblocco = _msk->get(F_DATA);
_tiposo = _msk->get(F_TIPO);
_definitiva = _msk->get_bool(F_DEFINITIVA);
reset_files();
add_file(LF_SOGGETTI);
filtra_sezioni();
@ -183,7 +214,7 @@ bool TSbloccoSO_app::set_print(int)
current_cursor()->setfilter(format("STATO == \"%s\"",(const char*)_tiposo));
else
current_cursor()->setfilter("TCS->S6 == \"S\"", TRUE);
current_cursor()->set_filterfunction(filter_func_sbloccoSO,TRUE);
current_cursor()->set_filterfunction(filter_func_sbloccosospesi,TRUE);
reset_print();
crea_intestazione();
return TRUE;
@ -192,12 +223,15 @@ bool TSbloccoSO_app::set_print(int)
return FALSE;
}
void TSbloccoSO_app::crea_intestazione()
void TSbloccoSospesi::crea_intestazione()
{
reset_header();
TString sep(132);
sep = "SBLOCCO SOSPESI ";
TString sep(100);
if (_definitiva)
sep = "SBLOCCO DEFINITIVO SOSPESI ";
else
sep = "STAMPA PROVVISORIA PER SBLOCCO SOSPESI ";
sep << _tiposo;
sep << " FINO ALLA DATA ";
TString16 data_stampa = _data_sblocco.string();
@ -208,40 +242,45 @@ void TSbloccoSO_app::crea_intestazione()
set_header(2,"@0g%10s", (const char*) data_stampa);
sep = "";
sep << "Pag. @#";
set_header(2, "@120g%s", (const char*) sep);
set_header(2, "@88g%s", (const char*) sep);
sep = "";
sep.fill('-');
set_header(3, (const char *) sep);
set_header(4,"@0gCod.@9gC.@12gCognome e nome@38gNato il");
set_header(5,"@0g------@9g--@12g-------------------------@38g----------");
set_header(4,"@0gCod.@9gC.@12gCognome e nome@38gNato il@49gTessera@57gStato att.@68gStato prec.@80gScadenza");
set_header(5,"@0g------@9g--@12g-------------------------@38g----------@49g-------@57g----------@68g-----------@80g----------");
}
bool TSbloccoSO_app::user_create()
bool TSbloccoSospesi::user_create()
{
_msk = new TMask("at1300a");
_rel = new TRelation(LF_SOGGETTI);
_rel->add(LF_SEZIONI,"CODSEZ==CODSEZ|CODSOT==CODSOT");
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
_cur = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
//cursore ordinamento per sezione+sottogruppo+cognome+nome
_cur = add_cursor(new TCursor(_rel, "", 3));
_msk->set_handler(F_PRINTER, printer_handler);
_contsan = new TLocalisamfile(LF_CONTSAN);
_scontrolli = new TRecord_array(LF_CONTSAN, CON_PROGCON);
TString16 config;
config << "SBLOCCOSO";
printer().read_configuration(config);
return TRUE;
}
bool TSbloccoSO_app::user_destroy()
bool TSbloccoSospesi::user_destroy()
{
delete _rel;
delete _msk;
delete _contsan;
delete _scontrolli;
printer().read_configuration();
return TRUE;
}
int at1300(int argc, char* argv[])
{
TSbloccoSO_app a;
TSbloccoSospesi a;
a.run(argc, argv, "Sblocco sospesi");
return 0;
}

View File

@ -12,3 +12,5 @@
#define F_DATA 109
#define F_TIPO 110
#define F_D_TIPO 111
#define F_DEFINITIVA 112
#define F_PRINTER 113

View File

@ -117,7 +117,7 @@ BEGIN
HELP "Sottogruppo finale"
END
GROUPBOX DLG_NULL 77 4
GROUPBOX DLG_NULL 77 5
BEGIN
PROMPT 1 5 "Opzioni per lo sblocco"
END
@ -150,14 +150,26 @@ BEGIN
FLAGS "D"
END
BOOLEAN F_DEFINITIVA
BEGIN
PROMPT 2 8 "Sblocco definitivo"
HELP "Se sblocco definitivo, i soggetti stampati vengono sbloccati"
END
BUTTON DLG_OK 9 2
BEGIN
PROMPT -12 -1 ""
PROMPT -13 -1 ""
END
BUTTON F_PRINTER 19 2
BEGIN
PROMPT -23 -1 "Imposta stampante"
END
BUTTON DLG_QUIT 9 2
BEGIN
PROMPT -22 -1 ""
PROMPT -33 -1 ""
END
ENDPAGE

View File

@ -35,18 +35,16 @@ public:
};
*/
class TTessere_application : public TPrintapp
class TStampaTessere : public TPrintapp
{
TRelation* _rel;
TMask* _msk;
TAssoc_array _categorie;
//TTessere_form* _form_pag;
TAssoc_array _asoggetti;
int _numdon;
bool _aggiorna;
int _cur1, _cur2, _cur3, _cur4;
int _cur;
TDate _data_stampa;
TString _riepilogodon;
@ -67,10 +65,10 @@ public:
void filtra_sezioni();
void filtra_codici();
TMask& app_mask() { return *_msk; }
TTessere_application() : _data_stampa(TODAY), _riepilogodon(50) {}
TStampaTessere() : _data_stampa(TODAY), _riepilogodon(50) {}
};
HIDDEN inline TTessere_application& app() { return (TTessere_application&) main_app(); }
HIDDEN inline TStampaTessere& app() { return (TStampaTessere&) main_app(); }
//TCursor* TTessere_form::cursor() const { return app().current_cursor(); }
@ -97,7 +95,7 @@ HIDDEN bool printer_handler(TMask_field& f, KEY k)
}
void TTessere_application::add_rows_soggetti(TSheet_field& s, int count, int start)
void TStampaTessere::add_rows_soggetti(TSheet_field& s, int count, int start)
{
if (start == 1)
s.destroy();
@ -105,9 +103,8 @@ void TTessere_application::add_rows_soggetti(TSheet_field& s, int count, int sta
TToken_string& row = s.row(r-1);
}
void TTessere_application::filtra_codici()
void TStampaTessere::filtra_codici()
{
select_cursor(_cur4);
TRectype da(LF_SOGGETTI);
TRectype a (LF_SOGGETTI);
TSheet_field& s = (TSheet_field&)_msk->field(F_SOGGETTI);
@ -132,13 +129,12 @@ void TTessere_application::filtra_codici()
current_cursor()->setregion(da, a);
}
void TTessere_application::filtra_sezioni()
void TStampaTessere::filtra_sezioni()
{
const TString16 sezini = _msk->get(F_SEZINI);
const TString16 sotini = _msk->get(F_SOTINI);
const TString16 sezfin = _msk->get(F_SEZFIN);
const TString16 sotfin = _msk->get(F_SOTFIN);
select_cursor(_cur4);
TRectype da(LF_SOGGETTI);
TRectype a(LF_SOGGETTI);
if (sezini.not_empty())
@ -152,7 +148,7 @@ void TTessere_application::filtra_sezioni()
current_cursor()->setregion(da, a);
}
void TTessere_application::set_page(int file, int cnt)
void TStampaTessere::set_page(int file, int cnt)
{
TString16 data_stampa = _data_stampa.string();
set_row(3, "@30g@S", FLD(LF_SEZIONI,SEZ_DENSEZ));
@ -177,7 +173,7 @@ void TTessere_application::set_page(int file, int cnt)
set_row(72,"");
}
bool TTessere_application::filter_func_auto(const TRelation* rel)
bool TStampaTessere::filter_func_auto(const TRelation* rel)
{
bool filtrato = TRUE;
TLocalisamfile& sog = rel->lfile();
@ -197,7 +193,7 @@ bool TTessere_application::filter_func_auto(const TRelation* rel)
return filtrato;
}
bool TTessere_application::filter_func_manuale(const TRelation* rel)
bool TStampaTessere::filter_func_manuale(const TRelation* rel)
{
TLocalisamfile& sog = rel->lfile();
TAssoc_array& array_sogg = app()._asoggetti;
@ -205,13 +201,13 @@ bool TTessere_application::filter_func_manuale(const TRelation* rel)
return (array_sogg.is_key(codice));
}
print_action TTessere_application::postprocess_page(int file, int counter)
print_action TStampaTessere::postprocess_page(int file, int counter)
{
printer().formfeed();
return NEXT_PAGE;
}
bool TTessere_application::preprocess_page(int file, int counter)
bool TStampaTessere::preprocess_page(int file, int counter)
{
TLocalisamfile& sogg = current_cursor()->file(LF_SOGGETTI);
const int totdon = sogg.get_int(SOG_TOTDON);
@ -232,13 +228,13 @@ bool TTessere_application::preprocess_page(int file, int counter)
return TRUE;
}
bool TTessere_application::set_print(int m)
bool TStampaTessere::set_print(int m)
{
TSheet_field& s = (TSheet_field&)_msk->field(F_SOGGETTI);
s.destroy();
s.force_update();
if (s.items()==0)
add_rows_soggetti(s,8);
add_rows_soggetti(s,50);
KEY tasto;
tasto = _msk->run();
if (tasto == K_ENTER)
@ -297,7 +293,7 @@ bool TTessere_application::set_print(int m)
return FALSE;
}
bool TTessere_application::user_create()
bool TStampaTessere::user_create()
{
_rel = new TRelation(LF_SOGGETTI);
_rel->add(LF_COMUNI, "COM==COMNASC",1,0,ALIAS_COMNAS);
@ -308,39 +304,29 @@ bool TTessere_application::user_create()
//_rel->add("CTN", "CODTAB==CATNOND1",1,0,ALIAS_CTN1);
//_rel->add("CTN", "CODTAB==CATNOND2",1,0,ALIAS_CTN2);
_rel->add("CTD", "CODTAB==CATDON",1,0,ALIAS_CTD);
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
//cursore ordinamento per sezione+sottogruppo+cognome+nome
_cur = add_cursor(new TCursor(_rel, "", 3));
_msk = new TMask("at1400a");
_msk->set_handler(F_PRINTER, printer_handler);
//_form_pag = new TTessere_form("AT_PAGIN"); // dovrà esserci PAGINE
TString16 config;
config << "TESSERE";
printer().read_configuration(config);
return TRUE;
}
bool TTessere_application::user_destroy()
bool TStampaTessere::user_destroy()
{
delete _msk;
delete _rel;
//delete _form_pag;
printer().read_configuration();
return TRUE;
}
int at1400(int argc, char* argv[])
{
TTessere_application a;
TStampaTessere a;
a.run(argc, argv, "Stampa tessere associative");
return 0;
}

View File

@ -20,7 +20,7 @@
#include "contsan.h"
#include "sezioni.h"
class TCambiaInt_app : public TPrintapp
class TModificaIntervalli : public TPrintapp
{
TMask* _msk;
TRelation* _rel;
@ -34,7 +34,7 @@ class TCambiaInt_app : public TPrintapp
TDate _data_stampa;
TString16 _codsez, _codsot;
static bool filter_func_cambiaint(const TRelation* rel);
static bool filter_func_intervalli(const TRelation* rel);
protected:
virtual bool user_create();
@ -47,12 +47,12 @@ public:
void filtra_sezioni();
void crea_intestazione();
void header_sezione(const TString16 codsez, const TString16 codsot);
TCambiaInt_app() : _data_stampa(TODAY) {}
TModificaIntervalli() : _data_stampa(TODAY) {}
};
HIDDEN inline TCambiaInt_app& app() { return (TCambiaInt_app&) main_app(); }
HIDDEN inline TModificaIntervalli& app() { return (TModificaIntervalli&) main_app(); }
void TCambiaInt_app::filtra_sezioni()
void TModificaIntervalli::filtra_sezioni()
{
const TString16 sezini = _msk->get(F_SEZINI);
const TString16 sotini = _msk->get(F_SOTINI);
@ -71,7 +71,7 @@ void TCambiaInt_app::filtra_sezioni()
current_cursor()->setregion(da, a);
}
bool TCambiaInt_app::preprocess_page(int file, int counter)
bool TModificaIntervalli::preprocess_page(int file, int counter)
{
TRectype& recsog = current_cursor()->curr();
TRectype* key = new TRectype(LF_CONTSAN);
@ -116,7 +116,7 @@ bool TCambiaInt_app::preprocess_page(int file, int counter)
return TRUE;
}
void TCambiaInt_app::set_page(int file, int cnt)
void TModificaIntervalli::set_page(int file, int cnt)
{
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"######"));
set_row(1,"@9g@S", FLD(LF_SOGGETTI,SOG_CATDON));
@ -125,7 +125,7 @@ void TCambiaInt_app::set_page(int file, int cnt)
set_row(1,"@63g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
}
bool TCambiaInt_app::filter_func_cambiaint(const TRelation* rel)
bool TModificaIntervalli::filter_func_intervalli(const TRelation* rel)
{
bool filtrato = FALSE;
TRectype& recsog = rel->lfile().curr();
@ -136,7 +136,7 @@ bool TCambiaInt_app::filter_func_cambiaint(const TRelation* rel)
return filtrato;
}
void TCambiaInt_app::header_sezione(const TString16 codsez, const TString16 codsot)
void TModificaIntervalli::header_sezione(const TString16 codsez, const TString16 codsot)
{
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
@ -157,7 +157,7 @@ void TCambiaInt_app::header_sezione(const TString16 codsez, const TString16 cods
return;
}
bool TCambiaInt_app::set_print(int)
bool TModificaIntervalli::set_print(int)
{
KEY tasto;
tasto = _msk->run();
@ -176,7 +176,7 @@ bool TCambiaInt_app::set_print(int)
filtra_sezioni();
// non si puo' fare il filtro per intervalli perche' la setfilter
// non funziona bene con i campi numerici
current_cursor()->set_filterfunction(filter_func_cambiaint, TRUE);
current_cursor()->set_filterfunction(filter_func_intervalli, TRUE);
reset_print();
crea_intestazione();
return TRUE;
@ -185,7 +185,7 @@ bool TCambiaInt_app::set_print(int)
return FALSE;
}
void TCambiaInt_app::crea_intestazione()
void TModificaIntervalli::crea_intestazione()
{
reset_header();
@ -222,20 +222,21 @@ void TCambiaInt_app::crea_intestazione()
set_header(5,"@0g------@9g--@12g-------------------------@38g----------");
}
bool TCambiaInt_app::user_create()
bool TModificaIntervalli::user_create()
{
_msk = new TMask("at1500a");
_rel = new TRelation(LF_SOGGETTI);
_rel->add(LF_SEZIONI,"CODSEZ==CODSEZ|CODSOT==CODSOT");
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
_cur = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
//cursore ordinamento per sezione+sottogruppo+cognome+nome
_cur = add_cursor(new TCursor(_rel, "", 3));
_contsan = new TLocalisamfile(LF_CONTSAN);
_scontrolli = new TRecord_array(LF_CONTSAN, CON_PROGCON);
return TRUE;
}
bool TCambiaInt_app::user_destroy()
bool TModificaIntervalli::user_destroy()
{
delete _rel;
delete _msk;
@ -246,7 +247,7 @@ bool TCambiaInt_app::user_destroy()
int at1500(int argc, char* argv[])
{
TCambiaInt_app a;
TModificaIntervalli a;
a.run(argc, argv, "Modifica intervalli di donazione");
return 0;
}

View File

@ -15,7 +15,7 @@
#include "soggetti.h"
#include "sezioni.h"
class TSbloccoES_app : public TPrintapp
class TSbloccoEsclusi : public TPrintapp
{
TMask* _msk;
TRelation* _rel;
@ -24,8 +24,9 @@ class TSbloccoES_app : public TPrintapp
TDate _data_sblocco; // data scadenza esclusione fino a _data_sblocco
TDate _data_stampa;
TString16 _codsez, _codsot;
bool _definitiva;
static bool filter_func_sbloccoES(const TRelation* rel);
static bool filter_func_sbloccoesclusi(const TRelation* rel);
protected:
virtual bool user_create();
@ -38,12 +39,12 @@ public:
void filtra_sezioni();
void crea_intestazione();
void header_sezione(const TString16 codsez, const TString16 codsot);
TSbloccoES_app() : _data_sblocco(TODAY), _data_stampa(TODAY) {}
TSbloccoEsclusi() : _data_sblocco(TODAY), _data_stampa(TODAY) {}
};
HIDDEN inline TSbloccoES_app& app() { return (TSbloccoES_app&) main_app(); }
HIDDEN inline TSbloccoEsclusi& app() { return (TSbloccoEsclusi&) main_app(); }
void TSbloccoES_app::filtra_sezioni()
void TSbloccoEsclusi::filtra_sezioni()
{
const TString16 sezini = _msk->get(F_SEZINI);
const TString16 sotini = _msk->get(F_SOTINI);
@ -62,13 +63,15 @@ void TSbloccoES_app::filtra_sezioni()
current_cursor()->setregion(da, a);
}
bool TSbloccoES_app::preprocess_page(int file, int counter)
bool TSbloccoEsclusi::preprocess_page(int file, int counter)
{
TRectype& recsog = current_cursor()->curr();
recsog.put(SOG_ESCLUSO, " ");
recsog.put(SOG_TERMESCL, NULLDATE);
current_cursor()->file().rewrite();
if (_definitiva)
{
recsog.put(SOG_ESCLUSO, " ");
recsog.put(SOG_TERMESCL, NULLDATE);
current_cursor()->file().rewrite();
}
// salto pagina se cambio sezione
const TString16 codsez = recsog.get(SOG_CODSEZ);
const TString16 codsot = recsog.get(SOG_CODSOT);
@ -83,7 +86,7 @@ bool TSbloccoES_app::preprocess_page(int file, int counter)
return TRUE;
}
void TSbloccoES_app::set_page(int file, int cnt)
void TSbloccoEsclusi::set_page(int file, int cnt)
{
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########"));
set_row(1,"@9g@S", FLD(LF_SOGGETTI,SOG_CATDON));
@ -92,14 +95,14 @@ void TSbloccoES_app::set_page(int file, int cnt)
set_row(1,"@63g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
}
bool TSbloccoES_app::filter_func_sbloccoES(const TRelation* rel)
bool TSbloccoEsclusi::filter_func_sbloccoesclusi(const TRelation* rel)
{
TRectype& recsog = rel->lfile().curr();
TDate scadenza = recsog.get(SOG_TERMESCL);
return (scadenza.ok() && scadenza <= app()._data_sblocco);
}
void TSbloccoES_app::header_sezione(const TString16 codsez, const TString16 codsot)
void TSbloccoEsclusi::header_sezione(const TString16 codsez, const TString16 codsot)
{
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
@ -120,7 +123,7 @@ void TSbloccoES_app::header_sezione(const TString16 codsez, const TString16 cods
return;
}
bool TSbloccoES_app::set_print(int)
bool TSbloccoEsclusi::set_print(int)
{
KEY tasto;
tasto = _msk->run();
@ -129,11 +132,12 @@ bool TSbloccoES_app::set_print(int)
_codsez = "**";
_codsot = "**";
_data_sblocco = _msk->get(F_DATA);
_definitiva = _msk->get_bool(F_DEFINITIVA);
reset_files();
add_file(LF_SOGGETTI);
filtra_sezioni();
current_cursor()->setfilter("ESCLUSO == \"TD\"", TRUE);
current_cursor()->set_filterfunction(filter_func_sbloccoES, TRUE);
current_cursor()->set_filterfunction(filter_func_sbloccoesclusi, TRUE);
reset_print();
crea_intestazione();
return TRUE;
@ -142,12 +146,15 @@ bool TSbloccoES_app::set_print(int)
return FALSE;
}
void TSbloccoES_app::crea_intestazione()
void TSbloccoEsclusi::crea_intestazione()
{
reset_header();
TString sep(132);
sep = "SBLOCCO ESCLUSO ";
if (_definitiva)
sep = "SBLOCCO DEFINITIVO ESCLUSI ";
else
sep = "STAMPA PROVVISORIA PER SBLOCCO ESCLUSI ";
sep << " FINO ALLA DATA ";
TString16 data_stampa = _data_sblocco.string();
sep << data_stampa;
@ -166,16 +173,17 @@ void TSbloccoES_app::crea_intestazione()
set_header(5,"@0g--------@9g--@12g-------------------------@38g----------");
}
bool TSbloccoES_app::user_create()
bool TSbloccoEsclusi::user_create()
{
_msk = new TMask("at1600a");
_rel = new TRelation(LF_SOGGETTI);
_rel->add(LF_SEZIONI,"CODSEZ==CODSEZ|CODSOT==CODSOT");
_cur = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
//cursore ordinamento per sezione+sottogruppo+cognome+nome
_cur = add_cursor(new TCursor(_rel, "", 3));
return TRUE;
}
bool TSbloccoES_app::user_destroy()
bool TSbloccoEsclusi::user_destroy()
{
delete _rel;
delete _msk;
@ -184,7 +192,7 @@ bool TSbloccoES_app::user_destroy()
int at1600(int argc, char* argv[])
{
TSbloccoES_app a;
TSbloccoEsclusi a;
a.run(argc, argv, "Sblocco esclusi");
return 0;
}

View File

@ -10,3 +10,4 @@
#define F_SOTFIN 107
#define F_D_SOTFIN 108
#define F_DATA 109
#define F_DEFINITIVA 110

View File

@ -129,6 +129,12 @@ BEGIN
HELP "Data di riferimento per la scadenza (fino al)"
END
BOOLEAN F_DEFINITIVA
BEGIN
PROMPT 35 6 "Sblocco definitivo"
HELP "Se sblocco definitivo, i soggetti stampati vengono sbloccati"
END
BUTTON DLG_OK 9 2
BEGIN
PROMPT -12 -1 ""

View File

@ -29,19 +29,17 @@ public:
virtual ~TEti_sospesi_form() {};
};
class TSospesi_application : public TPrintapp
class TStampaSospesi : public TPrintapp
{
TRelation* _rel;
TMask* _msk;
TEti_sospesi_form* _form_eti;
TAssoc_array _categorie;
int _cur1, _cur2, _cur3, _cur4;
TParagraph_string _cognome_nome;
TDate _data_stampa;
ts _tipo_stampa;
TString16 _codsez, _codsot;
int _cur;
TParagraph_string _cognome_nome;
TDate _data_stampa;
ts _tipo_stampa;
TString16 _codsez, _codsot;
static bool filter_func_sospesi(const TRelation* rel);
@ -57,22 +55,21 @@ public:
void filtra_sezioni();
void header_sezione(const TString16 codsez, const TString16 codsot);
TMask& app_mask() { return *_msk; }
TSospesi_application() : _data_stampa(TODAY), _cognome_nome("",25) {}
TStampaSospesi() : _data_stampa(TODAY), _cognome_nome("",25) {}
};
HIDDEN inline TSospesi_application& app() { return (TSospesi_application&) main_app(); }
HIDDEN inline TStampaSospesi& app() { return (TStampaSospesi&) main_app(); }
TCursor* TEti_sospesi_form::cursor() const { return app().current_cursor(); }
TRelation* TEti_sospesi_form::relation() const { return cursor()->relation(); }
void TSospesi_application::filtra_sezioni()
void TStampaSospesi::filtra_sezioni()
{
const TString16 sezini = _msk->get(F_SEZINI);
const TString16 sotini = _msk->get(F_SOTINI);
const TString16 sezfin = _msk->get(F_SEZFIN);
const TString16 sotfin = _msk->get(F_SOTFIN);
select_cursor(_cur4);
TRectype da(LF_SOGGETTI);
TRectype a (LF_SOGGETTI);
if (sezini.not_empty())
@ -86,7 +83,7 @@ void TSospesi_application::filtra_sezioni()
current_cursor()->setregion(da, a);
}
void TSospesi_application::set_page(int file, int cnt)
void TStampaSospesi::set_page(int file, int cnt)
{
// costruzione etichette
switch (_tipo_stampa)
@ -124,7 +121,7 @@ void TSospesi_application::set_page(int file, int cnt)
}
}
bool TSospesi_application::filter_func_sospesi(const TRelation* rel)
bool TStampaSospesi::filter_func_sospesi(const TRelation* rel)
{
bool filtrato = TRUE;
TLocalisamfile& sog = rel->lfile();
@ -138,7 +135,7 @@ bool TSospesi_application::filter_func_sospesi(const TRelation* rel)
return filtrato;
}
bool TSospesi_application::preprocess_page(int file, int counter)
bool TStampaSospesi::preprocess_page(int file, int counter)
{
if (_tipo_stampa == elenco)
{
@ -147,7 +144,6 @@ bool TSospesi_application::preprocess_page(int file, int counter)
nome << " ";
nome << recsog.get(SOG_NOME);
_cognome_nome = nome;
// salto pagina se cambio sezione
const TString16 codsez = recsog.get(SOG_CODSEZ);
const TString16 codsot = recsog.get(SOG_CODSOT);
@ -163,7 +159,7 @@ bool TSospesi_application::preprocess_page(int file, int counter)
return TRUE;
}
void TSospesi_application::header_sezione(const TString16 codsez, const TString16 codsot)
void TStampaSospesi::header_sezione(const TString16 codsez, const TString16 codsot)
{
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
@ -184,7 +180,7 @@ void TSospesi_application::header_sezione(const TString16 codsez, const TString1
return;
}
bool TSospesi_application::set_print(int m)
bool TStampaSospesi::set_print(int m)
{
_tipo_stampa = undefined;
KEY tasto;
@ -204,17 +200,14 @@ bool TSospesi_application::set_print(int m)
{
reset_files();
add_file(LF_SOGGETTI);
// filtro per sezioni selezionati
filtra_sezioni();
// filtro per tipo sospensione
const TString16 tiposo = _msk->get(F_TIPO);
if (tiposo.not_empty() && tiposo.ok())
current_cursor()->setfilter(format("STATO == \"%s\"",(const char*)tiposo));
else
current_cursor()->setfilter("TCS->S6 == \"S\"", TRUE);
// filtro per categorie
const TString16 catpri = _msk->get(F_CAT1);
const TString16 catsec = _msk->get(F_CAT2);
@ -235,7 +228,6 @@ bool TSospesi_application::set_print(int m)
if (catses.not_empty() && catses.ok())
_categorie.add((const char*) catses);
current_cursor()->set_filterfunction(filter_func_sospesi);
reset_print();
crea_intestazione();
return TRUE;
@ -244,7 +236,7 @@ bool TSospesi_application::set_print(int m)
return FALSE;
}
void TSospesi_application::crea_intestazione()
void TStampaSospesi::crea_intestazione()
{
reset_header();
@ -268,18 +260,16 @@ void TSospesi_application::crea_intestazione()
sep = "";
sep << "Pag. @#";
set_header(2, "@120g%s", (const char*) sep);
sep = "";
sep.fill('-');
set_header(3, (const char *) sep);
set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gSospensione@63gUltima idon.@77gIntervalli@88gUltima donaz.@102gUlt.controllo@116gPross.contr.");
set_header(5,"@78gSI AF");
set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g-------------@63g-------------@77g----------@88g-------------@102g-------------@116g-------------");
}
}
bool TSospesi_application::user_create()
bool TStampaSospesi::user_create()
{
_rel = new TRelation(LF_SOGGETTI);
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
@ -287,20 +277,14 @@ bool TSospesi_application::user_create()
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
// per stampare nell'intestazione la denominazione della sezione
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
// ordinamento per sezione+sottogruppo+cognome e nome
_cur = add_cursor(new TCursor(_rel, "", 3));
_msk = new TMask("at2100a");
_form_eti = new TEti_sospesi_form("AT_ETSOG");
return TRUE;
}
bool TSospesi_application::user_destroy()
bool TStampaSospesi::user_destroy()
{
delete _msk;
delete _rel;
@ -310,10 +294,7 @@ bool TSospesi_application::user_destroy()
int at2100(int argc, char* argv[])
{
TSospesi_application a;
TStampaSospesi a;
a.run(argc, argv, "Elenco sospesi");
return 0;
}

View File

@ -1,6 +1,6 @@
#include "at2100a.h"
#include "lf.h"
PAGE "Definizione Stampe" -1 -1 78 20
PAGE "Stampa soggetti sospesi" -1 -1 78 20
GROUPBOX DLG_NULL 77 4
BEGIN

View File

@ -29,19 +29,16 @@ public:
virtual ~TEti_pereta_form() {};
};
class TPereta_application : public TPrintapp
class TStampaPerEta : public TPrintapp
{
static bool filter_func_pereta(const TRelation* rel);
TRelation* _rel;
TMask* _msk;
TEti_pereta_form* _form_eti;
TAssoc_array _categorie;
int _cur1, _cur2, _cur3, _cur4;
int _cur;
TParagraph_string _cognome_nome, _dencom;
TDate _data_stampa;
TDate _dataini, _datafin;
ts _tipo_stampa;
@ -61,22 +58,21 @@ public:
void header_sezione(const TString16 codsez, const TString16 codsot);
TMask& app_mask() { return *_msk; }
TPereta_application() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {}
TStampaPerEta() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {}
};
HIDDEN inline TPereta_application& app() { return (TPereta_application&) main_app(); }
HIDDEN inline TStampaPerEta& app() { return (TStampaPerEta&) main_app(); }
TCursor* TEti_pereta_form::cursor() const { return app().current_cursor(); }
TRelation* TEti_pereta_form::relation() const { return cursor()->relation(); }
void TPereta_application::filtra_sezioni()
void TStampaPerEta::filtra_sezioni()
{
const TString16 sezini = _msk->get(F_SEZINI);
const TString16 sotini = _msk->get(F_SOTINI);
const TString16 sezfin = _msk->get(F_SEZFIN);
const TString16 sotfin = _msk->get(F_SOTFIN);
select_cursor(_cur4);
TRectype da(LF_SOGGETTI);
TRectype a(LF_SOGGETTI);
if (sezini.not_empty())
@ -90,7 +86,7 @@ void TPereta_application::filtra_sezioni()
current_cursor()->setregion(da, a);
}
void TPereta_application::set_page(int file, int cnt)
void TStampaPerEta::set_page(int file, int cnt)
{
switch (_tipo_stampa)
{
@ -104,8 +100,9 @@ void TPereta_application::set_page(int file, int cnt)
TPrintrow& riga = corpo.row(i);
set_row(i+1,riga);
}
force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
// serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
force_setpage(TRUE);
}
break;
case elenco:
@ -124,7 +121,7 @@ void TPereta_application::set_page(int file, int cnt)
}
}
bool TPereta_application::filter_func_pereta(const TRelation* rel)
bool TStampaPerEta::filter_func_pereta(const TRelation* rel)
{
bool filtrato = TRUE;
TLocalisamfile& sog = rel->lfile();
@ -147,7 +144,7 @@ bool TPereta_application::filter_func_pereta(const TRelation* rel)
return filtrato;
}
void TPereta_application::header_sezione(const TString16 codsez, const TString16 codsot)
void TStampaPerEta::header_sezione(const TString16 codsez, const TString16 codsot)
{
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
@ -168,7 +165,7 @@ void TPereta_application::header_sezione(const TString16 codsez, const TString16
return;
}
bool TPereta_application::preprocess_page(int file, int counter)
bool TStampaPerEta::preprocess_page(int file, int counter)
{
if (_tipo_stampa == elenco)
{
@ -209,7 +206,7 @@ bool TPereta_application::preprocess_page(int file, int counter)
return TRUE;
}
bool TPereta_application::set_print(int m)
bool TStampaPerEta::set_print(int m)
{
_tipo_stampa = undefined;
KEY tasto;
@ -230,7 +227,6 @@ bool TPereta_application::set_print(int m)
reset_files();
add_file(LF_SOGGETTI);
filtra_sezioni();
_dataini = _msk->get(F_DATAINI);
_datafin = _msk->get(F_DATAFIN);
const TString16 catpri = _msk->get(F_CAT1);
@ -252,7 +248,6 @@ bool TPereta_application::set_print(int m)
if (catses.not_empty() && catses.ok())
_categorie.add((const char*) catses);
current_cursor()->set_filterfunction (filter_func_pereta);
reset_print();
crea_intestazione();
return TRUE;
@ -261,10 +256,9 @@ bool TPereta_application::set_print(int m)
return FALSE;
}
void TPereta_application::crea_intestazione()
void TStampaPerEta::crea_intestazione()
{
reset_header();
if (_tipo_stampa == elenco)
{
TString sep(132);
@ -288,18 +282,16 @@ void TPereta_application::crea_intestazione()
sep = "";
sep << "Pag. @#";
set_header(2, "@120g%s", (const char*) sep);
sep = "";
sep.fill('-');
set_header(3, (const char *) sep);
set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gIndirizzo@100gTelefono abit.@116gTelefono lavoro");
set_header(5,"@49gCAP/Località/Comune/Prov.@116gTelefono altro");
set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g---------------");
}
}
bool TPereta_application::user_create()
bool TStampaPerEta::user_create()
{
_rel = new TRelation(LF_SOGGETTI);
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
@ -307,18 +299,14 @@ bool TPereta_application::user_create()
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
// per stampare nell'intestazione la denominazione della sezione
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
// ordinamento per sezione+sottogruppo+cognome e nome
_cur = add_cursor(new TCursor(_rel, "", 3));
_form_eti = new TEti_pereta_form("AT_ETSOG");
_msk = new TMask("at2200a");
return TRUE;
}
bool TPereta_application::user_destroy()
bool TStampaPerEta::user_destroy()
{
delete _msk;
delete _rel;
@ -328,10 +316,7 @@ bool TPereta_application::user_destroy()
int at2200(int argc, char* argv[])
{
TPereta_application a;
TStampaPerEta a;
a.run(argc, argv, "Elenco per data nascita");
return 0;
}

View File

@ -1,6 +1,6 @@
#include "at2200a.h"
#include "lf.h"
PAGE "Definizione Stampe" -1 -1 78 20
PAGE "Stampa soggetti per data nascita" -1 -1 78 20
GROUPBOX DLG_NULL 77 4
BEGIN

View File

@ -29,19 +29,17 @@ public:
virtual ~TEti_esclusi_form() {};
};
class TEsclusi_application : public TPrintapp
class TStampaEsclusi : public TPrintapp
{
static bool filter_func_esclusi(const TRelation* rel);
TRelation* _rel;
TMask* _msk;
TEti_esclusi_form* _form_eti;
TAssoc_array _categorie;
TString16 _tipoesc;
TDate _termineesc;
int _cur1, _cur2, _cur3, _cur4;
int _cur;
TParagraph_string _cognome_nome;
TDate _data_stampa;
ts _tipo_stampa;
@ -59,22 +57,21 @@ public:
void filtra_sezioni();
void header_sezione(const TString16 codsez, const TString16 codsot);
TMask& app_mask() { return *_msk; }
TEsclusi_application() : _data_stampa(TODAY), _cognome_nome("",25) {}
TStampaEsclusi() : _data_stampa(TODAY), _cognome_nome("",25) {}
};
HIDDEN inline TEsclusi_application& app() { return (TEsclusi_application&) main_app(); }
HIDDEN inline TStampaEsclusi& app() { return (TStampaEsclusi&) main_app(); }
TCursor* TEti_esclusi_form::cursor() const { return app().current_cursor(); }
TRelation* TEti_esclusi_form::relation() const { return cursor()->relation(); }
void TEsclusi_application::filtra_sezioni()
void TStampaEsclusi::filtra_sezioni()
{
const TString16 sezini = _msk->get(F_SEZINI);
const TString16 sotini = _msk->get(F_SOTINI);
const TString16 sezfin = _msk->get(F_SEZFIN);
const TString16 sotfin = _msk->get(F_SOTFIN);
select_cursor(_cur4);
TRectype da(LF_SOGGETTI);
TRectype a(LF_SOGGETTI);
if (sezini.not_empty())
@ -88,7 +85,7 @@ void TEsclusi_application::filtra_sezioni()
current_cursor()->setregion(da, a);
}
void TEsclusi_application::set_page(int file, int cnt)
void TStampaEsclusi::set_page(int file, int cnt)
{
// costruzione etichette
switch (_tipo_stampa)
@ -103,8 +100,9 @@ void TEsclusi_application::set_page(int file, int cnt)
TPrintrow& riga = corpo.row(i);
set_row(i+1,riga);
}
force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
// serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
force_setpage(TRUE);
}
break;
case elenco:
@ -121,7 +119,7 @@ void TEsclusi_application::set_page(int file, int cnt)
}
}
bool TEsclusi_application::filter_func_esclusi(const TRelation * rel)
bool TStampaEsclusi::filter_func_esclusi(const TRelation * rel)
{
bool filtrato = TRUE;
TLocalisamfile& sog = rel->lfile();
@ -141,7 +139,7 @@ bool TEsclusi_application::filter_func_esclusi(const TRelation * rel)
return filtrato;
}
bool TEsclusi_application::preprocess_page(int file, int counter)
bool TStampaEsclusi::preprocess_page(int file, int counter)
{
if (_tipo_stampa == elenco)
{
@ -165,7 +163,7 @@ bool TEsclusi_application::preprocess_page(int file, int counter)
return TRUE;
}
void TEsclusi_application::header_sezione(const TString16 codsez, const TString16 codsot)
void TStampaEsclusi::header_sezione(const TString16 codsez, const TString16 codsot)
{
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
@ -186,7 +184,7 @@ void TEsclusi_application::header_sezione(const TString16 codsez, const TString1
return;
}
bool TEsclusi_application::set_print(int)
bool TStampaEsclusi::set_print(int)
{
_tipo_stampa = undefined;
KEY tasto;
@ -207,14 +205,12 @@ bool TEsclusi_application::set_print(int)
reset_files();
add_file(LF_SOGGETTI);
filtra_sezioni();
// filtro per tipo esclusione
_tipoesc = _msk->get(F_TIPO);
if (_tipoesc.not_empty() && _tipoesc.ok())
current_cursor()->setfilter(format("ESCLUSO == \"%s\"",(const char*)_tipoesc));
else
current_cursor()->setfilter("ESCLUSO != \"\"");
// filtro per categorie
const TString16 catpri = _msk->get(F_CAT1);
const TString16 catsec = _msk->get(F_CAT2);
@ -236,9 +232,7 @@ bool TEsclusi_application::set_print(int)
_categorie.add((const char*) catses);
// filtro per termine esclusione
_termineesc = _msk->get(F_DATA);
current_cursor()->set_filterfunction(filter_func_esclusi);
reset_print();
crea_intestazione();
return TRUE;
@ -247,10 +241,9 @@ bool TEsclusi_application::set_print(int)
return FALSE;
}
void TEsclusi_application::crea_intestazione()
void TStampaEsclusi::crea_intestazione()
{
reset_header();
if (_tipo_stampa == elenco)
{
TString sep(90);
@ -272,18 +265,16 @@ void TEsclusi_application::crea_intestazione()
sep = "";
sep << "Pag. @#";
set_header(2, "@78g%s", (const char*) sep);
sep = "";
sep.fill('-');
set_header(3, (const char *) sep);
set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gEsclusione@63gMotivo");
set_header(5,"@49gTipo Termine");
set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g-------------@63g------------------------------");
}
}
bool TEsclusi_application::user_create()
bool TStampaEsclusi::user_create()
{
_rel = new TRelation(LF_SOGGETTI);
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
@ -291,19 +282,14 @@ bool TEsclusi_application::user_create()
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
// per stampare le denominazione della sezione nell'intestazione
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
// ordinamento per sezione+sottogruppo+cognome+nome
_cur = add_cursor(new TCursor(_rel, "", 3));
_msk = new TMask("at2300a");
_form_eti = new TEti_esclusi_form("AT_ETSOG");
return TRUE;
}
bool TEsclusi_application::user_destroy()
bool TStampaEsclusi::user_destroy()
{
delete _msk;
delete _rel;
@ -313,10 +299,7 @@ bool TEsclusi_application::user_destroy()
int at2300(int argc, char* argv[])
{
TEsclusi_application a;
TStampaEsclusi a;
a.run(argc, argv, "Elenco esclusi");
return 0;
}

View File

@ -1,6 +1,6 @@
#include "at2300a.h"
#include "lf.h"
PAGE "Definizione Stampe" -1 -1 78 20
PAGE "Stampa soggetti esclusi" -1 -1 78 20
GROUPBOX DLG_NULL 77 4
BEGIN

View File

@ -15,7 +15,7 @@
#define ALIAS_CTN2 120 // categoria non donatori 2
#define ALIAS_TCS 200 // tipi/esiti controlli sanitari
#define ALIAS_LDN 300 // luoghi di donazione/punti di raccolta
#define ALIAS_LDN 300 // punti di prelievo
#define ALIAS_LCPRES 400 // localita' postale di residenza
#define ALIAS_LCPDOM 410 // localita' postale di domicilio
@ -39,7 +39,7 @@ public:
virtual ~TModificati_form() {};
};
class TModificati_application : public TPrintapp
class TStampaModificati : public TPrintapp
{
static bool filter_func_modificati(const TRelation* rel);
@ -47,15 +47,12 @@ class TModificati_application : public TPrintapp
TMask* _msk;
TModificati_form* _form_pag;
TAssoc_array _categorie;
int _cur1, _cur2, _cur3, _cur4;
int _cur;
TParagraph_string _cognome_nome, _dencom;
TDate _data_stampa, _dataini;
ts _tipo_stampa;
TString16 _codsez, _codsot;
protected:
virtual bool user_create();
virtual bool user_destroy();
@ -69,22 +66,21 @@ public:
void header_sezione(const TString16 codsez, const TString16 codsot);
TMask& app_mask() { return *_msk; }
TModificati_application() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {}
TStampaModificati() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {}
};
HIDDEN inline TModificati_application& app() { return (TModificati_application&) main_app(); }
HIDDEN inline TStampaModificati& app() { return (TStampaModificati&) main_app(); }
TCursor* TModificati_form::cursor() const { return app().current_cursor(); }
TRelation* TModificati_form::relation() const { return cursor()->relation(); }
void TModificati_application::filtra_sezioni()
void TStampaModificati::filtra_sezioni()
{
const TString16 sezini = _msk->get(F_SEZINI);
const TString16 sotini = _msk->get(F_SOTINI);
const TString16 sezfin = _msk->get(F_SEZFIN);
const TString16 sotfin = _msk->get(F_SOTFIN);
select_cursor(_cur4);
TRectype da(LF_SOGGETTI);
TRectype a(LF_SOGGETTI);
if (sezini.not_empty())
@ -98,7 +94,7 @@ void TModificati_application::filtra_sezioni()
current_cursor()->setregion(da, a);
}
void TModificati_application::set_page(int file, int cnt)
void TStampaModificati::set_page(int file, int cnt)
{
switch (_tipo_stampa)
{
@ -112,8 +108,9 @@ void TModificati_application::set_page(int file, int cnt)
TPrintrow& riga = corpo.row(i);
set_row(i+1,riga);
}
force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
// serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
force_setpage(TRUE);
}
break;
case elenco:
@ -132,7 +129,7 @@ void TModificati_application::set_page(int file, int cnt)
}
}
bool TModificati_application::filter_func_modificati(const TRelation* rel)
bool TStampaModificati::filter_func_modificati(const TRelation* rel)
{
bool filtrato = TRUE;
TLocalisamfile& sog = rel->lfile();
@ -152,7 +149,7 @@ bool TModificati_application::filter_func_modificati(const TRelation* rel)
return filtrato;
}
bool TModificati_application::preprocess_page(int file, int counter)
bool TStampaModificati::preprocess_page(int file, int counter)
{
if (_tipo_stampa == elenco)
{
@ -177,7 +174,6 @@ bool TModificati_application::preprocess_page(int file, int counter)
localita << current_cursor()->curr(-ALIAS_COMDOM).get(COM_DENCOM);
localita.trim();
_dencom = localita;
// salto pagina se cambio sezione
const TString16 codsez = recsog.get(SOG_CODSEZ);
const TString16 codsot = recsog.get(SOG_CODSOT);
@ -193,7 +189,7 @@ bool TModificati_application::preprocess_page(int file, int counter)
return TRUE;
}
void TModificati_application::header_sezione(const TString16 codsez, const TString16 codsot)
void TStampaModificati::header_sezione(const TString16 codsez, const TString16 codsot)
{
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
@ -214,7 +210,7 @@ void TModificati_application::header_sezione(const TString16 codsez, const TStri
return;
}
bool TModificati_application::set_print(int)
bool TStampaModificati::set_print(int)
{
_tipo_stampa = undefined;
KEY tasto;
@ -236,7 +232,6 @@ bool TModificati_application::set_print(int)
add_file(LF_SOGGETTI);
_dataini = _msk->get(F_DATAINI);
filtra_sezioni();
// filtro per categorie
const TString16 catpri = _msk->get(F_CAT1);
const TString16 catsec = _msk->get(F_CAT2);
@ -256,7 +251,6 @@ bool TModificati_application::set_print(int)
_categorie.add((const char*) catqui);
if (catses.not_empty() && catses.ok())
_categorie.add((const char*) catses);
current_cursor()->set_filterfunction(filter_func_modificati);
reset_print();
crea_intestazione();
@ -266,10 +260,9 @@ bool TModificati_application::set_print(int)
return FALSE;
}
void TModificati_application::crea_intestazione()
void TStampaModificati::crea_intestazione()
{
reset_header();
if (_tipo_stampa == elenco)
{
TString sep(132);
@ -287,18 +280,16 @@ void TModificati_application::crea_intestazione()
sep = "";
sep << "Pag. @#";
set_header(2, "@120g%s", (const char*) sep);
sep = "";
sep.fill('-');
set_header(3, (const char *) sep);
set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gIndirizzo@100gTelefono abit.@116gTelefono lavoro");
set_header(5,"@49gCAP/Località/Comune/Prov.@116gTelefono altro");
set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g---------------");
}
}
bool TModificati_application::user_create()
bool TStampaModificati::user_create()
{
_rel = new TRelation(LF_SOGGETTI);
_rel->add("CTD", "CODTAB==CATDON",1,0,ALIAS_CTD);
@ -313,18 +304,14 @@ bool TModificati_application::user_create()
_rel->add(LF_COMUNI, "COM==COMNASC",1,0,ALIAS_COMNAS);
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
_rel->add(LF_MEDICI, "CODMED==CODMED");
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
// ordinamento per sezione+sottogruppo+cognome+nome
_cur = add_cursor(new TCursor(_rel, "", 3));
_form_pag = new TModificati_form("AT_PAGIN");
_msk = new TMask("at2400a");
return TRUE;
}
bool TModificati_application::user_destroy()
bool TStampaModificati::user_destroy()
{
delete _msk;
delete _rel;
@ -334,10 +321,7 @@ bool TModificati_application::user_destroy()
int at2400(int argc, char* argv[])
{
TModificati_application a;
TStampaModificati a;
a.run(argc, argv, "Elenco soggetti modificati");
return 0;
}

View File

@ -1,6 +1,6 @@
#include "at2400a.h"
#include "lf.h"
PAGE "Definizione Stampe" -1 -1 78 20
PAGE "Stampa soggetti modificati" -1 -1 78 20
GROUPBOX DLG_NULL 77 4
BEGIN

View File

@ -29,7 +29,7 @@ public:
virtual ~TEti_idonei_form() {};
};
class TIdonei_application : public TPrintapp
class TStampaIdonei : public TPrintapp
{
TRelation* _rel;
TMask* _msk;
@ -38,7 +38,7 @@ class TIdonei_application : public TPrintapp
TString16 _tipoidon;
TString16 _idon1, _idon2, _idon3, _idon4;
int _cur1, _cur2, _cur3, _cur4;
int _cur;
TParagraph_string _cognome_nome;
TDate _data_stampa;
ts _tipo_stampa;
@ -58,22 +58,21 @@ public:
void filtra_sezioni();
void header_sezione(const TString16 codsez, const TString16 codsot);
TMask& app_mask() { return *_msk; }
TIdonei_application() : _data_stampa(TODAY), _cognome_nome("",25) {}
TStampaIdonei() : _data_stampa(TODAY), _cognome_nome("",25) {}
};
HIDDEN inline TIdonei_application& app() { return (TIdonei_application&) main_app(); }
HIDDEN inline TStampaIdonei& app() { return (TStampaIdonei&) main_app(); }
TCursor* TEti_idonei_form::cursor() const { return app().current_cursor(); }
TRelation* TEti_idonei_form::relation() const { return cursor()->relation(); }
void TIdonei_application::filtra_sezioni()
void TStampaIdonei::filtra_sezioni()
{
const TString16 sezini = _msk->get(F_SEZINI);
const TString16 sotini = _msk->get(F_SOTINI);
const TString16 sezfin = _msk->get(F_SEZFIN);
const TString16 sotfin = _msk->get(F_SOTFIN);
select_cursor(_cur4);
TRectype da(LF_SOGGETTI);
TRectype a(LF_SOGGETTI);
if (sezini.not_empty())
@ -87,7 +86,7 @@ void TIdonei_application::filtra_sezioni()
current_cursor()->setregion(da, a);
}
void TIdonei_application::set_page(int file, int cnt)
void TStampaIdonei::set_page(int file, int cnt)
{
// costruzione etichette
switch (_tipo_stampa)
@ -102,8 +101,9 @@ void TIdonei_application::set_page(int file, int cnt)
TPrintrow& riga = corpo.row(i);
set_row(i+1,riga);
}
force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
// serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
force_setpage(TRUE);
}
break;
case elenco:
@ -117,14 +117,13 @@ void TIdonei_application::set_page(int file, int cnt)
set_row(1,"@63g@S", FLD(LF_SOGGETTI,SOG_IDON2));
set_row(1,"@66g@S", FLD(LF_SOGGETTI,SOG_IDON3));
set_row(1,"@69g@S", FLD(LF_SOGGETTI,SOG_IDON4));
set_row(2,"@52g@S", FLD(LF_SOGGETTI,SOG_STATO));
}
break;
}
}
bool TIdonei_application::filter_func_idonei(const TRelation * rel)
bool TStampaIdonei::filter_func_idonei(const TRelation * rel)
{
bool filtrato = TRUE;
TLocalisamfile& sog = rel->lfile();
@ -166,7 +165,7 @@ bool TIdonei_application::filter_func_idonei(const TRelation * rel)
return filtrato;
}
bool TIdonei_application::preprocess_page(int file, int counter)
bool TStampaIdonei::preprocess_page(int file, int counter)
{
if (_tipo_stampa == elenco)
{
@ -175,7 +174,6 @@ bool TIdonei_application::preprocess_page(int file, int counter)
nome << " ";
nome << recsog.get(SOG_NOME);
_cognome_nome = nome;
// salto pagina se cambio sezione
const TString16 codsez = recsog.get(SOG_CODSEZ);
const TString16 codsot = recsog.get(SOG_CODSOT);
@ -191,7 +189,7 @@ bool TIdonei_application::preprocess_page(int file, int counter)
return TRUE;
}
void TIdonei_application::header_sezione(const TString16 codsez, const TString16 codsot)
void TStampaIdonei::header_sezione(const TString16 codsez, const TString16 codsot)
{
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
@ -212,7 +210,7 @@ void TIdonei_application::header_sezione(const TString16 codsez, const TString16
return;
}
bool TIdonei_application::set_print(int m)
bool TStampaIdonei::set_print(int m)
{
_tipo_stampa = undefined;
KEY tasto;
@ -221,8 +219,6 @@ bool TIdonei_application::set_print(int m)
{
case F_ELENCO:
_tipo_stampa = elenco;
//_codsez.spaces(2);
//_codsot.spaces(2);
_codsez = "**";
_codsot = "**";
break;
@ -234,17 +230,14 @@ bool TIdonei_application::set_print(int m)
{
reset_files();
add_file(LF_SOGGETTI);
// filtro per sezioni selezionati
filtra_sezioni();
// filtro per tipo idoneità
_tipoidon = _msk->get(F_TIPO);
if (_tipoidon.not_empty() && _tipoidon.ok())
current_cursor()->setfilter(format("STATO == \"%s\"",(const char*)_tipoidon));
else
current_cursor()->setfilter("(TCS->S6 == \"I\") || (TCS->S6 == \"F\")", TRUE);
// filtro per categorie
const TString16 catpri = _msk->get(F_CAT1);
const TString16 catsec = _msk->get(F_CAT2);
@ -264,15 +257,12 @@ bool TIdonei_application::set_print(int m)
_categorie.add((const char*) catqui);
if (catses.not_empty() && catses.ok())
_categorie.add((const char*) catses);
// filtro per idoneita
_idon1 = _msk->get(F_IDON1);
_idon2 = _msk->get(F_IDON2);
_idon3 = _msk->get(F_IDON3);
_idon4 = _msk->get(F_IDON4);
current_cursor()->set_filterfunction(filter_func_idonei);
reset_print();
crea_intestazione();
return TRUE;
@ -281,10 +271,9 @@ bool TIdonei_application::set_print(int m)
return FALSE;
}
void TIdonei_application::crea_intestazione()
void TStampaIdonei::crea_intestazione()
{
reset_header();
if (_tipo_stampa == elenco)
{
TString sep(132);
@ -324,18 +313,16 @@ void TIdonei_application::crea_intestazione()
sep = "";
sep << "Pag. @#";
set_header(2, "@120g%s", (const char*) sep);
sep = "";
sep.fill('-');
set_header(3, (const char *) sep);
set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gData ID@60gTipi idon.");
set_header(5,"@49gTipo/Esito");
set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g----------@60g-- -- -- --");
}
}
bool TIdonei_application::user_create()
bool TStampaIdonei::user_create()
{
_rel = new TRelation(LF_SOGGETTI);
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
@ -343,20 +330,14 @@ bool TIdonei_application::user_create()
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
// per stampare la denominazione della sezione nell'intestazione
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
// ordinamento per sezione+sottogruppo+cognome+nome
_cur = add_cursor(new TCursor(_rel, "", 3));
_msk = new TMask("at2500a");
_form_eti = new TEti_idonei_form("AT_ETSOG");
return TRUE;
}
bool TIdonei_application::user_destroy()
bool TStampaIdonei::user_destroy()
{
delete _msk;
delete _rel;
@ -366,10 +347,7 @@ bool TIdonei_application::user_destroy()
int at2500(int argc, char* argv[])
{
TIdonei_application a;
TStampaIdonei a;
a.run(argc, argv, "Elenco idonei");
return 0;
}

View File

@ -1,6 +1,6 @@
#include "at2500a.h"
#include "lf.h"
PAGE "Definizione Stampe" -1 -1 78 20
PAGE "Stampa soggetti idonei alla donazione" -1 -1 78 20
GROUPBOX DLG_NULL 77 4
BEGIN

View File

@ -29,15 +29,13 @@ public:
virtual ~TEti_iscritti_form() {};
};
class TIscritti_application : public TPrintapp
class TStampaIscritti : public TPrintapp
{
TRelation* _rel;
TMask* _msk;
TEti_iscritti_form* _form_eti;
TAssoc_array _categorie;
int _cur1, _cur2, _cur3, _cur4;
int _cur;
TParagraph_string _cognome_nome;
TDate _data_stampa;
ts _tipo_stampa;
@ -59,22 +57,21 @@ public:
void filtra_sezioni();
void header_sezione(const TString16 codsez, const TString16 codsot);
TMask& app_mask() { return *_msk; }
TIscritti_application() : _data_stampa(TODAY), _cognome_nome("",25) {}
TStampaIscritti() : _data_stampa(TODAY), _cognome_nome("",25) {}
};
HIDDEN inline TIscritti_application& app() { return (TIscritti_application&) main_app(); }
HIDDEN inline TStampaIscritti& app() { return (TStampaIscritti&) main_app(); }
TCursor* TEti_iscritti_form::cursor() const { return app().current_cursor(); }
TRelation* TEti_iscritti_form::relation() const { return cursor()->relation(); }
void TIscritti_application::filtra_sezioni()
void TStampaIscritti::filtra_sezioni()
{
const TString16 sezini = _msk->get(F_SEZINI);
const TString16 sotini = _msk->get(F_SOTINI);
const TString16 sezfin = _msk->get(F_SEZFIN);
const TString16 sotfin = _msk->get(F_SOTFIN);
const select_cursor(_cur4);
TRectype da(LF_SOGGETTI);
TRectype a(LF_SOGGETTI);
if (sezini.not_empty())
@ -88,7 +85,7 @@ void TIscritti_application::filtra_sezioni()
current_cursor()->setregion(da, a);
}
void TIscritti_application::set_page(int file, int cnt)
void TStampaIscritti::set_page(int file, int cnt)
{
// costruzione etichette
switch (_tipo_stampa)
@ -103,8 +100,9 @@ void TIscritti_application::set_page(int file, int cnt)
TPrintrow& riga = corpo.row(i);
set_row(i+1,riga);
}
force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
// serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
force_setpage(TRUE);
}
break;
case elenco:
@ -120,7 +118,7 @@ void TIscritti_application::set_page(int file, int cnt)
}
}
bool TIscritti_application::filter_func_iscritti(const TRelation * rel)
bool TStampaIscritti::filter_func_iscritti(const TRelation * rel)
{
bool filtrato = TRUE;
TLocalisamfile& sog = rel->lfile();
@ -131,7 +129,7 @@ bool TIscritti_application::filter_func_iscritti(const TRelation * rel)
const TString16 cat = sog.get(SOG_CATDON);
filtrato = categorie.is_key((const char*) cat);
}
// filtrp per date iscrizione/dimissione
// filtro per date iscrizione/dimissione
if (filtrato)
{
if (app()._tipo_iscdim == ISCRITTI)
@ -148,7 +146,7 @@ bool TIscritti_application::filter_func_iscritti(const TRelation * rel)
return filtrato;
}
bool TIscritti_application::preprocess_page(int file, int counter)
bool TStampaIscritti::preprocess_page(int file, int counter)
{
if (_tipo_stampa == elenco)
{
@ -172,7 +170,7 @@ bool TIscritti_application::preprocess_page(int file, int counter)
return TRUE;
}
void TIscritti_application::header_sezione(const TString16 codsez, const TString16 codsot)
void TStampaIscritti::header_sezione(const TString16 codsez, const TString16 codsot)
{
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
@ -193,7 +191,7 @@ void TIscritti_application::header_sezione(const TString16 codsez, const TString
return;
}
bool TIscritti_application::set_print(int m)
bool TStampaIscritti::set_print(int m)
{
_tipo_stampa = undefined;
KEY tasto;
@ -238,9 +236,7 @@ bool TIscritti_application::set_print(int m)
_tipo_iscdim = _msk->get(F_TIPO)[0];
_dataini = _msk->get(F_DATAINI);
_datafin = _msk->get(F_DATAFIN);
current_cursor()->set_filterfunction(filter_func_iscritti);
reset_print();
crea_intestazione();
return TRUE;
@ -249,10 +245,9 @@ bool TIscritti_application::set_print(int m)
return FALSE;
}
void TIscritti_application::crea_intestazione()
void TStampaIscritti::crea_intestazione()
{
reset_header();
if (_tipo_stampa == elenco)
{
TString sep(132);
@ -278,38 +273,29 @@ void TIscritti_application::crea_intestazione()
sep = "";
sep << "Pag. @#";
set_header(2, "@120g%s", (const char*) sep);
sep = "";
sep.fill('-');
set_header(3, (const char *) sep);
set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gData isc.@60gData dim.");
set_header(5,"@0g--------@9g--@12g-------------------------@38g----------@49g----------@60g----------");
}
}
bool TIscritti_application::user_create()
bool TStampaIscritti::user_create()
{
_rel = new TRelation(LF_SOGGETTI);
//_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCP);
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
// per stampare nell'intestazione la denominazione della sezione
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
// ordinamento per sezione+sottogruppo+cognome+nome
_cur = add_cursor(new TCursor(_rel, "", 3));
_msk = new TMask("at2600a");
_form_eti = new TEti_iscritti_form("AT_ETSOG");
return TRUE;
}
bool TIscritti_application::user_destroy()
bool TStampaIscritti::user_destroy()
{
delete _msk;
delete _rel;
@ -319,10 +305,7 @@ bool TIscritti_application::user_destroy()
int at2600(int argc, char* argv[])
{
TIscritti_application a;
TStampaIscritti a;
a.run(argc, argv, "Elenco iscritti/dimessi");
return 0;
}

View File

@ -1,6 +1,6 @@
#include "at2600a.h"
#include "lf.h"
PAGE "Definizione Stampe" -1 -1 78 20
PAGE "Stampa iscritti/dimessi" -1 -1 78 20
GROUPBOX DLG_NULL 77 4
BEGIN

View File

@ -29,7 +29,7 @@ public:
virtual ~TEti_percat_form() {};
};
class TPercat_application : public TPrintapp
class TStampaPerCategorie : public TPrintapp
{
static bool filter_func_percat(const TRelation* rel);
@ -46,7 +46,7 @@ class TPercat_application : public TPrintapp
TDate _data_stampa;
ts _tipo_stampa;
TString16 _codsez, _codsot;
char _lettini, _lettfin;
protected:
virtual bool user_create();
@ -61,16 +61,16 @@ public:
void header_sezione(const TString16 codsez, const TString16 codsot);
TMask& app_mask() { return *_msk; }
TPercat_application() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {}
TStampaPerCategorie() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {}
};
HIDDEN inline TPercat_application& app() { return (TPercat_application&) main_app(); }
HIDDEN inline TStampaPerCategorie& app() { return (TStampaPerCategorie&) main_app(); }
TCursor* TEti_percat_form::cursor() const { return app().current_cursor(); }
TRelation* TEti_percat_form::relation() const { return cursor()->relation(); }
void TPercat_application::filtra_sezioni()
void TStampaPerCategorie::filtra_sezioni()
{
const TString16 sezini = _msk->get(F_SEZINI);
const TString16 sotini = _msk->get(F_SOTINI);
@ -89,7 +89,7 @@ void TPercat_application::filtra_sezioni()
current_cursor()->setregion(da, a);
}
void TPercat_application::set_page(int file, int cnt)
void TStampaPerCategorie::set_page(int file, int cnt)
{
switch (_tipo_stampa)
{
@ -103,8 +103,9 @@ void TPercat_application::set_page(int file, int cnt)
TPrintrow& riga = corpo.row(i);
set_row(i+1,riga);
}
force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
// serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
force_setpage(TRUE);
}
break;
case elenco:
@ -123,11 +124,11 @@ void TPercat_application::set_page(int file, int cnt)
}
}
bool TPercat_application::filter_func_percat(const TRelation* rel)
bool TStampaPerCategorie::filter_func_percat(const TRelation* rel)
{
bool filtrato = FALSE;
TLocalisamfile& sog = rel->lfile();
// filtro per categorie
// filtro per categorie donatori
TAssoc_array& categorie = app()._catdon;
if (categorie.items() != 0)
{
@ -145,12 +146,21 @@ bool TPercat_application::filter_func_percat(const TRelation* rel)
filtrato = (categorie.is_key((const char*) cat1) || categorie.is_key((const char*) cat2)) ;
}
}
// se non ho selezionato categorie il soggetto va filtrato comunque
if (app()._catdon.items() == 0 && app()._catnondon.items() == 0)
filtrato = TRUE;
// filtro per iniziale cognome
if (filtrato && (app()._lettini != ' ') && (app()._lettfin != ' '))
{
TString80 cognome = sog.get(SOG_COGNOME);
const char primalett = cognome[0];
if (!(primalett >= app()._lettini && primalett <= app()._lettfin))
filtrato = FALSE;
}
return filtrato;
}
void TPercat_application::header_sezione(const TString16 codsez, const TString16 codsot)
void TStampaPerCategorie::header_sezione(const TString16 codsez, const TString16 codsot)
{
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
@ -171,7 +181,7 @@ void TPercat_application::header_sezione(const TString16 codsez, const TString16
return;
}
bool TPercat_application::preprocess_page(int file, int counter)
bool TStampaPerCategorie::preprocess_page(int file, int counter)
{
if (_tipo_stampa == elenco)
{
@ -211,7 +221,7 @@ bool TPercat_application::preprocess_page(int file, int counter)
return TRUE;
}
bool TPercat_application::set_print(int m)
bool TStampaPerCategorie::set_print(int m)
{
_tipo_stampa = undefined;
KEY tasto;
@ -231,6 +241,11 @@ bool TPercat_application::set_print(int m)
{
TString80 chiave = "";
bool percap = _msk->get_bool(F_PERCAP);
TString16 lettera;
lettera = _msk->get(F_LETTINI);
_lettini = lettera[0];
lettera = _msk->get(F_LETTFIN);
_lettfin = lettera[0];
if (percap)
chiave = "13->CAPCOM|UPPER(90->COGNOME)|UPPER(90->NOME)";
else
@ -240,8 +255,6 @@ bool TPercat_application::set_print(int m)
current_cursor()->setfilter((const char*) filtro, TRUE);
reset_files();
add_file(LF_SOGGETTI);
//filtra_sezioni();
const TString16 catpri = _msk->get(F_CAT1);
const TString16 catsec = _msk->get(F_CAT2);
const TString16 catter = _msk->get(F_CAT3);
@ -278,9 +291,7 @@ bool TPercat_application::set_print(int m)
_catnondon.add((const char*) catnqui);
if (catnses.not_empty() && catnses.ok())
_catnondon.add((const char*) catnses);
current_cursor()->set_filterfunction (filter_func_percat);
reset_print();
crea_intestazione();
return TRUE;
@ -289,10 +300,9 @@ bool TPercat_application::set_print(int m)
return FALSE;
}
void TPercat_application::crea_intestazione()
void TStampaPerCategorie::crea_intestazione()
{
reset_header();
if (_tipo_stampa == elenco)
{
TString sep(132);
@ -304,36 +314,27 @@ void TPercat_application::crea_intestazione()
sep = "";
sep << "Pag. @#";
set_header(2, "@120g%s", (const char*) sep);
sep = "";
sep.fill('-');
set_header(3, (const char *) sep);
set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gIndirizzo@100gTelefono abit.@116gTelefono lavoro");
set_header(5,"@49gCAP/Località/Comune/Prov.@116gTelefono altro");
set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g---------------");
}
}
bool TPercat_application::user_create()
bool TStampaPerCategorie::user_create()
{
_rel = new TRelation(LF_SOGGETTI);
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCP);
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
// per stampare nell'intestazione la denominazione della sezione
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
//_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
//_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
//_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
//_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
_form_eti = new TEti_percat_form("AT_ETSOG");
_msk = new TMask("at2700a");
return TRUE;
}
bool TPercat_application::user_destroy()
bool TStampaPerCategorie::user_destroy()
{
delete _msk;
delete _rel;
@ -343,10 +344,7 @@ bool TPercat_application::user_destroy()
int at2700(int argc, char* argv[])
{
TPercat_application a;
TStampaPerCategorie a;
a.run(argc, argv, "Elenco per categorie");
return 0;
}

View File

@ -37,6 +37,8 @@
#define F_D_CATN6 312
#define F_PERCAP 401
#define F_LETTINI 402
#define F_LETTFIN 403
#define F_ELENCO 501
#define F_ETICHETTE 502

View File

@ -1,6 +1,6 @@
#include "at2700a.h"
#include "lf.h"
PAGE "Definizione Stampe" -1 -1 78 20
PAGE "Stampa soggetti per categorie" -1 -1 78 20
GROUPBOX DLG_NULL 77 4
BEGIN
@ -372,8 +372,24 @@ END
BOOLEAN F_PERCAP
BEGIN
PROMPT 2 15 "Ordinamento per CAP"
MESSAGE TRUE DISABLE,1@
MESSAGE FALSE ENABLE,1@
END
STRING F_LETTINI 1
BEGIN
PROMPT 30 15 "Selezione iniziali cognome: da "
GROUP 1
PICTURE "!"
END
STRING F_LETTFIN 1
BEGIN
PROMPT 63 15 "a "
GROUP 1
//VALIDATE (#F_LETTINI<=#F_LETTFIN)
PICTURE "!"
END
GROUPBOX DLG_NULL 77 4
BEGIN

View File

@ -44,6 +44,7 @@ HIDDEN inline TCarica_app& app() { return (TCarica_app&) main_app(); }
bool TCarica_app::create()
{
TApplication::create();
_msk = new TMask("at3100a");
_rel = new TRelation(LF_SOGGETTI);
_trasfile = new TFile_text("sogg.txt","sogg.ini");
@ -57,7 +58,7 @@ bool TCarica_app::destroy()
delete _rel;
delete _msk;
delete _trasfile;
return TRUE;
return TApplication::destroy();
}
bool TCarica_app::menu(MENU_TAG m)
@ -95,7 +96,9 @@ int TCarica_app::write()
{
pi->addstatus(1);
if (_trasfile->read(rec) == NOERR)
{
_trasfile->autosave(*_rel, rec);
}
}
delete pi;

View File

@ -33,15 +33,14 @@ public:
virtual ~TScadenze_form() {};
};
class TScadenze_application : public TPrintapp
class TStampaScadenze : public TPrintapp
{
TRelation* _rel;
TMask* _msk;
TScadenze_form* _form_eti;
TScadenze_form* _form_car;
TAssoc_array _categorie;
int _cur1, _cur2, _cur3, _cur4;
int _cur;
TParagraph_string _cognome_nome;
TDate _data_stampa;
TDate _dataini, _datafin, _dataultid;
@ -69,16 +68,16 @@ public:
void header_sezione(const TString16 codsez, const TString16 codsot);
void dati_sezione(const TString16 codsez, const TString16 codsot);
TMask& app_mask() { return *_msk; }
TScadenze_application() : _data_stampa(TODAY), _cognome_nome("",25) {}
TStampaScadenze() : _data_stampa(TODAY), _cognome_nome("",25) {}
};
HIDDEN inline TScadenze_application& app() { return (TScadenze_application&) main_app(); }
HIDDEN inline TStampaScadenze& app() { return (TStampaScadenze&) main_app(); }
TCursor* TScadenze_form::cursor() const { return app().current_cursor(); }
TRelation* TScadenze_form::relation() const { return cursor()->relation(); }
ts TScadenze_application::dati_cartoline()
ts TStampaScadenze::dati_cartoline()
{
TMask msk("at4100b");
if (msk.run() == K_ENTER)
@ -99,13 +98,12 @@ ts TScadenze_application::dati_cartoline()
return undefined;
}
void TScadenze_application::filtra_sezioni()
void TStampaScadenze::filtra_sezioni()
{
const TString16 sezini = _msk->get(F_SEZINI);
const TString16 sotini = _msk->get(F_SOTINI);
const TString16 sezfin = _msk->get(F_SEZFIN);
const TString16 sotfin = _msk->get(F_SOTFIN);
select_cursor(_cur4);
TRectype da(LF_SOGGETTI);
TRectype a(LF_SOGGETTI);
if (sezini.not_empty())
@ -119,7 +117,7 @@ void TScadenze_application::filtra_sezioni()
current_cursor()->setregion(da, a);
}
void TScadenze_application::set_page(int file, int cnt)
void TStampaScadenze::set_page(int file, int cnt)
{
// costruzione etichette
switch (_tipo_stampa)
@ -133,8 +131,9 @@ void TScadenze_application::set_page(int file, int cnt)
TPrintrow& riga = corpo.row(i);
set_row(i+1,riga);
}
force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
// serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
force_setpage(TRUE);
}
break;
case cartoline:
@ -212,7 +211,7 @@ void TScadenze_application::set_page(int file, int cnt)
}
}
bool TScadenze_application::filter_func_scadenze(const TRelation* rel)
bool TStampaScadenze::filter_func_scadenze(const TRelation* rel)
{
bool filtrato = TRUE;
TLocalisamfile& sog = rel->lfile();
@ -281,7 +280,7 @@ bool TScadenze_application::filter_func_scadenze(const TRelation* rel)
return filtrato;
}
bool TScadenze_application::preprocess_page(int file, int counter)
bool TStampaScadenze::preprocess_page(int file, int counter)
{
switch (_tipo_stampa)
{
@ -309,7 +308,7 @@ bool TScadenze_application::preprocess_page(int file, int counter)
return TRUE;
}
void TScadenze_application::header_sezione(const TString16 codsez, const TString16 codsot)
void TStampaScadenze::header_sezione(const TString16 codsez, const TString16 codsot)
{
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
@ -330,7 +329,7 @@ void TScadenze_application::header_sezione(const TString16 codsez, const TString
return;
}
void TScadenze_application::dati_sezione(const TString16 codsez, const TString16 codsot)
void TStampaScadenze::dati_sezione(const TString16 codsez, const TString16 codsot)
{
_intest1 = current_cursor()->curr(LF_SEZIONI).get(SEZ_INTESTAZ1);
_intest2 = current_cursor()->curr(LF_SEZIONI).get(SEZ_INTESTAZ2);
@ -353,7 +352,7 @@ void TScadenze_application::dati_sezione(const TString16 codsez, const TString16
return;
}
bool TScadenze_application::set_print(int m)
bool TStampaScadenze::set_print(int m)
{
_tipo_stampa = undefined;
KEY tasto;
@ -401,7 +400,7 @@ bool TScadenze_application::set_print(int m)
_giorni[5] = 'X';
if (_msk->get_bool(F_GPD_DOM))
_giorni[6] = 'X';
// filtro per sezioni selezionati
// filtro per sezioni selezionati
filtra_sezioni();
// filtro per categorie
const TString16 catpri = _msk->get(F_CAT1);
@ -437,10 +436,9 @@ bool TScadenze_application::set_print(int m)
return FALSE;
}
void TScadenze_application::crea_intestazione()
void TStampaScadenze::crea_intestazione()
{
reset_header();
if (_tipo_stampa == elenco)
{
TString sep(132);
@ -466,18 +464,16 @@ void TScadenze_application::crea_intestazione()
sep = "";
sep << "Pag. @#";
set_header(2, "@120g%s", (const char*) sep);
sep = "";
sep.fill('-');
set_header(3, (const char *) sep);
set_header(5,"@0gCod.@10gC.@13gCognome@39gNato il@50gData pr.SI@61gData pr.AF@72gData/Tipo@83gData/Tipo@94gIdon.@100gAB0");
set_header(6,"@13gNome@50gInterv. SI@61gInterv. AF@72gult. don.@83gult. idon.@94gper@100gRh");
set_header(7,"@0g---------@10g--@13g-------------------------@39g----------@50g----------@61g----------@72g----------@83g----------@94g-----");
}
}
bool TScadenze_application::user_create()
bool TStampaScadenze::user_create()
{
_rel = new TRelation(LF_SOGGETTI);
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
@ -485,21 +481,15 @@ bool TScadenze_application::user_create()
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
// per stampare la denominazione della sezione nell'intestazione
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
//cursore ordinamento per sezione+sottogruppo+cognome+nome
_cur = add_cursor(new TCursor(_rel, "", 3));
_msk = new TMask("at4100a");
_form_eti = new TScadenze_form("AT_ETSOG");
_form_car = new TScadenze_form("AT_ETCAR");
return TRUE;
}
bool TScadenze_application::user_destroy()
bool TStampaScadenze::user_destroy()
{
delete _msk;
delete _rel;
@ -510,10 +500,7 @@ bool TScadenze_application::user_destroy()
int at4100(int argc, char* argv[])
{
TScadenze_application a;
TStampaScadenze a;
a.run(argc, argv, "Scadenze di donazione");
return 0;
}

View File

@ -1,6 +1,6 @@
#include "at4100a.h"
#include "lf.h"
PAGE "Definizione Stampe" -1 -1 78 20
PAGE "Stampa scadenze di donazione" -1 -1 78 20
GROUPBOX DLG_NULL 77 4
BEGIN
@ -331,7 +331,7 @@ END
GROUPBOX DLG_NULL 25 8
BEGIN
PROMPT 53 9 "Tipizzazione"
PROMPT 53 9 "Dati gruppo-ematici"
END
LISTBOX F_AB01 5

View File

@ -29,7 +29,7 @@ public:
virtual ~TUrgenze_form() {};
};
class TUrgenze_application : public TPrintapp
class TStampaUrgenze : public TPrintapp
{
static bool filter_func_urgenze(const TRelation* rel);
@ -39,16 +39,13 @@ class TUrgenze_application : public TPrintapp
TRectype* _sangue;
TAssoc_array _categorie;
long _giorni;
int _cur1, _cur2, _cur3, _cur4;
int _cur;
TParagraph_string _cognome_nome, _dencom;
TDate _data_stampa;
TDate _dataini, _datafin;
ts _tipo_stampa;
TString16 _codsez, _codsot;
protected:
virtual bool user_create();
virtual bool user_destroy();
@ -63,22 +60,21 @@ public:
TMask& app_mask() { return *_msk; }
TRectype& get_sangue() { return *_sangue; }
TUrgenze_application() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {}
TStampaUrgenze() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {}
};
HIDDEN inline TUrgenze_application& app() { return (TUrgenze_application&) main_app(); }
HIDDEN inline TStampaUrgenze& app() { return (TStampaUrgenze&) main_app(); }
TCursor* TUrgenze_form::cursor() const { return app().current_cursor(); }
TRelation* TUrgenze_form::relation() const { return cursor()->relation(); }
void TUrgenze_application::filtra_sezioni()
void TStampaUrgenze::filtra_sezioni()
{
const TString16 sezini = _msk->get(F_SEZINI);
const TString16 sotini = _msk->get(F_SOTINI);
const TString16 sezfin = _msk->get(F_SEZFIN);
const TString16 sotfin = _msk->get(F_SOTFIN);
select_cursor(_cur4);
TRectype da(LF_SOGGETTI);
TRectype a(LF_SOGGETTI);
if (sezini.not_empty())
@ -92,7 +88,7 @@ void TUrgenze_application::filtra_sezioni()
current_cursor()->setregion(da, a);
}
void TUrgenze_application::set_page(int file, int cnt)
void TStampaUrgenze::set_page(int file, int cnt)
{
switch (_tipo_stampa)
{
@ -106,8 +102,9 @@ void TUrgenze_application::set_page(int file, int cnt)
TPrintrow& riga = corpo.row(i);
set_row(i+1,riga);
}
force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
// serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
force_setpage(TRUE);
}
break;
case elenco:
@ -127,7 +124,7 @@ void TUrgenze_application::set_page(int file, int cnt)
}
}
bool TUrgenze_application::filter_func_urgenze(const TRelation* rel)
bool TStampaUrgenze::filter_func_urgenze(const TRelation* rel)
{
bool filtrato = TRUE;
TLocalisamfile& sog = rel->lfile();
@ -157,7 +154,7 @@ bool TUrgenze_application::filter_func_urgenze(const TRelation* rel)
return filtrato;
}
bool TUrgenze_application::preprocess_page(int file, int counter)
bool TStampaUrgenze::preprocess_page(int file, int counter)
{
if (_tipo_stampa == elenco)
{
@ -197,7 +194,7 @@ bool TUrgenze_application::preprocess_page(int file, int counter)
return TRUE;
}
void TUrgenze_application::header_sezione(const TString16 codsez, const TString16 codsot)
void TStampaUrgenze::header_sezione(const TString16 codsez, const TString16 codsot)
{
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
@ -218,7 +215,7 @@ void TUrgenze_application::header_sezione(const TString16 codsez, const TString1
return;
}
bool TUrgenze_application::set_print(int)
bool TStampaUrgenze::set_print(int)
{
_tipo_stampa = undefined;
KEY tasto;
@ -288,10 +285,9 @@ bool TUrgenze_application::set_print(int)
return FALSE;
}
void TUrgenze_application::crea_intestazione()
void TStampaUrgenze::crea_intestazione()
{
reset_header();
if (_tipo_stampa == elenco)
{
TString sep(132);
@ -303,18 +299,16 @@ void TUrgenze_application::crea_intestazione()
sep = "";
sep << "Pag. @#";
set_header(2, "@120g%s", (const char*) sep);
sep = "";
sep.fill('-');
set_header(3, (const char *) sep);
set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gIndirizzo@100gTelefono abit.@116gTelefono lavoro");
set_header(5,"@49gCAP/Località/Comune/Prov.@116gTelefono altro");
set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g---------------");
}
}
bool TUrgenze_application::user_create()
bool TStampaUrgenze::user_create()
{
_rel = new TRelation(LF_SOGGETTI);
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
@ -322,19 +316,15 @@ bool TUrgenze_application::user_create()
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
// per stampare nell'intestazione la denominazione della sezione
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
// ordinamento per sezione+sottogruppo+cognome+nome
_cur = add_cursor(new TCursor(_rel, "", 3));
_form_eti = new TUrgenze_form("AT_ETSOG");
_msk = new TMask("at4200a");
_sangue = new TRectype(LF_SOGGETTI);
return TRUE;
}
bool TUrgenze_application::user_destroy()
bool TStampaUrgenze::user_destroy()
{
delete _msk;
delete _rel;
@ -345,10 +335,7 @@ bool TUrgenze_application::user_destroy()
int at4200(int argc, char* argv[])
{
TUrgenze_application a;
TStampaUrgenze a;
a.run(argc, argv, "Urgenze");
return 0;
}

View File

@ -1,6 +1,6 @@
#include "at4200a.h"
#include "lf.h"
PAGE "Definizione Stampe" -1 -1 78 20
PAGE "Stampa Urgenze" -1 -1 78 20
GROUPBOX DLG_NULL 77 4
BEGIN
@ -247,7 +247,7 @@ END
GROUPBOX DLG_NULL 77 3
BEGIN
PROMPT 1 10 "Tipizzazione richiesta"
PROMPT 1 10 "Dati gruppo-ematici richiesti"
END
LISTBOX F_GRUPPOAB0 4

View File

@ -1,7 +1,7 @@
#include <form.h>
#include <mask.h>
#include <msksheet.h>
#include <printapp.h>
#include <utility.h>
#include "lf.h"
#include "soggetti.h"
@ -9,6 +9,8 @@
#include "at4.h"
#include "at4300a.h"
#include "at4100b.h"
#include "at4100c.h"
#define ALIAS_TABCTD 100 // alias tabella categorie donatori
#define ALIAS_TABTCS 200 // alias tabella tipi/esiti controlli sanitari
@ -33,7 +35,7 @@ public:
virtual ~TConv_form() {};
};
class TConv_application : public TPrintapp
class TStampaConvocazioni : public TPrintapp
{
static bool filter_func_conv(const TRelation* rel);
@ -41,79 +43,93 @@ class TConv_application : public TPrintapp
TMask* _msk;
TConv_form* _form_eti; // per etichette
TConv_form* _form_car; // per cartoline
TAssoc_array _asezioni;
int _cur1, _cur2, _cur3, _cur4;
int _cur;
TDate _data_stampa;
int _sez_corrente;
ts _tipo_stampa;
bool _intesta;
// completare con tutti i dati selezionabili
TString16 _codsez, _codsot;
TString16 _codsez, _codsot, _orario, _datacart;
TString80 _invitoper, _data, _presso1, _presso2, _presso3, _presso4;
TString80 _note, _intest1, _intest2, _intest3, _intest4;
TDate _dataconv;
bool _usasez;
long _intmin, _intmax;
TParagraph_string _cognome_nome;
int _numconv;
bool _definitiva;
protected:
virtual bool user_create();
virtual bool user_destroy();
virtual bool set_print(int m);
virtual void set_page(int file, int cnt);
virtual void print();
virtual bool preprocess_page (int file, int counter);
static bool check_sez_sheet(const char* codice);
static bool convocazioni_notify(TSheet_field& s, int r, KEY k);
static void add_rows_convocazioni(TSheet_field& s, int count = 10, int start = 1);
ts dati_cartoline();
public:
void crea_intestazione();
void filtra_sezione();
void header_sezione();
TConv_application() : _data_stampa(TODAY) {}
void filtra_sezioni();
void header_sezione(const TString16 codsez, const TString16 codsot);
void dati_sezione(const TString16 codsez, const TString16 codsot);
TStampaConvocazioni() : _data_stampa(TODAY), _cognome_nome("",25) {}
};
HIDDEN inline TConv_application& app() { return (TConv_application&) main_app(); }
HIDDEN inline TStampaConvocazioni& app() { return (TStampaConvocazioni&) main_app(); }
TCursor* TConv_form::cursor() const { return app().current_cursor(); }
TRelation* TConv_form::relation() const { return cursor()->relation(); }
void TConv_application::add_rows_convocazioni(TSheet_field& s, int count, int start)
ts TStampaConvocazioni::dati_cartoline()
{
if (start == 1)
s.destroy();
for (int r=start; r<start+count; r++)
TToken_string& row = s.row(r-1);
TMask msk("at4100b");
if (msk.run() == K_ENTER)
{
_invitoper = msk.get(F_INVITOPER);
_data = msk.get(F_DATA);
_presso1 = msk.get(F_PRESSO1);
_presso2 = msk.get(F_PRESSO2);
_presso3 = msk.get(F_PRESSO3);
_presso4 = msk.get(F_PRESSO4);
_datacart = msk.get(F_DATACART);
_orario = msk.get(F_ORARIO);
_note = msk.get(F_NOTE);
_usasez = msk.get_bool(F_USASEZ);
return cartoline;
}
else
return undefined;
}
void TConv_application::set_page(int file, int cnt)
void TStampaConvocazioni::set_page(int file, int cnt)
{
switch (_tipo_stampa)
{
case elenco:
{
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"#########"));
set_row(1,"@10g@S", FLD(LF_SOGGETTI,SOG_CATDON));
set_row(1,"@13g@S", FLD(LF_SOGGETTI,SOG_COGNOME));
set_row(1,"@39g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
set_row(1,"@50g@ld", FLD(LF_SOGGETTI,SOG_DATAPROSSI));
set_row(1,"@61g@ld", FLD(LF_SOGGETTI,SOG_DATAPROSAF));
set_row(1,"@72g@ld", FLD(LF_SOGGETTI,SOG_DATAULTDON));
set_row(1,"@83g@ld", FLD(LF_SOGGETTI,SOG_DATAULTID));
set_row(1,"@94g@S", FLD(LF_SOGGETTI,SOG_IDON1));
set_row(1,"@97g@S", FLD(LF_SOGGETTI,SOG_IDON2));
set_row(2,"@13g@S", FLD(LF_SOGGETTI,SOG_NOME));
set_row(2,"@53g@pn", FLD(LF_SOGGETTI,SOG_INTSI,"###"));
set_row(2,"@64g@pn", FLD(LF_SOGGETTI,SOG_INTAF,"###"));
set_row(2,"@76g@S", FLD(LF_SOGGETTI,SOG_TIPOULTDON));
set_row(2,"@87g@S", FLD(LF_SOGGETTI,SOG_TIPOULTID));
set_row(2,"@94g@S", FLD(LF_SOGGETTI,SOG_IDON3));
set_row(2,"@97g@S", FLD(LF_SOGGETTI,SOG_IDON4));
if (printer().rows_left() < 3)
printer().formfeed();
reset_row(1);
reset_row(2);
reset_row(3);
set_row(1,"@0g@S", FLD(LF_SOGGETTI,SOG_CODCL));
// stampare il numero convocazione
//set_row(1,"@7g@pn", FLD(LF_SOGGETTI,SOG_NUMCONV,"###"));
//set_row(1,"@7g#3a", &_numconv);
set_row(1,"@11g#a", &_cognome_nome);
set_row(1,"@37g@ld",FLD(LF_SOGGETTI,SOG_DATANASC));
set_row(1,"@48g@S", FLD(LF_SOGGETTI,SOG_GRUPPOAB0));
set_row(1,"@52g@S", FLD(LF_SOGGETTI,SOG_RHANTID));
set_row(1,"@56g@S", FLD(LF_SOGGETTI,SOG_KELL));
set_row(1,"@60g@S", FLD(LF_SOGGETTI,SOG_FENOTIPORH));
set_row(1,"@67g@S", FLD(LF_SOGGETTI,SOG_DU));
set_row(1,"@71g@ld",FLD(LF_SOGGETTI,SOG_DATAULTDON));
set_row(1,"@82g@S", FLD(LF_SOGGETTI,SOG_TIPOULTDON));
set_row(1,"@85g@ld",FLD(LF_SOGGETTI,SOG_DATAPROSSI));
set_row(2,"@0g@S", FLD(LF_SOGGETTI,SOG_TESSAVIS));
set_row(2,"@37g@S", FLD(LF_SOGGETTI,SOG_CATDON));
set_row(2,"@71g@ld",FLD(LF_SOGGETTI,SOG_DATAULTID));
set_row(2,"@82g@S", FLD(LF_SOGGETTI,SOG_TIPOULTID));
set_row(2,"@85g@pn",FLD(LF_SOGGETTI,SOG_INTSI,"###"));
set_row(3,"");
}
break;
case etichette:
@ -133,12 +149,46 @@ void TConv_application::set_page(int file, int cnt)
case cartoline:
{
TPrint_section& corpo = _form_car->get_body();
corpo.reset();
const TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
const TString16 codsot = current_cursor()->curr().get(SOG_CODSOT);
if ((_codsez!=codsez)||(_codsot!=codsot))
{
_codsez = codsez;
_codsot = codsot;
dati_sezione(codsez, codsot);
corpo.reset();
TForm_item& intest1 = corpo.find_field(CAR_INTEST1);
intest1.set(_intest1);
TForm_item& intest2 = corpo.find_field(CAR_INTEST2);
intest2.set(_intest2);
TForm_item& intest3 = corpo.find_field(CAR_INTEST3);
intest3.set(_intest3);
TForm_item& intest4 = corpo.find_field(CAR_INTEST4);
intest4.set(_intest4);
TForm_item& invito = corpo.find_field(CAR_INVITOPER);
invito.set(_invitoper);
TForm_item& data = corpo.find_field(CAR_DATA);
data.set(_data);
TForm_item& presso1 = corpo.find_field(CAR_PRESSO1);
presso1.set(_presso1);
TForm_item& presso2 = corpo.find_field(CAR_PRESSO2);
presso2.set(_presso2);
TForm_item& presso3 = corpo.find_field(CAR_PRESSO3);
presso3.set(_presso3);
TForm_item& presso4 = corpo.find_field(CAR_PRESSO4);
presso4.set(_presso4);
TForm_item& orario = corpo.find_field(CAR_ORARIO);
orario.set(_orario);
TForm_item& datacart = corpo.find_field(CAR_DATACART);
datacart.set(_datacart);
TForm_item& note = corpo.find_field(CAR_NOTE);
note.set(_note);
}
corpo.update();
for (int i = 0; i < corpo.items(); i++)
for (int i = 0; i < corpo.height(); i++)
{
TPrintrow& riga = corpo.row(i);
set_row(i+1,"%s",riga.row());
set_row(i+1,riga);
}
force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage
// altrimenti stampa sempre la stessa etichetta
@ -147,7 +197,28 @@ void TConv_application::set_page(int file, int cnt)
}
}
bool TConv_application::filter_func_conv (const TRelation* rel)
void TStampaConvocazioni::header_sezione(const TString16 codsez, const TString16 codsot)
{
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
TString intestazione(132);
intestazione = "Sezione: ";
intestazione << codsez;
intestazione << "/";
intestazione << codsot;
intestazione << " ";
intestazione << densez;
if ((densot.ok())&& (densot.not_empty()))
{
intestazione << "/";
intestazione << densot;
}
intestazione.center_just();
set_header(1,"@0g%s", (const char*) intestazione);
return;
}
bool TStampaConvocazioni::filter_func_conv (const TRelation* rel)
{
TLocalisamfile& sog = rel->lfile();
const TDate dataprossi = sog.get_date(SOG_DATAPROSSI);
@ -170,86 +241,95 @@ bool TConv_application::filter_func_conv (const TRelation* rel)
return FALSE;
}
bool TConv_application::preprocess_page(int file, int counter)
bool TStampaConvocazioni::preprocess_page(int file, int counter)
{
if ((_tipo_stampa == elenco) && (!_intesta))
switch (_tipo_stampa)
{
_intesta = TRUE;
header_sezione();
case elenco:
{
TRectype& recsog = current_cursor()->curr();
const TString16 codsez = recsog.get(SOG_CODSEZ);
const TString16 codsot = recsog.get(SOG_CODSOT);
TString80 nome = recsog.get(SOG_COGNOME);
nome << " ";
nome << recsog.get(SOG_NOME);
_cognome_nome = nome;
// salto pagina se cambio sezione
if ((_codsez!=codsez)||(_codsot!=codsot))
{
if (_codsez != "**")
printer().formfeed();
_codsez = codsez;
_codsot = codsot;
header_sezione(codsez, codsot);
}
}
break;
}
if (_tipo_stampa == etichette || _tipo_stampa == cartoline)
TRectype& recsog = current_cursor()->curr();
TString80 nome = recsog.get(SOG_COGNOME);
nome << " ";
nome << recsog.get(SOG_NOME);
_cognome_nome = nome;
_numconv = recsog.get_int(SOG_NUMCONV);
_numconv++;
if (_definitiva)
{
TRectype& recsog = current_cursor()->curr();
recsog.put(SOG_DATACONV,app()._dataconv);
int numconv = recsog.get_int(SOG_NUMCONV);
numconv++;
recsog.put(SOG_NUMCONV, numconv);
current_cursor()->file().rewrite();
recsog.put(SOG_NUMCONV, _numconv);
if (_numconv > 4)
return FALSE;
else
{
recsog.put(SOG_DATACONV,app()._dataconv);
current_cursor()->file().rewrite();
}
}
return TRUE;
}
void TConv_application::print()
void TStampaConvocazioni::filtra_sezioni()
{
_intesta = FALSE;
filtra_sezione();
TPrint_application::print();
TSheet_field& s = (TSheet_field&)_msk->field(F_CONVOCAZIONI);
_sez_corrente++;
if (_sez_corrente <= s.items())
repeat_print();
return;
}
void TConv_application::filtra_sezione()
{
TSheet_field& s = (TSheet_field&)_msk->field(F_CONVOCAZIONI);
TToken_string& row = s.row(_sez_corrente-1);
_codsez = row.get(0);
_codsot = row.get();
_dataconv = row.get();
// deve diventare un membro
TString16 _giorno = row.get();
_intmin = row.get_int();
_intmax = row.get_int();
// deve diventare un membro
TString16 _tipoconv = row.get();
select_cursor(_cur4);
const TString16 sezini = _msk->get(F_SEZINI);
const TString16 sotini = _msk->get(F_SOTINI);
const TString16 sezfin = _msk->get(F_SEZFIN);
const TString16 sotfin = _msk->get(F_SOTFIN);
TRectype da(LF_SOGGETTI);
TRectype a(LF_SOGGETTI);
da.zero();
a.zero('Z');
if (_codsez.not_empty())
{
da.put(SOG_CODSEZ, _codsez);
a.put(SOG_CODSEZ, _codsez);
}
if (_codsot.not_empty())
{
da.put(SOG_CODSOT, _codsot);
a.put(SOG_CODSOT, _codsot);
}
current_cursor()->freeze(FALSE);
if (sezini.not_empty())
da.put(SOG_CODSEZ, sezini);
if (sotini.not_empty())
da.put(SOG_CODSOT, sotini);
if (sezfin.not_empty())
a.put(SOG_CODSEZ, sezfin);
if (sotfin.not_empty())
a.put(SOG_CODSOT, sotfin);
current_cursor()->setregion(da, a);
}
}
void TStampaConvocazioni::dati_sezione(const TString16 codsez, const TString16 codsot)
{
_intest1 = current_cursor()->curr(LF_SEZIONI).get(SEZ_INTESTAZ1);
_intest2 = current_cursor()->curr(LF_SEZIONI).get(SEZ_INTESTAZ2);
_intest3 = current_cursor()->curr(LF_SEZIONI).get(SEZ_INTESTAZ3);
_intest4 = current_cursor()->curr(LF_SEZIONI).get(SEZ_INTESTAZ4);
if (_usasez)
{
if (_presso1.blank())
{
_presso1 = current_cursor()->curr(LF_SEZIONI).get(SEZ_CONVSEDE1);
_presso2 = current_cursor()->curr(LF_SEZIONI).get(SEZ_CONVSEDE2);
_presso3 = current_cursor()->curr(LF_SEZIONI).get(SEZ_CONVSEDE3);
_presso4 = current_cursor()->curr(LF_SEZIONI).get(SEZ_CONVSEDE4);
}
if (_orario.blank())
_orario = current_cursor()->curr(LF_SEZIONI).get(SEZ_CONVORA);
if (_note.blank())
_note = current_cursor()->curr(LF_SEZIONI).get(SEZ_CONVNOTE);
}
return;
}
bool TConv_application::set_print(int)
bool TStampaConvocazioni::set_print(int)
{
TSheet_field& s = (TSheet_field&)_msk->field(F_CONVOCAZIONI);
if (s.items()==0)
add_rows_convocazioni(s,8);
_asezioni.destroy();
for (int r=0; r < s.items(); r++)
{
TToken_string& row = s.row(r);
TString16 codice = row.get(0);
TString16 codsot = row.get();
codice << codsot;
if (codice.not_empty())
_asezioni.add(codice);
}
_tipo_stampa = undefined;
KEY tasto;
tasto = _msk->run();
@ -262,26 +342,21 @@ bool TConv_application::set_print(int)
_tipo_stampa = etichette;
break;
case F_CARTOLINE:
_tipo_stampa = cartoline;
_tipo_stampa = dati_cartoline();
break;
case K_ESC:
_msk->reset();
}
if (_tipo_stampa != undefined)
{
reset_files();
_codsez = "**";
_codsot = "**";
reset_files();
add_file(LF_SOGGETTI);
select_cursor(_cur4);
TSheet_field& s = (TSheet_field&)_msk->field(F_CONVOCAZIONI);
for (int r=s.items()-1; r>=s.first_empty(); r--)
{
TToken_string& row = s.row(r);
_codsez = row.get(0);
_codsot = row.get();
if (_codsez.empty() || (!_codsez.ok()))
s.destroy(r);
}
_dataconv = _msk->get(F_DATACONV);
_intmin = _msk->get_int(F_INTMIN);
_intmax = _msk->get_int(F_INTMAX);
_definitiva = _msk->get_bool(F_DEFINITIVA);
// filtro per sezioni selezionati
filtra_sezioni();
// filtro su non esclusi, idonei e categorie non dimessi
// questo filtro non funziona perchè non funziona il riconoscimento dell'alias
// nelle espressioni; sarebbe molto bello averlo a disposizione!
@ -291,7 +366,6 @@ bool TConv_application::set_print(int)
// filtro su data e altri filtri che non posso mettere nella setfilter
current_cursor()->set_filterfunction (filter_func_conv, TRUE);
reset_print();
_sez_corrente = 1;
crea_intestazione();
return TRUE;
}
@ -299,57 +373,31 @@ bool TConv_application::set_print(int)
return FALSE;
}
void TConv_application::crea_intestazione()
void TStampaConvocazioni::crea_intestazione()
{
reset_header();
if (_tipo_stampa == elenco)
{
TString sep(132);
sep = "CONVOCAZIONI PER SEZIONE fatte il ";
sep << _dataconv.string();
sep.center_just();
set_header(2, "@0g%s", (const char*) sep);
TString16 data_stampa = _data_stampa.string();
set_header(2,"@0g%10s", (const char*) data_stampa);
sep = "";
sep << "Pag. @#";
set_header(2, "@120g%s", (const char*) sep);
sep = "";
sep.fill('-');
set_header(3, (const char *) sep);
set_header(5,"@0gCod.@10gC.@13gCognome@39gNato il@50gData pr.SI@61gData pr.AF@72gData/Tipo@83gData/Tipo@94gIdon.");
set_header(6,"@13gNome@50gInterv. SI@61gInterv. AF@72gult. don.@83gult. idon.@94gper");
set_header(7,"@0g---------@10g--@13g-------------------------@39g----------@50g----------@61g----------@72g----------@83g----------@94g-----");
set_header(5,"@0gCod.CL@7gNC@11gCognome e nome@37gNato il@48gGr.@52gRh@55gKell@60gFen.Rh@67gDu@71gUltima donaz.@85gData pros.");
set_header(6,"@0gTess.@37gCat.don@71gUltima idon.@85gInt.SI");
set_header(7,"@0g------@7g---@11g-------------------------@37g----------@48g--- --- --- ------ --@71g---------- --@85g---------- --@83g----------");
}
}
void TConv_application::header_sezione()
{
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
TString intestazione(132);
intestazione = "Sezione: ";
intestazione << _codsez;
intestazione << "/";
intestazione << _codsot;
intestazione << " ";
intestazione << densez;
if ((densot.ok())&& (densot.not_empty()))
{
intestazione << "/";
intestazione << densot;
}
intestazione.center_just();
set_header(1,"@0g%s", (const char*) intestazione);
intestazione = "ELENCO CONVOCATI PER IL ";
intestazione << _dataconv.string();
intestazione.center_just();
set_header(2, "@0g%s", (const char*) intestazione);
TString16 data_stampa = _data_stampa.string();
set_header(2,"@0g%10s", (const char*) data_stampa);
intestazione = "";
intestazione << "Pag. @#";
set_header(2, "@120g%s", (const char*) intestazione);
return;
}
bool TConv_application::user_create()
bool TStampaConvocazioni::user_create()
{
_rel = new TRelation(LF_SOGGETTI);
_rel->add("TCS", "CODTAB==STATO", 1, 0, ALIAS_TABTCS); // per verificare che sia IDONEO
@ -357,22 +405,15 @@ bool TConv_application::user_create()
_rel->add("LCP", "CODTAB==DOM_CODLOC", 1, 0, ALIAS_TABLCP); // per verificare che sia DONATORE NON DIMESSO
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
// ordinamento per sezione+sottogruppo+cognome+nome
_cur = add_cursor(new TCursor(_rel, "", 3));
_msk = new TMask("at4300a");
TSheet_field& sc = (TSheet_field&)_msk->field(F_CONVOCAZIONI);
sc.set_notify(convocazioni_notify);
_form_eti = new TConv_form("AT_ETSOG");
_form_car = new TConv_form("AT_CARTO");
return TRUE;
}
bool TConv_application::user_destroy()
bool TStampaConvocazioni::user_destroy()
{
delete _msk;
delete _rel;
@ -381,74 +422,9 @@ bool TConv_application::user_destroy()
return TRUE;
}
bool TConv_application::check_sez_sheet(const char* codice)
{
TAssoc_array& sez = app()._asezioni;
if (sez.is_key(codice))
return FALSE;
else
{
sez.add(codice);
return TRUE;
}
}
bool TConv_application::convocazioni_notify(TSheet_field& s, int r, KEY k)
{
bool ok = TRUE;
switch (k)
{
case K_TAB:
// entrata riga
{
TToken_string& row = s.row(r);
TString16 codice = row.get(0);
TString16 codsot = row.get();
codice << codsot;
if (codice.not_empty())
{
TAssoc_array& array_sez = app()._asezioni;
if (array_sez.is_key(codice))
array_sez.remove(codice);
}
if ((r == s.items()-1) && (r == s.first_empty()))
{
add_rows_convocazioni(s,8,r+1);
s.select(r);
}
}
break;
case K_CTRL+K_TAB:
// uscita riga
{
TToken_string& row = s.row(r);
TString16 codice = row.get(0);
TString16 codsot = row.get();
codice << codsot;
if (codice.not_empty())
{
ok = check_sez_sheet(codice);
if (!ok)
return s.error_box("Sezione già convocata");
}
if ((r == s.items()-1) && (r == s.first_empty()))
{
add_rows_convocazioni(s,8,r+1);
s.select(r);
}
}
break;
}
return ok;
}
int at4300(int argc, char* argv[])
{
TConv_application a;
a.run(argc, argv, "Convocazioni Parma");
TStampaConvocazioni a;
a.run(argc, argv, "Convocazioni per sezione");
return 0;
}

View File

@ -1,18 +1,17 @@
// convocazioni
// convocazioni su sezione
// definizione campi per maschera di selezione
#define F_CONVOCAZIONI 101
#define F_ELENCO 401
#define F_ETICHETTE 402
#define F_CARTOLINE 404
// campi di ogni riga
#define F_C_CODSEZ 101
#define F_C_CODSOT 102
#define F_C_DATA 103
#define F_C_GIORNO 104
#define F_C_INTMIN 105
#define F_C_INTMAX 106
#define F_C_CONV 107
#define F_C_DENSEZ 151
#define F_C_DENSOT 152
#define F_SEZINI 101
#define F_D_SEZINI 102
#define F_SOTINI 103
#define F_D_SOTINI 104
#define F_SEZFIN 105
#define F_D_SEZFIN 106
#define F_SOTFIN 107
#define F_D_SOTFIN 108
#define F_DATACONV 109
#define F_INTMIN 110
#define F_INTMAX 111
#define F_DEFINITIVA 112
#define F_ELENCO 401
#define F_ETICHETTE 402
#define F_CARTOLINE 404

View File

@ -1,174 +1,177 @@
#include "at4300a.h"
#include "lf.h"
PAGE "Definizione Stampe" -1 -1 78 20
PAGE "Stampa convocazioni per sezione (Parma)" -1 -1 78 15
GROUPBOX DLG_NULL 77 12
GROUPBOX DLG_NULL 77 4
BEGIN
PROMPT 1 1 "Selezioni per la convocazione"
PROMPT 1 0 "Scelta sezioni/sottogruppi"
END
SPREADSHEET F_CONVOCAZIONI 75 10
STRING F_SEZINI 2
BEGIN
PROMPT 2 2 ""
ITEM "Sez."
ITEM "Sot."
ITEM "Data@10"
ITEM "Giorno@15"
ITEM "Int.min"
ITEM "Int.max"
ITEM "Tipo@15"
PROMPT 2 1 "Da "
FLAGS "U"
USE LF_SEZIONI
INPUT CODSEZ F_SEZINI
INPUT CODSOT F_SOTINI
DISPLAY "Cod.sez" CODSEZ
DISPLAY "Cod.sot." CODSOT
DISPLAY "Sezione@25" DENSEZ
DISPLAY "Sottogruppo@25" DENSOT
OUTPUT F_SEZINI CODSEZ
OUTPUT F_D_SEZINI DENSEZ
OUTPUT F_SOTINI CODSOT
OUTPUT F_D_SOTINI DENSOT
CHECKTYPE SEARCH
HELP "Codice sezione da cui partire"
END
STRING F_D_SEZINI 25
BEGIN
PROMPT 11 1 ""
FLAGS "U"
USE LF_SEZIONI KEY 2
INPUT DENSEZ F_D_SEZINI
DISPLAY "Sezione@25" DENSEZ
DISPLAY "Sottogruppo@25" DENSOT
DISPLAY "Cod.sez" CODSEZ
DISPLAY "Cod.sot." CODSOT
COPY OUTPUT F_SEZINI
CHECKTYPE NORMAL
HELP "Sezione da cui partire"
END
STRING F_SOTINI 2
BEGIN
PROMPT 2 2 " "
COPY ALL F_SEZINI
CHECKTYPE SEARCH
HELP "Codice sottogruppo da cui partire"
END
STRING F_D_SOTINI 25
BEGIN
PROMPT 11 2 ""
FLAGS "U"
COPY USE F_D_SEZINI
INPUT DENSEZ F_D_SEZINI
INPUT DENSOT F_D_SOTINI
COPY DISPLAY F_D_SEZINI
COPY OUTPUT F_D_SEZINI
CHECKTYPE NORMAL
HELP "Sottogruppo da cui partire"
END
STRING F_SEZFIN 2
BEGIN
PROMPT 41 1 "A "
FLAGS "U"
USE LF_SEZIONI
INPUT CODSEZ F_SEZFIN
INPUT CODSOT F_SOTFIN
DISPLAY "Cod.sez" CODSEZ
DISPLAY "Cod.sot." CODSOT
DISPLAY "Sezione@25" DENSEZ
DISPLAY "Sottogruppo@25" DENSOT
OUTPUT F_SEZFIN CODSEZ
OUTPUT F_D_SEZFIN DENSEZ
OUTPUT F_SOTFIN CODSOT
OUTPUT F_D_SOTFIN DENSOT
CHECKTYPE SEARCH
HELP "Codice sezione finale"
END
STRING F_D_SEZFIN 25
BEGIN
PROMPT 49 1 ""
FLAGS "U"
USE LF_SEZIONI KEY 2
INPUT DENSEZ F_D_SEZFIN
DISPLAY "Sezione@25" DENSEZ
DISPLAY "Sottogruppo@25" DENSOT
DISPLAY "Cod.sez" CODSEZ
DISPLAY "Cod.sot." CODSOT
COPY OUTPUT F_SEZFIN
CHECKTYPE NORMAL
HELP "Sezione finale"
END
STRING F_SOTFIN 2
BEGIN
PROMPT 41 2 " "
COPY ALL F_SEZFIN
CHECKTYPE SEARCH
HELP "Codice sottogruppo finale"
END
STRING F_D_SOTFIN 25
BEGIN
PROMPT 49 2 ""
FLAGS "U"
COPY USE F_D_SEZFIN
INPUT DENSEZ F_D_SEZFIN
INPUT DENSOT F_D_SOTFIN
COPY DISPLAY F_D_SEZFIN
COPY OUTPUT F_D_SEZFIN
CHECKTYPE NORMAL
HELP "Sottogruppo finale"
END
GROUPBOX DLG_NULL 77 6
BEGIN
PROMPT 1 4 "Opzioni di convocazione"
END
DATE F_DATACONV
BEGIN
PROMPT 2 5 "Data elaborazione "
HELP "Data elaborazione"
VALIDATE NOT_EMPTY_FUNC
END
NUMBER F_INTMIN 4
BEGIN
PROMPT 2 6 "Intervallo minimo "
END
NUMBER F_INTMAX 4
BEGIN
PROMPT 2 7 "Intervallo massimo "
END
BOOLEAN F_DEFINITIVA
BEGIN
PROMPT 2 8 "Registra stampa convocazione su archivio soggetti"
END
GROUPBOX DLG_NULL 77 4
BEGIN
PROMPT 1 13 "Stampa"
PROMPT 1 11 "Stampa"
END
BUTTON F_ELENCO 9 2
BEGIN
PROMPT -15 14 "Elenco"
PROMPT -14 12 "Elenco"
MESSAGE EXIT,F_ELENCO
END
BUTTON F_ETICHETTE 9 2
BEGIN
PROMPT -25 14 "Etichette"
PROMPT -24 12 "Etichette"
MESSAGE EXIT,F_ETICHETTE
END
BUTTON F_CARTOLINE 9 2
BEGIN
PROMPT -35 14 "Cartoline"
MESSAGE EXIT,F_ETICHETTE
END
BUTTON DLG_CANCEL 9 2
BEGIN
PROMPT -45 14 ""
PROMPT -34 12 "Cartoline"
MESSAGE EXIT,F_CARTOLINE
END
BUTTON DLG_QUIT 9 2
BEGIN
PROMPT -55 14 ""
PROMPT -44 12 ""
END
ENDPAGE
ENDMASK
PAGE "Convocazioni" -1 -1 78 12
STRING F_C_CODSEZ 2
BEGIN
PROMPT 2 1 "Sezione "
FLAGS "U"
USE LF_SEZIONI
INPUT CODSEZ F_C_CODSEZ
INPUT CODSOT F_C_CODSOT
DISPLAY "Cod.sez" CODSEZ
DISPLAY "Cod.sot." CODSOT
DISPLAY "Sezione@25" DENSEZ
DISPLAY "Sottogruppo@25" DENSOT
OUTPUT F_C_CODSEZ CODSEZ
OUTPUT F_C_DENSEZ DENSEZ
OUTPUT F_C_CODSOT CODSOT
OUTPUT F_C_DENSOT DENSOT
//OUTPUT F_C_INTMIN INTMIN
//OUTPUT F_C_INTMAX INTMAX
OUTPUT F_C_CONV TIPOCONV
CHECKTYPE SEARCH
HELP "Codice sezione di appartenenza"
END
STRING F_C_DENSEZ 25
BEGIN
PROMPT 16 1 ""
//FLAGS "U"
USE LF_SEZIONI KEY 2
INPUT DENSEZ F_C_DENSEZ
INPUT DENSOT F_C_DENSOT
DISPLAY "Sezione@25" DENSEZ
DISPLAY "Sottogruppo@25" DENSOT
DISPLAY "Cod.sez" CODSEZ
DISPLAY "Cod.sot." CODSOT
COPY OUTPUT F_C_CODSEZ
CHECKTYPE NORMAL
HELP "Denominazione sezione di appartenenza"
END
STRING F_C_CODSOT 2
BEGIN
PROMPT 2 2 "Sottog. "
FLAGS "U"
COPY ALL F_C_CODSEZ
CHECKTYPE NORMAL
HELP "Codice sottogruppo di appartenenza"
END
STRING F_C_DENSOT 25
BEGIN
PROMPT 16 2 ""
//FLAGS "U"
COPY ALL F_C_DENSEZ
CHECKTYPE NORMAL
HELP "Sottogruppo di appartenenza"
END
DATE F_C_DATA
BEGIN
PROMPT 2 4 "Data convocazione "
HELP "Data convocazione"
CHECKTYPE REQUIRED
END
LISTBOX F_C_GIORNO 13
BEGIN
PROMPT 2 5 "Giorno preferito "
#include "giorni.h"
END
NUMBER F_C_INTMIN 4
BEGIN
PROMPT 2 6 "Intervallo minimo "
END
NUMBER F_C_INTMAX 4
BEGIN
PROMPT 2 7 "Intervallo massimo "
END
LISTBOX F_C_CONV 11
BEGIN
PROMPT 2 8 "Tipo convocazione "
ITEM "D|Data fissa"
ITEM "G|dal Giorno"
END
//DATE F_DATAULTCON
//BEGIN
// PROMPT 40 14 "Data ultima convocazione "
// FIELD DATAULTCON
// FLAGS "D"
//END
BUTTON DLG_OK 9 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_CANCEL 9 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_DELREC 9 2
BEGIN
PROMPT -33 -1 ""
MESSAGE EXIT, K_DEL
END
ENDPAGE
ENDMASK

View File

@ -1,6 +1,7 @@
#include <form.h>
#include <mask.h>
#include <printapp.h>
#include <tabutil.h>
#include <utility.h>
#include "lf.h"
@ -15,7 +16,7 @@
#include "at4100c.h"
#define ALIAS_LCP 100
#define ALIAS_TCS 200
#define ALIAS_LDN 200
enum ts { undefined = 0, elenco = 1, etichette = 2, cartoline = 3 };
@ -33,14 +34,14 @@ public:
virtual ~TStConvoc_form() {};
};
class TStConvoc_app : public TPrintapp
class TConvocazioniPerSezione : public TPrintapp
{
TRelation* _rel;
TMask* _msk;
TStConvoc_form* _form_eti;
TStConvoc_form* _form_car;
int _cur1;
int _cur;
TParagraph_string _cognome_nome;
TDate _data_stampa;
TDate _dataini, _datafin;
@ -52,6 +53,7 @@ class TStConvoc_app : public TPrintapp
TString80 _note, _intest1, _intest2, _intest3, _intest4;
bool _usasez;
ts _tipo_stampa;
int _contxsez;
//static bool filter_func_stconvoc(const TRelation* rel);
@ -61,23 +63,25 @@ protected:
virtual bool set_print(int m);
virtual void set_page(int file, int cnt);
virtual bool preprocess_page(int file, int counter);
virtual print_action postprocess_print(int file, int counter);
ts dati_cartoline();
public:
void crea_intestazione();
void header_sezione(const TString16 codsez, const TString16 codsot);
void footer_sezione();
void dati_sezione(const TString16 codsez, const TString16 codsot);
TMask& app_mask() { return *_msk; }
TStConvoc_app() : _data_stampa(TODAY), _cognome_nome("",25) {}
TConvocazioniPerSezione() : _data_stampa(TODAY), _cognome_nome("",35) {}
};
HIDDEN inline TStConvoc_app& app() { return (TStConvoc_app&) main_app(); }
HIDDEN inline TConvocazioniPerSezione& app() { return (TConvocazioniPerSezione&) main_app(); }
TCursor* TStConvoc_form::cursor() const { return app().current_cursor(); }
TRelation* TStConvoc_form::relation() const { return cursor()->relation(); }
ts TStConvoc_app::dati_cartoline()
ts TConvocazioniPerSezione::dati_cartoline()
{
TMask msk("at4100b");
if (msk.run() == K_ENTER)
@ -98,7 +102,7 @@ ts TStConvoc_app::dati_cartoline()
return undefined;
}
void TStConvoc_app::set_page(int file, int cnt)
void TConvocazioniPerSezione::set_page(int file, int cnt)
{
// costruzione etichette
switch (_tipo_stampa)
@ -166,40 +170,27 @@ void TStConvoc_app::set_page(int file, int cnt)
break;
case elenco:
{
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"#########"));
set_row(1,"@10g@S", FLD(LF_SOGGETTI,SOG_CATDON));
set_row(1,"@13g@S", FLD(LF_SOGGETTI,SOG_COGNOME));
set_row(1,"@39g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
set_row(1,"@50g@ld", FLD(LF_SOGGETTI,SOG_DATAPROSSI));
set_row(1,"@61g@ld", FLD(LF_SOGGETTI,SOG_DATAPROSAF));
set_row(1,"@72g@ld", FLD(LF_SOGGETTI,SOG_DATAULTDON));
set_row(1,"@83g@ld", FLD(LF_SOGGETTI,SOG_DATAULTID));
set_row(1,"@94g@S", FLD(LF_SOGGETTI,SOG_IDON1));
set_row(1,"@97g@S", FLD(LF_SOGGETTI,SOG_IDON2));
set_row(1,"@100g@S", FLD(LF_SOGGETTI,SOG_GRUPPOAB0));
set_row(1,"@105g@ld", FLD(LF_RCONVOC,RCV_DATACONV));
set_row(2,"@13g@S", FLD(LF_SOGGETTI,SOG_NOME));
set_row(2,"@53g@pn", FLD(LF_SOGGETTI,SOG_INTSI,"###"));
set_row(2,"@64g@pn", FLD(LF_SOGGETTI,SOG_INTAF,"###"));
set_row(2,"@76g@S", FLD(LF_SOGGETTI,SOG_TIPOULTDON));
set_row(2,"@87g@S", FLD(LF_SOGGETTI,SOG_TIPOULTID));
set_row(2,"@94g@S", FLD(LF_SOGGETTI,SOG_IDON3));
set_row(2,"@97g@S", FLD(LF_SOGGETTI,SOG_IDON4));
set_row(2,"@100g@S", FLD(LF_SOGGETTI,SOG_RHANTID));
set_row(2,"@105g@S", FLD(LF_RCONVOC,RCV_CHIAMATA));
set_row(3, "");
set_row(1,"@0g#a", &_cognome_nome);
set_row(1,"@36g@S", FLD(LF_SOGGETTI,SOG_CATDON));
set_row(1,"@40g@S", FLD(LF_SOGGETTI,SOG_TESSAVIS));
set_row(1,"@48g@ld", FLD(LF_SOGGETTI,SOG_DATAULTDON));
set_row(1,"@59g@S", FLD(LF_SOGGETTI,SOG_TIPOULTDON));
set_row(1,"@62g@ld", FLD(LF_RCONVOC,RCV_DATACONV));
set_row(1,"@73g@S", FLD(LF_RCONVOC,RCV_CHIAMATA));
}
break;
}
}
bool TStConvoc_app::preprocess_page(int file, int counter)
{
// contatore soggetti stampati
// per ora non c'è
print_action TConvocazioniPerSezione::postprocess_print(int file, int counter)
{
if (_contxsez > 0)
footer_sezione();
return NEXT_PAGE;
}
bool TConvocazioniPerSezione::preprocess_page(int file, int counter)
{
switch (_tipo_stampa)
{
case elenco:
@ -215,39 +206,61 @@ bool TStConvoc_app::preprocess_page(int file, int counter)
if ((_codsez!=codsez)||(_codsot!=codsot))
{
if (_codsez != "**")
printer().formfeed();
footer_sezione();
_contxsez = 0;
_codsez = codsez;
_codsot = codsot;
header_sezione(codsez, codsot);
}
_contxsez++;
}
break;
}
return TRUE;
}
void TStConvoc_app::header_sezione(const TString16 codsez, const TString16 codsot)
void TConvocazioniPerSezione::footer_sezione()
{
// stampa totale sezione
reset_footer();
TString sep(80);
sep.fill('-');
set_footer(2, (const char *) sep);
set_footer(3,"TOTALE CONVOCATI SEZIONE %d", _contxsez);
printer().formfeed();
reset_footer();
}
void TConvocazioniPerSezione::header_sezione(const TString16 codsez, const TString16 codsot)
{
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
TString intestazione(132);
TString intestazione(80);
intestazione = "Sezione: ";
intestazione << codsez;
intestazione << "/";
intestazione << codsot;
if (codsot.not_empty())
{
intestazione << "/";
intestazione << codsot;
}
intestazione << " ";
intestazione << densez;
if ((densot.ok())&& (densot.not_empty()))
if (densot.not_empty())
{
intestazione << "/";
intestazione << densot;
}
intestazione.center_just();
set_header(1,"@0g%s", (const char*) intestazione);
TString16 data_stampa = _data_stampa.string();
set_header(1,"@0g%10s", (const char*) data_stampa);
TString16 sep = "";
sep << "Pag. @#";
set_header(1, "@70g%s", (const char*) sep);
return;
}
void TStConvoc_app::dati_sezione(const TString16 codsez, const TString16 codsot)
void TConvocazioniPerSezione::dati_sezione(const TString16 codsez, const TString16 codsot)
{
_intest1 = current_cursor()->curr(LF_SEZIONI).get(SEZ_INTESTAZ1);
_intest2 = current_cursor()->curr(LF_SEZIONI).get(SEZ_INTESTAZ2);
@ -270,7 +283,7 @@ void TStConvoc_app::dati_sezione(const TString16 codsez, const TString16 codsot)
return;
}
bool TStConvoc_app::set_print(int m)
bool TConvocazioniPerSezione::set_print(int m)
{
_tipo_stampa = undefined;
KEY tasto;
@ -342,7 +355,7 @@ bool TStConvoc_app::set_print(int m)
da.put(RCV_DATACONV, _dataini);
if (_datafin.ok())
a.put(RCV_DATACONV, _datafin);
_cur1 = add_cursor(new TSorted_cursor(_rel, (const char*) chiave,"", 2, &da, &a));
_cur = add_cursor(new TSorted_cursor(_rel, (const char*) chiave,"", 2, &da, &a));
current_cursor()->setfilter((const char*) filtro, TRUE);
//current_cursor()->set_filterfunction(filter_func_stconvoc);
_codsez = "**";
@ -357,61 +370,69 @@ bool TStConvoc_app::set_print(int m)
return FALSE;
}
void TStConvoc_app::crea_intestazione()
void TConvocazioniPerSezione::crea_intestazione()
{
reset_header();
if (_tipo_stampa == elenco)
{
TString sep(132);
sep = "STAMPA CONVOCATI";
TString sep(80);
sep = "ELENCO CONVOCATI";
if (_tipo.not_empty())
{
sep << " per ";
sep << _tipo;
}
sep << " dal ";
sep << _dataini.string();
sep << " al ";
sep << _datafin.string();
sep << " - PUNTO ";
sep << _punto;
if (_dataini.ok())
{
sep << " dal ";
sep << _dataini.string();
}
if (_datafin.ok())
{
sep << " al ";
sep << _datafin.string();
}
sep.center_just();
set_header(2, "@0g%s", (const char*) sep);
TString16 data_stampa = _data_stampa.string();
set_header(2,"@0g%10s", (const char*) data_stampa);
sep = "";
sep << "Pag. @#";
set_header(2, "@120g%s", (const char*) sep);
sep = "";
sep.fill('-');
set_header(3, (const char *) sep);
set_header(5,"@0gCod.@10gC.@13gCognome@39gNato il@50gData pr.SI@61gData pr.AF@72gData/Tipo@83gData/Tipo@94gIdon.@100gAB0@105gData conv.");
set_header(6,"@13gNome@50gInterv. SI@61gInterv. AF@72gult. don.@83gult. idon.@94gper@100gRh@105gTipo conv.");
set_header(7,"@0g---------@10g--@13g-------------------------@39g----------@50g----------@61g----------@72g----------@83g----------@94g-----@100g----@105g----------");
char ora[16];
_strtime(ora);
set_header(2,"@0g%8s", ora);
sep = "";
if (_punto.not_empty())
{
sep << "presso ";
sep << _punto;
sep << " ";
TTable ldn("LDN");
ldn.put("CODTAB",_punto);
if (ldn.read() == NOERR)
sep << ldn.get("S0");
}
sep.center_just();
set_header(3, "@0g%s", (const char*) sep);
set_header(5,"@0gCognome e nome@36gCat.@40gTessera@48gUltima donaz.@62gData conv.@73gTipo");
set_header(6,"@0g-----------------------------------@36g---@40g-------@48g---------- --@62g----------@73g----");
printer().footerlen(3);
}
}
bool TStConvoc_app::user_create()
bool TConvocazioniPerSezione::user_create()
{
_rel = new TRelation(LF_RCONVOC);
_rel->add(LF_SOGGETTI, "CODICE==CODICE");
_rel->add(LF_CONVOC, "NUMERO==NUMERO");
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,LF_SOGGETTI,ALIAS_LCP);
//_rel->add("LDN", "CODTAB==COV_PUNTO",1,LF_CONVOC,ALIAS_LDN);
_rel->add(LF_COMUNI, "COM==DOM_CODCOM",1,LF_SOGGETTI);
// per stampare la denominazione della sezione nell'intestazione
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT",1,LF_SOGGETTI);
_msk = new TMask("at4400a");
_form_eti = new TStConvoc_form("AT_ETSOG");
_form_car = new TStConvoc_form("AT_ETCAR");
return TRUE;
}
bool TStConvoc_app::user_destroy()
bool TConvocazioniPerSezione::user_destroy()
{
delete _msk;
delete _rel;
@ -422,10 +443,7 @@ bool TStConvoc_app::user_destroy()
int at4400(int argc, char* argv[])
{
TStConvoc_app a;
a.run(argc, argv, "Stampa convocazioni Bologna");
TConvocazioniPerSezione a;
a.run(argc, argv, "Elenco convocati");
return 0;
}

View File

@ -1,6 +1,6 @@
#include "at4400a.h"
#include "lf.h"
PAGE "Definizione Stampe" -1 -1 78 20
PAGE "Stampa convocazioni per punto di prelievo" -1 -1 78 20
GROUPBOX DLG_NULL 77 12
BEGIN
@ -19,7 +19,7 @@ END
STRING F_PUNTO 4
BEGIN
PROMPT 2 4 "Punto raccolta "
PROMPT 2 4 "Punto prelievo "
FLAGS "U"
USE LDN
INPUT CODTAB F_PUNTO
@ -28,6 +28,7 @@ BEGIN
OUTPUT F_PUNTO CODTAB
OUTPUT F_D_PUNTO S0
CHECTYPE NORMAL
VALIDATE NOT_EMPTY_FUNC
END
STRING F_D_PUNTO 50

View File

@ -1,7 +1,7 @@
#ifndef __AT5_H
#define __AT5_H
int at5100(int argc, char* argv[]); // scarico dati per sezione comunale
int at5100(int argc, char* argv[]); // parametri
#endif // __AT5_H

View File

@ -5,39 +5,6 @@
#include <default.url>
/* at5 -0 */
/* at5 -0 definizione parametri di sezione */
MENU TASK_MENUBAR
SUBMENU MENU_FILE "~File"
/* at5 -1 */
MENUBAR MENU_BAR(1)
MENU MENU_BAR(1)
SUBMENU MENU_FILE "~File"
/* at5 -2 */
MENUBAR MENU_BAR(2)
MENU MENU_BAR(2)
SUBMENU MENU_FILE "~File"
/* at5 -3 */
MENUBAR MENU_BAR(3)
MENU MENU_BAR(3)
SUBMENU MENU_FILE "~File"
/* at5 -4 */
MENUBAR MENU_BAR(4)
MENU MENU_BAR(4)
SUBMENU MENU_FILE "~File"
/* at5 -5 */
MENUBAR MENU_BAR(5)
MENU MENU_BAR(5)
SUBMENU MENU_FILE "~File"

View File

@ -1,155 +1,15 @@
// trasferimenti
#include <confapp.h>
#include <applicat.h>
#include <config.h>
#include <mask.h>
#include <relation.h>
#include <urldefid.h>
#include "atfield.cpp"
#include "lf.h"
// nomi delle variabili in .ini per i campi
#define FIELD "FIELD"
#define LEN "LEN"
#define DEC "DEC"
#define FLAGS "FLAGS"
// nomi delle variabili in .ini per HEADER
#define HEADER "HEADER"
#define NOMEFILE "NOMEFILE"
#define LUNGHEZZA "LUNGHEZZA"
#define RECORDSEP "RECORDSEP"
#define FIELDSEP "FIELDSEP"
class TTransfer_app : public TApplication
class ATParametriSezione : public TConfig_application
{
TMask* _msk;
TRelation* _rel;
protected:
virtual bool create();
virtual bool destroy();
virtual bool menu(MENU_TAG m) ;
virtual TMask& get_mask() { return *_msk; }
virtual TRelation* get_relation() const { return _rel; }
virtual void scarica();
public:
TTransfer_app() {}
ATParametriSezione() : TConfig_application(CONFIG_STUDIO) {}
virtual ~ATParametriSezione() {}
};
HIDDEN inline TTransfer_app& app() { return (TTransfer_app&) main_app(); }
bool TTransfer_app::create()
int at5100 (int argc, char* argv[])
{
_msk = new TMask("at5100a");
_rel = new TRelation(LF_SOGGETTI);
/*
_rel->add("CTD", "CODTAB==CATDON",1,0,ALIAS_CTD);
_donaz = new TLocalisamfile(LF_DONAZ);
_contsan = new TLocalisamfile(LF_CONTSAN);
_sdonazioni = new TRecord_array(LF_DONAZ,DON_PROGDON);
_scontrolli = new TRecord_array(LF_CONTSAN,CON_PROGCON);
_asoggetti = new TAssoc_array();
_msk->set_handler(F_INS_CONTROLLI,ins_controlli_handler);
TSheet_field& ss = (TSheet_field&)_msk->field(F_SOGGETTI);
ss.set_notify(soggetti_notify);
//ss.sheet_mask().set_handler(F_S_CODICE,codice_handler);
ss.sheet_mask().set_handler(F_S_NOME,nome_handler);
*/
dispatch_e_menu(BAR_ITEM(1));
return TRUE;
}
bool TTransfer_app::destroy()
{
delete _rel;
delete _msk;
/*
delete _donaz;
delete _contsan;
delete _sdonazioni;
delete _scontrolli;
delete _asoggetti;
*/
return TRUE;
}
bool TTransfer_app::menu(MENU_TAG m)
{
TMask& msk = get_mask();
const TDate oggi(TODAY);
KEY tasto;
do
{
tasto = msk.run();
switch (tasto)
{
case K_ESC: // annulla
msk.reset();
break;
case K_ENTER: // registra
{
TTransfer_app::scarica();
msk.reset();
}
break;
}
}
while (tasto != K_QUIT);
return FALSE;
}
void TTransfer_app::scarica()
{
TArray arr_exprs; // array delle TExpr corrispondenti ai campi da scaricare
TArray arr_fields; // array dei TField_text (campi indicati in .ini)
TConfig ini("esporta.ini");
TString_array campi;
int i = ini.list_paragraphs(campi);
int poshead = campi.find("HEADER");
campi.remove(poshead,TRUE);
for ( int k = 0; k < campi.items(); k++ )
{
const char* campo = campi.row(k);
TString_array vl;
int i = ini.list_variables(vl, TRUE, campo);
//for ( int j = 0; j < vl.items(); j++ )
int pos = vl.find(FIELD);
TExpr* espressione = vl.row(pos).get(1);
arr_exprs.add(espressione)
TToken_string variabile = vl.row(pos);
int pos = vl.find(LEN);
TToken_string variabile = vl.row(pos);
int pos = vl.find(DEC);
TToken_string variabile = vl.row(pos);
}
/*
TText_field campo()
arr_fields.add();
*/
}
}
int at5100(int argc, char* argv[])
{
TTransfer_app a;
a.run(argc, argv, "Scarico dati");
return 0;
ATParametriSezione appc;
appc.run(argc, argv, "Parametri Sezione");
return 0;
}

View File

@ -1,13 +1,22 @@
// scarico dati per sezione comunale
// definizione campi per maschera di selezione
// definizione campi della maschera at5100a.msk
// Gestione parametri sezione
#define F_SEZINI 101
#define F_D_SEZINI 102
#define F_SOTINI 103
#define F_D_SOTINI 104
#define F_SEZFIN 105
#define F_D_SEZFIN 106
#define F_SOTFIN 107
#define F_D_SOTFIN 108
#define F_DATAINI 109
#define F_DATAFIN 110
// passaggio di categoria sul numero di donazioni 1
#define AT_NUMDON1 101 // numero donazioni necessarie per il primo passaggio
#define AT_CATINI1 102 // categoria iniziale (di partenza)
#define AT_CATFIN1 103 // categoria finale (di destinazione)
// passaggio di categoria sul numero di donazioni 2
#define AT_NUMDON2 104 // numero donazioni necessarie per il primo passaggio
#define AT_CATINI2 105 // categoria iniziale (di partenza)
#define AT_CATFIN2 106 // categoria finale (di destinazione)
#define AT_STTESS2 107 // da fare al momento della stampa tessera
// data iscrizione
#define AT_DATAISC 108 // data iscrizione se vuota = data prima donazione
// descrizioni
#define AT_D_CATINI1 151
#define AT_D_CATFIN1 152
#define AT_D_CATINI2 153
#define AT_D_CATFIN2 154

View File

@ -1,150 +1,140 @@
#include "at5100a.h"
#include "lf.h"
PAGE "Scarico dati" -1 -1 78 11
GROUPBOX DLG_NULL 77 4
/* toolbar */
TOOLBAR "" 0 20 0 2
BUTTON DLG_OK 10 2
BEGIN
PROMPT 1 1 "Scelta sezioni/sottogruppi"
PROMPT -12 -1 ""
END
STRING F_SEZINI 2
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT 2 2 "Da "
FLAGS "U"
USE LF_SEZIONI
INPUT CODSEZ F_SEZINI
INPUT CODSOT F_SOTINI
DISPLAY "Cod.sez" CODSEZ
DISPLAY "Cod.sot." CODSOT
DISPLAY "Sezione@25" DENSEZ
DISPLAY "Sottogruppo@25" DENSOT
OUTPUT F_SEZINI CODSEZ
OUTPUT F_D_SEZINI DENSEZ
OUTPUT F_SOTINI CODSOT
OUTPUT F_D_SOTINI DENSOT
CHECKTYPE SEARCH
HELP "Codice sezione da cui partire"
END
STRING F_D_SEZINI 25
BEGIN
PROMPT 11 2 ""
FLAGS "U"
USE LF_SEZIONI KEY 2
INPUT DENSEZ F_D_SEZINI
DISPLAY "Sezione@25" DENSEZ
DISPLAY "Sottogruppo@25" DENSOT
DISPLAY "Cod.sez" CODSEZ
DISPLAY "Cod.sot." CODSOT
COPY OUTPUT F_SEZINI
CHECKTYPE NORMAL
HELP "Sezione da cui partire"
END
STRING F_SOTINI 2
BEGIN
PROMPT 2 3 " "
COPY ALL F_SEZINI
CHECKTYPE SEARCH
HELP "Codice sottogruppo da cui partire"
END
STRING F_D_SOTINI 25
BEGIN
PROMPT 11 3 ""
FLAGS "U"
COPY USE F_D_SEZINI
INPUT DENSEZ F_D_SEZINI
INPUT DENSOT F_D_SOTINI
COPY DISPLAY F_D_SEZINI
COPY OUTPUT F_D_SEZINI
CHECKTYPE NORMAL
HELP "Sottogruppo da cui partire"
END
STRING F_SEZFIN 2
BEGIN
PROMPT 41 2 "A "
FLAGS "U"
USE LF_SEZIONI
INPUT CODSEZ F_SEZFIN
INPUT CODSOT F_SOTFIN
DISPLAY "Cod.sez" CODSEZ
DISPLAY "Cod.sot." CODSOT
DISPLAY "Sezione@25" DENSEZ
DISPLAY "Sottogruppo@25" DENSOT
OUTPUT F_SEZFIN CODSEZ
OUTPUT F_D_SEZFIN DENSEZ
OUTPUT F_SOTFIN CODSOT
OUTPUT F_D_SOTFIN DENSOT
CHECKTYPE SEARCH
HELP "Codice sezione finale"
END
STRING F_D_SEZFIN 25
BEGIN
PROMPT 49 2 ""
FLAGS "U"
USE LF_SEZIONI KEY 2
INPUT DENSEZ F_D_SEZFIN
DISPLAY "Sezione@25" DENSEZ
DISPLAY "Sottogruppo@25" DENSOT
DISPLAY "Cod.sez" CODSEZ
DISPLAY "Cod.sot." CODSOT
COPY OUTPUT F_SEZFIN
CHECKTYPE NORMAL
HELP "Sezione finale"
END
STRING F_SOTFIN 2
BEGIN
PROMPT 41 3 " "
COPY ALL F_SEZFIN
CHECKTYPE SEARCH
HELP "Codice sottogruppo finale"
END
STRING F_D_SOTFIN 25
BEGIN
PROMPT 49 3 ""
FLAGS "U"
COPY USE F_D_SEZFIN
INPUT DENSEZ F_D_SEZFIN
INPUT DENSOT F_D_SOTFIN
COPY DISPLAY F_D_SEZFIN
COPY OUTPUT F_D_SEZFIN
CHECKTYPE NORMAL
HELP "Sottogruppo finale"
END
GROUPBOX DLG_NULL 77 3
BEGIN
PROMPT 1 5 "Intervallo date ultimo aggiornamento"
END
DATE F_DATAINI
BEGIN
PROMPT 2 6 "Data ultimo aggiornamento dal "
HELP "Data di ultimo aggiornamento iniziale"
END
DATE F_DATAFIN
BEGIN
PROMPT 46 6 "al "
HELP "Data di ultimo aggiornamento finale"
END
BUTTON DLG_OK 9 2
BEGIN
PROMPT -12 9 ""
END
BUTTON DLG_QUIT 9 2
BEGIN
PROMPT -22 9 ""
PROMPT -22 -1 ""
END
ENDPAGE
PAGE "Parametri sezione" -1 -1 76 17
GROUPBOX DLG_NULL 74 5
BEGIN
PROMPT 1 0 "Primo passaggio di categoria"
END
NUMBER AT_NUMDON1 3
BEGIN
PROMPT 2 1 "Donazioni necessarie "
HELP "Numero donazioni necessarie per il passaggio"
FIELD NumDon1
END
STRING AT_CATINI1 2
BEGIN
PROMPT 2 2 "Categoria di partenza "
HELP "Categoria di partenza per il passaggio (possibile vuota)"
USE CTD
INPUT CODTAB[1,2] AT_CATINI1
DISPLAY "Cat." CODTAB[1,2]
DISPLAY "Descrizione@50" S0
OUTPUT AT_CATINI1 CODTAB[1,2]
OUTPUT AT_D_CATINI1 S0
FIELD CatIni1
CHECKTYPE NORMAL
END
STRING AT_CATFIN1 2
BEGIN
PROMPT 2 3 "Categoria di arrivo "
HELP "Categoria di arrivo per il passaggio (possibile vuota)"
USE CTD
INPUT CODTAB[1,2] AT_CATFIN1
DISPLAY "Cat." CODTAB[1,2]
DISPLAY "Descrizione@50" S0
OUTPUT AT_CATFIN1 CODTAB[1,2]
OUTPUT AT_D_CATFIN1 S0
FIELD CatFin1
CHECKTYPE NORMAL
END
GROUPBOX DLG_NULL 74 6
BEGIN
PROMPT 1 5 "Secondo passaggio di categoria"
END
NUMBER AT_NUMDON2 3
BEGIN
PROMPT 2 6 "Donazioni necessarie "
HELP "Numero donazioni necessarie per il passaggio"
FIELD NumDon2
END
STRING AT_CATINI2 2
BEGIN
PROMPT 2 7 "Categoria di partenza "
HELP "Categoria di partenza per il passaggio (possibile vuota)"
USE CTD
INPUT CODTAB[1,2] AT_CATINI2
DISPLAY "Cat." CODTAB[1,2]
DISPLAY "Descrizione@50" S0
OUTPUT AT_CATINI2 CODTAB[1,2]
OUTPUT AT_D_CATINI2 S0
FIELD CatIni2
CHECKTYPE NORMAL
END
STRING AT_CATFIN2 2
BEGIN
PROMPT 2 8 "Categoria di arrivo "
HELP "Categoria di arrivo per il passaggio (possibile vuota)"
USE CTD
INPUT CODTAB[1,2] AT_CATFIN2
DISPLAY "Cat." CODTAB[1,2]
DISPLAY "Descrizione@50" S0
OUTPUT AT_CATFIN2 CODTAB[1,2]
OUTPUT AT_D_CATFIN2 S0
FIELD CatFin2
CHECKTYPE NORMAL
END
BOOLEAN AT_STTESS2
BEGIN
PROMPT 2 9 "Passaggio con stampa tessera"
HELP "Eseguire il cambio di categoria al momento della stampa tessera"
FIELD StTess2
END
BOOLEAN AT_DATAISC
BEGIN
PROMPT 2 11 "Data iscrizione (se vuota) uguale a data prima donazione"
HELP "Data iscrizione automaticamente uguale alla data prima donazione, se vuota"
FIELD DataIsc
END
STRING AT_D_CATINI1 40
BEGIN
PROMPT 30 2 ""
FLAGS "D"
END
STRING AT_D_CATFIN1 40
BEGIN
PROMPT 30 3 ""
FLAGS "D"
END
STRING AT_D_CATINI2 40
BEGIN
PROMPT 30 7 ""
FLAGS "D"
END
STRING AT_D_CATFIN2 40
BEGIN
PROMPT 30 8 ""
FLAGS "D"
END
ENDPAGE
ENDMASK

View File

@ -3,7 +3,7 @@
#include "at6.h"
#define usage "Error - usage : %s -[0|1|2]"
#define usage "Error - usage : %s -[0|1|2|3]"
int main(int argc, char** argv)
{
@ -18,6 +18,8 @@ int main(int argc, char** argv)
rt = at6200(argc, argv); break;
case 2:
rt = at6300(argc, argv); break;
case 3:
rt = at6400(argc, argv); break;
default:
error_box(usage, argv[0]) ; rt = 1; break;
}

View File

@ -4,5 +4,6 @@
int at6100(int argc, char* argv[]); // stampa tabella medici
int at6200(int argc, char* argv[]); // stampa tabella sezioni/sottogruppi
int at6300(int argc, char* argv[]); // stampa di controllo donazioni
int at6400(int argc, char* argv[]); // stampa di controllo soggetti
#endif // __AT6_H

View File

@ -19,4 +19,10 @@ MENU MENU_BAR(1)
MENUBAR MENU_BAR(2)
MENU MENU_BAR(2)
SUBMENU MENU_FILE "~File"
/* at6 -3 stampa soggetti incompleti */
MENUBAR MENU_BAR(3)
MENU MENU_BAR(3)
SUBMENU MENU_FILE "~File"

View File

@ -25,12 +25,11 @@ public:
virtual ~TMed_form() {};
};
class TMedprint_application : public TPrintapp
class TStampaMedici : public TPrintapp
{
TRelation* _rel;
TMask* _msk;
TMed_form* _form_eti;
int _cur1, _cur2;
TParagraph_string _cognome_nome, _dencom, _indirizzo;
TDate _data_stampa;
@ -45,16 +44,16 @@ protected:
public:
void crea_intestazione();
TMedprint_application() : _data_stampa(TODAY), _indirizzo("",25), _dencom("",25), _cognome_nome("",40) {}
TStampaMedici() : _data_stampa(TODAY), _indirizzo("",25), _dencom("",25), _cognome_nome("",40) {}
};
HIDDEN inline TMedprint_application& app() { return (TMedprint_application&) main_app(); }
HIDDEN inline TStampaMedici& app() { return (TStampaMedici&) main_app(); }
TCursor* TMed_form::cursor() const { return app().current_cursor(); }
TRelation* TMed_form::relation() const { return cursor()->relation(); }
void TMedprint_application::set_page(int file, int cnt)
void TStampaMedici::set_page(int file, int cnt)
{
// costruzione etichette
switch (_tipo_stampa)
@ -85,7 +84,7 @@ void TMedprint_application::set_page(int file, int cnt)
}
}
bool TMedprint_application::preprocess_page(int file, int counter)
bool TStampaMedici::preprocess_page(int file, int counter)
{
if (_tipo_stampa == elenco)
{
@ -104,7 +103,7 @@ bool TMedprint_application::preprocess_page(int file, int counter)
return TRUE;
}
bool TMedprint_application::set_print(int)
bool TStampaMedici::set_print(int)
{
_tipo_stampa = undefined;
KEY tasto;
@ -162,10 +161,9 @@ bool TMedprint_application::set_print(int)
return FALSE;
}
void TMedprint_application::crea_intestazione()
void TStampaMedici::crea_intestazione()
{
reset_header();
if (_tipo_stampa == elenco)
{
TString sep(132);
@ -182,29 +180,25 @@ void TMedprint_application::crea_intestazione()
sep = "";
sep.fill('-');
set_header(3, (const char *) sep);
set_header(5,"@0gCodice@7gCognome e nome@48gIndirizzo@74gLocalità/Comune@100gTel. amb.@116gTel. abi.");
set_header(6,"@0g------@7g----------------------------------------@48g-------------------------");
set_header(6,"@74g-------------------------@100g---------------@116g---------------");
}
}
bool TMedprint_application::user_create()
bool TStampaMedici::user_create()
{
_rel = new TRelation(LF_MEDICI);
_rel->add(LF_COMUNI, "COM==COM");
_rel->add("LCP", "CODTAB==LOCALITA");
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
_msk = new TMask("at6100a");
_form_eti = new TMed_form("AT_ETMED");
return TRUE;
}
bool TMedprint_application::user_destroy()
bool TStampaMedici::user_destroy()
{
delete _msk;
delete _rel;
@ -214,10 +208,7 @@ bool TMedprint_application::user_destroy()
int at6100(int argc, char* argv[])
{
TMedprint_application a;
a.run(argc, argv, "Stampa Medici");
TStampaMedici a;
a.run(argc, argv, "Stampa Tabella Medici");
return 0;
}

View File

@ -1,7 +1,7 @@
#include "at6100a.h"
#include <lffiles.h>
#include "lf.h"
PAGE "Definizione Stampe" -1 -1 70 17
PAGE "Stampa di controllo tabella medici" -1 -1 70 17
RADIOBUTTON F_SORT 25
BEGIN

View File

@ -25,12 +25,11 @@ public:
virtual ~TSez_form() {};
};
class TSezprint_application : public TPrintapp
class TStampaSezioni : public TPrintapp
{
TRelation* _rel;
TMask* _msk;
TSez_form* _form_eti;
int _cur1, _cur2;
TParagraph_string _dencom, _indirizzo;
TDate _data_stampa;
@ -46,16 +45,16 @@ protected:
public:
void crea_intestazione();
TSezprint_application() : _data_stampa(TODAY), _indirizzo("", 22), _dencom("", 25) {}
TStampaSezioni() : _data_stampa(TODAY), _indirizzo("", 22), _dencom("", 25) {}
};
HIDDEN inline TSezprint_application& app() { return (TSezprint_application&) main_app(); }
HIDDEN inline TStampaSezioni& app() { return (TStampaSezioni&) main_app(); }
TCursor* TSez_form::cursor() const { return app().current_cursor(); }
TRelation* TSez_form::relation() const { return cursor()->relation(); }
void TSezprint_application::set_page(int file, int cnt)
void TStampaSezioni::set_page(int file, int cnt)
{
switch (_tipo_stampa)
{
@ -87,7 +86,7 @@ void TSezprint_application::set_page(int file, int cnt)
}
}
bool TSezprint_application::preprocess_page(int file, int counter)
bool TStampaSezioni::preprocess_page(int file, int counter)
{
if (_tipo_stampa == elenco)
{
@ -102,12 +101,11 @@ bool TSezprint_application::preprocess_page(int file, int counter)
return TRUE;
}
bool TSezprint_application::set_print(int)
bool TStampaSezioni::set_print(int)
{
_tipo_stampa = undefined;
KEY tasto;
tasto = _msk->run();
switch (tasto)
{
case F_ELENCO:
@ -122,25 +120,20 @@ bool TSezprint_application::set_print(int)
TString16 codfr, codto;
TString80 denfr, dento;
const int sort = _msk->get_int(F_SORT);
reset_files();
add_file(LF_SEZIONI);
if (sort == 1)
{
codfr = _msk->get(F_CODFR);
codto = _msk->get(F_CODTO);
select_cursor(_cur1);
TLocalisamfile& fl = current_cursor()->file(LF_SEZIONI);
TRectype da(fl.curr());
TRectype a(fl.curr());
da.zero();
a.zero();
da.put(SEZ_CODSEZ, codfr);
a.put(SEZ_CODSEZ, codto);
current_cursor()->setregion(da, a);
}
else
@ -148,19 +141,14 @@ bool TSezprint_application::set_print(int)
{
denfr = _msk->get(F_DENFR);
dento = _msk->get(F_DENTO);
select_cursor(_cur2);
TLocalisamfile& fl = current_cursor()->file(LF_SEZIONI);
TRectype da(fl.curr());
TRectype a(fl.curr());
da.zero();
a.zero();
da.put(SEZ_DENSEZ, denfr);
a.put (SEZ_DENSEZ, dento);
current_cursor()->setregion(da, a);
}
reset_print();
@ -171,10 +159,9 @@ bool TSezprint_application::set_print(int)
return FALSE;
}
void TSezprint_application::crea_intestazione()
void TStampaSezioni::crea_intestazione()
{
reset_header();
if (_tipo_stampa == elenco)
{
TString sep(132);
@ -185,37 +172,31 @@ void TSezprint_application::crea_intestazione()
sep << "Pag. @#";
sep.right_just(132);
set_header(2,(const char*) sep);
set_header(2,"@0gTABELLA SEZIONI/SOTTOGRUPPI@104gDATA");
data_stampa = _data_stampa.string();
set_header(2,"@109g%10s", (const char*) data_stampa);
sep = "";
sep.fill('-');
set_header(3, (const char *) sep);
set_header(5,"@0gCod.@5gDenominazione sezione@31gDenominazione sottogruppo@57gIndirizzo@80gComune@101gTelefono@117gFax");
set_header(6,"@0g----@5g-------------------------@31g-------------------------");
set_header(6,"@57g-----------------------@80g--------------------@101g---------------@117g---------------");
}
}
bool TSezprint_application::user_create()
bool TStampaSezioni::user_create()
{
_rel = new TRelation(LF_SEZIONI);
_rel->add(LF_COMUNI, "COM==COM");
_rel->add("LCP", "CODTAB==LOCALITA");
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per denominazione
_msk = new TMask("at6200a");
_form_eti = new TSez_form("AT_ETSEZ");
return TRUE;
}
bool TSezprint_application::user_destroy()
bool TStampaSezioni::user_destroy()
{
delete _msk;
delete _rel;
@ -225,10 +206,7 @@ bool TSezprint_application::user_destroy()
int at6200(int argc, char* argv[])
{
TSezprint_application a;
a.run(argc, argv, "Stampa Sezioni");
TStampaSezioni a;
a.run(argc, argv, "Stampa Tabella Sezioni");
return 0;
}

View File

@ -1,7 +1,7 @@
#include "at6200a.h"
#include <lffiles.h>
#include "lf.h"
PAGE "Definizione Stampe" -1 -1 70 17
PAGE "Stampa di controllo tabella sezioni" -1 -1 70 17
RADIOBUTTON F_SORT 25
BEGIN

View File

@ -13,15 +13,15 @@
#define ALIAS_LDN 100
class TElencoDon_app : public TPrintapp
class TControlloDonazioni : public TPrintapp
{
TRelation* _rel;
TMask* _msk;
int _counter;
int _cur1;
int _cur;
TDate _dataold, _dataini, _datafin;
TString16 _tipodon, _luogodon, _luogoold, _sezold;
TString16 _sezini, _sotini, _tipostampa;
TString16 _sezini, _sotini, _tipostampa,_ordinamento;
TParagraph_string _cognome_nome;
@ -36,12 +36,12 @@ public:
void crea_intestazione();
void header_data(const TDate data, const TString16 luogo, const TString16 sezione);
TMask& app_mask() { return *_msk; }
TElencoDon_app() : _cognome_nome("",35) {}
TControlloDonazioni() : _cognome_nome("",35) {}
};
HIDDEN inline TElencoDon_app& app() { return (TElencoDon_app&) main_app(); }
HIDDEN inline TControlloDonazioni& app() { return (TControlloDonazioni&) main_app(); }
void TElencoDon_app::set_page(int file, int cnt)
void TControlloDonazioni::set_page(int file, int cnt)
{
set_row(1,"@0g#D", &_counter);
set_row(1,"@7g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"######"));
@ -55,7 +55,7 @@ void TElencoDon_app::set_page(int file, int cnt)
set_row(1,"@92g@S", FLD(LF_DONAZ, DON_LUOGODON));
}
bool TElencoDon_app::preprocess_page(int file, int counter)
bool TControlloDonazioni::preprocess_page(int file, int counter)
{
// contatore soggetti stampati
// per ora non c'è
@ -113,7 +113,7 @@ bool TElencoDon_app::preprocess_page(int file, int counter)
return TRUE;
}
void TElencoDon_app::header_data(const TDate data, const TString16 luogo, const TString16 sezione)
void TControlloDonazioni::header_data(const TDate data, const TString16 luogo, const TString16 sezione)
{
TString intestazione(132);
intestazione = "STAMPA DI CONTROLLO DONAZIONI ";
@ -145,7 +145,7 @@ void TElencoDon_app::header_data(const TDate data, const TString16 luogo, const
return;
}
bool TElencoDon_app::set_print(int m)
bool TControlloDonazioni::set_print(int m)
{
KEY tasto;
tasto = _msk->run();
@ -159,17 +159,30 @@ bool TElencoDon_app::set_print(int m)
_luogodon = _msk->get(F_LUOGODON);
_tipostampa = _msk->get(F_TIPOSTAMPA);
_ordinamento = _msk->get(F_ORDINAMENTO);
TString80 chiave = "";
switch (_tipostampa[0])
{
case 'D':
chiave = "92->DATADON|UPPER(90->COGNOME)|UPPER(90->NOME)";
chiave = "92->DATADON|";
break;
case 'L':
chiave = "92->LUOGODON|92->DATADON|UPPER(90->COGNOME)|UPPER(90->NOME)";
chiave = "92->LUOGODON|92->DATADON|";
break;
case 'S':
chiave = "90->CODSEZ|90->CODSOT|92->DATADON|UPPER(90->COGNOME)|UPPER(90->NOME)";
chiave = "90->CODSEZ|90->CODSOT|92->DATADON|";
break;
}
switch (_ordinamento[0])
{
case 'C':
chiave << "UPPER(90->COGNOME)|UPPER(90->NOME)";
break;
case 'I':
chiave << "92->PROGINS";
break;
case 'E':
chiave << "92->ETICHETTA";
break;
}
TString80 filtro = "";
@ -215,7 +228,7 @@ bool TElencoDon_app::set_print(int m)
da.put(DON_DATADON, _dataini);
if (_datafin.ok())
a.put(DON_DATADON, _datafin);
_cur1 = add_cursor(new TSorted_cursor(_rel, (const char*) chiave, "", 2, &da, &a));
_cur = add_cursor(new TSorted_cursor(_rel, (const char*) chiave, "", 2, &da, &a));
current_cursor()->setfilter((const char*) filtro, TRUE);
_counter = 0;
_dataold = NULLDATE;
@ -231,7 +244,7 @@ bool TElencoDon_app::set_print(int m)
return FALSE;
}
void TElencoDon_app::crea_intestazione()
void TControlloDonazioni::crea_intestazione()
{
reset_header();
TString sep(132);
@ -277,7 +290,7 @@ void TElencoDon_app::crea_intestazione()
set_header(4,"@0g------@7g------@14g-------@22g-----------------------------------@58g----------@69g-----@75g----------@86g----@91g-------------------------");
}
bool TElencoDon_app::user_create()
bool TControlloDonazioni::user_create()
{
_rel = new TRelation(LF_DONAZ);
_rel->add(LF_SOGGETTI, "CODICE==CODICE");
@ -286,7 +299,7 @@ bool TElencoDon_app::user_create()
return TRUE;
}
bool TElencoDon_app::user_destroy()
bool TControlloDonazioni::user_destroy()
{
delete _msk;
delete _rel;
@ -295,7 +308,7 @@ bool TElencoDon_app::user_destroy()
int at6300(int argc, char* argv[])
{
TElencoDon_app a;
TControlloDonazioni a;
a.run(argc, argv, "Stampa di controllo donazioni");
return 0;
}

View File

@ -14,5 +14,6 @@
#define F_TIPODON 111
#define F_LUOGODON 112
#define F_TIPOSTAMPA 113
#define F_ORDINAMENTO 114
#define F_D_TIPODON 201
#define F_D_LUOGODON 202

View File

@ -1,6 +1,6 @@
#include "at6300a.h"
#include "lf.h"
PAGE "Definizione Stampe" -1 -1 78 20
PAGE "Stampa di controllo donazioni" -1 -1 78 20
GROUPBOX DLG_NULL 77 4
BEGIN
@ -154,7 +154,7 @@ END
STRING F_LUOGODON 4
BEGIN
PROMPT 2 8 "Luogo donazione "
PROMPT 2 8 "Punto prelievo "
FLAGS "U"
USE LDN
INPUT CODTAB F_LUOGODON
@ -176,10 +176,18 @@ RADIOBUTTON F_TIPOSTAMPA 25
BEGIN
PROMPT 1 10 "Stampa per "
ITEM "D|Data donazione"
ITEM "L|Luogo donazione"
ITEM "L|Punto prelievo"
ITEM "S|Sezione/Sottogruppo"
END
RADIOBUTTON F_ORDINAMENTO 25
BEGIN
PROMPT 40 10 "Ordinamento per "
ITEM "C|Cognome e nome"
ITEM "I|Inserimento"
ITEM "E|Etichetta sacca"
END
BUTTON DLG_OK 9 2
BEGIN
PROMPT -12 -1 ""

312
at/at6400.cpp Executable file
View File

@ -0,0 +1,312 @@
#include <form.h>
#include <mask.h>
#include <printapp.h>
#include "lf.h"
#include "soggetti.h"
#include "sezioni.h"
#include <comuni.h>
#include "at6.h"
#include "at6400a.h"
#define ALIAS_LCP 100
#define ALIAS_TCS 200
class TStampaIncompleti : public TPrintapp
{
static bool filter_func_incompleti(const TRelation* rel);
TRelation* _rel;
TMask* _msk;
TAssoc_array _catdon;
TAssoc_array _catnondon;
int _cur;
TParagraph_string _cognome_nome, _dencom;
TDate _data_stampa;
TString16 _codsez, _codsot;
bool _indirizzo, _datanasc, _categoria, _sezione, _gruppoab0, _rhantid;
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);
public:
void crea_intestazione();
void filtra_sezioni();
void header_sezione(const TString16 codsez, const TString16 codsot);
TMask& app_mask() { return *_msk; }
TStampaIncompleti() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {}
};
HIDDEN inline TStampaIncompleti& app() { return (TStampaIncompleti&) main_app(); }
void TStampaIncompleti::filtra_sezioni()
{
const TString16 sezini = _msk->get(F_SEZINI);
const TString16 sotini = _msk->get(F_SOTINI);
const TString16 sezfin = _msk->get(F_SEZFIN);
const TString16 sotfin = _msk->get(F_SOTFIN);
TRectype da(LF_SOGGETTI);
TRectype a(LF_SOGGETTI);
if (sezini.not_empty())
da.put(SOG_CODSEZ, sezini);
if (sotini.not_empty())
da.put(SOG_CODSOT, sotini);
if (sezfin.not_empty())
a.put(SOG_CODSEZ, sezfin);
if (sotfin.not_empty())
a.put(SOG_CODSOT, sotfin);
current_cursor()->setregion(da, a);
}
void TStampaIncompleti::set_page(int file, int cnt)
{
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########"));
set_row(1,"@9g@S", FLD(LF_SOGGETTI,SOG_CATDON));
set_row(1,"@12g#a", &_cognome_nome);
set_row(1,"@38g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
set_row(1,"@49g@S", FLD(LF_SOGGETTI,SOG_DOM_INDIR));
set_row(1,"@100g@S", FLD(LF_SOGGETTI,SOG_TELABI));
set_row(1,"@116g@S", FLD(LF_SOGGETTI,SOG_TELLAV));
set_row(2,"@49g#a", &_dencom);
set_row(2,"@116g@S", FLD(LF_SOGGETTI,SOG_TELALT));
}
bool TStampaIncompleti::filter_func_incompleti(const TRelation* rel)
{
bool filtrato = FALSE;
bool incompleto = FALSE;
TLocalisamfile& sog = rel->lfile();
// filtro per categorie
TAssoc_array& categorie = app()._catdon;
if (categorie.items() != 0)
{
const TString16 cat = sog.get(SOG_CATDON);
filtrato = categorie.is_key((const char*) cat);
}
if (!filtrato)
{
// filtro per categorie non donatori
TAssoc_array& categorie = app()._catnondon;
if (categorie.items() != 0)
{
const TString16 cat1 = sog.get(SOG_CATNOND1);
const TString16 cat2 = sog.get(SOG_CATNOND2);
filtrato = (categorie.is_key((const char*) cat1) || categorie.is_key((const char*) cat2)) ;
}
}
if (app()._catdon.items() == 0 && app()._catnondon.items() == 0)
filtrato = TRUE;
incompleto = !(app()._indirizzo || app()._datanasc
|| app()._categoria || app()._sezione
|| app()._gruppoab0 || app()._rhantid);
if (filtrato && app()._indirizzo && !incompleto)
{
TString80 indirizzo = sog.get(SOG_DOM_INDIR);
TString16 codcom = sog.get(SOG_DOM_CODCOM);
incompleto = (indirizzo.empty() || codcom.empty());
}
if (filtrato && app()._datanasc && !incompleto)
{
TDate datanasc = sog.get(SOG_DATANASC);
incompleto = (datanasc.empty());
}
if (filtrato && app()._categoria && !incompleto)
{
TString16 catdon = sog.get(SOG_CATDON);
TString16 catnond1 = sog.get(SOG_CATNOND1);
TString16 catnond2 = sog.get(SOG_CATNOND2);
incompleto = (catdon.empty() && catnond1.empty() && catnond2.empty());
}
if (filtrato && app()._sezione && !incompleto)
{
TString16 codsez = sog.get(SOG_CODSEZ);
incompleto = codsez.empty();
}
if (filtrato && app()._gruppoab0 && !incompleto)
{
TString16 gruppoab0 = sog.get(SOG_GRUPPOAB0);
incompleto = gruppoab0.empty();
}
if (filtrato && app()._rhantid && !incompleto)
{
TString16 rhantid = sog.get(SOG_RHANTID);
incompleto = rhantid.empty();
}
filtrato = (filtrato && incompleto);
return filtrato;
}
void TStampaIncompleti::header_sezione(const TString16 codsez, const TString16 codsot)
{
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
TString intestazione(132);
intestazione = "Sezione: ";
intestazione << codsez;
intestazione << "/";
intestazione << codsot;
intestazione << " ";
intestazione << densez;
if ((densot.ok())&& (densot.not_empty()))
{
intestazione << "/";
intestazione << densot;
}
intestazione.center_just();
set_header(1,"@0g%s", (const char*) intestazione);
return;
}
bool TStampaIncompleti::preprocess_page(int file, int counter)
{
TRectype& recsog = current_cursor()->curr();
TString80 nome = recsog.get(SOG_COGNOME);
nome << " ";
nome << recsog.get(SOG_NOME);
_cognome_nome = nome;
TString256 localita = "";
localita << current_cursor()->curr(-ALIAS_LCP).get("S6");
if (localita.not_empty() && localita.ok())
{
localita << " ";
localita << current_cursor()->curr(-ALIAS_LCP).get("S0");
localita << " - ";
}
else
{
localita = current_cursor()->curr(LF_COMUNI).get(COM_CAPCOM);
localita << " ";
}
localita << current_cursor()->curr(LF_COMUNI).get(COM_DENCOM);
localita.trim();
_dencom = localita;
// salto pagina se cambio sezione
const TString16 codsez = recsog.get(SOG_CODSEZ);
const TString16 codsot = recsog.get(SOG_CODSOT);
if ((_codsez!=codsez)||(_codsot!=codsot))
{
if (_codsez != "**")
printer().formfeed();
_codsez = codsez;
_codsot = codsot;
header_sezione(codsez, codsot);
}
return TRUE;
}
bool TStampaIncompleti::set_print(int m)
{
KEY tasto;
tasto = _msk->run();
if (tasto == K_ENTER)
{
_codsez = "**";
_codsot = "**";
reset_files();
add_file(LF_SOGGETTI);
filtra_sezioni();
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);
if (catpri.not_empty() && catpri.ok())
_catdon.add((const char*) catpri);
if (catsec.not_empty() && catsec.ok())
_catdon.add((const char*) catsec);
if (catter.not_empty() && catter.ok())
_catdon.add((const char*) catter);
if (catqua.not_empty() && catqua.ok())
_catdon.add((const char*) catqua);
if (catqui.not_empty() && catqui.ok())
_catdon.add((const char*) catqui);
if (catses.not_empty() && catses.ok())
_catdon.add((const char*) catses);
const TString16 catnpri = _msk->get(F_CATN1);
const TString16 catnsec = _msk->get(F_CATN2);
const TString16 catnter = _msk->get(F_CATN3);
const TString16 catnqua = _msk->get(F_CATN4);
const TString16 catnqui = _msk->get(F_CATN5);
const TString16 catnses = _msk->get(F_CATN6);
if (catnpri.not_empty() && catnpri.ok())
_catnondon.add((const char*) catnpri);
if (catnsec.not_empty() && catnsec.ok())
_catnondon.add((const char*) catnsec);
if (catnter.not_empty() && catnter.ok())
_catnondon.add((const char*) catnter);
if (catnqua.not_empty() && catnqua.ok())
_catnondon.add((const char*) catnqua);
if (catnqui.not_empty() && catnqui.ok())
_catnondon.add((const char*) catnqui);
if (catnses.not_empty() && catnses.ok())
_catnondon.add((const char*) catnses);
_indirizzo = _msk->get_bool(F_INDIRIZZO);
_datanasc = _msk->get_bool(F_DATANASC);
_categoria = _msk->get_bool(F_CATEGORIA);
_sezione = _msk->get_bool(F_SEZIONE);
_gruppoab0 = _msk->get_bool(F_GRUPPOAB0);
_rhantid = _msk->get_bool(F_RHANTID);
//current_cursor()->setfilter("DOM_CODCOM == \"\"");
current_cursor()->set_filterfunction (filter_func_incompleti);
reset_print();
crea_intestazione();
return TRUE;
}
else
return FALSE;
}
void TStampaIncompleti::crea_intestazione()
{
reset_header();
TString sep(132);
sep = "STAMPA DI CONTROLLO SOGGETTI INCOMPLETI";
sep.center_just();
set_header(2, "@0g%s", (const char*) sep);
TString16 data_stampa = _data_stampa.string();
set_header(2,"@0g%10s", (const char*) data_stampa);
sep = "";
sep << "Pag. @#";
set_header(2, "@120g%s", (const char*) sep);
sep = "";
sep.fill('-');
set_header(3, (const char *) sep);
set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gIndirizzo@100gTelefono abit.@116gTelefono lavoro");
set_header(5,"@49gCAP/Località/Comune/Prov.@116gTelefono altro");
set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g---------------");
}
bool TStampaIncompleti::user_create()
{
_rel = new TRelation(LF_SOGGETTI);
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCP);
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
// per stampare nell'intestazione la denominazione della sezione
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
// ordinamento per sezione+sottogruppo+cognome+nome
_cur = add_cursor(new TCursor(_rel, "", 3));
_msk = new TMask("at6400a");
return TRUE;
}
bool TStampaIncompleti::user_destroy()
{
delete _msk;
delete _rel;
return TRUE;
}
int at6400(int argc, char* argv[])
{
TStampaIncompleti a;
a.run(argc, argv, "Stampa di controllo soggetti incompleti");
return 0;
}

44
at/at6400a.h Executable file
View File

@ -0,0 +1,44 @@
// stampa elenco soggetti con dati incompleti
// definizione campi per maschera di selezione
#define F_SEZINI 101
#define F_D_SEZINI 102
#define F_SOTINI 103
#define F_D_SOTINI 104
#define F_SEZFIN 105
#define F_D_SEZFIN 106
#define F_SOTFIN 107
#define F_D_SOTFIN 108
#define F_CAT1 201
#define F_D_CAT1 202
#define F_CAT2 203
#define F_D_CAT2 204
#define F_CAT3 205
#define F_D_CAT3 206
#define F_CAT4 207
#define F_D_CAT4 208
#define F_CAT5 209
#define F_D_CAT5 210
#define F_CAT6 211
#define F_D_CAT6 212
#define F_CATN1 301
#define F_D_CATN1 302
#define F_CATN2 303
#define F_D_CATN2 304
#define F_CATN3 305
#define F_D_CATN3 306
#define F_CATN4 307
#define F_D_CATN4 308
#define F_CATN5 309
#define F_D_CATN5 310
#define F_CATN6 311
#define F_D_CATN6 312
#define F_INDIRIZZO 401
#define F_DATANASC 402
#define F_GRUPPOAB0 403
#define F_RHANTID 404
#define F_CATEGORIA 405
#define F_SEZIONE 406

418
at/at6400a.uml Executable file
View File

@ -0,0 +1,418 @@
#include "at6400a.h"
#include "lf.h"
PAGE "Stampa soggetti incompleti" -1 -1 78 20
GROUPBOX DLG_NULL 77 4
BEGIN
PROMPT 1 0 "Scelta sezioni/sottogruppi"
END
STRING F_SEZINI 2
BEGIN
PROMPT 2 1 "Da "
FLAGS "U"
USE LF_SEZIONI
INPUT CODSEZ F_SEZINI
INPUT CODSOT F_SOTINI
DISPLAY "Cod.sez" CODSEZ
DISPLAY "Cod.sot." CODSOT
DISPLAY "Sezione@25" DENSEZ
DISPLAY "Sottogruppo@25" DENSOT
OUTPUT F_SEZINI CODSEZ
OUTPUT F_D_SEZINI DENSEZ
OUTPUT F_SOTINI CODSOT
OUTPUT F_D_SOTINI DENSOT
CHECKTYPE SEARCH
HELP "Codice sezione da cui partire"
END
STRING F_D_SEZINI 25
BEGIN
PROMPT 11 1 ""
FLAGS "U"
USE LF_SEZIONI KEY 2
INPUT DENSEZ F_D_SEZINI
DISPLAY "Sezione@25" DENSEZ
DISPLAY "Sottogruppo@25" DENSOT
DISPLAY "Cod.sez" CODSEZ
DISPLAY "Cod.sot." CODSOT
COPY OUTPUT F_SEZINI
CHECKTYPE NORMAL
HELP "Sezione da cui partire"
END
STRING F_SOTINI 2
BEGIN
PROMPT 2 2 " "
COPY ALL F_SEZINI
CHECKTYPE SEARCH
HELP "Codice sottogruppo da cui partire"
END
STRING F_D_SOTINI 25
BEGIN
PROMPT 11 2 ""
FLAGS "U"
COPY USE F_D_SEZINI
INPUT DENSEZ F_D_SEZINI
INPUT DENSOT F_D_SOTINI
COPY DISPLAY F_D_SEZINI
COPY OUTPUT F_D_SEZINI
CHECKTYPE NORMAL
HELP "Sottogruppo da cui partire"
END
STRING F_SEZFIN 2
BEGIN
PROMPT 41 1 "A "
FLAGS "U"
USE LF_SEZIONI
INPUT CODSEZ F_SEZFIN
INPUT CODSOT F_SOTFIN
DISPLAY "Cod.sez" CODSEZ
DISPLAY "Cod.sot." CODSOT
DISPLAY "Sezione@25" DENSEZ
DISPLAY "Sottogruppo@25" DENSOT
OUTPUT F_SEZFIN CODSEZ
OUTPUT F_D_SEZFIN DENSEZ
OUTPUT F_SOTFIN CODSOT
OUTPUT F_D_SOTFIN DENSOT
CHECKTYPE SEARCH
HELP "Codice sezione finale"
END
STRING F_D_SEZFIN 25
BEGIN
PROMPT 49 1 ""
FLAGS "U"
USE LF_SEZIONI KEY 2
INPUT DENSEZ F_D_SEZFIN
DISPLAY "Sezione@25" DENSEZ
DISPLAY "Sottogruppo@25" DENSOT
DISPLAY "Cod.sez" CODSEZ
DISPLAY "Cod.sot." CODSOT
COPY OUTPUT F_SEZFIN
CHECKTYPE NORMAL
HELP "Sezione finale"
END
STRING F_SOTFIN 2
BEGIN
PROMPT 41 2 " "
COPY ALL F_SEZFIN
CHECKTYPE SEARCH
HELP "Codice sottogruppo finale"
END
STRING F_D_SOTFIN 25
BEGIN
PROMPT 49 2 ""
FLAGS "U"
COPY USE F_D_SEZFIN
INPUT DENSEZ F_D_SEZFIN
INPUT DENSOT F_D_SOTFIN
COPY DISPLAY F_D_SEZFIN
COPY OUTPUT F_D_SEZFIN
CHECKTYPE NORMAL
HELP "Sottogruppo finale"
END
GROUPBOX DLG_NULL 77 5
BEGIN
PROMPT 1 4 "Categorie donatori"
END
STRING F_CAT1 2
BEGIN
PROMPT 2 5 ""
FLAGS "U"
USE CTD
INPUT CODTAB F_CAT1
DISPLAY "Codice" CODTAB
DISPLAY "Descrizione@30" S0
OUTPUT F_CAT1 CODTAB
OUTPUT F_D_CAT1 S0
CHECKTYPE NORMAL
WARNING "Codice non presente"
HELP "Categoria di appartenenza"
END
STRING F_D_CAT1 30
BEGIN
PROMPT 8 5 ""
FLAGS "D"
END
STRING F_CAT2 2
BEGIN
PROMPT 2 6 ""
FLAGS "U"
USE CTD
INPUT CODTAB F_CAT2
COPY DISPLAY F_CAT1
OUTPUT F_CAT2 CODTAB
OUTPUT F_D_CAT2 S0
CHECKTYPE NORMAL
WARNING "Codice non presente"
HELP "Categoria di appartenenza"
END
STRING F_D_CAT2 30
BEGIN
PROMPT 8 6 ""
FLAGS "D"
END
STRING F_CAT3 2
BEGIN
PROMPT 2 7 ""
FLAGS "U"
USE CTD
INPUT CODTAB F_CAT3
COPY DISPLAY F_CAT1
OUTPUT F_CAT3 CODTAB
OUTPUT F_D_CAT3 S0
CHECKTYPE NORMAL
WARNING "Codice non presente"
HELP "Categoria di appartenenza"
END
STRING F_D_CAT3 30
BEGIN
PROMPT 8 7 ""
FLAGS "D"
END
STRING F_CAT4 2
BEGIN
PROMPT 40 5 ""
FLAGS "U"
USE CTD
INPUT CODTAB F_CAT4
COPY DISPLAY F_CAT1
OUTPUT F_CAT4 CODTAB
OUTPUT F_D_CAT4 S0
CHECKTYPE NORMAL
WARNING "Codice non presente"
HELP "Categoria di appartenenza"
END
STRING F_D_CAT4 30
BEGIN
PROMPT 46 5 ""
FLAGS "D"
END
STRING F_CAT5 2
BEGIN
PROMPT 40 6 ""
FLAGS "U"
USE CTD
INPUT CODTAB F_CAT5
COPY DISPLAY F_CAT1
OUTPUT F_CAT5 CODTAB
OUTPUT F_D_CAT5 S0
CHECKTYPE NORMAL
WARNING "Codice non presente"
HELP "Categoria di appartenenza"
END
STRING F_D_CAT5 30
BEGIN
PROMPT 46 6 ""
FLAGS "D"
END
STRING F_CAT6 2
BEGIN
PROMPT 40 7 ""
FLAGS "U"
USE CTD
INPUT CODTAB F_CAT6
COPY DISPLAY F_CAT1
OUTPUT F_CAT6 CODTAB
OUTPUT F_D_CAT6 S0
CHECKTYPE NORMAL
WARNING "Codice non presente"
HELP "Categoria di appartenenza"
END
STRING F_D_CAT6 30
BEGIN
PROMPT 46 7 ""
FLAGS "D"
END
GROUPBOX DLG_NULL 77 5
BEGIN
PROMPT 1 9 "Categorie non donatori"
END
STRING F_CATN1 2
BEGIN
PROMPT 2 10 ""
FLAGS "U"
USE CTN
INPUT CODTAB F_CATN1
DISPLAY "Codice" CODTAB
DISPLAY "Descrizione@30" S0
OUTPUT F_CATN1 CODTAB
OUTPUT F_D_CATN1 S0
CHECKTYPE NORMAL
WARNING "Codice non presente"
HELP "Categoria di appartenenza"
END
STRING F_D_CATN1 30
BEGIN
PROMPT 8 10 ""
FLAGS "D"
END
STRING F_CATN2 2
BEGIN
PROMPT 2 11 ""
FLAGS "U"
USE CTN
INPUT CODTAB F_CATN2
COPY DISPLAY F_CATN1
OUTPUT F_CATN2 CODTAB
OUTPUT F_D_CATN2 S0
CHECKTYPE NORMAL
WARNING "Codice non presente"
HELP "Categoria di appartenenza"
END
STRING F_D_CATN2 30
BEGIN
PROMPT 8 11 ""
FLAGS "D"
END
STRING F_CATN3 2
BEGIN
PROMPT 2 12 ""
FLAGS "U"
USE CTN
INPUT CODTAB F_CATN3
COPY DISPLAY F_CATN1
OUTPUT F_CATN3 CODTAB
OUTPUT F_D_CATN3 S0
CHECKTYPE NORMAL
WARNING "Codice non presente"
HELP "Categoria di appartenenza"
END
STRING F_D_CATN3 30
BEGIN
PROMPT 8 12 ""
FLAGS "D"
END
STRING F_CATN4 2
BEGIN
PROMPT 40 10 ""
FLAGS "U"
USE CTN
INPUT CODTAB F_CATN4
COPY DISPLAY F_CATN1
OUTPUT F_CATN4 CODTAB
OUTPUT F_D_CATN4 S0
CHECKTYPE NORMAL
WARNING "Codice non presente"
HELP "Categoria di appartenenza"
END
STRING F_D_CATN4 30
BEGIN
PROMPT 46 10 ""
FLAGS "D"
END
STRING F_CATN5 2
BEGIN
PROMPT 40 11 ""
FLAGS "U"
USE CTN
INPUT CODTAB F_CATN5
COPY DISPLAY F_CATN1
OUTPUT F_CATN5 CODTAB
OUTPUT F_D_CATN5 S0
CHECKTYPE NORMAL
WARNING "Codice non presente"
HELP "Categoria di appartenenza"
END
STRING F_D_CATN5 30
BEGIN
PROMPT 46 11 ""
FLAGS "D"
END
STRING F_CATN6 2
BEGIN
PROMPT 40 12 ""
FLAGS "U"
USE CTN
INPUT CODTAB F_CATN6
COPY DISPLAY F_CATN1
OUTPUT F_CATN6 CODTAB
OUTPUT F_D_CATN6 S0
CHECKTYPE NORMAL
WARNING "Codice non presente"
HELP "Categoria di appartenenza"
END
STRING F_D_CATN6 30
BEGIN
PROMPT 46 12 ""
FLAGS "D"
END
GROUPBOX DLG_NULL 77 4
BEGIN
PROMPT 1 14 "Soggetti con i seguenti dati incompleti"
END
BOOLEAN F_INDIRIZZO
BEGIN
PROMPT 2 15 "Indirizzo domicilio"
END
BOOLEAN F_DATANASC
BEGIN
PROMPT 2 16 "Data di nascita"
END
BOOLEAN F_CATEGORIA
BEGIN
PROMPT 27 15 "Categoria"
END
BOOLEAN F_SEZIONE
BEGIN
PROMPT 27 16 "Sezione di appartenenza"
END
BOOLEAN F_GRUPPOAB0
BEGIN
PROMPT 57 15 "Gruppo AB0"
END
BOOLEAN F_RHANTID
BEGIN
PROMPT 57 16 "Rh/AntiD"
END
BUTTON DLG_OK 9 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_QUIT 9 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
ENDMASK

185
at/at6500.cpp Executable file
View File

@ -0,0 +1,185 @@
#include <form.h>
#include <mask.h>
#include <printapp.h>
#include <utility.h>
#include "lf.h"
#include "donaz.h"
#include "soggetti.h"
#include "sezioni.h"
#include "at6.h"
#include "at6500a.h"
//#define ALIAS_LDN 100
class TRiepilogoDonazioni : public TPrintapp
{
TRelation* _rel;
TMask* _msk;
int _cur;
TDate _dataini, _datafin;
TString16 _codsez, _codsot;
int _mese,_anno;
//bool _primedon;
TAssoc_array* _totali_mese;
TAssoc_array* _totali_anno;
TAssoc_array* _totali_sezione;
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);
public:
void crea_intestazione();
void header_sezione(const TString16 codsez, const TString16 codsot);
TMask& app_mask() { return *_msk; }
TRiepilogoDonazioni() {}
};
HIDDEN inline TRiepilogoDonazioni& app() { return (TRiepilogoDonazioni&) main_app(); }
void TRiepilogoDonazioni::set_page(int file, int cnt)
{
}
bool TRiepilogoDonazioni::preprocess_page(int file, int counter)
{
TRectype& recsog = current_cursor()->curr(LF_SOGGETTI);
// salto pagina se cambio sezione
const TString16 codsez = recsog.get(SOG_CODSEZ);
const TString16 codsot = recsog.get(SOG_CODSOT);
if ((_codsez != codsez) || (_codsot != codsot))
{
if (_codsez != "**")
//printer().formfeed();
riepilogo_sezione();
_codsez = codsez;
_codsot = codsot;
_mese = -1;
_anno = -1;
header_sezione(codsez, codsot);
}
const TDate datadon = current_cursor()->curr().get(DON_DATADON);
const int mese = datadon.month();
const int anno = datadon.year();
if (_mese != mese)
{
if (_mese != -1)
riepilogo_mese();
_mese = mese;
}
if (_anno != anno)
{
if (_anno != -1)
riepilogo_anno();
_anno = anno;
}
const char* tipodon = current_cursor()->curr().get(DON_TIPODON);
if (_totali_mese.is_key(tipodon))
_totali_mese[tipodon]++;
else
_totali_mese.add(tipodon,1);
if (_totali_anno.is_key(tipodon))
_totali_anno[tipodon]++;
else
_totali_anno.add(tipodon,1);
return TRUE;
}
bool TRiepilogoDonazioni::set_print(int m)
{
KEY tasto;
tasto = _msk->run();
if (tasto == K_ENTER)
{
_dataini = _msk->get_date(F_DATAINI);
_datafin = _msk->get_date(F_DATAFIN);
//_primedon = _msk->get_bool(F_PRIMEDON);
TString80 chiave = "";
chiave = "90->CODSEZ|90->CODSOT|92->DATADON|";
// filtro per sezione/sottogruppo
TString80 filtro = "";
if
// filtro per data
TRectype da(LF_DONAZ);
TRectype a (LF_DONAZ);
if (_dataini.ok())
da.put(DON_DATADON, _dataini);
if (_datafin.ok())
a.put(DON_DATADON, _datafin);
_cur = add_cursor(new TSorted_cursor(_rel, (const char*) chiave, "", 2, &da, &a));
// manca il filtro da sez./sot. a sez./sot.
//current_cursor()->setfilter((const char*) filtro, TRUE);
_codsez = "**";
_codsot = "**";
_mese = -1;
_anno = -1;
reset_files();
add_file(LF_DONAZ);
reset_print();
crea_intestazione();
return TRUE;
}
else
return FALSE;
}
void TRiepilogoDonazioni::crea_intestazione()
{
reset_header();
TString sep(132);
sep = "RIEPILOGO DONAZIONI ";
if (_dataini.ok())
{
sep << " DAL ";
sep << _dataini.string();
}
if (_datafin.ok())
{
sep << " AL ";
sep << _datafin.string();
}
sep.center_just();
set_header(2, "@0g%s", (const char*) sep);
TString16 data_stampa = _data_stampa.string();
set_header(2,"@0g%10s", (const char*) data_stampa);
sep = "";
sep << "Pag. @#";
set_header(2, "@120g%s", (const char*) sep);
sep = "";
sep.fill('-');
set_header(3, (const char *) sep);
}
bool TRiepilogoDonazioni::user_create()
{
_rel = new TRelation(LF_DONAZ);
_rel->add(LF_SOGGETTI, "CODICE==CODICE");
//_rel->add("LDN", "CODTAB==LUOGODON",1,0,ALIAS_LDN);
_msk = new TMask("at6500a");
_totali_mese = new TAssoc_array();
_totali_anno = new TAssoc_array();
_totali_sezione = new TAssoc_array();
return TRUE;
}
bool TRiepilogoDonazioni::user_destroy()
{
delete _msk;
delete _rel;
delete _totali_mese;
delete _totali_anno;
delete _totali_sezione;
return TRUE;
}
int at6500(int argc, char* argv[])
{
TRiepilogoDonazioni a;
a.run(argc, argv, "Riepilogo donazioni");
return 0;
}

14
at/at6500a.h Executable file
View File

@ -0,0 +1,14 @@
// riepilogo mensile donazioni
// definizione campi per maschera di selezione
#define F_SEZINI 101
#define F_D_SEZINI 102
#define F_SOTINI 103
#define F_D_SOTINI 104
#define F_SEZFIN 105
#define F_D_SEZFIN 106
#define F_SOTFIN 107
#define F_D_SOTFIN 108
#define F_DATAINI 301
#define F_DATAFIN 302

148
at/at6500a.uml Executable file
View File

@ -0,0 +1,148 @@
#include "at6500a.h"
#include "lf.h"
PAGE "Riepilogo mensile donazioni" -1 -1 78 12
GROUPBOX DLG_NULL 77 4
BEGIN
PROMPT 1 1 "Scelta sezioni/sottogruppi"
END
STRING F_SEZINI 2
BEGIN
PROMPT 2 2 "Da "
FLAGS "U"
USE LF_SEZIONI
INPUT CODSEZ F_SEZINI
INPUT CODSOT F_SOTINI
DISPLAY "Cod.sez" CODSEZ
DISPLAY "Cod.sot." CODSOT
DISPLAY "Sezione@25" DENSEZ
DISPLAY "Sottogruppo@25" DENSOT
OUTPUT F_SEZINI CODSEZ
OUTPUT F_D_SEZINI DENSEZ
OUTPUT F_SOTINI CODSOT
OUTPUT F_D_SOTINI DENSOT
CHECKTYPE SEARCH
HELP "Codice sezione da cui partire"
END
STRING F_D_SEZINI 25
BEGIN
PROMPT 11 2 ""
FLAGS "U"
USE LF_SEZIONI KEY 2
INPUT DENSEZ F_D_SEZINI
DISPLAY "Sezione@25" DENSEZ
DISPLAY "Sottogruppo@25" DENSOT
DISPLAY "Cod.sez" CODSEZ
DISPLAY "Cod.sot." CODSOT
COPY OUTPUT F_SEZINI
CHECKTYPE NORMAL
HELP "Sezione da cui partire"
END
STRING F_SOTINI 2
BEGIN
PROMPT 2 3 " "
COPY ALL F_SEZINI
CHECKTYPE SEARCH
HELP "Codice sottogruppo da cui partire"
END
STRING F_D_SOTINI 25
BEGIN
PROMPT 11 3 ""
FLAGS "U"
COPY USE F_D_SEZINI
INPUT DENSEZ F_D_SEZINI
INPUT DENSOT F_D_SOTINI
COPY DISPLAY F_D_SEZINI
COPY OUTPUT F_D_SEZINI
CHECKTYPE NORMAL
HELP "Sottogruppo da cui partire"
END
STRING F_SEZFIN 2
BEGIN
PROMPT 41 2 "A "
FLAGS "U"
USE LF_SEZIONI
INPUT CODSEZ F_SEZFIN
INPUT CODSOT F_SOTFIN
DISPLAY "Cod.sez" CODSEZ
DISPLAY "Cod.sot." CODSOT
DISPLAY "Sezione@25" DENSEZ
DISPLAY "Sottogruppo@25" DENSOT
OUTPUT F_SEZFIN CODSEZ
OUTPUT F_D_SEZFIN DENSEZ
OUTPUT F_SOTFIN CODSOT
OUTPUT F_D_SOTFIN DENSOT
CHECKTYPE SEARCH
HELP "Codice sezione finale"
END
STRING F_D_SEZFIN 25
BEGIN
PROMPT 49 2 ""
FLAGS "U"
USE LF_SEZIONI KEY 2
INPUT DENSEZ F_D_SEZFIN
DISPLAY "Sezione@25" DENSEZ
DISPLAY "Sottogruppo@25" DENSOT
DISPLAY "Cod.sez" CODSEZ
DISPLAY "Cod.sot." CODSOT
COPY OUTPUT F_SEZFIN
CHECKTYPE NORMAL
HELP "Sezione finale"
END
STRING F_SOTFIN 2
BEGIN
PROMPT 41 3 " "
COPY ALL F_SEZFIN
CHECKTYPE SEARCH
HELP "Codice sottogruppo finale"
END
STRING F_D_SOTFIN 25
BEGIN
PROMPT 49 3 ""
FLAGS "U"
COPY USE F_D_SEZFIN
INPUT DENSEZ F_D_SEZFIN
INPUT DENSOT F_D_SOTFIN
COPY DISPLAY F_D_SEZFIN
COPY OUTPUT F_D_SEZFIN
CHECKTYPE NORMAL
HELP "Sottogruppo finale"
END
GROUPBOX DLG_NULL 77 3
BEGIN
PROMPT 1 5 "Opzioni per il riepilogo"
END
DATE F_DATAINI
BEGIN
PROMPT 2 6 "Donazioni effettuate dal "
HELP "Data iniziale"
END
DATE F_DATAFIN
BEGIN
PROMPT 40 6 "al "
HELP "Data finale"
END
BUTTON DLG_OK 9 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_QUIT 9 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
ENDMASK

View File

@ -4,7 +4,7 @@
#include "at7.h"
#define usage "Error - usage : %s -{0}"
#define usage "Error - usage : %s -{0|1|2|3}"
int main(int argc,char** argv)
@ -16,6 +16,12 @@ int main(int argc,char** argv)
{
case 0:
rt = at7100(argc,argv) ; break;
case 1:
rt = at7200(argc,argv) ; break;
case 2:
rt = at7300(argc,argv) ; break;
case 3:
rt = at7400(argc,argv) ; break;
default:
error_box(usage, argv[0]) ; break;
}

View File

@ -2,6 +2,9 @@
#define __AT7_H
int at7100(int argc, char* argv[]);
int at7200(int argc, char* argv[]);
int at7300(int argc, char* argv[]);
int at7400(int argc, char* argv[]);
#endif // __AT7_H

View File

@ -9,3 +9,23 @@
MENU TASK_MENUBAR
SUBMENU MENU_FILE "~File"
/* at7 -1 correzioni bolzano */
MENUBAR MENU_BAR(1)
MENU MENU_BAR(1)
SUBMENU MENU_FILE "~File"
/* at7 -2 so senza data fs */
MENUBAR MENU_BAR(2)
MENU MENU_BAR(2)
SUBMENU MENU_FILE "~File"
/* at7 -3 nati a cermes */
MENUBAR MENU_BAR(3)
MENU MENU_BAR(3)
SUBMENU MENU_FILE "~File"
/* at7 -4 sezione/sottogruppo su donazioni in base a soggetti e storico */
MENUBAR MENU_BAR(4)
MENU MENU_BAR(4)
SUBMENU MENU_FILE "~File"

View File

@ -13,7 +13,8 @@
#define ALIAS_LCPR 200
#define ALIAS_COMD 300
#define ALIAS_COMR 400
class TCAP_app : public TPrintapp
class TAggiornaCAP : public TPrintapp
{
TMask* _msk;
TRelation* _rel;
@ -27,12 +28,12 @@ protected:
virtual bool preprocess_page(int file, int counter);
public:
TCAP_app() {}
TAggiornaCAP() {}
};
HIDDEN inline TCAP_app& app() { return (TCAP_app&) main_app(); }
HIDDEN inline TAggiornaCAP& app() { return (TAggiornaCAP&) main_app(); }
bool TCAP_app::preprocess_page(int file, int counter)
bool TAggiornaCAP::preprocess_page(int file, int counter)
{
bool rew = FALSE;
TString16 cap;
@ -68,14 +69,14 @@ bool TCAP_app::preprocess_page(int file, int counter)
return rew;
}
void TCAP_app::set_page(int file, int cnt)
void TAggiornaCAP::set_page(int file, int cnt)
{
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########"));
set_row(1,"@10g@S", FLD(LF_SOGGETTI,SOG_COGNOME));
set_row(1,"@36g@S", FLD(LF_SOGGETTI,SOG_NOME));
}
bool TCAP_app::set_print(int)
bool TAggiornaCAP::set_print(int)
{
KEY tasto;
tasto = _msk->run();
@ -90,7 +91,7 @@ bool TCAP_app::set_print(int)
return FALSE;
}
bool TCAP_app::user_create()
bool TAggiornaCAP::user_create()
{
_msk = new TMask("at7100a");
_rel = new TRelation(LF_SOGGETTI);
@ -98,11 +99,11 @@ bool TCAP_app::user_create()
_rel->add(LF_COMUNI, "COM==DOM_CODCOM",1,0,ALIAS_COMD);
_rel->add("LCP", "CODTAB==RES_CODLOC",1,0,ALIAS_LCPR);
_rel->add(LF_COMUNI, "COM==RES_CODCOM",1,0,ALIAS_COMR);
_cur = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
_cur = add_cursor(new TCursor(_rel, "", 1));
return TRUE;
}
bool TCAP_app::user_destroy()
bool TAggiornaCAP::user_destroy()
{
delete _rel;
delete _msk;
@ -111,7 +112,7 @@ bool TCAP_app::user_destroy()
int at7100(int argc, char* argv[])
{
TCAP_app a;
TAggiornaCAP a;
a.run(argc, argv, "Aggiornamento CAP su indirizzi");
return 0;
}

View File

@ -8,16 +8,16 @@
// nomi dei campi
#include "soggetti.h"
#include "donaz.h"
#include "contsan.h"
#define ALIAS_TDN 100
#define ALIAS_TCS 200
class TRiordina_app : public TPrintapp
class TBolzano_app : public TPrintapp
{
TMask* _msk;
TRelation* _rel;
int _cur;
TString16 _cateme;
TString16 _catdec;
TString16 _fenEE;
TString16 _fenee;
protected:
virtual bool user_create();
@ -27,55 +27,79 @@ protected:
virtual bool preprocess_page(int file, int counter);
public:
TRiordina_app() {}
TBolzano_app() {}
};
HIDDEN inline TRiordina_app& app() { return (TRiordina_app&) main_app(); }
HIDDEN inline TBolzano_app& app() { return (TBolzano_app&) main_app(); }
bool TRiordina_app::preprocess_page(int file, int counter)
bool TBolzano_app::preprocess_page(int file, int counter)
{
bool rew = FALSE;
TString16 cap;
TString16 loc;
TString16 com;
TRectype& recsog = current_cursor()->curr();
cap = recsog.get(SOG_DOM_CAP);
com = recsog.get(SOG_DOM_CODCOM);
if (cap.empty() && com.not_empty())
// luogo di lavoro == gruppo aziendale
TString16 luogo;
luogo = recsog.get(SOG_LUOGOLAV);
if (luogo.not_empty())
{
loc = recsog.get(SOG_DOM_CODLOC);
if (loc.empty())
cap = current_cursor()->file(-ALIAS_COMD).get("CAPCOM");
else
cap = current_cursor()->file(-ALIAS_LCPD).get("S6");
recsog.put(SOG_DOM_CAP, cap);
recsog.put(SOG_GRUPPOAZIE, luogo);
rew = TRUE;
}
cap = recsog.get(SOG_RES_CAP);
com = recsog.get(SOG_RES_CODCOM);
if (cap.empty() && com.not_empty())
// categorie EM/DE scambiate
TString16 cat;
cat = recsog.get(SOG_CATDON);
if (cat == _cateme)
{
loc = recsog.get(SOG_RES_CODLOC);
if (loc.empty())
cap = current_cursor()->file(-ALIAS_COMR).get("CAPCOM");
else
cap = current_cursor()->file(-ALIAS_LCPR).get("S6");
recsog.put(SOG_RES_CAP, cap);
rew = TRUE;
recsog.put(SOG_CATDON, _catdec);
rew = TRUE;
}
if (cat == _catdec)
{
recsog.put(SOG_CATDON, _cateme);
rew = TRUE;
}
long cod = recsog.get_long(SOG_CODICE);
if (cod < 15077)
{
TString16 fenotipo;
fenotipo = recsog.get(SOG_FENOTIPORH);
if (fenotipo.not_empty())
{
int pos;
pos = fenotipo.find(_fenEE);
if (pos > 0)
{
fenotipo.overwrite(_fenee,pos);
recsog.put(SOG_FENOTIPORH,fenotipo);
rew = TRUE;
}
else
{
pos = fenotipo.find(_fenee);
if (pos > 0)
{
fenotipo.overwrite(_fenEE,pos);
recsog.put(SOG_FENOTIPORH,fenotipo);
rew = TRUE;
}
}
}
}
if (rew)
current_cursor()->file().rewrite();
return rew;
}
void TCAP_app::set_page(int file, int cnt)
void TBolzano_app::set_page(int file, int cnt)
{
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########"));
set_row(1,"@10g@S", FLD(LF_SOGGETTI,SOG_COGNOME));
set_row(1,"@36g@S", FLD(LF_SOGGETTI,SOG_NOME));
set_row(1,"@62g@S", FLD(LF_SOGGETTI,SOG_CATDON));
set_row(1,"@65g@S", FLD(LF_SOGGETTI,SOG_LUOGOLAV));
set_row(1,"@70g@S", FLD(LF_SOGGETTI,SOG_FENOTIPORH));
}
bool TCAP_app::set_print(int)
bool TBolzano_app::set_print(int)
{
KEY tasto;
tasto = _msk->run();
@ -84,25 +108,25 @@ bool TCAP_app::set_print(int)
reset_files();
add_file(LF_SOGGETTI);
reset_print();
_cateme = "EM";
_catdec = "DE";
_fenEE = "EE";
_fenee = "ee";
return TRUE;
}
else
return FALSE;
}
bool TCAP_app::user_create()
bool TBolzano_app::user_create()
{
_msk = new TMask("at7200a");
_rel = new TRelation(LF_SOGGETTI);
_rel->add("TDN", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCPD);
_rel->add(LF_COMUNI, "COM==DOM_CODCOM",1,0,ALIAS_COMD);
_rel->add("LCP", "CODTAB==RES_CODLOC",1,0,ALIAS_LCPR);
_rel->add(LF_COMUNI, "COM==RES_CODCOM",1,0,ALIAS_COMR);
_cur = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
_cur = add_cursor(new TCursor(_rel, "", 1));
return TRUE;
}
bool TCAP_app::user_destroy()
bool TBolzano_app::user_destroy()
{
delete _rel;
delete _msk;
@ -111,7 +135,7 @@ bool TCAP_app::user_destroy()
int at7200(int argc, char* argv[])
{
TRiordina_app a;
a.run(argc, argv, "Riordina donazioni e controlli");
TBolzano_app a;
a.run(argc, argv, "Correzioni per AVIS Bolzano");
return 0;
}

View File

@ -1,5 +1,5 @@
#include "lf.h"
PAGE "Riordina donazioni e controlli" -1 -1 78 20
PAGE "Correzioni per AVIS Bolzano" -1 -1 78 20
BUTTON DLG_OK 9 2
BEGIN

114
at/at7300.cpp Executable file
View File

@ -0,0 +1,114 @@
#include <mask.h>
#include <printapp.h>
#include <recarray.h>
#include <tabutil.h>
#include <utility.h>
#include "at7.h"
#include "lf.h"
#include "atlib.h"
// nomi dei campi
#include "soggetti.h"
#include "contsan.h"
class TFS_NoData_app : public TPrintapp
{
TMask* _msk;
TRelation* _rel;
int _cur;
TLocalisamfile* _soggetti;
TLocalisamfile* _contsan;
TRecord_array* _scontrolli;
TString16 _sospensione, _finesospensione;
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);
public:
TFS_NoData_app() {}
};
HIDDEN inline TFS_NoData_app& app() { return (TFS_NoData_app&) main_app(); }
bool TFS_NoData_app::preprocess_page(int file, int counter)
{
bool rew = FALSE;
TRectype& recsog = current_cursor()->curr();
const long codice = recsog.get_long(SOG_CODICE);
TRectype* key = new TRectype(LF_CONTSAN);
key->put(CON_CODICE, codice);
int err = _scontrolli->read(key);
if (err == NOERR)
{
const int numrighe = _scontrolli->rows();
if (numrighe > 1)
{
const TRectype& riga = _scontrolli->row(numrighe-1);
const TString16 tipocon = riga.get(CON_TIPOCON);
const TString16 prosstipo = riga.get(CON_PROSSTIPO);
const TDate prossdata = riga.get(CON_PROSSDATA);
const TDate datanulla(NULLDATE);
if ((tipocon == _sospensione) && (prosstipo == _finesospensione) && (prossdata == datanulla))
rew = TRUE;
}
}
return rew;
}
void TFS_NoData_app::set_page(int file, int cnt)
{
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########"));
set_row(1,"@10g@S", FLD(LF_SOGGETTI,SOG_COGNOME));
set_row(1,"@36g@S", FLD(LF_SOGGETTI,SOG_NOME));
}
bool TFS_NoData_app::set_print(int)
{
KEY tasto;
tasto = _msk->run();
if (tasto == K_ENTER)
{
reset_files();
add_file(LF_SOGGETTI);
reset_print();
_sospensione = "SO";
_finesospensione = "FS";
current_cursor()->setfilter(format("STATO == \"%s\"",(const char*)_finesospensione));
return TRUE;
}
else
return FALSE;
}
bool TFS_NoData_app::user_create()
{
_msk = new TMask("at7300a");
_rel = new TRelation(LF_SOGGETTI);
_contsan = new TLocalisamfile(LF_CONTSAN);
_scontrolli = new TRecord_array(LF_CONTSAN,CON_PROGCON);
_cur = add_cursor(new TCursor(_rel, "", 1));
return TRUE;
}
bool TFS_NoData_app::user_destroy()
{
delete _rel;
delete _msk;
delete _contsan;
delete _scontrolli;
return TRUE;
}
int at7300(int argc, char* argv[])
{
TFS_NoData_app a;
a.run(argc, argv, "Stampa SO ripristinati senza data FS");
return 0;
}

15
at/at7300a.uml Executable file
View File

@ -0,0 +1,15 @@
#include "lf.h"
PAGE "Stampa SO senza data FS" -1 -1 78 20
BUTTON DLG_OK 9 2
BEGIN
PROMPT -12 14 ""
END
BUTTON DLG_QUIT 9 2
BEGIN
PROMPT -22 14 ""
END
ENDPAGE
ENDMASK

103
at/at7400.cpp Executable file
View File

@ -0,0 +1,103 @@
#include <mask.h>
#include <printapp.h>
#include <tabutil.h>
#include <utility.h>
#include "at7.h"
#include "lf.h" // se non lo metto non riesco a usare gli LF
// nomi dei campi
#include "soggetti.h"
#define ALIAS_LCPD 100
#define ALIAS_LCPR 200
#define ALIAS_COMD 300
#define ALIAS_COMR 400
class TCermes : public TPrintapp
{
TMask* _msk;
TRelation* _rel;
int _cur;
TString16 _cermes, _vuoto;
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);
public:
TCermes() {}
};
HIDDEN inline TCermes& app() { return (TCermes&) main_app(); }
bool TCermes::preprocess_page(int file, int counter)
{
bool rew = FALSE;
TString16 cap;
TString16 loc;
TString16 com;
TRectype& recsog = current_cursor()->curr();
TString16 codcom = recsog.get(SOG_COMNASC);
if (codcom == _cermes)
{
recsog.put(SOG_COMNASC,_vuoto);
rew = TRUE;
}
if (rew)
current_cursor()->file().rewrite();
return rew;
}
void TCermes::set_page(int file, int cnt)
{
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########"));
set_row(1,"@10g@S", FLD(LF_SOGGETTI,SOG_COGNOME));
set_row(1,"@36g@S", FLD(LF_SOGGETTI,SOG_NOME));
}
bool TCermes::set_print(int)
{
KEY tasto;
tasto = _msk->run();
if (tasto == K_ENTER)
{
reset_files();
add_file(LF_SOGGETTI);
reset_print();
return TRUE;
}
else
return FALSE;
}
bool TCermes::user_create()
{
_msk = new TMask("at7400a");
_rel = new TRelation(LF_SOGGETTI);
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCPD);
_rel->add(LF_COMUNI, "COM==DOM_CODCOM",1,0,ALIAS_COMD);
_rel->add("LCP", "CODTAB==RES_CODLOC",1,0,ALIAS_LCPR);
_rel->add(LF_COMUNI, "COM==RES_CODCOM",1,0,ALIAS_COMR);
_cur = add_cursor(new TCursor(_rel, "", 1));
_cermes = "A022";
_vuoto = " ";
return TRUE;
}
bool TCermes::user_destroy()
{
delete _rel;
delete _msk;
return TRUE;
}
int at7400(int argc, char* argv[])
{
TCermes a;
a.run(argc, argv, "Correzione nati a CERMES");
return 0;
}

15
at/at7400a.uml Executable file
View File

@ -0,0 +1,15 @@
#include "lf.h"
PAGE "Correzione nati a CERMES" -1 -1 78 20
BUTTON DLG_OK 9 2
BEGIN
PROMPT -12 14 ""
END
BUTTON DLG_QUIT 9 2
BEGIN
PROMPT -22 14 ""
END
ENDPAGE
ENDMASK

174
at/at7500.cpp Executable file
View File

@ -0,0 +1,174 @@
#include <mask.h>
#include <printapp.h>
#include <tabutil.h>
#include <utility.h>
#include "at7.h"
#include "lf.h" // se non lo metto non riesco a usare gli LF
// nomi dei campi
#include "soggetti.h"
#include "storico.h"
#include "donaz.h"
class TAggiornaDon : public TPrintapp
{
TMask* _msk;
TRelation* _rel;
int _cur;
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);
public:
TAggiornaDon() {}
};
HIDDEN inline TAggiornaDon& app() { return (TAggiornaDon&) main_app(); }
bool TAggiornaDon::preprocess_page(int file, int counter)
{
bool rewrite = FALSE;
TRectype& recsog = current_cursor()->curr();
const TDate dataisc = recsog.get(SOG_DATAISC);
const TDate datadim = recsog.get(SOG_DATADIM);
const long codice = recsog.get_long(SOG_CODICE);
const TString16 codsez = recsog.get(SOG_CODSEZ);
const TString16 codsot = recsog.get(SOG_CODSOT);
TRectype* keys = new TRectype(LF_STORICO);
keys->put(SOG_CODICE, codice);
int errs = _sstorico->read(keys);
TRectype* keyd = new TRectype(LF_DONAZ);
keyd->put(DON_CODICE, codice);
int errd = _sdonazioni->read(keyd);
if (errd == NOERR)
{
TDate datadon;
for (int r=1; r<=_sdonazioni->rows(); r++)
{
const TRectype& riga = _sdonazioni->row(r);
datadon = riga.get(DON_DATADON);
if (dataisc.ok())
// ha la data iscrizione
{
if (datadon >= dataisc)
// la data donazione è superiore alla data iscrizione
if (datadim.ok())
// ha la data dimisssione
if (datadon <= datadim)
// la data donazione è inferiore alla data dimissione
{
riga.put(DON_CODSEZ, codsez);
riga.put(DON_CODSOT, codsot);
rewrite = TRUE;
}
else
// la data donazione è superiore alla data dimissione
{
// c'è un errore, quindi uso sezione/sottogruppo del soggetto
riga.put(DON_CODSEZ, codsez);
riga.put(DON_CODSOT, codsot);
rewrite = TRUE;
}
else
// non ha data dimissione
{
riga.put(DON_CODSEZ, codsez);
riga.put(DON_CODSOT, codsot);
rewrite = TRUE;
}
else
// la data donazione è inferiore alla data iscrizione
{
bool trovato = FALSE
for (int l=1; l<=_sstorico->rows(); l++)
{
const TRectype& rigas = _sstorico->row(l);
const TDate data1 = rigas.get(STO_DATAISC);
const TDate data2 = rigas.get(STO_DATADIM);
if ((datadon >= data1) && (datadon <= data2))
{
trovato = TRUE;
riga.put(DON_CODSEZ, rigas.get(STO_CODSEZ));
riga.put(DON_CODSOT, rigas.get(STO_CODSOT));
rewrite = TRUE;
}
}
if (!trovato)
// non ha trovato nello storico un periodo corrispondente alla data donazione
{
riga.put(DON_CODSEZ, codsez);
riga.put(DON_CODSOT, codsot);
rewrite = TRUE;
}
}
}
else
// non ha la data di iscrizione
{
riga.put(DON_CODSEZ, codsez);
riga.put(DON_CODSOT, codsot);
rewrite = TRUE;
}
}
if (rewrite)
_sdonazioni.rewrite();
}
return rewrite;
}
void TAggiornaDon::set_page(int file, int cnt)
{
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########"));
set_row(1,"@10g@S", FLD(LF_SOGGETTI,SOG_COGNOME));
set_row(1,"@36g@S", FLD(LF_SOGGETTI,SOG_NOME));
}
bool TAggiornaDon::set_print(int)
{
KEY tasto;
tasto = _msk->run();
if (tasto == K_ENTER)
{
reset_files();
add_file(LF_SOGGETTI);
reset_print();
return TRUE;
}
else
return FALSE;
}
bool TAggiornaDon::user_create()
{
_msk = new TMask("at7500a");
_rel = new TRelation(LF_SOGGETTI);
_donaz = new TLocalisamfile(LF_DONAZ);
_storico = new TLocalisamfile(LF_STORICO);
_sdonazioni = new TRecord_array(LF_DONAZ,DON_PROGDON);
_sstorico = new TRecord_array(LF_STORICO,STO_PROGSTO);
_cur = add_cursor(new TCursor(_rel, "", 1));
return TRUE;
}
bool TAggiornaDon::user_destroy()
{
delete _msk;
delete _rel;
delete _donaz;
delete _storico;
delete _sdonazioni;
delete _sstorico;
return TRUE;
}
int at7500(int argc, char* argv[])
{
TAggiornaDon a;
a.run(argc, argv, "Aggiornamento sez./sot. su archivio donazioni");
return 0;
}

15
at/at7500a.uml Executable file
View File

@ -0,0 +1,15 @@
#include "lf.h"
PAGE "Correzione sez./sot. su donazioni" -1 -1 78 20
BUTTON DLG_OK 9 2
BEGIN
PROMPT -12 14 ""
END
BUTTON DLG_QUIT 9 2
BEGIN
PROMPT -22 14 ""
END
ENDPAGE
ENDMASK

View File

@ -11,8 +11,9 @@
1|Soggetti|at0 -0
1|Giornaliero donazioni/controlli|at0 -1
1|Giornaliero controlli|at0 -2
1|Convocazioni su punto di raccolta|at0 -3
1|Convocazioni su punto di prelievo|at0 -3
1|Spostamento convocazioni|at0 -4
1|Parametri di sezione|at5 -0
2|Tabelle|23
2|Sezioni|ba3 -3 at0700a 96
2|Medici|ba3 -3 at0800a 97
@ -22,13 +23,12 @@
2|Gruppi aziendali|ba3 -0 gaz
2|Idoneita' alla donazione|ba3 -0 ido
2|Localita' postali|ba3 -0 lcp
2|Luoghi di donazione|ba3 -0 ldn
2|Punti di prelievo|ba3 -0 ldn
2|Luoghi di lavoro|ba3 -0 ldl
2|Motivi per controlli sanitari|ba3 -0 mtc
2|Professioni|ba3 -0 prf
2|Tipi di donazione|ba3 -0 tdn
2|Tipi/Esiti controlli sanitari|ba3 -0 tcs
2|Stati esteri|ba3 -0 %sta
2|Comuni|ba4 -0
3|Operazioni periodiche|21
3|Chiusura|at1 -0
@ -47,12 +47,19 @@
5|Stampe per convocazioni|22
5|Scadenze di donazione|at4 -0
5|Urgenze|at4 -1
5|Convocazioni Parma|at4 -2
5|Stampa convocazioni su punto di raccolta|at4 -3
5|Convocazioni per sezione|at4 -2
5|Convocazioni su punto di prelievo|at4 -3
6|Stampe di controllo|25
6|Medici|at6 -0
6|Sezioni|at6 -1
6|Donazioni|at6 -2
6|Soggetti incompleti|at6 -3
6|Tabelle|7
7|Stampa di controllo tabelle|25
7|Sezioni|at6 -1
7|Medici|at6 -0
7|Categorie non donatori|ba3 -1 ctn
7|Gruppi aziendali|ba3 -1 gaz
7|Localita' postali|ba3 -1 lcp
7|Luoghi di lavoro|ba3 -1 ldl
99|Manutenzione|04
99|Archivi|ba1
99|Utenti|ba1 -3

17
at/bastctn.uml Executable file
View File

@ -0,0 +1,17 @@
//DEFINIZIONE MASCHERA PER STAMPA TABELLA CATEGORIE NON DONATORI
//#include "bastctn.h"
PAGE "Stampa Tabella Categorie non donatori" -1 -1 56 8
BUTTON DLG_OK 10 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
ENDMASK

17
at/bastgaz.uml Executable file
View File

@ -0,0 +1,17 @@
//DEFINIZIONE MASCHERA PER STAMPA TABELLA GRUPPI AZIENDALI
//#include "bastgaz.h"
PAGE "Stampa Tabella Gruppi Aziendali" -1 -1 56 8
BUTTON DLG_OK 10 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
ENDMASK

17
at/bastlcp.uml Executable file
View File

@ -0,0 +1,17 @@
//DEFINIZIONE MASCHERA PER STAMPA TABELLA LOCALITA' POSTALI
//#include "bastlcp.h"
PAGE "Stampa Tabella Localita' Postali" -1 -1 56 8
BUTTON DLG_OK 10 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
ENDMASK

17
at/bastldl.uml Executable file
View File

@ -0,0 +1,17 @@
//DEFINIZIONE MASCHERA PER STAMPA TABELLA LUOGHI DI LAVORO
//#include "bastldl.h"
PAGE "Stampa Tabella Luoghi di lavoro" -1 -1 56 8
BUTTON DLG_OK 10 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_QUIT 10 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
ENDMASK

9
at/batbctn.rpt Executable file
View File

@ -0,0 +1,9 @@
[Headers]
80
Tabella categorie non donatori
1|@0g%s|Codice
1|@7g%s|Descrizione
[Rows]
1|CODTAB|@0g@2s
1|S0|@7g@30,ls

9
at/batbgaz.rpt Executable file
View File

@ -0,0 +1,9 @@
[Headers]
80
Tabella gruppi aziendali
1|@0g%s|Codice
1|@7g%s|Denominazione gruppo
[Rows]
1|CODTAB|@0g@4s
1|S0|@7g@30,ls

18
at/batblcp.rpt Executable file
View File

@ -0,0 +1,18 @@
[Relations]
13;COM=S7
[Headers]
132
Tabella localita' postali
1|@0g%s|Cod.loc.
1|@9g%s|Denominazione localita'
1|@40g%s|CAP
1|@46g%s|Comune
1|@97g%s|Prov.
[Rows]
1|CODTAB|@0g@4s
1|S0|@9g@30,ls
1|S6|@40g@5,ls
1|13->DENCOM|@46g@50,ls
1|13->PROVCOM|@97g@5,ls

9
at/batbldl.rpt Executable file
View File

@ -0,0 +1,9 @@
[Headers]
80
Tabella luoghi di lavoro
1|@0g%s|Codice
1|@7g%s|Descrizione
[Rows]
1|CODTAB|@0g@4s
1|S0|@7g@40,ls

View File

@ -4,13 +4,13 @@ TOOLBAR "" 0 20 0 2
#include <toolbar.h>
ENDPAGE
PAGE "Luoghi di donazione" -1 -1 78 7
PAGE "Punti di prelievo" -1 -1 78 7
STRING F_TABLDN_CODTAB 4
BEGIN
PROMPT 2 1 "Codice "
FIELD CODTAB
HELP "Inserire il codice del luogo di donazione"
HELP "Inserire il codice del punto di prelievo"
USE LDN
CHECKTYPE REQUIRED
INPUT CODTAB F_TABLDN_CODTAB
@ -24,9 +24,9 @@ END
STRING F_TABLDN_DESCR 50
BEGIN
PROMPT 2 3 "Luogo "
PROMPT 2 3 "Punto "
FIELD S0
HELP "Inserire la descrizione del luogo"
HELP "Inserire la descrizione del punto"
USE LDN KEY 2
CHECKTYPE REQUIRED
INPUT S0 F_TABLDN_DESCR

View File

@ -2,6 +2,7 @@
#define DON_CODICE "CODICE"
#define DON_PROGDON "PROGDON"
#define DON_PROGINS "PROGINS"
#define DON_DATADON "DATADON"
#define DON_TIPODON "TIPODON"
#define DON_LUOGODON "LUOGODON"

8
at/sdu.h Executable file
View File

@ -0,0 +1,8 @@
// listbox per Rh, Kell, Du, CMV
ITEM " |"
MESSAGE COPY,10@
ITEM "NEG|NEG"
MESSAGE COPY,10@
ITEM "POS|POS"
MESSAGE COPY,10@

20
at/sgruppo.h Executable file
View File

@ -0,0 +1,20 @@
// listbox per gruppo sanguigno
ITEM " |"
MESSAGE COPY,6@
ITEM "0|0"
MESSAGE COPY,6@
ITEM "A|A"
MESSAGE COPY,6@
ITEM "A1|A1"
MESSAGE COPY,6@
ITEM "A1B|A1B"
MESSAGE COPY,6@
ITEM "A2|A2"
MESSAGE COPY,6@
ITEM "A2B|A2B"
MESSAGE COPY,6@
ITEM "AB|AB"
MESSAGE COPY,6@
ITEM "B|B"
MESSAGE COPY,6@

10
at/skell.h Executable file
View File

@ -0,0 +1,10 @@
// listbox per Kell
ITEM " |"
MESSAGE COPY,9@
ITEM "NEG|NEG"
MESSAGE COPY,9@
ITEM "POS|POS"
MESSAGE COPY,9@
ITEM "DPO|++"
MESSAGE COPY,9@

8
at/srh.h Executable file
View File

@ -0,0 +1,8 @@
// listbox per Rh, Kell, Du, CMV
ITEM " |"
MESSAGE COPY,7@
ITEM "NEG|NEG"
MESSAGE COPY,7@
ITEM "POS|POS"
MESSAGE COPY,7@