Prima versione di AT Win
git-svn-id: svn://10.65.10.50/trunk@3294 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
6907be7464
commit
9e87d4da39
27
at/at0.cpp
Executable file
27
at/at0.cpp
Executable file
@ -0,0 +1,27 @@
|
||||
#include <xvt.h>
|
||||
#include <strings.h>
|
||||
#include <checks.h>
|
||||
|
||||
#include "at0.h"
|
||||
|
||||
#define usage "Error - usage : %s -{0|1|2}"
|
||||
|
||||
int main(int argc,char** argv)
|
||||
|
||||
{
|
||||
int rt = -1 ;
|
||||
const int r = (argc > 1) ? atoi(&argv[1][1]) : -1;
|
||||
|
||||
switch (r)
|
||||
{
|
||||
case 0:
|
||||
rt = at0100(argc,argv) ; break;
|
||||
case 1:
|
||||
rt = at0200(argc,argv) ; break;
|
||||
case 2:
|
||||
rt = at0300(argc,argv) ; break;
|
||||
default:
|
||||
error_box(usage, argv[0]) ; break;
|
||||
}
|
||||
return rt;
|
||||
}
|
9
at/at0.h
Executable file
9
at/at0.h
Executable file
@ -0,0 +1,9 @@
|
||||
#ifndef __AT0_H
|
||||
#define __AT0_H
|
||||
|
||||
int at0100(int argc, char* argv[]);
|
||||
int at0200(int argc, char* argv[]);
|
||||
int at0300(int argc, char* argv[]);
|
||||
|
||||
#endif // __AT0_H
|
||||
|
36
at/at0.url
Executable file
36
at/at0.url
Executable file
@ -0,0 +1,36 @@
|
||||
#define APPNAME AVIS
|
||||
#define QAPPNAME "AVIS"
|
||||
#define LIBDIR f:\xvt.403\win_x86\ptk\lib
|
||||
|
||||
#include <default.url>
|
||||
|
||||
/* at0 -0 soggetti*/
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
|
||||
/* at0 -1 inserimento donazioni */
|
||||
MENUBAR MENU_BAR(1)
|
||||
|
||||
MENU MENU_BAR(1)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
|
||||
/* at0 -2 chiusura annuale */
|
||||
MENUBAR MENU_BAR(2)
|
||||
|
||||
MENU MENU_BAR(2)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* ba1 -3 */
|
||||
MENUBAR MENU_BAR(3)
|
||||
|
||||
MENU MENU_BAR(3)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* ba1 -4 */
|
||||
MENUBAR MENU_BAR(4)
|
||||
|
||||
MENU MENU_BAR(4)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
154
at/at0100.h
Executable file
154
at/at0100.h
Executable file
@ -0,0 +1,154 @@
|
||||
// definizione campi della maschera at0100a.msk
|
||||
// SOGGETTI e dati collegati
|
||||
|
||||
// pagina 1
|
||||
#define F_CODICE 101
|
||||
#define F_COGNOME 102
|
||||
#define F_NOME 103
|
||||
#define F_DATANASC 104
|
||||
#define F_CODSEZ 105
|
||||
#define F_DENSEZ 106
|
||||
#define F_CODSOT 107
|
||||
#define F_DENSOT 108
|
||||
#define F_CATDON 109
|
||||
#define F_DESC_CATDON 110
|
||||
#define F_DATAISC 111
|
||||
#define F_DATADIM 112
|
||||
#define F_COMNASC 113
|
||||
#define F_DENCOMNASC 114
|
||||
#define F_PROVCOMNASC 115
|
||||
#define F_INDIRIZZO 116
|
||||
#define F_COM 117
|
||||
#define F_DENCOM 118
|
||||
#define F_CAPCOM 119
|
||||
#define F_PROVCOM 120
|
||||
#define F_LOCALITA 121
|
||||
#define F_DENLOC 122
|
||||
#define F_TELABI 123
|
||||
#define F_TELLAV 124
|
||||
#define F_TELALT 125
|
||||
#define F_SESSO 126
|
||||
#define F_DATAULTAGG 127
|
||||
#define F_UTENULTAGG 128
|
||||
|
||||
// pagina 2
|
||||
#define F_CATNOND1 201
|
||||
#define F_DESC_CATNOND1 202
|
||||
#define F_CATNOND2 203
|
||||
#define F_DESC_CATNOND2 204
|
||||
#define F_TITINDIR 205
|
||||
#define F_TESSAVIS 206
|
||||
#define F_CODCT 207
|
||||
#define F_CODCL 208
|
||||
#define F_TESSSSN 209
|
||||
#define F_DOCID 210
|
||||
#define F_CF 211
|
||||
#define F_CONDOCC 212
|
||||
#define F_POSPROF 213
|
||||
#define F_RAMOATT 214
|
||||
#define F_TITSTUD 215
|
||||
#define F_PROFESS 216
|
||||
#define F_DESC_PROF 217
|
||||
#define F_LUOGOLAV 218
|
||||
#define F_DESC_LUOGO 219
|
||||
|
||||
// pagina 3
|
||||
#define F_STATO 301
|
||||
#define F_DESCSTATO 302
|
||||
#define F_DATASTATO 303
|
||||
#define F_IDON1 304
|
||||
#define F_DESC_ID1 305
|
||||
#define F_IDON2 306
|
||||
#define F_DESC_ID2 307
|
||||
#define F_IDON3 308
|
||||
#define F_DESC_ID3 309
|
||||
#define F_IDON4 310
|
||||
#define F_DESC_ID4 311
|
||||
#define F_DATAULTID 312
|
||||
#define F_TIPOULTID 313
|
||||
#define F_INTSI 314
|
||||
#define F_INTAF 315
|
||||
#define F_TOTDON 316
|
||||
#define F_DATAULTDON 317
|
||||
#define F_TIPOULTDON 318
|
||||
#define F_DESC_ULTDON 319
|
||||
#define F_DATAPROSSI 320
|
||||
#define F_DATAPROSAF 321
|
||||
#define F_DATAULTSI 322
|
||||
#define F_DATAULTAF 323
|
||||
#define F_TOTDONSI 324
|
||||
#define F_TOTDONAF 325
|
||||
|
||||
|
||||
// pagina 4
|
||||
#define F_GRUPPOAB0 401
|
||||
#define F_RHANTID 402
|
||||
#define F_KELL 403
|
||||
#define F_FENOTIPORH 404
|
||||
#define F_DU 405
|
||||
#define F_MODCONV 406
|
||||
#define F_GIOPREDON 407
|
||||
#define F_GIOPRECON 408
|
||||
#define F_ESCLUSO 409
|
||||
#define F_TERMESCL 410
|
||||
#define F_MOTESCL 411
|
||||
#define F_CODMED 412
|
||||
#define F_COGNMED 413
|
||||
#define F_NOMMED 414
|
||||
|
||||
// pagina 5
|
||||
#define F_DONAZIONI 501
|
||||
|
||||
// pagina 6
|
||||
#define F_CONTROLLI 601
|
||||
|
||||
// pagina 7
|
||||
#define F_BENEMERENZE 701
|
||||
#define F_STORICO 702
|
||||
|
||||
// pagina donazioni
|
||||
#define F_D_DATADON 101
|
||||
#define F_D_TIPODON 102
|
||||
#define F_D_LUOGODON 103
|
||||
#define F_D_ETICHETTA 104
|
||||
#define F_D_CC 105
|
||||
#define F_D_PA 106
|
||||
#define F_D_HB 107
|
||||
#define F_D_SGPT 108
|
||||
#define F_D_PROTIDEMIA 109
|
||||
//#define F_D_PRIMADON 110
|
||||
#define F_D_DESC_TIPODON 211
|
||||
#define F_D_DESC_LUOGODON 212
|
||||
|
||||
// pagina controlli sanitari
|
||||
#define F_C_DATACON 101
|
||||
#define F_C_TIPOCON 102
|
||||
#define F_C_IDON1 103
|
||||
#define F_C_IDON2 104
|
||||
#define F_C_IDON3 105
|
||||
#define F_C_IDON4 106
|
||||
#define F_C_INTSI 107
|
||||
#define F_C_INTAF 108
|
||||
#define F_C_DESC_TIPOCON 211
|
||||
#define F_C_DESC_IDON1 212
|
||||
#define F_C_DESC_IDON2 213
|
||||
#define F_C_DESC_IDON3 214
|
||||
#define F_C_DESC_IDON4 215
|
||||
|
||||
// pagina benemerenze
|
||||
#define F_B_TIPOBEN 101
|
||||
#define F_B_DATABEN 102
|
||||
#define F_B_RITIRATA 103
|
||||
#define F_B_DESC_TIPOBEN 211
|
||||
|
||||
// pagina storico iscrizioni e dimissioni
|
||||
#define F_S_DATAISC 101
|
||||
#define F_S_DATADIM 102
|
||||
#define F_S_CODSEZ 103
|
||||
#define F_S_CODSOT 104
|
||||
#define F_S_CATISC 105
|
||||
#define F_S_MOTDIM 106
|
||||
#define F_S_DENSEZ 211
|
||||
#define F_S_DENSOT 212
|
||||
#define F_S_DESC_CATISC 213
|
||||
|
1683
at/at0100a.uml
Executable file
1683
at/at0100a.uml
Executable file
File diff suppressed because it is too large
Load Diff
512
at/at0200.cpp
Executable file
512
at/at0200.cpp
Executable file
@ -0,0 +1,512 @@
|
||||
#include <execp.h>
|
||||
#include <mask.h>
|
||||
#include <msksheet.h>
|
||||
#include <mailbox.h>
|
||||
#include <applicat.h>
|
||||
#include <relation.h>
|
||||
#include <tabutil.h>
|
||||
#include <urldefid.h>
|
||||
#include <validate.h>
|
||||
|
||||
#include "at0.h"
|
||||
#include "lf.h" // se non lo metto non riesco a usare gli LF
|
||||
|
||||
// nomi campi maschera
|
||||
#include "at0200a.h"
|
||||
|
||||
// nomi dei campi
|
||||
#include "soggetti.h"
|
||||
#include "donaz.h"
|
||||
#include "contsan.h"
|
||||
|
||||
#include "atlib1.cpp"
|
||||
|
||||
#define ALIAS_CTD 100
|
||||
|
||||
class TDonaz_app : public TApplication
|
||||
{
|
||||
TMask* _msk;
|
||||
TRelation* _rel;
|
||||
|
||||
TLocalisamfile* _soggetti;
|
||||
TLocalisamfile* _donaz;
|
||||
TLocalisamfile* _contsan;
|
||||
TRecord_array* _sdonazioni;
|
||||
TRecord_array* _scontrolli;
|
||||
TAssoc_array* _asoggetti; // array dei soggetti inseriti per controllare doppio ins.
|
||||
|
||||
|
||||
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 TAssoc_array& get_array_sogg() { return *_asoggetti; }
|
||||
virtual int write(TSheet_field& s);
|
||||
|
||||
static bool check_sog_sheet(const char* codsog);
|
||||
//static bool codice_handler(TMask_field& f, KEY k);
|
||||
static bool nome_handler(TMask_field& f, KEY k);
|
||||
static bool soggetti_notify(TSheet_field& s, int r, KEY k);
|
||||
static void add_rows_soggetti(TSheet_field& s, int count = 10, int start = 1);
|
||||
static bool ins_controlli_handler(TMask_field& f, KEY k);
|
||||
|
||||
public:
|
||||
TDonaz_app() {}
|
||||
|
||||
};
|
||||
|
||||
HIDDEN inline TDonaz_app& app() { return (TDonaz_app&) main_app(); }
|
||||
|
||||
bool TDonaz_app::ins_controlli_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
if (k == K_SPACE)
|
||||
{
|
||||
TMask& m = f.mask();
|
||||
TSheet_field& s = (TSheet_field&)m.field(F_SOGGETTI);
|
||||
const bool ins_controlli = m.get_bool(F_INS_CONTROLLI);
|
||||
s.enable_column(3,ins_controlli);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
void TDonaz_app::add_rows_soggetti(TSheet_field& s, int count, int start)
|
||||
{
|
||||
if (start == 1)
|
||||
s.destroy();
|
||||
for (int r=start; r<=start+count; r++)
|
||||
TToken_string& row = s.row(r-1);
|
||||
}
|
||||
|
||||
bool TDonaz_app::create()
|
||||
{
|
||||
_msk = new TMask("at0200a");
|
||||
_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 TDonaz_app::destroy()
|
||||
{
|
||||
delete _rel;
|
||||
delete _msk;
|
||||
delete _donaz;
|
||||
delete _contsan;
|
||||
delete _sdonazioni;
|
||||
delete _scontrolli;
|
||||
delete _asoggetti;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TDonaz_app::menu(MENU_TAG m)
|
||||
{
|
||||
TMask& msk = get_mask();
|
||||
const TDate oggi(TODAY);
|
||||
KEY tasto;
|
||||
do
|
||||
{
|
||||
TSheet_field& s = (TSheet_field&)msk.field(F_SOGGETTI);
|
||||
add_rows_soggetti(s,12);
|
||||
_asoggetti->destroy();
|
||||
msk.set(F_DATADON,oggi);
|
||||
tasto = msk.run();
|
||||
switch (tasto)
|
||||
{
|
||||
case K_ESC: // annulla
|
||||
msk.reset();
|
||||
break;
|
||||
case K_SAVE: // registra
|
||||
{
|
||||
TDonaz_app::write(s);
|
||||
msk.reset();
|
||||
}
|
||||
break;
|
||||
case K_INS: // nuovo
|
||||
{
|
||||
TDonaz_app::write(s);
|
||||
msk.reset();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (tasto != K_QUIT);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int TDonaz_app::write(TSheet_field& s)
|
||||
{
|
||||
|
||||
const TMask& m = s.mask();
|
||||
const TDate data = m.get(F_DATADON);
|
||||
for (int r=1; r<=s.items(); r++)
|
||||
{
|
||||
TToken_string& row = s.row(r-1);
|
||||
const long codsog = row.get_long(0);
|
||||
if (codsog != 0)
|
||||
{
|
||||
TLocalisamfile& sog = get_relation()->lfile();
|
||||
sog.zero();
|
||||
sog.put(SOG_CODICE, codsog);
|
||||
int err = sog.read();
|
||||
if (err == NOERR)
|
||||
{
|
||||
TString tipocon = row.get(3);
|
||||
if (!tipocon.blank())
|
||||
{
|
||||
TRectype* recc = new TRectype(LF_CONTSAN);
|
||||
recc->put(CON_CODICE, row.get(0));
|
||||
recc->put(CON_DATACON, m.get(F_DATADON));
|
||||
recc->put(CON_TIPOCON, row.get(3));
|
||||
bool insert = FALSE;
|
||||
bool exist = FALSE;
|
||||
TRectype* keyc = new TRectype(LF_CONTSAN);
|
||||
keyc->put(CON_CODICE, row.get(0));
|
||||
int err = _scontrolli->read(keyc);
|
||||
if (err == NOERR)
|
||||
{
|
||||
int r=_scontrolli->rows();
|
||||
while (r>=1 && !insert && !exist)
|
||||
{
|
||||
const TRectype& riga = _scontrolli->row(r);
|
||||
const TDate d = riga.get(CON_DATACON);
|
||||
if (data==d) // esiste già un controllo in questa data
|
||||
{
|
||||
exist=TRUE;
|
||||
r=0;
|
||||
}
|
||||
else
|
||||
if (data > d)
|
||||
{
|
||||
recc->put(CON_PROGCON,r+1);
|
||||
_scontrolli->insert_row(recc);
|
||||
insert=TRUE;
|
||||
}
|
||||
r--;
|
||||
}
|
||||
if (!exist && !insert)
|
||||
{
|
||||
recc->put(CON_PROGCON,1);
|
||||
_scontrolli->insert_row(recc);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (err == _iseof || err == _isemptyfile)
|
||||
{
|
||||
recc->put(CON_PROGCON,1);
|
||||
_scontrolli->insert_row(recc);
|
||||
}
|
||||
if (!exist)
|
||||
_scontrolli->write(TRUE);
|
||||
}
|
||||
|
||||
TRectype* rec = new TRectype(LF_DONAZ);
|
||||
rec->put(DON_CODICE, row.get(0));
|
||||
rec->put(DON_DATADON, m.get(F_DATADON));
|
||||
rec->put(DON_TIPODON, m.get(F_TIPODON));
|
||||
rec->put(DON_LUOGODON, m.get(F_LUOGODON));
|
||||
|
||||
bool insert = FALSE;
|
||||
bool exist = FALSE;
|
||||
|
||||
TRectype* key = new TRectype(LF_DONAZ);
|
||||
key->put(DON_CODICE, row.get(0));
|
||||
//int err = _sdonazioni->read(key);
|
||||
err = _sdonazioni->read(key);
|
||||
if (err == NOERR)
|
||||
{
|
||||
int r=_sdonazioni->rows();
|
||||
while (r>=1 && !insert && !exist)
|
||||
{
|
||||
const TRectype& riga = _sdonazioni->row(r);
|
||||
const TDate d = riga.get(DON_DATADON);
|
||||
if (data==d) // esiste già una donazione in questa data
|
||||
{
|
||||
exist=TRUE;
|
||||
r=0;
|
||||
}
|
||||
else
|
||||
if (data > d)
|
||||
{
|
||||
rec->put(DON_PROGDON,r+1);
|
||||
_sdonazioni->insert_row(rec);
|
||||
insert=TRUE;
|
||||
}
|
||||
r--;
|
||||
}
|
||||
if (!exist && !insert)
|
||||
{
|
||||
rec->put(DON_PROGDON,1);
|
||||
_sdonazioni->insert_row(rec);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (err == _iseof || err == _isemptyfile)
|
||||
{
|
||||
rec->put(DON_PROGDON,1);
|
||||
_sdonazioni->insert_row(rec);
|
||||
}
|
||||
if (!exist)
|
||||
{
|
||||
_sdonazioni->write(TRUE);
|
||||
|
||||
|
||||
TDate dataultdon = sog.get_date(SOG_DATAULTDON);
|
||||
const TString tipo = m.get(F_TIPODON);
|
||||
int totdon = sog.get_int(SOG_TOTDON);
|
||||
sog.put(SOG_TOTDON,totdon+1);
|
||||
if (data > dataultdon)
|
||||
{
|
||||
sog.put(SOG_DATAULTDON,data);
|
||||
sog.put(SOG_TIPOULTDON,tipo);
|
||||
}
|
||||
if (xis_donaz(tipo,XIDON_SI))
|
||||
{
|
||||
totdon = sog.get_int(SOG_TOTDONSI);
|
||||
sog.put(SOG_TOTDONSI,totdon+1);
|
||||
dataultdon = sog.get_date(SOG_DATAULTSI);
|
||||
if (data>dataultdon)
|
||||
sog.put(SOG_DATAULTSI,data);
|
||||
}
|
||||
if (xis_donaz(tipo,XIDON_AF))
|
||||
{
|
||||
totdon = sog.get_int(SOG_TOTDONAF);
|
||||
sog.put(SOG_TOTDONAF,totdon+1);
|
||||
dataultdon = sog.get_date(SOG_DATAULTAF);
|
||||
if (data>dataultdon)
|
||||
sog.put(SOG_DATAULTAF,data);
|
||||
}
|
||||
char modstato = ' ';
|
||||
const TString stato = sog.get(SOG_STATO); // stato attuale
|
||||
const TString id1 = sog.get(SOG_IDON1); // idon. 1
|
||||
const TString id2 = sog.get(SOG_IDON2); // idon. 2
|
||||
const TString id3 = sog.get(SOG_IDON3); // idon. 3
|
||||
const TString id4 = sog.get(SOG_IDON4); // idon. 4
|
||||
const int intsi = sog.get_int(SOG_INTSI); // intervallo per SI
|
||||
const int intaf = sog.get_int(SOG_INTAF); // intervallo per AF
|
||||
dataultdon = sog.get_date(SOG_DATAULTDON); // data ultima donazione
|
||||
const TString tipoultdon(sog.get(SOG_TIPOULTDON)); // tipo ultima donazione
|
||||
TDate datasi(NULLDATE); // data prossima si calcolata
|
||||
TDate dataaf(NULLDATE); // data prossima af calcolata
|
||||
TDate dataultsi(NULLDATE); // data ultima donazione si
|
||||
|
||||
bool id_si = FALSE; // il soggetto è idoneo per si?
|
||||
bool id_af = FALSE; // il soggetto è idoneo per af?
|
||||
|
||||
modstato = xmodstato_tcs(stato);
|
||||
if (modstato == 'I' || modstato == 'F') // il soggetto è idoneo
|
||||
{
|
||||
id_si = (xis_idon(id1,id2,id3,id4,XIDON_SI) && intsi != 0); // il soggetto è idoneo SI
|
||||
id_af = (xis_idon(id1,id2,id3,id4,XIDON_AF) && intaf != 0); // il soggetto è idoneo AF
|
||||
|
||||
if (dataultdon.ok()) // se ha fatto almeno una donazione
|
||||
{
|
||||
if (xis_donaz(tipoultdon,XIDON_SI)) // se l'ultima donazione è una SI
|
||||
{
|
||||
if (id_si)
|
||||
{
|
||||
datasi=dataultdon;
|
||||
datasi+=intsi;
|
||||
}
|
||||
if (id_af)
|
||||
{
|
||||
dataaf=dataultdon;
|
||||
dataaf+=intaf;
|
||||
}
|
||||
}
|
||||
if (xis_donaz(tipoultdon,XIDON_AF)) // se l'ultima donazione è una AF
|
||||
{
|
||||
dataultsi = sog.get_date(SOG_DATAULTSI);
|
||||
// cerco l'ultima donazione SI
|
||||
/*
|
||||
for (int r=s.items(); r>0; r--)
|
||||
{
|
||||
TToken_string& row = s.row(r-1);
|
||||
const TString tipo = row.get(1);
|
||||
if (is_donaz(tipo,IDON_SI) && !dataultsi.ok())
|
||||
dataultsi = TDate(row.get(0));
|
||||
}
|
||||
*/
|
||||
if (id_si)
|
||||
{
|
||||
if (intaf != 0)
|
||||
{
|
||||
datasi=dataultdon;
|
||||
datasi+=intaf;
|
||||
}
|
||||
else
|
||||
{
|
||||
datasi=dataultdon;
|
||||
datasi+=intsi;
|
||||
}
|
||||
if (dataultsi.ok())
|
||||
dataultsi+=intsi;
|
||||
if (dataultsi > datasi)
|
||||
datasi = dataultsi;
|
||||
}
|
||||
if (id_af)
|
||||
{
|
||||
dataaf=dataultdon;
|
||||
dataaf+=intaf;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (id_si)
|
||||
datasi=sog.get_date(SOG_DATAULTID);
|
||||
if (id_af)
|
||||
dataaf=sog.get_date(SOG_DATAULTID);
|
||||
}
|
||||
}
|
||||
sog.put(SOG_DATAPROSSI,datasi);
|
||||
sog.put(SOG_DATAPROSAF,dataaf);
|
||||
|
||||
// controllo la sua categoria
|
||||
|
||||
TTable ctd("CTD");
|
||||
TString catdon = sog.get(SOG_CATDON);
|
||||
ctd.put("CODTAB",catdon);
|
||||
if (ctd.read() == NOERR)
|
||||
{
|
||||
bool dimissione = ctd.get_bool("B0");
|
||||
if (dimissione)
|
||||
sog.put(SOG_CATDON,ctd.get("S6"));
|
||||
}
|
||||
|
||||
// controllo se è idoneo
|
||||
|
||||
sog.rewrite();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return NOERR;
|
||||
}
|
||||
|
||||
bool TDonaz_app::check_sog_sheet(const char* codsog)
|
||||
{
|
||||
TAssoc_array& array_sogg = app().get_array_sogg();
|
||||
if (array_sogg.is_key(codsog))
|
||||
return FALSE;
|
||||
else
|
||||
{
|
||||
array_sogg.add(codsog);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
bool TDonaz_app::soggetti_notify(TSheet_field& s, int r, KEY k)
|
||||
{
|
||||
bool ok = TRUE;
|
||||
switch (k)
|
||||
{
|
||||
case K_TAB:
|
||||
// entrata riga
|
||||
{
|
||||
TToken_string& row = s.row(r);
|
||||
const char* codsog = row.get(0);
|
||||
if (codsog != NULL)
|
||||
{
|
||||
TAssoc_array& array_sogg = app().get_array_sogg();
|
||||
if (array_sogg.is_key(codsog))
|
||||
array_sogg.remove(codsog);
|
||||
}
|
||||
if ((r == s.items()-1) && (r == s.first_empty()))
|
||||
{
|
||||
add_rows_soggetti(s,10,r+1);
|
||||
s.select(r);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case K_CTRL+K_TAB:
|
||||
// uscita riga
|
||||
{
|
||||
TToken_string& row = s.row(r);
|
||||
const char* codice = row.get(0);
|
||||
if (codice != NULL)
|
||||
{
|
||||
ok = check_sog_sheet(codice);
|
||||
if (!ok)
|
||||
return s.error_box("Soggetto già inserito");
|
||||
else
|
||||
// controllare che sia idoneo a quel tipo di donazione
|
||||
// il controllo sull'esistenza della donazione viene fatto
|
||||
// al momento della registrazione (write)
|
||||
{
|
||||
const long codsog = row.get_long(0);
|
||||
|
||||
//TLocalisamfile& sog = get_relation()->lfile();
|
||||
//sog.zero();
|
||||
//sog.put(SOG_CODICE, codsog);
|
||||
//int err = sog.read();
|
||||
//if (err == NOERR)
|
||||
//{
|
||||
//}
|
||||
}
|
||||
}
|
||||
if ((r == s.items()-1) && (r == s.first_empty()))
|
||||
{
|
||||
add_rows_soggetti(s,10,r+1);
|
||||
s.select(r);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
/*
|
||||
bool TDonaz_app::codice_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
bool ok = TRUE;
|
||||
if (k == K_TAB && f.focusdirty() && f.get().not_empty())
|
||||
{
|
||||
const TMask& m = f.mask();
|
||||
const char* codsog = m.get(F_S_CODICE);
|
||||
ok = check_sog_sheet(codsog); // controllo che il sog. non sia già inserito
|
||||
if (!ok)
|
||||
f.error_box("Soggetto già inserito");
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
*/
|
||||
|
||||
bool TDonaz_app::nome_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
bool ok = TRUE;
|
||||
if (k == K_TAB && f.focusdirty())
|
||||
{
|
||||
TMask& m = f.mask();
|
||||
long codsog = m.get_long(F_S_CODICE);
|
||||
if (codsog == 0)
|
||||
m.send_key(K_F9,F_S_NOME);
|
||||
}
|
||||
//f.message_box("sono in nome_handler");
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
int at0200(int argc, char* argv[])
|
||||
{
|
||||
TDonaz_app a;
|
||||
a.run(argc, argv, "Giornaliero donazioni/controlli");
|
||||
return 0;
|
||||
}
|
27
at/at0200a.h
Executable file
27
at/at0200a.h
Executable file
@ -0,0 +1,27 @@
|
||||
// definizione campi della maschera at0200a.msk
|
||||
// INSERIMENTO VELOCE DONAZIONI
|
||||
|
||||
// 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
|
||||
// spreadsheet
|
||||
#define F_SOGGETTI 107
|
||||
|
||||
// pagina soggetti
|
||||
#define F_S_CODICE 101
|
||||
#define F_S_COGNOME 102
|
||||
#define F_S_NOME 103
|
||||
#define F_S_TIPOCON 104
|
||||
#define F_S_DATANASC 105
|
||||
#define F_S_CODSEZ 106
|
||||
#define F_S_CODSOT 107
|
||||
#define F_S_CATDON 108
|
||||
#define F_S_TESSERA 109
|
||||
#define F_S_DENSEZ 201
|
||||
#define F_S_DENSOT 202
|
||||
#define F_S_DESC_TIPOCON 203
|
||||
#define F_S_DESC_CATDON 204
|
258
at/at0200a.uml
Executable file
258
at/at0200a.uml
Executable file
@ -0,0 +1,258 @@
|
||||
#include "at0200a.h"
|
||||
#include "lf.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
#include <toolbar.h>
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Giornaliero donazioni/controlli" -1 -1 78 20
|
||||
|
||||
|
||||
GROUPBOX DLG_NULL 77 6
|
||||
BEGIN
|
||||
PROMPT 1 0 "Dati fissi"
|
||||
FLAGS "R"
|
||||
END
|
||||
|
||||
DATE F_DATADON
|
||||
BEGIN
|
||||
PROMPT 2 1 "Data donazione "
|
||||
//VALIDATE NOT_EMPTY_FUNC
|
||||
CHECKTYPE REQUIRED
|
||||
HELP "Data donazione"
|
||||
END
|
||||
|
||||
STRING F_TIPODON 2
|
||||
BEGIN
|
||||
PROMPT 2 2 "Tipo donazione "
|
||||
FLAGS "U"
|
||||
USE TDN
|
||||
INPUT CODTAB F_TIPODON
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@30" S0
|
||||
OUTPUT F_TIPODON CODTAB
|
||||
OUTPUT F_DESC_TIPODON S0
|
||||
//VALIDATE NOT_EMPTY_FUNC
|
||||
CHECKTYPE REQUIRED
|
||||
WARNING "Codice non presente"
|
||||
HELP "Tipo donazione"
|
||||
END
|
||||
|
||||
STRING F_LUOGODON 4
|
||||
BEGIN
|
||||
PROMPT 2 3 "Luogo donazione "
|
||||
FLAGS "U"
|
||||
USE LDN
|
||||
INPUT CODTAB F_LUOGODON
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@30" S0
|
||||
OUTPUT F_LUOGODON CODTAB
|
||||
OUTPUT F_DESC_LUOGODON S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice non presente"
|
||||
HELP "Luogo donazione"
|
||||
END
|
||||
|
||||
STRING F_DESC_TIPODON 25
|
||||
BEGIN
|
||||
PROMPT 30 2 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_DESC_LUOGODON 25
|
||||
BEGIN
|
||||
PROMPT 30 3 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
BOOLEAN F_INS_CONTROLLI
|
||||
BEGIN
|
||||
PROMPT 2 4 "Inserimento controlli"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 13
|
||||
BEGIN
|
||||
PROMPT 1 6 "Soggetti"
|
||||
END
|
||||
|
||||
SPREADSHEET F_SOGGETTI 75 11
|
||||
BEGIN
|
||||
PROMPT 2 7 ""
|
||||
ITEM "Codice@6"
|
||||
ITEM "Cognome@25"
|
||||
ITEM "Nome@25"
|
||||
ITEM "Con."
|
||||
ITEM "Nato il@10"
|
||||
ITEM "Sez."
|
||||
ITEM "Sot."
|
||||
ITEM "Cat."
|
||||
ITEM "Tessera"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
|
||||
PAGE "Soggetto " -1 -1 78 20
|
||||
|
||||
NUMBER F_S_CODICE 6
|
||||
BEGIN
|
||||
PROMPT 2 1 "Codice "
|
||||
FIELD LF_SOGGETTI->CODICE
|
||||
FLAGS "RG"
|
||||
USE LF_SOGGETTI KEY 1
|
||||
INPUT CODICE F_S_CODICE
|
||||
DISPLAY "Codice@6" CODICE
|
||||
DISPLAY "Cognome@25" COGNOME
|
||||
DISPLAY "Nome@25" NOME
|
||||
DISPLAY "Nato il@10" DATANASC
|
||||
DISPLAY "Sez." CODSEZ
|
||||
DISPLAY "Sot." CODSOT
|
||||
DISPLAY "C." CATDON
|
||||
DISPLAY "Tessera" TESSAVIS
|
||||
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
|
||||
CHECKTYPE NORMAL
|
||||
ADD RUN at0 -0
|
||||
END
|
||||
|
||||
STRING F_S_COGNOME 25
|
||||
BEGIN
|
||||
PROMPT 2 2 "Cognome e nome "
|
||||
FIELD LF_SOGGETTI->COGNOME
|
||||
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
|
||||
DISPLAY "Codice@6" CODICE
|
||||
DISPLAY "Sez." CODSEZ
|
||||
DISPLAY "Sot." CODSOT
|
||||
DISPLAY "C." CATDON
|
||||
DISPLAY "Tessera" TESSAVIS
|
||||
COPY OUTPUT F_S_CODICE
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Cognome del soggetto"
|
||||
ADD RUN at0 -0
|
||||
END
|
||||
|
||||
STRING F_S_NOME 25
|
||||
BEGIN
|
||||
PROMPT 46 2 ""
|
||||
FIELD LF_SOGGETTI->NOME
|
||||
COPY ALL F_S_COGNOME
|
||||
COPY OUTPUT F_S_CODICE
|
||||
//CHECKTYPE NORMAL
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Nome del soggetto"
|
||||
ADD RUN at0 -0
|
||||
END
|
||||
|
||||
STRING F_S_TIPOCON 2
|
||||
BEGIN
|
||||
PROMPT 2 5 "Tipo controllo "
|
||||
FLAGS "U"
|
||||
USE TCS SELECT S6=="N"
|
||||
INPUT CODTAB F_S_TIPOCON
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@30" S0
|
||||
OUTPUT F_S_TIPOCON CODTAB
|
||||
OUTPUT F_S_DESC_TIPOCON S0
|
||||
WARNING "Codice non presente"
|
||||
HELP "Tipo/Esito controllo sanitario"
|
||||
END
|
||||
|
||||
DATE F_S_DATANASC
|
||||
BEGIN
|
||||
PROMPT 2 3 "Nato il "
|
||||
FIELD LF_SOGGETTI->DATANASC
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_CODSEZ 2
|
||||
BEGIN
|
||||
PROMPT 2 7 "Sez. "
|
||||
FIELD LF_SOGGETTI->CODSEZ
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_DENSEZ 25
|
||||
BEGIN
|
||||
PROMPT 13 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_CODSOT 2
|
||||
BEGIN
|
||||
PROMPT 43 7 "Sot. "
|
||||
FIELD LF_SOGGETTI->CODSOT
|
||||
FLAGS "D"
|
||||
USE LF_SEZIONI
|
||||
INPUT CODSEZ F_S_CODSEZ
|
||||
INPUT CODSOT F_S_CODSOT
|
||||
OUTPUT F_S_DENSEZ DENSEZ
|
||||
OUTPUT F_S_DENSOT DENSOT
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
STRING F_S_DENSOT 25
|
||||
BEGIN
|
||||
PROMPT 54 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_CATDON 2
|
||||
BEGIN
|
||||
PROMPT 2 8 "Cat. "
|
||||
FIELD LF_SOGGETTI->CATDON
|
||||
FLAGS "D"
|
||||
USE CTD
|
||||
INPUT CODTAB F_S_CATDON
|
||||
OUTPUT F_S_DESC_CATDON S0
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
STRING F_S_TESSERA 10
|
||||
BEGIN
|
||||
PROMPT 43 8 "Tessera AVIS "
|
||||
FIELD LF_SOGGETTI->TESSAVIS
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_DESC_TIPOCON 25
|
||||
BEGIN
|
||||
PROMPT 35 5 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_DESC_CATDON 22
|
||||
BEGIN
|
||||
PROMPT 13 8 ""
|
||||
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
|
207
at/at0300.cpp
Executable file
207
at/at0300.cpp
Executable file
@ -0,0 +1,207 @@
|
||||
#include <mask.h>
|
||||
#include <form.h>
|
||||
#include <printapp.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "at0.h"
|
||||
#include "lf.h" // se non lo metto non riesco a usare gli LF
|
||||
|
||||
// nomi campi maschera
|
||||
#include "at0300a.h"
|
||||
|
||||
// nomi dei campi
|
||||
#include "soggetti.h"
|
||||
#include "donaz.h"
|
||||
#include "contsan.h"
|
||||
#include "benem.h"
|
||||
#include "storico.h"
|
||||
#include "sezioni.h"
|
||||
|
||||
class TChiusura_app : public TPrintapp
|
||||
{
|
||||
static bool filter_func_chiusura(const TRelation *);
|
||||
|
||||
TMask* _msk;
|
||||
TRelation* _rel;
|
||||
|
||||
int _cur;
|
||||
TDate _data_chiusura;
|
||||
TParagraph_string _operazione;
|
||||
|
||||
|
||||
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);
|
||||
|
||||
virtual TMask& get_mask() { return *_msk; }
|
||||
|
||||
public:
|
||||
void filtra_sezioni();
|
||||
void crea_intestazione();
|
||||
TChiusura_app() : _data_chiusura(TODAY), _operazione("",30) {}
|
||||
};
|
||||
|
||||
HIDDEN inline TChiusura_app& app() { return (TChiusura_app&) main_app(); }
|
||||
|
||||
void TChiusura_app::filtra_sezioni()
|
||||
{
|
||||
TString sezini = _msk->get(F_SEZINI);
|
||||
TString sotini = _msk->get(F_SOTINI);
|
||||
TString sezfin = _msk->get(F_SEZFIN);
|
||||
TString sotfin = _msk->get(F_SOTFIN);
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
|
||||
TRectype da(fl.curr());
|
||||
TRectype a(fl.curr());
|
||||
da.zero();
|
||||
a.zero();
|
||||
if ((sezini.not_empty()) && (sezini.ok()))
|
||||
da.put(SOG_CODSEZ, sezini);
|
||||
if ((sotini.not_empty()) && (sotini.ok()))
|
||||
da.put(SOG_CODSOT, sotini);
|
||||
if ((sezfin.not_empty()) && (sezfin.ok()))
|
||||
a.put(SOG_CODSEZ, sezfin);
|
||||
if ((sotfin.not_empty()) && (sotfin.ok()))
|
||||
a.put(SOG_CODSOT, sotfin);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
bool TChiusura_app::preprocess_page(int file, int counter)
|
||||
{
|
||||
_operazione = "Nulla";
|
||||
TString cat_estinti = current_cursor()->curr(LF_SEZIONI).get(SEZ_CATESTI);
|
||||
TString cat_cancellati = current_cursor()->curr(LF_SEZIONI).get(SEZ_CATCANC);
|
||||
int intesti = current_cursor()->curr(LF_SEZIONI).get_int(SEZ_INTESTI);
|
||||
int donemer = current_cursor()->curr(LF_SEZIONI).get_int(SEZ_DONEMER);
|
||||
|
||||
TString catsog = current_cursor()->curr().get(SOG_CATDON);
|
||||
if ((catsog==cat_estinti) || (catsog==cat_cancellati))
|
||||
{
|
||||
int totdon = current_cursor()->curr().get_int(SOG_TOTDON);
|
||||
if (totdon >= donemer)
|
||||
_operazione = "Passaggio a emeriti";
|
||||
else
|
||||
_operazione = "Cancellato";
|
||||
}
|
||||
else
|
||||
{
|
||||
TDate dataultdon = current_cursor()->curr().get(SOG_DATAULTDON);
|
||||
if (dataultdon.ok())
|
||||
{
|
||||
dataultdon.addyear(intesti);
|
||||
TMask& msk = app().get_mask();
|
||||
//TDate data_chiusura = msk.get(F_DATA);
|
||||
if (dataultdon < _data_chiusura)
|
||||
_operazione = "Passaggio a estinti";
|
||||
else
|
||||
_operazione = "Non doveva essere filtrato: data ancora valida";
|
||||
}
|
||||
else
|
||||
_operazione = "Non doveva essere filtrato: data vuota";
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void TChiusura_app::set_page(int file, int cnt)
|
||||
{
|
||||
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"######"));
|
||||
set_row(1,"@7g@S", FLD(LF_SOGGETTI,SOG_CATDON));
|
||||
set_row(1,"@10g@S", FLD(LF_SOGGETTI,SOG_COGNOME));
|
||||
set_row(1,"@36g@S", FLD(LF_SOGGETTI,SOG_NOME));
|
||||
set_row(1,"@63g#a", &_operazione);
|
||||
}
|
||||
|
||||
bool TChiusura_app::filter_func_chiusura(const TRelation * rel)
|
||||
{
|
||||
bool filtrato = FALSE;
|
||||
|
||||
TString cat_estinti = rel->lfile(LF_SEZIONI).curr().get(SEZ_CATESTI);
|
||||
TString cat_cancellati = rel->lfile(LF_SEZIONI).curr().get(SEZ_CATCANC);
|
||||
int intesti = rel->lfile(LF_SEZIONI).curr().get_int(SEZ_INTESTI);
|
||||
|
||||
TString catsog = rel->lfile().curr().get(SOG_CATDON);
|
||||
if ((catsog==cat_estinti) || (catsog==cat_cancellati))
|
||||
filtrato = TRUE;
|
||||
if (!filtrato)
|
||||
{
|
||||
TDate dataultdon = rel->lfile().curr().get(SOG_DATAULTDON);
|
||||
if (dataultdon.ok())
|
||||
{
|
||||
dataultdon.addyear(intesti);
|
||||
TMask& msk = app().get_mask();
|
||||
TDate data_chiusura = msk.get(F_DATA);
|
||||
if (dataultdon < data_chiusura)
|
||||
filtrato = TRUE;
|
||||
}
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TChiusura_app::set_print(int)
|
||||
{
|
||||
KEY tasto;
|
||||
tasto = _msk->run();
|
||||
if (tasto == K_ENTER)
|
||||
{
|
||||
_data_chiusura = _msk->get(F_DATA);
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
filtra_sezioni();
|
||||
current_cursor()->set_filterfunction(filter_func_chiusura,TRUE);
|
||||
reset_print();
|
||||
crea_intestazione();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
void TChiusura_app::crea_intestazione()
|
||||
{
|
||||
reset_header();
|
||||
|
||||
TString sep(132);
|
||||
TString data_stampa;
|
||||
|
||||
sep.fill('-');
|
||||
set_header(1, (const char *) sep);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
sep.right_just(132);
|
||||
set_header(2,(const char*) sep);
|
||||
|
||||
set_header(2,"@0gCHIUSURA ANNUALE ALLA DATA");
|
||||
data_stampa = _data_chiusura.string();
|
||||
set_header(2,"@30g%10s", (const char*) data_stampa);
|
||||
|
||||
sep = "";
|
||||
sep.fill('-');
|
||||
set_header(3, (const char *) sep);
|
||||
}
|
||||
|
||||
bool TChiusura_app::user_create()
|
||||
{
|
||||
_msk = new TMask("at0300a");
|
||||
_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
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TChiusura_app::user_destroy()
|
||||
{
|
||||
delete _rel;
|
||||
delete _msk;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at0300(int argc, char* argv[])
|
||||
{
|
||||
TChiusura_app a;
|
||||
a.run(argc, argv, "Chiusura annuale");
|
||||
return 0;
|
||||
}
|
12
at/at0300a.h
Executable file
12
at/at0300a.h
Executable file
@ -0,0 +1,12 @@
|
||||
// chiusura annuale
|
||||
// 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_DATA 109
|
138
at/at0300a.uml
Executable file
138
at/at0300a.uml
Executable file
@ -0,0 +1,138 @@
|
||||
#include "at0300a.h"
|
||||
#include "lf.h"
|
||||
PAGE "Chiusura annuale" -1 -1 78 20
|
||||
|
||||
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
|
||||
|
||||
DATE F_DATA
|
||||
BEGIN
|
||||
PROMPT 2 5 "Data chiusura "
|
||||
CHECKTYPE REQUIRED
|
||||
HELP "Data di riferimento per i conteggi di chiusura"
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
BEGIN
|
||||
PROMPT -12 14 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -22 14 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
40
at/at0700.h
Executable file
40
at/at0700.h
Executable file
@ -0,0 +1,40 @@
|
||||
// definizione campi della maschera at0700a.msk
|
||||
|
||||
#define F_CODSEZ 101
|
||||
#define F_CODSOT 102
|
||||
#define F_DENSEZ 103
|
||||
#define F_DENSOT 104
|
||||
#define F_INDIRIZZO 105
|
||||
#define F_COM 106
|
||||
#define F_DENCOM 107
|
||||
#define F_LOCALITA 108
|
||||
#define F_DENLOC 109
|
||||
#define F_CAPCOM 110
|
||||
#define F_PROVCOM 111
|
||||
#define F_TELEFONO 112
|
||||
#define F_FAX 113
|
||||
#define F_REFERCED 114
|
||||
#define F_STATO 115
|
||||
#define F_INTMINCONV 116
|
||||
#define F_INTMIN 117
|
||||
#define F_INTMAX 118
|
||||
#define F_TIPOCONV 119
|
||||
#define F_DATAULTCON 120
|
||||
#define F_INTESTAZ1 121
|
||||
#define F_INTESTAZ2 122
|
||||
#define F_INTESTAZ3 123
|
||||
#define F_INTESTAZ4 124
|
||||
#define F_CONVORA 125
|
||||
#define F_CONVSEDE1 126
|
||||
#define F_CONVSEDE2 127
|
||||
#define F_CONVSEDE3 128
|
||||
#define F_CONVSEDE4 129
|
||||
#define F_CONVNOTE 130
|
||||
#define F_DONEMER 131
|
||||
#define F_INTESTI 132
|
||||
#define F_CATEMER 133
|
||||
#define F_DESC_CATEMER 134
|
||||
#define F_CATESTI 135
|
||||
#define F_DESC_CATESTI 136
|
||||
#define F_CATCANC 137
|
||||
#define F_DESC_CATCANC 138
|
430
at/at0700a.uml
Executable file
430
at/at0700a.uml
Executable file
@ -0,0 +1,430 @@
|
||||
#include "at0700.h"
|
||||
#include "lf.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
#include <toolbar.h>
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Tabella Sezioni 1/2" -1 -1 78 20
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
PROMPT 1 0 ""
|
||||
FLAGS "R"
|
||||
END
|
||||
|
||||
STRING F_CODSEZ 2
|
||||
BEGIN
|
||||
PROMPT 2 1 "Cod. sezione "
|
||||
FIELD CODSEZ
|
||||
FLAGS "U"
|
||||
KEY 1
|
||||
USE LF_SEZIONI
|
||||
INPUT CODSEZ F_CODSEZ
|
||||
DISPLAY "Cod.sez. " CODSEZ
|
||||
DISPLAY "Cod.sot. " CODSOT
|
||||
DISPLAY "Sezione@25" DENSEZ
|
||||
DISPLAY "Sottogruppo@25" DENSOT
|
||||
OUTPUT F_CODSEZ CODSEZ
|
||||
OUTPUT F_DENSEZ DENSEZ
|
||||
OUTPUT F_CODSOT CODSOT
|
||||
OUTPUT F_DENSOT DENSOT
|
||||
MESSAGE COPY,1@
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
STRING F_CODSOT 2
|
||||
BEGIN
|
||||
PROMPT 2 2 "Cod. sottogruppo "
|
||||
FIELD CODSOT
|
||||
FLAGS "U"
|
||||
KEY 1
|
||||
USE LF_SEZIONI
|
||||
INPUT CODSEZ F_CODSEZ
|
||||
INPUT CODSOT F_CODSOT
|
||||
DISPLAY "Cod.sez. " CODSEZ
|
||||
DISPLAY "Cod.sot. " CODSOT
|
||||
DISPLAY "Sezione@25" DENSEZ
|
||||
DISPLAY "Sottogruppo@25" DENSOT
|
||||
OUTPUT F_CODSEZ CODSEZ
|
||||
OUTPUT F_DENSEZ DENSEZ
|
||||
OUTPUT F_CODSOT CODSOT
|
||||
OUTPUT F_DENSOT DENSOT
|
||||
MESSAGE COPY,2@
|
||||
CHECKTYPE REQUIRED
|
||||
WARNING "Inserire il codice della sezione"
|
||||
END
|
||||
|
||||
STRING F_DENSEZ 25
|
||||
BEGIN
|
||||
PROMPT 29 1 "Denominazione sez. "
|
||||
FIELD DENSEZ
|
||||
KEY 2
|
||||
USE LF_SEZIONI KEY 2
|
||||
INPUT DENSEZ F_DENSEZ
|
||||
DISPLAY "Sezione@25" DENSEZ
|
||||
DISPLAY "Sottogruppo@25" DENSOT
|
||||
DISPLAY "Cod.sez. " CODSEZ
|
||||
DISPLAY "Cod.sot. " CODSOT
|
||||
COPY OUTPUT F_CODSEZ
|
||||
MESSAGE COPY,3@
|
||||
CHECKTYPE REQUIRED
|
||||
WARNING "Inserire la denominazione della sezione"
|
||||
END
|
||||
|
||||
STRING F_DENSOT 25
|
||||
BEGIN
|
||||
PROMPT 29 2 "Denominazione sot. "
|
||||
FIELD DENSOT
|
||||
KEY 2
|
||||
COPY ALL F_DENSEZ
|
||||
MESSAGE COPY,4@
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Inserire la denominazione del sottogruppo"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 7
|
||||
BEGIN
|
||||
PROMPT 1 4 "Dati anagrafici"
|
||||
END
|
||||
|
||||
STRING F_INDIRIZZO 50
|
||||
BEGIN
|
||||
PROMPT 2 5 "Indirizzo "
|
||||
FIELD INDIRIZZO
|
||||
END
|
||||
|
||||
STRING F_COM 4
|
||||
BEGIN
|
||||
PROMPT 2 6 "Comune "
|
||||
FIELD COM
|
||||
FLAGS "U"
|
||||
USE LF_COMUNI
|
||||
INPUT STATO ""
|
||||
INPUT COM F_COM
|
||||
#include <comdcod.h>
|
||||
OUTPUT F_COM COM
|
||||
OUTPUT F_DENCOM DENCOM
|
||||
OUTPUT F_PROVCOM PROVCOM
|
||||
OUTPUT F_CAPCOM CAPCOM
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Comune assente"
|
||||
END
|
||||
|
||||
STRING F_DENCOM 48
|
||||
BEGIN
|
||||
PROMPT 19 6 ""
|
||||
USE LF_COMUNI KEY 2
|
||||
INPUT DENCOM F_DENCOM
|
||||
#include <comdden.h>
|
||||
COPY OUTPUT F_COM
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
STRING F_LOCALITA 4
|
||||
BEGIN
|
||||
PROMPT 2 7 "Località "
|
||||
FIELD LOCALITA
|
||||
FLAGS "U"
|
||||
USE LCP SELECT S7=#F_COM
|
||||
INPUT CODTAB F_LOCALITA
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Località@30" S0
|
||||
DISPLAY "CAP@5" S6
|
||||
OUTPUT F_LOCALITA CODTAB
|
||||
OUTPUT F_DENLOC S0
|
||||
OUTPUT F_CAPCOM S6
|
||||
OUTPUT F_COM S7
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Codice localit… postale se diversa dal comune"
|
||||
END
|
||||
|
||||
STRING F_DENLOC 30
|
||||
BEGIN
|
||||
PROMPT 19 7 ""
|
||||
COPY USE F_LOCALITA
|
||||
INPUT S0 F_DENLOC
|
||||
DISPLAY "Località@30" S0
|
||||
DISPLAY "CAP@5" S6
|
||||
DISPLAY "Codice" CODTAB
|
||||
COPY OUTPUT F_LOCALITA
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Localit… postale se diversa dal comune"
|
||||
END
|
||||
|
||||
|
||||
STRING F_PROVCOM 5
|
||||
BEGIN
|
||||
PROMPT 71 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAPCOM 5
|
||||
BEGIN
|
||||
PROMPT 67 7 "CAP "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_TELEFONO 15
|
||||
BEGIN
|
||||
PROMPT 2 8 "Telefono "
|
||||
FIELD TELEFONO
|
||||
END
|
||||
|
||||
STRING F_FAX 15
|
||||
BEGIN
|
||||
PROMPT 32 8 "Fax "
|
||||
FIELD FAX
|
||||
END
|
||||
|
||||
STRING F_REFERCED 50
|
||||
BEGIN
|
||||
PROMPT 2 9 "Referente CED "
|
||||
FIELD REFERCED
|
||||
END
|
||||
|
||||
RADIOBUTTON F_STATO 13
|
||||
BEGIN
|
||||
PROMPT 1 11 "Stato"
|
||||
FIELD STATO
|
||||
ITEM "A|Attiva"
|
||||
ITEM "E|Estinta"
|
||||
END
|
||||
|
||||
|
||||
GROUPBOX DLG_NULL 35 7
|
||||
BEGIN
|
||||
PROMPT 16 11 "Parametri convocazione"
|
||||
END
|
||||
|
||||
NUMBER F_INTMINCONV 4
|
||||
BEGIN
|
||||
PROMPT 17 12 "Int. min. convoc. "
|
||||
FIELD INTMINCONV
|
||||
HELP "Intervallo minimo di convocazione in giorni (dall'ultima don.)"
|
||||
END
|
||||
|
||||
NUMBER F_INTMIN 4
|
||||
BEGIN
|
||||
PROMPT 17 13 "Int. avvisi: min. "
|
||||
FIELD INTMIN
|
||||
END
|
||||
|
||||
NUMBER F_INTMAX 4
|
||||
BEGIN
|
||||
PROMPT 17 14 " max. "
|
||||
FIELD INTMAX
|
||||
END
|
||||
|
||||
LISTBOX F_TIPOCONV 11
|
||||
BEGIN
|
||||
PROMPT 17 15 "Tipo convocazione "
|
||||
FIELD TIPOCONV
|
||||
ITEM "D|Data fissa"
|
||||
ITEM "G|dal Giorno"
|
||||
END
|
||||
|
||||
DATE F_DATAULTCON
|
||||
BEGIN
|
||||
PROMPT 17 16 "Data ultima conv. "
|
||||
FIELD DATAULTCON
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 25 6
|
||||
BEGIN
|
||||
PROMPT 53 11 "Intestazione tessere"
|
||||
END
|
||||
|
||||
STRING F_INTESTAZ1 20
|
||||
BEGIN
|
||||
PROMPT 55 12 ""
|
||||
FIELD INTESTAZ1
|
||||
END
|
||||
|
||||
STRING F_INTESTAZ2 20
|
||||
BEGIN
|
||||
PROMPT 55 13 ""
|
||||
FIELD INTESTAZ2
|
||||
END
|
||||
|
||||
STRING F_INTESTAZ3 20
|
||||
BEGIN
|
||||
PROMPT 55 14 ""
|
||||
FIELD INTESTAZ3
|
||||
END
|
||||
|
||||
STRING F_INTESTAZ4 20
|
||||
BEGIN
|
||||
PROMPT 55 15 ""
|
||||
FIELD INTESTAZ4
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Tabella Sezioni 2/2" -1 -1 78 20
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
PROMPT 1 0 ""
|
||||
FLAGS "R"
|
||||
END
|
||||
|
||||
STRING DLG_NULL 2
|
||||
BEGIN
|
||||
PROMPT 2 1 "Cod. sezione "
|
||||
FLAGS "D"
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
STRING DLG_NULL 2
|
||||
BEGIN
|
||||
PROMPT 2 2 "Cod. sottogruppo "
|
||||
FLAGS "D"
|
||||
GROUP 2
|
||||
END
|
||||
|
||||
STRING DLG_NULL 25
|
||||
BEGIN
|
||||
PROMPT 29 1 "Denominazione sez. "
|
||||
FLAGS "D"
|
||||
GROUP 3
|
||||
END
|
||||
|
||||
STRING DLG_NULL 25
|
||||
BEGIN
|
||||
PROMPT 29 2 "Denominazione sot. "
|
||||
FLAGS "D"
|
||||
GROUP 4
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 35 8
|
||||
BEGIN
|
||||
PROMPT 1 4 "Dati per stampa cartolina"
|
||||
END
|
||||
|
||||
STRING F_CONVORA 20
|
||||
BEGIN
|
||||
PROMPT 2 5 "Orario "
|
||||
FIELD CONVORA
|
||||
END
|
||||
|
||||
STRING F_CONVSEDE1 25
|
||||
BEGIN
|
||||
PROMPT 2 6 "Sede "
|
||||
FIELD CONVSEDE1
|
||||
END
|
||||
|
||||
STRING F_CONVSEDE2 25
|
||||
BEGIN
|
||||
PROMPT 2 7 " "
|
||||
FIELD CONVSEDE2
|
||||
END
|
||||
|
||||
STRING F_CONVSEDE3 25
|
||||
BEGIN
|
||||
PROMPT 2 8 " "
|
||||
FIELD CONVSEDE3
|
||||
END
|
||||
|
||||
STRING F_CONVSEDE4 25
|
||||
BEGIN
|
||||
PROMPT 2 9 " "
|
||||
FIELD CONVSEDE4
|
||||
END
|
||||
|
||||
STRING F_CONVNOTE 25
|
||||
BEGIN
|
||||
PROMPT 2 10 "Note "
|
||||
FIELD CONVNOTE
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 41 8
|
||||
BEGIN
|
||||
PROMPT 37 4 "Parametri per chiusura fine anno"
|
||||
END
|
||||
|
||||
NUMBER F_DONEMER 3
|
||||
BEGIN
|
||||
PROMPT 38 5 "Donazioni per passaggio a emeriti "
|
||||
FIELD DONEMER
|
||||
FLAGS "U"
|
||||
END
|
||||
|
||||
NUMBER F_INTESTI 2
|
||||
BEGIN
|
||||
PROMPT 38 6 "Intervallo di estinzione in anni "
|
||||
FIELD INTESTI
|
||||
FLAGS "U"
|
||||
END
|
||||
|
||||
TEXT DLG_NULL
|
||||
BEGIN
|
||||
PROMPT 38 7 "Categorie:"
|
||||
END
|
||||
|
||||
STRING F_CATEMER 2
|
||||
BEGIN
|
||||
PROMPT 39 8 "emeriti "
|
||||
FIELD CATEMER
|
||||
FLAGS "U"
|
||||
USE CTD
|
||||
INPUT CODTAB F_CATEMER
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@30" S0
|
||||
OUTPUT F_CATEMER CODTAB
|
||||
OUTPUT F_DESC_CATEMER S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice non presente"
|
||||
END
|
||||
|
||||
STRING F_DESC_CATEMER 20
|
||||
BEGIN
|
||||
PROMPT 56 8 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CATESTI 2
|
||||
BEGIN
|
||||
PROMPT 39 9 "estinti "
|
||||
FIELD CATESTI
|
||||
FLAGS "U"
|
||||
USE CTD
|
||||
INPUT CODTAB F_CATESTI
|
||||
COPY DISPLAY F_CATEMER
|
||||
OUTPUT F_CATESTI CODTAB
|
||||
OUTPUT F_DESC_CATESTI S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice non presente"
|
||||
END
|
||||
|
||||
STRING F_DESC_CATESTI 20
|
||||
BEGIN
|
||||
PROMPT 56 9 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CATCANC 2
|
||||
BEGIN
|
||||
PROMPT 39 10 "cancellati "
|
||||
FIELD CATCANC
|
||||
FLAGS "U"
|
||||
USE CTD
|
||||
INPUT CODTAB F_CATCANC
|
||||
COPY DISPLAY F_CATEMER
|
||||
OUTPUT F_CATCANC CODTAB
|
||||
OUTPUT F_DESC_CATCANC S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice non presente"
|
||||
END
|
||||
|
||||
STRING F_DESC_CATCANC 20
|
||||
BEGIN
|
||||
PROMPT 56 10 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
14
at/at0800.h
Executable file
14
at/at0800.h
Executable file
@ -0,0 +1,14 @@
|
||||
// definizione campi della maschera at0800a.msk
|
||||
|
||||
#define F_CODMED 101
|
||||
#define F_COGNOME 102
|
||||
#define F_NOME 103
|
||||
#define F_INDIRIZZO 104
|
||||
#define F_COM 105
|
||||
#define F_DENCOM 106
|
||||
#define F_LOCALITA 107
|
||||
#define F_DENLOC 108
|
||||
#define F_CAPCOM 109
|
||||
#define F_PROVCOM 110
|
||||
#define F_TELAMB 111
|
||||
#define F_TELABI 112
|
157
at/at0800a.uml
Executable file
157
at/at0800a.uml
Executable file
@ -0,0 +1,157 @@
|
||||
#include "at0800.h"
|
||||
#include "lf.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
#include <toolbar.h>
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Tabella Medici 1/1" -1 -1 78 20
|
||||
|
||||
GROUPBOX DLG_NULL 77 5
|
||||
BEGIN
|
||||
PROMPT 1 1 ""
|
||||
FLAGS "R"
|
||||
END
|
||||
|
||||
NUMBER F_CODMED 6
|
||||
BEGIN
|
||||
PROMPT 2 2 "Cod. medico "
|
||||
FIELD CODMED
|
||||
FLAGS "U"
|
||||
KEY 1
|
||||
USE LF_MEDICI
|
||||
INPUT CODMED F_CODMED
|
||||
DISPLAY "Codice " CODMED
|
||||
DISPLAY "Cognome@25" COGNOME
|
||||
DISPLAY "Nome@25" NOME
|
||||
OUTPUT F_CODMED CODMED
|
||||
OUTPUT F_COGNOME COGNOME
|
||||
OUTPUT F_NOME NOME
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
STRING F_COGNOME 25
|
||||
BEGIN
|
||||
PROMPT 2 3 "Cognome "
|
||||
FIELD COGNOME
|
||||
KEY 2
|
||||
USE LF_MEDICI KEY 2
|
||||
INPUT COGNOME F_COGNOME
|
||||
INPUT NOME F_NOME
|
||||
DISPLAY "Cognome@25" COGNOME
|
||||
DISPLAY "Nome@25" NOME
|
||||
DISPLAY "Codice " CODMED
|
||||
COPY OUTPUT F_CODMED
|
||||
CHECKTYPE REQUIRED
|
||||
WARNING "Inserire il cognome del medico"
|
||||
END
|
||||
|
||||
STRING F_NOME 25
|
||||
BEGIN
|
||||
PROMPT 2 4 "Nome "
|
||||
FIELD NOME
|
||||
KEY 2
|
||||
COPY ALL F_COGNOME
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 5
|
||||
BEGIN
|
||||
PROMPT 1 6 "Indirizzo"
|
||||
END
|
||||
|
||||
STRING F_INDIRIZZO 50
|
||||
BEGIN
|
||||
PROMPT 2 7 "Indirizzo "
|
||||
FIELD INDIRIZZO
|
||||
END
|
||||
|
||||
STRING F_COM 4
|
||||
BEGIN
|
||||
PROMPT 2 8 "Comune "
|
||||
FIELD COM
|
||||
FLAGS "U"
|
||||
USE LF_COMUNI
|
||||
INPUT STATO ""
|
||||
INPUT COM F_COM
|
||||
#include <comdcod.h>
|
||||
OUTPUT F_COM COM
|
||||
OUTPUT F_DENCOM DENCOM
|
||||
OUTPUT F_PROVCOM PROVCOM
|
||||
OUTPUT F_CAPCOM CAPCOM
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Comune assente"
|
||||
END
|
||||
|
||||
STRING F_DENCOM 48
|
||||
BEGIN
|
||||
PROMPT 19 8 ""
|
||||
USE LF_COMUNI KEY 2
|
||||
INPUT DENCOM F_DENCOM
|
||||
#include <comdden.h>
|
||||
COPY OUTPUT F_COM
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
STRING F_LOCALITA 4
|
||||
BEGIN
|
||||
PROMPT 2 9 "Località "
|
||||
FIELD LOCALITA
|
||||
FLAGS "U"
|
||||
USE LCP SELECT S7=#F_COM
|
||||
INPUT CODTAB F_LOCALITA
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Località@30" S0
|
||||
DISPLAY "CAP@5" S6
|
||||
OUTPUT F_LOCALITA CODTAB
|
||||
OUTPUT F_DENLOC S0
|
||||
OUTPUT F_CAPCOM S6
|
||||
OUTPUT F_COM S7
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Codice localit… postale se diversa dal comune"
|
||||
END
|
||||
|
||||
STRING F_DENLOC 30
|
||||
BEGIN
|
||||
PROMPT 19 9 ""
|
||||
COPY USE F_LOCALITA
|
||||
INPUT S0 F_DENLOC
|
||||
DISPLAY "Località@30" S0
|
||||
DISPLAY "CAP@5" S6
|
||||
DISPLAY "Codice" CODTAB
|
||||
COPY OUTPUT F_LOCALITA
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Localit… postale se diversa dal comune"
|
||||
END
|
||||
|
||||
STRING F_PROVCOM 5
|
||||
BEGIN
|
||||
PROMPT 71 8 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAPCOM 5
|
||||
BEGIN
|
||||
PROMPT 67 9 "CAP "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 3
|
||||
BEGIN
|
||||
PROMPT 1 11 "Telefoni"
|
||||
END
|
||||
|
||||
STRING F_TELAMB 15
|
||||
BEGIN
|
||||
PROMPT 2 12 "Ambulatorio "
|
||||
FIELD TELAMB
|
||||
END
|
||||
|
||||
STRING F_TELABI 15
|
||||
BEGIN
|
||||
PROMPT 40 12 "Abitazione "
|
||||
FIELD TELABI
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
24
at/at1.cpp
Executable file
24
at/at1.cpp
Executable file
@ -0,0 +1,24 @@
|
||||
#include <xvt.h>
|
||||
|
||||
#include <checks.h>
|
||||
|
||||
#include "at1.h"
|
||||
|
||||
#define usage "Error - usage : %s -[0,1]"
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
int rt = 0 ;
|
||||
const int r = (argc > 1) ? atoi(&argv[1][1]) : -1;
|
||||
|
||||
switch (r)
|
||||
{
|
||||
case 0:
|
||||
rt = at1100(argc, argv); break;
|
||||
case 1:
|
||||
rt = at1200(argc, argv); break;
|
||||
default:
|
||||
error_box(usage, argv[0]) ; rt = 1; break;
|
||||
}
|
||||
return rt;
|
||||
}
|
21
at/at1.url
Executable file
21
at/at1.url
Executable file
@ -0,0 +1,21 @@
|
||||
|
||||
#define APPNAME AVIS
|
||||
#define QAPPNAME "AVIS"
|
||||
#define LIBDIR f:\xvt.403\win_x86\ptk\lib
|
||||
#include <default.url>
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at1 -0
|
||||
* ---------------------------------------------------- */
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at1 -1
|
||||
* ---------------------------------------------------- */
|
||||
MENUBAR MENU_BAR(1)
|
||||
|
||||
MENU MENU_BAR(1)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
|
223
at/at1100.cpp
Executable file
223
at/at1100.cpp
Executable file
@ -0,0 +1,223 @@
|
||||
#include <mask.h>
|
||||
#include <form.h>
|
||||
#include <printapp.h>
|
||||
|
||||
#include "lf.h"
|
||||
#include "medici.h"
|
||||
#include <comuni.h>
|
||||
|
||||
#include "at1.h"
|
||||
#include "at1100a.h"
|
||||
|
||||
enum ts { undefined = 0, elenco = 1, etichette = 2 };
|
||||
|
||||
// definizione form per etichette
|
||||
class TMed_form : public TForm
|
||||
{
|
||||
public:
|
||||
|
||||
virtual TCursor* cursor() const;
|
||||
virtual TRelation* relation() const;
|
||||
TPrint_section& get_body() { return section('B'); } ;
|
||||
TMed_form(): TForm() {};
|
||||
TMed_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
|
||||
: TForm(form,code,editlevel,desc) {};
|
||||
virtual ~TMed_form() {};
|
||||
};
|
||||
|
||||
class TMedprint_application : public TPrintapp
|
||||
{
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TMed_form* _form_eti;
|
||||
|
||||
int _cur1, _cur2;
|
||||
TParagraph_string _cognome_nome, _dencom, _indirizzo;
|
||||
TDate _data_stampa;
|
||||
ts _tipo_stampa;
|
||||
|
||||
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();
|
||||
TMedprint_application() : _data_stampa(TODAY), _indirizzo("",25), _dencom("",25), _cognome_nome("",40) {}
|
||||
};
|
||||
|
||||
HIDDEN inline TMedprint_application& app() { return (TMedprint_application&) 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)
|
||||
{
|
||||
// costruzione etichette
|
||||
switch (_tipo_stampa)
|
||||
{
|
||||
case etichette:
|
||||
{
|
||||
TPrint_section& corpo = _form_eti->get_body();
|
||||
corpo.reset();
|
||||
corpo.update();
|
||||
for (int i = 0; i < corpo.height(); i++)
|
||||
{
|
||||
TPrintrow& riga = corpo.row(i);
|
||||
set_row(i+1,riga);
|
||||
}
|
||||
force_setpage(TRUE);
|
||||
}
|
||||
break;
|
||||
case elenco:
|
||||
{
|
||||
set_row(1,"@0g@pn",FLD(LF_MEDICI,MED_CODMED,"######"));
|
||||
set_row(1,"@7g#a",&_cognome_nome);
|
||||
set_row(1,"@48g#a",&_indirizzo);
|
||||
set_row(1,"@74g#a",&_dencom);
|
||||
set_row(1,"@100g@S",FLD(LF_MEDICI,MED_TELAMB));
|
||||
set_row(1,"@116g@S",FLD(LF_MEDICI,MED_TELABI));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool TMedprint_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString nome = current_cursor()->curr().get(MED_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(MED_NOME);
|
||||
_cognome_nome = nome;
|
||||
TString localita = "";
|
||||
localita << current_cursor()->curr("LCP").get("S0");
|
||||
if (localita.not_empty() && localita.ok())
|
||||
localita << " - ";
|
||||
localita << current_cursor()->curr(LF_COMUNI).get(COM_DENCOM);
|
||||
_dencom = localita;
|
||||
_indirizzo = current_cursor()->curr(LF_MEDICI).get(MED_INDIRIZZO);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TMedprint_application::set_print(int)
|
||||
{
|
||||
_tipo_stampa = undefined;
|
||||
KEY tasto;
|
||||
tasto = _msk->run();
|
||||
switch (tasto)
|
||||
{
|
||||
case F_ELENCO:
|
||||
_tipo_stampa = elenco;
|
||||
break;
|
||||
case F_ETICHETTE:
|
||||
_tipo_stampa = etichette;
|
||||
break;
|
||||
}
|
||||
if (_tipo_stampa != undefined)
|
||||
{
|
||||
long codfr, codto;
|
||||
TString cogfr, cogto;
|
||||
int sort = _msk->get_int(F_SORT);
|
||||
reset_files();
|
||||
add_file(LF_MEDICI);
|
||||
if (sort == 1)
|
||||
{
|
||||
codfr = _msk->get_long(F_CODFR);
|
||||
codto = _msk->get_long(F_CODTO);
|
||||
select_cursor(_cur1);
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_MEDICI);
|
||||
TRectype da(fl.curr());
|
||||
TRectype a(fl.curr());
|
||||
da.zero();
|
||||
a.zero();
|
||||
da.put(MED_CODMED, codfr);
|
||||
a.put(MED_CODMED, codto);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
else
|
||||
if (sort == 2)
|
||||
{
|
||||
cogfr = _msk->get(F_COGFR);
|
||||
cogto = _msk->get(F_COGTO);
|
||||
select_cursor(_cur2);
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_MEDICI);
|
||||
TRectype da(fl.curr());
|
||||
TRectype a(fl.curr());
|
||||
da.zero();
|
||||
a.zero();
|
||||
da.put(MED_COGNOME, cogfr);
|
||||
a.put (MED_COGNOME, cogto);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
reset_print();
|
||||
crea_intestazione();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TMedprint_application::crea_intestazione()
|
||||
{
|
||||
reset_header();
|
||||
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString sep(132);
|
||||
TString data_stampa;
|
||||
sep.fill('-');
|
||||
set_header(1, (const char *) sep);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
sep.right_just(132);
|
||||
set_header(2,(const char*) sep);
|
||||
set_header(2,"@0gARCHIVIO MEDICI@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,"@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()
|
||||
{
|
||||
_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("at1100a");
|
||||
|
||||
_form_eti = new TMed_form("AT_ETMED");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TMedprint_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_eti;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at1100(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TMedprint_application a;
|
||||
|
||||
a.run(argc, argv, "Stampa Medici");
|
||||
|
||||
return 0;
|
||||
}
|
10
at/at1100a.h
Executable file
10
at/at1100a.h
Executable file
@ -0,0 +1,10 @@
|
||||
// stampa anagrafica medici
|
||||
// definizione campi per maschera di selezione
|
||||
|
||||
#define F_SORT 101 // ordinamento: cod. o cognome/nome
|
||||
#define F_CODFR 102 // da codice
|
||||
#define F_CODTO 103 // a codice
|
||||
#define F_COGFR 104 // da cognome
|
||||
#define F_COGTO 105 // a cognome
|
||||
#define F_ELENCO 106 // elenco
|
||||
#define F_ETICHETTE 107 // etichette
|
94
at/at1100a.uml
Executable file
94
at/at1100a.uml
Executable file
@ -0,0 +1,94 @@
|
||||
#include "at1100a.h"
|
||||
#include <lffiles.h>
|
||||
#include "lf.h"
|
||||
PAGE "Definizione Stampe" -1 -1 70 17
|
||||
|
||||
RADIOBUTTON F_SORT 25
|
||||
BEGIN
|
||||
PROMPT 3 1 "Ordinamento"
|
||||
HELP "Selezionare il tipo di ordinamento per la stampa"
|
||||
ITEM "1|per Codice"
|
||||
MESSAGE DISABLE,5@|ENABLE,4@|RESET,5@
|
||||
ITEM "2|per Cognome e nome"
|
||||
MESSAGE DISABLE,4@|ENABLE,5@|RESET,4@
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 65 4
|
||||
BEGIN
|
||||
PROMPT 3 5 "Selezione "
|
||||
END
|
||||
|
||||
NUMBER F_CODFR 6
|
||||
BEGIN
|
||||
PROMPT 4 6 "da Codice "
|
||||
USE LF_MEDICI KEY 1
|
||||
INPUT CODMED F_CODFR
|
||||
DISPLAY "Codice" CODMED
|
||||
DISPLAY "Cognome@25" COGNOME
|
||||
DISPLAY "Nome@25" NOME
|
||||
OUTPUT F_CODFR CODMED
|
||||
FLAGS "R"
|
||||
HELP "Codice medico da cui iniziare la stampa: vuoto = inizio"
|
||||
GROUP 1 4
|
||||
END
|
||||
|
||||
NUMBER F_CODTO 6
|
||||
BEGIN
|
||||
PROMPT 4 7 " a Codice "
|
||||
COPY USE F_CODFR
|
||||
INPUT CODMED F_CODTO
|
||||
COPY DISPLAY F_CODFR
|
||||
OUTPUT F_CODTO CODMED
|
||||
FLAGS "R"
|
||||
HELP "Codice medico finale per la stampa: vuoto = fine archivio"
|
||||
GROUP 1 4
|
||||
END
|
||||
|
||||
STRING F_COGFR 25
|
||||
BEGIN
|
||||
PROMPT 27 6 "da Cognome "
|
||||
USE LF_MEDICI KEY 2
|
||||
INPUT COGNOME F_COGFR
|
||||
DISPLAY "Cognome@25" COGNOME
|
||||
DISPLAY "Nome@25" NOME
|
||||
DISPLAY "Codice" CODMED
|
||||
OUTPUT F_COGFR COGNOME
|
||||
HELP "Cognome da cui iniziare stampa: vuoto = inizio archivio"
|
||||
GROUP 1 5
|
||||
END
|
||||
|
||||
STRING F_COGTO 25
|
||||
BEGIN
|
||||
PROMPT 27 7 " a Cognome "
|
||||
COPY USE F_COGFR
|
||||
INPUT COGNOME F_COGTO
|
||||
COPY DISPLAY F_COGFR
|
||||
OUTPUT F_COGTO COGNOME
|
||||
HELP "Cognome finale per la stampa: vuoto = fine archivio"
|
||||
GROUP 1 5
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 50 4
|
||||
BEGIN
|
||||
PROMPT 3 11 "Stampa"
|
||||
END
|
||||
|
||||
BUTTON F_ELENCO 9 2
|
||||
BEGIN
|
||||
PROMPT 4 12 "Elenco"
|
||||
MESSAGE EXIT,F_ELENCO
|
||||
END
|
||||
|
||||
BUTTON F_ETICHETTE 9 2
|
||||
BEGIN
|
||||
PROMPT 16 12 "Etichette"
|
||||
MESSAGE EXIT,F_ETICHETTE
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT 32 12 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
234
at/at1200.cpp
Executable file
234
at/at1200.cpp
Executable file
@ -0,0 +1,234 @@
|
||||
#include <mask.h>
|
||||
#include <form.h>
|
||||
#include <printapp.h>
|
||||
|
||||
#include <lffiles.h>
|
||||
#include "lf.h"
|
||||
#include "sezioni.h"
|
||||
#include <comuni.h>
|
||||
|
||||
#include "at1.h"
|
||||
#include "at1200a.h"
|
||||
enum ts { undefined = 0, elenco = 1, etichette = 2 };
|
||||
|
||||
// definizione form per etichette
|
||||
class TSez_form : public TForm
|
||||
{
|
||||
public:
|
||||
|
||||
virtual TCursor* cursor() const;
|
||||
virtual TRelation* relation() const;
|
||||
TPrint_section& get_body() { return section('B'); } ;
|
||||
TSez_form(): TForm() {};
|
||||
TSez_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
|
||||
: TForm(form,code,editlevel,desc) {};
|
||||
virtual ~TSez_form() {};
|
||||
};
|
||||
|
||||
class TSezprint_application : public TPrintapp
|
||||
{
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TSez_form* _form_eti;
|
||||
|
||||
int _cur1, _cur2;
|
||||
TParagraph_string _dencom, _indirizzo;
|
||||
TDate _data_stampa;
|
||||
ts _tipo_stampa;
|
||||
|
||||
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();
|
||||
|
||||
TSezprint_application() : _data_stampa(TODAY), _indirizzo("", 22), _dencom("", 25) {}
|
||||
};
|
||||
|
||||
HIDDEN inline TSezprint_application& app() { return (TSezprint_application&) 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)
|
||||
{
|
||||
switch (_tipo_stampa)
|
||||
{
|
||||
case etichette:
|
||||
{
|
||||
TPrint_section& corpo = _form_eti->get_body();
|
||||
corpo.reset();
|
||||
corpo.update();
|
||||
for (int i = 0; i < corpo.height(); i++)
|
||||
{
|
||||
TPrintrow& riga = corpo.row(i);
|
||||
set_row(i+1,riga);
|
||||
}
|
||||
force_setpage(TRUE);
|
||||
}
|
||||
break;
|
||||
case elenco:
|
||||
{
|
||||
set_row(1,"@0g@S", FLD(LF_SEZIONI,SEZ_CODSEZ));
|
||||
set_row(1,"@2g@S", FLD(LF_SEZIONI,SEZ_CODSOT));
|
||||
set_row(1,"@5g@S", FLD(LF_SEZIONI,SEZ_DENSEZ));
|
||||
set_row(1,"@31g@S", FLD(LF_SEZIONI,SEZ_DENSOT));
|
||||
set_row(1,"@57g#a",&_indirizzo);
|
||||
set_row(1,"@80g#a",&_dencom);
|
||||
set_row(1,"@101g@S",FLD(LF_SEZIONI,SEZ_TELEFONO));
|
||||
set_row(1,"@117g@S",FLD(LF_SEZIONI,SEZ_FAX));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool TSezprint_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString localita = "";
|
||||
localita << current_cursor()->curr("LCP").get("S0");
|
||||
if (localita.not_empty() && localita.ok())
|
||||
localita << " - ";
|
||||
localita << current_cursor()->curr(LF_COMUNI).get(COM_DENCOM);
|
||||
_dencom = localita;
|
||||
_indirizzo = current_cursor()->curr(LF_SEZIONI).get(SEZ_INDIRIZZO);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TSezprint_application::set_print(int)
|
||||
{
|
||||
_tipo_stampa = undefined;
|
||||
KEY tasto;
|
||||
tasto = _msk->run();
|
||||
|
||||
switch (tasto)
|
||||
{
|
||||
case F_ELENCO:
|
||||
_tipo_stampa = elenco;
|
||||
break;
|
||||
case F_ETICHETTE:
|
||||
_tipo_stampa = etichette;
|
||||
break;
|
||||
}
|
||||
if (_tipo_stampa != undefined)
|
||||
{
|
||||
TString codfr, codto;
|
||||
TString denfr, dento;
|
||||
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
|
||||
if (sort == 2)
|
||||
{
|
||||
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();
|
||||
crea_intestazione();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TSezprint_application::crea_intestazione()
|
||||
{
|
||||
reset_header();
|
||||
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString sep(132);
|
||||
TString data_stampa;
|
||||
sep.fill('-');
|
||||
set_header(1, (const char *) sep);
|
||||
sep = "";
|
||||
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()
|
||||
{
|
||||
_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("at1200a");
|
||||
|
||||
_form_eti = new TSez_form("AT_ETSEZ");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TSezprint_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_eti;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at1200(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TSezprint_application a;
|
||||
|
||||
a.run(argc, argv, "Stampa Sezioni");
|
||||
|
||||
return 0;
|
||||
}
|
10
at/at1200a.h
Executable file
10
at/at1200a.h
Executable file
@ -0,0 +1,10 @@
|
||||
// stampa anagrafica sezioni/sottogruppi
|
||||
// definizione campi per maschera di selezione
|
||||
|
||||
#define F_SORT 101 // ordinamento: cod. o denominazione
|
||||
#define F_CODFR 102 // da codice
|
||||
#define F_CODTO 103 // a codice
|
||||
#define F_DENFR 104 // da sezione
|
||||
#define F_DENTO 105 // a sezione
|
||||
#define F_ELENCO 106 // elenco
|
||||
#define F_ETICHETTE 107 // etichette
|
94
at/at1200a.uml
Executable file
94
at/at1200a.uml
Executable file
@ -0,0 +1,94 @@
|
||||
#include "at1200a.h"
|
||||
#include <lffiles.h>
|
||||
#include "lf.h"
|
||||
PAGE "Definizione Stampe" -1 -1 70 17
|
||||
|
||||
RADIOBUTTON F_SORT 25
|
||||
BEGIN
|
||||
PROMPT 3 1 "Ordinamento"
|
||||
HELP "Selezionare il tipo di ordinamento per la stampa"
|
||||
ITEM "1|per Codice"
|
||||
MESSAGE DISABLE,5@|ENABLE,4@|RESET,5@
|
||||
ITEM "2|per Sezione"
|
||||
MESSAGE DISABLE,4@|ENABLE,5@|RESET,4@
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 65 4
|
||||
BEGIN
|
||||
PROMPT 3 5 "Selezione "
|
||||
END
|
||||
|
||||
STRING F_CODFR 6
|
||||
BEGIN
|
||||
PROMPT 4 6 "da Codice "
|
||||
USE LF_SEZIONI KEY 1
|
||||
INPUT CODSEZ F_CODFR
|
||||
DISPLAY "Codice" CODSEZ
|
||||
DISPLAY "Sezione@25" DENSEZ
|
||||
DISPLAY "Sottogruppo@25" DENSOT
|
||||
OUTPUT F_CODFR CODSEZ
|
||||
FLAGS "R"
|
||||
HELP "Codice sezione da cui iniziare la stampa: vuoto = inizio"
|
||||
GROUP 1 4
|
||||
END
|
||||
|
||||
STRING F_CODTO 6
|
||||
BEGIN
|
||||
PROMPT 4 7 " a Codice "
|
||||
COPY USE F_CODFR
|
||||
INPUT CODSEZ F_CODTO
|
||||
COPY DISPLAY F_CODFR
|
||||
OUTPUT F_CODTO CODSEZ
|
||||
FLAGS "R"
|
||||
HELP "Codice sezione finale per la stampa: vuoto = fine archivio"
|
||||
GROUP 1 4
|
||||
END
|
||||
|
||||
STRING F_DENFR 25
|
||||
BEGIN
|
||||
PROMPT 27 6 "da Sezione "
|
||||
USE LF_SEZIONI KEY 2
|
||||
INPUT DENSEZ F_DENFR
|
||||
DISPLAY "Sezione@25" DENSEZ
|
||||
DISPLAY "Sottogruppo@25" DENSOT
|
||||
DISPLAY "Codice" CODSEZ
|
||||
OUTPUT F_DENFR DENSEZ
|
||||
HELP "Sezione da cui iniziare stampa: vuoto = inizio archivio"
|
||||
GROUP 1 5
|
||||
END
|
||||
|
||||
STRING F_DENTO 25
|
||||
BEGIN
|
||||
PROMPT 27 7 " a Sezione "
|
||||
COPY USE F_DENFR
|
||||
INPUT DENSEZ F_DENTO
|
||||
COPY DISPLAY F_DENFR
|
||||
OUTPUT F_DENTO DENSEZ
|
||||
HELP "Sezione finale per la stampa: vuoto = fine archivio"
|
||||
GROUP 1 5
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 50 4
|
||||
BEGIN
|
||||
PROMPT 3 11 "Stampa"
|
||||
END
|
||||
|
||||
BUTTON F_ELENCO 9 2
|
||||
BEGIN
|
||||
PROMPT 4 12 "Elenco"
|
||||
MESSAGE EXIT,F_ELENCO
|
||||
END
|
||||
|
||||
BUTTON F_ETICHETTE 9 2
|
||||
BEGIN
|
||||
PROMPT 16 12 "Etichette"
|
||||
MESSAGE EXIT,F_ETICHETTE
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT 32 12 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
32
at/at2.cpp
Executable file
32
at/at2.cpp
Executable file
@ -0,0 +1,32 @@
|
||||
#include <xvt.h>
|
||||
|
||||
#include <checks.h>
|
||||
|
||||
#include "at2.h"
|
||||
|
||||
#define usage "Error - usage : %s -[0,1,2,3,4,5]"
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
int rt = 0 ;
|
||||
const int r = (argc > 1) ? atoi(&argv[1][1]) : -1;
|
||||
|
||||
switch (r)
|
||||
{
|
||||
case 0:
|
||||
rt = at2100(argc, argv); break;
|
||||
case 1:
|
||||
rt = at2200(argc, argv); break;
|
||||
case 2:
|
||||
rt = at2300(argc, argv); break;
|
||||
case 3:
|
||||
rt = at2400(argc, argv); break;
|
||||
case 4:
|
||||
rt = at2500(argc, argv); break;
|
||||
case 5:
|
||||
rt = at2600(argc, argv); break;
|
||||
default:
|
||||
error_box(usage, argv[0]) ; rt = 1; break;
|
||||
}
|
||||
return rt;
|
||||
}
|
12
at/at2.h
Executable file
12
at/at2.h
Executable file
@ -0,0 +1,12 @@
|
||||
#ifndef __AT2_H
|
||||
#define __AT2_H
|
||||
|
||||
int at2100(int argc, char* argv[]); // stampa soggetti sospesi
|
||||
int at2200(int argc, char* argv[]); // stampa soggetti per età (da data nasc. a data nasc.)
|
||||
int at2300(int argc, char* argv[]); // stampa soggetti esclusi
|
||||
int at2400(int argc, char* argv[]); // stampa benemerenze assegnate
|
||||
int at2500(int argc, char* argv[]); // stampa soggetti idonei
|
||||
int at2600(int argc, char* argv[]); // stampa soggetti iscritti/dimessi
|
||||
|
||||
#endif // __AT2_H
|
||||
|
56
at/at2.url
Executable file
56
at/at2.url
Executable file
@ -0,0 +1,56 @@
|
||||
#define APPNAME AVIS
|
||||
#define QAPPNAME "AVIS"
|
||||
#define LIBDIR f:\xvt.403\win_x86\ptk\lib
|
||||
|
||||
#include <default.url>
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at2 -0
|
||||
* ---------------------------------------------------- */
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at2 -1
|
||||
* ---------------------------------------------------- */
|
||||
MENUBAR MENU_BAR(1)
|
||||
|
||||
MENU MENU_BAR(1)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at2 -2
|
||||
* ---------------------------------------------------- */
|
||||
|
||||
MENUBAR MENU_BAR(2)
|
||||
|
||||
MENU MENU_BAR(2)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at2 -3
|
||||
*
|
||||
* ----------------------------------------------------*/
|
||||
|
||||
MENUBAR MENU_BAR(3)
|
||||
|
||||
MENU MENU_BAR(3)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at2 -4
|
||||
* ---------------------------------------------------- */
|
||||
MENUBAR MENU_BAR(4)
|
||||
|
||||
MENU MENU_BAR(4)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at2 -5
|
||||
* ---------------------------------------------------- */
|
||||
MENUBAR MENU_BAR(5)
|
||||
|
||||
MENU MENU_BAR(5)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
332
at/at2100.cpp
Executable file
332
at/at2100.cpp
Executable file
@ -0,0 +1,332 @@
|
||||
#include <mask.h>
|
||||
#include <form.h>
|
||||
#include <printapp.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "lf.h"
|
||||
#include "soggetti.h"
|
||||
#include "sezioni.h"
|
||||
|
||||
#include "at2.h"
|
||||
#include "at2100a.h"
|
||||
|
||||
#define ALIAS_LCP 100
|
||||
#define ALIAS_TCS 200
|
||||
|
||||
enum ts { undefined = 0, elenco = 1, etichette = 2 };
|
||||
|
||||
// definizione form per etichette
|
||||
class TEti_sospesi_form : public TForm
|
||||
{
|
||||
public:
|
||||
|
||||
virtual TCursor* cursor() const;
|
||||
virtual TRelation* relation() const;
|
||||
TPrint_section& get_body() { return section('B'); } ;
|
||||
TEti_sospesi_form(): TForm() {};
|
||||
TEti_sospesi_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
|
||||
: TForm(form,code,editlevel,desc) {};
|
||||
virtual ~TEti_sospesi_form() {};
|
||||
};
|
||||
|
||||
class TSospesi_application : public TPrintapp
|
||||
{
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TEti_sospesi_form* _form_eti;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome;
|
||||
TDate _data_stampa;
|
||||
ts _tipo_stampa;
|
||||
TString _codsez, _codsot;
|
||||
|
||||
static bool filter_func_sospesi(const TRelation *);
|
||||
|
||||
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(TString codsez, TString codsot);
|
||||
TMask& app_mask() { return *_msk; }
|
||||
TSospesi_application() : _data_stampa(TODAY), _cognome_nome("",25) {}
|
||||
};
|
||||
|
||||
HIDDEN inline TSospesi_application& app() { return (TSospesi_application&) 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()
|
||||
{
|
||||
TString sezini = _msk->get(F_SEZINI);
|
||||
TString sotini = _msk->get(F_SOTINI);
|
||||
TString sezfin = _msk->get(F_SEZFIN);
|
||||
TString sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
|
||||
TRectype da(fl.curr());
|
||||
TRectype a(fl.curr());
|
||||
da.zero();
|
||||
a.zero();
|
||||
if ((sezini.not_empty()) && (sezini.ok()))
|
||||
da.put(SOG_CODSEZ, sezini);
|
||||
if ((sotini.not_empty()) && (sotini.ok()))
|
||||
da.put(SOG_CODSOT, sotini);
|
||||
if ((sezfin.not_empty()) && (sezfin.ok()))
|
||||
a.put(SOG_CODSEZ, sezfin);
|
||||
if ((sotfin.not_empty()) && (sotfin.ok()))
|
||||
a.put(SOG_CODSOT, sotfin);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
void TSospesi_application::set_page(int file, int cnt)
|
||||
{
|
||||
// costruzione etichette
|
||||
switch (_tipo_stampa)
|
||||
{
|
||||
case etichette:
|
||||
{
|
||||
TPrint_section& corpo = _form_eti->get_body();
|
||||
corpo.reset();
|
||||
corpo.update();
|
||||
for (int i = 0; i < corpo.height(); i++)
|
||||
{
|
||||
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
|
||||
}
|
||||
break;
|
||||
case elenco:
|
||||
{
|
||||
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"######"));
|
||||
set_row(1,"@7g@S", FLD(LF_SOGGETTI,SOG_CATDON));
|
||||
set_row(1,"@10g#a", &_cognome_nome);
|
||||
set_row(1,"@36g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
|
||||
set_row(1,"@47g@ld", FLD(LF_SOGGETTI,SOG_DATASTATO));
|
||||
set_row(1,"@58g@S", FLD(LF_SOGGETTI,SOG_STATO));
|
||||
set_row(1,"@61g@ld", FLD(LF_SOGGETTI,SOG_DATAULTID));
|
||||
set_row(1,"@72g@S", FLD(LF_SOGGETTI,SOG_TIPOULTID));
|
||||
set_row(1,"@75g@pn", FLD(LF_SOGGETTI,SOG_INTSI,"###"));
|
||||
set_row(1,"@79g@pn", FLD(LF_SOGGETTI,SOG_INTAF,"###"));
|
||||
set_row(1,"@86g@ld", FLD(LF_SOGGETTI,SOG_DATAULTDON));
|
||||
set_row(1,"@97g@S", FLD(LF_SOGGETTI,SOG_TIPOULTDON));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool TSospesi_application::filter_func_sospesi(const TRelation * rel)
|
||||
{
|
||||
|
||||
bool filtrato = TRUE;
|
||||
|
||||
TLocalisamfile* sog = &(rel->lfile(LF_SOGGETTI));
|
||||
|
||||
TAssoc_array categorie;
|
||||
|
||||
TMask& msk = app().app_mask();
|
||||
|
||||
TString catpri = msk.get(F_CAT1);
|
||||
TString catsec = msk.get(F_CAT2);
|
||||
TString catter = msk.get(F_CAT3);
|
||||
TString catqua = msk.get(F_CAT4);
|
||||
TString catqui = msk.get(F_CAT5);
|
||||
TString catses = msk.get(F_CAT6);
|
||||
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
categorie.add((const char*) catpri);
|
||||
if (catsec.not_empty() && catsec.ok())
|
||||
categorie.add((const char*) catsec);
|
||||
if (catter.not_empty() && catter.ok())
|
||||
categorie.add((const char*) catter);
|
||||
if (catqua.not_empty() && catqua.ok())
|
||||
categorie.add((const char*) catqua);
|
||||
if (catqui.not_empty() && catqui.ok())
|
||||
categorie.add((const char*) catqui);
|
||||
if (catses.not_empty() && catses.ok())
|
||||
categorie.add((const char*) catses);
|
||||
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
TString cat = sog->curr().get(SOG_CATDON);
|
||||
if (categorie.is_key((const char*) cat))
|
||||
filtrato = TRUE;
|
||||
else
|
||||
filtrato = FALSE;
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TSospesi_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
|
||||
// salto pagina se cambio sezione
|
||||
TString codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
TString codsot = current_cursor()->curr().get(SOG_CODSOT);
|
||||
if ((_codsez!=codsez)||(_codsot!=codsot))
|
||||
{
|
||||
//if (!_codsez.blank())
|
||||
if (_codsez != "**")
|
||||
printer().formfeed();
|
||||
_codsez = codsez;
|
||||
_codsot = codsot;
|
||||
header_sezione(codsez, codsot);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void TSospesi_application::header_sezione(TString codsez, TString codsot)
|
||||
{
|
||||
TString densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
TString 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 TSospesi_application::set_print(int m)
|
||||
{
|
||||
_tipo_stampa = undefined;
|
||||
KEY tasto;
|
||||
tasto = _msk->run();
|
||||
switch (tasto)
|
||||
{
|
||||
case F_ELENCO:
|
||||
_tipo_stampa = elenco;
|
||||
//_codsez.spaces(2);
|
||||
//_codsot.spaces(2);
|
||||
_codsez = "**";
|
||||
_codsot = "**";
|
||||
break;
|
||||
case F_ETICHETTE:
|
||||
_tipo_stampa = etichette;
|
||||
break;
|
||||
}
|
||||
if (_tipo_stampa != undefined)
|
||||
{
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
|
||||
// filtro per sezioni selezionati
|
||||
filtra_sezioni();
|
||||
|
||||
// filtro per tipo sospensione
|
||||
TString 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
|
||||
current_cursor()->set_filterfunction(filter_func_sospesi);
|
||||
reset_print();
|
||||
crea_intestazione();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TSospesi_application::crea_intestazione()
|
||||
{
|
||||
reset_header();
|
||||
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString sep(132);
|
||||
sep = "ELENCO SOSPESI";
|
||||
TString tipo = _msk->get(F_TIPO);
|
||||
if ((tipo.ok()) && (tipo.not_empty()))
|
||||
{
|
||||
sep << ": tipo ";
|
||||
sep << tipo;
|
||||
TString dtipo = _msk->get(F_D_TIPO);
|
||||
sep << " ";
|
||||
sep << dtipo;
|
||||
}
|
||||
sep.center_just();
|
||||
set_header(2, "@0g%s", (const char*) sep);
|
||||
TString 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,"@0gCod.@7gC.@10gCognome e nome@36gNato il@47gSospensione@61gUltima id.@75gIntervalli@86gUltima donaz.@100gUlt. controllo");
|
||||
set_header(6,"@0g------@7g--@10g-------------------------@36g----------@47g-------------@61g-------------@75g----------@86g-------------@100g-------------");
|
||||
}
|
||||
}
|
||||
|
||||
bool TSospesi_application::user_create()
|
||||
{
|
||||
_rel = new TRelation(LF_SOGGETTI);
|
||||
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
|
||||
_rel->add("LCP", "CODTAB==LOCALITA",1,0,ALIAS_LCP);
|
||||
_rel->add(LF_COMUNI, "COM==COM");
|
||||
// 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
|
||||
|
||||
_msk = new TMask("at2100a");
|
||||
|
||||
_form_eti = new TEti_sospesi_form("AT_ETSOG");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TSospesi_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_eti;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at2100(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TSospesi_application a;
|
||||
|
||||
a.run(argc, argv, "Elenco sospesi");
|
||||
|
||||
return 0;
|
||||
}
|
30
at/at2100a.h
Executable file
30
at/at2100a.h
Executable file
@ -0,0 +1,30 @@
|
||||
// stampa elenco sospesi
|
||||
// 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_TIPO 301
|
||||
#define F_D_TIPO 302
|
||||
|
||||
#define F_ELENCO 401
|
||||
#define F_ETICHETTE 402
|
296
at/at2100a.uml
Executable file
296
at/at2100a.uml
Executable file
@ -0,0 +1,296 @@
|
||||
#include "at2100a.h"
|
||||
#include "lf.h"
|
||||
PAGE "Definizione Stampe" -1 -1 78 20
|
||||
|
||||
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 5
|
||||
BEGIN
|
||||
PROMPT 1 5 "Categorie"
|
||||
END
|
||||
|
||||
|
||||
STRING F_CAT1 2
|
||||
BEGIN
|
||||
PROMPT 2 6 ""
|
||||
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 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT2 2
|
||||
BEGIN
|
||||
PROMPT 2 7 ""
|
||||
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 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT3 2
|
||||
BEGIN
|
||||
PROMPT 2 8 ""
|
||||
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 8 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT4 2
|
||||
BEGIN
|
||||
PROMPT 40 6 ""
|
||||
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 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT5 2
|
||||
BEGIN
|
||||
PROMPT 40 7 ""
|
||||
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 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT6 2
|
||||
BEGIN
|
||||
PROMPT 40 8 ""
|
||||
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 8 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 3
|
||||
BEGIN
|
||||
PROMPT 1 10 "Tipo sospensione"
|
||||
END
|
||||
|
||||
STRING F_TIPO 2
|
||||
BEGIN
|
||||
PROMPT 2 11 ""
|
||||
FLAGS "U"
|
||||
USE TCS SELECT S6="S"
|
||||
INPUT CODTAB F_TIPO
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@30" S0
|
||||
OUTPUT F_TIPO CODTAB
|
||||
OUTPUT F_D_TIPO S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice non presente"
|
||||
HELP "Tipo sospensione: vuoto = tutti"
|
||||
END
|
||||
|
||||
STRING F_D_TIPO 30
|
||||
BEGIN
|
||||
PROMPT 8 11 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
PROMPT 1 13 "Stampa"
|
||||
END
|
||||
|
||||
BUTTON F_ELENCO 9 2
|
||||
BEGIN
|
||||
PROMPT -13 14 "Elenco"
|
||||
MESSAGE EXIT,F_ELENCO
|
||||
END
|
||||
|
||||
BUTTON F_ETICHETTE 9 2
|
||||
BEGIN
|
||||
PROMPT -23 14 "Etichette"
|
||||
MESSAGE EXIT,F_ETICHETTE
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -33 14 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
30
at/at2200a.h
Executable file
30
at/at2200a.h
Executable file
@ -0,0 +1,30 @@
|
||||
// stampa elenco soggetti nati dal .. al ..
|
||||
// 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_DATAINI 301
|
||||
#define F_DATAFIN 302
|
||||
|
||||
#define F_ELENCO 401
|
||||
#define F_ETICHETTE 402
|
288
at/at2200a.uml
Executable file
288
at/at2200a.uml
Executable file
@ -0,0 +1,288 @@
|
||||
#include "at2200a.h"
|
||||
#include "lf.h"
|
||||
PAGE "Definizione Stampe" -1 -1 78 20
|
||||
|
||||
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 5
|
||||
BEGIN
|
||||
PROMPT 1 5 "Categorie"
|
||||
END
|
||||
|
||||
|
||||
STRING F_CAT1 2
|
||||
BEGIN
|
||||
PROMPT 2 6 ""
|
||||
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 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT2 2
|
||||
BEGIN
|
||||
PROMPT 2 7 ""
|
||||
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 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT3 2
|
||||
BEGIN
|
||||
PROMPT 2 8 ""
|
||||
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 8 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT4 2
|
||||
BEGIN
|
||||
PROMPT 40 6 ""
|
||||
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 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT5 2
|
||||
BEGIN
|
||||
PROMPT 40 7 ""
|
||||
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 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT6 2
|
||||
BEGIN
|
||||
PROMPT 40 8 ""
|
||||
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 8 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 3
|
||||
BEGIN
|
||||
PROMPT 1 10 "Selezione data di nascita"
|
||||
END
|
||||
|
||||
DATE F_DATAINI
|
||||
BEGIN
|
||||
PROMPT 2 11 "Dal "
|
||||
HELP "Data di nascita iniziale"
|
||||
END
|
||||
|
||||
DATE F_DATAFIN
|
||||
BEGIN
|
||||
PROMPT 20 11 "Al "
|
||||
HELP "Data di nascita finale"
|
||||
END
|
||||
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
PROMPT 1 13 "Stampa"
|
||||
END
|
||||
|
||||
BUTTON F_ELENCO 9 2
|
||||
BEGIN
|
||||
PROMPT -13 14 "Elenco"
|
||||
MESSAGE EXIT,F_ELENCO
|
||||
END
|
||||
|
||||
BUTTON F_ETICHETTE 9 2
|
||||
BEGIN
|
||||
PROMPT -23 14 "Etichette"
|
||||
MESSAGE EXIT,F_ETICHETTE
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -33 14 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
332
at/at2300.cpp
Executable file
332
at/at2300.cpp
Executable file
@ -0,0 +1,332 @@
|
||||
#include <mask.h>
|
||||
#include <form.h>
|
||||
#include <printapp.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "lf.h"
|
||||
#include "soggetti.h"
|
||||
#include "sezioni.h"
|
||||
|
||||
#include "at2.h"
|
||||
#include "at2300a.h"
|
||||
|
||||
#define ALIAS_LCP 100
|
||||
#define ALIAS_TCS 200
|
||||
|
||||
enum ts { undefined = 0, elenco = 1, etichette = 2 };
|
||||
|
||||
// definizione form per etichette
|
||||
class TEti_esclusi_form : public TForm
|
||||
{
|
||||
public:
|
||||
|
||||
virtual TCursor* cursor() const;
|
||||
virtual TRelation* relation() const;
|
||||
TPrint_section& get_body() { return section('B'); } ;
|
||||
TEti_esclusi_form(): TForm() {};
|
||||
TEti_esclusi_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
|
||||
: TForm(form,code,editlevel,desc) {};
|
||||
virtual ~TEti_esclusi_form() {};
|
||||
};
|
||||
|
||||
class TEsclusi_application : public TPrintapp
|
||||
{
|
||||
static bool filter_func_esclusi(const TRelation *);
|
||||
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TEti_esclusi_form* _form_eti;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome;
|
||||
TDate _data_stampa;
|
||||
ts _tipo_stampa;
|
||||
TString _codsez, _codsot;
|
||||
|
||||
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(TString codsez, TString codsot);
|
||||
TMask& app_mask() { return *_msk; }
|
||||
TEsclusi_application() : _data_stampa(TODAY), _cognome_nome("",25) {}
|
||||
};
|
||||
|
||||
HIDDEN inline TEsclusi_application& app() { return (TEsclusi_application&) 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()
|
||||
{
|
||||
TString sezini = _msk->get(F_SEZINI);
|
||||
TString sotini = _msk->get(F_SOTINI);
|
||||
TString sezfin = _msk->get(F_SEZFIN);
|
||||
TString sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
|
||||
TRectype da(fl.curr());
|
||||
TRectype a(fl.curr());
|
||||
da.zero();
|
||||
a.zero();
|
||||
if ((sezini.not_empty()) && (sezini.ok()))
|
||||
da.put(SOG_CODSEZ, sezini);
|
||||
if ((sotini.not_empty()) && (sotini.ok()))
|
||||
da.put(SOG_CODSOT, sotini);
|
||||
if ((sezfin.not_empty()) && (sezfin.ok()))
|
||||
a.put(SOG_CODSEZ, sezfin);
|
||||
if ((sotfin.not_empty()) && (sotfin.ok()))
|
||||
a.put(SOG_CODSOT, sotfin);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
void TEsclusi_application::set_page(int file, int cnt)
|
||||
{
|
||||
// costruzione etichette
|
||||
switch (_tipo_stampa)
|
||||
{
|
||||
case etichette:
|
||||
{
|
||||
TPrint_section& corpo = _form_eti->get_body();
|
||||
corpo.reset();
|
||||
corpo.update();
|
||||
for (int i = 0; i < corpo.height(); i++)
|
||||
{
|
||||
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
|
||||
}
|
||||
break;
|
||||
case elenco:
|
||||
{
|
||||
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"######"));
|
||||
set_row(1,"@7g@S", FLD(LF_SOGGETTI,SOG_CATDON));
|
||||
set_row(1,"@10g#a", &_cognome_nome);
|
||||
set_row(1,"@36g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
|
||||
set_row(1,"@50g@S", FLD(LF_SOGGETTI,SOG_ESCLUSO));
|
||||
set_row(1,"@58g@S", FLD(LF_SOGGETTI,SOG_MOTESCL));
|
||||
set_row(2,"@47g@ld", FLD(LF_SOGGETTI,SOG_TERMESCL));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool TEsclusi_application::filter_func_esclusi(const TRelation * rel)
|
||||
{
|
||||
bool filtrato = TRUE;
|
||||
|
||||
TLocalisamfile* sog = &(rel->lfile(LF_SOGGETTI));
|
||||
|
||||
//filtro per categorie
|
||||
|
||||
TMask& msk = app().app_mask();
|
||||
TString catpri = msk.get(F_CAT1);
|
||||
TString catsec = msk.get(F_CAT2);
|
||||
TString catter = msk.get(F_CAT3);
|
||||
TString catqua = msk.get(F_CAT4);
|
||||
TString catqui = msk.get(F_CAT5);
|
||||
TString catses = msk.get(F_CAT6);
|
||||
|
||||
TAssoc_array categorie;
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
categorie.add((const char*) catpri);
|
||||
if (catsec.not_empty() && catsec.ok())
|
||||
categorie.add((const char*) catsec);
|
||||
if (catter.not_empty() && catter.ok())
|
||||
categorie.add((const char*) catter);
|
||||
if (catqua.not_empty() && catqua.ok())
|
||||
categorie.add((const char*) catqua);
|
||||
if (catqui.not_empty() && catqui.ok())
|
||||
categorie.add((const char*) catqui);
|
||||
if (catses.not_empty() && catses.ok())
|
||||
categorie.add((const char*) catses);
|
||||
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
TString cat = sog->curr().get(SOG_CATDON);
|
||||
if (categorie.is_key((const char*) cat))
|
||||
filtrato = TRUE;
|
||||
else
|
||||
filtrato = FALSE;
|
||||
}
|
||||
TDate termine = msk.get_date(F_DATA);
|
||||
TDate terminesog = sog->curr().get_date(SOG_TERMESCL);
|
||||
if ((filtrato) && (termine.ok()))
|
||||
if (terminesog > termine)
|
||||
filtrato = FALSE;
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TEsclusi_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
// salto pagina se cambio sezione
|
||||
TString codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
TString codsot = current_cursor()->curr().get(SOG_CODSOT);
|
||||
if ((_codsez!=codsez)||(_codsot!=codsot))
|
||||
{
|
||||
//if (!_codsez.blank())
|
||||
if (_codsez != "**")
|
||||
printer().formfeed();
|
||||
_codsez = codsez;
|
||||
_codsot = codsot;
|
||||
header_sezione(codsez, codsot);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void TEsclusi_application::header_sezione(TString codsez, TString codsot)
|
||||
{
|
||||
TString densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
TString 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 TEsclusi_application::set_print(int)
|
||||
{
|
||||
_tipo_stampa = undefined;
|
||||
KEY tasto;
|
||||
tasto = _msk->run();
|
||||
switch (tasto)
|
||||
{
|
||||
case F_ELENCO:
|
||||
_tipo_stampa = elenco;
|
||||
//_codsez.spaces(2);
|
||||
//_codsot.spaces(2);
|
||||
_codsez = "**";
|
||||
_codsot = "**";
|
||||
break;
|
||||
case F_ETICHETTE:
|
||||
_tipo_stampa = etichette;
|
||||
break;
|
||||
}
|
||||
if (_tipo_stampa != undefined)
|
||||
{
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
|
||||
TString tipoesc = _msk->get(F_TIPO);
|
||||
TDate termineesc = _msk->get(F_DATA);
|
||||
|
||||
filtra_sezioni();
|
||||
|
||||
if (tipoesc.not_empty() && tipoesc.ok())
|
||||
current_cursor()->setfilter(format("ESCLUSO == \"%s\"",(const char*)tipoesc));
|
||||
else
|
||||
current_cursor()->setfilter("ESCLUSO != \"\"");
|
||||
|
||||
current_cursor()->set_filterfunction(filter_func_esclusi);
|
||||
reset_print();
|
||||
crea_intestazione();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TEsclusi_application::crea_intestazione()
|
||||
{
|
||||
reset_header();
|
||||
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString sep(132);
|
||||
sep = "ELENCO ESCLUSI";
|
||||
TString tipo = _msk->get(F_TIPO);
|
||||
if ((tipo.ok()) && (tipo.not_empty()))
|
||||
{
|
||||
sep << " ";
|
||||
sep << tipo;
|
||||
}
|
||||
TDate data = _msk->get(F_DATA);
|
||||
if (data.ok())
|
||||
{
|
||||
sep << " termine fino al ";
|
||||
sep << data.string();
|
||||
}
|
||||
sep.center_just();
|
||||
set_header(2, "@0g%s", (const char*) sep);
|
||||
TString 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,"@0gCod.@7gC.@10gCognome e nome@36gNato il@47gTipo escl.@58gMotivo");
|
||||
set_header(5,"47gTermine");
|
||||
set_header(6,"@0g------@7g--@10g-------------------------@36g----------@47g----------@58g------------------------------");
|
||||
}
|
||||
}
|
||||
|
||||
bool TEsclusi_application::user_create()
|
||||
{
|
||||
_rel = new TRelation(LF_SOGGETTI);
|
||||
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
|
||||
_rel->add("LCP", "CODTAB==LOCALITA",1,0,ALIAS_LCP);
|
||||
_rel->add(LF_COMUNI, "COM==COM");
|
||||
// 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
|
||||
|
||||
_msk = new TMask("at2300a");
|
||||
_form_eti = new TEti_esclusi_form("AT_ETSOG");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TEsclusi_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_eti;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at2300(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TEsclusi_application a;
|
||||
|
||||
a.run(argc, argv, "Elenco esclusi");
|
||||
|
||||
return 0;
|
||||
}
|
31
at/at2300a.h
Executable file
31
at/at2300a.h
Executable file
@ -0,0 +1,31 @@
|
||||
// stampa elenco esclusi
|
||||
// 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_TIPO 301
|
||||
#define F_DATA 302
|
||||
|
||||
|
||||
#define F_ELENCO 401
|
||||
#define F_ETICHETTE 402
|
296
at/at2300a.uml
Executable file
296
at/at2300a.uml
Executable file
@ -0,0 +1,296 @@
|
||||
#include "at2300a.h"
|
||||
#include "lf.h"
|
||||
PAGE "Definizione Stampe" -1 -1 78 20
|
||||
|
||||
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 5
|
||||
BEGIN
|
||||
PROMPT 1 5 "Categorie"
|
||||
END
|
||||
|
||||
|
||||
STRING F_CAT1 2
|
||||
BEGIN
|
||||
PROMPT 2 6 ""
|
||||
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 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT2 2
|
||||
BEGIN
|
||||
PROMPT 2 7 ""
|
||||
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 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT3 2
|
||||
BEGIN
|
||||
PROMPT 2 8 ""
|
||||
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 8 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT4 2
|
||||
BEGIN
|
||||
PROMPT 40 6 ""
|
||||
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 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT5 2
|
||||
BEGIN
|
||||
PROMPT 40 7 ""
|
||||
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 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT6 2
|
||||
BEGIN
|
||||
PROMPT 40 8 ""
|
||||
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 8 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 3
|
||||
BEGIN
|
||||
PROMPT 1 10 "Tipo esclusione e termine"
|
||||
END
|
||||
|
||||
|
||||
LISTBOX F_TIPO 20
|
||||
BEGIN
|
||||
PROMPT 2 11 ""
|
||||
ITEM " | "
|
||||
MESSAGE CLEAR, F_DATA
|
||||
MESSAGE DISABLE, F_DATA
|
||||
ITEM "TI|Tempo indeterminato"
|
||||
MESSAGE CLEAR, F_DATA
|
||||
MESSAGE DISABLE, F_DATA
|
||||
ITEM "TD|Tempo determinato"
|
||||
MESSAGE ENABLE, F_DATA
|
||||
HELP "Tipo esclusione: vuoto = tutti"
|
||||
END
|
||||
|
||||
DATE F_DATA
|
||||
BEGIN
|
||||
PROMPT 30 11 "Termine "
|
||||
HELP "Termine esclusione: vuoto = tutti"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
PROMPT 1 13 "Stampa"
|
||||
END
|
||||
|
||||
BUTTON F_ELENCO 9 2
|
||||
BEGIN
|
||||
PROMPT -13 14 "Elenco"
|
||||
MESSAGE EXIT,F_ELENCO
|
||||
END
|
||||
|
||||
BUTTON F_ETICHETTE 9 2
|
||||
BEGIN
|
||||
PROMPT -23 14 "Etichette"
|
||||
MESSAGE EXIT,F_ETICHETTE
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -33 14 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
241
at/at2400.cpp
Executable file
241
at/at2400.cpp
Executable file
@ -0,0 +1,241 @@
|
||||
#include <mask.h>
|
||||
#include <printapp.h>
|
||||
#include <tabutil.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include <lffiles.h>
|
||||
#include "lf.h"
|
||||
#include "soggetti.h"
|
||||
#include "benem.h"
|
||||
|
||||
#include "at2.h"
|
||||
#include "at2400a.h"
|
||||
|
||||
class TBenem_application : public TPrintapp
|
||||
{
|
||||
static bool filter_func_benem(const TRelation *);
|
||||
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TLocalisamfile* _benem;
|
||||
TRecord_array* _sbenemerenze;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TDate _data_stampa;
|
||||
TString _codsez, _codsot;
|
||||
|
||||
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();
|
||||
|
||||
TMask& app_mask() { return *_msk; }
|
||||
TBenem_application() : _data_stampa(TODAY) {}
|
||||
};
|
||||
|
||||
HIDDEN inline TBenem_application& app() { return (TBenem_application&) main_app(); }
|
||||
|
||||
void TBenem_application::filtra_sezioni()
|
||||
{
|
||||
TString sezini = _msk->get(F_SEZINI);
|
||||
TString sotini = _msk->get(F_SOTINI);
|
||||
TString sezfin = _msk->get(F_SEZFIN);
|
||||
TString sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
|
||||
TRectype da(fl.curr());
|
||||
TRectype a(fl.curr());
|
||||
da.zero();
|
||||
a.zero();
|
||||
if ((sezini.not_empty()) && (sezini.ok()))
|
||||
da.put(SOG_CODSEZ, sezini);
|
||||
if ((sotini.not_empty()) && (sotini.ok()))
|
||||
da.put(SOG_CODSOT, sotini);
|
||||
if ((sezfin.not_empty()) && (sezfin.ok()))
|
||||
a.put(SOG_CODSEZ, sezfin);
|
||||
if ((sotfin.not_empty()) && (sotfin.ok()))
|
||||
a.put(SOG_CODSOT, sotfin);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
void TBenem_application::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_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@S", FLD(LF_SOGGETTI,SOG_TOTDON));
|
||||
|
||||
set_row(2,"@13g@S", FLD(LF_SOGGETTI,SOG_NOME));
|
||||
set_row(2,"@50g@ld", FLD(LF_SOGGETTI,SOG_DATAULTDON));
|
||||
}
|
||||
|
||||
bool TBenem_application::filter_func_benem(const TRelation* rel)
|
||||
{
|
||||
bool filtrato = TRUE;
|
||||
|
||||
TLocalisamfile* sog = &(rel->lfile(LF_SOGGETTI));
|
||||
|
||||
//filtro per categorie
|
||||
|
||||
TMask& msk = app().app_mask();
|
||||
TString catpri = msk.get(F_CAT1);
|
||||
TString catsec = msk.get(F_CAT2);
|
||||
TString catter = msk.get(F_CAT3);
|
||||
TString catqua = msk.get(F_CAT4);
|
||||
TString catqui = msk.get(F_CAT5);
|
||||
TString catses = msk.get(F_CAT6);
|
||||
|
||||
TAssoc_array categorie;
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
categorie.add((const char*) catpri);
|
||||
if (catsec.not_empty() && catsec.ok())
|
||||
categorie.add((const char*) catsec);
|
||||
if (catter.not_empty() && catter.ok())
|
||||
categorie.add((const char*) catter);
|
||||
if (catqua.not_empty() && catqua.ok())
|
||||
categorie.add((const char*) catqua);
|
||||
if (catqui.not_empty() && catqui.ok())
|
||||
categorie.add((const char*) catqui);
|
||||
if (catses.not_empty() && catses.ok())
|
||||
categorie.add((const char*) catses);
|
||||
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
TString cat = sog->curr().get(SOG_CATDON);
|
||||
if (categorie.is_key((const char*) cat))
|
||||
filtrato = TRUE;
|
||||
else
|
||||
filtrato = FALSE;
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TBenem_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
// salto pagina se cambio sezione
|
||||
TString codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
TString codsot = current_cursor()->curr().get(SOG_CODSOT);
|
||||
if ((_codsez!=codsez)||(_codsot!=codsot))
|
||||
{
|
||||
//if (!_codsez.blank())
|
||||
if (_codsez != "**")
|
||||
printer().formfeed();
|
||||
_codsez = codsez;
|
||||
_codsot = codsot;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int get_donbene(TString tipo)
|
||||
{
|
||||
int donbene = 0;
|
||||
TTable bnz("BNZ");
|
||||
bnz.put("CODTAB",tipo);
|
||||
if (bnz.read() == NOERR)
|
||||
donbene = bnz.get_int("I0");
|
||||
return donbene;
|
||||
|
||||
}
|
||||
bool TBenem_application::set_print(int)
|
||||
{
|
||||
KEY tasto;
|
||||
tasto = _msk->run();
|
||||
if (tasto == F_ELENCO)
|
||||
{
|
||||
//_codsez.spaces(2);
|
||||
//_codsot.spaces(2);
|
||||
_codsez = "**";
|
||||
_codsot = "**";
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
|
||||
TString tipoben = _msk->get(F_TIPOBEN);
|
||||
|
||||
filtra_sezioni();
|
||||
|
||||
int donbene = get_donbene(tipoben);
|
||||
|
||||
if (tipoben.not_empty() && tipoben.ok())
|
||||
current_cursor()->setfilter(format("TOTDON >= \"%i\"",donbene));
|
||||
else
|
||||
current_cursor()->setfilter(format("TOTDON >= \"%i\"",donbene));
|
||||
// current_cursor()->setfilter("ESCLUSO != \"\"");
|
||||
current_cursor()->set_filterfunction(filter_func_benem);
|
||||
crea_intestazione();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TBenem_application::crea_intestazione()
|
||||
{
|
||||
TString sep(132);
|
||||
TString data_stampa;
|
||||
|
||||
reset_header();
|
||||
|
||||
sep.fill('-');
|
||||
set_header(1, (const char *) sep);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
sep.right_just(132);
|
||||
set_header(2,(const char*) sep);
|
||||
|
||||
set_header(2,"@0gELENCO SOGGETTI CHE DEVONO RICEVERE LA BENEMERENZA xx@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.@10gC.@13gCognome@39gNato il@50gData esc.");
|
||||
set_header(6,"@13gNome@50gTipo esc.");
|
||||
set_header(7,"@0g---------@10g--@13g-------------------------@39g----------@50g--------");
|
||||
}
|
||||
|
||||
bool TBenem_application::user_create()
|
||||
{
|
||||
_rel = new TRelation(LF_SOGGETTI);
|
||||
//_rel->add(LF_BENEM, "CODICE==CODICE");
|
||||
_benem = new TLocalisamfile(LF_BENEM);
|
||||
_sbenemerenze = new TRecord_array(LF_BENEM,BEN_PROGBEN);
|
||||
|
||||
|
||||
_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
|
||||
|
||||
_msk = new TMask("at2400a");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TBenem_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _benem;
|
||||
delete _sbenemerenze;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at2400(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TBenem_application a;
|
||||
|
||||
a.run(argc, argv, "Elenco premiati");
|
||||
|
||||
return 0;
|
||||
}
|
31
at/at2400a.h
Executable file
31
at/at2400a.h
Executable file
@ -0,0 +1,31 @@
|
||||
// stampa benemerenze da assegnare
|
||||
// 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_TIPOBEN 301
|
||||
#define F_D_TIPOBEN 302
|
||||
|
||||
|
||||
#define F_ELENCO 401
|
||||
#define F_ETICHETTE 402
|
297
at/at2400a.uml
Executable file
297
at/at2400a.uml
Executable file
@ -0,0 +1,297 @@
|
||||
#include "at2400a.h"
|
||||
#include "lf.h"
|
||||
PAGE "Definizione Stampe" -1 -1 78 20
|
||||
|
||||
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 5
|
||||
BEGIN
|
||||
PROMPT 1 5 "Categorie"
|
||||
END
|
||||
|
||||
|
||||
STRING F_CAT1 2
|
||||
BEGIN
|
||||
PROMPT 2 6 ""
|
||||
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 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT2 2
|
||||
BEGIN
|
||||
PROMPT 2 7 ""
|
||||
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 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT3 2
|
||||
BEGIN
|
||||
PROMPT 2 8 ""
|
||||
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 8 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT4 2
|
||||
BEGIN
|
||||
PROMPT 40 6 ""
|
||||
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 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT5 2
|
||||
BEGIN
|
||||
PROMPT 40 7 ""
|
||||
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 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT6 2
|
||||
BEGIN
|
||||
PROMPT 40 8 ""
|
||||
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 8 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 3
|
||||
BEGIN
|
||||
PROMPT 1 10 "Tipo benemerenza"
|
||||
END
|
||||
|
||||
STRING F_TIPOBEN 2
|
||||
BEGIN
|
||||
PROMPT 2 11 "Benemerenza "
|
||||
FLAGS "U"
|
||||
USE BNZ
|
||||
INPUT CODTAB F_TIPOBEN
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@30" S0
|
||||
OUTPUT F_TIPOBEN CODTAB
|
||||
OUTPUT F_D_TIPOBEN S0
|
||||
CHECKTYPE REQUIRED
|
||||
VALIDATE NOT_EMPTY_FUNC
|
||||
WARNING "Codice non presente"
|
||||
HELP "Benemerenza assegnata"
|
||||
END
|
||||
|
||||
STRING F_D_TIPOBEN 25
|
||||
BEGIN
|
||||
PROMPT 26 11 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
PROMPT 1 13 "Stampa"
|
||||
END
|
||||
|
||||
BUTTON F_ELENCO 9 2
|
||||
BEGIN
|
||||
PROMPT -13 14 "Elenco"
|
||||
MESSAGE EXIT,F_ELENCO
|
||||
END
|
||||
|
||||
BUTTON F_ETICHETTE 9 2
|
||||
BEGIN
|
||||
PROMPT -23 14 "Etichette"
|
||||
MESSAGE EXIT,F_ETICHETTE
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -33 14 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
407
at/at2500.cpp
Executable file
407
at/at2500.cpp
Executable file
@ -0,0 +1,407 @@
|
||||
#include <mask.h>
|
||||
#include <form.h>
|
||||
#include <printapp.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "lf.h"
|
||||
#include "soggetti.h"
|
||||
#include "sezioni.h"
|
||||
|
||||
#include "at2.h"
|
||||
#include "at2500a.h"
|
||||
|
||||
#define ALIAS_LCP 100
|
||||
#define ALIAS_TCS 200
|
||||
|
||||
enum ts { undefined = 0, elenco = 1, etichette = 2 };
|
||||
|
||||
// definizione form per etichette
|
||||
class TEti_idonei_form : public TForm
|
||||
{
|
||||
public:
|
||||
|
||||
virtual TCursor* cursor() const;
|
||||
virtual TRelation* relation() const;
|
||||
TPrint_section& get_body() { return section('B'); } ;
|
||||
TEti_idonei_form(): TForm() {};
|
||||
TEti_idonei_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
|
||||
: TForm(form,code,editlevel,desc) {};
|
||||
virtual ~TEti_idonei_form() {};
|
||||
};
|
||||
|
||||
class TIdonei_application : public TPrintapp
|
||||
{
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TEti_idonei_form* _form_eti;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome;
|
||||
TDate _data_stampa;
|
||||
ts _tipo_stampa;
|
||||
TString _codsez, _codsot;
|
||||
|
||||
static bool filter_func_idonei(const TRelation *);
|
||||
|
||||
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(TString codsez, TString codsot);
|
||||
TMask& app_mask() { return *_msk; }
|
||||
TIdonei_application() : _data_stampa(TODAY), _cognome_nome("",25) {}
|
||||
};
|
||||
|
||||
HIDDEN inline TIdonei_application& app() { return (TIdonei_application&) 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()
|
||||
{
|
||||
TString sezini = _msk->get(F_SEZINI);
|
||||
TString sotini = _msk->get(F_SOTINI);
|
||||
TString sezfin = _msk->get(F_SEZFIN);
|
||||
TString sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
|
||||
TRectype da(fl.curr());
|
||||
TRectype a(fl.curr());
|
||||
da.zero();
|
||||
a.zero();
|
||||
if ((sezini.not_empty()) && (sezini.ok()))
|
||||
da.put(SOG_CODSEZ, sezini);
|
||||
if ((sotini.not_empty()) && (sotini.ok()))
|
||||
da.put(SOG_CODSOT, sotini);
|
||||
if ((sezfin.not_empty()) && (sezfin.ok()))
|
||||
a.put(SOG_CODSEZ, sezfin);
|
||||
if ((sotfin.not_empty()) && (sotfin.ok()))
|
||||
a.put(SOG_CODSOT, sotfin);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
void TIdonei_application::set_page(int file, int cnt)
|
||||
{
|
||||
// costruzione etichette
|
||||
switch (_tipo_stampa)
|
||||
{
|
||||
case etichette:
|
||||
{
|
||||
TPrint_section& corpo = _form_eti->get_body();
|
||||
corpo.reset();
|
||||
corpo.update();
|
||||
for (int i = 0; i < corpo.height(); i++)
|
||||
{
|
||||
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
|
||||
}
|
||||
break;
|
||||
case elenco:
|
||||
{
|
||||
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"######"));
|
||||
set_row(1,"@7g@S", FLD(LF_SOGGETTI,SOG_CATDON));
|
||||
set_row(1,"@10g#a", &_cognome_nome);
|
||||
set_row(1,"@36g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
|
||||
set_row(1,"@47g@ld", FLD(LF_SOGGETTI,SOG_DATAULTID)); // potremmo mettere anche datastato
|
||||
set_row(1,"@58g@S", FLD(LF_SOGGETTI,SOG_IDON1));
|
||||
set_row(1,"@61g@S", FLD(LF_SOGGETTI,SOG_IDON2));
|
||||
set_row(1,"@64g@S", FLD(LF_SOGGETTI,SOG_IDON3));
|
||||
set_row(1,"@67g@S", FLD(LF_SOGGETTI,SOG_IDON4));
|
||||
|
||||
set_row(2,"@50g@S", FLD(LF_SOGGETTI,SOG_STATO));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool TIdonei_application::filter_func_idonei(const TRelation * rel)
|
||||
{
|
||||
|
||||
bool filtrato = TRUE;
|
||||
|
||||
TLocalisamfile* sog = &(rel->lfile(LF_SOGGETTI));
|
||||
|
||||
TAssoc_array categorie;
|
||||
|
||||
TMask& msk = app().app_mask();
|
||||
|
||||
TString cat = msk.get(F_CAT1);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
cat = msk.get(F_CAT2);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
cat = msk.get(F_CAT3);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
cat = msk.get(F_CAT4);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
cat = msk.get(F_CAT5);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
cat = msk.get(F_CAT6);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
TString catsog = sog->curr().get(SOG_CATDON);
|
||||
if (categorie.is_key((const char*) catsog))
|
||||
filtrato = TRUE;
|
||||
else
|
||||
filtrato = FALSE;
|
||||
}
|
||||
if (filtrato)
|
||||
{
|
||||
TAssoc_array idoneita;
|
||||
TString idonsog = sog->curr().get(SOG_IDON1);
|
||||
if (idonsog.not_empty() && idonsog.ok())
|
||||
idoneita.add((const char*) idonsog);
|
||||
idonsog = sog->curr().get(SOG_IDON2);
|
||||
if (idonsog.not_empty() && idonsog.ok())
|
||||
idoneita.add((const char*) idonsog);
|
||||
idonsog = sog->curr().get(SOG_IDON3);
|
||||
if (idonsog.not_empty() && idonsog.ok())
|
||||
idoneita.add((const char*) idonsog);
|
||||
idonsog = sog->curr().get(SOG_IDON4);
|
||||
if (idonsog.not_empty() && idonsog.ok())
|
||||
idoneita.add((const char*) idonsog);
|
||||
if (idoneita.items() != 0)
|
||||
{
|
||||
TString idon = msk.get(F_IDON1);
|
||||
if (idon.not_empty() && idon.ok())
|
||||
if (idoneita.is_key((const char*) idon))
|
||||
filtrato = TRUE;
|
||||
else
|
||||
filtrato = FALSE;
|
||||
if (filtrato)
|
||||
{
|
||||
TString idon = msk.get(F_IDON2);
|
||||
if (idon.not_empty() && idon.ok())
|
||||
if (idoneita.is_key((const char*) idon))
|
||||
filtrato = TRUE;
|
||||
else
|
||||
filtrato = FALSE;
|
||||
}
|
||||
if (filtrato)
|
||||
{
|
||||
TString idon = msk.get(F_IDON3);
|
||||
if (idon.not_empty() && idon.ok())
|
||||
if (idoneita.is_key((const char*) idon))
|
||||
filtrato = TRUE;
|
||||
else
|
||||
filtrato = FALSE;
|
||||
}
|
||||
if (filtrato)
|
||||
{
|
||||
TString idon = msk.get(F_IDON4);
|
||||
if (idon.not_empty() && idon.ok())
|
||||
if (idoneita.is_key((const char*) idon))
|
||||
filtrato = TRUE;
|
||||
else
|
||||
filtrato = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TIdonei_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
|
||||
// salto pagina se cambio sezione
|
||||
TString codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
TString codsot = current_cursor()->curr().get(SOG_CODSOT);
|
||||
if ((_codsez!=codsez)||(_codsot!=codsot))
|
||||
{
|
||||
//if (!_codsez.blank())
|
||||
if (_codsez != "**")
|
||||
printer().formfeed();
|
||||
_codsez = codsez;
|
||||
_codsot = codsot;
|
||||
header_sezione(codsez, codsot);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void TIdonei_application::header_sezione(TString codsez, TString codsot)
|
||||
{
|
||||
TString densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
TString 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 TIdonei_application::set_print(int m)
|
||||
{
|
||||
_tipo_stampa = undefined;
|
||||
KEY tasto;
|
||||
tasto = _msk->run();
|
||||
switch (tasto)
|
||||
{
|
||||
case F_ELENCO:
|
||||
_tipo_stampa = elenco;
|
||||
//_codsez.spaces(2);
|
||||
//_codsot.spaces(2);
|
||||
_codsez = "**";
|
||||
_codsot = "**";
|
||||
break;
|
||||
case F_ETICHETTE:
|
||||
_tipo_stampa = etichette;
|
||||
break;
|
||||
}
|
||||
if (_tipo_stampa != undefined)
|
||||
{
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
|
||||
// filtro per sezioni selezionati
|
||||
filtra_sezioni();
|
||||
|
||||
// filtro per tipo idoneità
|
||||
TString tipoid = _msk->get(F_TIPO);
|
||||
if (tipoid.not_empty() && tipoid.ok())
|
||||
current_cursor()->setfilter(format("STATO == \"%s\"",(const char*)tipoid));
|
||||
else
|
||||
current_cursor()->setfilter("(TCS->S6 == \"I\") || (TCS->S6 == \"F\")", TRUE);
|
||||
|
||||
// filtro per categorie
|
||||
current_cursor()->set_filterfunction(filter_func_idonei);
|
||||
reset_print();
|
||||
crea_intestazione();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TIdonei_application::crea_intestazione()
|
||||
{
|
||||
reset_header();
|
||||
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString sep(132);
|
||||
sep = "ELENCO IDONEI";
|
||||
TString tipo = _msk->get(F_TIPO);
|
||||
if ((tipo.ok()) && (tipo.not_empty()))
|
||||
{
|
||||
sep << ": tipo ";
|
||||
sep << tipo;
|
||||
TString dtipo = _msk->get(F_D_TIPO);
|
||||
sep << " ";
|
||||
sep << dtipo;
|
||||
}
|
||||
TString idon = _msk->get(F_IDON1);
|
||||
if ((idon.ok()) && (idon.not_empty()))
|
||||
{
|
||||
sep << " per ";
|
||||
sep << idon;
|
||||
}
|
||||
idon = _msk->get(F_IDON2);
|
||||
if ((idon.ok()) && (idon.not_empty()))
|
||||
{
|
||||
sep << " ";
|
||||
sep << idon;
|
||||
}
|
||||
idon = _msk->get(F_IDON3);
|
||||
if ((idon.ok()) && (idon.not_empty()))
|
||||
{
|
||||
sep << " ";
|
||||
sep << idon;
|
||||
}
|
||||
idon = _msk->get(F_IDON4);
|
||||
if ((idon.ok()) && (idon.not_empty()))
|
||||
{
|
||||
sep << " ";
|
||||
sep << idon;
|
||||
}
|
||||
sep.center_just();
|
||||
set_header(2, "@0g%s", (const char*) sep);
|
||||
TString 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,"@0gCod.@7gC.@10gCognome e nome@36gNato il@47gData ID@58gTipi idon.");
|
||||
set_header(5,"@47gTipo/Esito");
|
||||
set_header(6,"@0g------@7g--@10g-------------------------@36g----------@47g----------@58g-- -- -- --");
|
||||
}
|
||||
}
|
||||
|
||||
bool TIdonei_application::user_create()
|
||||
{
|
||||
_rel = new TRelation(LF_SOGGETTI);
|
||||
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
|
||||
_rel->add("LCP", "CODTAB==LOCALITA",1,0,ALIAS_LCP);
|
||||
_rel->add(LF_COMUNI, "COM==COM");
|
||||
// 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
|
||||
|
||||
_msk = new TMask("at2500a");
|
||||
|
||||
_form_eti = new TEti_idonei_form("AT_ETSOG");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TIdonei_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_eti;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at2500(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TIdonei_application a;
|
||||
|
||||
a.run(argc, argv, "Elenco idonei");
|
||||
|
||||
return 0;
|
||||
}
|
381
at/at2500a.uml
Executable file
381
at/at2500a.uml
Executable file
@ -0,0 +1,381 @@
|
||||
#include "at2500a.h"
|
||||
#include "lf.h"
|
||||
PAGE "Definizione Stampe" -1 -1 78 20
|
||||
|
||||
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 5
|
||||
BEGIN
|
||||
PROMPT 1 5 "Categorie"
|
||||
END
|
||||
|
||||
|
||||
STRING F_CAT1 2
|
||||
BEGIN
|
||||
PROMPT 2 6 ""
|
||||
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 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT2 2
|
||||
BEGIN
|
||||
PROMPT 2 7 ""
|
||||
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 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT3 2
|
||||
BEGIN
|
||||
PROMPT 2 8 ""
|
||||
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 8 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT4 2
|
||||
BEGIN
|
||||
PROMPT 40 6 ""
|
||||
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 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT5 2
|
||||
BEGIN
|
||||
PROMPT 40 7 ""
|
||||
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 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT6 2
|
||||
BEGIN
|
||||
PROMPT 40 8 ""
|
||||
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 8 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 5
|
||||
BEGIN
|
||||
PROMPT 1 10 "Tipo/Esito e tipi idoneita'"
|
||||
END
|
||||
|
||||
STRING F_TIPO 2
|
||||
BEGIN
|
||||
PROMPT 2 11 "Tipo/Esito "
|
||||
FLAGS "U"
|
||||
USE TCS SELECT S6="I"
|
||||
INPUT CODTAB F_TIPO
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@30" S0
|
||||
OUTPUT F_TIPO CODTAB
|
||||
OUTPUT F_D_TIPO S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice non presente"
|
||||
HELP "Tipo idoneit…: vuoto = tutti"
|
||||
END
|
||||
|
||||
STRING F_D_TIPO 30
|
||||
BEGIN
|
||||
PROMPT 19 11 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
|
||||
STRING F_IDON1 2
|
||||
BEGIN
|
||||
PROMPT 2 12 "Tipi idon. "
|
||||
FLAGS "U"
|
||||
USE IDO
|
||||
INPUT CODTAB F_IDON1
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@30" S0
|
||||
OUTPUT F_IDON1 CODTAB
|
||||
OUTPUT F_D_IDON1 S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice non presente"
|
||||
HELP "Idoneita' alla donazione"
|
||||
END
|
||||
|
||||
STRING F_IDON2 2
|
||||
BEGIN
|
||||
PROMPT 2 13 " "
|
||||
FLAGS "U"
|
||||
USE IDO
|
||||
INPUT CODTAB F_IDON2
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@30" S0
|
||||
OUTPUT F_IDON2 CODTAB
|
||||
OUTPUT F_D_IDON2 S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice non presente"
|
||||
HELP "Idoneita' alla donazione"
|
||||
END
|
||||
|
||||
STRING F_IDON3 2
|
||||
BEGIN
|
||||
PROMPT 46 12 ""
|
||||
FLAGS "U"
|
||||
USE IDO
|
||||
INPUT CODTAB F_IDON3
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@30" S0
|
||||
OUTPUT F_IDON3 CODTAB
|
||||
OUTPUT F_D_IDON3 S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice non presente"
|
||||
HELP "Idoneita' alla donazione"
|
||||
END
|
||||
|
||||
STRING F_IDON4 2
|
||||
BEGIN
|
||||
PROMPT 46 13 ""
|
||||
FLAGS "U"
|
||||
USE IDO
|
||||
INPUT CODTAB F_IDON4
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@30" S0
|
||||
OUTPUT F_IDON4 CODTAB
|
||||
OUTPUT F_D_IDON4 S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice non presente"
|
||||
HELP "Idoneita' alla donazione"
|
||||
END
|
||||
|
||||
STRING F_D_IDON1 24
|
||||
BEGIN
|
||||
PROMPT 19 12 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_D_IDON2 24
|
||||
BEGIN
|
||||
PROMPT 19 13 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_D_IDON3 24
|
||||
BEGIN
|
||||
PROMPT 52 12 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_D_IDON4 24
|
||||
BEGIN
|
||||
PROMPT 52 13 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
PROMPT 1 15 "Stampa"
|
||||
END
|
||||
|
||||
BUTTON F_ELENCO 9 2
|
||||
BEGIN
|
||||
PROMPT -13 16 "Elenco"
|
||||
MESSAGE EXIT,F_ELENCO
|
||||
END
|
||||
|
||||
BUTTON F_ETICHETTE 9 2
|
||||
BEGIN
|
||||
PROMPT -23 16 "Etichette"
|
||||
MESSAGE EXIT,F_ETICHETTE
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -33 16 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
355
at/at2600.cpp
Executable file
355
at/at2600.cpp
Executable file
@ -0,0 +1,355 @@
|
||||
#include <mask.h>
|
||||
#include <form.h>
|
||||
#include <printapp.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "lf.h"
|
||||
#include "soggetti.h"
|
||||
#include "sezioni.h"
|
||||
|
||||
#include "at2.h"
|
||||
#include "at2600a.h"
|
||||
|
||||
#define ALIAS_LCP 100
|
||||
//#define ALIAS_TCS 200
|
||||
|
||||
#define ISCRITTI 'I'
|
||||
enum ts { undefined = 0, elenco = 1, etichette = 2 };
|
||||
|
||||
// definizione form per etichette
|
||||
class TEti_iscritti_form : public TForm
|
||||
{
|
||||
public:
|
||||
|
||||
virtual TCursor* cursor() const;
|
||||
virtual TRelation* relation() const;
|
||||
TPrint_section& get_body() { return section('B'); } ;
|
||||
TEti_iscritti_form(): TForm() {};
|
||||
TEti_iscritti_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
|
||||
: TForm(form,code,editlevel,desc) {};
|
||||
virtual ~TEti_iscritti_form() {};
|
||||
};
|
||||
|
||||
class TIscritti_application : public TPrintapp
|
||||
{
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TEti_iscritti_form* _form_eti;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome;
|
||||
TDate _data_stampa;
|
||||
ts _tipo_stampa;
|
||||
TString _codsez, _codsot;
|
||||
char _tipo_iscdim; // iscritti o dimessi
|
||||
TDate _dataini, _datafin;
|
||||
|
||||
static bool filter_func_iscritti(const TRelation *);
|
||||
|
||||
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(TString codsez, TString codsot);
|
||||
TMask& app_mask() { return *_msk; }
|
||||
TIscritti_application() : _data_stampa(TODAY), _cognome_nome("",25) {}
|
||||
};
|
||||
|
||||
HIDDEN inline TIscritti_application& app() { return (TIscritti_application&) 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()
|
||||
{
|
||||
TString sezini = _msk->get(F_SEZINI);
|
||||
TString sotini = _msk->get(F_SOTINI);
|
||||
TString sezfin = _msk->get(F_SEZFIN);
|
||||
TString sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
|
||||
TRectype da(fl.curr());
|
||||
TRectype a(fl.curr());
|
||||
da.zero();
|
||||
a.zero();
|
||||
if ((sezini.not_empty()) && (sezini.ok()))
|
||||
da.put(SOG_CODSEZ, sezini);
|
||||
if ((sotini.not_empty()) && (sotini.ok()))
|
||||
da.put(SOG_CODSOT, sotini);
|
||||
if ((sezfin.not_empty()) && (sezfin.ok()))
|
||||
a.put(SOG_CODSEZ, sezfin);
|
||||
if ((sotfin.not_empty()) && (sotfin.ok()))
|
||||
a.put(SOG_CODSOT, sotfin);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
void TIscritti_application::set_page(int file, int cnt)
|
||||
{
|
||||
// costruzione etichette
|
||||
switch (_tipo_stampa)
|
||||
{
|
||||
case etichette:
|
||||
{
|
||||
TPrint_section& corpo = _form_eti->get_body();
|
||||
corpo.reset();
|
||||
corpo.update();
|
||||
for (int i = 0; i < corpo.height(); i++)
|
||||
{
|
||||
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
|
||||
}
|
||||
break;
|
||||
case elenco:
|
||||
{
|
||||
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"######"));
|
||||
set_row(1,"@7g@S", FLD(LF_SOGGETTI,SOG_CATDON));
|
||||
set_row(1,"@10g#a", &_cognome_nome);
|
||||
set_row(1,"@36g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
|
||||
set_row(1,"@47g@ld", FLD(LF_SOGGETTI,SOG_DATAISC));
|
||||
set_row(1,"@58g@ld", FLD(LF_SOGGETTI,SOG_DATADIM));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool TIscritti_application::filter_func_iscritti(const TRelation * rel)
|
||||
{
|
||||
|
||||
bool filtrato = TRUE;
|
||||
|
||||
TLocalisamfile* sog = &(rel->lfile(LF_SOGGETTI));
|
||||
|
||||
TAssoc_array categorie;
|
||||
|
||||
TMask& msk = app().app_mask();
|
||||
|
||||
TString catpri = msk.get(F_CAT1);
|
||||
TString catsec = msk.get(F_CAT2);
|
||||
TString catter = msk.get(F_CAT3);
|
||||
TString catqua = msk.get(F_CAT4);
|
||||
TString catqui = msk.get(F_CAT5);
|
||||
TString catses = msk.get(F_CAT6);
|
||||
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
categorie.add((const char*) catpri);
|
||||
if (catsec.not_empty() && catsec.ok())
|
||||
categorie.add((const char*) catsec);
|
||||
if (catter.not_empty() && catter.ok())
|
||||
categorie.add((const char*) catter);
|
||||
if (catqua.not_empty() && catqua.ok())
|
||||
categorie.add((const char*) catqua);
|
||||
if (catqui.not_empty() && catqui.ok())
|
||||
categorie.add((const char*) catqui);
|
||||
if (catses.not_empty() && catses.ok())
|
||||
categorie.add((const char*) catses);
|
||||
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
TString cat = sog->curr().get(SOG_CATDON);
|
||||
if (categorie.is_key((const char*) cat))
|
||||
filtrato = TRUE;
|
||||
else
|
||||
filtrato = FALSE;
|
||||
}
|
||||
if (filtrato)
|
||||
{
|
||||
TRectype from (sog->curr());
|
||||
TRectype to (sog->curr());
|
||||
from.zero();
|
||||
to.zero();
|
||||
if (app()._tipo_iscdim == ISCRITTI)
|
||||
{
|
||||
from.put(SOG_DATAISC, app()._dataini);
|
||||
to.put(SOG_DATAISC, app()._datafin);
|
||||
if ((sog->curr() >= from) && (sog->curr() <= to))
|
||||
filtrato = TRUE;
|
||||
else
|
||||
filtrato = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
from.put(SOG_DATADIM, app()._dataini);
|
||||
to.put(SOG_DATADIM, app()._datafin);
|
||||
if ((sog->curr() >= from) && (sog->curr() <= to))
|
||||
filtrato = TRUE;
|
||||
else
|
||||
filtrato = FALSE;
|
||||
}
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TIscritti_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
|
||||
// salto pagina se cambio sezione
|
||||
TString codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
TString codsot = current_cursor()->curr().get(SOG_CODSOT);
|
||||
if ((_codsez!=codsez)||(_codsot!=codsot))
|
||||
{
|
||||
//if (!_codsez.blank())
|
||||
if (_codsez != "**")
|
||||
printer().formfeed();
|
||||
_codsez = codsez;
|
||||
_codsot = codsot;
|
||||
header_sezione(codsez, codsot);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void TIscritti_application::header_sezione(TString codsez, TString codsot)
|
||||
{
|
||||
TString densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
TString 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 TIscritti_application::set_print(int m)
|
||||
{
|
||||
_tipo_stampa = undefined;
|
||||
KEY tasto;
|
||||
tasto = _msk->run();
|
||||
switch (tasto)
|
||||
{
|
||||
case F_ELENCO:
|
||||
_tipo_stampa = elenco;
|
||||
//_codsez.spaces(2);
|
||||
//_codsot.spaces(2);
|
||||
_codsez = "**";
|
||||
_codsot = "**";
|
||||
break;
|
||||
case F_ETICHETTE:
|
||||
_tipo_stampa = etichette;
|
||||
break;
|
||||
}
|
||||
if (_tipo_stampa != undefined)
|
||||
{
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
|
||||
_tipo_iscdim = _msk->get(F_TIPO)[0];
|
||||
_dataini = _msk->get(F_DATAINI);
|
||||
_datafin = _msk->get(F_DATAFIN);
|
||||
// filtro per sezioni selezionati
|
||||
filtra_sezioni();
|
||||
|
||||
// filtro per categorie
|
||||
current_cursor()->set_filterfunction(filter_func_iscritti);
|
||||
reset_print();
|
||||
crea_intestazione();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TIscritti_application::crea_intestazione()
|
||||
{
|
||||
reset_header();
|
||||
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString sep(132);
|
||||
sep = "ELENCO ";
|
||||
if (_tipo_iscdim == ISCRITTI)
|
||||
sep << "ISCRITTI";
|
||||
else
|
||||
sep << "DIMESSI";
|
||||
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);
|
||||
TString 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,"@0gCod.@7gC.@10gCognome e nome@36gNato il@47gData isc.@58gData dim.");
|
||||
set_header(5,"@0g------@7g--@10g-------------------------@36g----------@47g----------@58g----------");
|
||||
}
|
||||
}
|
||||
|
||||
bool TIscritti_application::user_create()
|
||||
{
|
||||
_rel = new TRelation(LF_SOGGETTI);
|
||||
//_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
|
||||
_rel->add("LCP", "CODTAB==LOCALITA",1,0,ALIAS_LCP);
|
||||
_rel->add(LF_COMUNI, "COM==COM");
|
||||
// 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
|
||||
|
||||
_msk = new TMask("at2600a");
|
||||
|
||||
_form_eti = new TEti_iscritti_form("AT_ETSOG");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TIscritti_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_eti;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at2600(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TIscritti_application a;
|
||||
|
||||
a.run(argc, argv, "Elenco iscritti/dimessi");
|
||||
|
||||
return 0;
|
||||
}
|
31
at/at2600a.h
Executable file
31
at/at2600a.h
Executable file
@ -0,0 +1,31 @@
|
||||
// stampa elenco iscritti/dimessi
|
||||
// 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_TIPO 301 // iscritti o dimessi
|
||||
#define F_DATAINI 302
|
||||
#define F_DATAFIN 303
|
||||
|
||||
#define F_ELENCO 401
|
||||
#define F_ETICHETTE 402
|
295
at/at2600a.uml
Executable file
295
at/at2600a.uml
Executable file
@ -0,0 +1,295 @@
|
||||
#include "at2600a.h"
|
||||
#include "lf.h"
|
||||
PAGE "Definizione Stampe" -1 -1 78 20
|
||||
|
||||
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 5
|
||||
BEGIN
|
||||
PROMPT 1 5 "Categorie"
|
||||
END
|
||||
|
||||
|
||||
STRING F_CAT1 2
|
||||
BEGIN
|
||||
PROMPT 2 6 ""
|
||||
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 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT2 2
|
||||
BEGIN
|
||||
PROMPT 2 7 ""
|
||||
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 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT3 2
|
||||
BEGIN
|
||||
PROMPT 2 8 ""
|
||||
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 8 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT4 2
|
||||
BEGIN
|
||||
PROMPT 40 6 ""
|
||||
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 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT5 2
|
||||
BEGIN
|
||||
PROMPT 40 7 ""
|
||||
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 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT6 2
|
||||
BEGIN
|
||||
PROMPT 40 8 ""
|
||||
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 8 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
RADIOBUTTON F_TIPO 30
|
||||
BEGIN
|
||||
PROMPT 1 10 "Tipo stampa"
|
||||
FLAGS "Z"
|
||||
ITEM "I|Iscritti"
|
||||
ITEM "D|Dimessi"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 40 3
|
||||
BEGIN
|
||||
PROMPT 38 10 "Selezione date"
|
||||
END
|
||||
|
||||
DATE F_DATAINI
|
||||
BEGIN
|
||||
PROMPT 39 11 "Dal "
|
||||
HELP "Data iscrizione o dimissione iniziale"
|
||||
END
|
||||
|
||||
DATE F_DATAFIN
|
||||
BEGIN
|
||||
PROMPT 60 11 "Al "
|
||||
HELP "Data iscrizione o dimissione finale"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
PROMPT 1 13 "Stampa"
|
||||
END
|
||||
|
||||
BUTTON F_ELENCO 9 2
|
||||
BEGIN
|
||||
PROMPT -13 14 "Elenco"
|
||||
MESSAGE EXIT,F_ELENCO
|
||||
END
|
||||
|
||||
BUTTON F_ETICHETTE 9 2
|
||||
BEGIN
|
||||
PROMPT -23 14 "Etichette"
|
||||
MESSAGE EXIT,F_ETICHETTE
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -33 14 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
30
at/at3.cpp
Executable file
30
at/at3.cpp
Executable file
@ -0,0 +1,30 @@
|
||||
#include <xvt.h>
|
||||
|
||||
#include <checks.h>
|
||||
|
||||
#include "at3.h"
|
||||
|
||||
#define usage "Error - usage : %s -[0,1,2,3,4]"
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
int rt = 0 ;
|
||||
const int r = (argc > 1) ? atoi(&argv[1][1]) : -1;
|
||||
|
||||
switch (r)
|
||||
{
|
||||
case 0:
|
||||
rt = at3100(argc, argv); break;
|
||||
case 1:
|
||||
rt = at3200(argc, argv); break;
|
||||
case 2:
|
||||
rt = at3300(argc, argv); break;
|
||||
case 3:
|
||||
rt = at3400(argc, argv); break;
|
||||
case 4:
|
||||
rt = at3500(argc, argv); break;
|
||||
default:
|
||||
error_box(usage, argv[0]) ; rt = 1; break;
|
||||
}
|
||||
return rt;
|
||||
}
|
11
at/at3.h
Executable file
11
at/at3.h
Executable file
@ -0,0 +1,11 @@
|
||||
#ifndef __AT3_H
|
||||
#define __AT3_H
|
||||
|
||||
int at3100(int argc, char* argv[]); // convocazioni
|
||||
int at3200(int argc, char* argv[]); // tessere e pagine
|
||||
int at3300(int argc, char* argv[]); // urgenze
|
||||
int at3400(int argc, char* argv[]); // elenco soggetti modificati
|
||||
int at3500(int argc, char* argv[]); // scadenze di donazione
|
||||
|
||||
#endif // __AT3_H
|
||||
|
48
at/at3.url
Executable file
48
at/at3.url
Executable file
@ -0,0 +1,48 @@
|
||||
#define APPNAME AVIS
|
||||
#define QAPPNAME "AVIS"
|
||||
#define LIBDIR f:\xvt.403\win_x86\ptk\lib
|
||||
|
||||
#include <default.url>
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at3 -0
|
||||
* ---------------------------------------------------- */
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at1 -1
|
||||
* ---------------------------------------------------- */
|
||||
MENUBAR MENU_BAR(1)
|
||||
|
||||
MENU MENU_BAR(1)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at1 -2
|
||||
* ---------------------------------------------------- */
|
||||
|
||||
MENUBAR MENU_BAR(2)
|
||||
|
||||
MENU MENU_BAR(2)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at1 -3
|
||||
*
|
||||
* ----------------------------------------------------*/
|
||||
|
||||
MENUBAR MENU_BAR(3)
|
||||
|
||||
MENU MENU_BAR(3)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at1 -4
|
||||
* ---------------------------------------------------- */
|
||||
MENUBAR MENU_BAR(4)
|
||||
|
||||
MENU MENU_BAR(4)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
458
at/at3100.cpp
Executable file
458
at/at3100.cpp
Executable file
@ -0,0 +1,458 @@
|
||||
#include <mask.h>
|
||||
#include <msksheet.h>
|
||||
#include <form.h>
|
||||
#include <printapp.h>
|
||||
|
||||
#include "lf.h"
|
||||
#include "soggetti.h"
|
||||
#include "sezioni.h"
|
||||
|
||||
#include "at3.h"
|
||||
#include "at3100a.h"
|
||||
|
||||
|
||||
#define ALIAS_TABCTD 100 // alias tabella categorie donatori
|
||||
#define ALIAS_TABTCS 200 // alias tabella tipi/esiti controlli sanitari
|
||||
#define ALIAS_TABLCP 300 // alias tabella località postali
|
||||
|
||||
|
||||
#define STATO_IDONEO 'I' // IDONEITA'
|
||||
#define STATO_FINESO 'F' // FINE SOSPENSIONE
|
||||
|
||||
enum ts { undefined = 0, elenco = 1, etichette = 2, cartoline = 3 };
|
||||
|
||||
// definizione form per etichette e cartoline
|
||||
class TConv_form : public TForm
|
||||
{
|
||||
public:
|
||||
|
||||
virtual TCursor* cursor() const;
|
||||
virtual TRelation* relation() const;
|
||||
TPrint_section& get_body() { return section('B'); } ;
|
||||
TConv_form(): TForm() {};
|
||||
TConv_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
|
||||
: TForm(form,code,editlevel,desc) {};
|
||||
virtual ~TConv_form() {};
|
||||
};
|
||||
|
||||
class TConv_application : public TPrintapp
|
||||
{
|
||||
static bool filter_func_conv(const TRelation *);
|
||||
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TConv_form* _form_eti; // per etichette
|
||||
TConv_form* _form_car; // per cartoline
|
||||
|
||||
TAssoc_array* _asezioni; // array per controllare che non venga convocata
|
||||
// 2 volte la stessa sezione/sottogruppo
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TDate _data_stampa;
|
||||
|
||||
int _sez_corrente;
|
||||
ts _tipo_stampa;
|
||||
bool _intesta;
|
||||
|
||||
// completare con tutti i dati selezionabili
|
||||
TString _codsez, _codsot;
|
||||
TDate _dataconv;
|
||||
long _intmin, _intmax;
|
||||
|
||||
|
||||
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);
|
||||
|
||||
virtual TAssoc_array& get_array_sez() { return *_asezioni; }
|
||||
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);
|
||||
|
||||
public:
|
||||
void crea_intestazione();
|
||||
void filtra_sezione();
|
||||
void header_sezione();
|
||||
|
||||
TConv_application() : _data_stampa(TODAY) {}
|
||||
};
|
||||
|
||||
HIDDEN inline TConv_application& app() { return (TConv_application&) 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)
|
||||
{
|
||||
if (start == 1)
|
||||
s.destroy();
|
||||
for (int r=start; r<start+count; r++)
|
||||
TToken_string& row = s.row(r-1);
|
||||
}
|
||||
|
||||
void TConv_application::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));
|
||||
}
|
||||
break;
|
||||
case etichette:
|
||||
{
|
||||
TPrint_section& corpo = _form_eti->get_body();
|
||||
corpo.reset();
|
||||
corpo.update();
|
||||
for (int i = 0; i < corpo.items(); i++)
|
||||
{
|
||||
TPrintrow& riga = corpo.row(i);
|
||||
set_row(i+1,"%s",riga.row());
|
||||
}
|
||||
force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage
|
||||
// altrimenti stampa sempre la stessa etichetta
|
||||
}
|
||||
break;
|
||||
case cartoline:
|
||||
{
|
||||
TPrint_section& corpo = _form_car->get_body();
|
||||
corpo.reset();
|
||||
corpo.update();
|
||||
for (int i = 0; i < corpo.items(); i++)
|
||||
{
|
||||
TPrintrow& riga = corpo.row(i);
|
||||
set_row(i+1,"%s",riga.row());
|
||||
}
|
||||
force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage
|
||||
// altrimenti stampa sempre la stessa etichetta
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool TConv_application::filter_func_conv (const TRelation * rel)
|
||||
{
|
||||
TLocalisamfile& sog = rel->lfile(LF_SOGGETTI);
|
||||
TDate dataprossi = sog.curr().get_date(SOG_DATAPROSSI);
|
||||
|
||||
const char stato = rel->curr(-ALIAS_TABTCS).get_char("S6");
|
||||
const bool dimesso = rel->curr(-ALIAS_TABCTD).get_char("B0");
|
||||
|
||||
|
||||
//TDate dataultconv = sog.curr().get_date(SOG_DATAULTCONV);
|
||||
if (dataprossi.ok())
|
||||
{
|
||||
// intervallo tra data convocazione e data calcolata per pross. si
|
||||
long intconvsi = app()._dataconv - dataprossi;
|
||||
// intervallo tra data convocazione e data ultima convocazione
|
||||
//long intultconvsi = app()._data - dataultconv;
|
||||
|
||||
if ((intconvsi >= 0) && (intconvsi < app()._intmax) && ((stato == STATO_IDONEO) || (stato == STATO_FINESO)) && (dimesso != 'X'))
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
// non ha la data di prossima donazione SI
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool TConv_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
if ((_tipo_stampa == elenco) && (!_intesta))
|
||||
{
|
||||
_intesta = TRUE;
|
||||
header_sezione();
|
||||
}
|
||||
// contatore soggetti stampati
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void TConv_application::print()
|
||||
{
|
||||
_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
|
||||
TString _giorno = row.get();
|
||||
_intmin = row.get_int();
|
||||
_intmax = row.get_int();
|
||||
// deve diventare un membro
|
||||
TString _tipoconv = row.get();
|
||||
|
||||
select_cursor(_cur4);
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
|
||||
TRectype da(fl.curr());
|
||||
TRectype a(fl.curr());
|
||||
da.zero();
|
||||
a.zero('Z');
|
||||
if ((_codsez.not_empty()) && (_codsez.ok()))
|
||||
{
|
||||
da.put(SOG_CODSEZ, _codsez);
|
||||
a.put(SOG_CODSEZ, _codsez);
|
||||
}
|
||||
if ((_codsot.not_empty()) && (_codsot.ok()))
|
||||
{
|
||||
da.put(SOG_CODSOT, _codsot);
|
||||
a.put(SOG_CODSOT, _codsot);
|
||||
}
|
||||
current_cursor()->freeze(FALSE);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
bool TConv_application::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);
|
||||
TString codice = row.get(0);
|
||||
TString codsot = row.get();
|
||||
codice << codsot;
|
||||
if (codice.not_empty())
|
||||
_asezioni->add(codice);
|
||||
}
|
||||
_tipo_stampa = undefined;
|
||||
KEY tasto;
|
||||
tasto = _msk->run();
|
||||
switch (tasto)
|
||||
{
|
||||
case F_ELENCO:
|
||||
_tipo_stampa = elenco;
|
||||
break;
|
||||
case F_ETICHETTE:
|
||||
_tipo_stampa = etichette;
|
||||
break;
|
||||
case F_CARTOLINE:
|
||||
_tipo_stampa = cartoline;
|
||||
break;
|
||||
case K_ESC:
|
||||
_msk->reset();
|
||||
}
|
||||
if (_tipo_stampa != undefined)
|
||||
{
|
||||
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);
|
||||
}
|
||||
// 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!
|
||||
//current_cursor()->setfilter("((ESCLUSO == \"\") && (-100->B0!=\"X\") && ((-200->S6 == \"I\") || (-200->S6 == \"F\")))", TRUE);
|
||||
// filtro su non esclusi
|
||||
current_cursor()->setfilter("(ESCLUSO == \"\")", TRUE);
|
||||
// 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;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TConv_application::crea_intestazione()
|
||||
{
|
||||
|
||||
reset_header();
|
||||
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString sep(132);
|
||||
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-----");
|
||||
}
|
||||
}
|
||||
|
||||
void TConv_application::header_sezione()
|
||||
{
|
||||
TString densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
TString 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);
|
||||
TString 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()
|
||||
{
|
||||
_rel = new TRelation(LF_SOGGETTI);
|
||||
_rel->add("TCS", "CODTAB==STATO", 1, 0, ALIAS_TABTCS); // per verificare che sia IDONEO
|
||||
_rel->add("CTD", "CODTAB==CATDON", 1, 0, ALIAS_TABCTD); // per verificare che sia DONATORE NON DIMESSO
|
||||
_rel->add("LCP", "CODTAB==LOCALITA", 1, 0, ALIAS_TABLCP); // per verificare che sia DONATORE NON DIMESSO
|
||||
_rel->add(LF_COMUNI, "COM==COM");
|
||||
_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
|
||||
|
||||
_msk = new TMask("at3100a");
|
||||
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");
|
||||
|
||||
_asezioni = new TAssoc_array();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TConv_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_eti;
|
||||
delete _form_car;
|
||||
delete _asezioni;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TConv_application::check_sez_sheet(const char* codice)
|
||||
{
|
||||
TAssoc_array& array_sez = app().get_array_sez();
|
||||
if (array_sez.is_key(codice))
|
||||
return FALSE;
|
||||
else
|
||||
{
|
||||
array_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);
|
||||
TString codice = row.get(0);
|
||||
TString codsot = row.get();
|
||||
codice << codsot;
|
||||
if (codice.not_empty())
|
||||
{
|
||||
TAssoc_array& array_sez = app().get_array_sez();
|
||||
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);
|
||||
TString codice = row.get(0);
|
||||
TString 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 at3100(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TConv_application a;
|
||||
|
||||
a.run(argc, argv, "Convocazioni");
|
||||
|
||||
return 0;
|
||||
}
|
18
at/at3100a.h
Executable file
18
at/at3100a.h
Executable file
@ -0,0 +1,18 @@
|
||||
// convocazioni
|
||||
// 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
|
||||
|
173
at/at3100a.uml
Executable file
173
at/at3100a.uml
Executable file
@ -0,0 +1,173 @@
|
||||
#include "at3100a.h"
|
||||
#include "lf.h"
|
||||
PAGE "Definizione Stampe" -1 -1 78 20
|
||||
|
||||
GROUPBOX DLG_NULL 77 12
|
||||
BEGIN
|
||||
PROMPT 1 1 "Selezioni per la convocazione"
|
||||
END
|
||||
|
||||
SPREADSHEET F_CONVOCAZIONI 75 10
|
||||
BEGIN
|
||||
PROMPT 2 2 ""
|
||||
ITEM "Sez."
|
||||
ITEM "Sot."
|
||||
ITEM "Data@10"
|
||||
ITEM "Giorno@15"
|
||||
ITEM "Int.min"
|
||||
ITEM "Int.max"
|
||||
ITEM "Tipo@15"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
PROMPT 1 13 "Stampa"
|
||||
END
|
||||
|
||||
BUTTON F_ELENCO 9 2
|
||||
BEGIN
|
||||
PROMPT -15 14 "Elenco"
|
||||
MESSAGE EXIT,F_ELENCO
|
||||
END
|
||||
|
||||
BUTTON F_ETICHETTE 9 2
|
||||
BEGIN
|
||||
PROMPT -25 14 "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 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -55 14 ""
|
||||
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 SEARCH
|
||||
HELP "Denominazione sezione di appartenenza"
|
||||
END
|
||||
|
||||
|
||||
STRING F_C_CODSOT 2
|
||||
BEGIN
|
||||
PROMPT 2 2 "Sottog. "
|
||||
COPY ALL F_C_CODSEZ
|
||||
CHECKTYPE REQUIRED
|
||||
HELP "Codice sottogruppo di appartenenza"
|
||||
END
|
||||
|
||||
STRING F_C_DENSOT 25
|
||||
BEGIN
|
||||
PROMPT 16 2 ""
|
||||
FLAGS "U"
|
||||
COPY ALL F_C_DENSEZ
|
||||
CHECKTYPE SEARCH
|
||||
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
|
218
at/at3200.cpp
Executable file
218
at/at3200.cpp
Executable file
@ -0,0 +1,218 @@
|
||||
#include <mask.h>
|
||||
#include <form.h>
|
||||
#include <printapp.h>
|
||||
|
||||
#include "lf.h"
|
||||
#include "soggetti.h"
|
||||
#include "sezioni.h"
|
||||
#include <comuni.h>
|
||||
|
||||
#include "at3.h"
|
||||
#include "at3200a.h"
|
||||
|
||||
#define ALIAS_COMRES 100
|
||||
#define ALIAS_COMNAS 200
|
||||
|
||||
enum ts { undefined = 0, tessere = 1, pagine = 2 };
|
||||
|
||||
// definizione form per pagine anagrafiche
|
||||
class TTessere_form : public TForm
|
||||
{
|
||||
public:
|
||||
|
||||
virtual TCursor* cursor() const;
|
||||
virtual TRelation* relation() const;
|
||||
TPrint_section& get_body() { return section('B'); } ;
|
||||
TTessere_form(): TForm() {};
|
||||
TTessere_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
|
||||
: TForm(form,code,editlevel,desc) {};
|
||||
virtual ~TTessere_form() {};
|
||||
};
|
||||
|
||||
class TTessere_application : public TPrintapp
|
||||
{
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TTessere_form* _form_pag;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TDate _data_stampa;
|
||||
ts _tipo_stampa;
|
||||
TString _riepilogodon;
|
||||
|
||||
static bool filter_func_tessere(const TRelation *);
|
||||
|
||||
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();
|
||||
TMask& app_mask() { return *_msk; }
|
||||
TTessere_application() : _data_stampa(TODAY), _riepilogodon(50) {}
|
||||
};
|
||||
|
||||
HIDDEN inline TTessere_application& app() { return (TTessere_application&) main_app(); }
|
||||
|
||||
TCursor* TTessere_form::cursor() const { return app().current_cursor(); }
|
||||
|
||||
TRelation* TTessere_form::relation() const { return cursor()->relation(); }
|
||||
|
||||
void TTessere_application::set_page(int file, int cnt)
|
||||
{
|
||||
// costruzione pagine
|
||||
switch (_tipo_stampa)
|
||||
{
|
||||
case pagine:
|
||||
{
|
||||
TPrint_section& corpo = _form_pag->get_body();
|
||||
corpo.reset();
|
||||
corpo.update();
|
||||
for (int i = 0; i < corpo.items(); i++)
|
||||
{
|
||||
TPrintrow& riga = corpo.row(i);
|
||||
set_row(i+1,"%s",riga.row());
|
||||
}
|
||||
force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage
|
||||
// altrimenti stampa sempre la stessa etichetta
|
||||
}
|
||||
break;
|
||||
case tessere:
|
||||
{
|
||||
TString data_stampa = _data_stampa.string();
|
||||
set_row(3, "@30g@S", FLD(LF_SEZIONI,SEZ_DENSEZ));
|
||||
set_row(4, "@30g@S", FLD(LF_SEZIONI,SEZ_DENSOT));
|
||||
set_row(9,"@33g%s@1j@pn", "Cod. prov.",FLD(LF_SOGGETTI,SOG_CODICE,"#########"));
|
||||
set_row(12,"@37g@10ls", FLD(LF_SOGGETTI,SOG_TESSAVIS));
|
||||
set_row(14,"@45g%10s", (const char*) data_stampa);
|
||||
set_row(16,"@8g@ls@1j@ls", FLD(LF_SOGGETTI,SOG_COGNOME), FLD(LF_SOGGETTI,SOG_NOME));
|
||||
set_row(18,"@8g@ls@1j@2s", FLD(-ALIAS_COMNAS,COM_DENCOM),FLD(-ALIAS_COMNAS,COM_PROVCOM));
|
||||
set_row(18,"@45g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
|
||||
set_row(20,"@10g@ls@1j@2s",FLD(-ALIAS_COMRES,COM_DENCOM),FLD(-ALIAS_COMRES,COM_PROVCOM));
|
||||
set_row(20,"@45g@15ls", FLD(LF_SOGGETTI,SOG_TELABI));
|
||||
set_row(22,"@2g@50ls", FLD(LF_SOGGETTI,SOG_INDIRIZZO));
|
||||
set_row(24,"@10g@16ls", FLD(LF_SOGGETTI,SOG_CF));
|
||||
set_row(28,"@4g@4ls", FLD(LF_SOGGETTI,SOG_GRUPPOAB0));
|
||||
set_row(28,"@17g@3ls", FLD(LF_SOGGETTI,SOG_RHANTID));
|
||||
set_row(28,"@30g@6ls", FLD(LF_SOGGETTI,SOG_FENOTIPORH));
|
||||
set_row(28,"@48g@3ls", FLD(LF_SOGGETTI,SOG_KELL));
|
||||
set_row(28,"@58g@3ls", FLD(LF_SOGGETTI,SOG_DU));
|
||||
set_row(32,"@4g@20ls", FLD(LF_SOGGETTI,SOG_DOCID));
|
||||
set_row(41,"@4g#t", &_riepilogodon);
|
||||
set_row(72,"");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool TTessere_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
int totdon = current_cursor()->curr(LF_SOGGETTI).get_int(SOG_TOTDON);
|
||||
TDate dataultima = current_cursor()->curr(LF_SOGGETTI).get(SOG_DATAULTDON);
|
||||
|
||||
_riepilogodon = "";
|
||||
if (totdon != 0)
|
||||
{
|
||||
_riepilogodon = "Donazioni effettuate fino al ";
|
||||
_riepilogodon << dataultima.string();
|
||||
_riepilogodon << " n.ro ";
|
||||
_riepilogodon << totdon;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TTessere_application::set_print(int m)
|
||||
{
|
||||
_tipo_stampa = undefined;
|
||||
KEY tasto;
|
||||
tasto = _msk->run();
|
||||
switch (tasto)
|
||||
{
|
||||
case F_TESSERE:
|
||||
_tipo_stampa = tessere;
|
||||
break;
|
||||
case F_PAGINE:
|
||||
_tipo_stampa = pagine;
|
||||
break;
|
||||
}
|
||||
if (_tipo_stampa != undefined)
|
||||
{
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
|
||||
reset_print();
|
||||
crea_intestazione();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TTessere_application::crea_intestazione()
|
||||
{
|
||||
TString sep(132);
|
||||
TString data_stampa;
|
||||
|
||||
reset_header();
|
||||
|
||||
if (_tipo_stampa == pagine)
|
||||
{
|
||||
sep.fill('-');
|
||||
set_header(1, (const char *) sep);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
sep.right_just(132);
|
||||
set_header(2,(const char*) sep);
|
||||
|
||||
set_header(2,"@0gSTAMPA PAGINE ANAGRAFICHE@64gDATA");
|
||||
data_stampa = _data_stampa.string();
|
||||
set_header(2,"@69g%10s", (const char*) data_stampa);
|
||||
|
||||
sep = "";
|
||||
sep.fill('-');
|
||||
set_header(3, (const char *) sep);
|
||||
}
|
||||
}
|
||||
|
||||
bool TTessere_application::user_create()
|
||||
{
|
||||
_rel = new TRelation(LF_SOGGETTI);
|
||||
_rel->add(LF_COMUNI, "COM==COMNASC",1,0,ALIAS_COMNAS);
|
||||
_rel->add(LF_COMUNI, "COM==COM",1,0,ALIAS_COMRES);
|
||||
_rel->add("LCP", "CODTAB==LOCALITA");
|
||||
_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
|
||||
|
||||
_msk = new TMask("at3200a");
|
||||
|
||||
_form_pag = new TTessere_form("AT_PAGIN"); // dovrà esserci PAGINE
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TTessere_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_pag;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at3200(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TTessere_application a;
|
||||
|
||||
a.run(argc, argv, "Stampa tessere e pagine");
|
||||
|
||||
return 0;
|
||||
}
|
8
at/at3200a.h
Executable file
8
at/at3200a.h
Executable file
@ -0,0 +1,8 @@
|
||||
// stampa tessere associative e pagine anagrafiche
|
||||
// definizione campi per maschera di selezione
|
||||
|
||||
#define F_CODINI 101
|
||||
#define F_CODFIN 102
|
||||
|
||||
#define F_TESSERE 401
|
||||
#define F_PAGINE 402
|
44
at/at3200a.uml
Executable file
44
at/at3200a.uml
Executable file
@ -0,0 +1,44 @@
|
||||
#include "at3200a.h"
|
||||
#include "lf.h"
|
||||
PAGE "Definizione Stampe" -1 -1 78 20
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
PROMPT 1 1 "Selezione codici"
|
||||
END
|
||||
|
||||
NUMBER F_CODINI 6
|
||||
BEGIN
|
||||
PROMPT 2 2 "Iniziale "
|
||||
END
|
||||
|
||||
NUMBER F_CODFIN 6
|
||||
BEGIN
|
||||
PROMPT 40 2 "Finale "
|
||||
END
|
||||
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
PROMPT 1 16 "Stampa"
|
||||
END
|
||||
|
||||
BUTTON F_TESSERE 9 2
|
||||
BEGIN
|
||||
PROMPT -13 17 "Tessere"
|
||||
MESSAGE EXIT,F_TESSERE
|
||||
END
|
||||
|
||||
BUTTON F_PAGINE 9 2
|
||||
BEGIN
|
||||
PROMPT -23 17 "Pagine"
|
||||
MESSAGE EXIT,F_PAGINE
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -33 17 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
373
at/at3300.cpp
Executable file
373
at/at3300.cpp
Executable file
@ -0,0 +1,373 @@
|
||||
#include <mask.h>
|
||||
#include <form.h>
|
||||
#include <printapp.h>
|
||||
|
||||
#include "lf.h"
|
||||
#include "soggetti.h"
|
||||
#include "sezioni.h"
|
||||
#include <comuni.h>
|
||||
|
||||
#include "at3.h"
|
||||
#include "at3300a.h"
|
||||
|
||||
#define ALIAS_LCP 100
|
||||
#define ALIAS_TCS 200
|
||||
|
||||
enum ts { undefined = 0, elenco = 1, etichette = 2 };
|
||||
|
||||
// definizione form per etichette
|
||||
class TUrgenze_form : public TForm
|
||||
{
|
||||
public:
|
||||
|
||||
virtual TCursor* cursor() const;
|
||||
virtual TRelation* relation() const;
|
||||
TPrint_section& get_body() { return section('B'); } ;
|
||||
TUrgenze_form(): TForm() {};
|
||||
TUrgenze_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
|
||||
: TForm(form,code,editlevel,desc) {};
|
||||
virtual ~TUrgenze_form() {};
|
||||
};
|
||||
|
||||
class TUrgenze_application : public TPrintapp
|
||||
{
|
||||
static bool filter_func_urgenze(const TRelation *);
|
||||
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TUrgenze_form* _form_eti;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome, _dencom;
|
||||
|
||||
TDate _data_stampa;
|
||||
TDate _dataini, _datafin;
|
||||
ts _tipo_stampa;
|
||||
TString _codsez, _codsot;
|
||||
|
||||
|
||||
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(TString codsez, TString codsot);
|
||||
TMask& app_mask() { return *_msk; }
|
||||
|
||||
TUrgenze_application() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {}
|
||||
};
|
||||
|
||||
HIDDEN inline TUrgenze_application& app() { return (TUrgenze_application&) main_app(); }
|
||||
|
||||
TCursor* TUrgenze_form::cursor() const { return app().current_cursor(); }
|
||||
|
||||
TRelation* TUrgenze_form::relation() const { return cursor()->relation(); }
|
||||
|
||||
void TUrgenze_application::filtra_sezioni()
|
||||
{
|
||||
TString sezini = _msk->get(F_SEZINI);
|
||||
TString sotini = _msk->get(F_SOTINI);
|
||||
TString sezfin = _msk->get(F_SEZFIN);
|
||||
TString sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
|
||||
TRectype da(fl.curr());
|
||||
TRectype a(fl.curr());
|
||||
da.zero();
|
||||
a.zero();
|
||||
if ((sezini.not_empty()) && (sezini.ok()))
|
||||
da.put(SOG_CODSEZ, sezini);
|
||||
if ((sotini.not_empty()) && (sotini.ok()))
|
||||
da.put(SOG_CODSOT, sotini);
|
||||
if ((sezfin.not_empty()) && (sezfin.ok()))
|
||||
a.put(SOG_CODSEZ, sezfin);
|
||||
if ((sotfin.not_empty()) && (sotfin.ok()))
|
||||
a.put(SOG_CODSOT, sotfin);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
void TUrgenze_application::set_page(int file, int cnt)
|
||||
{
|
||||
switch (_tipo_stampa)
|
||||
{
|
||||
case etichette:
|
||||
{
|
||||
TPrint_section& corpo = _form_eti->get_body();
|
||||
corpo.reset();
|
||||
corpo.update();
|
||||
for (int i = 0; i < corpo.height(); i++)
|
||||
{
|
||||
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
|
||||
}
|
||||
break;
|
||||
case elenco:
|
||||
{
|
||||
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"######"));
|
||||
set_row(1,"@7g@S", FLD(LF_SOGGETTI,SOG_CATDON));
|
||||
set_row(1,"@10g#a", &_cognome_nome);
|
||||
set_row(1,"@36g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
|
||||
set_row(1,"@47g@S", FLD(LF_SOGGETTI,SOG_INDIRIZZO));
|
||||
set_row(1,"@98g@S", FLD(LF_SOGGETTI,SOG_TELABI));
|
||||
set_row(1,"@114g@S", FLD(LF_SOGGETTI,SOG_TELLAV));
|
||||
set_row(2,"@47g#a", &_dencom);
|
||||
set_row(2,"@114g@S", FLD(LF_SOGGETTI,SOG_TELALT));
|
||||
set_row(2,"@36g@ld", FLD(LF_SOGGETTI,SOG_DATAULTDON));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool TUrgenze_application::filter_func_urgenze(const TRelation * rel)
|
||||
{
|
||||
bool filtrato = TRUE;
|
||||
|
||||
TLocalisamfile* sog = &(rel->lfile(LF_SOGGETTI));
|
||||
|
||||
//filtro per categorie
|
||||
|
||||
TMask& msk = app().app_mask();
|
||||
TString catpri = msk.get(F_CAT1);
|
||||
TString catsec = msk.get(F_CAT2);
|
||||
TString catter = msk.get(F_CAT3);
|
||||
TString catqua = msk.get(F_CAT4);
|
||||
TString catqui = msk.get(F_CAT5);
|
||||
TString catses = msk.get(F_CAT6);
|
||||
|
||||
TAssoc_array categorie;
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
categorie.add((const char*) catpri);
|
||||
if (catsec.not_empty() && catsec.ok())
|
||||
categorie.add((const char*) catsec);
|
||||
if (catter.not_empty() && catter.ok())
|
||||
categorie.add((const char*) catter);
|
||||
if (catqua.not_empty() && catqua.ok())
|
||||
categorie.add((const char*) catqua);
|
||||
if (catqui.not_empty() && catqui.ok())
|
||||
categorie.add((const char*) catqui);
|
||||
if (catses.not_empty() && catses.ok())
|
||||
categorie.add((const char*) catses);
|
||||
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
TString cat = sog->curr().get(SOG_CATDON);
|
||||
if (categorie.is_key((const char*) cat))
|
||||
filtrato = TRUE;
|
||||
else
|
||||
filtrato = FALSE;
|
||||
}
|
||||
TRectype from (sog->curr());
|
||||
if (filtrato)
|
||||
{
|
||||
// filtro per tipizzazione
|
||||
from.zero();
|
||||
TString gruppoab0 = msk.get(F_GRUPPOAB0);
|
||||
TString rhantid = msk.get(F_RHANTID);
|
||||
TString kell = msk.get(F_KELL);
|
||||
TString fenotiporh = msk.get(F_FENOTIPORH);
|
||||
TString du = msk.get(F_DU);
|
||||
|
||||
if ((gruppoab0.ok()) && (gruppoab0.not_empty()))
|
||||
from.put(SOG_GRUPPOAB0, gruppoab0);
|
||||
if ((rhantid.ok()) && (rhantid.not_empty()))
|
||||
from.put(SOG_RHANTID, rhantid);
|
||||
if ((kell.ok()) && (kell.not_empty()))
|
||||
from.put(SOG_KELL, kell);
|
||||
if ((fenotiporh.ok()) && (fenotiporh.not_empty()))
|
||||
from.put(SOG_FENOTIPORH, fenotiporh);
|
||||
if ((du.ok()) && (du.not_empty()))
|
||||
from.put(SOG_DU, du);
|
||||
if (sog->curr()==from)
|
||||
filtrato = TRUE;
|
||||
else
|
||||
filtrato = FALSE;
|
||||
}
|
||||
// filtro su data donazione
|
||||
if (filtrato)
|
||||
{
|
||||
long giorni = msk.get_long(F_GIORNI);
|
||||
long giorni_sez = rel->lfile(LF_SEZIONI).curr().get_long(SEZ_INTMINCONV);
|
||||
|
||||
giorni = (giorni_sez > giorni) ? giorni_sez : giorni;
|
||||
from.zero();
|
||||
TDate data(TODAY);
|
||||
data = data - (const long) giorni;
|
||||
from.put(SOG_DATAULTDON, data);
|
||||
if ((sog->curr()<= from))
|
||||
filtrato = TRUE;
|
||||
else
|
||||
filtrato = FALSE;
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TUrgenze_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
TString 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
|
||||
TString codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
TString codsot = current_cursor()->curr().get(SOG_CODSOT);
|
||||
if ((_codsez!=codsez)||(_codsot!=codsot))
|
||||
{
|
||||
//if (!_codsez.blank())
|
||||
if (_codsez != "**")
|
||||
printer().formfeed();
|
||||
_codsez = codsez;
|
||||
_codsot = codsot;
|
||||
header_sezione(codsez, codsot);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void TUrgenze_application::header_sezione(TString codsez, TString codsot)
|
||||
{
|
||||
TString densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
TString 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 TUrgenze_application::set_print(int)
|
||||
{
|
||||
_tipo_stampa = undefined;
|
||||
KEY tasto;
|
||||
tasto = _msk->run();
|
||||
switch (tasto)
|
||||
{
|
||||
case F_ELENCO:
|
||||
_tipo_stampa = elenco;
|
||||
//_codsez.spaces(2);
|
||||
//_codsot.spaces(2);
|
||||
_codsez = "**";
|
||||
_codsot = "**";
|
||||
break;
|
||||
case F_ETICHETTE:
|
||||
_tipo_stampa = etichette;
|
||||
break;
|
||||
}
|
||||
if (_tipo_stampa != undefined)
|
||||
{
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
filtra_sezioni();
|
||||
|
||||
// filtra solo idonei
|
||||
current_cursor()->setfilter("TCS->S6 == \"I\"", TRUE);
|
||||
// filtra per tipizzazione e data donazione
|
||||
current_cursor()->set_filterfunction (filter_func_urgenze, TRUE);
|
||||
reset_print();
|
||||
crea_intestazione();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TUrgenze_application::crea_intestazione()
|
||||
{
|
||||
reset_header();
|
||||
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString sep(132);
|
||||
sep = "CONVOCAZIONI URGENTI";
|
||||
sep.center_just();
|
||||
set_header(2, "@0g%s", (const char*) sep);
|
||||
TString 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,"@0gCod.@7gC.@10gCognome e nome@36gNato il@47gIndirizzo@98gTelefono abit.@114gTelefono lavoro");
|
||||
set_header(5,"@47gCAP/Località/Comune/Prov.@114gTelefono altro");
|
||||
set_header(6,"@0g------@7g--@10g-------------------------@36g----------@47g--------------------------------------------------@98g---------------@114g---------------");
|
||||
}
|
||||
}
|
||||
|
||||
bool TUrgenze_application::user_create()
|
||||
{
|
||||
_rel = new TRelation(LF_SOGGETTI);
|
||||
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
|
||||
_rel->add("LCP", "CODTAB==LOCALITA",1,0,ALIAS_LCP);
|
||||
_rel->add(LF_COMUNI, "COM==COM");
|
||||
// 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 TUrgenze_form("AT_ETSOG");
|
||||
_msk = new TMask("at3300a");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TUrgenze_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_eti;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at3300(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TUrgenze_application a;
|
||||
|
||||
a.run(argc, argv, "Urgenze");
|
||||
|
||||
return 0;
|
||||
}
|
37
at/at3300a.h
Executable file
37
at/at3300a.h
Executable file
@ -0,0 +1,37 @@
|
||||
// convocazione urgente
|
||||
// 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_GRUPPOAB0 301
|
||||
#define F_RHANTID 302
|
||||
#define F_KELL 303
|
||||
#define F_FENOTIPORH 304
|
||||
#define F_DU 305
|
||||
|
||||
#define F_NUMERO 306
|
||||
#define F_GIORNI 307
|
||||
|
||||
#define F_ELENCO 401
|
||||
#define F_ETICHETTE 402
|
335
at/at3300a.uml
Executable file
335
at/at3300a.uml
Executable file
@ -0,0 +1,335 @@
|
||||
#include "at3300a.h"
|
||||
#include "lf.h"
|
||||
PAGE "Definizione Stampe" -1 -1 78 20
|
||||
|
||||
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 5
|
||||
BEGIN
|
||||
PROMPT 1 5 "Categorie"
|
||||
END
|
||||
|
||||
|
||||
STRING F_CAT1 2
|
||||
BEGIN
|
||||
PROMPT 2 6 ""
|
||||
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 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT2 2
|
||||
BEGIN
|
||||
PROMPT 2 7 ""
|
||||
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 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT3 2
|
||||
BEGIN
|
||||
PROMPT 2 8 ""
|
||||
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 8 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT4 2
|
||||
BEGIN
|
||||
PROMPT 40 6 ""
|
||||
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 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT5 2
|
||||
BEGIN
|
||||
PROMPT 40 7 ""
|
||||
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 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT6 2
|
||||
BEGIN
|
||||
PROMPT 40 8 ""
|
||||
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 8 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
|
||||
GROUPBOX DLG_NULL 77 3
|
||||
BEGIN
|
||||
PROMPT 1 10 "Tipizzazione richiesta"
|
||||
END
|
||||
|
||||
LISTBOX F_GRUPPOAB0 4
|
||||
BEGIN
|
||||
PROMPT 2 11 "Gruppo AB0 "
|
||||
FIELD GRUPPOAB0
|
||||
FLAGS "U"
|
||||
#include "gruppo.h"
|
||||
END
|
||||
|
||||
LISTBOX F_RHANTID 3
|
||||
BEGIN
|
||||
PROMPT 22 11 "Rh/AntiD "
|
||||
FIELD RHANTID
|
||||
FLAGS "U"
|
||||
#include "rh.h"
|
||||
END
|
||||
|
||||
STRING F_FENOTIPORH 6
|
||||
BEGIN
|
||||
PROMPT 39 11 "Fen.Rh "
|
||||
FIELD FENOTIPORH
|
||||
END
|
||||
|
||||
LISTBOX F_KELL 3
|
||||
BEGIN
|
||||
PROMPT 55 11 "Kell "
|
||||
FIELD KELL
|
||||
FLAGS "U"
|
||||
#include "rh.h"
|
||||
END
|
||||
|
||||
LISTBOX F_DU 3
|
||||
BEGIN
|
||||
PROMPT 68 11 "Du "
|
||||
FIELD DU
|
||||
FLAGS "U"
|
||||
#include "rh.h"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 3
|
||||
BEGIN
|
||||
PROMPT 1 13 "Richieste"
|
||||
END
|
||||
|
||||
NUMBER F_NUMERO 3
|
||||
BEGIN
|
||||
PROMPT 2 14 "Soggetti richiesti "
|
||||
CHECKTYPE REQUIRED
|
||||
WARNING "Inserire il numero dei soggetti richiesti"
|
||||
HELP "Numero dei soggetti richiesti per l'urgenza"
|
||||
END
|
||||
|
||||
NUMBER F_GIORNI 3
|
||||
BEGIN
|
||||
PROMPT 40 14 "Giorni dall'ultima donazione"
|
||||
CHECKTYPE REQUIRED
|
||||
WARNING "Inserire il numero giorni"
|
||||
HELP "N.ro minimo di giorni che devono essere trascorsi dall'ultima donazione"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
PROMPT 1 16 "Stampa"
|
||||
END
|
||||
|
||||
BUTTON F_ELENCO 9 2
|
||||
BEGIN
|
||||
PROMPT -13 17 "Elenco"
|
||||
MESSAGE EXIT,F_ELENCO
|
||||
END
|
||||
|
||||
BUTTON F_ETICHETTE 9 2
|
||||
BEGIN
|
||||
PROMPT -23 17 "Etichette"
|
||||
MESSAGE EXIT,F_ETICHETTE
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -33 17 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
350
at/at3400.cpp
Executable file
350
at/at3400.cpp
Executable file
@ -0,0 +1,350 @@
|
||||
#include <mask.h>
|
||||
#include <form.h>
|
||||
#include <printapp.h>
|
||||
|
||||
#include "lf.h"
|
||||
#include "soggetti.h"
|
||||
#include "sezioni.h"
|
||||
#include <comuni.h>
|
||||
|
||||
#include "at3.h"
|
||||
#include "at3400a.h"
|
||||
|
||||
#define ALIAS_LCP 100
|
||||
//#define ALIAS_TCS 200
|
||||
|
||||
enum ts { undefined = 0, elenco = 1, pagine = 2 };
|
||||
|
||||
// definizione form per pagine anagrafiche
|
||||
class TModificati_form : public TForm
|
||||
{
|
||||
public:
|
||||
|
||||
virtual TCursor* cursor() const;
|
||||
virtual TRelation* relation() const;
|
||||
TPrint_section& get_body() { return section('B'); } ;
|
||||
TModificati_form(): TForm() {};
|
||||
TModificati_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
|
||||
: TForm(form,code,editlevel,desc) {};
|
||||
virtual ~TModificati_form() {};
|
||||
};
|
||||
|
||||
class TModificati_application : public TPrintapp
|
||||
{
|
||||
static bool filter_func_modificati(const TRelation *);
|
||||
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TModificati_form* _form_pag;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome, _dencom;
|
||||
|
||||
TDate _data_stampa;
|
||||
TDate _dataini, _datafin;
|
||||
ts _tipo_stampa;
|
||||
TString _codsez, _codsot;
|
||||
|
||||
|
||||
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(TString codsez, TString codsot);
|
||||
TMask& app_mask() { return *_msk; }
|
||||
|
||||
TModificati_application() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {}
|
||||
};
|
||||
|
||||
HIDDEN inline TModificati_application& app() { return (TModificati_application&) main_app(); }
|
||||
|
||||
TCursor* TModificati_form::cursor() const { return app().current_cursor(); }
|
||||
|
||||
TRelation* TModificati_form::relation() const { return cursor()->relation(); }
|
||||
|
||||
void TModificati_application::filtra_sezioni()
|
||||
{
|
||||
TString sezini = _msk->get(F_SEZINI);
|
||||
TString sotini = _msk->get(F_SOTINI);
|
||||
TString sezfin = _msk->get(F_SEZFIN);
|
||||
TString sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
|
||||
TRectype da(fl.curr());
|
||||
TRectype a(fl.curr());
|
||||
da.zero();
|
||||
a.zero();
|
||||
if ((sezini.not_empty()) && (sezini.ok()))
|
||||
da.put(SOG_CODSEZ, sezini);
|
||||
if ((sotini.not_empty()) && (sotini.ok()))
|
||||
da.put(SOG_CODSOT, sotini);
|
||||
if ((sezfin.not_empty()) && (sezfin.ok()))
|
||||
a.put(SOG_CODSEZ, sezfin);
|
||||
if ((sotfin.not_empty()) && (sotfin.ok()))
|
||||
a.put(SOG_CODSOT, sotfin);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
void TModificati_application::set_page(int file, int cnt)
|
||||
{
|
||||
switch (_tipo_stampa)
|
||||
{
|
||||
case pagine:
|
||||
{
|
||||
TPrint_section& corpo = _form_pag->get_body();
|
||||
corpo.reset();
|
||||
corpo.update();
|
||||
for (int i = 0; i < corpo.height(); i++)
|
||||
{
|
||||
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
|
||||
}
|
||||
break;
|
||||
case elenco:
|
||||
{
|
||||
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"######"));
|
||||
set_row(1,"@7g@S", FLD(LF_SOGGETTI,SOG_CATDON));
|
||||
set_row(1,"@10g#a", &_cognome_nome);
|
||||
set_row(1,"@36g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
|
||||
set_row(1,"@47g@S", FLD(LF_SOGGETTI,SOG_INDIRIZZO));
|
||||
set_row(1,"@98g@S", FLD(LF_SOGGETTI,SOG_TELABI));
|
||||
set_row(1,"@114g@S", FLD(LF_SOGGETTI,SOG_TELLAV));
|
||||
set_row(2,"@47g#a", &_dencom);
|
||||
set_row(2,"@114g@S", FLD(LF_SOGGETTI,SOG_TELALT));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool TModificati_application::filter_func_modificati(const TRelation * rel)
|
||||
{
|
||||
bool filtrato = TRUE;
|
||||
|
||||
TLocalisamfile* sog = &(rel->lfile(LF_SOGGETTI));
|
||||
|
||||
//filtro per categorie
|
||||
|
||||
TMask& msk = app().app_mask();
|
||||
TString catpri = msk.get(F_CAT1);
|
||||
TString catsec = msk.get(F_CAT2);
|
||||
TString catter = msk.get(F_CAT3);
|
||||
TString catqua = msk.get(F_CAT4);
|
||||
TString catqui = msk.get(F_CAT5);
|
||||
TString catses = msk.get(F_CAT6);
|
||||
|
||||
TAssoc_array categorie;
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
categorie.add((const char*) catpri);
|
||||
if (catsec.not_empty() && catsec.ok())
|
||||
categorie.add((const char*) catsec);
|
||||
if (catter.not_empty() && catter.ok())
|
||||
categorie.add((const char*) catter);
|
||||
if (catqua.not_empty() && catqua.ok())
|
||||
categorie.add((const char*) catqua);
|
||||
if (catqui.not_empty() && catqui.ok())
|
||||
categorie.add((const char*) catqui);
|
||||
if (catses.not_empty() && catses.ok())
|
||||
categorie.add((const char*) catses);
|
||||
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
TString cat = sog->curr().get(SOG_CATDON);
|
||||
if (categorie.is_key((const char*) cat))
|
||||
filtrato = TRUE;
|
||||
else
|
||||
filtrato = FALSE;
|
||||
}
|
||||
if (filtrato)
|
||||
{
|
||||
// filtro per data aggiornamento
|
||||
TRectype from (sog->curr());
|
||||
//TRectype to (sog->curr());
|
||||
from.zero();
|
||||
//to.zero();
|
||||
if (app()._dataini.ok())
|
||||
from.put(SOG_DATAULTAGG, app()._dataini);
|
||||
//if (app()._datafin.ok())
|
||||
// to.put(SOG_DATANASC, app()._datafin);
|
||||
//if ((sog->curr() >= from) && (sog->curr() <= to))
|
||||
if (sog->curr() >= from)
|
||||
filtrato = TRUE;
|
||||
else
|
||||
filtrato = FALSE;
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TModificati_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
TString 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
|
||||
TString codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
TString codsot = current_cursor()->curr().get(SOG_CODSOT);
|
||||
if ((_codsez!=codsez)||(_codsot!=codsot))
|
||||
{
|
||||
//if (!_codsez.blank())
|
||||
if (_codsez != "**")
|
||||
printer().formfeed();
|
||||
_codsez = codsez;
|
||||
_codsot = codsot;
|
||||
header_sezione(codsez, codsot);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void TModificati_application::header_sezione(TString codsez, TString codsot)
|
||||
{
|
||||
TString densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
TString 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 TModificati_application::set_print(int)
|
||||
{
|
||||
_tipo_stampa = undefined;
|
||||
KEY tasto;
|
||||
tasto = _msk->run();
|
||||
switch (tasto)
|
||||
{
|
||||
case F_ELENCO:
|
||||
_tipo_stampa = elenco;
|
||||
//_codsez.spaces(2);
|
||||
//_codsot.spaces(2);
|
||||
_codsez = "**";
|
||||
_codsez = "**";
|
||||
break;
|
||||
case F_PAGINE:
|
||||
_tipo_stampa = pagine;
|
||||
break;
|
||||
}
|
||||
if (_tipo_stampa != undefined)
|
||||
{
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
_dataini = _msk->get(F_DATAINI);
|
||||
filtra_sezioni();
|
||||
current_cursor()->set_filterfunction (filter_func_modificati);
|
||||
reset_print();
|
||||
crea_intestazione();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TModificati_application::crea_intestazione()
|
||||
{
|
||||
reset_header();
|
||||
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString sep(132);
|
||||
sep = "ELENCO MODIFICATI";
|
||||
TDate data = _msk->get(F_DATAINI);
|
||||
if (data.ok())
|
||||
{
|
||||
sep << " dal ";
|
||||
sep << data.string();
|
||||
}
|
||||
sep.center_just();
|
||||
set_header(2, "@0g%s", (const char*) sep);
|
||||
TString 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,"@0gCod.@7gC.@10gCognome e nome@36gNato il@47gIndirizzo@98gTelefono abit.@114gTelefono lavoro");
|
||||
set_header(5,"@47gCAP/Località/Comune/Prov.@114gTelefono altro");
|
||||
set_header(6,"@0g------@7g--@10g-------------------------@36g----------@47g--------------------------------------------------@98g---------------@114g---------------");
|
||||
}
|
||||
}
|
||||
|
||||
bool TModificati_application::user_create()
|
||||
{
|
||||
_rel = new TRelation(LF_SOGGETTI);
|
||||
//_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
|
||||
_rel->add("LCP", "CODTAB==LOCALITA",1,0,ALIAS_LCP);
|
||||
_rel->add(LF_COMUNI, "COM==COM");
|
||||
// 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_pag = new TModificati_form("AT_PAGIN");
|
||||
_msk = new TMask("at3400a");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TModificati_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_pag;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at3400(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TModificati_application a;
|
||||
|
||||
a.run(argc, argv, "Elenco soggetti modificati");
|
||||
|
||||
return 0;
|
||||
}
|
30
at/at3400a.h
Executable file
30
at/at3400a.h
Executable file
@ -0,0 +1,30 @@
|
||||
// stampa elenco soggetti modficati a partire dal ...
|
||||
// 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_DATAINI 301
|
||||
//#define F_DATAFIN 302
|
||||
|
||||
#define F_ELENCO 401
|
||||
#define F_PAGINE 402
|
288
at/at3400a.uml
Executable file
288
at/at3400a.uml
Executable file
@ -0,0 +1,288 @@
|
||||
#include "at3400a.h"
|
||||
#include "lf.h"
|
||||
PAGE "Definizione Stampe" -1 -1 78 20
|
||||
|
||||
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 5
|
||||
BEGIN
|
||||
PROMPT 1 5 "Categorie"
|
||||
END
|
||||
|
||||
|
||||
STRING F_CAT1 2
|
||||
BEGIN
|
||||
PROMPT 2 6 ""
|
||||
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 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT2 2
|
||||
BEGIN
|
||||
PROMPT 2 7 ""
|
||||
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 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT3 2
|
||||
BEGIN
|
||||
PROMPT 2 8 ""
|
||||
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 8 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT4 2
|
||||
BEGIN
|
||||
PROMPT 40 6 ""
|
||||
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 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT5 2
|
||||
BEGIN
|
||||
PROMPT 40 7 ""
|
||||
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 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT6 2
|
||||
BEGIN
|
||||
PROMPT 40 8 ""
|
||||
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 8 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 3
|
||||
BEGIN
|
||||
PROMPT 1 10 "Selezione soggetti"
|
||||
END
|
||||
|
||||
DATE F_DATAINI
|
||||
BEGIN
|
||||
PROMPT 2 11 "Soggetti modificati dal "
|
||||
HELP "Data iniziale"
|
||||
END
|
||||
|
||||
//DATE F_DATAFIN
|
||||
//BEGIN
|
||||
// PROMPT 20 11 "Al "
|
||||
// HELP "Data di nascita finale"
|
||||
//END
|
||||
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
PROMPT 1 13 "Stampa"
|
||||
END
|
||||
|
||||
BUTTON F_ELENCO 9 2
|
||||
BEGIN
|
||||
PROMPT -13 14 "Elenco"
|
||||
MESSAGE EXIT,F_ELENCO
|
||||
END
|
||||
|
||||
BUTTON F_PAGINE 9 2
|
||||
BEGIN
|
||||
PROMPT -23 14 "Pagine"
|
||||
MESSAGE EXIT,F_PAGINE
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -33 14 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
373
at/at3500.cpp
Executable file
373
at/at3500.cpp
Executable file
@ -0,0 +1,373 @@
|
||||
#include <mask.h>
|
||||
#include <form.h>
|
||||
#include <printapp.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "lf.h"
|
||||
#include "soggetti.h"
|
||||
#include "sezioni.h"
|
||||
|
||||
#include "at3.h"
|
||||
#include "at3500a.h"
|
||||
|
||||
#define ALIAS_LCP 100
|
||||
#define ALIAS_TCS 200
|
||||
#define IDON_SI "SI"
|
||||
#define IDON_AF "AF"
|
||||
|
||||
enum ts { undefined = 0, elenco = 1, etichette = 2, cartoline = 3 };
|
||||
|
||||
// definizione form per etichette
|
||||
class TScadenze_form : public TForm
|
||||
{
|
||||
public:
|
||||
|
||||
virtual TCursor* cursor() const;
|
||||
virtual TRelation* relation() const;
|
||||
TPrint_section& get_body() { return section('B'); } ;
|
||||
TScadenze_form(): TForm() {};
|
||||
TScadenze_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
|
||||
: TForm(form,code,editlevel,desc) {};
|
||||
virtual ~TScadenze_form() {};
|
||||
};
|
||||
|
||||
class TScadenze_application : public TPrintapp
|
||||
{
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TScadenze_form* _form_eti;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome;
|
||||
TDate _data_stampa;
|
||||
TDate _dataini, _datafin;
|
||||
TString _procdon;
|
||||
ts _tipo_stampa;
|
||||
TString _codsez, _codsot;
|
||||
|
||||
static bool filter_func_scadenze(const TRelation *);
|
||||
|
||||
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(TString codsez, TString codsot);
|
||||
TMask& app_mask() { return *_msk; }
|
||||
TScadenze_application() : _data_stampa(TODAY), _cognome_nome("",25) {}
|
||||
};
|
||||
|
||||
HIDDEN inline TScadenze_application& app() { return (TScadenze_application&) main_app(); }
|
||||
|
||||
TCursor* TScadenze_form::cursor() const { return app().current_cursor(); }
|
||||
|
||||
TRelation* TScadenze_form::relation() const { return cursor()->relation(); }
|
||||
|
||||
void TScadenze_application::filtra_sezioni()
|
||||
{
|
||||
TString sezini = _msk->get(F_SEZINI);
|
||||
TString sotini = _msk->get(F_SOTINI);
|
||||
TString sezfin = _msk->get(F_SEZFIN);
|
||||
TString sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
|
||||
TRectype da(fl.curr());
|
||||
TRectype a(fl.curr());
|
||||
da.zero();
|
||||
a.zero();
|
||||
if ((sezini.not_empty()) && (sezini.ok()))
|
||||
da.put(SOG_CODSEZ, sezini);
|
||||
if ((sotini.not_empty()) && (sotini.ok()))
|
||||
da.put(SOG_CODSOT, sotini);
|
||||
if ((sezfin.not_empty()) && (sezfin.ok()))
|
||||
a.put(SOG_CODSEZ, sezfin);
|
||||
if ((sotfin.not_empty()) && (sotfin.ok()))
|
||||
a.put(SOG_CODSOT, sotfin);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
void TScadenze_application::set_page(int file, int cnt)
|
||||
{
|
||||
// costruzione etichette
|
||||
switch (_tipo_stampa)
|
||||
{
|
||||
case etichette:
|
||||
{
|
||||
TPrint_section& corpo = _form_eti->get_body();
|
||||
corpo.reset();
|
||||
corpo.update();
|
||||
for (int i = 0; i < corpo.height(); i++)
|
||||
{
|
||||
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
|
||||
}
|
||||
break;
|
||||
case elenco:
|
||||
{
|
||||
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"######"));
|
||||
set_row(1,"@7g@S", FLD(LF_SOGGETTI,SOG_CATDON));
|
||||
set_row(1,"@10g#a", &_cognome_nome);
|
||||
set_row(1,"@36g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
|
||||
set_row(1,"@47g@ld", FLD(LF_SOGGETTI,SOG_DATAULTID)); // potremmo mettere anche datastato
|
||||
set_row(1,"@58g@S", FLD(LF_SOGGETTI,SOG_IDON1));
|
||||
set_row(1,"@61g@S", FLD(LF_SOGGETTI,SOG_IDON2));
|
||||
set_row(1,"@64g@S", FLD(LF_SOGGETTI,SOG_IDON3));
|
||||
set_row(1,"@67g@S", FLD(LF_SOGGETTI,SOG_IDON4));
|
||||
|
||||
set_row(2,"@50g@S", FLD(LF_SOGGETTI,SOG_STATO));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool TScadenze_application::filter_func_scadenze(const TRelation * rel)
|
||||
{
|
||||
|
||||
bool filtrato = TRUE;
|
||||
|
||||
TLocalisamfile* sog = &(rel->lfile(LF_SOGGETTI));
|
||||
|
||||
TAssoc_array categorie;
|
||||
|
||||
TMask& msk = app().app_mask();
|
||||
|
||||
TString cat = msk.get(F_CAT1);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
cat = msk.get(F_CAT2);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
cat = msk.get(F_CAT3);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
cat = msk.get(F_CAT4);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
cat = msk.get(F_CAT5);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
cat = msk.get(F_CAT6);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
TString catsog = sog->curr().get(SOG_CATDON);
|
||||
if (categorie.is_key((const char*) catsog))
|
||||
filtrato = TRUE;
|
||||
else
|
||||
filtrato = FALSE;
|
||||
}
|
||||
if (filtrato)
|
||||
{
|
||||
// filtro per età
|
||||
TRectype from (sog->curr());
|
||||
TRectype to (sog->curr());
|
||||
from.zero();
|
||||
to.zero();
|
||||
if (app()._dataini.ok())
|
||||
{
|
||||
if (app()._procdon == IDON_SI)
|
||||
from.put(SOG_DATAPROSSI, app()._dataini);
|
||||
else
|
||||
from.put(SOG_DATAPROSAF, app()._dataini);
|
||||
}
|
||||
if (app()._datafin.ok())
|
||||
{
|
||||
if (app()._procdon == IDON_SI)
|
||||
to.put(SOG_DATAPROSSI, app()._datafin);
|
||||
else
|
||||
to.put(SOG_DATAPROSAF, app()._datafin);
|
||||
}
|
||||
if ((sog->curr() >= from) && (sog->curr() <= to))
|
||||
filtrato = TRUE;
|
||||
else
|
||||
filtrato = FALSE;
|
||||
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TScadenze_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
|
||||
// salto pagina se cambio sezione
|
||||
TString codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
TString codsot = current_cursor()->curr().get(SOG_CODSOT);
|
||||
if ((_codsez!=codsez)||(_codsot!=codsot))
|
||||
{
|
||||
if (_codsez != "**")
|
||||
printer().formfeed();
|
||||
_codsez = codsez;
|
||||
_codsot = codsot;
|
||||
header_sezione(codsez, codsot);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void TScadenze_application::header_sezione(TString codsez, TString codsot)
|
||||
{
|
||||
TString densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
TString 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 TScadenze_application::set_print(int m)
|
||||
{
|
||||
_tipo_stampa = undefined;
|
||||
KEY tasto;
|
||||
tasto = _msk->run();
|
||||
switch (tasto)
|
||||
{
|
||||
case F_ELENCO:
|
||||
_tipo_stampa = elenco;
|
||||
_codsez = "**";
|
||||
_codsot = "**";
|
||||
break;
|
||||
case F_ETICHETTE:
|
||||
_tipo_stampa = etichette;
|
||||
case F_CARTOLINE:
|
||||
_tipo_stampa = cartoline;
|
||||
break;
|
||||
}
|
||||
if (_tipo_stampa != undefined)
|
||||
{
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
_dataini = _msk->get(F_DATAINI);
|
||||
_datafin = _msk->get(F_DATAFIN);
|
||||
_procdon = _msk->get(F_PROCDON1);
|
||||
|
||||
// filtro per sezioni selezionati
|
||||
filtra_sezioni();
|
||||
|
||||
// filtro per idoneo e non escluso
|
||||
current_cursor()->setfilter("((TCS->S6 == \"I\" ) || (TCS->S6 == \"F\")) && (ESCLUSO == \"\")", TRUE);
|
||||
|
||||
// filtro per procedura di donazione (controllo che abbia la data)
|
||||
/* questo filtro è nella filter_function
|
||||
TString procdon = _msk->get(F_PROCDON1);
|
||||
if (procdon == IDON_SI)
|
||||
current_cursor()->setfilter("(DATAPROSSI == \"\")", TRUE);
|
||||
else
|
||||
current_cursor()->setfilter("(DATAPROSAF == \"\")", TRUE);
|
||||
*/
|
||||
// filtro per categorie
|
||||
current_cursor()->set_filterfunction(filter_func_scadenze);
|
||||
reset_print();
|
||||
crea_intestazione();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TScadenze_application::crea_intestazione()
|
||||
{
|
||||
reset_header();
|
||||
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString sep(132);
|
||||
sep = "SCADENZE DI DONAZIONE ";
|
||||
TString procdon = _msk->get(F_PROCDON1);
|
||||
sep << procdon ;
|
||||
TDate data = _msk->get(F_DATAINI);
|
||||
if (data.ok())
|
||||
{
|
||||
sep << " dal ";
|
||||
sep << data.string();
|
||||
}
|
||||
data = _msk->get(F_DATAFIN);
|
||||
if (data.ok())
|
||||
{
|
||||
sep << " al ";
|
||||
sep << data.string();
|
||||
}
|
||||
sep.center_just();
|
||||
set_header(2, "@0g%s", (const char*) sep);
|
||||
TString 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,"@0gCod.@7gC.@10gCognome e nome@36gNato il@47gData ID@58gTipi idon.");
|
||||
set_header(5,"@47gTipo/Esito");
|
||||
set_header(6,"@0g------@7g--@10g-------------------------@36g----------@47g----------@58g-- -- -- --");
|
||||
}
|
||||
}
|
||||
|
||||
bool TScadenze_application::user_create()
|
||||
{
|
||||
_rel = new TRelation(LF_SOGGETTI);
|
||||
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
|
||||
_rel->add("LCP", "CODTAB==LOCALITA",1,0,ALIAS_LCP);
|
||||
_rel->add(LF_COMUNI, "COM==COM");
|
||||
// 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
|
||||
|
||||
_msk = new TMask("at3500a");
|
||||
|
||||
_form_eti = new TScadenze_form("AT_ETSOG");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TScadenze_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_eti;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at3500(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TScadenze_application a;
|
||||
|
||||
a.run(argc, argv, "Scadenze di donazione");
|
||||
|
||||
return 0;
|
||||
}
|
42
at/at3500a.h
Executable file
42
at/at3500a.h
Executable file
@ -0,0 +1,42 @@
|
||||
// Scadenze di donazione
|
||||
// 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_PROCDON1 301
|
||||
//#define F_PROCDON2 302
|
||||
#define F_DATAINI 303
|
||||
#define F_DATAFIN 304
|
||||
#define F_USOGIORNO 305
|
||||
#define F_GIORNO 306
|
||||
#define F_USOMODO 307
|
||||
#define F_MODO 308
|
||||
#define F_DATAULTID 309
|
||||
#define F_AB01 310
|
||||
#define F_AB02 311
|
||||
#define F_AB03 312
|
||||
#define F_RHANTID 313
|
||||
|
||||
#define F_ELENCO 401
|
||||
#define F_ETICHETTE 402
|
||||
#define F_CARTOLINE 403
|
364
at/at3500a.uml
Executable file
364
at/at3500a.uml
Executable file
@ -0,0 +1,364 @@
|
||||
#include "at3500a.h"
|
||||
#include "lf.h"
|
||||
PAGE "Definizione Stampe" -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"
|
||||
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 50 8
|
||||
BEGIN
|
||||
PROMPT 1 9 "Opzioni di convocazione"
|
||||
END
|
||||
|
||||
LISTBOX F_PROCDON1 17
|
||||
BEGIN
|
||||
PROMPT 2 10 "Procedura di donazione "
|
||||
#include "procdon.h"
|
||||
END
|
||||
|
||||
//LISTBOX F_PROCDON2 17
|
||||
//BEGIN
|
||||
// PROMPT 50 10 ""
|
||||
// #include "procdon.h"
|
||||
//END
|
||||
|
||||
DATE F_DATAINI
|
||||
BEGIN
|
||||
PROMPT 2 11 "Data prossima don. da "
|
||||
END
|
||||
|
||||
DATE F_DATAFIN
|
||||
BEGIN
|
||||
PROMPT 37 11 "a "
|
||||
END
|
||||
|
||||
BOOLEAN F_USOGIORNO
|
||||
BEGIN
|
||||
PROMPT 2 13 "Uso giorno preferito "
|
||||
MESSAGE TRUE ENABLE,F_GIORNO
|
||||
MESSAGE FALSE RESET,F_GIORNO|DISABLE,F_GIORNO
|
||||
END
|
||||
|
||||
LISTBOX F_GIORNO 13
|
||||
BEGIN
|
||||
PROMPT 30 13 ""
|
||||
#include "giorni.h"
|
||||
END
|
||||
|
||||
BOOLEAN F_USOMODO
|
||||
BEGIN
|
||||
PROMPT 2 14 "Uso modalità preferita "
|
||||
MESSAGE TRUE ENABLE,F_MODO
|
||||
MESSAGE FALSE RESET,F_MODO|DISABLE,F_MODO
|
||||
END
|
||||
|
||||
LISTBOX F_MODO 13
|
||||
BEGIN
|
||||
PROMPT 30 14 ""
|
||||
#include "modalita.h"
|
||||
END
|
||||
|
||||
DATE F_DATAULTID
|
||||
BEGIN
|
||||
PROMPT 2 15 "Blocco per id. precedente a "
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 25 8
|
||||
BEGIN
|
||||
PROMPT 53 9 "Tipizzazione"
|
||||
END
|
||||
|
||||
LISTBOX F_AB01 5
|
||||
BEGIN
|
||||
PROMPT 54 10 "Gruppi AB0 "
|
||||
#include "gruppo.h"
|
||||
END
|
||||
|
||||
LISTBOX F_AB02 5
|
||||
BEGIN
|
||||
PROMPT 54 11 " "
|
||||
#include "gruppo.h"
|
||||
END
|
||||
|
||||
LISTBOX F_AB03 5
|
||||
BEGIN
|
||||
PROMPT 54 12 " "
|
||||
#include "gruppo.h"
|
||||
END
|
||||
|
||||
LISTBOX F_RHANTID 5
|
||||
BEGIN
|
||||
PROMPT 54 13 "Rh/AntiD "
|
||||
#include "rh.h"
|
||||
END
|
||||
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
PROMPT 1 17 "Stampa"
|
||||
END
|
||||
|
||||
BUTTON F_ELENCO 9 2
|
||||
BEGIN
|
||||
PROMPT -14 18 "Elenco"
|
||||
MESSAGE EXIT,F_ELENCO
|
||||
END
|
||||
|
||||
BUTTON F_ETICHETTE 9 2
|
||||
BEGIN
|
||||
PROMPT -24 18 "Etichette"
|
||||
MESSAGE EXIT,F_ETICHETTE
|
||||
END
|
||||
|
||||
BUTTON F_CARTOLINE 9 2
|
||||
BEGIN
|
||||
PROMPT -34 18 "Cartoline"
|
||||
MESSAGE EXIT,F_CARTOLINE
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -44 18 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
22
at/at4.cpp
Executable file
22
at/at4.cpp
Executable file
@ -0,0 +1,22 @@
|
||||
#include <xvt.h>
|
||||
|
||||
#include <checks.h>
|
||||
|
||||
#include "at4.h"
|
||||
|
||||
#define usage "Error - usage : %s -[0]"
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
int rt = 0 ;
|
||||
const int r = (argc > 1) ? atoi(&argv[1][1]) : -1;
|
||||
|
||||
switch (r)
|
||||
{
|
||||
case 0:
|
||||
rt = at4100(argc, argv); break;
|
||||
default:
|
||||
error_box(usage, argv[0]) ; rt = 1; break;
|
||||
}
|
||||
return rt;
|
||||
}
|
48
at/at4.url
Executable file
48
at/at4.url
Executable file
@ -0,0 +1,48 @@
|
||||
#define APPNAME AVIS
|
||||
#define QAPPNAME "AVIS"
|
||||
#define LIBDIR f:\xvt.403\win_x86\ptk\lib
|
||||
|
||||
#include <default.url>
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at4 -0
|
||||
* ---------------------------------------------------- */
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at4 -1
|
||||
* ---------------------------------------------------- */
|
||||
MENUBAR MENU_BAR(1)
|
||||
|
||||
MENU MENU_BAR(1)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at4 -2
|
||||
* ---------------------------------------------------- */
|
||||
|
||||
MENUBAR MENU_BAR(2)
|
||||
|
||||
MENU MENU_BAR(2)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at4 -3
|
||||
*
|
||||
* ----------------------------------------------------*/
|
||||
|
||||
MENUBAR MENU_BAR(3)
|
||||
|
||||
MENU MENU_BAR(3)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at4 -4
|
||||
* ---------------------------------------------------- */
|
||||
MENUBAR MENU_BAR(4)
|
||||
|
||||
MENU MENU_BAR(4)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
381
at/at4100.cpp
Executable file
381
at/at4100.cpp
Executable file
@ -0,0 +1,381 @@
|
||||
#include <mask.h>
|
||||
#include <form.h>
|
||||
#include <printapp.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "lf.h"
|
||||
#include "soggetti.h"
|
||||
#include "sezioni.h"
|
||||
#include "contsan.h"
|
||||
|
||||
#include "at4.h"
|
||||
#include "at4100a.h"
|
||||
|
||||
#define ALIAS_LCP 100
|
||||
#define ALIAS_TCS 200
|
||||
|
||||
enum ts { undefined = 0, elenco = 1, etichette = 2 };
|
||||
|
||||
// definizione form per etichette
|
||||
class TSitsan_form : public TForm
|
||||
{
|
||||
public:
|
||||
|
||||
virtual TCursor* cursor() const;
|
||||
virtual TRelation* relation() const;
|
||||
TPrint_section& get_body() { return section('B'); } ;
|
||||
TSitsan_form(): TForm() {};
|
||||
TSitsan_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
|
||||
: TForm(form,code,editlevel,desc) {};
|
||||
virtual ~TSitsan_form() {};
|
||||
};
|
||||
|
||||
class TSitsan_application : public TPrintapp
|
||||
{
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TSitsan_form* _form_eti;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome;
|
||||
TDate _data_stampa;
|
||||
ts _tipo_stampa;
|
||||
TString _codsez, _codsot;
|
||||
|
||||
bool _usotipo;
|
||||
TString _tipo;
|
||||
long _codmed;
|
||||
|
||||
static bool filter_func_sitsan(const TRelation *);
|
||||
|
||||
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(TString codsez, TString codsot);
|
||||
TMask& app_mask() { return *_msk; }
|
||||
TSitsan_application() : _data_stampa(TODAY), _cognome_nome("",25) {}
|
||||
};
|
||||
|
||||
HIDDEN inline TSitsan_application& app() { return (TSitsan_application&) main_app(); }
|
||||
|
||||
TCursor* TSitsan_form::cursor() const { return app().current_cursor(); }
|
||||
|
||||
TRelation* TSitsan_form::relation() const { return cursor()->relation(); }
|
||||
|
||||
void TSitsan_application::filtra_sezioni()
|
||||
{
|
||||
TString sezini = _msk->get(F_SEZINI);
|
||||
TString sotini = _msk->get(F_SOTINI);
|
||||
TString sezfin = _msk->get(F_SEZFIN);
|
||||
TString sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
|
||||
TRectype da(fl.curr());
|
||||
TRectype a(fl.curr());
|
||||
da.zero();
|
||||
a.zero();
|
||||
if ((sezini.not_empty()) && (sezini.ok()))
|
||||
da.put(SOG_CODSEZ, sezini);
|
||||
if ((sotini.not_empty()) && (sotini.ok()))
|
||||
da.put(SOG_CODSOT, sotini);
|
||||
if ((sezfin.not_empty()) && (sezfin.ok()))
|
||||
a.put(SOG_CODSEZ, sezfin);
|
||||
if ((sotfin.not_empty()) && (sotfin.ok()))
|
||||
a.put(SOG_CODSOT, sotfin);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
void TSitsan_application::set_page(int file, int cnt)
|
||||
{
|
||||
// costruzione etichette
|
||||
switch (_tipo_stampa)
|
||||
{
|
||||
case etichette:
|
||||
{
|
||||
TPrint_section& corpo = _form_eti->get_body();
|
||||
corpo.reset();
|
||||
corpo.update();
|
||||
for (int i = 0; i < corpo.height(); i++)
|
||||
{
|
||||
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
|
||||
}
|
||||
break;
|
||||
case elenco:
|
||||
{
|
||||
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"######"));
|
||||
set_row(1,"@7g@S", FLD(LF_SOGGETTI,SOG_CATDON));
|
||||
set_row(1,"@10g#a", &_cognome_nome);
|
||||
set_row(1,"@36g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
|
||||
set_row(1,"@47g@ld", FLD(LF_SOGGETTI,SOG_DATAULTID)); // potremmo mettere anche datastato
|
||||
set_row(1,"@58g@S", FLD(LF_SOGGETTI,SOG_IDON1));
|
||||
set_row(1,"@61g@S", FLD(LF_SOGGETTI,SOG_IDON2));
|
||||
set_row(1,"@64g@S", FLD(LF_SOGGETTI,SOG_IDON3));
|
||||
set_row(1,"@67g@S", FLD(LF_SOGGETTI,SOG_IDON4));
|
||||
|
||||
set_row(2,"@50g@S", FLD(LF_SOGGETTI,SOG_STATO));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool TSitsan_application::filter_func_sitsan(const TRelation * rel)
|
||||
{
|
||||
|
||||
bool filtrato = TRUE;
|
||||
|
||||
TLocalisamfile* sog = &(rel->lfile(LF_SOGGETTI));
|
||||
|
||||
TAssoc_array categorie;
|
||||
|
||||
TMask& msk = app().app_mask();
|
||||
|
||||
TString cat = msk.get(F_CAT1);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
cat = msk.get(F_CAT2);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
cat = msk.get(F_CAT3);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
cat = msk.get(F_CAT4);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
cat = msk.get(F_CAT5);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
cat = msk.get(F_CAT6);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
TString catsog = sog->curr().get(SOG_CATDON);
|
||||
if (categorie.is_key((const char*) catsog))
|
||||
filtrato = TRUE;
|
||||
else
|
||||
filtrato = FALSE;
|
||||
}
|
||||
if (filtrato)
|
||||
{
|
||||
const long codice = sog->curr().get_long(SOG_CODICE);
|
||||
const int prog = 999;
|
||||
TLocalisamfile con(LF_CONTSAN);
|
||||
con.zero();
|
||||
con.put(CON_CODICE,codice);
|
||||
con.put(CON_PROGCON,prog);
|
||||
int err = con.read(_isgteq);
|
||||
if (err == _isemptyfile)
|
||||
filtrato = FALSE;
|
||||
else
|
||||
{
|
||||
if (err==NOERR)
|
||||
{
|
||||
const long codcon = con.get_long(CON_CODICE);
|
||||
if (codice != codcon)
|
||||
{
|
||||
err = con.prev();
|
||||
if (err != NOERR)
|
||||
filtrato = FALSE;
|
||||
}
|
||||
}
|
||||
if (filtrato)
|
||||
{
|
||||
const long codsog = con.get_long(CON_CODICE);
|
||||
if (codice != codsog)
|
||||
filtrato = FALSE;
|
||||
else if (app()._usotipo)
|
||||
{
|
||||
TString tipo = con.get(CON_TIPOCON);
|
||||
if (tipo == app()._tipo)
|
||||
filtrato = TRUE;
|
||||
else
|
||||
filtrato = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TSitsan_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
|
||||
// salto pagina se cambio sezione
|
||||
TString codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
TString codsot = current_cursor()->curr().get(SOG_CODSOT);
|
||||
if ((_codsez!=codsez)||(_codsot!=codsot))
|
||||
{
|
||||
//if (!_codsez.blank())
|
||||
if (_codsez != "**")
|
||||
printer().formfeed();
|
||||
_codsez = codsez;
|
||||
_codsot = codsot;
|
||||
header_sezione(codsez, codsot);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void TSitsan_application::header_sezione(TString codsez, TString codsot)
|
||||
{
|
||||
TString densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
TString 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 TSitsan_application::set_print(int m)
|
||||
{
|
||||
_tipo_stampa = undefined;
|
||||
KEY tasto;
|
||||
tasto = _msk->run();
|
||||
switch (tasto)
|
||||
{
|
||||
case F_ELENCO:
|
||||
_tipo_stampa = elenco;
|
||||
//_codsez.spaces(2);
|
||||
//_codsot.spaces(2);
|
||||
_codsez = "**";
|
||||
_codsot = "**";
|
||||
break;
|
||||
case F_ETICHETTE:
|
||||
_tipo_stampa = etichette;
|
||||
break;
|
||||
}
|
||||
if (_tipo_stampa != undefined)
|
||||
{
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
|
||||
_usotipo = _msk->get_bool(F_USOTIPO);
|
||||
_tipo = _msk->get(F_TIPO);
|
||||
_codmed = _msk->get_long(F_CODMED);
|
||||
|
||||
// filtro per sezioni selezionati
|
||||
filtra_sezioni();
|
||||
|
||||
// filtro per tipo idoneità
|
||||
/*
|
||||
TString tipoid = _msk->get(F_TIPO);
|
||||
if (tipoid.not_empty() && tipoid.ok())
|
||||
current_cursor()->setfilter(format("STATO == \"%s\"",(const char*)tipoid));
|
||||
else
|
||||
current_cursor()->setfilter("TCS->S6 == \"I\"", TRUE);
|
||||
*/
|
||||
// filtro per categorie
|
||||
current_cursor()->set_filterfunction(filter_func_sitsan);
|
||||
reset_print();
|
||||
crea_intestazione();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TSitsan_application::crea_intestazione()
|
||||
{
|
||||
reset_header();
|
||||
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString sep(132);
|
||||
sep = "SITUAZIONE SANITARIA ATTUALE";
|
||||
TString tipo = _msk->get(F_TIPO);
|
||||
if ((tipo.ok()) && (tipo.not_empty()))
|
||||
{
|
||||
sep << ": tipo ";
|
||||
sep << tipo;
|
||||
tipo = _msk->get(F_D_TIPO);
|
||||
sep << " ";
|
||||
sep << tipo;
|
||||
}
|
||||
sep.center_just();
|
||||
set_header(2, "@0g%s", (const char*) sep);
|
||||
TString 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,"@0gCod.@7gC.@10gCognome e nome@36gNato il@47gData ID@58gTipi idon.");
|
||||
set_header(5,"@47gTipo/Esito");
|
||||
set_header(6,"@0g------@7g--@10g-------------------------@36g----------@47g----------@58g-- -- -- --");
|
||||
}
|
||||
}
|
||||
|
||||
bool TSitsan_application::user_create()
|
||||
{
|
||||
_rel = new TRelation(LF_SOGGETTI);
|
||||
_rel->add("TCS","CODTAB==STATO",1,0,ALIAS_TCS);
|
||||
_rel->add("LCP","CODTAB==LOCALITA",1,0,ALIAS_LCP);
|
||||
_rel->add(LF_COMUNI,"COM==COM");
|
||||
// per stampare la denominazione della sezione nell'intestazione
|
||||
_rel->add(LF_SEZIONI,"CODSEZ==CODSEZ|CODSOT==CODSOT");
|
||||
_rel->add(LF_CONTSAN,"CODICE==CODICE");
|
||||
|
||||
_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
|
||||
|
||||
_msk = new TMask("at4100a");
|
||||
|
||||
_form_eti = new TSitsan_form("AT_ETSOG");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TSitsan_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_eti;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at4100(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TSitsan_application a;
|
||||
|
||||
a.run(argc, argv, "Situazione sanitaria attuale");
|
||||
|
||||
return 0;
|
||||
}
|
39
at/at4100a.h
Executable file
39
at/at4100a.h
Executable file
@ -0,0 +1,39 @@
|
||||
// situazione sanitaria attuale
|
||||
// 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_USOTIPO 301
|
||||
#define F_TIPO 302
|
||||
#define F_D_TIPO 303
|
||||
//#define F_USOPROSS 304
|
||||
//#define F_PROSS 305
|
||||
//#define F_D_PROSS 306
|
||||
#define F_DATAINI 304
|
||||
#define F_DATAFIN 305
|
||||
#define F_CODMED 307
|
||||
#define F_COGNMED 308
|
||||
#define F_NOMMED 309
|
||||
|
||||
#define F_ELENCO 401
|
||||
#define F_ETICHETTE 402
|
394
at/at4100a.uml
Executable file
394
at/at4100a.uml
Executable file
@ -0,0 +1,394 @@
|
||||
#include "at4100a.h"
|
||||
#include "lf.h"
|
||||
PAGE "Definizione Stampe" -1 -1 78 20
|
||||
|
||||
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 5
|
||||
BEGIN
|
||||
PROMPT 1 5 "Categorie"
|
||||
END
|
||||
|
||||
|
||||
STRING F_CAT1 2
|
||||
BEGIN
|
||||
PROMPT 2 6 ""
|
||||
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 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT2 2
|
||||
BEGIN
|
||||
PROMPT 2 7 ""
|
||||
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 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT3 2
|
||||
BEGIN
|
||||
PROMPT 2 8 ""
|
||||
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 8 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT4 2
|
||||
BEGIN
|
||||
PROMPT 40 6 ""
|
||||
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 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT5 2
|
||||
BEGIN
|
||||
PROMPT 40 7 ""
|
||||
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 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT6 2
|
||||
BEGIN
|
||||
PROMPT 40 8 ""
|
||||
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 8 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
PROMPT 1 10 "Situazione sanitaria"
|
||||
END
|
||||
|
||||
BOOLEAN F_USOTIPO
|
||||
BEGIN
|
||||
PROMPT 2 11 "Seleziona Tipo/Esito "
|
||||
MESSAGE TRUE ENABLE,F_TIPO
|
||||
MESSAGE FALSE RESET,F_TIPO|DISABLE,F_TIPO
|
||||
END
|
||||
|
||||
STRING F_TIPO 2
|
||||
BEGIN
|
||||
PROMPT 35 11 ""
|
||||
FLAGS "U"
|
||||
USE TCS
|
||||
INPUT CODTAB F_TIPO
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@30" S0
|
||||
OUTPUT F_TIPO CODTAB
|
||||
OUTPUT F_D_TIPO S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice non presente"
|
||||
HELP "Tipo/Esito"
|
||||
END
|
||||
|
||||
STRING F_D_TIPO 30
|
||||
BEGIN
|
||||
PROMPT 40 11 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
//BOOLEAN F_USOPROSS
|
||||
//BEGIN
|
||||
// PROMPT 2 12 "Seleziona pross. Tipo/Esito "
|
||||
// MESSAGE TRUE ENABLE,F_PROSS
|
||||
// MESSAGE FALSE RESET,F_PROSS|DISABLE,F_PROSS
|
||||
//END
|
||||
|
||||
//STRING F_PROSS 2
|
||||
//BEGIN
|
||||
// PROMPT 35 12 ""
|
||||
// FLAGS "U"
|
||||
// USE TCS SELECT S6="I"
|
||||
// INPUT CODTAB F_PROSS
|
||||
// DISPLAY "Codice" CODTAB
|
||||
// DISPLAY "Descrizione@30" S0
|
||||
// OUTPUT F_PROSS CODTAB
|
||||
// OUTPUT F_D_PROSS S0
|
||||
|
||||
// CHECKTYPE NORMAL
|
||||
// WARNING "Codice non presente"
|
||||
// HELP "Prossimo Tipo/Esito"
|
||||
//END
|
||||
|
||||
//STRING F_D_PROSS 30
|
||||
//BEGIN
|
||||
// PROMPT 40 12 ""
|
||||
// FLAGS "D"
|
||||
//END
|
||||
|
||||
DATE F_DATAINI
|
||||
BEGIN
|
||||
PROMPT 2 12 "Data iniziale "
|
||||
END
|
||||
|
||||
DATE F_DATAFIN
|
||||
BEGIN
|
||||
PROMPT 35 12 "Data finale "
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 3
|
||||
BEGIN
|
||||
PROMPT 1 14 "Medico di base"
|
||||
END
|
||||
|
||||
NUMBER F_CODMED 6
|
||||
BEGIN
|
||||
PROMPT 2 15 "Medico "
|
||||
FLAGS "U"
|
||||
USE LF_MEDICI
|
||||
INPUT CODMED F_CODMED
|
||||
DISPLAY "Codice" CODMED
|
||||
DISPLAY "Cognome@25" COGNOME
|
||||
DISPLAY "Nome@25" NOME
|
||||
OUTPUT F_CODMED CODMED
|
||||
OUTPUT F_COGNMED COGNOME
|
||||
OUTPUT F_NOMMED NOME
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Codice medico di base"
|
||||
WARNING "Codice medico assente"
|
||||
END
|
||||
|
||||
STRING F_COGNMED 25
|
||||
BEGIN
|
||||
PROMPT 19 15 ""
|
||||
USE LF_MEDICI KEY 2
|
||||
INPUT COGNOME F_COGNMED
|
||||
DISPLAY "Cognome@25" COGNOME
|
||||
DISPLAY "Nome@25" NOME
|
||||
DISPLAY "Codice" CODMED
|
||||
COPY OUTPUT F_CODMED
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Medico di base"
|
||||
WARNING "Medico assente"
|
||||
END
|
||||
|
||||
STRING F_NOMMED 25
|
||||
BEGIN
|
||||
PROMPT 48 15 ""
|
||||
USE LF_MEDICI KEY 2
|
||||
INPUT COGNOME F_COGNMED
|
||||
INPUT NOME F_NOMNMED
|
||||
DISPLAY "Cognome@25" COGNOME
|
||||
DISPLAY "Nome@25" NOME
|
||||
DISPLAY "Codice" CODMED
|
||||
COPY OUTPUT F_COGNMED
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Medico di base"
|
||||
WARNING "Medico assente"
|
||||
END
|
||||
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
PROMPT 1 17 "Stampa"
|
||||
END
|
||||
|
||||
BUTTON F_ELENCO 9 2
|
||||
BEGIN
|
||||
PROMPT -13 18 "Elenco"
|
||||
MESSAGE EXIT,F_ELENCO
|
||||
END
|
||||
|
||||
BUTTON F_ETICHETTE 9 2
|
||||
BEGIN
|
||||
PROMPT -23 18 "Etichette"
|
||||
MESSAGE EXIT,F_ETICHETTE
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -33 18 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
22
at/at5.cpp
Executable file
22
at/at5.cpp
Executable file
@ -0,0 +1,22 @@
|
||||
#include <xvt.h>
|
||||
|
||||
#include <checks.h>
|
||||
|
||||
#include "at5.h"
|
||||
|
||||
#define usage "Error - usage : %s -[0]"
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
int rt = 0 ;
|
||||
const int r = (argc > 1) ? atoi(&argv[1][1]) : -1;
|
||||
|
||||
switch (r)
|
||||
{
|
||||
case 0:
|
||||
rt = at5100(argc, argv); break;
|
||||
default:
|
||||
error_box(usage, argv[0]) ; rt = 1; break;
|
||||
}
|
||||
return rt;
|
||||
}
|
7
at/at5.h
Executable file
7
at/at5.h
Executable file
@ -0,0 +1,7 @@
|
||||
#ifndef __AT5_H
|
||||
#define __AT5_H
|
||||
|
||||
int at5100(int argc, char* argv[]); // scarico dati per sezione comunale
|
||||
|
||||
#endif // __AT5_H
|
||||
|
21
at/at5.url
Executable file
21
at/at5.url
Executable file
@ -0,0 +1,21 @@
|
||||
#define APPNAME AVIS
|
||||
#define QAPPNAME "AVIS"
|
||||
#define LIBDIR f:\xvt.403\win_x86\ptk\lib
|
||||
|
||||
#include <default.url>
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at5 -0
|
||||
* ---------------------------------------------------- */
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at5 -1
|
||||
* ---------------------------------------------------- */
|
||||
MENUBAR MENU_BAR(1)
|
||||
|
||||
MENU MENU_BAR(1)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
|
118
at/at5100.cpp
Executable file
118
at/at5100.cpp
Executable file
@ -0,0 +1,118 @@
|
||||
// trasferimenti !!!!
|
||||
|
||||
class TTransfer : public TObject
|
||||
{
|
||||
TArray _cursors;
|
||||
TCursor* _current_cursor;
|
||||
|
||||
TArray _configs;
|
||||
TConfig* _current_config;
|
||||
|
||||
const char* _wmess;
|
||||
bool _wbar;
|
||||
bool _wcancel;
|
||||
int _wthr;
|
||||
|
||||
MENU_TAG _last_choice;
|
||||
|
||||
virtual bool create();
|
||||
virtual bool destroy();
|
||||
|
||||
protected:
|
||||
virtual bool user_create() pure;
|
||||
virtual bool user_destroy() pure;
|
||||
|
||||
void do_trasf(int n);
|
||||
|
||||
public:
|
||||
void select_cursor(int i);
|
||||
TCursor* get_cursor(int i);
|
||||
int add_cursor(TCursor* c);
|
||||
TCursor* current_cursor() { return _current_cursor; }
|
||||
|
||||
void select_config(int i);
|
||||
TConfig* get_config(int i);
|
||||
int add_config(TConfig* c);
|
||||
TConfig* current_config() { return _current_config; }
|
||||
|
||||
virtual bool menu(MENU_TAG m);
|
||||
|
||||
void reset_files();
|
||||
void add_file(int file, int from = 0);
|
||||
void add_file(const char* tab, int from = 0);
|
||||
|
||||
|
||||
TTransfer();
|
||||
virtual ~TTransfer{};
|
||||
|
||||
};
|
||||
|
||||
TTransfer::TTransfer():TObject(),_cursors(10),_configs(10)
|
||||
{
|
||||
_current_cursor = NULL;
|
||||
_current_config = NULL;
|
||||
_last_choice = BAR_ITEM (1);
|
||||
}
|
||||
|
||||
bool TTransfer::create()
|
||||
{
|
||||
if (user_create())
|
||||
{
|
||||
dispatch_e_menu (_last_choice);
|
||||
return TRUE;
|
||||
}
|
||||
else return FALSE;
|
||||
}
|
||||
|
||||
bool TTransfer::destroy()
|
||||
{
|
||||
user_destroy();
|
||||
//reset_files();
|
||||
_cursors.destroy();
|
||||
_configs.destroy()
|
||||
return //TApplication::destroy();
|
||||
}
|
||||
|
||||
|
||||
void TTransfer::select_cursor(int c)
|
||||
{
|
||||
if (c == -1) _current_cursor = NULL;
|
||||
else _current_cursor = (TCursor*) &_cursors[c];
|
||||
}
|
||||
|
||||
TCursor* TTransfer::get_cursor(int c)
|
||||
{
|
||||
if (c == -1) return NULL;
|
||||
else return (TCursor*) &_cursors[c];
|
||||
}
|
||||
|
||||
int TTransfer::add_cursor(TCursor* c)
|
||||
{
|
||||
if (c == NULL)
|
||||
return -1;
|
||||
_cursors.add(c);
|
||||
_current_cursor = c;
|
||||
return _cursors.items() - 1;
|
||||
}
|
||||
|
||||
void TTransfer::select_config(int c)
|
||||
{
|
||||
if (c == -1) _current_config = NULL;
|
||||
else _current_config = (TConfig*) &_configs[c];
|
||||
}
|
||||
|
||||
TConfig* TTransfer::get_config(int c)
|
||||
{
|
||||
if (c == -1) return NULL;
|
||||
else return (TConfig*) &_configs[c];
|
||||
}
|
||||
|
||||
int TTransfer::add_config(TConfig* c)
|
||||
{
|
||||
if (c == NULL)
|
||||
return -1;
|
||||
_configs.add(c);
|
||||
_current_config = c;
|
||||
return _configs.items() - 1;
|
||||
}
|
||||
|
12
at/at5100a.h
Executable file
12
at/at5100a.h
Executable file
@ -0,0 +1,12 @@
|
||||
// scarico dati per sezione comunale
|
||||
// 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_DATA 109
|
138
at/at5100a.uml
Executable file
138
at/at5100a.uml
Executable file
@ -0,0 +1,138 @@
|
||||
#include "at4100a.h"
|
||||
#include "lf.h"
|
||||
PAGE "Scarico dati" -1 -1 78 20
|
||||
|
||||
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 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 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
|
||||
|
||||
DATE F_DATA
|
||||
BEGIN
|
||||
PROMPT 2 5 "Data scarico "
|
||||
CHECKTYPE REQUIRED
|
||||
HELP "Data scarico"
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
BEGIN
|
||||
PROMPT -12 14 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -22 14 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
117
at/at_etcar.frm
Executable file
117
at/at_etcar.frm
Executable file
@ -0,0 +1,117 @@
|
||||
USE 90
|
||||
JOIN 13 INTO COM==COM
|
||||
JOIN LCP ALIAS 100 INTO CODTAB==LOCALITA
|
||||
|
||||
END
|
||||
DESCRIPTION
|
||||
BEGIN
|
||||
90->* "Soggetti Sezioni AVIS"
|
||||
13->* "COMUNI"
|
||||
LCP->* "Località postali"
|
||||
END
|
||||
|
||||
GENERAL
|
||||
BEGIN
|
||||
OFFSET 0 0
|
||||
FONT "Arial"
|
||||
SIZE 12
|
||||
GRID ""
|
||||
END
|
||||
|
||||
SECTION BODY ODD 9
|
||||
|
||||
STRINGA 1 25
|
||||
BEGIN
|
||||
KEY "Cognome"
|
||||
FIELD 90->COGNOME
|
||||
PROMPT 0 0 ""
|
||||
FLAGS "H"
|
||||
MESSAGE RESET,3|COPY,3
|
||||
END
|
||||
|
||||
STRINGA 2 25
|
||||
BEGIN
|
||||
KEY "Nome"
|
||||
FIELD 90->NOME
|
||||
PROMPT 0 0 ""
|
||||
FLAGS "H"
|
||||
MESSAGE APPEND,3
|
||||
END
|
||||
|
||||
STRINGA 3 33 2
|
||||
BEGIN
|
||||
KEY "Cognome e nome"
|
||||
PROMPT 1 1 ""
|
||||
END
|
||||
|
||||
STRINGA 4 33 2
|
||||
BEGIN
|
||||
KEY "Indirizzo"
|
||||
PROMPT 1 3 ""
|
||||
FIELD 90->INDIRIZZO
|
||||
END
|
||||
|
||||
STRINGA 5 4
|
||||
BEGIN
|
||||
KEY "Codice localita'"
|
||||
PROMPT 0 0 ""
|
||||
FLAG "H"
|
||||
FIELD 90->LOCALITA
|
||||
MESSAGE ENABLE,1@|DISABLE,2@
|
||||
MESSAGE EMPTY ENABLE,2@|DISABLE,1@
|
||||
END
|
||||
|
||||
STRINGA 6 5
|
||||
BEGIN
|
||||
KEY "CAP loc."
|
||||
PROMPT 1 5 ""
|
||||
FIELD 100@->S6
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
STRINGA 7 30
|
||||
BEGIN
|
||||
KEY "Localita'"
|
||||
PROMPT 0 0 ""
|
||||
FIELD 100@->S0
|
||||
GROUP 1
|
||||
FLAG "H"
|
||||
MESSAGE RESET,11|COPY,11
|
||||
END
|
||||
|
||||
STRINGA 8 5
|
||||
BEGIN
|
||||
KEY "CAP"
|
||||
PROMPT 1 5 ""
|
||||
FIELD 13->CAPCOM
|
||||
GROUP 2
|
||||
END
|
||||
|
||||
STRINGA 9 50
|
||||
BEGIN
|
||||
KEY "Comune"
|
||||
PROMPT 0 0 ""
|
||||
FIELD 13->DENCOM
|
||||
GROUP 2
|
||||
FLAG "H"
|
||||
MESSAGE RESET,11|COPY,11
|
||||
END
|
||||
|
||||
STRINGA 10 5
|
||||
BEGIN
|
||||
KEY "Provincia"
|
||||
PROMPT 0 0 ""
|
||||
FIELD 13->PROVCOM
|
||||
FLAG "H"
|
||||
MESSAGE APPEND,11
|
||||
END
|
||||
|
||||
STRINGA 11 27 2
|
||||
BEGIN
|
||||
KEY "Loc./Com. e Prov."
|
||||
PROMPT 7 5 ""
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
END
|
117
at/at_etmed.frm
Executable file
117
at/at_etmed.frm
Executable file
@ -0,0 +1,117 @@
|
||||
USE 97
|
||||
JOIN 13 INTO COM==COM
|
||||
JOIN LCP INTO CODTAB==LOCALITA
|
||||
|
||||
END
|
||||
DESCRIPTION
|
||||
BEGIN
|
||||
97->* "Medici"
|
||||
13->* "COMUNI"
|
||||
LCP->* "Località postali"
|
||||
END
|
||||
|
||||
GENERAL
|
||||
BEGIN
|
||||
OFFSET 0 0
|
||||
FONT "Arial"
|
||||
SIZE 12
|
||||
GRID ""
|
||||
END
|
||||
|
||||
SECTION BODY ODD 9
|
||||
|
||||
STRINGA 1 25
|
||||
BEGIN
|
||||
KEY "Cognome"
|
||||
FIELD 97->COGNOME
|
||||
PROMPT 0 0 ""
|
||||
FLAGS "H"
|
||||
MESSAGE RESET,3|COPY,3
|
||||
END
|
||||
|
||||
STRINGA 2 25
|
||||
BEGIN
|
||||
KEY "Nome"
|
||||
FIELD 97->NOME
|
||||
PROMPT 0 0 ""
|
||||
FLAGS "H"
|
||||
MESSAGE APPEND,3
|
||||
END
|
||||
|
||||
STRINGA 3 33 2
|
||||
BEGIN
|
||||
KEY "Cognome e nome"
|
||||
PROMPT 1 1 ""
|
||||
END
|
||||
|
||||
STRINGA 4 33 2
|
||||
BEGIN
|
||||
KEY "Indirizzo"
|
||||
PROMPT 1 3 ""
|
||||
FIELD 97->INDIRIZZO
|
||||
END
|
||||
|
||||
STRINGA 5 4
|
||||
BEGIN
|
||||
KEY "Codice localita'"
|
||||
PROMPT 0 0 ""
|
||||
FLAG "H"
|
||||
FIELD 97->LOCALITA
|
||||
MESSAGE ENABLE,1@|DISABLE,2@
|
||||
MESSAGE EMPTY ENABLE,2@|DISABLE,1@
|
||||
END
|
||||
|
||||
STRINGA 6 5
|
||||
BEGIN
|
||||
KEY "CAP loc."
|
||||
PROMPT 1 5 ""
|
||||
FIELD LCP->S6
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
STRINGA 7 30
|
||||
BEGIN
|
||||
KEY "Localita'"
|
||||
PROMPT 0 0 ""
|
||||
FIELD LCP->S0
|
||||
GROUP 1
|
||||
FLAG "H"
|
||||
MESSAGE RESET,11|COPY,11
|
||||
END
|
||||
|
||||
STRINGA 8 5
|
||||
BEGIN
|
||||
KEY "CAP"
|
||||
PROMPT 1 5 ""
|
||||
FIELD 13->CAPCOM
|
||||
GROUP 2
|
||||
END
|
||||
|
||||
STRINGA 9 50
|
||||
BEGIN
|
||||
KEY "Comune"
|
||||
PROMPT 0 0 ""
|
||||
FIELD 13->DENCOM
|
||||
GROUP 2
|
||||
FLAG "H"
|
||||
MESSAGE RESET,11|COPY,11
|
||||
END
|
||||
|
||||
STRINGA 10 5
|
||||
BEGIN
|
||||
KEY "Provincia"
|
||||
PROMPT 0 0 ""
|
||||
FIELD 13->PROVCOM
|
||||
FLAG "H"
|
||||
MESSAGE APPEND,11
|
||||
END
|
||||
|
||||
STRINGA 11 27 2
|
||||
BEGIN
|
||||
KEY "Loc./Com. e Prov."
|
||||
PROMPT 7 5 ""
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
END
|
134
at/at_etsez.frm
Executable file
134
at/at_etsez.frm
Executable file
@ -0,0 +1,134 @@
|
||||
USE 96
|
||||
JOIN 13 INTO COM==COM
|
||||
JOIN LCP INTO CODTAB==LOCALITA
|
||||
|
||||
END
|
||||
DESCRIPTION
|
||||
BEGIN
|
||||
96->* "Sezioni"
|
||||
13->* "COMUNI"
|
||||
LCP->* "Località postali"
|
||||
END
|
||||
|
||||
GENERAL
|
||||
BEGIN
|
||||
OFFSET 0 0
|
||||
FONT "Arial"
|
||||
SIZE 12
|
||||
GRID ""
|
||||
END
|
||||
|
||||
SECTION BODY ODD 9
|
||||
|
||||
STRINGA 1 25
|
||||
BEGIN
|
||||
KEY "Sezione"
|
||||
FIELD 96->DENSEZ
|
||||
PROMPT 0 0 ""
|
||||
FLAGS "H"
|
||||
MESSAGE RESET,4|COPY,4|"/",2
|
||||
END
|
||||
|
||||
STRINGA 13 25
|
||||
BEGIN
|
||||
KEY "/"
|
||||
FIELD 96->DENSOT
|
||||
PROMPT 0 0 ""
|
||||
FLAGS "H"
|
||||
MESSAGE EMPTY RESET,2
|
||||
END
|
||||
|
||||
STRINGA 2 1
|
||||
BEGIN
|
||||
KEY "/"
|
||||
PROMPT 0 0 ""
|
||||
FLAGS "H"
|
||||
MESSAGE APPEND,4
|
||||
END
|
||||
|
||||
STRINGA 3 25
|
||||
BEGIN
|
||||
KEY "Sottogruppo"
|
||||
FIELD 96->DENSOT
|
||||
PROMPT 0 0 ""
|
||||
FLAGS "H"
|
||||
MESSAGE APPEND,4
|
||||
END
|
||||
|
||||
STRINGA 4 33 3
|
||||
BEGIN
|
||||
KEY "Denominazione"
|
||||
PROMPT 1 1 "Spett.le AVIS "
|
||||
END
|
||||
|
||||
STRINGA 5 33 2
|
||||
BEGIN
|
||||
KEY "Indirizzo"
|
||||
PROMPT 1 4 ""
|
||||
FIELD 96->INDIRIZZO
|
||||
END
|
||||
|
||||
STRINGA 6 4
|
||||
BEGIN
|
||||
KEY "Codice localita'"
|
||||
PROMPT 0 0 ""
|
||||
FLAG "H"
|
||||
FIELD 96->LOCALITA
|
||||
MESSAGE ENABLE,1@|DISABLE,2@
|
||||
MESSAGE EMPTY ENABLE,2@|DISABLE,1@
|
||||
END
|
||||
|
||||
STRINGA 7 5
|
||||
BEGIN
|
||||
KEY "CAP loc."
|
||||
PROMPT 1 6 ""
|
||||
FIELD LCP->S6
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
STRINGA 8 30
|
||||
BEGIN
|
||||
KEY "Localita'"
|
||||
PROMPT 0 0 ""
|
||||
FIELD LCP->S0
|
||||
GROUP 1
|
||||
FLAG "H"
|
||||
MESSAGE RESET,12|COPY,12
|
||||
END
|
||||
|
||||
STRINGA 9 5
|
||||
BEGIN
|
||||
KEY "CAP"
|
||||
PROMPT 1 6 ""
|
||||
FIELD 13->CAPCOM
|
||||
GROUP 2
|
||||
END
|
||||
|
||||
STRINGA 10 50
|
||||
BEGIN
|
||||
KEY "Comune"
|
||||
PROMPT 0 0 ""
|
||||
FIELD 13->DENCOM
|
||||
GROUP 2
|
||||
FLAG "H"
|
||||
MESSAGE RESET,12|COPY,12
|
||||
END
|
||||
|
||||
STRINGA 11 5
|
||||
BEGIN
|
||||
KEY "Provincia"
|
||||
PROMPT 0 0 ""
|
||||
FIELD 13->PROVCOM
|
||||
FLAG "H"
|
||||
MESSAGE APPEND,12
|
||||
END
|
||||
|
||||
STRINGA 12 27 2
|
||||
BEGIN
|
||||
KEY "Loc./Com. e Prov."
|
||||
PROMPT 7 6 ""
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
END
|
117
at/at_etsog.frm
Executable file
117
at/at_etsog.frm
Executable file
@ -0,0 +1,117 @@
|
||||
USE 90
|
||||
JOIN 13 INTO COM==COM
|
||||
JOIN LCP ALIAS 100 INTO CODTAB==LOCALITA
|
||||
|
||||
END
|
||||
DESCRIPTION
|
||||
BEGIN
|
||||
90->* "Soggetti Sezioni AVIS"
|
||||
13->* "COMUNI"
|
||||
LCP->* "Località postali"
|
||||
END
|
||||
|
||||
GENERAL
|
||||
BEGIN
|
||||
OFFSET 0 0
|
||||
FONT "Arial"
|
||||
SIZE 12
|
||||
GRID ""
|
||||
END
|
||||
|
||||
SECTION BODY ODD 9
|
||||
|
||||
STRINGA 1 25
|
||||
BEGIN
|
||||
KEY "Cognome"
|
||||
FIELD 90->COGNOME
|
||||
PROMPT 0 0 ""
|
||||
FLAGS "H"
|
||||
MESSAGE RESET,3|COPY,3
|
||||
END
|
||||
|
||||
STRINGA 2 25
|
||||
BEGIN
|
||||
KEY "Nome"
|
||||
FIELD 90->NOME
|
||||
PROMPT 0 0 ""
|
||||
FLAGS "H"
|
||||
MESSAGE APPEND,3
|
||||
END
|
||||
|
||||
STRINGA 3 33 2
|
||||
BEGIN
|
||||
KEY "Cognome e nome"
|
||||
PROMPT 1 1 ""
|
||||
END
|
||||
|
||||
STRINGA 4 33 2
|
||||
BEGIN
|
||||
KEY "Indirizzo"
|
||||
PROMPT 1 3 ""
|
||||
FIELD 90->INDIRIZZO
|
||||
END
|
||||
|
||||
STRINGA 5 4
|
||||
BEGIN
|
||||
KEY "Codice localita'"
|
||||
PROMPT 0 0 ""
|
||||
FLAG "H"
|
||||
FIELD 90->LOCALITA
|
||||
MESSAGE ENABLE,1@|DISABLE,2@
|
||||
MESSAGE EMPTY ENABLE,2@|DISABLE,1@
|
||||
END
|
||||
|
||||
STRINGA 6 5
|
||||
BEGIN
|
||||
KEY "CAP loc."
|
||||
PROMPT 1 5 ""
|
||||
FIELD 100@->S6
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
STRINGA 7 30
|
||||
BEGIN
|
||||
KEY "Localita'"
|
||||
PROMPT 0 0 ""
|
||||
FIELD 100@->S0
|
||||
GROUP 1
|
||||
FLAG "H"
|
||||
MESSAGE RESET,11|COPY,11
|
||||
END
|
||||
|
||||
STRINGA 8 5
|
||||
BEGIN
|
||||
KEY "CAP"
|
||||
PROMPT 1 5 ""
|
||||
FIELD 13->CAPCOM
|
||||
GROUP 2
|
||||
END
|
||||
|
||||
STRINGA 9 50
|
||||
BEGIN
|
||||
KEY "Comune"
|
||||
PROMPT 0 0 ""
|
||||
FIELD 13->DENCOM
|
||||
GROUP 2
|
||||
FLAG "H"
|
||||
MESSAGE RESET,11|COPY,11
|
||||
END
|
||||
|
||||
STRINGA 10 5
|
||||
BEGIN
|
||||
KEY "Provincia"
|
||||
PROMPT 0 0 ""
|
||||
FIELD 13->PROVCOM
|
||||
FLAG "H"
|
||||
MESSAGE APPEND,11
|
||||
END
|
||||
|
||||
STRINGA 11 27 2
|
||||
BEGIN
|
||||
KEY "Loc./Com. e Prov."
|
||||
PROMPT 7 5 ""
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
END
|
260
at/at_pagin.frm
Executable file
260
at/at_pagin.frm
Executable file
@ -0,0 +1,260 @@
|
||||
USE 90
|
||||
JOIN 13 ALIAS 300 INTO COM==COM
|
||||
JOIN LCP ALIAS 100 INTO CODTAB==LOCALITA
|
||||
JOIN 96 INTO CODSEZ==CODSEZ
|
||||
JOIN CTD ALIAS 200 INTO CODTAB==CATDON
|
||||
JOIN CTN ALIAS 500 INTO CODTAB==CATNOND1
|
||||
JOIN CTN ALIAS 600 INTO CODTAB==CATNOND2
|
||||
JOIN 13 ALIAS 400 INTO COM==COMNASC
|
||||
|
||||
END
|
||||
DESCRIPTION
|
||||
BEGIN
|
||||
90->* "Soggetti Sezioni AVIS"
|
||||
13->* "COMUNI"
|
||||
LCP->* "Località postali"
|
||||
96->* "Sezioni AVIS"
|
||||
CTD->* "Categorie donatori"
|
||||
CTN->* "Categorie non donatori"
|
||||
END
|
||||
|
||||
GENERAL
|
||||
BEGIN
|
||||
OFFSET 0 0
|
||||
FONT "Arial"
|
||||
SIZE 12
|
||||
GRID ""
|
||||
END
|
||||
|
||||
SECTION BODY ODD 60
|
||||
|
||||
NUMERO 1 13
|
||||
BEGIN
|
||||
KEY "Codice"
|
||||
FIELD 90->CODICE
|
||||
PROMPT 1 1 "Codice "
|
||||
END
|
||||
|
||||
STRINGA 2 33
|
||||
BEGIN
|
||||
KEY "Cognome"
|
||||
FIELD 90->COGNOME
|
||||
PROMPT 1 2 "Cognome "
|
||||
END
|
||||
|
||||
STRINGA 3 33
|
||||
BEGIN
|
||||
KEY "Nome"
|
||||
FIELD 90->NOME
|
||||
PROMPT 35 2 "Nome "
|
||||
END
|
||||
|
||||
STRINGA 4 7
|
||||
BEGIN
|
||||
KEY "Codice sezione"
|
||||
FIELD 90->CODSEZ
|
||||
PROMPT 1 4 "Sez. "
|
||||
END
|
||||
|
||||
STRINGA 5 25
|
||||
BEGIN
|
||||
KEY "Denominazione sezione"
|
||||
FIELD 96->DENSEZ
|
||||
PROMPT 9 4 ""
|
||||
END
|
||||
|
||||
STRINGA 6 7
|
||||
BEGIN
|
||||
KEY "Codice sottog."
|
||||
FIELD 90->CODSOT
|
||||
PROMPT 1 5 "Sot. "
|
||||
END
|
||||
|
||||
STRINGA 7 25
|
||||
BEGIN
|
||||
KEY "Denominazione sottog."
|
||||
FIELD 96->DENSOT
|
||||
PROMPT 9 5 ""
|
||||
END
|
||||
|
||||
STRINGA 8 12
|
||||
BEGIN
|
||||
KEY "Categoria don."
|
||||
FIELD 90->CATDON
|
||||
PROMPT 35 4 "Categoria "
|
||||
END
|
||||
|
||||
STRINGA 9 25
|
||||
BEGIN
|
||||
KEY "Descrizione categoria"
|
||||
FIELD 200@->S0
|
||||
PROMPT 48 4 ""
|
||||
END
|
||||
|
||||
DATA 10 10
|
||||
BEGIN
|
||||
KEY "Data iscrizione"
|
||||
FIELD 90->DATAISC
|
||||
PROMPT 35 5 "Data iscr. "
|
||||
END
|
||||
|
||||
DATA 11 10
|
||||
BEGIN
|
||||
KEY "Data dimissione"
|
||||
FIELD 90->DATADIM
|
||||
PROMPT 56 5 "Data dim. "
|
||||
END
|
||||
|
||||
|
||||
STRINGA 13 50
|
||||
BEGIN
|
||||
KEY "Comune di nascita"
|
||||
PROMPT 0 0 ""
|
||||
FIELD 400@->DENCOM
|
||||
FLAG "H"
|
||||
MESSAGE RESET,15|COPY,15
|
||||
END
|
||||
|
||||
STRINGA 14 5
|
||||
BEGIN
|
||||
KEY "Provincia di nascita"
|
||||
PROMPT 0 0 ""
|
||||
FIELD 400@->PROVCOM
|
||||
FLAG "H"
|
||||
MESSAGE APPEND,15
|
||||
END
|
||||
|
||||
STRINGA 15 56
|
||||
BEGIN
|
||||
KEY "Comune e provincia di nascita"
|
||||
PROMPT 1 7 "Nato a "
|
||||
END
|
||||
|
||||
STRINGA 16 50
|
||||
BEGIN
|
||||
KEY "Indirizzo"
|
||||
FIELD 90->INDIRIZZO
|
||||
PROMPT 1 8 "Indirizzo "
|
||||
MESSAGE RESET,24
|
||||
END
|
||||
|
||||
STRINGA 17 4
|
||||
BEGIN
|
||||
KEY "Codice Localita"
|
||||
FIELD 90->LOCALITA
|
||||
PROMPT 0 0 ""
|
||||
FLAG "H"
|
||||
MESSAGE ENABLE,1@|DISABLE,2@
|
||||
MESSAGE EMPTY DISABLE,1@|ENABLE,2@
|
||||
END
|
||||
|
||||
STRINGA 18 5
|
||||
BEGIN
|
||||
KEY "CAP Loc."
|
||||
FIELD LCP->S6
|
||||
PROMPT 0 0 ""
|
||||
GROUP 1
|
||||
MESSAGE APPEND,24
|
||||
END
|
||||
|
||||
STRINGA 19 30
|
||||
BEGIN
|
||||
KEY "Localita"
|
||||
FIELD LCP->S0
|
||||
PROMPT 0 0 ""
|
||||
FLAG "H"
|
||||
GROUP 1
|
||||
MESSAGE APPEND,24
|
||||
END
|
||||
|
||||
STRINGA 20 5
|
||||
BEGIN
|
||||
KEY "CAP Comune"
|
||||
FIELD 300@->CAPCOM
|
||||
PROMPT 0 0 ""
|
||||
FLAG "H"
|
||||
GROUP 2
|
||||
MESSAGE APPEND,24
|
||||
END
|
||||
|
||||
STRINGA 21 50
|
||||
BEGIN
|
||||
KEY "Comune"
|
||||
FIELD 300@->DENCOM
|
||||
PROMPT 0 0 ""
|
||||
FLAG "H"
|
||||
MESSAGE APPEND,24
|
||||
END
|
||||
|
||||
STRINGA 22 5
|
||||
BEGIN
|
||||
KEY "Provincia"
|
||||
FIELD 300@->PROVCOM
|
||||
PROMPT 0 0 ""
|
||||
FLAG "H"
|
||||
MESSAGE APPEND,24
|
||||
END
|
||||
|
||||
STRINGA 23 11
|
||||
BEGIN
|
||||
KEY "Testo fisso"
|
||||
PROMPT 1 9 "Localita'"
|
||||
END
|
||||
|
||||
STRINGA 24 65 2
|
||||
BEGIN
|
||||
KEY "Loc/Com/Prov"
|
||||
PROMPT 11 9 ""
|
||||
END
|
||||
|
||||
STRINGA 25 30
|
||||
BEGIN
|
||||
KEY "Tel. abi."
|
||||
FIELD 90->TELABI
|
||||
PROMPT 1 10 "Tel.abit. "
|
||||
END
|
||||
|
||||
STRINGA 26 30
|
||||
BEGIN
|
||||
KEY "Tel. lav."
|
||||
FIELD 90->TELLAV
|
||||
PROMPT 31 10 "Tel.lavoro "
|
||||
END
|
||||
|
||||
STRINGA 27 30
|
||||
BEGIN
|
||||
KEY "Tel. altro"
|
||||
FIELD 90->TELALT
|
||||
PROMPT 61 10 "Tel.altro "
|
||||
END
|
||||
|
||||
STRINGA 31 13
|
||||
BEGIN
|
||||
KEY "Categoria non don. 1"
|
||||
FIELD 90->CATNOND1
|
||||
PROMPT 1 12 "Altre cat. "
|
||||
END
|
||||
|
||||
STRINGA 32 25
|
||||
BEGIN
|
||||
KEY "Descrizione cat."
|
||||
FIELD 500@->S0
|
||||
PROMPT 15 12 ""
|
||||
END
|
||||
STRINGA 33 2
|
||||
BEGIN
|
||||
KEY "Categoria non don. 2"
|
||||
FIELD 90->CATNOND1
|
||||
PROMPT 42 12 ""
|
||||
END
|
||||
|
||||
STRINGA 34 25
|
||||
BEGIN
|
||||
KEY "Descrizione cat."
|
||||
FIELD 600@->S0
|
||||
PROMPT 45 12 ""
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
END
|
53
at/atlib1.cpp
Executable file
53
at/atlib1.cpp
Executable file
@ -0,0 +1,53 @@
|
||||
#define XIDON_SI "SI"
|
||||
#define XIDON_AF "AF"
|
||||
|
||||
bool xis_idon_one(TString idon, const char* tipo)
|
||||
// verifica che l'idoneità "idon" sia del tipo "tipo"
|
||||
// esempio: se passo PL, AF restituisce TRUE
|
||||
{
|
||||
bool is_idon = FALSE;
|
||||
TTable ido("IDO");
|
||||
ido.put("CODTAB",idon);
|
||||
if (ido.read() == NOERR)
|
||||
{
|
||||
TString tipol(2);
|
||||
tipol = ido.get("S6");
|
||||
if (tipol == tipo)
|
||||
is_idon = TRUE;
|
||||
}
|
||||
return is_idon;
|
||||
}
|
||||
|
||||
bool xis_idon(TString id1, TString id2, TString id3, TString id4, const char* tipo)
|
||||
//verifica che almeno una delle "id" sia del tipo "tipo"
|
||||
{
|
||||
return (xis_idon_one(id1,tipo) || xis_idon_one(id2,tipo) || xis_idon_one(id3,tipo) || xis_idon_one(id4,tipo));
|
||||
}
|
||||
|
||||
bool xis_donaz(TString don, const char* tipo)
|
||||
// verifica che il tipo di donazione "don" sia del tipo "tipo"
|
||||
{
|
||||
bool is_don = FALSE;
|
||||
TTable tdn("TDN");
|
||||
tdn.put("CODTAB",don);
|
||||
if (tdn.read() == NOERR)
|
||||
{
|
||||
TString tipol(2);
|
||||
tipol = tdn.get("S6");
|
||||
if (tipol == tipo)
|
||||
is_don = TRUE;
|
||||
}
|
||||
return is_don;
|
||||
}
|
||||
|
||||
char xmodstato_tcs(TString tipo)
|
||||
//verifica se il controllo sanitario "tipo" è un controllo che modifica lo stato del soggetto
|
||||
{
|
||||
char modstato = ' ';
|
||||
TTable tcs("TCS");
|
||||
tcs.put("CODTAB",tipo);
|
||||
if (tcs.read() == NOERR)
|
||||
modstato = tcs.get_char("S6");
|
||||
return modstato;
|
||||
}
|
||||
|
26
at/atmsk.bat
Executable file
26
at/atmsk.bat
Executable file
@ -0,0 +1,26 @@
|
||||
call mskcomp at0100a
|
||||
call mskcomp at0200a
|
||||
call mskcomp at0300a
|
||||
call mskcomp at0700a
|
||||
call mskcomp at0800a
|
||||
call mskcomp at1100a
|
||||
call mskcomp at1200a
|
||||
call mskcomp at2100a
|
||||
call mskcomp at2200a
|
||||
call mskcomp at2300a
|
||||
call mskcomp at2400a
|
||||
call mskcomp at2500a
|
||||
call mskcomp at2600a
|
||||
call mskcomp at3100a
|
||||
call mskcomp at3200a
|
||||
call mskcomp at3300a
|
||||
call mskcomp at3400a
|
||||
call mskcomp at4100a
|
||||
call mskcomp batbbnz
|
||||
call mskcomp batbctd
|
||||
call mskcomp batbctn
|
||||
call mskcomp batbido
|
||||
call mskcomp batblcp
|
||||
call mskcomp batbldn
|
||||
call mskcomp batbtcs
|
||||
call mskcomp batbtdn
|
257
at/attransf.cpp
Executable file
257
at/attransf.cpp
Executable file
@ -0,0 +1,257 @@
|
||||
#include <execp.h>
|
||||
#include <prefix.h>
|
||||
#include <printapp.h>
|
||||
#include <relation.h>
|
||||
#include <tabutil.h>
|
||||
|
||||
// trasferimenti
|
||||
|
||||
|
||||
class TField_text : public TObject
|
||||
{
|
||||
int _pos;
|
||||
int _from;
|
||||
int _to;
|
||||
|
||||
struct TField_Flags
|
||||
{
|
||||
bool rightjust : 1;
|
||||
byte trim : 2; // Trim the string
|
||||
bool uppercase : 1;
|
||||
bool zerofilled : 1;
|
||||
|
||||
char update(const char*);
|
||||
TField_Flags(const char* flags) {update(flags);}
|
||||
TField_Flags();
|
||||
} _flags;
|
||||
protected:
|
||||
|
||||
public:
|
||||
TField_text(int pos, int from, int to, const char* flags);
|
||||
~TField_text();
|
||||
};
|
||||
|
||||
TField_text::TField_text(int pos, int from, int to, const char* flags)
|
||||
{
|
||||
_pos = pos;
|
||||
_from = from;
|
||||
_to = to;
|
||||
_flags.update(flags);
|
||||
};
|
||||
|
||||
TField_text::TField_Flags::TField_Flags()
|
||||
{
|
||||
uppercase = FALSE;
|
||||
rightjust = FALSE;
|
||||
zerofilled = FALSE;
|
||||
trim = 3;
|
||||
};
|
||||
|
||||
char TField_text::TField_Flags::update(const char* f)
|
||||
{
|
||||
for (const char* s = f; *s; s++)
|
||||
switch(*s)
|
||||
{
|
||||
case '#':
|
||||
trim = 2; break;
|
||||
case '@':
|
||||
trim = 1; break;
|
||||
case ' ':
|
||||
case '_':
|
||||
trim = 0; break;
|
||||
case 'R':
|
||||
rightjust = TRUE; break;
|
||||
case 'U':
|
||||
uppercase = TRUE; break;
|
||||
case 'Z':
|
||||
zerofilled = TRUE; break;
|
||||
default :
|
||||
CHECKS(FALSE, "FLAG sconosciuto in ", f);
|
||||
break;
|
||||
}
|
||||
return *s;
|
||||
}
|
||||
|
||||
class TRecord_text : TToken_string
|
||||
{
|
||||
int _numrec;
|
||||
public:
|
||||
const char* get_field(int pos, int from, int to);
|
||||
TRecord_text();
|
||||
};
|
||||
|
||||
const char* TRecord_text::get_field(int pos, int from, int to)
|
||||
{
|
||||
if (from == 0 && to == 0)
|
||||
return TToken_string::get(pos);
|
||||
else
|
||||
{
|
||||
TString record = TToken_string::get(0);
|
||||
return record.sub(from, to);
|
||||
}
|
||||
}
|
||||
|
||||
class TFiletext_len : public TObject
|
||||
{
|
||||
char _name[20];
|
||||
word _len;
|
||||
TRecord_text* _current;
|
||||
|
||||
public:
|
||||
TRecord_text& curr() {return *_current;}
|
||||
};
|
||||
|
||||
|
||||
class TTransfer : public TObject
|
||||
{
|
||||
|
||||
TCursor* _cursor;
|
||||
TConfig* _config;
|
||||
|
||||
link_item* _pr_tree;
|
||||
int _cur_file;
|
||||
|
||||
link_item* _look_transf_node(link_item* head, int logicnum);
|
||||
void _reset_tree(link_item* head);
|
||||
|
||||
protected:
|
||||
|
||||
void create_cursor(TRelation* r, const char* filter, int nkey,
|
||||
const TRectype *from, const TRectype* to);
|
||||
void create_config(const char* file);
|
||||
virtual bool preprocess_record(int file, int counter) { return TRUE; }
|
||||
virtual bool preprocess_transf(int file, int counter) { return TRUE; }
|
||||
virtual bool postprocess_record(int file, int counter) { return TRUE; }
|
||||
virtual bool postprocess_transf(int file, int counter) { return TRUE; }
|
||||
|
||||
public:
|
||||
void reset_files();
|
||||
void add_file(int file, int from = 0);
|
||||
void add_file(const char* tab, int from = 0);
|
||||
|
||||
bool add(TLocalisamfile* f, const char* relexprs, int key, int linkto,
|
||||
int alias, bool allow_lock);
|
||||
bool add(int logicnum, const char* relexprs, int key = 1, int linkto = 0,
|
||||
int alias = 0, bool allow_lock = FALSE);
|
||||
bool add(const char* tabname, const char* relexprs, int key = 1, int linkto = 0,
|
||||
int alias = 0, bool allow_lock = FALSE);
|
||||
|
||||
bool do_load();
|
||||
bool do_dump();
|
||||
|
||||
TTransfer();
|
||||
virtual ~TTransfer();
|
||||
|
||||
};
|
||||
|
||||
TTransfer::~TTransfer()
|
||||
{
|
||||
if (_cursor != NULL)
|
||||
delete _cursor;
|
||||
if (_config != NULL)
|
||||
delete _config;
|
||||
}
|
||||
|
||||
void TTransfer::create_cursor(TRelation* r, const char* filter, int nkey,
|
||||
const TRectype* from, const TRectype* to)
|
||||
{
|
||||
CHECK(_cursor == NULL, "Il cursore esiste già");
|
||||
_cursor = new TCursor(r, filter, nkey, from, to);
|
||||
}
|
||||
|
||||
void TTransfer::create_config(const char* file)
|
||||
{
|
||||
CHECK(_config == NULL, "La configurazione esiste già");
|
||||
_config = new TConfig(file, "HEADER");
|
||||
}
|
||||
|
||||
void TTransfer::_reset_tree(link_item* head)
|
||||
{
|
||||
if (head)
|
||||
{
|
||||
if (head->_brother)
|
||||
_reset_tree(head->_brother);
|
||||
if (head->_son)
|
||||
_reset_tree(head->_son);
|
||||
delete head;
|
||||
}
|
||||
}
|
||||
|
||||
link_item* TTransfer::_look_transf_node(link_item* head, int logicnum)
|
||||
{
|
||||
link_item* s;
|
||||
while (head)
|
||||
{
|
||||
if (head->_logicnum == logicnum)
|
||||
return head;
|
||||
else if (head->_son)
|
||||
if ((s = _look_transf_node(head->_son, logicnum)) != NULL)
|
||||
return s;
|
||||
head = head->_brother;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void TTransfer::add_file(const char* tab, int from)
|
||||
{
|
||||
add_file(TTable::name2log(tab), from);
|
||||
}
|
||||
|
||||
void TTransfer::add_file(int file, int from)
|
||||
{
|
||||
link_item *nw = new link_item(file);
|
||||
if (_pr_tree == NULL)
|
||||
{
|
||||
_pr_tree = nw;
|
||||
return;
|
||||
}
|
||||
|
||||
if (from == 0)
|
||||
from = _pr_tree->_logicnum;
|
||||
|
||||
link_item *fr = _look_transf_node(_pr_tree, from);
|
||||
|
||||
CHECKD(fr, "add_file: nonexistent node: logicnum = ", from);
|
||||
|
||||
if (fr->_son)
|
||||
{
|
||||
fr = fr->_son;
|
||||
while (fr->_brother)
|
||||
fr = fr->_brother;
|
||||
fr->_brother = nw;
|
||||
}
|
||||
else
|
||||
fr->_son = nw;
|
||||
}
|
||||
|
||||
// aggiunge un file alla relazione del cursore (come add della TRelation)
|
||||
bool TTransfer::add(TLocalisamfile* f, const char* relexprs, int key, int linkto,
|
||||
int alias, bool allow_lock)
|
||||
{
|
||||
return _cursor->relation()->add(f, relexprs, key, linkto, alias, allow_lock);
|
||||
}
|
||||
|
||||
bool TTransfer::add(int logicnum, const char* relexprs, int key, int linkto,
|
||||
int alias, bool allow_lock)
|
||||
{
|
||||
return _cursor->relation()->add(logicnum, relexprs, key, linkto, alias, allow_lock);
|
||||
}
|
||||
|
||||
bool TTransfer::add(const char* tabname, const char* relexprs, int key, int linkto,
|
||||
int alias, bool allow_lock)
|
||||
{
|
||||
return _cursor->relation()->add(tabname, relexprs, key, linkto, alias, allow_lock);
|
||||
}
|
||||
|
||||
bool TTransfer::do_load()
|
||||
{
|
||||
CHECK((_config != NULL) && (_cursor != NULL), "Non esistono cursore o config");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TTransfer::do_dump()
|
||||
{
|
||||
CHECK((_config != NULL) && (_cursor != NULL), "Non esistono cursore o config");
|
||||
|
||||
return TRUE;
|
||||
}
|
5
at/batbbnz.h
Executable file
5
at/batbbnz.h
Executable file
@ -0,0 +1,5 @@
|
||||
#define F_TABBNZ_CODTAB 100
|
||||
#define F_TABBNZ_DESCR 101
|
||||
#define F_TABBNZ_NDON 102
|
||||
#define F_TABBNZ_STATUTO 103
|
||||
#define DLG_DEL 105
|
56
at/batbbnz.uml
Executable file
56
at/batbbnz.uml
Executable file
@ -0,0 +1,56 @@
|
||||
#include "batbbnz.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
#include <toolbar.h>
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Benemerenze" -1 -1 78 7
|
||||
|
||||
STRING F_TABBNZ_CODTAB 2
|
||||
BEGIN
|
||||
PROMPT 2 1 "Codice "
|
||||
FIELD CODTAB
|
||||
HELP "Inserire il codice della benemerenza"
|
||||
USE BNZ
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT CODTAB F_TABBNZ_CODTAB
|
||||
DISPLAY "Codice " CODTAB
|
||||
DISPLAY "Descrizione@30" S0
|
||||
OUTPUT F_TABBNZ_CODTAB CODTAB
|
||||
OUTPUT F_TABBNZ_DESCR S0
|
||||
KEY 1
|
||||
FLAGS "URZ"
|
||||
END
|
||||
|
||||
STRING F_TABBNZ_DESCR 30
|
||||
BEGIN
|
||||
PROMPT 2 3 "Descrizione "
|
||||
FIELD S0
|
||||
HELP "Inserire la descrizione della benemerenza"
|
||||
USE BNZ KEY 2
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT S0 F_TABBNZ_DESCR
|
||||
DISPLAY "Descrizione@30" S0
|
||||
DISPLAY "Codice " CODTAB
|
||||
COPY OUTPUT F_TABBNZ_CODTAB
|
||||
KEY 2
|
||||
END
|
||||
|
||||
NUMBER F_TABBNZ_NDON 3
|
||||
BEGIN
|
||||
PROMPT 2 5 "Num. donazioni "
|
||||
FIELD I0
|
||||
HELP "Inserire il numero di donazioni necessarie per ottenere la benemerenza"
|
||||
CHECKTYPE REQUIRED
|
||||
FLAGS "U"
|
||||
END
|
||||
|
||||
BOOLEAN F_TABBNZ_STATUTO
|
||||
BEGIN
|
||||
PROMPT 30 5 "Da statuto "
|
||||
FIELD B0
|
||||
HELP "La benemerenza Š prevista nello statuto AVIS?"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
6
at/batbctd.h
Executable file
6
at/batbctd.h
Executable file
@ -0,0 +1,6 @@
|
||||
#define F_TABCTD_CODTAB 100
|
||||
#define F_TABCTD_DESCR 101
|
||||
#define F_TABCTD_DIMESSI 102
|
||||
#define F_TABCTD_CATCOLL 103
|
||||
#define F_DESCR_CATCOLL 104
|
||||
#define DLG_DEL 105
|
68
at/batbctd.uml
Executable file
68
at/batbctd.uml
Executable file
@ -0,0 +1,68 @@
|
||||
#include "batbctd.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
#include <toolbar.h>
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Categorie donatori" -1 -1 78 7
|
||||
|
||||
STRING F_TABCTD_CODTAB 2
|
||||
BEGIN
|
||||
PROMPT 2 1 "Codice "
|
||||
FIELD CODTAB
|
||||
HELP "Inserire il codice della categoria"
|
||||
USE CTD
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT CODTAB F_TABCTD_CODTAB
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@30" S0
|
||||
OUTPUT F_TABCTD_CODTAB CODTAB
|
||||
OUTPUT F_TABCTD_DESCR S0
|
||||
KEY 1
|
||||
FLAGS "URZ"
|
||||
END
|
||||
|
||||
STRING F_TABCTD_DESCR 30
|
||||
BEGIN
|
||||
PROMPT 2 3 "Descrizione "
|
||||
FIELD S0
|
||||
HELP "Inserire la descrizione della categoria"
|
||||
USE CTD KEY 2
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT S0 F_TABCTD_DESCR
|
||||
DISPLAY "Descrizione@30" S0
|
||||
DISPLAY "Codice" CODTAB
|
||||
COPY OUTPUT F_TABCTD_CODTAB
|
||||
KEY 2
|
||||
END
|
||||
|
||||
BOOLEAN F_TABCTD_DIMESSI
|
||||
BEGIN
|
||||
PROMPT 2 5 "Categoria di dimissione"
|
||||
FIELD B0
|
||||
HELP "Indicare se la categoria è di dimissione"
|
||||
END
|
||||
|
||||
STRING F_TABCTD_CATCOLL 2
|
||||
BEGIN
|
||||
PROMPT 2 7 "Cat. collegata "
|
||||
FIELD S6
|
||||
FLAGS "U"
|
||||
USE CTD SELECT B0!=#F_TABCTD_DIMESSI
|
||||
INPUT CODTAB F_TABCTD_CATCOLL
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@30" S0
|
||||
OUTPUT F_TABCTD_CATCOLL CODTAB
|
||||
OUTPUT F_DESCR_CATCOLL S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice non presente"
|
||||
END
|
||||
|
||||
STRING F_DESCR_CATCOLL 30
|
||||
BEGIN
|
||||
PROMPT 23 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
3
at/batbctn.h
Executable file
3
at/batbctn.h
Executable file
@ -0,0 +1,3 @@
|
||||
#define F_TABCTN_CODTAB 100
|
||||
#define F_TABCTN_DESCR 101
|
||||
#define DLG_DEL 105
|
40
at/batbctn.uml
Executable file
40
at/batbctn.uml
Executable file
@ -0,0 +1,40 @@
|
||||
#include "batbctn.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
#include <toolbar.h>
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Categorie non donatori" -1 -1 78 7
|
||||
|
||||
STRING F_TABCTN_CODTAB 2
|
||||
BEGIN
|
||||
PROMPT 2 1 "Codice "
|
||||
FIELD CODTAB
|
||||
HELP "Inserire il codice della categoria"
|
||||
USE CTN
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT CODTAB F_TABCTN_CODTAB
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@30" S0
|
||||
OUTPUT F_TABCTN_CODTAB CODTAB
|
||||
OUTPUT F_TABCTN_DESCR S0
|
||||
KEY 1
|
||||
FLAGS "URZ"
|
||||
END
|
||||
|
||||
STRING F_TABCTN_DESCR 30
|
||||
BEGIN
|
||||
PROMPT 2 3 "Descrizione "
|
||||
FIELD S0
|
||||
HELP "Inserire la descrizione della categoria"
|
||||
USE CTN KEY 2
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT S0 F_TABCTN_DESCR
|
||||
DISPLAY "Descrizione@30" S0
|
||||
DISPLAY "Codice" CODTAB
|
||||
COPY OUTPUT F_TABCTN_CODTAB
|
||||
KEY 2
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
4
at/batbido.h
Executable file
4
at/batbido.h
Executable file
@ -0,0 +1,4 @@
|
||||
#define F_TABIDO_CODTAB 100
|
||||
#define F_TABIDO_DESCR 101
|
||||
#define F_TABIDO_PROCDON 102
|
||||
#define DLG_DEL 105
|
48
at/batbido.uml
Executable file
48
at/batbido.uml
Executable file
@ -0,0 +1,48 @@
|
||||
#include "batbido.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
#include <toolbar.h>
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Idoneità alla donazione" -1 -1 78 7
|
||||
|
||||
STRING F_TABIDO_CODTAB 2
|
||||
BEGIN
|
||||
PROMPT 2 1 "Codice "
|
||||
FIELD CODTAB
|
||||
HELP "Inserire il codice della idoneità"
|
||||
USE IDO
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT CODTAB F_TABIDO_CODTAB
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@30" S0
|
||||
OUTPUT F_TABIDO_CODTAB CODTAB
|
||||
OUTPUT F_TABIDO_DESCR S0
|
||||
KEY 1
|
||||
FLAGS "URZ"
|
||||
END
|
||||
|
||||
STRING F_TABIDO_DESCR 30
|
||||
BEGIN
|
||||
PROMPT 2 3 "Descrizione "
|
||||
FIELD S0
|
||||
HELP "Inserire la descrizione della idoneità"
|
||||
USE IDO KEY 2
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT S0 F_TABIDO_DESCR
|
||||
DISPLAY "Descrizione@30" S0
|
||||
DISPLAY "Codice" CODTAB
|
||||
COPY OUTPUT F_TABIDO_CODTAB
|
||||
KEY 2
|
||||
END
|
||||
|
||||
LISTBOX F_TABIDO_PROCDON 17
|
||||
BEGIN
|
||||
PROMPT 2 5 "Procedura di don. "
|
||||
FIELD S6
|
||||
#include "procdon.h"
|
||||
HELP "Indicare la procedura di donazione collegata alla idoneità"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
7
at/batblcp.h
Executable file
7
at/batblcp.h
Executable file
@ -0,0 +1,7 @@
|
||||
#define F_TABLCP_CODTAB 100
|
||||
#define F_TABLCP_LOCALITA 101
|
||||
#define F_TABLCP_CAP 102
|
||||
#define F_TABLCP_COM 103
|
||||
#define F_DENCOM 104
|
||||
#define F_PROVCOM 105
|
||||
#define DLG_DEL 106
|
83
at/batblcp.uml
Executable file
83
at/batblcp.uml
Executable file
@ -0,0 +1,83 @@
|
||||
#include "batblcp.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
#include <toolbar.h>
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Località postali" -1 -1 78 7
|
||||
|
||||
STRING F_TABLCP_CODTAB 4
|
||||
BEGIN
|
||||
PROMPT 2 1 "Codice "
|
||||
FIELD CODTAB
|
||||
HELP "Inserire il codice della località"
|
||||
USE LCP
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT CODTAB F_TABLCP_CODTAB
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Denominazione@30" S0
|
||||
DISPLAY "CAP@5" S6
|
||||
OUTPUT F_TABLCP_CODTAB CODTAB
|
||||
OUTPUT F_TABLCP_LOCALITA S0
|
||||
KEY 1
|
||||
FLAGS "URZ"
|
||||
END
|
||||
|
||||
STRING F_TABLCP_LOCALITA 30
|
||||
BEGIN
|
||||
PROMPT 2 3 "Località "
|
||||
FIELD S0
|
||||
HELP "Inserire la denominazione della località"
|
||||
USE LCP KEY 2
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT S0 F_TABLCP_LOCALITA
|
||||
DISPLAY "Denominazione@30" S0
|
||||
DISPLAY "CAP@5" S6
|
||||
DISPLAY "Codice" CODTAB
|
||||
COPY OUTPUT F_TABLCP_CODTAB
|
||||
KEY 2
|
||||
END
|
||||
|
||||
STRING F_TABLCP_CAP 5
|
||||
BEGIN
|
||||
PROMPT 2 5 "CAP "
|
||||
FIELD S6
|
||||
HELP "Inserire il CAP della località"
|
||||
CHECKTYPE REQUIRED
|
||||
FLAGS "U"
|
||||
END
|
||||
|
||||
STRING F_TABLCP_COM 4
|
||||
BEGIN
|
||||
PROMPT 2 7 "Comune "
|
||||
FIELD S7
|
||||
FLAGS "U"
|
||||
USE LF_COMUNI
|
||||
INPUT STATO ""
|
||||
INPUT COM F_TABLCP_COM
|
||||
#include <comdcod.h>
|
||||
OUTPUT F_TABLCP_COM COM
|
||||
OUTPUT F_DENCOM DENCOM
|
||||
OUTPUT F_PROVCOM PROVCOM
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Comune assente"
|
||||
END
|
||||
|
||||
STRING F_DENCOM 50
|
||||
BEGIN
|
||||
PROMPT 19 7 ""
|
||||
USE LF_COMUNI KEY 2
|
||||
INPUT DENCOM F_DENCOM
|
||||
#include <comdden.h>
|
||||
COPY OUTPUT F_TABLCP_COM
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
STRING F_PROVCOM 5
|
||||
BEGIN
|
||||
PROMPT 73 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
3
at/batbldn.h
Executable file
3
at/batbldn.h
Executable file
@ -0,0 +1,3 @@
|
||||
#define F_TABLDN_CODTAB 100
|
||||
#define F_TABLDN_DESCR 101
|
||||
#define DLG_DEL 105
|
40
at/batbldn.uml
Executable file
40
at/batbldn.uml
Executable file
@ -0,0 +1,40 @@
|
||||
#include "batbldn.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
#include <toolbar.h>
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Luoghi di donazione" -1 -1 78 7
|
||||
|
||||
STRING F_TABLDN_CODTAB 4
|
||||
BEGIN
|
||||
PROMPT 2 1 "Codice "
|
||||
FIELD CODTAB
|
||||
HELP "Inserire il codice del luogo di donazione"
|
||||
USE LDN
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT CODTAB F_TABLDN_CODTAB
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@25" S0
|
||||
OUTPUT F_TABLDN_CODTAB CODTAB
|
||||
OUTPUT F_TABLDN_DESCR S0
|
||||
KEY 1
|
||||
FLAGS "URZ"
|
||||
END
|
||||
|
||||
STRING F_TABLDN_DESCR 25
|
||||
BEGIN
|
||||
PROMPT 2 3 "Descrizione "
|
||||
FIELD S0
|
||||
HELP "Inserire la descrizione del luogo"
|
||||
USE LDN KEY 2
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT S0 F_TABLDN_DESCR
|
||||
DISPLAY "Descrizione@25" S0
|
||||
DISPLAY "Codice" CODTAB
|
||||
COPY OUTPUT F_TABLDN_CODTAB
|
||||
KEY 2
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
5
at/batbtcs.h
Executable file
5
at/batbtcs.h
Executable file
@ -0,0 +1,5 @@
|
||||
#define F_TABTCS_CODTAB 100
|
||||
#define F_TABTCS_DESCR 101
|
||||
#define F_TABTCS_MODSTATO 102
|
||||
#define F_TABTCS_STATO 103
|
||||
#define DLG_DEL 105
|
62
at/batbtcs.uml
Executable file
62
at/batbtcs.uml
Executable file
@ -0,0 +1,62 @@
|
||||
#include "batbtcs.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
#include <toolbar.h>
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Tipi/Esiti controlli sanitari" -1 -1 78 7
|
||||
|
||||
STRING F_TABTCS_CODTAB 2
|
||||
BEGIN
|
||||
PROMPT 2 1 "Codice "
|
||||
FIELD CODTAB
|
||||
HELP "Inserire il codice del controllo"
|
||||
USE TCS
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT CODTAB F_TABTCS_CODTAB
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@30" S0
|
||||
OUTPUT F_TABTCS_CODTAB CODTAB
|
||||
OUTPUT F_TABTCS_DESCR S0
|
||||
KEY 1
|
||||
FLAGS "URZ"
|
||||
END
|
||||
|
||||
STRING F_TABTCS_DESCR 30
|
||||
BEGIN
|
||||
PROMPT 2 3 "Descrizione "
|
||||
FIELD S0
|
||||
HELP "Inserire la descrizione del controllo"
|
||||
USE TCS KEY 2
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT S0 F_TABTCS_DESCR
|
||||
DISPLAY "Descrizione@30" S0
|
||||
DISPLAY "Codice" CODTAB
|
||||
COPY OUTPUT F_TABTCS_CODTAB
|
||||
KEY 2
|
||||
END
|
||||
|
||||
RADIOBUTTON F_TABTCS_MODSTATO 23
|
||||
BEGIN
|
||||
PROMPT 2 5 "Modifica stato"
|
||||
FIELD S6
|
||||
ITEM "N|Non modifica"
|
||||
MESSAGE CLEAR, F_TABTCS_STATO
|
||||
MESSAGE DISABLE, F_TABTCS_STATO
|
||||
ITEM "I|Idoneità"
|
||||
MESSAGE ENABLE, F_TABTCS_STATO
|
||||
ITEM "S|Sospensione"
|
||||
MESSAGE ENABLE, F_TABTCS_STATO
|
||||
ITEM "F|Fine sospensione"
|
||||
MESSAGE ENABLE, F_TABTCS_STATO
|
||||
HELP "Indicare se il controllo modifica lo stato e in che modo"
|
||||
END
|
||||
|
||||
STRING F_TABTCS_STATO 20
|
||||
BEGIN
|
||||
PROMPT 24 5 "Stato "
|
||||
FIELD S3
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
8
at/batbtdn.h
Executable file
8
at/batbtdn.h
Executable file
@ -0,0 +1,8 @@
|
||||
#define F_TABTDN_CODTAB 100
|
||||
#define F_TABTDN_DESCR 101
|
||||
#define F_TABTDN_PROCDON 102
|
||||
#define F_TABTDN_IDON1 103
|
||||
#define F_DESC_I1 104
|
||||
#define F_TABTDN_IDON2 105
|
||||
#define F_DESC_I2 106
|
||||
#define DLG_DEL 107
|
86
at/batbtdn.uml
Executable file
86
at/batbtdn.uml
Executable file
@ -0,0 +1,86 @@
|
||||
#include "batbtdn.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
#include <toolbar.h>
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Tipi di donazione" -1 -1 78 7
|
||||
|
||||
STRING F_TABTDN_CODTAB 2
|
||||
BEGIN
|
||||
PROMPT 2 1 "Codice "
|
||||
FIELD CODTAB
|
||||
HELP "Inserire il codice del tipo di donazione"
|
||||
USE TDN
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT CODTAB F_TABTDN_CODTAB
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@30" S0
|
||||
OUTPUT F_TABTDN_CODTAB CODTAB
|
||||
OUTPUT F_TABTDN_DESCR S0
|
||||
KEY 1
|
||||
FLAGS "URZ"
|
||||
END
|
||||
|
||||
STRING F_TABTDN_DESCR 30
|
||||
BEGIN
|
||||
PROMPT 2 3 "Descrizione "
|
||||
FIELD S0
|
||||
HELP "Inserire la descrizione del tipo di donazione"
|
||||
USE TDN KEY 2
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT S0 F_TABTDN_DESCR
|
||||
DISPLAY "Descrizione@30" S0
|
||||
DISPLAY "Codice" CODTAB
|
||||
COPY OUTPUT F_TABTDN_CODTAB
|
||||
KEY 2
|
||||
END
|
||||
|
||||
LISTBOX F_TABTDN_PROCDON 17
|
||||
BEGIN
|
||||
PROMPT 2 5 "Procedura di donazione "
|
||||
FIELD S6
|
||||
#include "procdon.h"
|
||||
HELP "Indicare la procedura di donazione"
|
||||
END
|
||||
|
||||
STRING F_TABTDN_IDON1 2
|
||||
BEGIN
|
||||
PROMPT 2 7 "Idoneità necessarie: 1 "
|
||||
FIELD S7
|
||||
USE IDO SELECT S6==#F_TABTDN_PROCDON
|
||||
INPUT CODTAB F_TABTDN_IDON1
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@30" S0
|
||||
OUTPUT F_TABTDN_IDON1 CODTAB
|
||||
OUTPUT F_DESC_I1 S0
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
STRING F_DESC_I1 30
|
||||
BEGIN
|
||||
PROMPT 31 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_TABTDN_IDON2 2
|
||||
BEGIN
|
||||
PROMPT 2 9 " 2 "
|
||||
FIELD S8
|
||||
USE IDO SELECT S6==#F_TABTDN_PROCDON
|
||||
INPUT CODTAB F_TABTDN_IDON2
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@30" S0
|
||||
OUTPUT F_TABTDN_IDON2 CODTAB
|
||||
OUTPUT F_DESC_I2 S0
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
STRING F_DESC_I2 30
|
||||
BEGIN
|
||||
PROMPT 31 9 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
19
at/benem.cpp
Executable file
19
at/benem.cpp
Executable file
@ -0,0 +1,19 @@
|
||||
if (filtrato)
|
||||
{
|
||||
const TString benemerenza =
|
||||
TLocalisamfile* sog = &(rel->lfile(LF_SOGGETTI));
|
||||
TRectype* key = new TRectype(LF_BENEM);
|
||||
long codsog = sog->curr().get(SOG_CODICE);
|
||||
key->put(BEN_CODICE, codsog);
|
||||
err = _sbenemerenze->read(key);
|
||||
if (err == NOERR)
|
||||
{
|
||||
for (int r=1; r<=_sbenemerenze->rows(); r++)
|
||||
{
|
||||
const TRectype& riga = _sbenemerenze->row(r);
|
||||
const TString bene = riga.get(BEN_TIPOBEN);
|
||||
if (bene =
|
||||
row.add(riga.get(BEN_DATABEN));
|
||||
row.add(riga.get(BEN_RITIRATA));
|
||||
}
|
||||
|
7
at/benem.h
Executable file
7
at/benem.h
Executable file
@ -0,0 +1,7 @@
|
||||
// definizione campi dell'archivio BENEM
|
||||
|
||||
#define BEN_CODICE "CODICE"
|
||||
#define BEN_PROGBEN "PROGBEN"
|
||||
#define BEN_TIPOBEN "TIPOBEN"
|
||||
#define BEN_DATABEN "DATABEN"
|
||||
#define BEN_RITIRATA "RITIRATA"
|
20
at/chkdon.cpp
Executable file
20
at/chkdon.cpp
Executable file
@ -0,0 +1,20 @@
|
||||
bool TDonaz_app::check_don(const long codsog, const TDate datadon)
|
||||
{
|
||||
bool ok = TRUE;
|
||||
TRectype* key = new TRectype(LF_DONAZ);
|
||||
key->put(DON_CODICE, codsog);
|
||||
TRecord_array adon = TRecord_array(LF_DONAZ, DON_PROGDON);
|
||||
int err = adon.read(key);
|
||||
if (err == NOERR)
|
||||
{
|
||||
for (int r=1; r<=adon.rows(); r++)
|
||||
{
|
||||
const TRectype& riga = adon.row(r);
|
||||
const TDate dataact = riga.get(DON_DATADON);
|
||||
if (dataact == datadon)
|
||||
ok = FALSE;
|
||||
}
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
11
at/condocc.h
Executable file
11
at/condocc.h
Executable file
@ -0,0 +1,11 @@
|
||||
// listbox per condizione occupazionale
|
||||
|
||||
ITEM " |"
|
||||
ITEM "01|Occupato"
|
||||
ITEM "02|Disoccupato"
|
||||
ITEM "03|In cerca di 1° occ."
|
||||
ITEM "04|Pensionato"
|
||||
ITEM "05|Casalinga"
|
||||
ITEM "06|Studente"
|
||||
ITEM "07|Religioso"
|
||||
ITEM "99|Altro"
|
12
at/contsan.h
Executable file
12
at/contsan.h
Executable file
@ -0,0 +1,12 @@
|
||||
// definizione campi dell'archivio CONTSAN
|
||||
|
||||
#define CON_CODICE "CODICE"
|
||||
#define CON_PROGCON "PROGCON"
|
||||
#define CON_DATACON "DATACON"
|
||||
#define CON_TIPOCON "TIPOCON"
|
||||
#define CON_IDON1 "IDON1"
|
||||
#define CON_IDON2 "IDON2"
|
||||
#define CON_IDON3 "IDON3"
|
||||
#define CON_IDON4 "IDON4"
|
||||
#define CON_INTSI "INTSI"
|
||||
#define CON_INTAF "INTAF"
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user