Cris nevert commit . Shame on her
git-svn-id: svn://10.65.10.50/trunk@4223 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
00b0f2b8c2
commit
e1594fd672
57
at/acc.sql
Executable file
57
at/acc.sql
Executable file
@ -0,0 +1,57 @@
|
||||
PROMPT
|
||||
PROMPT
|
||||
PROMPT
|
||||
PROMPT
|
||||
PROMPT
|
||||
PROMPT
|
||||
PROMPT AGA Informatica S.r.l.
|
||||
PROMPT
|
||||
PROMPT
|
||||
PROMPT Gestione Sezione Provinciale AVIS
|
||||
PROMPT
|
||||
PROMPT
|
||||
PROMPT
|
||||
PROMPT TRASFERIMENTO ARCHIVIO ACCESSI DEI DONATORI DA SOFTEAM (ORACLE)
|
||||
PROMPT
|
||||
PROMPT
|
||||
PROMPT
|
||||
PROMPT
|
||||
PROMPT
|
||||
PROMPT Inserire il numero (SOFTEAM) della sezione da trasferire
|
||||
PROMPT
|
||||
ACCEPT SEZIONE NUMBER PROMPT 'SEZIONE: '
|
||||
SET HEADING OFF;
|
||||
SET PAUSE OFF;
|
||||
SET LINESIZE 500;
|
||||
SET PAGESIZE 500;
|
||||
COLUMN DINPACC FORMAT EDATE;
|
||||
COLUMN DTAPRA FORMAT EDATE;
|
||||
COLUMN DUIAD FORMAT EDATE;
|
||||
COLUMN DPRIIADTLL FORMAT EDATE;
|
||||
SPOOL ACC.TXT
|
||||
SELECT '%',
|
||||
NEVNACC,
|
||||
DINPACC,
|
||||
CPER,
|
||||
CCAS,
|
||||
CSAS,
|
||||
CTIAPVS,
|
||||
CTIAAVV,
|
||||
CPRA,
|
||||
ACCGGORPS,
|
||||
EAGESAACC,
|
||||
EAGFQDACC,
|
||||
EAGSTTACC,
|
||||
CUTR,
|
||||
DTAPRA,
|
||||
PROPRA,
|
||||
DUIAD,
|
||||
DPRIIADTLL
|
||||
FROM ACC
|
||||
WHERE CSAS = &SEZIONE;
|
||||
SPOOL OFF;
|
||||
SET LINESIZE 79;
|
||||
SET PAGESIZE 25;
|
||||
SET PAUSE ON;
|
||||
SET HEADING ON;
|
||||
QUIT
|
||||
56
at/at0.cpp
56
at/at0.cpp
@ -1,27 +1,29 @@
|
||||
#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;
|
||||
}
|
||||
#include <xvt.h>
|
||||
#include <strings.h>
|
||||
#include <checks.h>
|
||||
|
||||
#include "at0.h"
|
||||
|
||||
#define usage "Error - usage : %s -{0|1|2|3}"
|
||||
|
||||
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;
|
||||
case 3:
|
||||
rt = at0400(argc,argv) ; break;
|
||||
default:
|
||||
error_box(usage, argv[0]) ; break;
|
||||
}
|
||||
return rt;
|
||||
}
|
||||
|
||||
1
at/at0.h
1
at/at0.h
@ -4,6 +4,7 @@
|
||||
int at0100(int argc, char* argv[]);
|
||||
int at0200(int argc, char* argv[]);
|
||||
int at0300(int argc, char* argv[]);
|
||||
int at0400(int argc, char* argv[]);
|
||||
|
||||
#endif // __AT0_H
|
||||
|
||||
|
||||
13
at/at0.url
13
at/at0.url
@ -1,6 +1,7 @@
|
||||
#define APPNAME AVIS
|
||||
#define QAPPNAME "AVIS"
|
||||
#define LIBDIR f:\xvt.403\win_x86\ptk\lib
|
||||
#define QFIRMNAME "AGA Informatica S.r.l."
|
||||
|
||||
#include <default.url>
|
||||
|
||||
@ -9,28 +10,22 @@ MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
|
||||
/* at0 -1 inserimento donazioni */
|
||||
/* at0 -1 giornaliero donazioni/controlli */
|
||||
MENUBAR MENU_BAR(1)
|
||||
|
||||
MENU MENU_BAR(1)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
|
||||
/* at0 -2 chiusura annuale */
|
||||
/* at0 -2 giornaliero controlli */
|
||||
MENUBAR MENU_BAR(2)
|
||||
|
||||
MENU MENU_BAR(2)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* ba1 -3 */
|
||||
/* at0 -3 gestione convocazione */
|
||||
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"
|
||||
|
||||
|
||||
373
at/at0100a.h
373
at/at0100a.h
@ -1,185 +1,188 @@
|
||||
// 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_TESSAVIS 105
|
||||
#define F_CODSEZ 106
|
||||
#define F_DENSEZ 107
|
||||
#define F_CODSOT 108
|
||||
#define F_DENSOT 109
|
||||
#define F_CATDON 110
|
||||
#define F_DESC_CATDON 111
|
||||
#define F_DATAISC 112
|
||||
#define F_DATADIM 113
|
||||
#define F_DOM_INDIR 114
|
||||
#define F_DOM_CODCOM 115
|
||||
#define F_DOM_DENCOM 116
|
||||
#define F_DOM_CAPCOM 117
|
||||
#define F_DOM_PROVCOM 118
|
||||
#define F_DOM_CODLOC 119
|
||||
#define F_DOM_DENLOC 120
|
||||
#define F_DOM_STRADA 121
|
||||
#define F_DOM_DISTRI 122
|
||||
#define F_RES_INDIR 123
|
||||
#define F_RES_CODCOM 124
|
||||
#define F_RES_DENCOM 125
|
||||
#define F_RES_CAPCOM 126
|
||||
#define F_RES_PROVCOM 127
|
||||
#define F_RES_CODLOC 128
|
||||
#define F_RES_DENLOC 129
|
||||
#define F_COMNASC 130
|
||||
#define F_DENCOMNASC 131
|
||||
#define F_PROVCOMNASC 132
|
||||
#define F_SESSO 133
|
||||
#define F_CF 134
|
||||
#define F_DOCID 135
|
||||
#define F_TELABI 136
|
||||
#define F_TELLAV 137
|
||||
#define F_TELALT 138
|
||||
|
||||
// pagina 2
|
||||
#define F_CATNOND1 201
|
||||
#define F_DESC_CATNOND1 202
|
||||
#define F_CATNOND2 203
|
||||
#define F_DESC_CATNOND2 204
|
||||
#define F_CODCL 205
|
||||
#define F_CODCT 206
|
||||
#define F_TESSSSN 207
|
||||
#define F_TITINDIR 208
|
||||
#define F_CODMED 209
|
||||
#define F_COGNMED 210
|
||||
#define F_NOMMED 211
|
||||
#define F_GRUPPOAB0 212
|
||||
#define F_RHANTID 213
|
||||
#define F_KELL 214
|
||||
#define F_FENOTIPORH 215
|
||||
#define F_DU 216
|
||||
#define F_MODCONV 217
|
||||
#define F_PUNTORACC 218
|
||||
#define F_DESC_PUNTORACC 219
|
||||
#define F_GPD_LUN 220
|
||||
#define F_GPD_MAR 221
|
||||
#define F_GPD_MER 222
|
||||
#define F_GPD_GIO 223
|
||||
#define F_GPD_VEN 224
|
||||
#define F_GPD_SAB 225
|
||||
#define F_GPD_DOM 226
|
||||
#define F_GPC_LUN 227
|
||||
#define F_GPC_MAR 228
|
||||
#define F_GPC_MER 229
|
||||
#define F_GPC_GIO 230
|
||||
#define F_GPC_VEN 231
|
||||
#define F_GPC_SAB 232
|
||||
#define F_GPC_DOM 233
|
||||
|
||||
|
||||
// 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
|
||||
#define F_DATACONV 326
|
||||
#define F_NUMCONV 327
|
||||
|
||||
// pagina 4
|
||||
#define F_CONDOCC 401
|
||||
#define F_POSPROF 402
|
||||
#define F_RAMOATT 403
|
||||
#define F_TITSTUD 404
|
||||
#define F_PROFESS 405
|
||||
#define F_DESC_PROFESS 406
|
||||
#define F_LUOGOLAV 407
|
||||
#define F_DESC_LUOGOLAV 408
|
||||
#define F_ESCLUSO 409
|
||||
#define F_TERMESCL 410
|
||||
#define F_MOTESCL 411
|
||||
#define F_UTENULTAGG 412
|
||||
#define F_DATAULTAGG 413
|
||||
|
||||
// pagina 5
|
||||
#define F_DONAZIONI 501
|
||||
|
||||
// pagina 6
|
||||
#define F_CONTROLLI 601
|
||||
|
||||
// pagina 7
|
||||
#define F_BENEMERENZE 701
|
||||
#define F_STORICO 702
|
||||
|
||||
// bottoni personalizzati per l'applicazione
|
||||
#define DLG_GENDON 801
|
||||
|
||||
// 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_PROSSTIPO 109
|
||||
#define F_C_PROSSDATA 110
|
||||
#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
|
||||
#define F_C_DESC_PROSSTIPO 216
|
||||
|
||||
// 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
|
||||
|
||||
// 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_TESSAVIS 105
|
||||
#define F_T_STAMPATA 106
|
||||
#define F_CODSEZ 107
|
||||
#define F_DENSEZ 108
|
||||
#define F_CODSOT 109
|
||||
#define F_DENSOT 110
|
||||
#define F_CATDON 111
|
||||
#define F_DESC_CATDON 112
|
||||
#define F_DATAISC 113
|
||||
#define F_DATADIM 114
|
||||
#define F_DOM_INDIR 115
|
||||
#define F_DOM_CODCOM 116
|
||||
#define F_DOM_DENCOM 117
|
||||
#define F_DOM_CAPCOM 118
|
||||
#define F_DOM_PROVCOM 119
|
||||
#define F_DOM_CODLOC 120
|
||||
#define F_DOM_DENLOC 121
|
||||
#define F_DOM_STRADA 122
|
||||
#define F_DOM_DISTRI 123
|
||||
#define F_RES_INDIR 124
|
||||
#define F_RES_CODCOM 125
|
||||
#define F_RES_DENCOM 126
|
||||
#define F_RES_CAPCOM 127
|
||||
#define F_RES_PROVCOM 128
|
||||
#define F_RES_CODLOC 129
|
||||
#define F_RES_DENLOC 130
|
||||
#define F_COMNASC 131
|
||||
#define F_DENCOMNASC 132
|
||||
#define F_PROVCOMNASC 133
|
||||
#define F_SESSO 134
|
||||
#define F_CF 135
|
||||
#define F_DOCID 136
|
||||
#define F_TELABI 137
|
||||
#define F_TELLAV 138
|
||||
#define F_TELALT 139
|
||||
|
||||
// pagina 2
|
||||
#define F_CATNOND1 201
|
||||
#define F_DESC_CATNOND1 202
|
||||
#define F_CATNOND2 203
|
||||
#define F_DESC_CATNOND2 204
|
||||
#define F_GRUPPOAZIE 205
|
||||
#define F_DESC_GRUPPOAZIE 206
|
||||
#define F_CODCL 207
|
||||
#define F_CODCT 208
|
||||
#define F_TESSSSN 209
|
||||
#define F_TITINDIR 210
|
||||
#define F_CODMED 211
|
||||
#define F_COGNMED 212
|
||||
#define F_NOMMED 213
|
||||
#define F_GRUPPOAB0 214
|
||||
#define F_RHANTID 215
|
||||
#define F_KELL 216
|
||||
#define F_FENOTIPORH 217
|
||||
#define F_DU 218
|
||||
#define F_MODCONV 219
|
||||
#define F_PUNTORACC 220
|
||||
#define F_DESC_PUNTORACC 221
|
||||
#define F_GPD_LUN 222
|
||||
#define F_GPD_MAR 223
|
||||
#define F_GPD_MER 224
|
||||
#define F_GPD_GIO 225
|
||||
#define F_GPD_VEN 226
|
||||
#define F_GPD_SAB 227
|
||||
#define F_GPD_DOM 228
|
||||
#define F_GPC_LUN 229
|
||||
#define F_GPC_MAR 230
|
||||
#define F_GPC_MER 231
|
||||
#define F_GPC_GIO 232
|
||||
#define F_GPC_VEN 233
|
||||
#define F_GPC_SAB 234
|
||||
#define F_GPC_DOM 235
|
||||
|
||||
|
||||
// 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
|
||||
#define F_DATACONV 326
|
||||
#define F_NUMCONV 327
|
||||
|
||||
// pagina 4
|
||||
#define F_CONDOCC 401
|
||||
#define F_POSPROF 402
|
||||
#define F_RAMOATT 403
|
||||
#define F_TITSTUD 404
|
||||
#define F_PROFESS 405
|
||||
#define F_DESC_PROFESS 406
|
||||
#define F_LUOGOLAV 407
|
||||
#define F_DESC_LUOGOLAV 408
|
||||
#define F_ESCLUSO 409
|
||||
#define F_TERMESCL 410
|
||||
#define F_MOTESCL 411
|
||||
#define F_UTENULTAGG 412
|
||||
#define F_DATAULTAGG 413
|
||||
#define F_NOTE 414
|
||||
|
||||
// pagina 5
|
||||
#define F_DONAZIONI 501
|
||||
#define F_GENERA 502
|
||||
|
||||
// pagina 6
|
||||
#define F_CONTROLLI 601
|
||||
|
||||
// pagina 7
|
||||
#define F_BENEMERENZE 701
|
||||
#define F_FAMIGLIA 702
|
||||
#define F_STORICO 703
|
||||
|
||||
// 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_PROSSTIPO 109
|
||||
#define F_C_PROSSDATA 110
|
||||
#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
|
||||
#define F_C_DESC_PROSSTIPO 216
|
||||
|
||||
// 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
|
||||
|
||||
|
||||
4002
at/at0100a.uml
4002
at/at0100a.uml
File diff suppressed because it is too large
Load Diff
20
at/at0100b.h
Executable file
20
at/at0100b.h
Executable file
@ -0,0 +1,20 @@
|
||||
// definizione dei campi della maschera at0100c.msk
|
||||
// genera donazioni
|
||||
|
||||
// pagina 1
|
||||
#define F_QUANTEGEN 101
|
||||
#define F_COMEGEN 102
|
||||
#define F_FINOALGEN 103
|
||||
#define F_TIPOGEN 104
|
||||
#define F_D_TIPOGEN 105
|
||||
#define F_LUOGOGEN 106
|
||||
#define F_D_LUOGOGEN 107
|
||||
#define F_ESEGUIGEN 108
|
||||
#define F_DONGEN 109
|
||||
|
||||
// pagina donazione
|
||||
#define F_G_DATA 101
|
||||
#define F_G_TIPO 102
|
||||
#define F_G_LUOGO 103
|
||||
#define F_G_D_TIPO 210
|
||||
#define F_G_D_LUOGO 211
|
||||
159
at/at0100b.uml
Executable file
159
at/at0100b.uml
Executable file
@ -0,0 +1,159 @@
|
||||
#include "at0100b.h"
|
||||
#include "lf.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
|
||||
|
||||
BUTTON DLG_OK 10 2
|
||||
BEGIN
|
||||
PROMPT -12 -11 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_CANCEL 10 2
|
||||
BEGIN
|
||||
PROMPT -22 -11 ""
|
||||
END
|
||||
|
||||
//#include <toolbar.h>
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Genera donazioni" -1 -1 78 20
|
||||
|
||||
NUMBER F_QUANTEGEN 3
|
||||
BEGIN
|
||||
PROMPT 2 2 "Numero donazioni da generare "
|
||||
HELP "Numero donazioni da generare"
|
||||
END
|
||||
|
||||
RADIOBUTTON F_COMEGEN 17
|
||||
BEGIN
|
||||
PROMPT 2 3 "Modalita' "
|
||||
ITEM "A|Automatica"
|
||||
MESSAGE ENABLE,F_FINOALGEN
|
||||
MESSAGE DISABLE,F_DONGEN
|
||||
ITEM "M|Manuale"
|
||||
MESSAGE ENABLE,F_DONGEN
|
||||
MESSAGE DISABLE,F_FINOALGEN
|
||||
HELP "Modalita' di generazione: automatica o manuale (inserire solo le date)"
|
||||
END
|
||||
|
||||
DATE F_FINOALGEN
|
||||
BEGIN
|
||||
PROMTP 2 7 "Fino al "
|
||||
VALIDATE NOT_EMPTY_FUNC
|
||||
HELP "Data ultima donazione da generare"
|
||||
END
|
||||
|
||||
STRING F_TIPOGEN 2
|
||||
BEGIN
|
||||
PROMPT 2 8 "Tipo don. "
|
||||
FLAGS "U"
|
||||
USE TDN
|
||||
INPUT CODTAB F_TIPOGEN
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_TIPOGEN CODTAB
|
||||
OUTPUT F_D_TIPOGEN S0
|
||||
CHECKTYPE REQUIRED
|
||||
VALIDATE NOT_EMPTY_FUNC
|
||||
WARNING "Codice tipo donazione non presente"
|
||||
HELP "Tipo donazione"
|
||||
END
|
||||
|
||||
STRING F_D_TIPOGEN 25
|
||||
BEGIN
|
||||
PROMPT 20 8 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_LUOGOGEN 4
|
||||
BEGIN
|
||||
PROMPT 2 9 "Luogo don. "
|
||||
FLAGS "U"
|
||||
USE LDN
|
||||
INPUT CODTAB F_LUOGOGEN
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_LUOGOGEN CODTAB
|
||||
OUTPUT F_D_LUOGOGEN S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice luogo donazione non presente"
|
||||
HELP "Luogo donazione"
|
||||
END
|
||||
|
||||
STRING F_D_LUOGOGEN 25
|
||||
BEGIN
|
||||
PROMPT 20 9 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
BUTTON F_ESEGUIGEN 21 2
|
||||
BEGIN
|
||||
PROMPT 2 11 "Esegui generazione"
|
||||
END
|
||||
|
||||
SPREADSHEET F_DONGEN 29 18
|
||||
BEGIN
|
||||
PROMPT 50 2 ""
|
||||
ITEM "Data@10"
|
||||
ITEM "Tipo"
|
||||
ITEM "Luogo"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
|
||||
PAGE "Riga donazione" -1 -1 60 12
|
||||
|
||||
DATE F_G_DATA
|
||||
BEGIN
|
||||
PROMPT 2 2 "Data "
|
||||
END
|
||||
|
||||
STRING F_G_TIPO 2
|
||||
BEGIN
|
||||
PROMPT 2 3 "Tipo "
|
||||
FLAGS "U"
|
||||
USE TDN
|
||||
INPUT CODTAB F_G_TIPO
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_G_TIPO CODTAB
|
||||
OUTPUT F_G_D_TIPO S0
|
||||
CHECKTYPE REQUIRED
|
||||
VALIDATE NOT_EMPTY_FUNC
|
||||
WARNING "Codice tipo donazione non presente"
|
||||
HELP "Tipo donazione"
|
||||
END
|
||||
|
||||
STRING F_G_LUOGO 4
|
||||
BEGIN
|
||||
PROMPT 2 5 "Luogo donazione "
|
||||
FLAGS "U"
|
||||
USE LDN
|
||||
INPUT CODTAB F_G_LUOGO
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_G_LUOGO CODTAB
|
||||
OUTPUT F_G_D_LUOGO S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice luogo donazione non presente"
|
||||
HELP "Luogo donazione"
|
||||
END
|
||||
|
||||
STRING F_G_D_TIPO 25
|
||||
BEGIN
|
||||
PROMPT 30 4 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_G_D_LUOGO 25
|
||||
BEGIN
|
||||
PROMPT 30 5 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
25
at/at0100c.h
Executable file
25
at/at0100c.h
Executable file
@ -0,0 +1,25 @@
|
||||
// definizione dei campi della maschera at0100c.msk
|
||||
// famiglia (collegata a un soggetto)
|
||||
|
||||
// pagina 1
|
||||
#define F_NUOVA 101 // crea nuova famiglia
|
||||
#define F_ES_COLLEGA 102
|
||||
#define F_ES_CODICE 103 // campi di ricerca (codice, cognome, nome)
|
||||
#define F_ES_COGNOME 104 // per collegare il soggetto a una
|
||||
#define F_ES_NOME 105 // famiglia gi… esistente
|
||||
#define F_FAMIGLIARI 106 // sheet famigliari
|
||||
|
||||
// pagina famigliare
|
||||
#define F_F_GRADOPAR 101
|
||||
#define F_F_CODICE 102
|
||||
#define F_F_COGNOME 103
|
||||
#define F_F_NOME 104
|
||||
#define F_F_DATANASC 105
|
||||
#define F_F_CODSEZ 106
|
||||
#define F_F_CODSOT 107
|
||||
#define F_F_CATDON 108
|
||||
#define F_F_TESSAVIS 109
|
||||
|
||||
#define F_F_DENSEZ 151
|
||||
#define F_F_DENSOT 152
|
||||
#define F_F_DESC_CATDON 154
|
||||
260
at/at0100c.uml
Executable file
260
at/at0100c.uml
Executable file
@ -0,0 +1,260 @@
|
||||
#include "at0100c.h"
|
||||
#include "lf.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
|
||||
BUTTON DLG_OK 10 2
|
||||
BEGIN
|
||||
PROMPT -12 -11 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_CANCEL 10 2
|
||||
BEGIN
|
||||
PROMPT -22 -11 ""
|
||||
END
|
||||
|
||||
//#include <toolbar.h>
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Famiglia" -1 -1 78 20
|
||||
|
||||
BUTTON F_NUOVA 21
|
||||
BEGIN
|
||||
PROMPT 2 1 "Crea nuova famiglia"
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
GROUPBOX F_ES_COLLEGA 45 5
|
||||
BEGIN
|
||||
PROMPT 30 1 "Collega a famiglia esistente"
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
NUMBER F_ES_CODICE 6
|
||||
BEGIN
|
||||
PROMPT 31 2 "Codice "
|
||||
FLAGS "RG"
|
||||
USE LF_SOGGETTI SELECT LF_FAMIGLIE->CODFAM!=0
|
||||
JOIN LF_FAMIGLIE TO LF_SOGGETTI KEY 2 INTO CODFAM=CODICE
|
||||
INPUT CODICE F_ES_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_ES_CODICE CODICE
|
||||
OUTPUT F_ES_COGNOME COGNOME
|
||||
OUTPUT F_ES_NOME NOME
|
||||
CHECKTYPE NORMAL
|
||||
ADD RUN at0 -0
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
STRING F_ES_COGNOME 25
|
||||
BEGIN
|
||||
PROMPT 31 3 "Cognome "
|
||||
USE LF_SOGGETTI KEY 2 SELECT LF_FAMIGLIE->CODFAM!=0
|
||||
JOIN LF_FAMIGLIE TO LF_SOGGETTI KEY 2 INTO CODFAM=CODICE
|
||||
INPUT COGNOME F_ES_COGNOME
|
||||
INPUT NOME F_ES_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_ES_CODICE
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Cognome del soggetto"
|
||||
ADD RUN at0 -0
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
STRING F_ES_NOME 25
|
||||
BEGIN
|
||||
PROMPT 31 4 "Nome "
|
||||
COPY ALL F_ES_COGNOME
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Nome del soggetto"
|
||||
ADD RUN at0 -0
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
|
||||
SPREADSHEET F_FAMIGLIARI
|
||||
BEGIN
|
||||
PROMPT 2 6 ""
|
||||
ITEM "Grado"
|
||||
ITEM "Codice"
|
||||
ITEM "Cognome@25"
|
||||
ITEM "Nome@25"
|
||||
ITEM "Nato il@10"
|
||||
ITEM "Sez."
|
||||
ITEM "Sot."
|
||||
ITEM "Cat."
|
||||
ITEM "Tessera"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
|
||||
|
||||
PAGE "Soggetto familiare" -1 -1 78 20
|
||||
|
||||
GROUPBOX DLG_NULL 77 6
|
||||
BEGIN
|
||||
PROMPT 1 0 "Dati familiare"
|
||||
END
|
||||
|
||||
|
||||
LISTBOX F_F_GRADOPAR 12
|
||||
BEGIN
|
||||
PROMPT 2 1 "Grado parentela "
|
||||
FLAGS "U"
|
||||
#include "parenti.h"
|
||||
END
|
||||
|
||||
NUMBER F_F_CODICE 6
|
||||
BEGIN
|
||||
PROMPT 2 2 "Codice "
|
||||
FLAGS "RG"
|
||||
USE LF_SOGGETTI KEY 1
|
||||
INPUT CODICE F_F_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_F_CODICE CODICE
|
||||
OUTPUT F_F_COGNOME COGNOME
|
||||
OUTPUT F_F_NOME NOME
|
||||
OUTPUT F_F_DATANASC DATANASC
|
||||
OUTPUT F_F_CODSEZ CODSEZ
|
||||
OUTPUT F_F_CODSOT CODSOT
|
||||
OUTPUT F_F_CATDON CATDON
|
||||
OUTPUT F_F_TESSAVIS TESSAVIS
|
||||
CHECKTYPE NORMAL
|
||||
ADD RUN at0 -0
|
||||
END
|
||||
|
||||
STRING F_F_COGNOME 25
|
||||
BEGIN
|
||||
PROMPT 2 3 "Cognome e nome "
|
||||
USE LF_SOGGETTI KEY 2
|
||||
INPUT COGNOME F_F_COGNOME
|
||||
INPUT NOME F_F_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_F_CODICE
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Cognome del soggetto"
|
||||
ADD RUN at0 -0
|
||||
END
|
||||
|
||||
STRING F_F_NOME 25
|
||||
BEGIN
|
||||
PROMPT 46 3 ""
|
||||
COPY ALL F_F_COGNOME
|
||||
COPY OUTPUT F_F_CODICE
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Nome del soggetto"
|
||||
ADD RUN at0 -0
|
||||
END
|
||||
|
||||
DATE F_F_DATANASC
|
||||
BEGIN
|
||||
PROMPT 2 4 "Nato il "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
PROMPT 1 6 "Dati associativi"
|
||||
END
|
||||
|
||||
STRING F_F_CODSEZ 2
|
||||
BEGIN
|
||||
PROMPT 2 7 "Sez. "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_F_DENSEZ 25
|
||||
BEGIN
|
||||
PROMPT 12 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_F_CODSOT 2
|
||||
BEGIN
|
||||
PROMPT 40 7 "Sot. "
|
||||
FLAGS "D"
|
||||
USE LF_SEZIONI
|
||||
INPUT CODSEZ F_F_CODSEZ
|
||||
INPUT CODSOT F_F_CODSOT
|
||||
OUTPUT F_F_DENSEZ DENSEZ
|
||||
OUTPUT F_F_DENSOT DENSOT
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
STRING F_F_DENSOT 25
|
||||
BEGIN
|
||||
PROMPT 50 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_F_CATDON 2
|
||||
BEGIN
|
||||
PROMPT 2 8 "Cat. "
|
||||
FLAGS "D"
|
||||
USE CTD
|
||||
INPUT CODTAB F_F_CATDON
|
||||
OUTPUT F_F_DESC_CATDON S0
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
STRING F_F_TESSAVIS 10
|
||||
BEGIN
|
||||
PROMPT 52 8 "Tessera AVIS "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_F_DESC_CATDON 25
|
||||
BEGIN
|
||||
PROMPT 12 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
|
||||
1033
at/at0200.cpp
1033
at/at0200.cpp
File diff suppressed because it is too large
Load Diff
83
at/at0200a.h
83
at/at0200a.h
@ -1,41 +1,42 @@
|
||||
// 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_TESSAVIS 109
|
||||
#define F_S_DENSEZ 201
|
||||
#define F_S_DENSOT 202
|
||||
#define F_S_DESC_TIPOCON 203
|
||||
#define F_S_DESC_CATDON 204
|
||||
|
||||
#define F_S_IDON1 205
|
||||
#define F_S_IDON2 206
|
||||
#define F_S_IDON3 207
|
||||
#define F_S_IDON4 208
|
||||
#define F_S_INTSI 209
|
||||
#define F_S_INTAF 210
|
||||
#define F_S_PROSSTIPO 211
|
||||
#define F_S_PROSSDATA 212
|
||||
#define F_S_DESC_IDON1 213
|
||||
#define F_S_DESC_IDON2 214
|
||||
#define F_S_DESC_IDON3 215
|
||||
#define F_S_DESC_IDON4 216
|
||||
#define F_S_DESC_PROSSTIPO 217
|
||||
// definizione campi della maschera at0200a.msk
|
||||
// GIORNALIERO DONAZIONI/CONTROLLI
|
||||
|
||||
// dati fissi
|
||||
#define F_DATADON 101
|
||||
#define F_TIPODON 102
|
||||
#define F_LUOGODON 103
|
||||
#define F_DESC_TIPODON 104
|
||||
#define F_DESC_LUOGODON 105
|
||||
#define F_INS_CONTROLLI 106
|
||||
// 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_TESSAVIS 109
|
||||
|
||||
#define F_S_DENSEZ 151
|
||||
#define F_S_DENSOT 152
|
||||
#define F_S_DESC_TIPOCON 153
|
||||
#define F_S_DESC_CATDON 154
|
||||
|
||||
#define F_S_IDON1 155
|
||||
#define F_S_IDON2 156
|
||||
#define F_S_IDON3 157
|
||||
#define F_S_IDON4 158
|
||||
#define F_S_INTSI 159
|
||||
#define F_S_INTAF 160
|
||||
#define F_S_PROSSTIPO 161
|
||||
#define F_S_PROSSDATA 162
|
||||
#define F_S_DESC_IDON1 163
|
||||
#define F_S_DESC_IDON2 164
|
||||
#define F_S_DESC_IDON3 165
|
||||
#define F_S_DESC_IDON4 166
|
||||
#define F_S_DESC_PROSSTIPO 167
|
||||
|
||||
860
at/at0200a.uml
860
at/at0200a.uml
@ -1,431 +1,429 @@
|
||||
#include "at0200a.h"
|
||||
#include "lf.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
|
||||
BUTTON DLG_SAVEREC 10 2
|
||||
BEGIN
|
||||
PROMPT -14 -11 "~Registra"
|
||||
MESSAGE EXIT,K_SAVE
|
||||
PICTURE BMP_SAVEREC
|
||||
PICTURE BMP_SAVERECDN
|
||||
END
|
||||
|
||||
BUTTON DLG_NEWREC 10 2
|
||||
BEGIN
|
||||
PROMPT -24 -11 "~Nuovo"
|
||||
MESSAGE EXIT,K_INS
|
||||
PICTURE BMP_NEWREC
|
||||
PICTURE BMP_NEWRECDN
|
||||
END
|
||||
|
||||
BUTTON DLG_CANCEL 10 2
|
||||
BEGIN
|
||||
PROMPT -34 -11 "~Annulla"
|
||||
MESSAGE EXIT,K_ESC
|
||||
PICTURE 102
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 10 2
|
||||
BEGIN
|
||||
PROMPT -44 -11 "~Fine"
|
||||
MESSAGE EXIT,K_QUIT
|
||||
PICTURE BMP_QUIT
|
||||
PICTURE BMP_QUITDN
|
||||
END
|
||||
|
||||
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
|
||||
|
||||
GROUPBOX DLG_NULL 77 5
|
||||
BEGIN
|
||||
PROMPT 1 0 ""
|
||||
FLAGS "R"
|
||||
END
|
||||
|
||||
NUMBER F_S_CODICE 6
|
||||
BEGIN
|
||||
PROMPT 2 1 "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
|
||||
OUTPUT F_S_TESSAVIS TESSAVIS
|
||||
CHECKTYPE NORMAL
|
||||
ADD RUN at0 -0
|
||||
END
|
||||
|
||||
STRING F_S_COGNOME 25
|
||||
BEGIN
|
||||
PROMPT 2 2 "Cognome e nome "
|
||||
USE LF_SOGGETTI KEY 2
|
||||
INPUT COGNOME F_S_COGNOME
|
||||
INPUT NOME F_S_NOME
|
||||
DISPLAY "Cognome@25" COGNOME
|
||||
DISPLAY "Nome@25" NOME
|
||||
DISPLAY "Nato il@10" DATANASC
|
||||
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 ""
|
||||
COPY ALL F_S_COGNOME
|
||||
COPY OUTPUT F_S_CODICE
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Nome del soggetto"
|
||||
ADD RUN at0 -0
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 9
|
||||
BEGIN
|
||||
PROMPT 1 9 "Dati del controllo sanitario effettuato"
|
||||
END
|
||||
|
||||
STRING F_S_TIPOCON 2
|
||||
BEGIN
|
||||
PROMPT 2 10 "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 "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
PROMPT 1 5 "Dati associativi"
|
||||
END
|
||||
|
||||
STRING F_S_CODSEZ 2
|
||||
BEGIN
|
||||
PROMPT 2 6 "Sez. "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_DENSEZ 25
|
||||
BEGIN
|
||||
PROMPT 12 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_CODSOT 2
|
||||
BEGIN
|
||||
PROMPT 40 6 "Sot. "
|
||||
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 50 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_CATDON 2
|
||||
BEGIN
|
||||
PROMPT 2 7 "Cat. "
|
||||
FLAGS "D"
|
||||
USE CTD
|
||||
INPUT CODTAB F_S_CATDON
|
||||
OUTPUT F_S_DESC_CATDON S0
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
STRING F_S_TESSAVIS 10
|
||||
BEGIN
|
||||
PROMPT 52 7 "Tessera AVIS "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_DESC_TIPOCON 25
|
||||
BEGIN
|
||||
PROMPT 23 10 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_DESC_CATDON 25
|
||||
BEGIN
|
||||
PROMPT 12 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
TEXT DLG_NULL
|
||||
BEGIN
|
||||
PROMPT 2 11 "Se idoneita': Tipi donazione ammessi"
|
||||
END
|
||||
|
||||
STRING F_S_IDON1 2
|
||||
BEGIN
|
||||
PROMPT 40 11 ""
|
||||
FLAGS "U"
|
||||
USE IDO
|
||||
INPUT CODTAB F_S_IDON1
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_S_IDON1 CODTAB
|
||||
OUTPUT F_S_DESC_IDON1 S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice non presente"
|
||||
HELP "Idoneita' alla donazione"
|
||||
END
|
||||
|
||||
STRING F_S_IDON2 2
|
||||
BEGIN
|
||||
PROMPT 40 12 ""
|
||||
FLAGS "U"
|
||||
USE IDO
|
||||
INPUT CODTAB F_S_IDON2
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_S_IDON2 CODTAB
|
||||
OUTPUT F_S_DESC_IDON2 S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice non presente"
|
||||
HELP "Idoneita' alla donazione"
|
||||
END
|
||||
|
||||
STRING F_S_IDON3 2
|
||||
BEGIN
|
||||
PROMPT 40 13 ""
|
||||
FLAGS "U"
|
||||
USE IDO
|
||||
INPUT CODTAB F_S_IDON3
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_S_IDON3 CODTAB
|
||||
OUTPUT F_S_DESC_IDON3 S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice non presente"
|
||||
HELP "Idoneita' alla donazione"
|
||||
END
|
||||
|
||||
STRING F_S_IDON4 2
|
||||
BEGIN
|
||||
PROMPT 40 14 ""
|
||||
FLAGS "U"
|
||||
USE IDO
|
||||
INPUT CODTAB F_S_IDON4
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_S_IDON4 CODTAB
|
||||
OUTPUT F_S_DESC_IDON4 S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice non presente"
|
||||
HELP "Idoneita' alla donazione"
|
||||
END
|
||||
|
||||
TEXT DLG_NULL
|
||||
BEGIN
|
||||
PROMPT 2 15 " Intervalli"
|
||||
END
|
||||
|
||||
NUMBER F_S_INTSI 3 0
|
||||
BEGIN
|
||||
PROMPT 40 15 "Sangue intero "
|
||||
FLAGS "U"
|
||||
END
|
||||
|
||||
NUMBER F_S_INTAF 3 0
|
||||
BEGIN
|
||||
PROMPT 60 15 "Aferesi "
|
||||
FLAGS "U"
|
||||
END
|
||||
|
||||
STRING F_S_PROSSTIPO 2
|
||||
BEGIN
|
||||
PROMPT 2 16 "Prossimo contr.: Tipo "
|
||||
FLAGS "U"
|
||||
USE TCS
|
||||
INPUT CODTAB F_S_PROSSTIPO
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_S_PROSSTIPO CODTAB
|
||||
OUTPUT F_S_DESC_PROSSTIPO S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice non presente"
|
||||
HELP "Tipo/Esito controllo sanitario"
|
||||
END
|
||||
|
||||
|
||||
DATE F_S_PROSSDATA
|
||||
BEGIN
|
||||
PROMPT 56 16 "Data "
|
||||
HELP "Data controllo"
|
||||
END
|
||||
|
||||
STRING F_S_DESC_IDON1 25
|
||||
BEGIN
|
||||
PROMPT 46 11 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_DESC_IDON2 25
|
||||
BEGIN
|
||||
PROMPT 46 12 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_DESC_IDON3 25
|
||||
BEGIN
|
||||
PROMPT 46 13 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_DESC_IDON4 25
|
||||
BEGIN
|
||||
PROMPT 46 14 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_DESC_PROSSTIPO 25
|
||||
BEGIN
|
||||
PROMPT 29 16 ""
|
||||
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
|
||||
#include "at0200a.h"
|
||||
#include "lf.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
|
||||
BUTTON DLG_SAVEREC 10 2
|
||||
BEGIN
|
||||
PROMPT -14 -11 "~Registra"
|
||||
MESSAGE EXIT,K_SAVE
|
||||
PICTURE BMP_SAVEREC
|
||||
PICTURE BMP_SAVERECDN
|
||||
END
|
||||
|
||||
BUTTON DLG_NEWREC 10 2
|
||||
BEGIN
|
||||
PROMPT -24 -11 "~Nuovo"
|
||||
MESSAGE EXIT,K_INS
|
||||
PICTURE BMP_NEWREC
|
||||
PICTURE BMP_NEWRECDN
|
||||
END
|
||||
|
||||
BUTTON DLG_CANCEL 10 2
|
||||
BEGIN
|
||||
PROMPT -34 -11 "~Annulla"
|
||||
MESSAGE EXIT,K_ESC
|
||||
PICTURE 102
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 10 2
|
||||
BEGIN
|
||||
PROMPT -44 -11 "~Fine"
|
||||
MESSAGE EXIT,K_QUIT
|
||||
PICTURE BMP_QUIT
|
||||
PICTURE BMP_QUITDN
|
||||
END
|
||||
|
||||
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
|
||||
|
||||
SPREADSHEET F_SOGGETTI
|
||||
BEGIN
|
||||
PROMPT 2 6 "Soggetti"
|
||||
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
|
||||
|
||||
GROUPBOX DLG_NULL 77 5
|
||||
BEGIN
|
||||
PROMPT 1 0 ""
|
||||
FLAGS "R"
|
||||
END
|
||||
|
||||
NUMBER F_S_CODICE 6
|
||||
BEGIN
|
||||
PROMPT 2 1 "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
|
||||
OUTPUT F_S_TESSAVIS TESSAVIS
|
||||
CHECKTYPE NORMAL
|
||||
ADD RUN at0 -0
|
||||
END
|
||||
|
||||
STRING F_S_COGNOME 25
|
||||
BEGIN
|
||||
PROMPT 2 2 "Cognome e nome "
|
||||
USE LF_SOGGETTI KEY 2
|
||||
INPUT COGNOME F_S_COGNOME
|
||||
//INPUT NOME F_S_NOME
|
||||
DISPLAY "Cognome@25" COGNOME
|
||||
DISPLAY "Nome@25" NOME
|
||||
DISPLAY "Nato il@10" DATANASC
|
||||
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 ""
|
||||
USE LF_SOGGETTI KEY 2
|
||||
INPUT COGNOME F_S_COGNOME
|
||||
INPUT NOME F_S_NOME
|
||||
COPY DISPLAY F_S_COGNOME
|
||||
COPY OUTPUT F_S_COGNOME
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Nome del soggetto"
|
||||
ADD RUN at0 -0
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 9
|
||||
BEGIN
|
||||
PROMPT 1 9 "Dati del controllo sanitario effettuato"
|
||||
END
|
||||
|
||||
STRING F_S_TIPOCON 2
|
||||
BEGIN
|
||||
PROMPT 2 10 "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 "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
PROMPT 1 5 "Dati associativi"
|
||||
END
|
||||
|
||||
STRING F_S_CODSEZ 2
|
||||
BEGIN
|
||||
PROMPT 2 6 "Sez. "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_DENSEZ 25
|
||||
BEGIN
|
||||
PROMPT 12 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_CODSOT 2
|
||||
BEGIN
|
||||
PROMPT 40 6 "Sot. "
|
||||
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 50 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_CATDON 2
|
||||
BEGIN
|
||||
PROMPT 2 7 "Cat. "
|
||||
FLAGS "D"
|
||||
USE CTD
|
||||
INPUT CODTAB F_S_CATDON
|
||||
OUTPUT F_S_DESC_CATDON S0
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
STRING F_S_TESSAVIS 10
|
||||
BEGIN
|
||||
PROMPT 52 7 "Tessera AVIS "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_DESC_TIPOCON 25
|
||||
BEGIN
|
||||
PROMPT 23 10 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_DESC_CATDON 25
|
||||
BEGIN
|
||||
PROMPT 12 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
TEXT DLG_NULL
|
||||
BEGIN
|
||||
PROMPT 2 11 "Se idoneita': Tipi donazione ammessi"
|
||||
END
|
||||
|
||||
STRING F_S_IDON1 2
|
||||
BEGIN
|
||||
PROMPT 40 11 ""
|
||||
FLAGS "U"
|
||||
USE IDO
|
||||
INPUT CODTAB F_S_IDON1
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_S_IDON1 CODTAB
|
||||
OUTPUT F_S_DESC_IDON1 S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice non presente"
|
||||
HELP "Idoneita' alla donazione"
|
||||
END
|
||||
|
||||
STRING F_S_IDON2 2
|
||||
BEGIN
|
||||
PROMPT 40 12 ""
|
||||
FLAGS "U"
|
||||
USE IDO
|
||||
INPUT CODTAB F_S_IDON2
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_S_IDON2 CODTAB
|
||||
OUTPUT F_S_DESC_IDON2 S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice non presente"
|
||||
HELP "Idoneita' alla donazione"
|
||||
END
|
||||
|
||||
STRING F_S_IDON3 2
|
||||
BEGIN
|
||||
PROMPT 40 13 ""
|
||||
FLAGS "U"
|
||||
USE IDO
|
||||
INPUT CODTAB F_S_IDON3
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_S_IDON3 CODTAB
|
||||
OUTPUT F_S_DESC_IDON3 S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice non presente"
|
||||
HELP "Idoneita' alla donazione"
|
||||
END
|
||||
|
||||
STRING F_S_IDON4 2
|
||||
BEGIN
|
||||
PROMPT 40 14 ""
|
||||
FLAGS "U"
|
||||
USE IDO
|
||||
INPUT CODTAB F_S_IDON4
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_S_IDON4 CODTAB
|
||||
OUTPUT F_S_DESC_IDON4 S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice non presente"
|
||||
HELP "Idoneita' alla donazione"
|
||||
END
|
||||
|
||||
TEXT DLG_NULL
|
||||
BEGIN
|
||||
PROMPT 2 15 " Intervalli"
|
||||
END
|
||||
|
||||
NUMBER F_S_INTSI 3 0
|
||||
BEGIN
|
||||
PROMPT 40 15 "Sangue intero "
|
||||
FLAGS "U"
|
||||
END
|
||||
|
||||
NUMBER F_S_INTAF 3 0
|
||||
BEGIN
|
||||
PROMPT 60 15 "Aferesi "
|
||||
FLAGS "U"
|
||||
END
|
||||
|
||||
STRING F_S_PROSSTIPO 2
|
||||
BEGIN
|
||||
PROMPT 2 16 "Prossimo contr.: Tipo "
|
||||
FLAGS "U"
|
||||
USE TCS
|
||||
INPUT CODTAB F_S_PROSSTIPO
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_S_PROSSTIPO CODTAB
|
||||
OUTPUT F_S_DESC_PROSSTIPO S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice non presente"
|
||||
HELP "Tipo/Esito controllo sanitario"
|
||||
END
|
||||
|
||||
|
||||
DATE F_S_PROSSDATA
|
||||
BEGIN
|
||||
PROMPT 56 16 "Data "
|
||||
HELP "Data controllo"
|
||||
END
|
||||
|
||||
STRING F_S_DESC_IDON1 25
|
||||
BEGIN
|
||||
PROMPT 46 11 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_DESC_IDON2 25
|
||||
BEGIN
|
||||
PROMPT 46 12 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_DESC_IDON3 25
|
||||
BEGIN
|
||||
PROMPT 46 13 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_DESC_IDON4 25
|
||||
BEGIN
|
||||
PROMPT 46 14 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_DESC_PROSSTIPO 25
|
||||
BEGIN
|
||||
PROMPT 29 16 ""
|
||||
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
|
||||
|
||||
489
at/at0300.cpp
489
at/at0300.cpp
@ -1,7 +1,15 @@
|
||||
#include <applicat.h>
|
||||
#include <execp.h>
|
||||
#include <mask.h>
|
||||
#include <form.h>
|
||||
#include <printapp.h>
|
||||
#include <utility.h>
|
||||
#include <msksheet.h>
|
||||
#include <mailbox.h>
|
||||
#include <prefix.h>
|
||||
#include <progind.h>
|
||||
#include <recarray.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
|
||||
@ -13,195 +21,346 @@
|
||||
#include "soggetti.h"
|
||||
#include "donaz.h"
|
||||
#include "contsan.h"
|
||||
#include "benem.h"
|
||||
#include "storico.h"
|
||||
#include "sezioni.h"
|
||||
|
||||
class TChiusura_app : public TPrintapp
|
||||
#include "atlib.h"
|
||||
|
||||
#define ALIAS_CTD 100
|
||||
|
||||
class TContsan_app : public TApplication
|
||||
{
|
||||
static bool filter_func_chiusura(const TRelation *);
|
||||
|
||||
TMask* _msk;
|
||||
TRelation* _rel;
|
||||
|
||||
int _cur;
|
||||
TDate _data_chiusura;
|
||||
TParagraph_string _operazione;
|
||||
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.
|
||||
bool _modified;
|
||||
|
||||
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 bool create();
|
||||
virtual bool destroy();
|
||||
virtual bool menu(MENU_TAG m);
|
||||
virtual TMask& get_mask() { return *_msk; }
|
||||
virtual TRelation* get_relation() const { return _rel; }
|
||||
|
||||
TAssoc_array& get_array_sogg() { return *_asoggetti; }
|
||||
int write(TSheet_field& s);
|
||||
|
||||
bool check_sog_sheet(const char* codsog);
|
||||
static bool nome_handler(TMask_field& f, KEY k);
|
||||
static bool tipocon_handler(TMask_field& f, KEY k);
|
||||
static bool soggetti_notify(TSheet_field& s, int r, KEY k);
|
||||
void add_rows_soggetti(TSheet_field& s, int count = 20, int start = 0);
|
||||
|
||||
public:
|
||||
void filtra_sezioni();
|
||||
void crea_intestazione();
|
||||
TChiusura_app() : _data_chiusura(TODAY), _operazione("",30) {}
|
||||
TContsan_app() {}
|
||||
|
||||
};
|
||||
|
||||
HIDDEN inline TChiusura_app& app() { return (TChiusura_app&) main_app(); }
|
||||
HIDDEN inline TContsan_app& app() { return (TContsan_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)
|
||||
void TContsan_app::add_rows_soggetti(TSheet_field& s, int count, int start)
|
||||
{
|
||||
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);
|
||||
if (start == 0)
|
||||
s.destroy();
|
||||
for (int r=start; r<=start+count-1; r++)
|
||||
TToken_string& row = s.row(r);
|
||||
}
|
||||
|
||||
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()
|
||||
bool TContsan_app::create()
|
||||
{
|
||||
_modified = FALSE;
|
||||
_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
|
||||
_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();
|
||||
|
||||
TSheet_field& ss = (TSheet_field&)_msk->field(F_SOGGETTI);
|
||||
ss.set_notify(soggetti_notify);
|
||||
|
||||
ss.sheet_mask().set_handler(F_S_NOME,nome_handler);
|
||||
//ss.sheet_mask().set_handler(F_S_TIPOCON,tipocon_handler);
|
||||
|
||||
dispatch_e_menu(BAR_ITEM(1));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TChiusura_app::user_destroy()
|
||||
bool TContsan_app::destroy()
|
||||
{
|
||||
delete _rel;
|
||||
delete _msk;
|
||||
delete _donaz;
|
||||
delete _contsan;
|
||||
delete _sdonazioni;
|
||||
delete _scontrolli;
|
||||
delete _asoggetti;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TContsan_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);
|
||||
s.reset();
|
||||
add_rows_soggetti(s);
|
||||
_asoggetti->destroy();
|
||||
msk.set(F_DATACON,oggi);
|
||||
tasto = msk.run();
|
||||
switch (tasto)
|
||||
{
|
||||
case K_ESC: // annulla
|
||||
{
|
||||
if (_modified)
|
||||
if (yesno_box("Registrare le modifiche?"))
|
||||
TContsan_app::write(s);
|
||||
_modified = FALSE;
|
||||
msk.reset();
|
||||
}
|
||||
break;
|
||||
case K_SAVE: // registra
|
||||
{
|
||||
TContsan_app::write(s);
|
||||
_modified = FALSE;
|
||||
msk.reset();
|
||||
}
|
||||
break;
|
||||
case K_INS: // nuovo
|
||||
{
|
||||
TContsan_app::write(s);
|
||||
_modified = FALSE;
|
||||
msk.reset();
|
||||
}
|
||||
break;
|
||||
case K_QUIT: // fine
|
||||
{
|
||||
if (_modified)
|
||||
if (yesno_box("Registrare le modifiche?"))
|
||||
TContsan_app::write(s);
|
||||
msk.reset();
|
||||
_modified = FALSE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (tasto != K_QUIT);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
int TContsan_app::write(TSheet_field& s)
|
||||
{
|
||||
|
||||
const TMask& m = s.mask();
|
||||
const TDate data = m.get(F_DATACON);
|
||||
|
||||
int items = s.items();
|
||||
TProgind *pi;
|
||||
pi = new TProgind(items,"Registrazione controlli", FALSE, TRUE, 10);
|
||||
pi->setstatus(1);
|
||||
|
||||
for (int r=1; r<=s.items(); r++)
|
||||
{
|
||||
|
||||
pi->addstatus(1);
|
||||
|
||||
TToken_string& row = s.row(r-1);
|
||||
const long codsog = row.get_long(0);
|
||||
if (codsog != 0)
|
||||
{
|
||||
TLocalisamfile& sog = get_relation()->lfile();
|
||||
sog.setkey(1);
|
||||
sog.zero();
|
||||
sog.put(SOG_CODICE, codsog);
|
||||
int err = sog.read();
|
||||
if (err == NOERR)
|
||||
{
|
||||
const TString16 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_DATACON));
|
||||
recc->put(CON_TIPOCON, tipocon);
|
||||
recc->put(CON_PROSSTIPO, row.get(4));
|
||||
recc->put(CON_PROSSDATA, row.get(5));
|
||||
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 gia' 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);
|
||||
con_reord(sog.curr(), _scontrolli);
|
||||
sog.put(SOG_DATAULTAGG,TODAY);
|
||||
sog.put(SOG_UTENULTAGG,user());
|
||||
sog.rewrite();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
delete pi;
|
||||
|
||||
return NOERR;
|
||||
}
|
||||
|
||||
bool TContsan_app::check_sog_sheet(const char* codsog)
|
||||
{
|
||||
TAssoc_array& array_sogg = app().get_array_sogg();
|
||||
if (array_sogg.is_key(codsog))
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TContsan_app::soggetti_notify(TSheet_field& s, int r, KEY k)
|
||||
{
|
||||
bool ok = TRUE;
|
||||
switch (k)
|
||||
{
|
||||
case K_CTRL+K_DEL:
|
||||
// avvenuta cancellazione riga
|
||||
break;
|
||||
case K_SPACE:
|
||||
// inizio modifica riga
|
||||
break;
|
||||
case K_TAB:
|
||||
// entrata riga
|
||||
{
|
||||
if (r > 1)
|
||||
{
|
||||
if ((r == s.items()-1) && (r == s.first_empty()))
|
||||
{
|
||||
app().add_rows_soggetti(s,10,r+1);
|
||||
s.select(r);
|
||||
}
|
||||
TToken_string& row = s.row(r);
|
||||
if (row.empty_items())
|
||||
s.set_focus_cell(r,1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case K_ENTER:
|
||||
// uscita da riga modificata
|
||||
case K_CTRL+K_TAB:
|
||||
// uscita riga
|
||||
{
|
||||
app()._modified = TRUE;
|
||||
TToken_string& row = s.row(r);
|
||||
const long codsog = row.get_long(0);
|
||||
if (codsog != 0)
|
||||
for (int i=s.items()-1; i>=0; i--)
|
||||
{
|
||||
if (i != r)
|
||||
{
|
||||
TToken_string& row = s.row(i);
|
||||
if (codsog == row.get_long(0))
|
||||
return s.sheet_mask().field(F_S_CODICE).error_box("Soggetto gia' inserito");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const char* cognome = row.get(1);
|
||||
if ((cognome != NULL) && (cognome != "\0"))
|
||||
{
|
||||
s.sheet_mask().field(F_S_NOME).set_focusdirty();
|
||||
s.set_focus_cell(r,2);
|
||||
}
|
||||
}
|
||||
s.force_update(r);
|
||||
if (r == s.items()-1)
|
||||
{
|
||||
app().add_rows_soggetti(s,10,r+1);
|
||||
s.select(r);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool TContsan_app::nome_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
bool ok = TRUE;
|
||||
//if (k == K_TAB && f.focusdirty())
|
||||
if (f.to_check(k))
|
||||
{
|
||||
TMask& m = f.mask();
|
||||
long codsog = m.get_long(F_S_CODICE);
|
||||
if (codsog == 0)
|
||||
f.on_key(K_F9);
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool TContsan_app::tipocon_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
bool ok = TRUE;
|
||||
if (k == K_TAB && !f.focusdirty())
|
||||
{
|
||||
TMask& m = f.mask();
|
||||
TString16 tipoconsog = m.get(F_S_TIPOCON);
|
||||
TString80 nome = m.get(F_S_NOME);
|
||||
if (tipoconsog.empty() && nome.not_empty())
|
||||
{
|
||||
TString16 tipocon = app().get_mask().get(F_TIPOCON);
|
||||
TString16 prosstipo = app().get_mask().get(F_PROSSTIPO);
|
||||
TDate prossdata = app().get_mask().get(F_PROSSDATA);
|
||||
m.field(F_S_TIPOCON).set(tipocon);
|
||||
m.field(F_S_PROSSTIPO).set(prosstipo);
|
||||
m.field(F_S_PROSSDATA).set(prossdata);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at0300(int argc, char* argv[])
|
||||
{
|
||||
TChiusura_app a;
|
||||
a.run(argc, argv, "Chiusura annuale");
|
||||
TContsan_app a;
|
||||
a.run(argc, argv, "Giornaliero controlli");
|
||||
return 0;
|
||||
}
|
||||
53
at/at0300a.h
53
at/at0300a.h
@ -1,12 +1,43 @@
|
||||
// chiusura annuale
|
||||
// definizione campi per maschera di selezione
|
||||
// definizione campi della maschera at0300a.msk
|
||||
// GIORNALIERO CONTROLLI
|
||||
|
||||
#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
|
||||
// dati fissi
|
||||
#define F_DATACON 101
|
||||
#define F_TIPOCON 102
|
||||
#define F_PROSSTIPO 103
|
||||
#define F_PROSSDATA 104
|
||||
#define F_DESC_TIPOCON 105
|
||||
#define F_DESC_PROSSTIPO 106
|
||||
|
||||
// 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_PROSSTIPO 105
|
||||
#define F_S_PROSSDATA 106
|
||||
#define F_S_DATANASC 107
|
||||
#define F_S_CODSEZ 108
|
||||
#define F_S_CODSOT 109
|
||||
#define F_S_CATDON 110
|
||||
#define F_S_TESSAVIS 111
|
||||
|
||||
#define F_S_DENSEZ 151
|
||||
#define F_S_DENSOT 152
|
||||
#define F_S_DESC_TIPOCON 153
|
||||
#define F_S_DESC_CATDON 155
|
||||
|
||||
#define F_S_IDON1 156
|
||||
#define F_S_IDON2 157
|
||||
#define F_S_IDON3 158
|
||||
#define F_S_IDON4 159
|
||||
#define F_S_INTSI 160
|
||||
#define F_S_INTAF 161
|
||||
#define F_S_DESC_IDON1 162
|
||||
#define F_S_DESC_IDON2 163
|
||||
#define F_S_DESC_IDON3 164
|
||||
#define F_S_DESC_IDON4 165
|
||||
#define F_S_DESC_PROSSTIPO 166
|
||||
|
||||
486
at/at0300a.uml
486
at/at0300a.uml
@ -1,138 +1,430 @@
|
||||
#include "at0300a.h"
|
||||
#include "lf.h"
|
||||
PAGE "Chiusura annuale" -1 -1 78 20
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
|
||||
BUTTON DLG_SAVEREC 10 2
|
||||
BEGIN
|
||||
PROMPT -14 -11 "~Registra"
|
||||
MESSAGE EXIT,K_SAVE
|
||||
PICTURE BMP_SAVEREC
|
||||
PICTURE BMP_SAVERECDN
|
||||
END
|
||||
|
||||
BUTTON DLG_NEWREC 10 2
|
||||
BEGIN
|
||||
PROMPT -24 -11 "~Nuovo"
|
||||
MESSAGE EXIT,K_INS
|
||||
PICTURE BMP_NEWREC
|
||||
PICTURE BMP_NEWRECDN
|
||||
END
|
||||
|
||||
BUTTON DLG_CANCEL 10 2
|
||||
BEGIN
|
||||
PROMPT -34 -11 "~Annulla"
|
||||
MESSAGE EXIT,K_ESC
|
||||
PICTURE 102
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 10 2
|
||||
BEGIN
|
||||
PROMPT -44 -11 "~Fine"
|
||||
MESSAGE EXIT,K_QUIT
|
||||
PICTURE BMP_QUIT
|
||||
PICTURE BMP_QUITDN
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Giornaliero controlli" -1 -1 78 20
|
||||
|
||||
|
||||
GROUPBOX DLG_NULL 77 6
|
||||
BEGIN
|
||||
PROMPT 1 0 "Dati fissi"
|
||||
FLAGS "R"
|
||||
END
|
||||
|
||||
DATE F_DATACON
|
||||
BEGIN
|
||||
PROMPT 2 1 "Data controllo "
|
||||
VALIDATE NOT_EMPTY_FUNC
|
||||
CHECKTYPE REQUIRED
|
||||
HELP "Data donazione"
|
||||
END
|
||||
|
||||
//STRING F_TIPOCON 2
|
||||
//BEGIN
|
||||
// PROMPT 2 2 "Tipo/Esito "
|
||||
// FLAGS "U"
|
||||
// USE TCS
|
||||
// INPUT CODTAB F_TIPOCON
|
||||
// DISPLAY "Codice" CODTAB
|
||||
// DISPLAY "Descrizione@30" S0
|
||||
// OUTPUT F_TIPOCON CODTAB
|
||||
// OUTPUT F_DESC_TIPOCON S0
|
||||
// CHECKTYPE NORMAL
|
||||
// WARNING "Codice non presente"
|
||||
// HELP "Tipo/Esito controllo sanitario"
|
||||
//END
|
||||
//
|
||||
//STRING F_PROSSTIPO 2
|
||||
//BEGIN
|
||||
// PROMPT 2 3 "Prossimo tipo "
|
||||
// FLAGS "U"
|
||||
// USE TCS
|
||||
// INPUT CODTAB F_PROSSTIPO
|
||||
// DISPLAY "Codice" CODTAB
|
||||
// DISPLAY "Descrizione@30" S0
|
||||
// OUTPUT F_PROSSTIPO CODTAB
|
||||
// OUTPUT F_DESC_PROSSTIPO S0
|
||||
// CHECKTYPE NORMAL
|
||||
// WARNING "Codice non presente"
|
||||
// HELP "Tipo/Esito del prossimo controllo previsto"
|
||||
//END
|
||||
//
|
||||
//DATE F_PROSSDATA
|
||||
//BEGIN
|
||||
// PROMPT 2 4 "Data prevista "
|
||||
// HELP "Data prevista per il prossimo controllo"
|
||||
//END
|
||||
//
|
||||
//STRING F_DESC_TIPOCON 25
|
||||
//BEGIN
|
||||
// PROMPT 30 2 ""
|
||||
// FLAGS "D"
|
||||
//END
|
||||
//
|
||||
//STRING F_DESC_PROSSTIPO 25
|
||||
//BEGIN
|
||||
// PROMPT 30 3 ""
|
||||
// FLAGS "D"
|
||||
//END
|
||||
//
|
||||
SPREADSHEET F_SOGGETTI
|
||||
BEGIN
|
||||
PROMPT 2 6 "Soggetti"
|
||||
ITEM "Codice@6"
|
||||
ITEM "Cognome@25"
|
||||
ITEM "Nome@25"
|
||||
ITEM "Contr."
|
||||
ITEM "Pross."
|
||||
ITEM "Data pross."
|
||||
ITEM "Nato il@10"
|
||||
ITEM "Sez."
|
||||
ITEM "Sot."
|
||||
ITEM "Cat."
|
||||
ITEM "Tessera"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
|
||||
PAGE "Soggetto " -1 -1 78 20
|
||||
|
||||
GROUPBOX DLG_NULL 77 5
|
||||
BEGIN
|
||||
PROMPT 1 0 ""
|
||||
FLAGS "R"
|
||||
END
|
||||
|
||||
NUMBER F_S_CODICE 6
|
||||
BEGIN
|
||||
PROMPT 2 1 "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
|
||||
OUTPUT F_S_TESSAVIS TESSAVIS
|
||||
CHECKTYPE NORMAL
|
||||
ADD RUN at0 -0
|
||||
END
|
||||
|
||||
STRING F_S_COGNOME 25
|
||||
BEGIN
|
||||
PROMPT 2 2 "Cognome e nome "
|
||||
USE LF_SOGGETTI KEY 2
|
||||
INPUT COGNOME F_S_COGNOME
|
||||
//INPUT NOME F_S_NOME
|
||||
DISPLAY "Cognome@25" COGNOME
|
||||
DISPLAY "Nome@25" NOME
|
||||
DISPLAY "Nato il@10" DATANASC
|
||||
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 ""
|
||||
USE LF_SOGGETTI KEY 2
|
||||
INPUT COGNOME F_S_COGNOME
|
||||
INPUT NOME F_S_NOME
|
||||
COPY DISPLAY F_S_COGNOME
|
||||
COPY OUTPUT F_S_COGNOME
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Nome del soggetto"
|
||||
ADD RUN at0 -0
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 9
|
||||
BEGIN
|
||||
PROMPT 1 9 "Dati del controllo sanitario effettuato"
|
||||
END
|
||||
|
||||
STRING F_S_TIPOCON 2
|
||||
BEGIN
|
||||
PROMPT 2 10 "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
|
||||
|
||||
STRING F_S_PROSSTIPO 2
|
||||
BEGIN
|
||||
PROMPT 2 16 "Prossimo contr.: Tipo "
|
||||
FLAGS "U"
|
||||
USE TCS
|
||||
INPUT CODTAB F_S_PROSSTIPO
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_S_PROSSTIPO CODTAB
|
||||
OUTPUT F_S_DESC_PROSSTIPO S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice non presente"
|
||||
HELP "Tipo/Esito controllo sanitario"
|
||||
END
|
||||
|
||||
DATE F_S_PROSSDATA
|
||||
BEGIN
|
||||
PROMPT 56 16 "Data "
|
||||
HELP "Data controllo"
|
||||
END
|
||||
|
||||
DATE F_S_DATANASC
|
||||
BEGIN
|
||||
PROMPT 2 3 "Nato il "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
PROMPT 1 1 "Scelta sezioni/sottogruppi"
|
||||
PROMPT 1 5 "Dati associativi"
|
||||
END
|
||||
|
||||
STRING F_SEZINI 2
|
||||
STRING F_S_CODSEZ 2
|
||||
BEGIN
|
||||
PROMPT 2 2 "Da "
|
||||
FLAGS "U"
|
||||
PROMPT 2 6 "Sez. "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_DENSEZ 25
|
||||
BEGIN
|
||||
PROMPT 12 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_CODSOT 2
|
||||
BEGIN
|
||||
PROMPT 40 6 "Sot. "
|
||||
FLAGS "D"
|
||||
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
|
||||
INPUT CODSEZ F_S_CODSEZ
|
||||
INPUT CODSOT F_S_CODSOT
|
||||
OUTPUT F_S_DENSEZ DENSEZ
|
||||
OUTPUT F_S_DENSOT DENSOT
|
||||
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
|
||||
STRING F_S_DENSOT 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
|
||||
PROMPT 50 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_CATDON 2
|
||||
BEGIN
|
||||
PROMPT 2 7 "Cat. "
|
||||
FLAGS "D"
|
||||
USE CTD
|
||||
INPUT CODTAB F_S_CATDON
|
||||
OUTPUT F_S_DESC_CATDON S0
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Sottogruppo da cui partire"
|
||||
END
|
||||
|
||||
STRING F_SEZFIN 2
|
||||
STRING F_S_TESSAVIS 10
|
||||
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"
|
||||
PROMPT 52 7 "Tessera AVIS "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_D_SEZFIN 25
|
||||
STRING F_S_DESC_TIPOCON 25
|
||||
BEGIN
|
||||
PROMPT 49 2 ""
|
||||
PROMPT 23 10 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_DESC_CATDON 25
|
||||
BEGIN
|
||||
PROMPT 12 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
TEXT DLG_NULL
|
||||
BEGIN
|
||||
PROMPT 2 11 "Se idoneita': Tipi donazione ammessi"
|
||||
END
|
||||
|
||||
STRING F_S_IDON1 2
|
||||
BEGIN
|
||||
PROMPT 40 11 ""
|
||||
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
|
||||
USE IDO
|
||||
INPUT CODTAB F_S_IDON1
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_S_IDON1 CODTAB
|
||||
OUTPUT F_S_DESC_IDON1 S0
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Sezione finale"
|
||||
WARNING "Codice non presente"
|
||||
HELP "Idoneita' alla donazione"
|
||||
END
|
||||
|
||||
STRING F_SOTFIN 2
|
||||
STRING F_S_IDON2 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 ""
|
||||
PROMPT 40 12 ""
|
||||
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
|
||||
USE IDO
|
||||
INPUT CODTAB F_S_IDON2
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_S_IDON2 CODTAB
|
||||
OUTPUT F_S_DESC_IDON2 S0
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Sottogruppo finale"
|
||||
WARNING "Codice non presente"
|
||||
HELP "Idoneita' alla donazione"
|
||||
END
|
||||
|
||||
DATE F_DATA
|
||||
STRING F_S_IDON3 2
|
||||
BEGIN
|
||||
PROMPT 2 5 "Data chiusura "
|
||||
CHECKTYPE REQUIRED
|
||||
HELP "Data di riferimento per i conteggi di chiusura"
|
||||
PROMPT 40 13 ""
|
||||
FLAGS "U"
|
||||
USE IDO
|
||||
INPUT CODTAB F_S_IDON3
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_S_IDON3 CODTAB
|
||||
OUTPUT F_S_DESC_IDON3 S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice non presente"
|
||||
HELP "Idoneita' alla donazione"
|
||||
END
|
||||
|
||||
STRING F_S_IDON4 2
|
||||
BEGIN
|
||||
PROMPT 40 14 ""
|
||||
FLAGS "U"
|
||||
USE IDO
|
||||
INPUT CODTAB F_S_IDON4
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_S_IDON4 CODTAB
|
||||
OUTPUT F_S_DESC_IDON4 S0
|
||||
CHECKTYPE NORMAL
|
||||
WARNING "Codice non presente"
|
||||
HELP "Idoneita' alla donazione"
|
||||
END
|
||||
|
||||
TEXT DLG_NULL
|
||||
BEGIN
|
||||
PROMPT 2 15 " Intervalli"
|
||||
END
|
||||
|
||||
NUMBER F_S_INTSI 3 0
|
||||
BEGIN
|
||||
PROMPT 40 15 "Sangue intero "
|
||||
FLAGS "U"
|
||||
END
|
||||
|
||||
NUMBER F_S_INTAF 3 0
|
||||
BEGIN
|
||||
PROMPT 60 15 "Aferesi "
|
||||
FLAGS "U"
|
||||
END
|
||||
|
||||
STRING F_S_DESC_IDON1 25
|
||||
BEGIN
|
||||
PROMPT 46 11 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_DESC_IDON2 25
|
||||
BEGIN
|
||||
PROMPT 46 12 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_DESC_IDON3 25
|
||||
BEGIN
|
||||
PROMPT 46 13 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_DESC_IDON4 25
|
||||
BEGIN
|
||||
PROMPT 46 14 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_DESC_PROSSTIPO 25
|
||||
BEGIN
|
||||
PROMPT 29 16 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
BEGIN
|
||||
PROMPT -12 14 ""
|
||||
PROMPT -13 -1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BUTTON DLG_CANCEL 9 2
|
||||
BEGIN
|
||||
PROMPT -22 14 ""
|
||||
PROMPT -23 -1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_DELREC 9 2
|
||||
BEGIN
|
||||
PROMPT -33 -1 ""
|
||||
MESSAGE EXIT, K_DEL
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
|
||||
343
at/at0400.cpp
Executable file
343
at/at0400.cpp
Executable file
@ -0,0 +1,343 @@
|
||||
#include <mask.h>
|
||||
#include <msksheet.h>
|
||||
#include <progind.h>
|
||||
#include <recarray.h>
|
||||
#include <relapp.h>
|
||||
#include <tabutil.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "at0.h"
|
||||
#include "lf.h" // se non lo metto non riesco a usare gli LF
|
||||
|
||||
// nomi campi maschera
|
||||
#include "at0400a.h"
|
||||
|
||||
// nomi dei campi
|
||||
#include "soggetti.h"
|
||||
#include "convoc.h"
|
||||
#include "rconvoc.h"
|
||||
|
||||
#define IDON_SI "SI"
|
||||
#define IDON_AF "AF"
|
||||
|
||||
class TConvoc_app: public TRelation_application
|
||||
{
|
||||
TMask* _msk;
|
||||
TRelation* _rel;
|
||||
TRelation* _relsog;
|
||||
TCursor* _cur; // cursore per selezione soggetti
|
||||
TLocalisamfile* _rconvoc;
|
||||
TLocalisamfile* _soggetti;
|
||||
TRecord_array* _sconvocati; // sheet convocati
|
||||
long _lastcod; // progressivo convocazione da assegnare
|
||||
long _numero; // numero convocazione
|
||||
TDate _data; // data convocazione
|
||||
TString16 _punto; // punto di raccolta
|
||||
TString16 _tipo; // tipo donazione
|
||||
TString16 _codsez; // codice sezione convocata
|
||||
TString16 _codsot; // codice sottogruppo
|
||||
|
||||
protected:
|
||||
virtual bool user_create();
|
||||
virtual bool user_destroy();
|
||||
virtual const char* get_next_key();
|
||||
virtual int scrivi(const TMask& m, bool ri);
|
||||
virtual int write(const TMask& m);
|
||||
virtual int rewrite(const TMask& m);
|
||||
virtual int read(TMask& m);
|
||||
virtual bool remove();
|
||||
virtual bool changing_mask(int mode) { return FALSE; }
|
||||
virtual TMask* get_mask( int mode = 0) { return _msk; }
|
||||
virtual TRelation* get_relation() const { return _rel; }
|
||||
|
||||
static bool convocati_notify(TSheet_field& s, int r, KEY k);
|
||||
static bool esegui_handler(TMask_field& f, KEY k);
|
||||
|
||||
public:
|
||||
TConvoc_app() {}
|
||||
|
||||
};
|
||||
|
||||
HIDDEN inline TConvoc_app& app() { return (TConvoc_app&) main_app(); }
|
||||
|
||||
/*
|
||||
bool is_idon_one(TString16 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)
|
||||
{
|
||||
TString16 tipol(2);
|
||||
tipol = ido.get("S6");
|
||||
if (tipol == tipo)
|
||||
is_idon = TRUE;
|
||||
}
|
||||
return is_idon;
|
||||
}
|
||||
|
||||
bool is_idon(TString16 id1, TString16 id2, TString16 id3, TString16 id4, const char* tipo)
|
||||
//verifica che almeno una delle "id" sia del tipo "tipo"
|
||||
{
|
||||
return (is_idon_one(id1,tipo) || is_idon_one(id2,tipo) || is_idon_one(id3,tipo) || is_idon_one(id4,tipo));
|
||||
}
|
||||
*/
|
||||
|
||||
bool TConvoc_app::esegui_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
if (k == K_SPACE)
|
||||
{
|
||||
TMask& m = f.mask();
|
||||
TCursor* cur = app()._cur;
|
||||
|
||||
app()._numero = m.get_long(F_NUMERO);
|
||||
app()._data = m.get(F_DATA);
|
||||
app()._punto = m.get(F_PUNTO);
|
||||
app()._tipo = m.get(F_TIPO);
|
||||
app()._codsez = m.get(F_CODSEZ);
|
||||
app()._codsot = m.get(F_CODSOT);
|
||||
if (app()._numero == 0 || !app()._data.ok() || app()._punto.empty() || app()._tipo.empty())
|
||||
return f.error_box("Mancano i dati fondamentali per la convocazione");
|
||||
// filtro per sezione
|
||||
TRectype da(LF_SOGGETTI);
|
||||
if (app()._codsez.not_empty())
|
||||
da.put(SOG_CODSEZ, app()._codsez);
|
||||
if (app()._codsot.not_empty())
|
||||
da.put(SOG_CODSOT, app()._codsot);
|
||||
cur->setregion(da, da);
|
||||
// filtro per punto di raccolta
|
||||
cur->setfilter(format("PUNTORACC == \"%s\"",(const char*)app()._punto));
|
||||
// altri filtri piu' complicati
|
||||
//cur->set_filterfunction(filter_func_convoc);
|
||||
TSheet_field& s = (TSheet_field&)m.field(F_CONVOCATI);
|
||||
s.destroy();
|
||||
TRectype& rec = cur->curr();
|
||||
long last = cur->items();
|
||||
int r=0;
|
||||
TProgind prg (last, "Elaborazione in corso... Prego attendere", FALSE, TRUE, 30);
|
||||
for ( *cur=0; cur->pos() < last; ++(*cur) )
|
||||
{
|
||||
prg.addstatus(1);
|
||||
TToken_string& row = s.row(r);
|
||||
row.add(rec.get(SOG_CODICE));
|
||||
row.add(rec.get(SOG_COGNOME));
|
||||
row.add(rec.get(SOG_NOME));
|
||||
row.add(' '); // stampato
|
||||
row.add(rec.get(SOG_DATANASC));
|
||||
row.add(rec.get(SOG_CATDON));
|
||||
row.add(rec.get(SOG_TESSAVIS));
|
||||
r++;
|
||||
}
|
||||
s.force_update();
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TConvoc_app::user_create()
|
||||
{
|
||||
_msk = new TMask("at0400a");
|
||||
_rel = new TRelation(LF_CONVOC);
|
||||
_relsog = new TRelation(LF_SOGGETTI);
|
||||
_cur = new TCursor(_relsog, "", 4); //cursore ordinamento per sezione+sottogruppo+cognome+nome
|
||||
_rconvoc = new TLocalisamfile(LF_RCONVOC);
|
||||
_soggetti = new TLocalisamfile(LF_SOGGETTI);
|
||||
_sconvocati = new TRecord_array(LF_RCONVOC,RCV_PROGCONV);
|
||||
_msk->set_handler(F_ESEGUI,esegui_handler);
|
||||
TSheet_field& sc = (TSheet_field&)_msk->field(F_CONVOCATI);
|
||||
sc.set_notify(convocati_notify);
|
||||
//TMask& scmask = sc.sheet_mask();
|
||||
_rel->lfile().last();
|
||||
_lastcod = _rel->lfile().get_long(COV_NUMERO);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TConvoc_app::user_destroy()
|
||||
{
|
||||
delete _rel;
|
||||
delete _relsog;
|
||||
delete _msk;
|
||||
delete _rconvoc;
|
||||
delete _soggetti;
|
||||
delete _sconvocati;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
const char* TConvoc_app::get_next_key()
|
||||
{
|
||||
// autonumerazione progressiva delle convocazioni
|
||||
return format("%d|%ld", F_NUMERO, _lastcod+1 );
|
||||
}
|
||||
|
||||
bool TConvoc_app::remove()
|
||||
{
|
||||
// cancella convocati
|
||||
// cancella testata convocazione
|
||||
bool ok = TRUE;
|
||||
// cancella convocati
|
||||
int err = _sconvocati->remove();
|
||||
if (err == _iseof || err == _isemptyfile)
|
||||
err = NOERR;
|
||||
// cancella la testata
|
||||
if (err == NOERR) ok = TRelation_application::remove();
|
||||
return (ok && err == NOERR);
|
||||
}
|
||||
|
||||
int TConvoc_app::read(TMask& m)
|
||||
{
|
||||
int err = TRelation_application::read(m);
|
||||
if (err == NOERR)
|
||||
{
|
||||
TRectype* key = new TRectype(LF_RCONVOC);
|
||||
key->put(RCV_NUMERO, m.get(F_NUMERO));
|
||||
err = _sconvocati->read(key);
|
||||
if (err == NOERR)
|
||||
{
|
||||
TLocalisamfile soggetti(LF_SOGGETTI);
|
||||
TSheet_field& s = (TSheet_field&)m.field(F_CONVOCATI);
|
||||
s.destroy();
|
||||
for (int r=1; r<=_sconvocati->rows(); r++)
|
||||
{
|
||||
TToken_string& row = s.row(r-1);
|
||||
const TRectype& riga = _sconvocati->row(r);
|
||||
const TString& codice = riga.get(RCV_CODICE);
|
||||
row.add(codice);
|
||||
soggetti.put(SOG_CODICE,codice);
|
||||
if (soggetti.read() != NOERR)
|
||||
soggetti.zero();
|
||||
row.add(soggetti.get(SOG_COGNOME));
|
||||
row.add(soggetti.get(SOG_NOME));
|
||||
row.add(riga.get(RCV_STAMPATO));
|
||||
row.add(soggetti.get(SOG_DATANASC));
|
||||
row.add(soggetti.get(SOG_CATDON));
|
||||
row.add(soggetti.get(SOG_TESSAVIS));
|
||||
}
|
||||
}
|
||||
else
|
||||
if (err == _iseof || err == _isemptyfile)
|
||||
err = NOERR;
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
int TConvoc_app::write(const TMask& m)
|
||||
{
|
||||
long curcod = m.get_long(F_NUMERO);
|
||||
if (curcod > _lastcod) _lastcod = curcod;
|
||||
return TConvoc_app::scrivi(m, FALSE);
|
||||
}
|
||||
|
||||
int TConvoc_app::rewrite(const TMask& m)
|
||||
{
|
||||
return TConvoc_app::scrivi(m, TRUE);
|
||||
}
|
||||
|
||||
int TConvoc_app::scrivi(const TMask& m, bool ri)
|
||||
{
|
||||
// questo trucco è autorizzato dal capo!
|
||||
//TMask& hmask = (TMask&) m;
|
||||
//TDate oggi(TODAY);
|
||||
//hmask.set(F_DATAULTAGG,oggi);
|
||||
//hmask.set(F_UTENULTAGG,user());
|
||||
int err = ri ? TRelation_application::rewrite(m) : TRelation_application::write(m);
|
||||
if (err == NOERR)
|
||||
{
|
||||
_sconvocati->destroy_rows();
|
||||
TSheet_field& s = (TSheet_field&)m.field(F_CONVOCATI);
|
||||
TRectype* key = new TRectype(LF_RCONVOC);
|
||||
key->put(RCV_NUMERO, m.get(F_NUMERO));
|
||||
_sconvocati->set_key(key);
|
||||
for (int r=s.items(); r>0; r--)
|
||||
{
|
||||
TToken_string& row = s.row(r-1);
|
||||
TRectype& rec = _sconvocati->row(r,TRUE);
|
||||
rec.put(RCV_CODICE, row.get(0));
|
||||
rec.put(RCV_STAMPATO, row.get(3));
|
||||
}
|
||||
err = ri ? _sconvocati->rewrite() : _sconvocati->write();
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
bool TConvoc_app::convocati_notify(TSheet_field& s, int r, KEY k)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
bool TSoggetti_app::controlli_notify(TSheet_field& s, int r, KEY k)
|
||||
{
|
||||
static bool delete_l = FALSE; // flag per cancellazione ultima riga
|
||||
static TToken_string oldrow;
|
||||
bool modified = FALSE;
|
||||
TMask& mask = s.mask();
|
||||
|
||||
if (k == K_CTRL+K_DEL) // avvenuta cancellazione riga
|
||||
{
|
||||
if (delete_l)
|
||||
modified = TRUE;
|
||||
delete_l = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (k)
|
||||
{
|
||||
case K_SPACE: // inizio modifica riga
|
||||
oldrow = s.row(r);
|
||||
break;
|
||||
case K_ENTER: // uscita da riga modificata
|
||||
{
|
||||
TToken_string& row = s.row(r);
|
||||
const TDate actdata(row.get(0));
|
||||
const TString16 acttipo(row.get());
|
||||
const TDate olddata(oldrow.get(0));
|
||||
const TString16 oldtipo(oldrow.get());
|
||||
if (olddata != actdata)
|
||||
{
|
||||
ordina_sheet_data(s);
|
||||
app().tipocon_set_sheet(s);
|
||||
s.force_update();
|
||||
}
|
||||
if (modstato_tcs(oldtipo) != ' ' || modstato_tcs(acttipo) != ' ')
|
||||
modified = TRUE;
|
||||
}
|
||||
break;
|
||||
case K_DEL: // richiesta di cancellazione riga
|
||||
{
|
||||
oldrow = s.row(r);
|
||||
const TString16 oldtipo(oldrow.get(1));
|
||||
if (r == (s.items()-1) && modstato_tcs(oldtipo) != ' ')
|
||||
delete_l = TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (modified)
|
||||
c_reord(s);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TSoggetti_app::benemerenze_notify(TSheet_field& s, int r, KEY k)
|
||||
{
|
||||
if (k == K_ENTER)
|
||||
{
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TSoggetti_app::storico_notify(TSheet_field& s, int r, KEY k)
|
||||
{
|
||||
if (k == K_ENTER)
|
||||
{
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
*/
|
||||
int at0400(int argc, char* argv[])
|
||||
{
|
||||
TConvoc_app a;
|
||||
a.run(argc, argv, "Gestione convocazione");
|
||||
return 0;
|
||||
}
|
||||
28
at/at0400a.h
Executable file
28
at/at0400a.h
Executable file
@ -0,0 +1,28 @@
|
||||
// Gestione convocazioni per BOLOGNA
|
||||
// definizione campi per maschera
|
||||
|
||||
#define F_NUMERO 101
|
||||
#define F_DATA 102
|
||||
#define F_PUNTO 103
|
||||
#define F_D_PUNTO 104
|
||||
#define F_TIPO 105
|
||||
#define F_D_TIPO 106
|
||||
#define F_CODSEZ 107
|
||||
#define F_DENSEZ 108
|
||||
#define F_CODSOT 109
|
||||
#define F_DENSOT 110
|
||||
#define F_NOTE 111
|
||||
#define F_CONVOCATI 112
|
||||
|
||||
#define F_ESEGUI 140
|
||||
|
||||
// pagina soggetti
|
||||
#define F_S_CODICE 101
|
||||
#define F_S_COGNOME 102
|
||||
#define F_S_NOME 103
|
||||
#define F_S_STAMPATO 104
|
||||
#define F_S_DATANASC 105
|
||||
#define F_S_CATDON 106
|
||||
#define F_S_TESSAVIS 107
|
||||
|
||||
#define F_S_DESC_CATDON 151
|
||||
311
at/at0400a.uml
Executable file
311
at/at0400a.uml
Executable file
@ -0,0 +1,311 @@
|
||||
#include "at0400a.h"
|
||||
#include "lf.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
|
||||
#include <toolbar.h>
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Testata" -1 -1 78 20
|
||||
|
||||
GROUPBOX DLG_NULL 77 9
|
||||
BEGIN
|
||||
PROMPT 1 0 "Opzioni per la convocazione"
|
||||
END
|
||||
|
||||
NUMBER F_NUMERO 5
|
||||
BEGIN
|
||||
PROMPT 2 1 "Numero "
|
||||
FIELD NUMERO
|
||||
FLAGS "RG"
|
||||
KEY 1
|
||||
USE LF_CONVOC
|
||||
INPUT NUMERO F_NUMERO
|
||||
DISPLAY "Numero" NUMERO
|
||||
DISPLAY "Data@10" DATA
|
||||
DISPLAY "Punto" PUNTO
|
||||
DISPLAY "Tipo" TIPO
|
||||
DISPLAY "Sez." CODSEZ
|
||||
DISPLAY "Sot." CODSOT
|
||||
OUTPUT F_NUMERO NUMERO
|
||||
OUTPUT F_DATA DATA
|
||||
OUTPUT F_PUNTO PUNTO
|
||||
OUTPUT F_TIPO TIPO
|
||||
OUTPUT F_CODSEZ CODSEZ
|
||||
OUTPUT F_CODSOT CODSOT
|
||||
CHECKTYPE REQUIRED
|
||||
VALIDATE NOT_EMPTY_FUNC
|
||||
END
|
||||
|
||||
DATE F_DATA
|
||||
BEGIN
|
||||
PROMPT 2 2 "Data "
|
||||
FIELD DATA
|
||||
KEY 2
|
||||
USE LF_CONVOC KEY 2
|
||||
INPUT DATA F_DATA
|
||||
INPUT PUNTO F_PUNTO
|
||||
INPUT TIPO F_TIPO
|
||||
INPUT CODSEZ F_CODSEZ
|
||||
INPUT CODSOT F_CODSOT
|
||||
COPY DISPLAY F_NUMERO
|
||||
COPY OUTPUT F_NUMERO
|
||||
CHECKTYPE REQUIRED
|
||||
VALIDATE NOT_EMPTY_FUNC
|
||||
END
|
||||
|
||||
STRING F_PUNTO 4
|
||||
BEGIN
|
||||
PROMPT 2 3 "Punto di raccolta "
|
||||
FIELD PUNTO
|
||||
FLAGS "U"
|
||||
USE LDN
|
||||
INPUT CODTAB F_PUNTO
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_PUNTO CODTAB
|
||||
OUTPUT F_D_PUNTO S0
|
||||
CHECKTYPE REQUIRED
|
||||
WARNING "Codice non presente"
|
||||
HELP "Punto di raccolta per la convocazione"
|
||||
VALIDATE NOT_EMPTY_FUNC
|
||||
END
|
||||
|
||||
STRING F_D_PUNTO 25
|
||||
BEGIN
|
||||
PROMPT 27 3 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_TIPO 2
|
||||
BEGIN
|
||||
PROMPT 2 4 "Tipo donazione "
|
||||
FIELD TIPO
|
||||
FLAGS "U"
|
||||
USE TDN
|
||||
INPUT CODTAB F_TIPO
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_TIPO CODTAB
|
||||
OUTPUT F_D_TIPO S0
|
||||
CHECKTYPE REQUIRED
|
||||
VALIDATE NOT_EMPTY_FUNC
|
||||
WARNING "Codice non presente"
|
||||
HELP "Tipo donazione"
|
||||
END
|
||||
|
||||
STRING F_D_TIPO 25
|
||||
BEGIN
|
||||
PROMPT 27 4 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CODSEZ 2
|
||||
BEGIN
|
||||
PROMPT 2 5 "Sezione "
|
||||
FIELD CODSEZ
|
||||
FLAGS "U"
|
||||
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
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Codice sezione da convocare"
|
||||
ADD MASK at0700a
|
||||
END
|
||||
|
||||
STRING F_DENSEZ 25
|
||||
BEGIN
|
||||
PROMPT 27 5 ""
|
||||
FLAGS "U"
|
||||
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
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Denominazione sezione da convocare"
|
||||
ADD MASK at0700a
|
||||
END
|
||||
|
||||
STRING F_CODSOT 2
|
||||
BEGIN
|
||||
PROMPT 2 6 "Sottogruppo "
|
||||
FIELD CODSOT
|
||||
COPY ALL F_CODSEZ
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Codice sottogruppo da convocare"
|
||||
ADD MASK at0700a
|
||||
END
|
||||
|
||||
STRING F_DENSOT 25
|
||||
BEGIN
|
||||
PROMPT 27 6 ""
|
||||
FLAGS "U"
|
||||
COPY USE F_DENSEZ
|
||||
INPUT DENSEZ F_DENSEZ
|
||||
INPUT DENSOT F_DENSOT
|
||||
COPY DISPLAY F_DENSEZ
|
||||
COPY OUTPUT F_DENSEZ
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Sottogruppo da convocare"
|
||||
ADD MASK at0700a
|
||||
END
|
||||
|
||||
STRING F_NOTE 100 60
|
||||
BEGIN
|
||||
PROMPT 2 7 "Note "
|
||||
FIELD NOTE
|
||||
END
|
||||
|
||||
BUTTON F_ESEGUI 20 2
|
||||
BEGIN
|
||||
PROMPT -11 -1 "Esegui convocazione"
|
||||
END
|
||||
|
||||
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Soggetti" -1 -1 78 20
|
||||
|
||||
SPREADSHEET F_CONVOCATI
|
||||
BEGIN
|
||||
PROMPT 0 1 ""
|
||||
ITEM "Codice@6"
|
||||
ITEM "Cognome@25"
|
||||
ITEM "Nome@25"
|
||||
ITEM "St."
|
||||
ITEM "Nato il@10"
|
||||
ITEM "Cat."
|
||||
ITEM "Tessera"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
|
||||
PAGE "Soggetto " -1 -1 78 20
|
||||
|
||||
GROUPBOX DLG_NULL 77 5
|
||||
BEGIN
|
||||
PROMPT 1 0 ""
|
||||
FLAGS "R"
|
||||
END
|
||||
|
||||
NUMBER F_S_CODICE 6
|
||||
BEGIN
|
||||
PROMPT 2 1 "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_CATDON CATDON
|
||||
OUTPUT F_S_TESSAVIS TESSAVIS
|
||||
CHECKTYPE NORMAL
|
||||
ADD RUN at0 -0
|
||||
END
|
||||
|
||||
STRING F_S_COGNOME 25
|
||||
BEGIN
|
||||
PROMPT 2 2 "Cognome e nome "
|
||||
USE LF_SOGGETTI KEY 2
|
||||
INPUT COGNOME F_S_COGNOME
|
||||
INPUT NOME F_S_NOME
|
||||
DISPLAY "Cognome@25" COGNOME
|
||||
DISPLAY "Nome@25" NOME
|
||||
DISPLAY "Nato il@10" DATANASC
|
||||
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 ""
|
||||
COPY ALL F_S_COGNOME
|
||||
COPY OUTPUT F_S_CODICE
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Nome del soggetto"
|
||||
ADD RUN at0 -0
|
||||
END
|
||||
|
||||
BOOLEAN F_S_STAMPATO
|
||||
BEGIN
|
||||
PROMPT 46 3 "Convoc. stampata"
|
||||
END
|
||||
|
||||
DATE F_S_DATANASC
|
||||
BEGIN
|
||||
PROMPT 2 3 "Nato il "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_CATDON 2
|
||||
BEGIN
|
||||
PROMPT 2 7 "Cat. "
|
||||
FLAGS "D"
|
||||
USE CTD
|
||||
INPUT CODTAB F_S_CATDON
|
||||
OUTPUT F_S_DESC_CATDON S0
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
STRING F_S_TESSAVIS 10
|
||||
BEGIN
|
||||
PROMPT 52 7 "Tessera AVIS "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_DESC_CATDON 25
|
||||
BEGIN
|
||||
PROMPT 12 7 ""
|
||||
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
|
||||
80
at/at0700.h
80
at/at0700.h
@ -1,40 +1,40 @@
|
||||
// definizione campi della maschera at0700a.msk
|
||||
|
||||
#define F_CODSEZ 101
|
||||
#define F_CODSOT 103
|
||||
#define F_DENSEZ 102
|
||||
#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
|
||||
// definizione campi della maschera at0700a.msk
|
||||
|
||||
#define F_CODSEZ 101
|
||||
#define F_CODSOT 103
|
||||
#define F_DENSEZ 102
|
||||
#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
|
||||
|
||||
844
at/at0700a.uml
844
at/at0700a.uml
@ -1,422 +1,422 @@
|
||||
#include "at0700.h"
|
||||
#include "lf.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
#include <toolbar.h>
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Sezioni 1" -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
|
||||
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,1@
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
STRING F_CODSOT 2
|
||||
BEGIN
|
||||
PROMPT 2 2 "Cod. sottogruppo "
|
||||
FIELD CODSOT
|
||||
FLAGS "U"
|
||||
KEY 1
|
||||
COPY ALL F_CODSEZ
|
||||
MESSAGE COPY,2@
|
||||
CHECKTYPE NORMAL
|
||||
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
|
||||
INPUT DENSOT F_DENSOT
|
||||
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 "Sezioni 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
|
||||
#include "at0700.h"
|
||||
#include "lf.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
#include <toolbar.h>
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Sezioni 1" -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
|
||||
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,1@
|
||||
CHECKTYPE REQUIRED
|
||||
END
|
||||
|
||||
STRING F_CODSOT 2
|
||||
BEGIN
|
||||
PROMPT 2 2 "Cod. sottogruppo "
|
||||
FIELD CODSOT
|
||||
FLAGS "U"
|
||||
KEY 1
|
||||
COPY ALL F_CODSEZ
|
||||
MESSAGE COPY,2@
|
||||
CHECKTYPE NORMAL
|
||||
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
|
||||
INPUT DENSOT F_DENSOT
|
||||
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 "Localita' "
|
||||
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 "Sezioni 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
|
||||
|
||||
314
at/at0800a.uml
314
at/at0800a.uml
@ -1,157 +1,157 @@
|
||||
#include "at0800.h"
|
||||
#include "lf.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
#include <toolbar.h>
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Medici" -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
|
||||
#include "at0800.h"
|
||||
#include "lf.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
#include <toolbar.h>
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Medici" -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
|
||||
|
||||
52
at/at1.cpp
52
at/at1.cpp
@ -1,23 +1,29 @@
|
||||
#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;
|
||||
}
|
||||
#include <xvt.h>
|
||||
#include <strings.h>
|
||||
#include <checks.h>
|
||||
|
||||
#include "at1.h"
|
||||
|
||||
#define usage "Error - usage : %s -{0|1|2|3}"
|
||||
|
||||
int main(int argc,char** argv)
|
||||
|
||||
{
|
||||
int rt = -1 ;
|
||||
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;
|
||||
case 2:
|
||||
rt = at1300(argc,argv) ; break;
|
||||
case 3:
|
||||
rt = at1400(argc,argv) ; break;
|
||||
default:
|
||||
error_box(usage, argv[0]) ; break;
|
||||
}
|
||||
return rt;
|
||||
}
|
||||
|
||||
28
at/at1.url
28
at/at1.url
@ -1,21 +1,31 @@
|
||||
|
||||
#define APPNAME AVIS
|
||||
#define QAPPNAME "AVIS"
|
||||
#define LIBDIR f:\xvt.403\win_x86\ptk\lib
|
||||
#define QFIRMNAME "AGA Informatica S.r.l."
|
||||
|
||||
#include <default.url>
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at1 -0
|
||||
* ---------------------------------------------------- */
|
||||
/* at1 -0 chiusura periodica */
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at1 -1
|
||||
* ---------------------------------------------------- */
|
||||
|
||||
/* at1 -1 attribuzione benemerenze */
|
||||
MENUBAR MENU_BAR(1)
|
||||
|
||||
MENU MENU_BAR(1)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
|
||||
/* at1 -2 sblocco sospesi */
|
||||
MENUBAR MENU_BAR(2)
|
||||
|
||||
MENU MENU_BAR(2)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* at1 -3 stampa tessere */
|
||||
MENUBAR MENU_BAR(3)
|
||||
|
||||
MENU MENU_BAR(3)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
|
||||
350
at/at1100.cpp
350
at/at1100.cpp
@ -1,160 +1,168 @@
|
||||
#include <mask.h>
|
||||
#include <form.h>
|
||||
#include <mask.h>
|
||||
#include <printapp.h>
|
||||
|
||||
#include "lf.h"
|
||||
#include "medici.h"
|
||||
#include <comuni.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "at1.h"
|
||||
#include "lf.h" // se non lo metto non riesco a usare gli LF
|
||||
|
||||
// nomi campi maschera
|
||||
#include "at1100a.h"
|
||||
|
||||
// nomi dei campi
|
||||
#include "soggetti.h"
|
||||
#include "donaz.h"
|
||||
#include "contsan.h"
|
||||
#include "benem.h"
|
||||
#include "storico.h"
|
||||
#include "sezioni.h"
|
||||
|
||||
enum ts { undefined = 0, elenco = 1, etichette = 2 };
|
||||
|
||||
// definizione form per etichette
|
||||
class TMed_form : public TForm
|
||||
class TChiusura_app : public TPrintapp
|
||||
{
|
||||
public:
|
||||
static bool filter_func_chiusura(const TRelation *);
|
||||
|
||||
TMask* _msk;
|
||||
TRelation* _rel;
|
||||
|
||||
int _cur;
|
||||
TDate _data_chiusura;
|
||||
TParagraph_string _operazione;
|
||||
|
||||
|
||||
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);
|
||||
|
||||
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();
|
||||
TMedprint_application() : _data_stampa(TODAY), _indirizzo("",25), _dencom("",25), _cognome_nome("",40) {}
|
||||
TChiusura_app() : _data_chiusura(TODAY), _operazione("",30) {}
|
||||
};
|
||||
|
||||
HIDDEN inline TMedprint_application& app() { return (TMedprint_application&) main_app(); }
|
||||
HIDDEN inline TChiusura_app& app() { return (TChiusura_app&) main_app(); }
|
||||
|
||||
TCursor* TMed_form::cursor() const { return app().current_cursor(); }
|
||||
|
||||
TRelation* TMed_form::relation() const { return cursor()->relation(); }
|
||||
|
||||
void TMedprint_application::set_page(int file, int cnt)
|
||||
void TChiusura_app::filtra_sezioni()
|
||||
{
|
||||
// costruzione etichette
|
||||
switch (_tipo_stampa)
|
||||
const TString16 sezini = _msk->get(F_SEZINI);
|
||||
const TString16 sotini = _msk->get(F_SOTINI);
|
||||
const TString16 sezfin = _msk->get(F_SEZFIN);
|
||||
const TString16 sotfin = _msk->get(F_SOTFIN);
|
||||
TRectype da(LF_SOGGETTI);
|
||||
TRectype a(LF_SOGGETTI);
|
||||
if (sezini.not_empty())
|
||||
da.put(SOG_CODSEZ, sezini);
|
||||
if (sotini.not_empty())
|
||||
da.put(SOG_CODSOT, sotini);
|
||||
if (sezfin.not_empty())
|
||||
a.put(SOG_CODSEZ, sezfin);
|
||||
if (sotfin.not_empty())
|
||||
a.put(SOG_CODSOT, sotfin);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
|
||||
bool TChiusura_app::preprocess_page(int file, int counter)
|
||||
{
|
||||
_operazione = "Nulla";
|
||||
|
||||
TRectype& recsez = current_cursor()->curr(LF_SEZIONI);
|
||||
TLocalisamfile& sogg = current_cursor()->file(LF_SOGGETTI);
|
||||
|
||||
const TString16 cat_estinti = recsez.get(SEZ_CATESTI);
|
||||
const TString16 cat_cancellati = recsez.get(SEZ_CATCANC);
|
||||
const TString16 cat_emeriti = recsez.get(SEZ_CATEMER);
|
||||
|
||||
const int intesti = recsez.get_int(SEZ_INTESTI);
|
||||
const int donemer = recsez.get_int(SEZ_DONEMER);
|
||||
|
||||
const TString16 catsog = sogg.get(SOG_CATDON);
|
||||
if (catsog==cat_estinti || catsog==cat_cancellati)
|
||||
{
|
||||
case etichette:
|
||||
const int totdon = sogg.get_int(SOG_TOTDON);
|
||||
if (totdon >= donemer && donemer != 0)
|
||||
{
|
||||
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:
|
||||
_operazione = "Passaggio a emeriti";
|
||||
sogg.put(SOG_CATDON,cat_emeriti);
|
||||
sogg.rewrite();
|
||||
}
|
||||
else
|
||||
_operazione = "Cancellato";
|
||||
sogg.remove();
|
||||
}
|
||||
else
|
||||
{
|
||||
TDate dataultdon = sogg.get(SOG_DATAULTDON);
|
||||
if (dataultdon.ok())
|
||||
{
|
||||
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));
|
||||
dataultdon.addyear(intesti);
|
||||
if (dataultdon < _data_chiusura)
|
||||
{
|
||||
_operazione = "Passaggio a estinti";
|
||||
sogg.put(SOG_CATDON,cat_estinti);
|
||||
sogg.rewrite();
|
||||
}
|
||||
else
|
||||
_operazione = "Non doveva essere filtrato: data ancora valida";
|
||||
}
|
||||
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);
|
||||
}
|
||||
else
|
||||
_operazione = "Non doveva essere filtrato: data vuota";
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TMedprint_application::set_print(int)
|
||||
|
||||
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;
|
||||
|
||||
TRectype& recsez = rel->lfile(LF_SEZIONI).curr();
|
||||
TRectype& recsog = rel->lfile().curr();
|
||||
|
||||
const TString16 cat_estinti = recsez.get(SEZ_CATESTI);
|
||||
const TString16 cat_cancellati = recsez.get(SEZ_CATCANC);
|
||||
const TString16 cat_emeriti = recsez.get(SEZ_CATEMER);
|
||||
const int intesti = recsez.get_int(SEZ_INTESTI);
|
||||
|
||||
const TString16 catsog = recsog.get(SOG_CATDON);
|
||||
filtrato = (catsog == cat_estinti || catsog == cat_cancellati);
|
||||
if (!filtrato && catsog != cat_emeriti)
|
||||
{
|
||||
TDate dataultdon = recsog.get(SOG_DATAULTDON);
|
||||
if (dataultdon.ok())
|
||||
{
|
||||
dataultdon.addyear(intesti);
|
||||
filtrato = (dataultdon < app()._data_chiusura);
|
||||
}
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TChiusura_app::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);
|
||||
if (tasto == K_ENTER)
|
||||
{
|
||||
_data_chiusura = _msk->get(F_DATA);
|
||||
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();
|
||||
add_file(LF_SOGGETTI);
|
||||
filtra_sezioni();
|
||||
current_cursor()->set_filterfunction(filter_func_chiusura,TRUE);
|
||||
reset_print();
|
||||
crea_intestazione();
|
||||
return TRUE;
|
||||
}
|
||||
@ -162,62 +170,50 @@ bool TMedprint_application::set_print(int)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TMedprint_application::crea_intestazione()
|
||||
|
||||
void TChiusura_app::crea_intestazione()
|
||||
{
|
||||
reset_header();
|
||||
reset_header();
|
||||
|
||||
TString sep(132);
|
||||
TString16 data_stampa;
|
||||
|
||||
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);
|
||||
sep.fill('-');
|
||||
set_header(1, (const char *) sep);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
sep.right_just(132);
|
||||
set_header(2,(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---------------");
|
||||
}
|
||||
set_header(2,"@0gCHIUSURA PERIODICA 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 TMedprint_application::user_create()
|
||||
bool TChiusura_app::user_create()
|
||||
{
|
||||
_rel = new TRelation(LF_MEDICI);
|
||||
_rel->add(LF_COMUNI, "COM==COM");
|
||||
_rel->add("LCP", "CODTAB==LOCALITA");
|
||||
_msk = new TMask("at1100a");
|
||||
_rel = new TRelation(LF_SOGGETTI);
|
||||
_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
|
||||
_cur = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
_msk = new TMask("at1100a");
|
||||
|
||||
_form_eti = new TMed_form("AT_ETMED");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TMedprint_application::user_destroy()
|
||||
bool TChiusura_app::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_eti;
|
||||
return TRUE;
|
||||
delete _rel;
|
||||
delete _msk;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at1100(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TMedprint_application a;
|
||||
|
||||
a.run(argc, argv, "Stampa Medici");
|
||||
|
||||
return 0;
|
||||
}
|
||||
TChiusura_app a;
|
||||
a.run(argc, argv, "Chiusura periodica");
|
||||
return 0;
|
||||
}
|
||||
18
at/at1100a.h
18
at/at1100a.h
@ -1,10 +1,12 @@
|
||||
// stampa anagrafica medici
|
||||
// chiusura periodica
|
||||
// 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
|
||||
#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
|
||||
|
||||
162
at/at1100a.uml
162
at/at1100a.uml
@ -1,93 +1,137 @@
|
||||
#include "at1100a.h"
|
||||
#include <lffiles.h>
|
||||
#include "lf.h"
|
||||
PAGE "Definizione Stampe" -1 -1 70 17
|
||||
PAGE "Chiusura annuale" -1 -1 78 20
|
||||
|
||||
RADIOBUTTON F_SORT 25
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
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@
|
||||
PROMPT 1 1 "Scelta sezioni/sottogruppi"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 65 4
|
||||
STRING F_SEZINI 2
|
||||
BEGIN
|
||||
PROMPT 3 5 "Selezione "
|
||||
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
|
||||
|
||||
NUMBER F_CODFR 6
|
||||
STRING F_D_SEZINI 25
|
||||
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
|
||||
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
|
||||
|
||||
NUMBER F_CODTO 6
|
||||
STRING F_SOTINI 2
|
||||
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
|
||||
PROMPT 2 3 " "
|
||||
COPY ALL F_SEZINI
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Codice sottogruppo da cui partire"
|
||||
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
|
||||
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_COGTO 25
|
||||
STRING F_SEZFIN 2
|
||||
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
|
||||
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
|
||||
|
||||
GROUPBOX DLG_NULL 50 4
|
||||
STRING F_D_SEZFIN 25
|
||||
BEGIN
|
||||
PROMPT 3 11 "Stampa"
|
||||
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
|
||||
|
||||
BUTTON F_ELENCO 9 2
|
||||
STRING F_SOTFIN 2
|
||||
BEGIN
|
||||
PROMPT 4 12 "Elenco"
|
||||
MESSAGE EXIT,F_ELENCO
|
||||
PROMPT 41 3 " "
|
||||
COPY ALL F_SEZFIN
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Codice sottogruppo finale"
|
||||
END
|
||||
|
||||
BUTTON F_ETICHETTE 9 2
|
||||
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 16 12 "Etichette"
|
||||
MESSAGE EXIT,F_ETICHETTE
|
||||
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 32 12 ""
|
||||
PROMPT -22 14 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
388
at/at1200.cpp
388
at/at1200.cpp
@ -1,169 +1,177 @@
|
||||
#include <mask.h>
|
||||
#include <form.h>
|
||||
#include <mask.h>
|
||||
#include <printapp.h>
|
||||
|
||||
#include <lffiles.h>
|
||||
#include "lf.h"
|
||||
#include "sezioni.h"
|
||||
#include <comuni.h>
|
||||
#include <recarray.h>
|
||||
#include <tabutil.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "at1.h"
|
||||
#include "lf.h" // se non lo metto non riesco a usare gli LF
|
||||
|
||||
// nomi campi maschera
|
||||
#include "at1200a.h"
|
||||
enum ts { undefined = 0, elenco = 1, etichette = 2 };
|
||||
|
||||
// nomi dei campi
|
||||
#include "soggetti.h"
|
||||
#include "donaz.h"
|
||||
#include "benem.h"
|
||||
#include "sezioni.h"
|
||||
|
||||
// definizione form per etichette
|
||||
class TSez_form : public TForm
|
||||
class TAttriben_app : public TPrintapp
|
||||
{
|
||||
public:
|
||||
TMask* _msk;
|
||||
TRelation* _rel;
|
||||
|
||||
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() {};
|
||||
};
|
||||
TLocalisamfile* _donaz;
|
||||
TLocalisamfile* _benem;
|
||||
TRecord_array* _sdonazioni;
|
||||
TRecord_array* _sbenemerenze;
|
||||
|
||||
int _cur;
|
||||
TDate _data_attribuzione; // data attribuzione benemerenza
|
||||
TDate _data_stampa;
|
||||
TString16 _tipoben; // tipo benemerenza da assegnare
|
||||
int _numdon; // numero donazioni necessarie
|
||||
TString16 _codsez, _codsot;
|
||||
TParagraph_string _cognome_nome;
|
||||
|
||||
static bool filter_func_attriben(const TRelation* rel);
|
||||
|
||||
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);
|
||||
|
||||
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();
|
||||
|
||||
TSezprint_application() : _data_stampa(TODAY), _indirizzo("", 22), _dencom("", 25) {}
|
||||
void header_sezione(const TString16 codsez, const TString16 codsot);
|
||||
TAttriben_app() : _data_attribuzione(TODAY), _data_stampa(TODAY), _tipoben(""), _cognome_nome("",25) {}
|
||||
};
|
||||
|
||||
HIDDEN inline TSezprint_application& app() { return (TSezprint_application&) main_app(); }
|
||||
HIDDEN inline TAttriben_app& app() { return (TAttriben_app&) main_app(); }
|
||||
|
||||
TCursor* TSez_form::cursor() const { return app().current_cursor(); }
|
||||
|
||||
TRelation* TSez_form::relation() const { return cursor()->relation(); }
|
||||
|
||||
void TSezprint_application::set_page(int file, int cnt)
|
||||
void TAttriben_app::filtra_sezioni()
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
const TString16 sezini = _msk->get(F_SEZINI);
|
||||
const TString16 sotini = _msk->get(F_SOTINI);
|
||||
const TString16 sezfin = _msk->get(F_SEZFIN);
|
||||
const TString16 sotfin = _msk->get(F_SOTFIN);
|
||||
TRectype da(LF_SOGGETTI);
|
||||
TRectype a(LF_SOGGETTI);
|
||||
if (sezini.not_empty())
|
||||
da.put(SOG_CODSEZ, sezini);
|
||||
if (sotini.not_empty())
|
||||
da.put(SOG_CODSOT, sotini);
|
||||
if (sezfin.not_empty())
|
||||
a.put(SOG_CODSEZ, sezfin);
|
||||
if (sotfin.not_empty())
|
||||
a.put(SOG_CODSOT, sotfin);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
bool TSezprint_application::preprocess_page(int file, int counter)
|
||||
bool TAttriben_app::preprocess_page(int file, int counter)
|
||||
{
|
||||
if (_tipo_stampa == elenco)
|
||||
TString80 nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
|
||||
TRectype& recsez = current_cursor()->curr(LF_SEZIONI);
|
||||
TLocalisamfile& sogg = current_cursor()->file(LF_SOGGETTI);
|
||||
const int totdon = sogg.get_int(SOG_TOTDON);
|
||||
// salto pagina se cambio sezione
|
||||
const TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
const TString16 codsot = current_cursor()->curr().get(SOG_CODSOT);
|
||||
if ((_codsez!=codsez)||(_codsot!=codsot))
|
||||
{
|
||||
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);
|
||||
}
|
||||
if (_codsez != "**")
|
||||
printer().formfeed();
|
||||
_codsez = codsez;
|
||||
_codsot = codsot;
|
||||
header_sezione(codsez, codsot);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TSezprint_application::set_print(int)
|
||||
void TAttriben_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,"@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@pn", FLD(LF_SOGGETTI,SOG_TOTDON,"###"));
|
||||
}
|
||||
|
||||
bool TAttriben_app::filter_func_attriben(const TRelation* rel)
|
||||
{
|
||||
bool filtrato;
|
||||
// filtro chi non ha già ricevuto la benemerenza richiesta
|
||||
TLocalisamfile ben(LF_BENEM);
|
||||
ben.setkey(3);
|
||||
TRectype& recben = ben.curr();
|
||||
recben.zero();
|
||||
recben.put(BEN_CODICE, rel->lfile().curr().get_long(SOG_CODICE));
|
||||
recben.put(BEN_TIPOBEN, app()._tipoben);
|
||||
filtrato = (ben.read() != NOERR); // se ha gia' la ben. non va filtrato
|
||||
// filtro chi ha il numero donazioni giuste
|
||||
if (filtrato)
|
||||
filtrato = rel->lfile().curr().get_int(SOG_TOTDON) >= app()._numdon;
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
void TAttriben_app::header_sezione(const TString16 codsez, const TString16 codsot)
|
||||
{
|
||||
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << codsez;
|
||||
intestazione << "/";
|
||||
intestazione << codsot;
|
||||
intestazione << " ";
|
||||
intestazione << densez;
|
||||
if ((densot.ok())&& (densot.not_empty()))
|
||||
{
|
||||
intestazione << "/";
|
||||
intestazione << densot;
|
||||
}
|
||||
intestazione.center_just();
|
||||
set_header(1,"@0g%s", (const char*) intestazione);
|
||||
return;
|
||||
}
|
||||
|
||||
bool TAttriben_app::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);
|
||||
|
||||
if (tasto == K_ENTER)
|
||||
{
|
||||
_codsez = "**";
|
||||
_codsot = "**";
|
||||
_data_attribuzione = _msk->get(F_DATA);
|
||||
_tipoben = _msk->get(F_TIPOBEN);
|
||||
TTable bnz("BNZ");
|
||||
bnz.put("CODTAB",(const char*) _tipoben);
|
||||
if (bnz.read() == NOERR)
|
||||
_numdon = bnz.get_int("I0");
|
||||
else
|
||||
return FALSE;
|
||||
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();
|
||||
add_file(LF_SOGGETTI);
|
||||
filtra_sezioni();
|
||||
current_cursor()->setfilter("TOTDON!=0");
|
||||
current_cursor()->set_filterfunction(filter_func_attriben,TRUE);
|
||||
reset_print();
|
||||
crea_intestazione();
|
||||
return TRUE;
|
||||
}
|
||||
@ -171,64 +179,64 @@ bool TSezprint_application::set_print(int)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TSezprint_application::crea_intestazione()
|
||||
|
||||
void TAttriben_app::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---------------");
|
||||
}
|
||||
reset_header();
|
||||
|
||||
TString sep(132);
|
||||
sep = "ATTRIBUZIONE BENEMERENZA ";
|
||||
sep << _tipoben;
|
||||
const TString80 descr = _msk->get(F_D_TIPOBEN);
|
||||
sep << " ";
|
||||
sep << descr;
|
||||
sep << " ALLA DATA ";
|
||||
TString16 data_stampa = _data_attribuzione.string();
|
||||
sep << data_stampa;
|
||||
sep.center_just();
|
||||
set_header(2, "@0g%s", (const char*) sep);
|
||||
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@47Num.don.");
|
||||
set_header(5,"@0g------@7g--@10g-------------------------@36g----------@47g--------");
|
||||
}
|
||||
|
||||
bool TSezprint_application::user_create()
|
||||
bool TAttriben_app::user_create()
|
||||
{
|
||||
_rel = new TRelation(LF_SEZIONI);
|
||||
_rel->add(LF_COMUNI, "COM==COM");
|
||||
_rel->add("LCP", "CODTAB==LOCALITA");
|
||||
_msk = new TMask("at1200a");
|
||||
_rel = new TRelation(LF_SOGGETTI);
|
||||
_rel->add(LF_SEZIONI,"CODSEZ==CODSEZ|CODSOT==CODSOT");
|
||||
_cur = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
|
||||
|
||||
_donaz = new TLocalisamfile(LF_DONAZ);
|
||||
_benem = new TLocalisamfile(LF_BENEM);
|
||||
|
||||
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
|
||||
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per denominazione
|
||||
_sdonazioni = new TRecord_array(LF_DONAZ,DON_PROGDON);
|
||||
_sbenemerenze = new TRecord_array(LF_BENEM, BEN_PROGBEN);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
_msk = new TMask("at1200a");
|
||||
|
||||
_form_eti = new TSez_form("AT_ETSEZ");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TSezprint_application::user_destroy()
|
||||
bool TAttriben_app::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_eti;
|
||||
return TRUE;
|
||||
delete _rel;
|
||||
delete _msk;
|
||||
delete _donaz;
|
||||
delete _benem;
|
||||
delete _sdonazioni;
|
||||
delete _sbenemerenze;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at1200(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TSezprint_application a;
|
||||
|
||||
a.run(argc, argv, "Stampa Sezioni");
|
||||
|
||||
return 0;
|
||||
}
|
||||
TAttriben_app a;
|
||||
a.run(argc, argv, "Attribuzione benemerenze");
|
||||
return 0;
|
||||
}
|
||||
20
at/at1200a.h
20
at/at1200a.h
@ -1,10 +1,14 @@
|
||||
// stampa anagrafica sezioni/sottogruppi
|
||||
// attribuzione benemerenze
|
||||
// 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
|
||||
#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
|
||||
#define F_TIPOBEN 110
|
||||
#define F_D_TIPOBEN 111
|
||||
|
||||
184
at/at1200a.uml
184
at/at1200a.uml
@ -1,93 +1,159 @@
|
||||
#include "at1200a.h"
|
||||
#include <lffiles.h>
|
||||
#include "lf.h"
|
||||
PAGE "Definizione Stampe" -1 -1 70 17
|
||||
PAGE "Attribuzione benemerenze" -1 -1 78 10
|
||||
|
||||
RADIOBUTTON F_SORT 25
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
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@
|
||||
PROMPT 1 1 "Scelta sezioni/sottogruppi"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 65 4
|
||||
STRING F_SEZINI 2
|
||||
BEGIN
|
||||
PROMPT 3 5 "Selezione "
|
||||
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_CODFR 6
|
||||
STRING F_D_SEZINI 25
|
||||
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
|
||||
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_CODTO 6
|
||||
STRING F_SOTINI 2
|
||||
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
|
||||
PROMPT 2 3 " "
|
||||
COPY ALL F_SEZINI
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Codice sottogruppo da cui partire"
|
||||
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
|
||||
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_DENTO 25
|
||||
STRING F_SEZFIN 2
|
||||
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
|
||||
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
|
||||
|
||||
GROUPBOX DLG_NULL 50 4
|
||||
STRING F_D_SEZFIN 25
|
||||
BEGIN
|
||||
PROMPT 3 11 "Stampa"
|
||||
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
|
||||
|
||||
BUTTON F_ELENCO 9 2
|
||||
STRING F_SOTFIN 2
|
||||
BEGIN
|
||||
PROMPT 4 12 "Elenco"
|
||||
MESSAGE EXIT,F_ELENCO
|
||||
PROMPT 41 3 " "
|
||||
COPY ALL F_SEZFIN
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Codice sottogruppo finale"
|
||||
END
|
||||
|
||||
BUTTON F_ETICHETTE 9 2
|
||||
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 16 12 "Etichette"
|
||||
MESSAGE EXIT,F_ETICHETTE
|
||||
PROMPT 2 5 "Data attribuzione "
|
||||
CHECKTYPE REQUIRED
|
||||
HELP "Data di riferimento per l'attribuzione delle benemerenze"
|
||||
END
|
||||
|
||||
STRING F_TIPOBEN 2
|
||||
BEGIN
|
||||
PROMPT 2 6 "Benemerenza "
|
||||
FLAGS "U"
|
||||
USE BNZ
|
||||
INPUT CODTAB F_TIPOBEN
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_TIPOBEN CODTAB
|
||||
OUTPUT F_D_TIPOBEN S0
|
||||
CHECKTYPE REQUIRED
|
||||
VALIDATE NOT_EMPTY_FUNC
|
||||
WARNING "Codice benemerenza non presente"
|
||||
HELP "Benemerenza da assegnare"
|
||||
END
|
||||
|
||||
STRING F_D_TIPOBEN 25
|
||||
BEGIN
|
||||
PROMPT 26 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
BEGIN
|
||||
PROMPT -12 -1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT 32 12 ""
|
||||
PROMPT -22 -1 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
247
at/at1300.cpp
Executable file
247
at/at1300.cpp
Executable file
@ -0,0 +1,247 @@
|
||||
#include <form.h>
|
||||
#include <mask.h>
|
||||
#include <printapp.h>
|
||||
#include <recarray.h>
|
||||
#include <tabutil.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "at1.h"
|
||||
#include "lf.h" // se non lo metto non riesco a usare gli LF
|
||||
#include "atlib.h"
|
||||
|
||||
#define ALIAS_TCS 200
|
||||
#define FINE_SOSPENSIONE "FS"
|
||||
|
||||
// nomi campi maschera
|
||||
#include "at1300a.h"
|
||||
|
||||
// nomi dei campi
|
||||
#include "soggetti.h"
|
||||
#include "contsan.h"
|
||||
#include "sezioni.h"
|
||||
|
||||
class TSbloccoSO_app : public TPrintapp
|
||||
{
|
||||
TMask* _msk;
|
||||
TRelation* _rel;
|
||||
|
||||
TLocalisamfile* _contsan;
|
||||
TRecord_array* _scontrolli;
|
||||
|
||||
int _cur;
|
||||
TDate _data_sblocco; // data scadenza sospensione fino a _data_sblocco
|
||||
TDate _data_stampa;
|
||||
TString16 _tiposo; // tipo sospesione da sbloccare
|
||||
TString16 _codsez, _codsot;
|
||||
|
||||
static bool filter_func_sbloccoSO(const TRelation* rel);
|
||||
|
||||
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 filtra_sezioni();
|
||||
void crea_intestazione();
|
||||
void header_sezione(const TString16 codsez, const TString16 codsot);
|
||||
TSbloccoSO_app() : _data_sblocco(TODAY), _data_stampa(TODAY), _tiposo("") {}
|
||||
};
|
||||
|
||||
HIDDEN inline TSbloccoSO_app& app() { return (TSbloccoSO_app&) main_app(); }
|
||||
|
||||
void TSbloccoSO_app::filtra_sezioni()
|
||||
{
|
||||
const TString16 sezini = _msk->get(F_SEZINI);
|
||||
const TString16 sotini = _msk->get(F_SOTINI);
|
||||
const TString16 sezfin = _msk->get(F_SEZFIN);
|
||||
const TString16 sotfin = _msk->get(F_SOTFIN);
|
||||
TRectype da(LF_SOGGETTI);
|
||||
TRectype a(LF_SOGGETTI);
|
||||
if (sezini.not_empty())
|
||||
da.put(SOG_CODSEZ, sezini);
|
||||
if (sotini.not_empty())
|
||||
da.put(SOG_CODSOT, sotini);
|
||||
if (sezfin.not_empty())
|
||||
a.put(SOG_CODSEZ, sezfin);
|
||||
if (sotfin.not_empty())
|
||||
a.put(SOG_CODSOT, sotfin);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
bool TSbloccoSO_app::preprocess_page(int file, int counter)
|
||||
{
|
||||
TRectype& recsog = current_cursor()->curr();
|
||||
TRectype* key = new TRectype(LF_CONTSAN);
|
||||
long codice = recsog.get_long(SOG_CODICE);
|
||||
key->put(CON_CODICE, codice);
|
||||
int err = _scontrolli->read(key);
|
||||
int progcon = _scontrolli->rows()+1;
|
||||
TRectype& reccon = _contsan->curr();
|
||||
reccon.zero();
|
||||
reccon.put(CON_CODICE, codice);
|
||||
reccon.put(CON_PROGCON, progcon);
|
||||
reccon.put(CON_DATACON, _data_stampa);
|
||||
reccon.put(CON_TIPOCON, FINE_SOSPENSIONE);
|
||||
_scontrolli->add_row(reccon);
|
||||
_scontrolli->rewrite();
|
||||
con_reord(recsog, _scontrolli);
|
||||
current_cursor()->file().rewrite();
|
||||
|
||||
// salto pagina se cambio sezione
|
||||
const TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
const TString16 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 TSbloccoSO_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,"@61g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
|
||||
}
|
||||
|
||||
bool TSbloccoSO_app::filter_func_sbloccoSO(const TRelation* rel)
|
||||
{
|
||||
bool filtrato = FALSE;
|
||||
TRectype& recsog = rel->lfile().curr();
|
||||
TRectype* key = new TRectype(LF_CONTSAN);
|
||||
long codice = recsog.get_long(SOG_CODICE);
|
||||
key->put(CON_CODICE, codice);
|
||||
int err = app()._scontrolli->read(key);
|
||||
if (err == NOERR)
|
||||
{
|
||||
TString16 stato = recsog.get(SOG_STATO);
|
||||
TDate datastato = recsog.get(SOG_DATASTATO);
|
||||
for (int r=1; r<=app()._scontrolli->rows(); r++)
|
||||
{
|
||||
const TRectype& riga = app()._scontrolli->row(r);
|
||||
TString16 tipo = riga.get(CON_TIPOCON);
|
||||
TDate datatipo = riga.get(CON_DATACON);
|
||||
if (tipo == stato && datatipo == datastato)
|
||||
{
|
||||
TString16 prosstipo = riga.get(CON_PROSSTIPO);
|
||||
if (modstato_tcs(prosstipo) == 'F')
|
||||
{
|
||||
TDate datafine = riga.get(CON_PROSSDATA);
|
||||
filtrato = datafine <= app()._data_sblocco;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
void TSbloccoSO_app::header_sezione(const TString16 codsez, const TString16 codsot)
|
||||
{
|
||||
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << codsez;
|
||||
intestazione << "/";
|
||||
intestazione << codsot;
|
||||
intestazione << " ";
|
||||
intestazione << densez;
|
||||
if ((densot.ok())&& (densot.not_empty()))
|
||||
{
|
||||
intestazione << "/";
|
||||
intestazione << densot;
|
||||
}
|
||||
intestazione.center_just();
|
||||
set_header(1,"@0g%s", (const char*) intestazione);
|
||||
return;
|
||||
}
|
||||
|
||||
bool TSbloccoSO_app::set_print(int)
|
||||
{
|
||||
KEY tasto;
|
||||
tasto = _msk->run();
|
||||
if (tasto == K_ENTER)
|
||||
{
|
||||
_codsez = "**";
|
||||
_codsot = "**";
|
||||
_data_sblocco = _msk->get(F_DATA);
|
||||
_tiposo = _msk->get(F_TIPO);
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
filtra_sezioni();
|
||||
// filtro per tipo sospensione
|
||||
if (_tiposo.not_empty())
|
||||
current_cursor()->setfilter(format("STATO == \"%s\"",(const char*)_tiposo));
|
||||
else
|
||||
current_cursor()->setfilter("TCS->S6 == \"S\"", TRUE);
|
||||
current_cursor()->set_filterfunction(filter_func_sbloccoSO,TRUE);
|
||||
reset_print();
|
||||
crea_intestazione();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TSbloccoSO_app::crea_intestazione()
|
||||
{
|
||||
reset_header();
|
||||
|
||||
TString sep(132);
|
||||
sep = "SBLOCCO SOSPESI ";
|
||||
sep << _tiposo;
|
||||
sep << " FINO ALLA DATA ";
|
||||
TString16 data_stampa = _data_sblocco.string();
|
||||
sep << data_stampa;
|
||||
sep.center_just();
|
||||
set_header(2, "@0g%s", (const char*) sep);
|
||||
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");
|
||||
set_header(5,"@0g------@7g--@10g-------------------------@36g----------");
|
||||
}
|
||||
|
||||
bool TSbloccoSO_app::user_create()
|
||||
{
|
||||
_msk = new TMask("at1300a");
|
||||
_rel = new TRelation(LF_SOGGETTI);
|
||||
_rel->add(LF_SEZIONI,"CODSEZ==CODSEZ|CODSOT==CODSOT");
|
||||
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
|
||||
_cur = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
|
||||
|
||||
_contsan = new TLocalisamfile(LF_CONTSAN);
|
||||
_scontrolli = new TRecord_array(LF_CONTSAN, CON_PROGCON);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TSbloccoSO_app::user_destroy()
|
||||
{
|
||||
delete _rel;
|
||||
delete _msk;
|
||||
delete _contsan;
|
||||
delete _scontrolli;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at1300(int argc, char* argv[])
|
||||
{
|
||||
TSbloccoSO_app a;
|
||||
a.run(argc, argv, "Sblocco sospesi");
|
||||
return 0;
|
||||
}
|
||||
14
at/at1300a.h
Executable file
14
at/at1300a.h
Executable file
@ -0,0 +1,14 @@
|
||||
// sblocco 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_DATA 109
|
||||
#define F_TIPO 110
|
||||
#define F_D_TIPO 111
|
||||
164
at/at1300a.uml
Executable file
164
at/at1300a.uml
Executable file
@ -0,0 +1,164 @@
|
||||
#include "at1300a.h"
|
||||
#include "lf.h"
|
||||
PAGE "Sblocco sospesi" -1 -1 78 11
|
||||
|
||||
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 4
|
||||
BEGIN
|
||||
PROMPT 1 5 "Opzioni per lo sblocco"
|
||||
END
|
||||
|
||||
DATE F_DATA
|
||||
BEGIN
|
||||
PROMPT 2 6 "Scadenza fino al "
|
||||
CHECKTYPE REQUIRED
|
||||
HELP "Data di riferimento per la scadenza (fino al)"
|
||||
END
|
||||
|
||||
STRING F_TIPO 2
|
||||
BEGIN
|
||||
PROMPT 2 7 "Tipo sospensione "
|
||||
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 25 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
BEGIN
|
||||
PROMPT -12 -1 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -22 -1 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
||||
346
at/at1400.cpp
Executable file
346
at/at1400.cpp
Executable file
@ -0,0 +1,346 @@
|
||||
//#include <form.h>
|
||||
#include <mask.h>
|
||||
#include <msksheet.h>
|
||||
#include <printapp.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "lf.h"
|
||||
#include "soggetti.h"
|
||||
#include "sezioni.h"
|
||||
#include <comuni.h>
|
||||
|
||||
#include "at1.h"
|
||||
#include "at1400a.h"
|
||||
|
||||
#define ALIAS_COMRES 300
|
||||
#define ALIAS_COMNAS 400
|
||||
//#define ALIAS_CTN1 500
|
||||
//#define ALIAS_CTN2 600
|
||||
#define ALIAS_LCP 700
|
||||
#define ALIAS_CTD 800
|
||||
|
||||
/*
|
||||
// definizione form per tessere associative
|
||||
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;
|
||||
TAssoc_array _categorie;
|
||||
//TTessere_form* _form_pag;
|
||||
TAssoc_array _asoggetti;
|
||||
|
||||
int _numdon;
|
||||
bool _aggiorna;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TDate _data_stampa;
|
||||
TString _riepilogodon;
|
||||
|
||||
static bool filter_func_auto(const TRelation* rel);
|
||||
static bool filter_func_manuale(const TRelation* rel);
|
||||
|
||||
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 print_action postprocess_page(int file, int counter);
|
||||
|
||||
static void add_rows_soggetti(TSheet_field& s, int count = 10, int start = 1);
|
||||
|
||||
public:
|
||||
void filtra_sezioni();
|
||||
void filtra_codici();
|
||||
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(); }
|
||||
|
||||
HIDDEN bool printer_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
if (k == K_SPACE)
|
||||
{
|
||||
TMask& m = f.mask();
|
||||
if (!m.query_mode())
|
||||
{
|
||||
TString16 config;
|
||||
config << "TESSERE";
|
||||
|
||||
TPrinter& p = printer();
|
||||
p.set_printtype(normprinter); // Force configuration update
|
||||
p.read_configuration(config);
|
||||
if (p.set())
|
||||
f.message_box("Stampante configurata per stampa tessere");
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
void TTessere_application::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);
|
||||
}
|
||||
|
||||
void TTessere_application::filtra_codici()
|
||||
{
|
||||
select_cursor(_cur4);
|
||||
TRectype da(LF_SOGGETTI);
|
||||
TRectype a (LF_SOGGETTI);
|
||||
TSheet_field& s = (TSheet_field&)_msk->field(F_SOGGETTI);
|
||||
long maxcod = 0;
|
||||
long mincod = 99999;
|
||||
for (int r=0; r < s.items(); r++)
|
||||
{
|
||||
TToken_string& row = s.row(r);
|
||||
const long codice = row.get_long(0);
|
||||
if (codice != 0)
|
||||
{
|
||||
if (codice > maxcod)
|
||||
maxcod = codice;
|
||||
if (codice < mincod)
|
||||
mincod = codice;
|
||||
}
|
||||
}
|
||||
if (mincod != 0)
|
||||
da.put(SOG_CODICE, mincod);
|
||||
if (maxcod != 0)
|
||||
a.put(SOG_CODICE, maxcod);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
void TTessere_application::filtra_sezioni()
|
||||
{
|
||||
const TString16 sezini = _msk->get(F_SEZINI);
|
||||
const TString16 sotini = _msk->get(F_SOTINI);
|
||||
const TString16 sezfin = _msk->get(F_SEZFIN);
|
||||
const TString16 sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TRectype da(LF_SOGGETTI);
|
||||
TRectype a(LF_SOGGETTI);
|
||||
if (sezini.not_empty())
|
||||
da.put(SOG_CODSEZ, sezini);
|
||||
if (sotini.not_empty())
|
||||
da.put(SOG_CODSOT, sotini);
|
||||
if (sezfin.not_empty())
|
||||
a.put(SOG_CODSEZ, sezfin);
|
||||
if (sotfin.not_empty())
|
||||
a.put(SOG_CODSOT, sotfin);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
void TTessere_application::set_page(int file, int cnt)
|
||||
{
|
||||
TString16 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_DOM_INDIR));
|
||||
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,"");
|
||||
}
|
||||
|
||||
bool TTessere_application::filter_func_auto(const TRelation* rel)
|
||||
{
|
||||
bool filtrato = TRUE;
|
||||
TLocalisamfile& sog = rel->lfile();
|
||||
filtrato = !(sog.get_bool(SOG_T_STAMPATA));
|
||||
if (filtrato)
|
||||
filtrato = (sog.get_int(SOG_TOTDON) >= app()._numdon);
|
||||
if (filtrato)
|
||||
{
|
||||
// filtro per categorie
|
||||
TAssoc_array& categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
const TString16 cat = sog.get(SOG_CATDON);
|
||||
filtrato = categorie.is_key((const char*) cat);
|
||||
}
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TTessere_application::filter_func_manuale(const TRelation* rel)
|
||||
{
|
||||
TLocalisamfile& sog = rel->lfile();
|
||||
TAssoc_array& array_sogg = app()._asoggetti;
|
||||
const char* codice = sog.get(SOG_CODICE);
|
||||
return (array_sogg.is_key(codice));
|
||||
}
|
||||
|
||||
print_action TTessere_application::postprocess_page(int file, int counter)
|
||||
{
|
||||
printer().formfeed();
|
||||
return NEXT_PAGE;
|
||||
}
|
||||
|
||||
bool TTessere_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
TLocalisamfile& sogg = current_cursor()->file(LF_SOGGETTI);
|
||||
const int totdon = sogg.get_int(SOG_TOTDON);
|
||||
const TDate dataultima = sogg.get(SOG_DATAULTDON);
|
||||
_riepilogodon = "";
|
||||
if (totdon != 0)
|
||||
{
|
||||
_riepilogodon = "Donazioni effettuate fino al ";
|
||||
_riepilogodon << dataultima.string();
|
||||
_riepilogodon << " n.ro ";
|
||||
_riepilogodon << totdon;
|
||||
}
|
||||
if (_aggiorna)
|
||||
{
|
||||
sogg.put(SOG_T_STAMPATA,TRUE);
|
||||
sogg.rewrite();
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TTessere_application::set_print(int m)
|
||||
{
|
||||
TSheet_field& s = (TSheet_field&)_msk->field(F_SOGGETTI);
|
||||
s.destroy();
|
||||
s.force_update();
|
||||
if (s.items()==0)
|
||||
add_rows_soggetti(s,8);
|
||||
KEY tasto;
|
||||
tasto = _msk->run();
|
||||
if (tasto == K_ENTER)
|
||||
{
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
_asoggetti.destroy();
|
||||
for (int r=0; r < s.items(); r++)
|
||||
{
|
||||
TToken_string& row = s.row(r);
|
||||
const long codice = row.get_long(0);
|
||||
const char* scodice = row.get(0);
|
||||
if (codice != 0)
|
||||
_asoggetti.add(scodice);
|
||||
}
|
||||
if (_asoggetti.items() != 0)
|
||||
{
|
||||
_aggiorna = _msk->get_bool(F_AGGIORNA2);
|
||||
filtra_codici();
|
||||
current_cursor()->setfilter("");
|
||||
current_cursor()->set_filterfunction (filter_func_manuale, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
filtra_sezioni();
|
||||
_numdon = _msk->get_int(F_NUMDON);
|
||||
_aggiorna = _msk->get_bool(F_AGGIORNA);
|
||||
//const char* filtro = format("(NUM(TOTDON>=%i)) && (T_STAMPATA!=\"X\")",_numdon);
|
||||
//const char* filtro = format("T_STAMPATA!=\"X\"");
|
||||
//const char* filtro = format("TOTDON>=%i",_numdon);
|
||||
//current_cursor()->setfilter(filtro);
|
||||
const TString16 catpri = _msk->get(F_CAT1);
|
||||
const TString16 catsec = _msk->get(F_CAT2);
|
||||
const TString16 catter = _msk->get(F_CAT3);
|
||||
const TString16 catqua = _msk->get(F_CAT4);
|
||||
const TString16 catqui = _msk->get(F_CAT5);
|
||||
const TString16 catses = _msk->get(F_CAT6);
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
_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);
|
||||
current_cursor()->set_filterfunction (filter_func_auto, TRUE);
|
||||
}
|
||||
reset_print();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
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==DOM_CODCOM",1,0,ALIAS_COMRES);
|
||||
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCP);
|
||||
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
|
||||
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
|
||||
//_rel->add("CTN", "CODTAB==CATNOND1",1,0,ALIAS_CTN1);
|
||||
//_rel->add("CTN", "CODTAB==CATNOND2",1,0,ALIAS_CTN2);
|
||||
_rel->add("CTD", "CODTAB==CATDON",1,0,ALIAS_CTD);
|
||||
|
||||
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
|
||||
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
|
||||
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
|
||||
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
|
||||
|
||||
_msk = new TMask("at1400a");
|
||||
_msk->set_handler(F_PRINTER, printer_handler);
|
||||
|
||||
//_form_pag = new TTessere_form("AT_PAGIN"); // dovrà esserci PAGINE
|
||||
|
||||
TString16 config;
|
||||
config << "TESSERE";
|
||||
printer().read_configuration(config);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TTessere_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
//delete _form_pag;
|
||||
|
||||
printer().read_configuration();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at1400(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TTessere_application a;
|
||||
|
||||
a.run(argc, argv, "Stampa tessere associative");
|
||||
|
||||
return 0;
|
||||
}
|
||||
46
at/at1400a.h
Executable file
46
at/at1400a.h
Executable file
@ -0,0 +1,46 @@
|
||||
// stampa tessere associative
|
||||
// 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_NUMDON 301
|
||||
#define F_AGGIORNA 302
|
||||
|
||||
#define F_AGGIORNA2 303
|
||||
#define F_SOGGETTI 304
|
||||
|
||||
#define F_PRINTER 401
|
||||
|
||||
// pagina soggetti
|
||||
#define F_S_CODICE 101
|
||||
#define F_S_COGNOME 102
|
||||
#define F_S_NOME 103
|
||||
#define F_S_DATANASC 104
|
||||
#define F_S_CODSEZ 105
|
||||
#define F_S_CODSOT 106
|
||||
#define F_S_CATDON 107
|
||||
#define F_S_TESSAVIS 108
|
||||
#define F_S_DENSEZ 211
|
||||
#define F_S_DENSOT 212
|
||||
#define F_S_DESC_CATDON 213
|
||||
|
||||
455
at/at1400a.uml
Executable file
455
at/at1400a.uml
Executable file
@ -0,0 +1,455 @@
|
||||
#include "at1400a.h"
|
||||
#include "lf.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
|
||||
BUTTON DLG_PRINT 9 2
|
||||
BEGIN
|
||||
PROMPT -13 -11 "~Stampa"
|
||||
MESSAGE EXIT,K_ENTER
|
||||
END
|
||||
|
||||
BUTTON F_PRINTER 19 2
|
||||
BEGIN
|
||||
PROMPT -23 -11 "Imposta stampante"
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -33 -11 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Selezione automatica" -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 "Opzioni per la stampa tessere"
|
||||
END
|
||||
|
||||
NUMBER F_NUMDON 3
|
||||
BEGIN
|
||||
PROMPT 2 11 "Numero minimo di donazioni "
|
||||
END
|
||||
|
||||
BOOLEAN F_AGGIORNA
|
||||
BEGIN
|
||||
PROMPT 40 11 "Aggiornare archivio soggetti"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Selezione manuale" -1 -1 78 20
|
||||
|
||||
BOOLEAN F_AGGIORNA2
|
||||
BEGIN
|
||||
PROMPT 2 2 "Aggiornare archivio soggetti"
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
SPREADSHEET F_SOGGETTI
|
||||
BEGIN
|
||||
PROMPT 2 4 "Soggetti"
|
||||
ITEM "Codice@6"
|
||||
ITEM "Cognome@25"
|
||||
ITEM "Nome@25"
|
||||
ITEM "Nato il@10"
|
||||
ITEM "Sez."
|
||||
ITEM "Sot."
|
||||
ITEM "Cat."
|
||||
ITEM "Tessera"
|
||||
GROUP 1
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
ENDMASK
|
||||
|
||||
PAGE "Soggetto " -1 -1 78 20
|
||||
|
||||
GROUPBOX DLG_NULL 77 5
|
||||
BEGIN
|
||||
PROMPT 1 0 ""
|
||||
FLAGS "R"
|
||||
END
|
||||
|
||||
NUMBER F_S_CODICE 6
|
||||
BEGIN
|
||||
PROMPT 2 1 "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
|
||||
OUTPUT F_S_TESSAVIS TESSAVIS
|
||||
CHECKTYPE NORMAL
|
||||
ADD RUN at0 -0
|
||||
END
|
||||
|
||||
STRING F_S_COGNOME 25
|
||||
BEGIN
|
||||
PROMPT 2 2 "Cognome e nome "
|
||||
USE LF_SOGGETTI KEY 2
|
||||
INPUT COGNOME F_S_COGNOME
|
||||
INPUT NOME F_S_NOME
|
||||
DISPLAY "Cognome@25" COGNOME
|
||||
DISPLAY "Nome@25" NOME
|
||||
DISPLAY "Nato il@10" DATANASC
|
||||
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 ""
|
||||
COPY ALL F_S_COGNOME
|
||||
COPY OUTPUT F_S_CODICE
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Nome del soggetto"
|
||||
ADD RUN at0 -0
|
||||
END
|
||||
|
||||
DATE F_S_DATANASC
|
||||
BEGIN
|
||||
PROMPT 2 3 "Nato il "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
PROMPT 1 5 "Dati associativi"
|
||||
END
|
||||
|
||||
STRING F_S_CODSEZ 2
|
||||
BEGIN
|
||||
PROMPT 2 6 "Sez. "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_DENSEZ 25
|
||||
BEGIN
|
||||
PROMPT 12 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_CODSOT 2
|
||||
BEGIN
|
||||
PROMPT 40 6 "Sot. "
|
||||
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 50 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_CATDON 2
|
||||
BEGIN
|
||||
PROMPT 2 7 "Cat. "
|
||||
FLAGS "D"
|
||||
USE CTD
|
||||
INPUT CODTAB F_S_CATDON
|
||||
OUTPUT F_S_DESC_CATDON S0
|
||||
CHECKTYPE NORMAL
|
||||
END
|
||||
|
||||
STRING F_S_TESSAVIS 10
|
||||
BEGIN
|
||||
PROMPT 52 7 "Tessera AVIS "
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_S_DESC_CATDON 25
|
||||
BEGIN
|
||||
PROMPT 12 7 ""
|
||||
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
|
||||
62
at/at2.cpp
62
at/at2.cpp
@ -1,31 +1,31 @@
|
||||
#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;
|
||||
}
|
||||
#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
12
at/at2.h
@ -1,12 +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
|
||||
int at2100(int argc, char* argv[]); // elenco soggetti sospesi
|
||||
int at2200(int argc, char* argv[]); // elenco soggetti per data di nascita
|
||||
int at2300(int argc, char* argv[]); // elenco soggetti esclusi
|
||||
int at2400(int argc, char* argv[]); // elenco soggetti modificati
|
||||
int at2500(int argc, char* argv[]); // elenco soggetti idonei
|
||||
int at2600(int argc, char* argv[]); // elenco soggetti iscritti/dimessi
|
||||
|
||||
#endif // __AT2_H
|
||||
|
||||
|
||||
29
at/at2.url
29
at/at2.url
@ -1,54 +1,39 @@
|
||||
#define APPNAME AVIS
|
||||
#define QAPPNAME "AVIS"
|
||||
#define LIBDIR f:\xvt.403\win_x86\ptk\lib
|
||||
#define QFIRMNAME "AGA Informatica S.r.l."
|
||||
|
||||
#include <default.url>
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at2 -0
|
||||
* ---------------------------------------------------- */
|
||||
/* at2 -0 elenco sospesi */
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at2 -1
|
||||
* ---------------------------------------------------- */
|
||||
/* at2 -1 elenco soggetti modificati */
|
||||
MENUBAR MENU_BAR(1)
|
||||
|
||||
MENU MENU_BAR(1)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at2 -2
|
||||
* ---------------------------------------------------- */
|
||||
|
||||
/* at2 -2 elenco esclusi */
|
||||
MENUBAR MENU_BAR(2)
|
||||
|
||||
MENU MENU_BAR(2)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at2 -3
|
||||
*
|
||||
* ----------------------------------------------------*/
|
||||
|
||||
/* at2 -3 elenco soggetti modificati */
|
||||
MENUBAR MENU_BAR(3)
|
||||
|
||||
MENU MENU_BAR(3)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at2 -4
|
||||
* ---------------------------------------------------- */
|
||||
/* at2 -4 elenco idonei */
|
||||
MENUBAR MENU_BAR(4)
|
||||
|
||||
MENU MENU_BAR(4)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at2 -5
|
||||
* ---------------------------------------------------- */
|
||||
/* at2 -5 elenco iscritti/dimessi */
|
||||
MENUBAR MENU_BAR(5)
|
||||
|
||||
MENU MENU_BAR(5)
|
||||
|
||||
649
at/at2100.cpp
649
at/at2100.cpp
@ -1,326 +1,323 @@
|
||||
#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;
|
||||
|
||||
TAssoc_array _categorie;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome;
|
||||
TDate _data_stampa;
|
||||
ts _tipo_stampa;
|
||||
TString16 _codsez, _codsot;
|
||||
|
||||
static bool filter_func_sospesi(const TRelation* rel);
|
||||
|
||||
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(TString16 codsez, TString16 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()
|
||||
{
|
||||
TString16 sezini = _msk->get(F_SEZINI);
|
||||
TString16 sotini = _msk->get(F_SOTINI);
|
||||
TString16 sezfin = _msk->get(F_SEZFIN);
|
||||
TString16 sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
|
||||
TRectype da(fl.curr());
|
||||
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();
|
||||
// filtro per categorie
|
||||
TAssoc_array categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
TString16 cat = sog.get(SOG_CATDON);
|
||||
filtrato = categorie.is_key((const char*) cat);
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TSospesi_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString80 nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
|
||||
// salto pagina se cambio sezione
|
||||
TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
TString16 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(TString16 codsez, TString16 codsot)
|
||||
{
|
||||
TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString256 intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << codsez;
|
||||
intestazione << "/";
|
||||
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
|
||||
TString16 tiposo = _msk->get(F_TIPO);
|
||||
if (tiposo.not_empty() && tiposo.ok())
|
||||
current_cursor()->setfilter(format("STATO == \"%s\"",(const char*)tiposo));
|
||||
else
|
||||
current_cursor()->setfilter("TCS->S6 == \"S\"", TRUE);
|
||||
|
||||
// filtro per categorie
|
||||
TString16 catpri = _msk->get(F_CAT1);
|
||||
TString16 catsec = _msk->get(F_CAT2);
|
||||
TString16 catter = _msk->get(F_CAT3);
|
||||
TString16 catqua = _msk->get(F_CAT4);
|
||||
TString16 catqui = _msk->get(F_CAT5);
|
||||
TString16 catses = _msk->get(F_CAT6);
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
_categorie.add((const char*) catpri);
|
||||
if (catsec.not_empty() && catsec.ok())
|
||||
_categorie.add((const char*) catsec);
|
||||
if (catter.not_empty() && catter.ok())
|
||||
_categorie.add((const char*) catter);
|
||||
if (catqua.not_empty() && catqua.ok())
|
||||
_categorie.add((const char*) catqua);
|
||||
if (catqui.not_empty() && catqui.ok())
|
||||
_categorie.add((const char*) catqui);
|
||||
if (catses.not_empty() && catses.ok())
|
||||
_categorie.add((const char*) catses);
|
||||
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)
|
||||
{
|
||||
TString256 sep(132);
|
||||
sep = "ELENCO SOSPESI";
|
||||
TString16 tipo = _msk->get(F_TIPO);
|
||||
if ((tipo.ok()) && (tipo.not_empty()))
|
||||
{
|
||||
sep << ": tipo ";
|
||||
sep << tipo;
|
||||
TString80 dtipo = _msk->get(F_D_TIPO);
|
||||
sep << " ";
|
||||
sep << dtipo;
|
||||
}
|
||||
sep.center_just();
|
||||
set_header(2, "@0g%s", (const char*) sep);
|
||||
TString16 data_stampa = _data_stampa.string();
|
||||
set_header(2,"@0g%10s", (const char*) data_stampa);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
set_header(2, "@120g%s", (const char*) sep);
|
||||
|
||||
sep = "";
|
||||
sep.fill('-');
|
||||
set_header(3, (const char *) sep);
|
||||
|
||||
set_header(4,"@0gCod.@7gC.@10gCognome e nome@36gNato il@47gSospensione@61gUltima idon.@75gIntervalli@86gUltima donaz.@100gUlt.controllo@114gPross.contr.");
|
||||
set_header(5,"@76gSI AF");
|
||||
set_header(6,"@0g------@7g--@10g-------------------------@36g----------@47g-------------@61g-------------@75g----------@86g-------------@100g-------------@114g-------------");
|
||||
}
|
||||
}
|
||||
|
||||
bool TSospesi_application::user_create()
|
||||
{
|
||||
_rel = new TRelation(LF_SOGGETTI);
|
||||
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
|
||||
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCP);
|
||||
_rel->add(LF_COMUNI, "COM==DOM_COMCOM");
|
||||
// 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;
|
||||
}
|
||||
#include <form.h>
|
||||
#include <mask.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;
|
||||
|
||||
TAssoc_array _categorie;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome;
|
||||
TDate _data_stampa;
|
||||
ts _tipo_stampa;
|
||||
TString16 _codsez, _codsot;
|
||||
|
||||
static bool filter_func_sospesi(const TRelation* rel);
|
||||
|
||||
protected:
|
||||
virtual bool user_create();
|
||||
virtual bool user_destroy();
|
||||
virtual bool set_print(int m);
|
||||
virtual void set_page(int file, int cnt);
|
||||
virtual bool preprocess_page(int file, int counter);
|
||||
|
||||
public:
|
||||
void crea_intestazione();
|
||||
void filtra_sezioni();
|
||||
void header_sezione(const TString16 codsez, const TString16 codsot);
|
||||
TMask& app_mask() { return *_msk; }
|
||||
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()
|
||||
{
|
||||
const TString16 sezini = _msk->get(F_SEZINI);
|
||||
const TString16 sotini = _msk->get(F_SOTINI);
|
||||
const TString16 sezfin = _msk->get(F_SEZFIN);
|
||||
const TString16 sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TRectype da(LF_SOGGETTI);
|
||||
TRectype a (LF_SOGGETTI);
|
||||
if (sezini.not_empty())
|
||||
da.put(SOG_CODSEZ, sezini);
|
||||
if (sotini.not_empty())
|
||||
da.put(SOG_CODSOT, sotini);
|
||||
if (sezfin.not_empty())
|
||||
a.put(SOG_CODSEZ, sezfin);
|
||||
if (sotfin.not_empty())
|
||||
a.put(SOG_CODSOT, sotfin);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
void 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();
|
||||
// filtro per categorie
|
||||
TAssoc_array& categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
const TString16 cat = sog.get(SOG_CATDON);
|
||||
filtrato = categorie.is_key((const char*) cat);
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TSospesi_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString80 nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
|
||||
// salto pagina se cambio sezione
|
||||
const TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
const TString16 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(const TString16 codsez, const TString16 codsot)
|
||||
{
|
||||
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << codsez;
|
||||
intestazione << "/";
|
||||
intestazione << codsot;
|
||||
intestazione << " ";
|
||||
intestazione << densez;
|
||||
if ((densot.ok())&& (densot.not_empty()))
|
||||
{
|
||||
intestazione << "/";
|
||||
intestazione << densot;
|
||||
}
|
||||
intestazione.center_just();
|
||||
set_header(1,"@0g%s", (const char*) intestazione);
|
||||
return;
|
||||
}
|
||||
|
||||
bool 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
|
||||
const TString16 tiposo = _msk->get(F_TIPO);
|
||||
if (tiposo.not_empty() && tiposo.ok())
|
||||
current_cursor()->setfilter(format("STATO == \"%s\"",(const char*)tiposo));
|
||||
else
|
||||
current_cursor()->setfilter("TCS->S6 == \"S\"", TRUE);
|
||||
|
||||
// filtro per categorie
|
||||
const TString16 catpri = _msk->get(F_CAT1);
|
||||
const TString16 catsec = _msk->get(F_CAT2);
|
||||
const TString16 catter = _msk->get(F_CAT3);
|
||||
const TString16 catqua = _msk->get(F_CAT4);
|
||||
const TString16 catqui = _msk->get(F_CAT5);
|
||||
const TString16 catses = _msk->get(F_CAT6);
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
_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);
|
||||
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";
|
||||
const TString16 tipo = _msk->get(F_TIPO);
|
||||
if ((tipo.ok()) && (tipo.not_empty()))
|
||||
{
|
||||
sep << ": tipo ";
|
||||
sep << tipo;
|
||||
const TString80 dtipo = _msk->get(F_D_TIPO);
|
||||
sep << " ";
|
||||
sep << dtipo;
|
||||
}
|
||||
sep.center_just();
|
||||
set_header(2, "@0g%s", (const char*) sep);
|
||||
const TString16 data_stampa = _data_stampa.string();
|
||||
set_header(2,"@0g%10s", (const char*) data_stampa);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
set_header(2, "@120g%s", (const char*) sep);
|
||||
|
||||
sep = "";
|
||||
sep.fill('-');
|
||||
set_header(3, (const char *) sep);
|
||||
|
||||
set_header(4,"@0gCod.@7gC.@10gCognome e nome@36gNato il@47gSospensione@61gUltima idon.@75gIntervalli@86gUltima donaz.@100gUlt.controllo@114gPross.contr.");
|
||||
set_header(5,"@76gSI AF");
|
||||
set_header(6,"@0g------@7g--@10g-------------------------@36g----------@47g-------------@61g-------------@75g----------@86g-------------@100g-------------@114g-------------");
|
||||
}
|
||||
}
|
||||
|
||||
bool TSospesi_application::user_create()
|
||||
{
|
||||
_rel = new TRelation(LF_SOGGETTI);
|
||||
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
|
||||
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCP);
|
||||
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
|
||||
// per stampare nell'intestazione la denominazione della sezione
|
||||
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
|
||||
|
||||
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
|
||||
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
|
||||
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
|
||||
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
|
||||
|
||||
_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;
|
||||
}
|
||||
|
||||
683
at/at2200.cpp
683
at/at2200.cpp
@ -1,345 +1,338 @@
|
||||
#include <mask.h>
|
||||
#include <form.h>
|
||||
#include <printapp.h>
|
||||
|
||||
#include "lf.h"
|
||||
#include "soggetti.h"
|
||||
#include "sezioni.h"
|
||||
#include <comuni.h>
|
||||
|
||||
#include "at2.h"
|
||||
#include "at2200a.h"
|
||||
|
||||
#define ALIAS_LCP 100
|
||||
#define ALIAS_TCS 200
|
||||
|
||||
enum ts { undefined = 0, elenco = 1, etichette = 2 };
|
||||
|
||||
// definizione form per etichette
|
||||
class TEti_pereta_form : public TForm
|
||||
{
|
||||
public:
|
||||
|
||||
virtual TCursor* cursor() const;
|
||||
virtual TRelation* relation() const;
|
||||
TPrint_section& get_body() { return section('B'); } ;
|
||||
TEti_pereta_form(): TForm() {};
|
||||
TEti_pereta_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
|
||||
: TForm(form,code,editlevel,desc) {};
|
||||
virtual ~TEti_pereta_form() {};
|
||||
};
|
||||
|
||||
class TPereta_application : public TPrintapp
|
||||
{
|
||||
static bool filter_func_pereta(const TRelation* rel);
|
||||
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TEti_pereta_form* _form_eti;
|
||||
|
||||
TAssoc_array _categorie;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome, _dencom;
|
||||
|
||||
TDate _data_stampa;
|
||||
TDate _dataini, _datafin;
|
||||
ts _tipo_stampa;
|
||||
TString16 _codsez, _codsot;
|
||||
|
||||
|
||||
protected:
|
||||
virtual bool user_create();
|
||||
virtual bool user_destroy();
|
||||
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(TString16 codsez, TString16 codsot);
|
||||
TMask& app_mask() { return *_msk; }
|
||||
|
||||
TPereta_application() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {}
|
||||
};
|
||||
|
||||
HIDDEN inline TPereta_application& app() { return (TPereta_application&) main_app(); }
|
||||
|
||||
TCursor* TEti_pereta_form::cursor() const { return app().current_cursor(); }
|
||||
|
||||
TRelation* TEti_pereta_form::relation() const { return cursor()->relation(); }
|
||||
|
||||
void TPereta_application::filtra_sezioni()
|
||||
{
|
||||
const char* sezini = _msk->get(F_SEZINI);
|
||||
const char* sotini = _msk->get(F_SOTINI);
|
||||
const char* sezfin = _msk->get(F_SEZFIN);
|
||||
const char* 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()))
|
||||
if (sezini != NULL)
|
||||
da.put(SOG_CODSEZ, sezini);
|
||||
//if ((sotini.not_empty()) && (sotini.ok()))
|
||||
if (sotini != NULL)
|
||||
da.put(SOG_CODSOT, sotini);
|
||||
//if ((sezfin.not_empty()) && (sezfin.ok()))
|
||||
if (sezfin != NULL)
|
||||
a.put(SOG_CODSEZ, sezfin);
|
||||
//if ((sotfin.not_empty()) && (sotfin.ok()))
|
||||
if (sotfin != NULL)
|
||||
a.put(SOG_CODSOT, sotfin);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
void TPereta_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_DOM_INDIR));
|
||||
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 TPereta_application::filter_func_pereta(const TRelation* rel)
|
||||
{
|
||||
bool filtrato = TRUE;
|
||||
TLocalisamfile& sog = rel->lfile();
|
||||
// filtro per categorie
|
||||
TAssoc_array categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
TString16 cat = sog.get(SOG_CATDON);
|
||||
filtrato = categorie.is_key((const char*) cat);
|
||||
}
|
||||
// filtro per data di nascita
|
||||
if (filtrato)
|
||||
{
|
||||
TDate datanasc = sog.get(SOG_DATANASC);
|
||||
if (app()._dataini.ok())
|
||||
filtrato = datanasc >= app()._dataini;
|
||||
if (app()._datafin.ok())
|
||||
filtrato = (filtrato) && (datanasc <= app()._datafin);
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
void TPereta_application::header_sezione(TString16 codsez, TString16 codsot)
|
||||
{
|
||||
TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString256 intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << codsez;
|
||||
intestazione << "/";
|
||||
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 TPereta_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString80 nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
TString256 localita = "";
|
||||
localita << current_cursor()->curr(-ALIAS_LCP).get("S6");
|
||||
if (localita.not_empty() && localita.ok())
|
||||
{
|
||||
localita << " ";
|
||||
localita << current_cursor()->curr(-ALIAS_LCP).get("S0");
|
||||
localita << " - ";
|
||||
}
|
||||
else
|
||||
{
|
||||
localita = current_cursor()->curr(LF_COMUNI).get(COM_CAPCOM);
|
||||
localita << " ";
|
||||
}
|
||||
localita << current_cursor()->curr(LF_COMUNI).get(COM_DENCOM);
|
||||
localita.trim();
|
||||
_dencom = localita;
|
||||
|
||||
// salto pagina se cambio sezione
|
||||
TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
TString16 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;
|
||||
}
|
||||
|
||||
bool TPereta_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;
|
||||
break;
|
||||
}
|
||||
if (_tipo_stampa != undefined)
|
||||
{
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
filtra_sezioni();
|
||||
|
||||
_dataini = _msk->get(F_DATAINI);
|
||||
_datafin = _msk->get(F_DATAFIN);
|
||||
TString16 catpri = _msk->get(F_CAT1);
|
||||
TString16 catsec = _msk->get(F_CAT2);
|
||||
TString16 catter = _msk->get(F_CAT3);
|
||||
TString16 catqua = _msk->get(F_CAT4);
|
||||
TString16 catqui = _msk->get(F_CAT5);
|
||||
TString16 catses = _msk->get(F_CAT6);
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
_categorie.add((const char*) catpri);
|
||||
if (catsec.not_empty() && catsec.ok())
|
||||
_categorie.add((const char*) catsec);
|
||||
if (catter.not_empty() && catter.ok())
|
||||
_categorie.add((const char*) catter);
|
||||
if (catqua.not_empty() && catqua.ok())
|
||||
_categorie.add((const char*) catqua);
|
||||
if (catqui.not_empty() && catqui.ok())
|
||||
_categorie.add((const char*) catqui);
|
||||
if (catses.not_empty() && catses.ok())
|
||||
_categorie.add((const char*) catses);
|
||||
current_cursor()->set_filterfunction (filter_func_pereta);
|
||||
|
||||
reset_print();
|
||||
crea_intestazione();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TPereta_application::crea_intestazione()
|
||||
{
|
||||
reset_header();
|
||||
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString256 sep(132);
|
||||
sep = "ELENCO PER DATA DI NASCITA";
|
||||
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);
|
||||
TString16 data_stampa = _data_stampa.string();
|
||||
set_header(2,"@0g%10s", (const char*) data_stampa);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
set_header(2, "@120g%s", (const char*) sep);
|
||||
|
||||
sep = "";
|
||||
sep.fill('-');
|
||||
set_header(3, (const char *) sep);
|
||||
|
||||
set_header(4,"@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 TPereta_application::user_create()
|
||||
{
|
||||
_rel = new TRelation(LF_SOGGETTI);
|
||||
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
|
||||
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCP);
|
||||
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
|
||||
// per stampare nell'intestazione la denominazione della sezione
|
||||
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
|
||||
|
||||
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
|
||||
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
|
||||
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
|
||||
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
|
||||
|
||||
_form_eti = new TEti_pereta_form("AT_ETSOG");
|
||||
_msk = new TMask("at2200a");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TPereta_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_eti;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at2200(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TPereta_application a;
|
||||
|
||||
a.run(argc, argv, "Elenco per data nascita");
|
||||
|
||||
return 0;
|
||||
}
|
||||
#include <form.h>
|
||||
#include <mask.h>
|
||||
#include <printapp.h>
|
||||
|
||||
#include "lf.h"
|
||||
#include "soggetti.h"
|
||||
#include "sezioni.h"
|
||||
#include <comuni.h>
|
||||
|
||||
#include "at2.h"
|
||||
#include "at2200a.h"
|
||||
|
||||
#define ALIAS_LCP 100
|
||||
#define ALIAS_TCS 200
|
||||
|
||||
enum ts { undefined = 0, elenco = 1, etichette = 2 };
|
||||
|
||||
// definizione form per etichette
|
||||
class TEti_pereta_form : public TForm
|
||||
{
|
||||
public:
|
||||
|
||||
virtual TCursor* cursor() const;
|
||||
virtual TRelation* relation() const;
|
||||
TPrint_section& get_body() { return section('B'); } ;
|
||||
TEti_pereta_form(): TForm() {};
|
||||
TEti_pereta_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
|
||||
: TForm(form,code,editlevel,desc) {};
|
||||
virtual ~TEti_pereta_form() {};
|
||||
};
|
||||
|
||||
class TPereta_application : public TPrintapp
|
||||
{
|
||||
static bool filter_func_pereta(const TRelation* rel);
|
||||
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TEti_pereta_form* _form_eti;
|
||||
|
||||
TAssoc_array _categorie;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome, _dencom;
|
||||
|
||||
TDate _data_stampa;
|
||||
TDate _dataini, _datafin;
|
||||
ts _tipo_stampa;
|
||||
TString16 _codsez, _codsot;
|
||||
|
||||
|
||||
protected:
|
||||
virtual bool user_create();
|
||||
virtual bool user_destroy();
|
||||
virtual bool set_print(int m);
|
||||
virtual void set_page(int file, int cnt);
|
||||
virtual bool preprocess_page (int file, int counter);
|
||||
|
||||
public:
|
||||
void crea_intestazione();
|
||||
void filtra_sezioni();
|
||||
void header_sezione(const TString16 codsez, const TString16 codsot);
|
||||
TMask& app_mask() { return *_msk; }
|
||||
|
||||
TPereta_application() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {}
|
||||
};
|
||||
|
||||
HIDDEN inline TPereta_application& app() { return (TPereta_application&) main_app(); }
|
||||
|
||||
TCursor* TEti_pereta_form::cursor() const { return app().current_cursor(); }
|
||||
|
||||
TRelation* TEti_pereta_form::relation() const { return cursor()->relation(); }
|
||||
|
||||
void TPereta_application::filtra_sezioni()
|
||||
{
|
||||
const TString16 sezini = _msk->get(F_SEZINI);
|
||||
const TString16 sotini = _msk->get(F_SOTINI);
|
||||
const TString16 sezfin = _msk->get(F_SEZFIN);
|
||||
const TString16 sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TRectype da(LF_SOGGETTI);
|
||||
TRectype a(LF_SOGGETTI);
|
||||
if (sezini.not_empty())
|
||||
da.put(SOG_CODSEZ, sezini);
|
||||
if (sotini.not_empty())
|
||||
da.put(SOG_CODSOT, sotini);
|
||||
if (sezfin.not_empty())
|
||||
a.put(SOG_CODSEZ, sezfin);
|
||||
if (sotfin.not_empty())
|
||||
a.put(SOG_CODSOT, sotfin);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
void TPereta_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_DOM_INDIR));
|
||||
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 TPereta_application::filter_func_pereta(const TRelation* rel)
|
||||
{
|
||||
bool filtrato = TRUE;
|
||||
TLocalisamfile& sog = rel->lfile();
|
||||
// filtro per categorie
|
||||
TAssoc_array& categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
const TString16 cat = sog.get(SOG_CATDON);
|
||||
filtrato = categorie.is_key((const char*) cat);
|
||||
}
|
||||
// filtro per data di nascita
|
||||
if (filtrato)
|
||||
{
|
||||
const TDate datanasc = sog.get(SOG_DATANASC);
|
||||
if (app()._dataini.ok())
|
||||
filtrato = datanasc >= app()._dataini;
|
||||
if (app()._datafin.ok())
|
||||
filtrato = (filtrato) && (datanasc <= app()._datafin);
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
void TPereta_application::header_sezione(const TString16 codsez, const TString16 codsot)
|
||||
{
|
||||
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << codsez;
|
||||
intestazione << "/";
|
||||
intestazione << codsot;
|
||||
intestazione << " ";
|
||||
intestazione << densez;
|
||||
if ((densot.ok())&& (densot.not_empty()))
|
||||
{
|
||||
intestazione << "/";
|
||||
intestazione << densot;
|
||||
}
|
||||
intestazione.center_just();
|
||||
set_header(1,"@0g%s", (const char*) intestazione);
|
||||
return;
|
||||
}
|
||||
|
||||
bool TPereta_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString80 nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
TString256 localita = "";
|
||||
localita << current_cursor()->curr(-ALIAS_LCP).get("S6");
|
||||
if (localita.not_empty() && localita.ok())
|
||||
{
|
||||
localita << " ";
|
||||
localita << current_cursor()->curr(-ALIAS_LCP).get("S0");
|
||||
localita << " - ";
|
||||
}
|
||||
else
|
||||
{
|
||||
localita = current_cursor()->curr(LF_COMUNI).get(COM_CAPCOM);
|
||||
localita << " ";
|
||||
}
|
||||
localita << current_cursor()->curr(LF_COMUNI).get(COM_DENCOM);
|
||||
localita.trim();
|
||||
_dencom = localita;
|
||||
|
||||
// salto pagina se cambio sezione
|
||||
const TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
const TString16 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;
|
||||
}
|
||||
|
||||
bool TPereta_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;
|
||||
break;
|
||||
}
|
||||
if (_tipo_stampa != undefined)
|
||||
{
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
filtra_sezioni();
|
||||
|
||||
_dataini = _msk->get(F_DATAINI);
|
||||
_datafin = _msk->get(F_DATAFIN);
|
||||
const TString16 catpri = _msk->get(F_CAT1);
|
||||
const TString16 catsec = _msk->get(F_CAT2);
|
||||
const TString16 catter = _msk->get(F_CAT3);
|
||||
const TString16 catqua = _msk->get(F_CAT4);
|
||||
const TString16 catqui = _msk->get(F_CAT5);
|
||||
const TString16 catses = _msk->get(F_CAT6);
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
_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);
|
||||
current_cursor()->set_filterfunction (filter_func_pereta);
|
||||
|
||||
reset_print();
|
||||
crea_intestazione();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TPereta_application::crea_intestazione()
|
||||
{
|
||||
reset_header();
|
||||
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString sep(132);
|
||||
sep = "ELENCO PER DATA DI NASCITA";
|
||||
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);
|
||||
TString16 data_stampa = _data_stampa.string();
|
||||
set_header(2,"@0g%10s", (const char*) data_stampa);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
set_header(2, "@120g%s", (const char*) sep);
|
||||
|
||||
sep = "";
|
||||
sep.fill('-');
|
||||
set_header(3, (const char *) sep);
|
||||
|
||||
set_header(4,"@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 TPereta_application::user_create()
|
||||
{
|
||||
_rel = new TRelation(LF_SOGGETTI);
|
||||
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
|
||||
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCP);
|
||||
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
|
||||
// per stampare nell'intestazione la denominazione della sezione
|
||||
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
|
||||
|
||||
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
|
||||
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
|
||||
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
|
||||
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
|
||||
|
||||
_form_eti = new TEti_pereta_form("AT_ETSOG");
|
||||
_msk = new TMask("at2200a");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TPereta_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_eti;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at2200(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TPereta_application a;
|
||||
|
||||
a.run(argc, argv, "Elenco per data nascita");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
659
at/at2300.cpp
659
at/at2300.cpp
@ -1,331 +1,328 @@
|
||||
#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* rel);
|
||||
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TEti_esclusi_form* _form_eti;
|
||||
|
||||
TAssoc_array _categorie;
|
||||
TString16 _tipoesc;
|
||||
TDate _termineesc;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome;
|
||||
TDate _data_stampa;
|
||||
ts _tipo_stampa;
|
||||
TString16 _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(TString16 codsez, TString16 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()
|
||||
{
|
||||
TString16 sezini = _msk->get(F_SEZINI);
|
||||
TString16 sotini = _msk->get(F_SOTINI);
|
||||
TString16 sezfin = _msk->get(F_SEZFIN);
|
||||
TString16 sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
|
||||
TRectype da(fl.curr());
|
||||
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,"@47g@S", FLD(LF_SOGGETTI,SOG_ESCLUSO));
|
||||
set_row(1,"@50g@ld", FLD(LF_SOGGETTI,SOG_TERMESCL));
|
||||
set_row(1,"@61g@S", FLD(LF_SOGGETTI,SOG_MOTESCL));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool TEsclusi_application::filter_func_esclusi(const TRelation * rel)
|
||||
{
|
||||
bool filtrato = TRUE;
|
||||
TLocalisamfile& sog = rel->lfile();
|
||||
//filtro per categorie
|
||||
TAssoc_array categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
TString16 cat = sog.get(SOG_CATDON);
|
||||
filtrato = categorie.is_key((const char*) cat);
|
||||
}
|
||||
// filtro per termine esclusione
|
||||
if (filtrato && app()._termineesc.ok())
|
||||
{
|
||||
TDate terminesog = sog.get_date(SOG_TERMESCL);
|
||||
filtrato = terminesog <= app()._termineesc;
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TEsclusi_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString80 nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
// salto pagina se cambio sezione
|
||||
TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
TString16 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 TEsclusi_application::header_sezione(TString16 codsez, TString16 codsot)
|
||||
{
|
||||
TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString256 intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << codsez;
|
||||
intestazione << "/";
|
||||
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 = "**";
|
||||
_codsot = "**";
|
||||
break;
|
||||
case F_ETICHETTE:
|
||||
_tipo_stampa = etichette;
|
||||
break;
|
||||
}
|
||||
if (_tipo_stampa != undefined)
|
||||
{
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
filtra_sezioni();
|
||||
|
||||
// filtro per tipo esclusione
|
||||
_tipoesc = _msk->get(F_TIPO);
|
||||
if (_tipoesc.not_empty() && _tipoesc.ok())
|
||||
current_cursor()->setfilter(format("ESCLUSO == \"%s\"",(const char*)_tipoesc));
|
||||
else
|
||||
current_cursor()->setfilter("ESCLUSO != \"\"");
|
||||
|
||||
// filtro per categorie
|
||||
TString16 catpri = _msk->get(F_CAT1);
|
||||
TString16 catsec = _msk->get(F_CAT2);
|
||||
TString16 catter = _msk->get(F_CAT3);
|
||||
TString16 catqua = _msk->get(F_CAT4);
|
||||
TString16 catqui = _msk->get(F_CAT5);
|
||||
TString16 catses = _msk->get(F_CAT6);
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
_categorie.add((const char*) catpri);
|
||||
if (catsec.not_empty() && catsec.ok())
|
||||
_categorie.add((const char*) catsec);
|
||||
if (catter.not_empty() && catter.ok())
|
||||
_categorie.add((const char*) catter);
|
||||
if (catqua.not_empty() && catqua.ok())
|
||||
_categorie.add((const char*) catqua);
|
||||
if (catqui.not_empty() && catqui.ok())
|
||||
_categorie.add((const char*) catqui);
|
||||
if (catses.not_empty() && catses.ok())
|
||||
_categorie.add((const char*) catses);
|
||||
// filtro per termine esclusione
|
||||
_termineesc = _msk->get(F_DATA);
|
||||
|
||||
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)
|
||||
{
|
||||
TString256 sep(90);
|
||||
sep = "ELENCO ESCLUSI";
|
||||
if ((_tipoesc.ok()) && (_tipoesc.not_empty()))
|
||||
{
|
||||
sep << " ";
|
||||
sep << _tipoesc;
|
||||
}
|
||||
if (_termineesc.ok())
|
||||
{
|
||||
sep << " termine fino al ";
|
||||
sep << _termineesc.string();
|
||||
}
|
||||
sep.center_just();
|
||||
set_header(2, "@0g%s", (const char*) sep);
|
||||
TString16 data_stampa = _data_stampa.string();
|
||||
set_header(2,"@0g%10s", (const char*) data_stampa);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
set_header(2, "@78g%s", (const char*) sep);
|
||||
|
||||
sep = "";
|
||||
sep.fill('-');
|
||||
set_header(3, (const char *) sep);
|
||||
|
||||
set_header(4,"@0gCod.@7gC.@10gCognome e nome@36gNato il@47gEsclusione@61gMotivo");
|
||||
set_header(5,"@47gTipo Termine");
|
||||
set_header(6,"@0g------@7g--@10g-------------------------@36g----------@47g-------------@61g------------------------------");
|
||||
|
||||
//set_header(4,"@0gCod.@7gC.@10gCognome e nome@36gNato il@47gSospensione@61gUltima idon.@75gIntervalli@86gUltima donaz.@100gUlt.controllo@114gPross.contr.");
|
||||
//set_header(5,"@76gSI AF");
|
||||
//set_header(6,"@0g------@7g--@10g-------------------------@36g----------@47g-------------@61g-------------@75g----------@86g-------------@100g-------------@114g-------------");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
bool TEsclusi_application::user_create()
|
||||
{
|
||||
_rel = new TRelation(LF_SOGGETTI);
|
||||
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
|
||||
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCP);
|
||||
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
|
||||
// per stampare 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;
|
||||
}
|
||||
#include <form.h>
|
||||
#include <mask.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* rel);
|
||||
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TEti_esclusi_form* _form_eti;
|
||||
|
||||
TAssoc_array _categorie;
|
||||
TString16 _tipoesc;
|
||||
TDate _termineesc;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome;
|
||||
TDate _data_stampa;
|
||||
ts _tipo_stampa;
|
||||
TString16 _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(const TString16 codsez, const TString16 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()
|
||||
{
|
||||
const TString16 sezini = _msk->get(F_SEZINI);
|
||||
const TString16 sotini = _msk->get(F_SOTINI);
|
||||
const TString16 sezfin = _msk->get(F_SEZFIN);
|
||||
const TString16 sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TRectype da(LF_SOGGETTI);
|
||||
TRectype a(LF_SOGGETTI);
|
||||
if (sezini.not_empty())
|
||||
da.put(SOG_CODSEZ, sezini);
|
||||
if (sotini.not_empty())
|
||||
da.put(SOG_CODSOT, sotini);
|
||||
if (sezfin.not_empty())
|
||||
a.put(SOG_CODSEZ, sezfin);
|
||||
if (sotfin.not_empty())
|
||||
a.put(SOG_CODSOT, sotfin);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
void 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,"@47g@S", FLD(LF_SOGGETTI,SOG_ESCLUSO));
|
||||
set_row(1,"@50g@ld", FLD(LF_SOGGETTI,SOG_TERMESCL));
|
||||
set_row(1,"@61g@S", FLD(LF_SOGGETTI,SOG_MOTESCL));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool TEsclusi_application::filter_func_esclusi(const TRelation * rel)
|
||||
{
|
||||
bool filtrato = TRUE;
|
||||
TLocalisamfile& sog = rel->lfile();
|
||||
//filtro per categorie
|
||||
TAssoc_array& categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
const TString16 cat = sog.get(SOG_CATDON);
|
||||
filtrato = categorie.is_key((const char*) cat);
|
||||
}
|
||||
// filtro per termine esclusione
|
||||
if (filtrato && app()._termineesc.ok())
|
||||
{
|
||||
const TDate terminesog = sog.get_date(SOG_TERMESCL);
|
||||
filtrato = terminesog <= app()._termineesc;
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TEsclusi_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString80 nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
// salto pagina se cambio sezione
|
||||
const TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
const TString16 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 TEsclusi_application::header_sezione(const TString16 codsez, const TString16 codsot)
|
||||
{
|
||||
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << codsez;
|
||||
intestazione << "/";
|
||||
intestazione << codsot;
|
||||
intestazione << " ";
|
||||
intestazione << densez;
|
||||
if ((densot.ok())&& (densot.not_empty()))
|
||||
{
|
||||
intestazione << "/";
|
||||
intestazione << densot;
|
||||
}
|
||||
intestazione.center_just();
|
||||
set_header(1,"@0g%s", (const char*) intestazione);
|
||||
return;
|
||||
}
|
||||
|
||||
bool TEsclusi_application::set_print(int)
|
||||
{
|
||||
_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;
|
||||
break;
|
||||
}
|
||||
if (_tipo_stampa != undefined)
|
||||
{
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
filtra_sezioni();
|
||||
|
||||
// filtro per tipo esclusione
|
||||
_tipoesc = _msk->get(F_TIPO);
|
||||
if (_tipoesc.not_empty() && _tipoesc.ok())
|
||||
current_cursor()->setfilter(format("ESCLUSO == \"%s\"",(const char*)_tipoesc));
|
||||
else
|
||||
current_cursor()->setfilter("ESCLUSO != \"\"");
|
||||
|
||||
// filtro per categorie
|
||||
const TString16 catpri = _msk->get(F_CAT1);
|
||||
const TString16 catsec = _msk->get(F_CAT2);
|
||||
const TString16 catter = _msk->get(F_CAT3);
|
||||
const TString16 catqua = _msk->get(F_CAT4);
|
||||
const TString16 catqui = _msk->get(F_CAT5);
|
||||
const TString16 catses = _msk->get(F_CAT6);
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
_categorie.add((const char*) catpri);
|
||||
if (catsec.not_empty() && catsec.ok())
|
||||
_categorie.add((const char*) catsec);
|
||||
if (catter.not_empty() && catter.ok())
|
||||
_categorie.add((const char*) catter);
|
||||
if (catqua.not_empty() && catqua.ok())
|
||||
_categorie.add((const char*) catqua);
|
||||
if (catqui.not_empty() && catqui.ok())
|
||||
_categorie.add((const char*) catqui);
|
||||
if (catses.not_empty() && catses.ok())
|
||||
_categorie.add((const char*) catses);
|
||||
// filtro per termine esclusione
|
||||
_termineesc = _msk->get(F_DATA);
|
||||
|
||||
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(90);
|
||||
sep = "ELENCO ESCLUSI";
|
||||
if ((_tipoesc.ok()) && (_tipoesc.not_empty()))
|
||||
{
|
||||
sep << " ";
|
||||
sep << _tipoesc;
|
||||
}
|
||||
if (_termineesc.ok())
|
||||
{
|
||||
sep << " termine fino al ";
|
||||
sep << _termineesc.string();
|
||||
}
|
||||
sep.center_just();
|
||||
set_header(2, "@0g%s", (const char*) sep);
|
||||
const TString16 data_stampa = _data_stampa.string();
|
||||
set_header(2,"@0g%10s", (const char*) data_stampa);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
set_header(2, "@78g%s", (const char*) sep);
|
||||
|
||||
sep = "";
|
||||
sep.fill('-');
|
||||
set_header(3, (const char *) sep);
|
||||
|
||||
set_header(4,"@0gCod.@7gC.@10gCognome e nome@36gNato il@47gEsclusione@61gMotivo");
|
||||
set_header(5,"@47gTipo Termine");
|
||||
set_header(6,"@0g------@7g--@10g-------------------------@36g----------@47g-------------@61g------------------------------");
|
||||
|
||||
//set_header(4,"@0gCod.@7gC.@10gCognome e nome@36gNato il@47gSospensione@61gUltima idon.@75gIntervalli@86gUltima donaz.@100gUlt.controllo@114gPross.contr.");
|
||||
//set_header(5,"@76gSI AF");
|
||||
//set_header(6,"@0g------@7g--@10g-------------------------@36g----------@47g-------------@61g-------------@75g----------@86g-------------@100g-------------@114g-------------");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
bool TEsclusi_application::user_create()
|
||||
{
|
||||
_rel = new TRelation(LF_SOGGETTI);
|
||||
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
|
||||
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCP);
|
||||
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
|
||||
// per stampare 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;
|
||||
}
|
||||
|
||||
586
at/at2400.cpp
586
at/at2400.cpp
@ -1,241 +1,345 @@
|
||||
#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* rel);
|
||||
|
||||
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;
|
||||
}
|
||||
#include <form.h>
|
||||
#include <mask.h>
|
||||
#include <printapp.h>
|
||||
|
||||
#include "lf.h"
|
||||
#include "soggetti.h"
|
||||
#include "sezioni.h"
|
||||
#include <comuni.h>
|
||||
|
||||
#include "at2.h"
|
||||
#include "at2400a.h"
|
||||
|
||||
#define ALIAS_CTD 100 // categoria donatori
|
||||
#define ALIAS_CTN1 110 // categoria non donatori 1
|
||||
#define ALIAS_CTN2 120 // categoria non donatori 2
|
||||
|
||||
#define ALIAS_TCS 200 // tipi/esiti controlli sanitari
|
||||
#define ALIAS_LDN 300 // luoghi di donazione/punti di raccolta
|
||||
|
||||
#define ALIAS_LCPRES 400 // localita' postale di residenza
|
||||
#define ALIAS_LCPDOM 410 // localita' postale di domicilio
|
||||
#define ALIAS_COMRES 500 // comune di residenza
|
||||
#define ALIAS_COMDOM 510 // comune di domicilio
|
||||
#define ALIAS_COMNAS 520 // comune di nascita
|
||||
|
||||
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* rel);
|
||||
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TModificati_form* _form_pag;
|
||||
TAssoc_array _categorie;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome, _dencom;
|
||||
|
||||
TDate _data_stampa, _dataini;
|
||||
ts _tipo_stampa;
|
||||
TString16 _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(const TString16 codsez, const TString16 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()
|
||||
{
|
||||
const TString16 sezini = _msk->get(F_SEZINI);
|
||||
const TString16 sotini = _msk->get(F_SOTINI);
|
||||
const TString16 sezfin = _msk->get(F_SEZFIN);
|
||||
const TString16 sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TRectype da(LF_SOGGETTI);
|
||||
TRectype a(LF_SOGGETTI);
|
||||
if (sezini.not_empty())
|
||||
da.put(SOG_CODSEZ, sezini);
|
||||
if (sotini.not_empty())
|
||||
da.put(SOG_CODSOT, sotini);
|
||||
if (sezfin.not_empty())
|
||||
a.put(SOG_CODSEZ, sezfin);
|
||||
if (sotfin.not_empty())
|
||||
a.put(SOG_CODSOT, sotfin);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
void 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_DOM_INDIR));
|
||||
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();
|
||||
//filtro per categorie
|
||||
TAssoc_array& categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
const TString16 cat = sog.get(SOG_CATDON);
|
||||
filtrato = categorie.is_key((const char*) cat);
|
||||
}
|
||||
// filtro per data aggiornamento
|
||||
if (filtrato && app()._dataini.ok())
|
||||
{
|
||||
const TDate datamod = sog.get(SOG_DATAULTAGG);
|
||||
filtrato = (datamod >= app()._dataini);
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TModificati_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString80 nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
TString256 localita = "";
|
||||
localita << current_cursor()->curr(-ALIAS_LCPDOM).get("S6");
|
||||
if (localita.not_empty() && localita.ok())
|
||||
{
|
||||
localita << " ";
|
||||
localita << current_cursor()->curr(-ALIAS_LCPDOM).get("S0");
|
||||
localita << " - ";
|
||||
}
|
||||
else
|
||||
{
|
||||
localita = current_cursor()->curr(-ALIAS_COMDOM).get(COM_CAPCOM);
|
||||
localita << " ";
|
||||
}
|
||||
localita << current_cursor()->curr(-ALIAS_COMDOM).get(COM_DENCOM);
|
||||
localita.trim();
|
||||
_dencom = localita;
|
||||
|
||||
// salto pagina se cambio sezione
|
||||
const TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
const TString16 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(const TString16 codsez, const TString16 codsot)
|
||||
{
|
||||
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << codsez;
|
||||
intestazione << "/";
|
||||
intestazione << codsot;
|
||||
intestazione << " ";
|
||||
intestazione << densez;
|
||||
if ((densot.ok())&& (densot.not_empty()))
|
||||
{
|
||||
intestazione << "/";
|
||||
intestazione << densot;
|
||||
}
|
||||
intestazione.center_just();
|
||||
set_header(1,"@0g%s", (const char*) intestazione);
|
||||
return;
|
||||
}
|
||||
|
||||
bool TModificati_application::set_print(int)
|
||||
{
|
||||
_tipo_stampa = undefined;
|
||||
KEY tasto;
|
||||
tasto = _msk->run();
|
||||
switch (tasto)
|
||||
{
|
||||
case F_ELENCO:
|
||||
_tipo_stampa = elenco;
|
||||
_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();
|
||||
|
||||
// filtro per categorie
|
||||
const TString16 catpri = _msk->get(F_CAT1);
|
||||
const TString16 catsec = _msk->get(F_CAT2);
|
||||
const TString16 catter = _msk->get(F_CAT3);
|
||||
const TString16 catqua = _msk->get(F_CAT4);
|
||||
const TString16 catqui = _msk->get(F_CAT5);
|
||||
const TString16 catses = _msk->get(F_CAT6);
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
_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);
|
||||
|
||||
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";
|
||||
const 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);
|
||||
TString16 data_stampa = _data_stampa.string();
|
||||
set_header(2,"@0g%10s", (const char*) data_stampa);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
set_header(2, "@120g%s", (const char*) sep);
|
||||
|
||||
sep = "";
|
||||
sep.fill('-');
|
||||
set_header(3, (const char *) sep);
|
||||
|
||||
set_header(4,"@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("CTD", "CODTAB==CATDON",1,0,ALIAS_CTD);
|
||||
_rel->add("CTN", "CODTAB==CATNOND1",1,0,ALIAS_CTN1);
|
||||
_rel->add("CTN", "CODTAB==CATNOND2",1,0,ALIAS_CTN2);
|
||||
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
|
||||
_rel->add("LDN", "CODTAB==PUNTORACC",1,0,ALIAS_LDN);
|
||||
_rel->add("LCP", "CODTAB==RES_CODLOC",1,0,ALIAS_LCPRES);
|
||||
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCPDOM);
|
||||
_rel->add(LF_COMUNI, "COM==RES_CODCOM",1,0,ALIAS_COMRES);
|
||||
_rel->add(LF_COMUNI, "COM==DOM_CODCOM",1,0,ALIAS_COMDOM);
|
||||
_rel->add(LF_COMUNI, "COM==COMNASC",1,0,ALIAS_COMNAS);
|
||||
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
|
||||
_rel->add(LF_MEDICI, "CODMED==CODMED");
|
||||
|
||||
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
|
||||
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
|
||||
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
|
||||
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
|
||||
|
||||
_form_pag = new TModificati_form("AT_PAGIN");
|
||||
_msk = new TMask("at2400a");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TModificati_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_pag;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at2400(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TModificati_application a;
|
||||
|
||||
a.run(argc, argv, "Elenco soggetti modificati");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// stampa benemerenze da assegnare
|
||||
// stampa elenco soggetti modficati a partire dal ...
|
||||
// definizione campi per maschera di selezione
|
||||
|
||||
#define F_SEZINI 101
|
||||
@ -23,9 +23,8 @@
|
||||
#define F_CAT6 211
|
||||
#define F_D_CAT6 212
|
||||
|
||||
#define F_TIPOBEN 301
|
||||
#define F_D_TIPOBEN 302
|
||||
|
||||
#define F_DATAINI 301
|
||||
//#define F_DATAFIN 302
|
||||
|
||||
#define F_ELENCO 401
|
||||
#define F_ETICHETTE 402
|
||||
#define F_PAGINE 402
|
||||
|
||||
@ -246,30 +246,21 @@ END
|
||||
|
||||
GROUPBOX DLG_NULL 77 3
|
||||
BEGIN
|
||||
PROMPT 1 10 "Tipo benemerenza"
|
||||
PROMPT 1 10 "Selezione soggetti"
|
||||
END
|
||||
|
||||
STRING F_TIPOBEN 2
|
||||
DATE F_DATAINI
|
||||
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"
|
||||
PROMPT 2 11 "Soggetti modificati dal "
|
||||
HELP "Data iniziale"
|
||||
END
|
||||
|
||||
STRING F_D_TIPOBEN 25
|
||||
BEGIN
|
||||
PROMPT 26 11 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
//DATE F_DATAFIN
|
||||
//BEGIN
|
||||
// PROMPT 20 11 "Al "
|
||||
// HELP "Data di nascita finale"
|
||||
//END
|
||||
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
@ -282,10 +273,10 @@ BEGIN
|
||||
MESSAGE EXIT,F_ELENCO
|
||||
END
|
||||
|
||||
BUTTON F_ETICHETTE 9 2
|
||||
BUTTON F_PAGINE 9 2
|
||||
BEGIN
|
||||
PROMPT -23 14 "Etichette"
|
||||
MESSAGE EXIT,F_ETICHETTE
|
||||
PROMPT -23 14 "Pagine"
|
||||
MESSAGE EXIT,F_PAGINE
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
|
||||
755
at/at2500.cpp
755
at/at2500.cpp
@ -1,379 +1,376 @@
|
||||
#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;
|
||||
TAssoc_array _categorie;
|
||||
TString16 _tipoidon;
|
||||
TString16 _idon1, _idon2, _idon3, _idon4;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome;
|
||||
TDate _data_stampa;
|
||||
ts _tipo_stampa;
|
||||
TString16 _codsez, _codsot;
|
||||
|
||||
static bool filter_func_idonei(const TRelation* rel);
|
||||
|
||||
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(TString16 codsez, TString16 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()
|
||||
{
|
||||
TString16 sezini = _msk->get(F_SEZINI);
|
||||
TString16 sotini = _msk->get(F_SOTINI);
|
||||
TString16 sezfin = _msk->get(F_SEZFIN);
|
||||
TString16 sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
|
||||
TRectype da(fl.curr());
|
||||
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();
|
||||
// filtro per categorie
|
||||
TAssoc_array categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
TString16 catsog = sog.get(SOG_CATDON);
|
||||
filtrato = categorie.is_key((const char*) catsog);
|
||||
}
|
||||
// filtro per idoneità
|
||||
if (filtrato)
|
||||
{
|
||||
TAssoc_array idoneita;
|
||||
TString16 idonsog = sog.get(SOG_IDON1);
|
||||
if (idonsog.not_empty() && idonsog.ok())
|
||||
idoneita.add((const char*) idonsog);
|
||||
idonsog = sog.get(SOG_IDON2);
|
||||
if (idonsog.not_empty() && idonsog.ok())
|
||||
idoneita.add((const char*) idonsog);
|
||||
idonsog = sog.get(SOG_IDON3);
|
||||
if (idonsog.not_empty() && idonsog.ok())
|
||||
idoneita.add((const char*) idonsog);
|
||||
idonsog = sog.get(SOG_IDON4);
|
||||
if (idonsog.not_empty() && idonsog.ok())
|
||||
idoneita.add((const char*) idonsog);
|
||||
if (idoneita.items() != 0)
|
||||
{
|
||||
if (app()._idon1.not_empty() && app()._idon1.ok())
|
||||
filtrato = idoneita.is_key((const char*) app()._idon1);
|
||||
if (app()._idon2.not_empty() && app()._idon2.ok())
|
||||
filtrato = filtrato && idoneita.is_key((const char*) app()._idon2);
|
||||
if (app()._idon3.not_empty() && app()._idon3.ok())
|
||||
filtrato = filtrato && idoneita.is_key((const char*) app()._idon3);
|
||||
if (app()._idon4.not_empty() && app()._idon4.ok())
|
||||
filtrato = filtrato && idoneita.is_key((const char*) app()._idon4);
|
||||
}
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TIdonei_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString80 nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
|
||||
// salto pagina se cambio sezione
|
||||
TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
TString16 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 TIdonei_application::header_sezione(TString16 codsez, TString16 codsot)
|
||||
{
|
||||
TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString256 intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << codsez;
|
||||
intestazione << "/";
|
||||
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à
|
||||
_tipoidon = _msk->get(F_TIPO);
|
||||
if (_tipoidon.not_empty() && _tipoidon.ok())
|
||||
current_cursor()->setfilter(format("STATO == \"%s\"",(const char*)_tipoidon));
|
||||
else
|
||||
current_cursor()->setfilter("(TCS->S6 == \"I\") || (TCS->S6 == \"F\")", TRUE);
|
||||
|
||||
// filtro per categorie
|
||||
TString16 catpri = _msk->get(F_CAT1);
|
||||
TString16 catsec = _msk->get(F_CAT2);
|
||||
TString16 catter = _msk->get(F_CAT3);
|
||||
TString16 catqua = _msk->get(F_CAT4);
|
||||
TString16 catqui = _msk->get(F_CAT5);
|
||||
TString16 catses = _msk->get(F_CAT6);
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
_categorie.add((const char*) catpri);
|
||||
if (catsec.not_empty() && catsec.ok())
|
||||
_categorie.add((const char*) catsec);
|
||||
if (catter.not_empty() && catter.ok())
|
||||
_categorie.add((const char*) catter);
|
||||
if (catqua.not_empty() && catqua.ok())
|
||||
_categorie.add((const char*) catqua);
|
||||
if (catqui.not_empty() && catqui.ok())
|
||||
_categorie.add((const char*) catqui);
|
||||
if (catses.not_empty() && catses.ok())
|
||||
_categorie.add((const char*) catses);
|
||||
|
||||
// filtro per idoneita
|
||||
_idon1 = _msk->get(F_IDON1);
|
||||
_idon2 = _msk->get(F_IDON2);
|
||||
_idon3 = _msk->get(F_IDON3);
|
||||
_idon4 = _msk->get(F_IDON4);
|
||||
|
||||
current_cursor()->set_filterfunction(filter_func_idonei);
|
||||
|
||||
reset_print();
|
||||
crea_intestazione();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TIdonei_application::crea_intestazione()
|
||||
{
|
||||
reset_header();
|
||||
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString256 sep(132);
|
||||
sep = "ELENCO IDONEI";
|
||||
if ((_tipoidon.ok()) && (_tipoidon.not_empty()))
|
||||
{
|
||||
sep << ": tipo ";
|
||||
sep << _tipoidon;
|
||||
TString80 dtipo = _msk->get(F_D_TIPO);
|
||||
sep << " ";
|
||||
sep << dtipo;
|
||||
}
|
||||
if ((_idon1.ok()) && (_idon1.not_empty()))
|
||||
{
|
||||
sep << " per ";
|
||||
sep << _idon1;
|
||||
}
|
||||
if ((_idon2.ok()) && (_idon2.not_empty()))
|
||||
{
|
||||
sep << " ";
|
||||
sep << _idon2;
|
||||
}
|
||||
if ((_idon3.ok()) && (_idon3.not_empty()))
|
||||
{
|
||||
sep << " ";
|
||||
sep << _idon3;
|
||||
}
|
||||
if ((_idon4.ok()) && (_idon4.not_empty()))
|
||||
{
|
||||
sep << " ";
|
||||
sep << _idon4;
|
||||
}
|
||||
sep.center_just();
|
||||
set_header(2, "@0g%s", (const char*) sep);
|
||||
TString16 data_stampa = _data_stampa.string();
|
||||
set_header(2,"@0g%10s", (const char*) data_stampa);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
set_header(2, "@120g%s", (const char*) sep);
|
||||
|
||||
sep = "";
|
||||
sep.fill('-');
|
||||
set_header(3, (const char *) sep);
|
||||
|
||||
set_header(4,"@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==DOM_COLOC",1,0,ALIAS_LCP);
|
||||
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
|
||||
// per stampare la denominazione della sezione nell'intestazione
|
||||
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
|
||||
|
||||
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
|
||||
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
|
||||
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
|
||||
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
|
||||
|
||||
_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;
|
||||
}
|
||||
#include <form.h>
|
||||
#include <mask.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;
|
||||
TAssoc_array _categorie;
|
||||
TString16 _tipoidon;
|
||||
TString16 _idon1, _idon2, _idon3, _idon4;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome;
|
||||
TDate _data_stampa;
|
||||
ts _tipo_stampa;
|
||||
TString16 _codsez, _codsot;
|
||||
|
||||
static bool filter_func_idonei(const TRelation* rel);
|
||||
|
||||
protected:
|
||||
virtual bool user_create();
|
||||
virtual bool user_destroy();
|
||||
virtual bool set_print(int m);
|
||||
virtual void set_page(int file, int cnt);
|
||||
virtual bool preprocess_page(int file, int counter);
|
||||
|
||||
public:
|
||||
void crea_intestazione();
|
||||
void filtra_sezioni();
|
||||
void header_sezione(const TString16 codsez, const TString16 codsot);
|
||||
TMask& app_mask() { return *_msk; }
|
||||
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()
|
||||
{
|
||||
const TString16 sezini = _msk->get(F_SEZINI);
|
||||
const TString16 sotini = _msk->get(F_SOTINI);
|
||||
const TString16 sezfin = _msk->get(F_SEZFIN);
|
||||
const TString16 sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TRectype da(LF_SOGGETTI);
|
||||
TRectype a(LF_SOGGETTI);
|
||||
if (sezini.not_empty())
|
||||
da.put(SOG_CODSEZ, sezini);
|
||||
if (sotini.not_empty())
|
||||
da.put(SOG_CODSOT, sotini);
|
||||
if (sezfin.not_empty())
|
||||
a.put(SOG_CODSEZ, sezfin);
|
||||
if (sotfin.not_empty())
|
||||
a.put(SOG_CODSOT, sotfin);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
void 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();
|
||||
// filtro per categorie
|
||||
TAssoc_array& categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
const TString16 catsog = sog.get(SOG_CATDON);
|
||||
filtrato = categorie.is_key((const char*) catsog);
|
||||
}
|
||||
// filtro per idoneità
|
||||
if (filtrato)
|
||||
{
|
||||
TAssoc_array idoneita;
|
||||
TString16 idonsog = sog.get(SOG_IDON1);
|
||||
if (idonsog.not_empty() && idonsog.ok())
|
||||
idoneita.add((const char*) idonsog);
|
||||
idonsog = sog.get(SOG_IDON2);
|
||||
if (idonsog.not_empty() && idonsog.ok())
|
||||
idoneita.add((const char*) idonsog);
|
||||
idonsog = sog.get(SOG_IDON3);
|
||||
if (idonsog.not_empty() && idonsog.ok())
|
||||
idoneita.add((const char*) idonsog);
|
||||
idonsog = sog.get(SOG_IDON4);
|
||||
if (idonsog.not_empty() && idonsog.ok())
|
||||
idoneita.add((const char*) idonsog);
|
||||
if (idoneita.items() != 0)
|
||||
{
|
||||
if (app()._idon1.not_empty() && app()._idon1.ok())
|
||||
filtrato = idoneita.is_key((const char*) app()._idon1);
|
||||
if (app()._idon2.not_empty() && app()._idon2.ok())
|
||||
filtrato = filtrato && idoneita.is_key((const char*) app()._idon2);
|
||||
if (app()._idon3.not_empty() && app()._idon3.ok())
|
||||
filtrato = filtrato && idoneita.is_key((const char*) app()._idon3);
|
||||
if (app()._idon4.not_empty() && app()._idon4.ok())
|
||||
filtrato = filtrato && idoneita.is_key((const char*) app()._idon4);
|
||||
}
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TIdonei_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString80 nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
|
||||
// salto pagina se cambio sezione
|
||||
const TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
const TString16 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 TIdonei_application::header_sezione(const TString16 codsez, const TString16 codsot)
|
||||
{
|
||||
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << codsez;
|
||||
intestazione << "/";
|
||||
intestazione << codsot;
|
||||
intestazione << " ";
|
||||
intestazione << densez;
|
||||
if ((densot.ok())&& (densot.not_empty()))
|
||||
{
|
||||
intestazione << "/";
|
||||
intestazione << densot;
|
||||
}
|
||||
intestazione.center_just();
|
||||
set_header(1,"@0g%s", (const char*) intestazione);
|
||||
return;
|
||||
}
|
||||
|
||||
bool 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à
|
||||
_tipoidon = _msk->get(F_TIPO);
|
||||
if (_tipoidon.not_empty() && _tipoidon.ok())
|
||||
current_cursor()->setfilter(format("STATO == \"%s\"",(const char*)_tipoidon));
|
||||
else
|
||||
current_cursor()->setfilter("(TCS->S6 == \"I\") || (TCS->S6 == \"F\")", TRUE);
|
||||
|
||||
// filtro per categorie
|
||||
const TString16 catpri = _msk->get(F_CAT1);
|
||||
const TString16 catsec = _msk->get(F_CAT2);
|
||||
const TString16 catter = _msk->get(F_CAT3);
|
||||
const TString16 catqua = _msk->get(F_CAT4);
|
||||
const TString16 catqui = _msk->get(F_CAT5);
|
||||
const TString16 catses = _msk->get(F_CAT6);
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
_categorie.add((const char*) catpri);
|
||||
if (catsec.not_empty() && catsec.ok())
|
||||
_categorie.add((const char*) catsec);
|
||||
if (catter.not_empty() && catter.ok())
|
||||
_categorie.add((const char*) catter);
|
||||
if (catqua.not_empty() && catqua.ok())
|
||||
_categorie.add((const char*) catqua);
|
||||
if (catqui.not_empty() && catqui.ok())
|
||||
_categorie.add((const char*) catqui);
|
||||
if (catses.not_empty() && catses.ok())
|
||||
_categorie.add((const char*) catses);
|
||||
|
||||
// filtro per idoneita
|
||||
_idon1 = _msk->get(F_IDON1);
|
||||
_idon2 = _msk->get(F_IDON2);
|
||||
_idon3 = _msk->get(F_IDON3);
|
||||
_idon4 = _msk->get(F_IDON4);
|
||||
|
||||
current_cursor()->set_filterfunction(filter_func_idonei);
|
||||
|
||||
reset_print();
|
||||
crea_intestazione();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TIdonei_application::crea_intestazione()
|
||||
{
|
||||
reset_header();
|
||||
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString sep(132);
|
||||
sep = "ELENCO IDONEI";
|
||||
if ((_tipoidon.ok()) && (_tipoidon.not_empty()))
|
||||
{
|
||||
sep << ": tipo ";
|
||||
sep << _tipoidon;
|
||||
const TString80 dtipo = _msk->get(F_D_TIPO);
|
||||
sep << " ";
|
||||
sep << dtipo;
|
||||
}
|
||||
if ((_idon1.ok()) && (_idon1.not_empty()))
|
||||
{
|
||||
sep << " per ";
|
||||
sep << _idon1;
|
||||
}
|
||||
if ((_idon2.ok()) && (_idon2.not_empty()))
|
||||
{
|
||||
sep << " ";
|
||||
sep << _idon2;
|
||||
}
|
||||
if ((_idon3.ok()) && (_idon3.not_empty()))
|
||||
{
|
||||
sep << " ";
|
||||
sep << _idon3;
|
||||
}
|
||||
if ((_idon4.ok()) && (_idon4.not_empty()))
|
||||
{
|
||||
sep << " ";
|
||||
sep << _idon4;
|
||||
}
|
||||
sep.center_just();
|
||||
set_header(2, "@0g%s", (const char*) sep);
|
||||
const TString16 data_stampa = _data_stampa.string();
|
||||
set_header(2,"@0g%10s", (const char*) data_stampa);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
set_header(2, "@120g%s", (const char*) sep);
|
||||
|
||||
sep = "";
|
||||
sep.fill('-');
|
||||
set_header(3, (const char *) sep);
|
||||
|
||||
set_header(4,"@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==DOM_CODLOC",1,0,ALIAS_LCP);
|
||||
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
|
||||
// per stampare la denominazione della sezione nell'intestazione
|
||||
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
|
||||
|
||||
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
|
||||
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
|
||||
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
|
||||
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
|
||||
|
||||
_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;
|
||||
}
|
||||
|
||||
665
at/at2600.cpp
665
at/at2600.cpp
@ -1,335 +1,330 @@
|
||||
#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 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;
|
||||
|
||||
TAssoc_array _categorie;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome;
|
||||
TDate _data_stampa;
|
||||
ts _tipo_stampa;
|
||||
TString16 _codsez, _codsot;
|
||||
char _tipo_iscdim; // iscritti o dimessi
|
||||
TDate _dataini, _datafin;
|
||||
|
||||
static bool filter_func_iscritti(const TRelation* rel);
|
||||
|
||||
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(TString16 codsez, TString16 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()
|
||||
{
|
||||
TString16 sezini = _msk->get(F_SEZINI);
|
||||
TString16 sotini = _msk->get(F_SOTINI);
|
||||
TString16 sezfin = _msk->get(F_SEZFIN);
|
||||
TString16 sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
|
||||
TRectype da(fl.curr());
|
||||
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();
|
||||
// filtro per categorie
|
||||
TAssoc_array categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
TString16 cat = sog.get(SOG_CATDON);
|
||||
filtrato = categorie.is_key((const char*) cat);
|
||||
}
|
||||
// filtrp per date iscrizione/dimissione
|
||||
if (filtrato)
|
||||
{
|
||||
if (app()._tipo_iscdim == ISCRITTI)
|
||||
{
|
||||
TDate dataisc = sog.get(SOG_DATAISC);
|
||||
filtrato = (dataisc >= app()._dataini && dataisc <= app()._datafin);
|
||||
}
|
||||
else
|
||||
{
|
||||
TDate datadim = sog.get(SOG_DATADIM);
|
||||
filtrato = (datadim >= app()._dataini && datadim <= app()._datafin);
|
||||
}
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TIscritti_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString80 nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
|
||||
// salto pagina se cambio sezione
|
||||
TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
TString16 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 TIscritti_application::header_sezione(TString16 codsez, TString16 codsot)
|
||||
{
|
||||
TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString256 intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << codsez;
|
||||
intestazione << "/";
|
||||
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);
|
||||
// filtro per sezioni
|
||||
filtra_sezioni();
|
||||
// filtro per categorie
|
||||
TString16 catpri = _msk->get(F_CAT1);
|
||||
TString16 catsec = _msk->get(F_CAT2);
|
||||
TString16 catter = _msk->get(F_CAT3);
|
||||
TString16 catqua = _msk->get(F_CAT4);
|
||||
TString16 catqui = _msk->get(F_CAT5);
|
||||
TString16 catses = _msk->get(F_CAT6);
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
_categorie.add((const char*) catpri);
|
||||
if (catsec.not_empty() && catsec.ok())
|
||||
_categorie.add((const char*) catsec);
|
||||
if (catter.not_empty() && catter.ok())
|
||||
_categorie.add((const char*) catter);
|
||||
if (catqua.not_empty() && catqua.ok())
|
||||
_categorie.add((const char*) catqua);
|
||||
if (catqui.not_empty() && catqui.ok())
|
||||
_categorie.add((const char*) catqui);
|
||||
if (catses.not_empty() && catses.ok())
|
||||
_categorie.add((const char*) catses);
|
||||
// filtro per iscritti/dimessi e date
|
||||
_tipo_iscdim = _msk->get(F_TIPO)[0];
|
||||
_dataini = _msk->get(F_DATAINI);
|
||||
_datafin = _msk->get(F_DATAFIN);
|
||||
|
||||
current_cursor()->set_filterfunction(filter_func_iscritti);
|
||||
|
||||
reset_print();
|
||||
crea_intestazione();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TIscritti_application::crea_intestazione()
|
||||
{
|
||||
reset_header();
|
||||
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString256 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);
|
||||
TString16 data_stampa = _data_stampa.string();
|
||||
set_header(2,"@0g%10s", (const char*) data_stampa);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
set_header(2, "@120g%s", (const char*) sep);
|
||||
|
||||
sep = "";
|
||||
sep.fill('-');
|
||||
set_header(3, (const char *) sep);
|
||||
|
||||
set_header(4,"@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==DOM_CODLOC",1,0,ALIAS_LCP);
|
||||
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
|
||||
// per stampare nell'intestazione la denominazione della sezione
|
||||
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
|
||||
|
||||
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
|
||||
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
|
||||
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
|
||||
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
|
||||
|
||||
_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;
|
||||
}
|
||||
#include <form.h>
|
||||
#include <mask.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 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;
|
||||
|
||||
TAssoc_array _categorie;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome;
|
||||
TDate _data_stampa;
|
||||
ts _tipo_stampa;
|
||||
TString16 _codsez, _codsot;
|
||||
char _tipo_iscdim; // iscritti o dimessi
|
||||
TDate _dataini, _datafin;
|
||||
|
||||
static bool filter_func_iscritti(const TRelation* rel);
|
||||
|
||||
protected:
|
||||
virtual bool user_create();
|
||||
virtual bool user_destroy();
|
||||
virtual bool set_print(int m);
|
||||
virtual void set_page(int file, int cnt);
|
||||
virtual bool preprocess_page(int file, int counter);
|
||||
|
||||
public:
|
||||
void crea_intestazione();
|
||||
void filtra_sezioni();
|
||||
void header_sezione(const TString16 codsez, const TString16 codsot);
|
||||
TMask& app_mask() { return *_msk; }
|
||||
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()
|
||||
{
|
||||
const TString16 sezini = _msk->get(F_SEZINI);
|
||||
const TString16 sotini = _msk->get(F_SOTINI);
|
||||
const TString16 sezfin = _msk->get(F_SEZFIN);
|
||||
const TString16 sotfin = _msk->get(F_SOTFIN);
|
||||
const select_cursor(_cur4);
|
||||
TRectype da(LF_SOGGETTI);
|
||||
TRectype a(LF_SOGGETTI);
|
||||
if (sezini.not_empty())
|
||||
da.put(SOG_CODSEZ, sezini);
|
||||
if (sotini.not_empty())
|
||||
da.put(SOG_CODSOT, sotini);
|
||||
if (sezfin.not_empty())
|
||||
a.put(SOG_CODSEZ, sezfin);
|
||||
if (sotfin.not_empty())
|
||||
a.put(SOG_CODSOT, sotfin);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
void 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();
|
||||
// filtro per categorie
|
||||
TAssoc_array& categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
const TString16 cat = sog.get(SOG_CATDON);
|
||||
filtrato = categorie.is_key((const char*) cat);
|
||||
}
|
||||
// filtrp per date iscrizione/dimissione
|
||||
if (filtrato)
|
||||
{
|
||||
if (app()._tipo_iscdim == ISCRITTI)
|
||||
{
|
||||
const TDate dataisc = sog.get(SOG_DATAISC);
|
||||
filtrato = (dataisc >= app()._dataini && dataisc <= app()._datafin);
|
||||
}
|
||||
else
|
||||
{
|
||||
const TDate datadim = sog.get(SOG_DATADIM);
|
||||
filtrato = (datadim >= app()._dataini && datadim <= app()._datafin);
|
||||
}
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TIscritti_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString80 nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
|
||||
// salto pagina se cambio sezione
|
||||
const TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
const TString16 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 TIscritti_application::header_sezione(const TString16 codsez, const TString16 codsot)
|
||||
{
|
||||
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << codsez;
|
||||
intestazione << "/";
|
||||
intestazione << codsot;
|
||||
intestazione << " ";
|
||||
intestazione << densez;
|
||||
if ((densot.ok())&& (densot.not_empty()))
|
||||
{
|
||||
intestazione << "/";
|
||||
intestazione << densot;
|
||||
}
|
||||
intestazione.center_just();
|
||||
set_header(1,"@0g%s", (const char*) intestazione);
|
||||
return;
|
||||
}
|
||||
|
||||
bool TIscritti_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;
|
||||
break;
|
||||
}
|
||||
if (_tipo_stampa != undefined)
|
||||
{
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
// filtro per sezioni
|
||||
filtra_sezioni();
|
||||
// filtro per categorie
|
||||
const TString16 catpri = _msk->get(F_CAT1);
|
||||
const TString16 catsec = _msk->get(F_CAT2);
|
||||
const TString16 catter = _msk->get(F_CAT3);
|
||||
const TString16 catqua = _msk->get(F_CAT4);
|
||||
const TString16 catqui = _msk->get(F_CAT5);
|
||||
const TString16 catses = _msk->get(F_CAT6);
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
_categorie.add((const char*) catpri);
|
||||
if (catsec.not_empty() && catsec.ok())
|
||||
_categorie.add((const char*) catsec);
|
||||
if (catter.not_empty() && catter.ok())
|
||||
_categorie.add((const char*) catter);
|
||||
if (catqua.not_empty() && catqua.ok())
|
||||
_categorie.add((const char*) catqua);
|
||||
if (catqui.not_empty() && catqui.ok())
|
||||
_categorie.add((const char*) catqui);
|
||||
if (catses.not_empty() && catses.ok())
|
||||
_categorie.add((const char*) catses);
|
||||
// filtro per iscritti/dimessi e date
|
||||
_tipo_iscdim = _msk->get(F_TIPO)[0];
|
||||
_dataini = _msk->get(F_DATAINI);
|
||||
_datafin = _msk->get(F_DATAFIN);
|
||||
|
||||
current_cursor()->set_filterfunction(filter_func_iscritti);
|
||||
|
||||
reset_print();
|
||||
crea_intestazione();
|
||||
return TRUE;
|
||||
}
|
||||
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);
|
||||
const TString16 data_stampa = _data_stampa.string();
|
||||
set_header(2,"@0g%10s", (const char*) data_stampa);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
set_header(2, "@120g%s", (const char*) sep);
|
||||
|
||||
sep = "";
|
||||
sep.fill('-');
|
||||
set_header(3, (const char *) sep);
|
||||
|
||||
set_header(4,"@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==DOM_CODLOC",1,0,ALIAS_LCP);
|
||||
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
|
||||
// per stampare nell'intestazione la denominazione della sezione
|
||||
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
|
||||
|
||||
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
|
||||
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
|
||||
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
|
||||
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
|
||||
|
||||
_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;
|
||||
}
|
||||
|
||||
62
at/at3.cpp
62
at/at3.cpp
@ -1,31 +1,31 @@
|
||||
#include <xvt.h>
|
||||
#include <checks.h>
|
||||
|
||||
#include "at3.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 = 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;
|
||||
case 5:
|
||||
rt = at3600(argc, argv); break;
|
||||
default:
|
||||
error_box(usage, argv[0]) ; rt = 1; break;
|
||||
}
|
||||
return rt;
|
||||
}
|
||||
#include <xvt.h>
|
||||
#include <checks.h>
|
||||
|
||||
#include "at3.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 = 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;
|
||||
case 5:
|
||||
rt = at3600(argc, argv); break;
|
||||
default:
|
||||
error_box(usage, argv[0]) ; rt = 1; break;
|
||||
}
|
||||
return rt;
|
||||
}
|
||||
|
||||
24
at/at3.h
24
at/at3.h
@ -1,12 +1,12 @@
|
||||
#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
|
||||
int at3600(int argc, char* argv[]); // convocazioni su punto di raccolta
|
||||
|
||||
#endif // __AT3_H
|
||||
|
||||
#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
|
||||
int at3600(int argc, char* argv[]); // convocazioni su punto di raccolta
|
||||
|
||||
#endif // __AT3_H
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#define APPNAME AVIS
|
||||
#define QAPPNAME "AVIS"
|
||||
#define LIBDIR f:\xvt.403\win_x86\ptk\lib
|
||||
#define QFIRMNAME "AGA Informatica S.r.l."
|
||||
|
||||
#include <default.url>
|
||||
|
||||
@ -46,3 +47,11 @@ MENUBAR MENU_BAR(4)
|
||||
MENU MENU_BAR(4)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at1 -5
|
||||
* ---------------------------------------------------- */
|
||||
MENUBAR MENU_BAR(5)
|
||||
|
||||
MENU MENU_BAR(5)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
|
||||
892
at/at3100.cpp
892
at/at3100.cpp
@ -1,446 +1,446 @@
|
||||
#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
|
||||
// tpi di stampa
|
||||
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* rel);
|
||||
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TConv_form* _form_eti; // per etichette
|
||||
TConv_form* _form_car; // per cartoline
|
||||
TAssoc_array _asezioni;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TDate _data_stampa;
|
||||
|
||||
int _sez_corrente;
|
||||
ts _tipo_stampa;
|
||||
bool _intesta;
|
||||
|
||||
// completare con tutti i dati selezionabili
|
||||
TString16 _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);
|
||||
|
||||
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();
|
||||
TDate dataprossi = sog.get_date(SOG_DATAPROSSI);
|
||||
const char stato = rel->curr(-ALIAS_TABTCS).get_char("S6");
|
||||
const bool dimesso = rel->curr(-ALIAS_TABCTD).get_char("B0");
|
||||
//TDate dataultconv = sog.curr().get_date(SOG_DATAULTCONV);
|
||||
if (dataprossi.ok())
|
||||
{
|
||||
// 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
|
||||
TString16 _giorno = row.get();
|
||||
_intmin = row.get_int();
|
||||
_intmax = row.get_int();
|
||||
// deve diventare un membro
|
||||
TString16 _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);
|
||||
TString16 codice = row.get(0);
|
||||
TString16 codsot = row.get();
|
||||
codice << codsot;
|
||||
if (codice.not_empty())
|
||||
_asezioni.add(codice);
|
||||
}
|
||||
_tipo_stampa = undefined;
|
||||
KEY tasto;
|
||||
tasto = _msk->run();
|
||||
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)
|
||||
{
|
||||
TString256 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()
|
||||
{
|
||||
TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString256 intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << _codsez;
|
||||
intestazione << "/";
|
||||
intestazione << _codsot;
|
||||
intestazione << " ";
|
||||
intestazione << densez;
|
||||
if ((densot.ok())&& (densot.not_empty()))
|
||||
{
|
||||
intestazione << "/";
|
||||
intestazione << densot;
|
||||
}
|
||||
intestazione.center_just();
|
||||
set_header(1,"@0g%s", (const char*) intestazione);
|
||||
|
||||
intestazione = "ELENCO CONVOCATI PER IL ";
|
||||
intestazione << _dataconv.string();
|
||||
intestazione.center_just();
|
||||
set_header(2, "@0g%s", (const char*) intestazione);
|
||||
TString16 data_stampa = _data_stampa.string();
|
||||
set_header(2,"@0g%10s", (const char*) data_stampa);
|
||||
intestazione = "";
|
||||
intestazione << "Pag. @#";
|
||||
set_header(2, "@120g%s", (const char*) intestazione);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
bool TConv_application::user_create()
|
||||
{
|
||||
_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==DOM_CODLOC", 1, 0, ALIAS_TABLCP); // per verificare che sia DONATORE NON DIMESSO
|
||||
_rel->add(LF_COMUNI, "COM==DOMC_CODCOM");
|
||||
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
|
||||
|
||||
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
|
||||
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
|
||||
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
|
||||
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
|
||||
|
||||
_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");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TConv_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_eti;
|
||||
delete _form_car;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TConv_application::check_sez_sheet(const char* codice)
|
||||
{
|
||||
TAssoc_array& sez = app()._asezioni;
|
||||
if (sez.is_key(codice))
|
||||
return FALSE;
|
||||
else
|
||||
{
|
||||
sez.add(codice);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool TConv_application::convocazioni_notify(TSheet_field& s, int r, KEY k)
|
||||
{
|
||||
bool ok = TRUE;
|
||||
switch (k)
|
||||
{
|
||||
case K_TAB:
|
||||
// entrata riga
|
||||
{
|
||||
TToken_string& row = s.row(r);
|
||||
TString16 codice = row.get(0);
|
||||
TString16 codsot = row.get();
|
||||
codice << codsot;
|
||||
if (codice.not_empty())
|
||||
{
|
||||
TAssoc_array& array_sez = app()._asezioni;
|
||||
if (array_sez.is_key(codice))
|
||||
array_sez.remove(codice);
|
||||
}
|
||||
if ((r == s.items()-1) && (r == s.first_empty()))
|
||||
{
|
||||
add_rows_convocazioni(s,8,r+1);
|
||||
s.select(r);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case K_CTRL+K_TAB:
|
||||
// uscita riga
|
||||
{
|
||||
TToken_string& row = s.row(r);
|
||||
TString16 codice = row.get(0);
|
||||
TString16 codsot = row.get();
|
||||
codice << codsot;
|
||||
if (codice.not_empty())
|
||||
{
|
||||
ok = check_sez_sheet(codice);
|
||||
if (!ok)
|
||||
return s.error_box("Sezione già convocata");
|
||||
}
|
||||
if ((r == s.items()-1) && (r == s.first_empty()))
|
||||
{
|
||||
add_rows_convocazioni(s,8,r+1);
|
||||
s.select(r);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
int at3100(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TConv_application a;
|
||||
|
||||
a.run(argc, argv, "Convocazioni");
|
||||
|
||||
return 0;
|
||||
}
|
||||
#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
|
||||
// tpi di stampa
|
||||
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* rel);
|
||||
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TConv_form* _form_eti; // per etichette
|
||||
TConv_form* _form_car; // per cartoline
|
||||
TAssoc_array _asezioni;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TDate _data_stampa;
|
||||
|
||||
int _sez_corrente;
|
||||
ts _tipo_stampa;
|
||||
bool _intesta;
|
||||
|
||||
// completare con tutti i dati selezionabili
|
||||
TString16 _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);
|
||||
|
||||
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();
|
||||
TDate dataprossi = sog.get_date(SOG_DATAPROSSI);
|
||||
const char stato = rel->curr(-ALIAS_TABTCS).get_char("S6");
|
||||
const bool dimesso = rel->curr(-ALIAS_TABCTD).get_char("B0");
|
||||
//TDate dataultconv = sog.curr().get_date(SOG_DATAULTCONV);
|
||||
if (dataprossi.ok())
|
||||
{
|
||||
// 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
|
||||
TString16 _giorno = row.get();
|
||||
_intmin = row.get_int();
|
||||
_intmax = row.get_int();
|
||||
// deve diventare un membro
|
||||
TString16 _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);
|
||||
TString16 codice = row.get(0);
|
||||
TString16 codsot = row.get();
|
||||
codice << codsot;
|
||||
if (codice.not_empty())
|
||||
_asezioni.add(codice);
|
||||
}
|
||||
_tipo_stampa = undefined;
|
||||
KEY tasto;
|
||||
tasto = _msk->run();
|
||||
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)
|
||||
{
|
||||
TString256 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()
|
||||
{
|
||||
TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString256 intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << _codsez;
|
||||
intestazione << "/";
|
||||
intestazione << _codsot;
|
||||
intestazione << " ";
|
||||
intestazione << densez;
|
||||
if ((densot.ok())&& (densot.not_empty()))
|
||||
{
|
||||
intestazione << "/";
|
||||
intestazione << densot;
|
||||
}
|
||||
intestazione.center_just();
|
||||
set_header(1,"@0g%s", (const char*) intestazione);
|
||||
|
||||
intestazione = "ELENCO CONVOCATI PER IL ";
|
||||
intestazione << _dataconv.string();
|
||||
intestazione.center_just();
|
||||
set_header(2, "@0g%s", (const char*) intestazione);
|
||||
TString16 data_stampa = _data_stampa.string();
|
||||
set_header(2,"@0g%10s", (const char*) data_stampa);
|
||||
intestazione = "";
|
||||
intestazione << "Pag. @#";
|
||||
set_header(2, "@120g%s", (const char*) intestazione);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
bool TConv_application::user_create()
|
||||
{
|
||||
_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==DOM_CODLOC", 1, 0, ALIAS_TABLCP); // per verificare che sia DONATORE NON DIMESSO
|
||||
_rel->add(LF_COMUNI, "COM==DOMC_CODCOM");
|
||||
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
|
||||
|
||||
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
|
||||
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
|
||||
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
|
||||
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
|
||||
|
||||
_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");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TConv_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_eti;
|
||||
delete _form_car;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TConv_application::check_sez_sheet(const char* codice)
|
||||
{
|
||||
TAssoc_array& sez = app()._asezioni;
|
||||
if (sez.is_key(codice))
|
||||
return FALSE;
|
||||
else
|
||||
{
|
||||
sez.add(codice);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool TConv_application::convocazioni_notify(TSheet_field& s, int r, KEY k)
|
||||
{
|
||||
bool ok = TRUE;
|
||||
switch (k)
|
||||
{
|
||||
case K_TAB:
|
||||
// entrata riga
|
||||
{
|
||||
TToken_string& row = s.row(r);
|
||||
TString16 codice = row.get(0);
|
||||
TString16 codsot = row.get();
|
||||
codice << codsot;
|
||||
if (codice.not_empty())
|
||||
{
|
||||
TAssoc_array& array_sez = app()._asezioni;
|
||||
if (array_sez.is_key(codice))
|
||||
array_sez.remove(codice);
|
||||
}
|
||||
if ((r == s.items()-1) && (r == s.first_empty()))
|
||||
{
|
||||
add_rows_convocazioni(s,8,r+1);
|
||||
s.select(r);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case K_CTRL+K_TAB:
|
||||
// uscita riga
|
||||
{
|
||||
TToken_string& row = s.row(r);
|
||||
TString16 codice = row.get(0);
|
||||
TString16 codsot = row.get();
|
||||
codice << codsot;
|
||||
if (codice.not_empty())
|
||||
{
|
||||
ok = check_sez_sheet(codice);
|
||||
if (!ok)
|
||||
return s.error_box("Sezione già convocata");
|
||||
}
|
||||
if ((r == s.items()-1) && (r == s.first_empty()))
|
||||
{
|
||||
add_rows_convocazioni(s,8,r+1);
|
||||
s.select(r);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
int at3100(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TConv_application a;
|
||||
|
||||
a.run(argc, argv, "Convocazioni");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
436
at/at3200.cpp
436
at/at3200.cpp
@ -1,218 +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* rel);
|
||||
|
||||
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:
|
||||
{
|
||||
TString16 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_DOM_INDIR));
|
||||
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()
|
||||
{
|
||||
TString256 sep(132);
|
||||
TString16 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==DOM_CODCOM",1,0,ALIAS_COMRES);
|
||||
_rel->add("LCP", "CODTAB==DOM_CODLOC");
|
||||
_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;
|
||||
}
|
||||
#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* rel);
|
||||
|
||||
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:
|
||||
{
|
||||
TString16 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_DOM_INDIR));
|
||||
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()
|
||||
{
|
||||
TString256 sep(132);
|
||||
TString16 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==DOM_CODCOM",1,0,ALIAS_COMRES);
|
||||
_rel->add("LCP", "CODTAB==DOM_CODLOC");
|
||||
_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;
|
||||
}
|
||||
|
||||
718
at/at3300.cpp
718
at/at3300.cpp
@ -1,359 +1,359 @@
|
||||
#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* rel);
|
||||
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TUrgenze_form* _form_eti;
|
||||
TRectype* _sangue;
|
||||
TAssoc_array _categorie;
|
||||
long _giorni;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome, _dencom;
|
||||
|
||||
TDate _data_stampa;
|
||||
TDate _dataini, _datafin;
|
||||
ts _tipo_stampa;
|
||||
TString16 _codsez, _codsot;
|
||||
|
||||
|
||||
protected:
|
||||
virtual bool user_create();
|
||||
virtual bool user_destroy();
|
||||
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(TString16 codsez, TString16 codsot);
|
||||
TMask& app_mask() { return *_msk; }
|
||||
TRectype& get_sangue() { return *_sangue; }
|
||||
|
||||
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()
|
||||
{
|
||||
TString16 sezini = _msk->get(F_SEZINI);
|
||||
TString16 sotini = _msk->get(F_SOTINI);
|
||||
TString16 sezfin = _msk->get(F_SEZFIN);
|
||||
TString16 sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
|
||||
TRectype da(fl.curr());
|
||||
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_DOM_INDIR));
|
||||
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();
|
||||
//filtro per categorie
|
||||
TAssoc_array& categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
TString16 cat = sog.get(SOG_CATDON);
|
||||
filtrato = categorie.is_key((const char*) cat);
|
||||
}
|
||||
// filtro per tipizzazione
|
||||
if (filtrato)
|
||||
{
|
||||
TRectype from = app().get_sangue();
|
||||
filtrato = (sog.curr()==from);
|
||||
}
|
||||
// filtro su data donazione
|
||||
if (filtrato)
|
||||
{
|
||||
long giorni_sez = rel->lfile(LF_SEZIONI).get_long(SEZ_INTMINCONV);
|
||||
long giorni = (giorni_sez > app()._giorni) ? giorni_sez : app()._giorni;
|
||||
TDate data(TODAY);
|
||||
data = data - (const long) giorni;
|
||||
TDate dataultdon = sog.get(SOG_DATAULTDON);
|
||||
filtrato = (dataultdon <= data);
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TUrgenze_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString80 nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
TString256 localita = "";
|
||||
localita << current_cursor()->curr(-ALIAS_LCP).get("S6");
|
||||
if (localita.not_empty() && localita.ok())
|
||||
{
|
||||
localita << " ";
|
||||
localita << current_cursor()->curr(-ALIAS_LCP).get("S0");
|
||||
localita << " - ";
|
||||
}
|
||||
else
|
||||
{
|
||||
localita = current_cursor()->curr(LF_COMUNI).get(COM_CAPCOM);
|
||||
localita << " ";
|
||||
}
|
||||
localita << current_cursor()->curr(LF_COMUNI).get(COM_DENCOM);
|
||||
localita.trim();
|
||||
_dencom = localita;
|
||||
|
||||
// salto pagina se cambio sezione
|
||||
TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
TString16 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 TUrgenze_application::header_sezione(TString16 codsez, TString16 codsot)
|
||||
{
|
||||
TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString256 intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << codsez;
|
||||
intestazione << "/";
|
||||
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 = "**";
|
||||
_codsot = "**";
|
||||
break;
|
||||
case F_ETICHETTE:
|
||||
_tipo_stampa = etichette;
|
||||
break;
|
||||
}
|
||||
if (_tipo_stampa != undefined)
|
||||
{
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
filtra_sezioni();
|
||||
// filtro per categorie
|
||||
TString16 catpri = _msk->get(F_CAT1);
|
||||
TString16 catsec = _msk->get(F_CAT2);
|
||||
TString16 catter = _msk->get(F_CAT3);
|
||||
TString16 catqua = _msk->get(F_CAT4);
|
||||
TString16 catqui = _msk->get(F_CAT5);
|
||||
TString16 catses = _msk->get(F_CAT6);
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
_categorie.add((const char*) catpri);
|
||||
if (catsec.not_empty() && catsec.ok())
|
||||
_categorie.add((const char*) catsec);
|
||||
if (catter.not_empty() && catter.ok())
|
||||
_categorie.add((const char*) catter);
|
||||
if (catqua.not_empty() && catqua.ok())
|
||||
_categorie.add((const char*) catqua);
|
||||
if (catqui.not_empty() && catqui.ok())
|
||||
_categorie.add((const char*) catqui);
|
||||
if (catses.not_empty() && catses.ok())
|
||||
_categorie.add((const char*) catses);
|
||||
// filtro per tipizzazione
|
||||
_sangue->zero();
|
||||
TString16 gruppoab0 = _msk->get(F_GRUPPOAB0);
|
||||
TString16 rhantid = _msk->get(F_RHANTID);
|
||||
TString16 kell = _msk->get(F_KELL);
|
||||
TString16 fenotiporh = _msk->get(F_FENOTIPORH);
|
||||
TString16 du = _msk->get(F_DU);
|
||||
if ((gruppoab0.ok()) && (gruppoab0.not_empty()))
|
||||
_sangue->put(SOG_GRUPPOAB0, gruppoab0);
|
||||
if ((rhantid.ok()) && (rhantid.not_empty()))
|
||||
_sangue->put(SOG_RHANTID, rhantid);
|
||||
if ((kell.ok()) && (kell.not_empty()))
|
||||
_sangue->put(SOG_KELL, kell);
|
||||
if ((fenotiporh.ok()) && (fenotiporh.not_empty()))
|
||||
_sangue->put(SOG_FENOTIPORH, fenotiporh);
|
||||
if ((du.ok()) && (du.not_empty()))
|
||||
_sangue->put(SOG_DU, du);
|
||||
_giorni = _msk->get_long(F_GIORNI);
|
||||
// filtra solo idonei
|
||||
current_cursor()->setfilter("TCS->S6 == \"I\"", TRUE);
|
||||
// filtra per categorie, 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)
|
||||
{
|
||||
TString256 sep(132);
|
||||
sep = "CONVOCAZIONI URGENTI";
|
||||
sep.center_just();
|
||||
set_header(2, "@0g%s", (const char*) sep);
|
||||
TString16 data_stampa = _data_stampa.string();
|
||||
set_header(2,"@0g%10s", (const char*) data_stampa);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
set_header(2, "@120g%s", (const char*) sep);
|
||||
|
||||
sep = "";
|
||||
sep.fill('-');
|
||||
set_header(3, (const char *) sep);
|
||||
|
||||
set_header(4,"@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");
|
||||
_sangue = new TRectype(LF_SOGGETTI);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TUrgenze_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_eti;
|
||||
delete _sangue;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at3300(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TUrgenze_application a;
|
||||
|
||||
a.run(argc, argv, "Urgenze");
|
||||
|
||||
return 0;
|
||||
}
|
||||
#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* rel);
|
||||
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TUrgenze_form* _form_eti;
|
||||
TRectype* _sangue;
|
||||
TAssoc_array _categorie;
|
||||
long _giorni;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome, _dencom;
|
||||
|
||||
TDate _data_stampa;
|
||||
TDate _dataini, _datafin;
|
||||
ts _tipo_stampa;
|
||||
TString16 _codsez, _codsot;
|
||||
|
||||
|
||||
protected:
|
||||
virtual bool user_create();
|
||||
virtual bool user_destroy();
|
||||
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(TString16 codsez, TString16 codsot);
|
||||
TMask& app_mask() { return *_msk; }
|
||||
TRectype& get_sangue() { return *_sangue; }
|
||||
|
||||
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()
|
||||
{
|
||||
TString16 sezini = _msk->get(F_SEZINI);
|
||||
TString16 sotini = _msk->get(F_SOTINI);
|
||||
TString16 sezfin = _msk->get(F_SEZFIN);
|
||||
TString16 sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
|
||||
TRectype da(fl.curr());
|
||||
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_DOM_INDIR));
|
||||
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();
|
||||
//filtro per categorie
|
||||
TAssoc_array& categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
TString16 cat = sog.get(SOG_CATDON);
|
||||
filtrato = categorie.is_key((const char*) cat);
|
||||
}
|
||||
// filtro per tipizzazione
|
||||
if (filtrato)
|
||||
{
|
||||
TRectype from = app().get_sangue();
|
||||
filtrato = (sog.curr()==from);
|
||||
}
|
||||
// filtro su data donazione
|
||||
if (filtrato)
|
||||
{
|
||||
long giorni_sez = rel->lfile(LF_SEZIONI).get_long(SEZ_INTMINCONV);
|
||||
long giorni = (giorni_sez > app()._giorni) ? giorni_sez : app()._giorni;
|
||||
TDate data(TODAY);
|
||||
data = data - (const long) giorni;
|
||||
TDate dataultdon = sog.get(SOG_DATAULTDON);
|
||||
filtrato = (dataultdon <= data);
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TUrgenze_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString80 nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
TString256 localita = "";
|
||||
localita << current_cursor()->curr(-ALIAS_LCP).get("S6");
|
||||
if (localita.not_empty() && localita.ok())
|
||||
{
|
||||
localita << " ";
|
||||
localita << current_cursor()->curr(-ALIAS_LCP).get("S0");
|
||||
localita << " - ";
|
||||
}
|
||||
else
|
||||
{
|
||||
localita = current_cursor()->curr(LF_COMUNI).get(COM_CAPCOM);
|
||||
localita << " ";
|
||||
}
|
||||
localita << current_cursor()->curr(LF_COMUNI).get(COM_DENCOM);
|
||||
localita.trim();
|
||||
_dencom = localita;
|
||||
|
||||
// salto pagina se cambio sezione
|
||||
TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
TString16 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 TUrgenze_application::header_sezione(TString16 codsez, TString16 codsot)
|
||||
{
|
||||
TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString256 intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << codsez;
|
||||
intestazione << "/";
|
||||
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 = "**";
|
||||
_codsot = "**";
|
||||
break;
|
||||
case F_ETICHETTE:
|
||||
_tipo_stampa = etichette;
|
||||
break;
|
||||
}
|
||||
if (_tipo_stampa != undefined)
|
||||
{
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
filtra_sezioni();
|
||||
// filtro per categorie
|
||||
TString16 catpri = _msk->get(F_CAT1);
|
||||
TString16 catsec = _msk->get(F_CAT2);
|
||||
TString16 catter = _msk->get(F_CAT3);
|
||||
TString16 catqua = _msk->get(F_CAT4);
|
||||
TString16 catqui = _msk->get(F_CAT5);
|
||||
TString16 catses = _msk->get(F_CAT6);
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
_categorie.add((const char*) catpri);
|
||||
if (catsec.not_empty() && catsec.ok())
|
||||
_categorie.add((const char*) catsec);
|
||||
if (catter.not_empty() && catter.ok())
|
||||
_categorie.add((const char*) catter);
|
||||
if (catqua.not_empty() && catqua.ok())
|
||||
_categorie.add((const char*) catqua);
|
||||
if (catqui.not_empty() && catqui.ok())
|
||||
_categorie.add((const char*) catqui);
|
||||
if (catses.not_empty() && catses.ok())
|
||||
_categorie.add((const char*) catses);
|
||||
// filtro per tipizzazione
|
||||
_sangue->zero();
|
||||
TString16 gruppoab0 = _msk->get(F_GRUPPOAB0);
|
||||
TString16 rhantid = _msk->get(F_RHANTID);
|
||||
TString16 kell = _msk->get(F_KELL);
|
||||
TString16 fenotiporh = _msk->get(F_FENOTIPORH);
|
||||
TString16 du = _msk->get(F_DU);
|
||||
if ((gruppoab0.ok()) && (gruppoab0.not_empty()))
|
||||
_sangue->put(SOG_GRUPPOAB0, gruppoab0);
|
||||
if ((rhantid.ok()) && (rhantid.not_empty()))
|
||||
_sangue->put(SOG_RHANTID, rhantid);
|
||||
if ((kell.ok()) && (kell.not_empty()))
|
||||
_sangue->put(SOG_KELL, kell);
|
||||
if ((fenotiporh.ok()) && (fenotiporh.not_empty()))
|
||||
_sangue->put(SOG_FENOTIPORH, fenotiporh);
|
||||
if ((du.ok()) && (du.not_empty()))
|
||||
_sangue->put(SOG_DU, du);
|
||||
_giorni = _msk->get_long(F_GIORNI);
|
||||
// filtra solo idonei
|
||||
current_cursor()->setfilter("TCS->S6 == \"I\"", TRUE);
|
||||
// filtra per categorie, 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)
|
||||
{
|
||||
TString256 sep(132);
|
||||
sep = "CONVOCAZIONI URGENTI";
|
||||
sep.center_just();
|
||||
set_header(2, "@0g%s", (const char*) sep);
|
||||
TString16 data_stampa = _data_stampa.string();
|
||||
set_header(2,"@0g%10s", (const char*) data_stampa);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
set_header(2, "@120g%s", (const char*) sep);
|
||||
|
||||
sep = "";
|
||||
sep.fill('-');
|
||||
set_header(3, (const char *) sep);
|
||||
|
||||
set_header(4,"@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");
|
||||
_sangue = new TRectype(LF_SOGGETTI);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TUrgenze_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_eti;
|
||||
delete _sangue;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at3300(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TUrgenze_application a;
|
||||
|
||||
a.run(argc, argv, "Urgenze");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
668
at/at3400.cpp
668
at/at3400.cpp
@ -1,334 +1,334 @@
|
||||
#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* rel);
|
||||
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TModificati_form* _form_pag;
|
||||
TAssoc_array _categorie;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome, _dencom;
|
||||
|
||||
TDate _data_stampa;
|
||||
TDate _dataini, _datafin;
|
||||
ts _tipo_stampa;
|
||||
TString16 _codsez, _codsot;
|
||||
|
||||
|
||||
protected:
|
||||
virtual bool user_create();
|
||||
virtual bool user_destroy();
|
||||
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(TString16 codsez, TString16 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()
|
||||
{
|
||||
TString16 sezini = _msk->get(F_SEZINI);
|
||||
TString16 sotini = _msk->get(F_SOTINI);
|
||||
TString16 sezfin = _msk->get(F_SEZFIN);
|
||||
TString16 sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
|
||||
TRectype da(fl.curr());
|
||||
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_DOM_INDIR));
|
||||
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();
|
||||
//filtro per categorie
|
||||
TAssoc_array& categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
TString16 cat = sog.get(SOG_CATDON);
|
||||
filtrato = categorie.is_key((const char*) cat);
|
||||
}
|
||||
// filtro per data aggiornamento
|
||||
if (filtrato && app()._dataini.ok())
|
||||
{
|
||||
TDate datamod = sog.get(SOG_DATAULTAGG);
|
||||
filtrato = (datamod > app()._dataini);
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TModificati_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString80 nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
TString256 localita = "";
|
||||
localita << current_cursor()->curr(-ALIAS_LCP).get("S6");
|
||||
if (localita.not_empty() && localita.ok())
|
||||
{
|
||||
localita << " ";
|
||||
localita << current_cursor()->curr(-ALIAS_LCP).get("S0");
|
||||
localita << " - ";
|
||||
}
|
||||
else
|
||||
{
|
||||
localita = current_cursor()->curr(LF_COMUNI).get(COM_CAPCOM);
|
||||
localita << " ";
|
||||
}
|
||||
localita << current_cursor()->curr(LF_COMUNI).get(COM_DENCOM);
|
||||
localita.trim();
|
||||
_dencom = localita;
|
||||
|
||||
// salto pagina se cambio sezione
|
||||
TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
TString16 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(TString16 codsez, TString16 codsot)
|
||||
{
|
||||
TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString256 intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << codsez;
|
||||
intestazione << "/";
|
||||
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();
|
||||
|
||||
// filtro per categorie
|
||||
TString16 catpri = _msk->get(F_CAT1);
|
||||
TString16 catsec = _msk->get(F_CAT2);
|
||||
TString16 catter = _msk->get(F_CAT3);
|
||||
TString16 catqua = _msk->get(F_CAT4);
|
||||
TString16 catqui = _msk->get(F_CAT5);
|
||||
TString16 catses = _msk->get(F_CAT6);
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
_categorie.add((const char*) catpri);
|
||||
if (catsec.not_empty() && catsec.ok())
|
||||
_categorie.add((const char*) catsec);
|
||||
if (catter.not_empty() && catter.ok())
|
||||
_categorie.add((const char*) catter);
|
||||
if (catqua.not_empty() && catqua.ok())
|
||||
_categorie.add((const char*) catqua);
|
||||
if (catqui.not_empty() && catqui.ok())
|
||||
_categorie.add((const char*) catqui);
|
||||
if (catses.not_empty() && catses.ok())
|
||||
_categorie.add((const char*) catses);
|
||||
|
||||
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)
|
||||
{
|
||||
TString256 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);
|
||||
TString16 data_stampa = _data_stampa.string();
|
||||
set_header(2,"@0g%10s", (const char*) data_stampa);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
set_header(2, "@120g%s", (const char*) sep);
|
||||
|
||||
sep = "";
|
||||
sep.fill('-');
|
||||
set_header(3, (const char *) sep);
|
||||
|
||||
set_header(4,"@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;
|
||||
}
|
||||
#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* rel);
|
||||
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TModificati_form* _form_pag;
|
||||
TAssoc_array _categorie;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome, _dencom;
|
||||
|
||||
TDate _data_stampa;
|
||||
TDate _dataini, _datafin;
|
||||
ts _tipo_stampa;
|
||||
TString16 _codsez, _codsot;
|
||||
|
||||
|
||||
protected:
|
||||
virtual bool user_create();
|
||||
virtual bool user_destroy();
|
||||
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(TString16 codsez, TString16 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()
|
||||
{
|
||||
TString16 sezini = _msk->get(F_SEZINI);
|
||||
TString16 sotini = _msk->get(F_SOTINI);
|
||||
TString16 sezfin = _msk->get(F_SEZFIN);
|
||||
TString16 sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
|
||||
TRectype da(fl.curr());
|
||||
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_DOM_INDIR));
|
||||
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();
|
||||
//filtro per categorie
|
||||
TAssoc_array& categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
TString16 cat = sog.get(SOG_CATDON);
|
||||
filtrato = categorie.is_key((const char*) cat);
|
||||
}
|
||||
// filtro per data aggiornamento
|
||||
if (filtrato && app()._dataini.ok())
|
||||
{
|
||||
TDate datamod = sog.get(SOG_DATAULTAGG);
|
||||
filtrato = (datamod > app()._dataini);
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TModificati_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString80 nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
TString256 localita = "";
|
||||
localita << current_cursor()->curr(-ALIAS_LCP).get("S6");
|
||||
if (localita.not_empty() && localita.ok())
|
||||
{
|
||||
localita << " ";
|
||||
localita << current_cursor()->curr(-ALIAS_LCP).get("S0");
|
||||
localita << " - ";
|
||||
}
|
||||
else
|
||||
{
|
||||
localita = current_cursor()->curr(LF_COMUNI).get(COM_CAPCOM);
|
||||
localita << " ";
|
||||
}
|
||||
localita << current_cursor()->curr(LF_COMUNI).get(COM_DENCOM);
|
||||
localita.trim();
|
||||
_dencom = localita;
|
||||
|
||||
// salto pagina se cambio sezione
|
||||
TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
TString16 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(TString16 codsez, TString16 codsot)
|
||||
{
|
||||
TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString256 intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << codsez;
|
||||
intestazione << "/";
|
||||
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();
|
||||
|
||||
// filtro per categorie
|
||||
TString16 catpri = _msk->get(F_CAT1);
|
||||
TString16 catsec = _msk->get(F_CAT2);
|
||||
TString16 catter = _msk->get(F_CAT3);
|
||||
TString16 catqua = _msk->get(F_CAT4);
|
||||
TString16 catqui = _msk->get(F_CAT5);
|
||||
TString16 catses = _msk->get(F_CAT6);
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
_categorie.add((const char*) catpri);
|
||||
if (catsec.not_empty() && catsec.ok())
|
||||
_categorie.add((const char*) catsec);
|
||||
if (catter.not_empty() && catter.ok())
|
||||
_categorie.add((const char*) catter);
|
||||
if (catqua.not_empty() && catqua.ok())
|
||||
_categorie.add((const char*) catqua);
|
||||
if (catqui.not_empty() && catqui.ok())
|
||||
_categorie.add((const char*) catqui);
|
||||
if (catses.not_empty() && catses.ok())
|
||||
_categorie.add((const char*) catses);
|
||||
|
||||
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)
|
||||
{
|
||||
TString256 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);
|
||||
TString16 data_stampa = _data_stampa.string();
|
||||
set_header(2,"@0g%10s", (const char*) data_stampa);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
set_header(2, "@120g%s", (const char*) sep);
|
||||
|
||||
sep = "";
|
||||
sep.fill('-');
|
||||
set_header(3, (const char *) sep);
|
||||
|
||||
set_header(4,"@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;
|
||||
}
|
||||
|
||||
720
at/at3500.cpp
720
at/at3500.cpp
@ -1,360 +1,360 @@
|
||||
#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;
|
||||
TAssoc_array _categorie;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome;
|
||||
TDate _data_stampa;
|
||||
TDate _dataini, _datafin;
|
||||
TString16 _procdon;
|
||||
ts _tipo_stampa;
|
||||
TString16 _codsez, _codsot;
|
||||
|
||||
static bool filter_func_scadenze(const TRelation* rel);
|
||||
|
||||
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(TString16 codsez, TString16 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()
|
||||
{
|
||||
TString16 sezini = _msk->get(F_SEZINI);
|
||||
TString16 sotini = _msk->get(F_SOTINI);
|
||||
TString16 sezfin = _msk->get(F_SEZFIN);
|
||||
TString16 sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
|
||||
TRectype da(fl.curr());
|
||||
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();
|
||||
// filtro per categorie
|
||||
TAssoc_array categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
TString16 cat = sog.get(SOG_CATDON);
|
||||
filtrato = categorie.is_key((const char*) cat);
|
||||
}
|
||||
// filtro per data di prossima donazione
|
||||
if (filtrato)
|
||||
{
|
||||
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);
|
||||
}
|
||||
filtrato = (sog->curr() >= from) && (sog->curr() <= to);
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TScadenze_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString80 nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
|
||||
// salto pagina se cambio sezione
|
||||
TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
TString16 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(TString16 codsez, TString16 codsot)
|
||||
{
|
||||
TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString256 intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << codsez;
|
||||
intestazione << "/";
|
||||
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 categorie
|
||||
TString16 catpri = _msk->get(F_CAT1);
|
||||
TString16 catsec = _msk->get(F_CAT2);
|
||||
TString16 catter = _msk->get(F_CAT3);
|
||||
TString16 catqua = _msk->get(F_CAT4);
|
||||
TString16 catqui = _msk->get(F_CAT5);
|
||||
TString16 catses = _msk->get(F_CAT6);
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
_categorie.add((const char*) catpri);
|
||||
if (catsec.not_empty() && catsec.ok())
|
||||
_categorie.add((const char*) catsec);
|
||||
if (catter.not_empty() && catter.ok())
|
||||
_categorie.add((const char*) catter);
|
||||
if (catqua.not_empty() && catqua.ok())
|
||||
_categorie.add((const char*) catqua);
|
||||
if (catqui.not_empty() && catqui.ok())
|
||||
_categorie.add((const char*) catqui);
|
||||
if (catses.not_empty() && catses.ok())
|
||||
_categorie.add((const char*) catses);
|
||||
// filtro per idoneo e non escluso
|
||||
current_cursor()->setfilter("((TCS->S6 == \"I\" ) || (TCS->S6 == \"F\")) && (ESCLUSO == \"\")", TRUE);
|
||||
|
||||
// filtro per procedura di donazione (controllo che abbia la data)
|
||||
/* questo filtro è nella filter_function
|
||||
TString16 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)
|
||||
{
|
||||
TString256 sep(132);
|
||||
sep = "SCADENZE DI DONAZIONE ";
|
||||
TString16 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);
|
||||
TString16 data_stampa = _data_stampa.string();
|
||||
set_header(2,"@0g%10s", (const char*) data_stampa);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
set_header(2, "@120g%s", (const char*) sep);
|
||||
|
||||
sep = "";
|
||||
sep.fill('-');
|
||||
set_header(3, (const char *) sep);
|
||||
|
||||
set_header(4,"@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;
|
||||
}
|
||||
#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;
|
||||
TAssoc_array _categorie;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome;
|
||||
TDate _data_stampa;
|
||||
TDate _dataini, _datafin;
|
||||
TString16 _procdon;
|
||||
ts _tipo_stampa;
|
||||
TString16 _codsez, _codsot;
|
||||
|
||||
static bool filter_func_scadenze(const TRelation* rel);
|
||||
|
||||
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(TString16 codsez, TString16 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()
|
||||
{
|
||||
TString16 sezini = _msk->get(F_SEZINI);
|
||||
TString16 sotini = _msk->get(F_SOTINI);
|
||||
TString16 sezfin = _msk->get(F_SEZFIN);
|
||||
TString16 sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_SOGGETTI);
|
||||
TRectype da(fl.curr());
|
||||
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();
|
||||
// filtro per categorie
|
||||
TAssoc_array categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
TString16 cat = sog.get(SOG_CATDON);
|
||||
filtrato = categorie.is_key((const char*) cat);
|
||||
}
|
||||
// filtro per data di prossima donazione
|
||||
if (filtrato)
|
||||
{
|
||||
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);
|
||||
}
|
||||
filtrato = (sog->curr() >= from) && (sog->curr() <= to);
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TScadenze_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString80 nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
|
||||
// salto pagina se cambio sezione
|
||||
TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
TString16 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(TString16 codsez, TString16 codsot)
|
||||
{
|
||||
TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString256 intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << codsez;
|
||||
intestazione << "/";
|
||||
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 categorie
|
||||
TString16 catpri = _msk->get(F_CAT1);
|
||||
TString16 catsec = _msk->get(F_CAT2);
|
||||
TString16 catter = _msk->get(F_CAT3);
|
||||
TString16 catqua = _msk->get(F_CAT4);
|
||||
TString16 catqui = _msk->get(F_CAT5);
|
||||
TString16 catses = _msk->get(F_CAT6);
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
_categorie.add((const char*) catpri);
|
||||
if (catsec.not_empty() && catsec.ok())
|
||||
_categorie.add((const char*) catsec);
|
||||
if (catter.not_empty() && catter.ok())
|
||||
_categorie.add((const char*) catter);
|
||||
if (catqua.not_empty() && catqua.ok())
|
||||
_categorie.add((const char*) catqua);
|
||||
if (catqui.not_empty() && catqui.ok())
|
||||
_categorie.add((const char*) catqui);
|
||||
if (catses.not_empty() && catses.ok())
|
||||
_categorie.add((const char*) catses);
|
||||
// filtro per idoneo e non escluso
|
||||
current_cursor()->setfilter("((TCS->S6 == \"I\" ) || (TCS->S6 == \"F\")) && (ESCLUSO == \"\")", TRUE);
|
||||
|
||||
// filtro per procedura di donazione (controllo che abbia la data)
|
||||
/* questo filtro è nella filter_function
|
||||
TString16 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)
|
||||
{
|
||||
TString256 sep(132);
|
||||
sep = "SCADENZE DI DONAZIONE ";
|
||||
TString16 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);
|
||||
TString16 data_stampa = _data_stampa.string();
|
||||
set_header(2,"@0g%10s", (const char*) data_stampa);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
set_header(2, "@120g%s", (const char*) sep);
|
||||
|
||||
sep = "";
|
||||
sep.fill('-');
|
||||
set_header(3, (const char *) sep);
|
||||
|
||||
set_header(4,"@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;
|
||||
}
|
||||
|
||||
347
at/at3600.cpp
Executable file
347
at/at3600.cpp
Executable file
@ -0,0 +1,347 @@
|
||||
#include <form.h>
|
||||
#include <mask.h>
|
||||
#include <printapp.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include "lf.h"
|
||||
#include "soggetti.h"
|
||||
#include "sezioni.h"
|
||||
|
||||
#include "at3.h"
|
||||
#include "at3600a.h"
|
||||
|
||||
#define ALIAS_LCP 100
|
||||
#define ALIAS_TDN 200
|
||||
#define IDON_SI "SI"
|
||||
#define IDON_AF "AF"
|
||||
|
||||
enum ts { undefined = 0, elenco = 1, etichette = 2, cartoline = 3 };
|
||||
|
||||
// definizione form per etichette
|
||||
class TConvBO_form : public TForm
|
||||
{
|
||||
public:
|
||||
|
||||
virtual TCursor* cursor() const;
|
||||
virtual TRelation* relation() const;
|
||||
TPrint_section& get_body() { return section('B'); } ;
|
||||
TConvBO_form(): TForm() {};
|
||||
TConvBO_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
|
||||
: TForm(form,code,editlevel,desc) {};
|
||||
virtual ~TConvBO_form() {};
|
||||
};
|
||||
|
||||
class TConvBO_application : public TPrintapp
|
||||
{
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TConvBO_form* _form_eti;
|
||||
|
||||
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome;
|
||||
TDate _data_stampa;
|
||||
TDate _dataini, _datafin;
|
||||
TString16 _procdon;
|
||||
ts _tipo_stampa;
|
||||
TString16 _codsez, _codsot;
|
||||
|
||||
|
||||
static bool filter_func_convBO(const TRelation* rel);
|
||||
|
||||
protected:
|
||||
virtual bool user_create();
|
||||
virtual bool user_destroy();
|
||||
virtual bool set_print(int m);
|
||||
virtual void set_page(int file, int cnt);
|
||||
virtual bool preprocess_page(int file, int counter);
|
||||
|
||||
public:
|
||||
void crea_intestazione();
|
||||
void filtra_sezioni();
|
||||
void header_sezione(const TString16 codsez, const TString16 codsot);
|
||||
TMask& app_mask() { return *_msk; }
|
||||
TConvBO_application() : _data_stampa(TODAY), _cognome_nome("",25) {}
|
||||
};
|
||||
|
||||
HIDDEN inline TConvBO_application& app() { return (TConvBO_application&) main_app(); }
|
||||
|
||||
TCursor* TConvBO_form::cursor() const { return app().current_cursor(); }
|
||||
|
||||
TRelation* TConvBO_form::relation() const { return cursor()->relation(); }
|
||||
|
||||
void TConvBO_application::filtra_sezioni()
|
||||
{
|
||||
const TString16 sez = _msk->get(F_CODSEZ);
|
||||
const TString16 sot = _msk->get(F_CODSOT);
|
||||
select_cursor(_cur4);
|
||||
TRectype da(LF_SOGGETTI);
|
||||
if (sez.not_empty())
|
||||
da.put(SOG_CODSEZ, sez);
|
||||
if (sot.not_empty())
|
||||
da.put(SOG_CODSOT, sot);
|
||||
current_cursor()->setregion(da, da);
|
||||
}
|
||||
|
||||
void TConvBO_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 TConvBO_application::filter_func_convBO(const TRelation* rel)
|
||||
{
|
||||
|
||||
bool filtrato = TRUE;
|
||||
|
||||
TLocalisamfile& sog = rel->lfile();
|
||||
|
||||
/*
|
||||
TString16 catsog = sog.get(SOG_CATDON);
|
||||
TString
|
||||
if (categoria non di dimissione) && (punto di raccolta = scelto o vuoto)
|
||||
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 TConvBO_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString80 nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
|
||||
// salto pagina se cambio sezione
|
||||
const TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
const TString16 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 TConvBO_application::header_sezione(const TString16 codsez, const TString16 codsot)
|
||||
{
|
||||
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << codsez;
|
||||
intestazione << "/";
|
||||
intestazione << codsot;
|
||||
intestazione << " ";
|
||||
intestazione << densez;
|
||||
if ((densot.ok())&& (densot.not_empty()))
|
||||
{
|
||||
intestazione << "/";
|
||||
intestazione << densot;
|
||||
}
|
||||
intestazione.center_just();
|
||||
set_header(1,"@0g%s", (const char*) intestazione);
|
||||
return;
|
||||
}
|
||||
|
||||
bool TConvBO_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
|
||||
TString16 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_convBO);
|
||||
reset_print();
|
||||
crea_intestazione();
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TConvBO_application::crea_intestazione()
|
||||
{
|
||||
reset_header();
|
||||
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString sep(132);
|
||||
sep = "SCADENZE DI DONAZIONE ";
|
||||
/* TString16 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);
|
||||
TString16 data_stampa = _data_stampa.string();
|
||||
set_header(2,"@0g%10s", (const char*) data_stampa);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
set_header(2, "@120g%s", (const char*) sep);
|
||||
|
||||
sep = "";
|
||||
sep.fill('-');
|
||||
set_header(3, (const char *) sep);
|
||||
|
||||
set_header(4,"@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 TConvBO_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("at3600a");
|
||||
|
||||
_form_eti = new TConvBO_form("AT_ETSOG");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TConvBO_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_eti;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at3600(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TConvBO_application a;
|
||||
|
||||
a.run(argc, argv, "Convocazioni su punto di raccolta");
|
||||
|
||||
return 0;
|
||||
}
|
||||
16
at/at3600a.h
Executable file
16
at/at3600a.h
Executable file
@ -0,0 +1,16 @@
|
||||
// Convocazione per BOLOGNA
|
||||
// definizione campi per maschera di selezione
|
||||
|
||||
#define F_DATACONV 101
|
||||
#define F_PUNTO 102
|
||||
#define F_D_PUNTO 103
|
||||
#define F_TIPODON 104
|
||||
#define F_D_TIPODON 105
|
||||
#define F_CODSEZ 106
|
||||
#define F_DENSEZ 107
|
||||
#define F_CODSOT 108
|
||||
#define F_DENSOT 109
|
||||
|
||||
#define F_ELENCO 401
|
||||
#define F_ETICHETTE 402
|
||||
#define F_CARTOLINE 403
|
||||
148
at/at3600a.uml
Executable file
148
at/at3600a.uml
Executable file
@ -0,0 +1,148 @@
|
||||
#include "at3600a.h"
|
||||
#include "lf.h"
|
||||
PAGE "Definizione Stampe" -1 -1 78 20
|
||||
|
||||
GROUPBOX DLG_NULL 77 7
|
||||
BEGIN
|
||||
PROMPT 1 0 "Opzioni per la convocazione"
|
||||
END
|
||||
|
||||
DATE F_DATACONV
|
||||
BEGIN
|
||||
PROMPT 2 1 "Data convocazione "
|
||||
END
|
||||
|
||||
|
||||
STRING F_PUNTO 4
|
||||
BEGIN
|
||||
PROMPT 2 2 "Punto di raccolta "
|
||||
FLAGS "U"
|
||||
USE LDN
|
||||
INPUT CODTAB F_PUNTO
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_PUNTO CODTAB
|
||||
OUTPUT F_D_PUNTO S0
|
||||
CHECKTYPE REQUIRED
|
||||
WARNING "Codice non presente"
|
||||
HELP "Punto di raccolta per la convocazione"
|
||||
END
|
||||
|
||||
STRING F_D_PUNTO 25
|
||||
BEGIN
|
||||
PROMPT 27 2 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_TIPODON 2
|
||||
BEGIN
|
||||
PROMPT 2 3 "Tipo donazione "
|
||||
FLAGS "U"
|
||||
USE TDN
|
||||
INPUT CODTAB F_D_TIPODON
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_TIPODON CODTAB
|
||||
OUTPUT F_D_TIPODON S0
|
||||
CHECKTYPE REQUIRED
|
||||
VALIDATE NOT_EMPTY_FUNC
|
||||
WARNING "Codice non presente"
|
||||
HELP "Tipo donazione"
|
||||
END
|
||||
|
||||
STRING F_D_TIPODON 25
|
||||
BEGIN
|
||||
PROMPT 27 3 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CODSEZ 2
|
||||
BEGIN
|
||||
PROMPT 2 4 "Sezione "
|
||||
FLAGS "U"
|
||||
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
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Codice sezione da convocare"
|
||||
//ADD MASK at0700a
|
||||
END
|
||||
|
||||
STRING F_DENSEZ 25
|
||||
BEGIN
|
||||
PROMPT 27 4 ""
|
||||
FLAGS "U"
|
||||
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
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Denominazione sezione da convocare"
|
||||
//ADD MASK at0700a
|
||||
END
|
||||
|
||||
STRING F_CODSOT 2
|
||||
BEGIN
|
||||
PROMPT 2 5 "Sottogruppo "
|
||||
FIELD CODSOT
|
||||
COPY ALL F_CODSEZ
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Codice sottogruppo da convocare"
|
||||
//ADD MASK at0700a
|
||||
END
|
||||
|
||||
STRING F_DENSOT 25
|
||||
BEGIN
|
||||
PROMPT 27 5 ""
|
||||
FLAGS "U"
|
||||
COPY USE F_DENSEZ
|
||||
INPUT DENSEZ F_DENSEZ
|
||||
INPUT DENSOT F_DENSOT
|
||||
COPY DISPLAY F_DENSEZ
|
||||
COPY OUTPUT F_DENSEZ
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Sottogruppo da convocare"
|
||||
//ADD MASK at0700a
|
||||
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
|
||||
48
at/at4.cpp
48
at/at4.cpp
@ -1,21 +1,27 @@
|
||||
#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;
|
||||
}
|
||||
#include <xvt.h>
|
||||
#include <strings.h>
|
||||
#include <checks.h>
|
||||
|
||||
#include "at4.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 = at4100(argc,argv) ; break;
|
||||
case 1:
|
||||
rt = at4200(argc,argv) ; break;
|
||||
case 2:
|
||||
rt = at4300(argc,argv) ; break;
|
||||
default:
|
||||
error_box(usage, argv[0]) ; break;
|
||||
}
|
||||
return rt;
|
||||
}
|
||||
|
||||
39
at/at4.url
39
at/at4.url
@ -1,48 +1,25 @@
|
||||
#define APPNAME AVIS
|
||||
#define QAPPNAME "AVIS"
|
||||
#define LIBDIR f:\xvt.403\win_x86\ptk\lib
|
||||
#define QFIRMNAME "AGA Informatica S.r.l."
|
||||
|
||||
#include <default.url>
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at4 -0
|
||||
* ---------------------------------------------------- */
|
||||
/* at4 -0 scadenze di donazione */
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at4 -1
|
||||
* ---------------------------------------------------- */
|
||||
|
||||
/* at4 -1 urgenze */
|
||||
MENUBAR MENU_BAR(1)
|
||||
|
||||
MENU MENU_BAR(1)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at4 -2
|
||||
* ---------------------------------------------------- */
|
||||
|
||||
/* at4 -2 convocazioni per pi— sezioni (parma) */
|
||||
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"
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
|
||||
495
at/at4100.cpp
495
at/at4100.cpp
@ -1,52 +1,59 @@
|
||||
#include <mask.h>
|
||||
#include <form.h>
|
||||
#include <mask.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"
|
||||
#include "at4100b.h"
|
||||
#include "at4100c.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 };
|
||||
enum ts { undefined = 0, elenco = 1, etichette = 2, cartoline = 3 };
|
||||
|
||||
// definizione form per etichette
|
||||
class TSitsan_form : public TForm
|
||||
class TScadenze_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 = "")
|
||||
TScadenze_form(): TForm() {};
|
||||
TScadenze_form(const char* form, const char * code = "", int editlevel = 0, const char* desc = "")
|
||||
: TForm(form,code,editlevel,desc) {};
|
||||
virtual ~TSitsan_form() {};
|
||||
virtual ~TScadenze_form() {};
|
||||
};
|
||||
|
||||
class TSitsan_application : public TPrintapp
|
||||
class TScadenze_application : public TPrintapp
|
||||
{
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TSitsan_form* _form_eti;
|
||||
|
||||
TScadenze_form* _form_eti;
|
||||
TScadenze_form* _form_car;
|
||||
TAssoc_array _categorie;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome;
|
||||
TDate _data_stampa;
|
||||
TDate _dataini, _datafin, _dataultid;
|
||||
bool _usomodo, _usasez;
|
||||
TString16 _giorni;
|
||||
TString16 _procdon, _modo, _ab01, _ab02, _ab03, _rh;
|
||||
ts _tipo_stampa;
|
||||
TString _codsez, _codsot;
|
||||
TString16 _codsez, _codsot, _orario, _datacart;
|
||||
TString80 _invitoper, _data, _presso1, _presso2, _presso3, _presso4;
|
||||
TString80 _note, _intest1, _intest2, _intest3, _intest4;
|
||||
|
||||
bool _usotipo;
|
||||
TString _tipo;
|
||||
long _codmed;
|
||||
|
||||
static bool filter_func_sitsan(const TRelation *);
|
||||
static bool filter_func_scadenze(const TRelation* rel);
|
||||
|
||||
protected:
|
||||
virtual bool user_create();
|
||||
@ -54,45 +61,65 @@ protected:
|
||||
virtual bool set_print(int m);
|
||||
virtual void set_page(int file, int cnt);
|
||||
virtual bool preprocess_page(int file, int counter);
|
||||
ts dati_cartoline();
|
||||
|
||||
public:
|
||||
void crea_intestazione();
|
||||
void filtra_sezioni();
|
||||
void header_sezione(TString codsez, TString codsot);
|
||||
void header_sezione(const TString16 codsez, const TString16 codsot);
|
||||
void dati_sezione(const TString16 codsez, const TString16 codsot);
|
||||
TMask& app_mask() { return *_msk; }
|
||||
TSitsan_application() : _data_stampa(TODAY), _cognome_nome("",25) {}
|
||||
TScadenze_application() : _data_stampa(TODAY), _cognome_nome("",25) {}
|
||||
};
|
||||
|
||||
HIDDEN inline TSitsan_application& app() { return (TSitsan_application&) main_app(); }
|
||||
HIDDEN inline TScadenze_application& app() { return (TScadenze_application&) main_app(); }
|
||||
|
||||
TCursor* TSitsan_form::cursor() const { return app().current_cursor(); }
|
||||
TCursor* TScadenze_form::cursor() const { return app().current_cursor(); }
|
||||
|
||||
TRelation* TSitsan_form::relation() const { return cursor()->relation(); }
|
||||
TRelation* TScadenze_form::relation() const { return cursor()->relation(); }
|
||||
|
||||
void TSitsan_application::filtra_sezioni()
|
||||
ts TScadenze_application::dati_cartoline()
|
||||
{
|
||||
TString sezini = _msk->get(F_SEZINI);
|
||||
TString sotini = _msk->get(F_SOTINI);
|
||||
TString sezfin = _msk->get(F_SEZFIN);
|
||||
TString sotfin = _msk->get(F_SOTFIN);
|
||||
TMask msk("at4100b");
|
||||
if (msk.run() == K_ENTER)
|
||||
{
|
||||
_invitoper = msk.get(F_INVITOPER);
|
||||
_data = msk.get(F_DATA);
|
||||
_presso1 = msk.get(F_PRESSO1);
|
||||
_presso2 = msk.get(F_PRESSO2);
|
||||
_presso3 = msk.get(F_PRESSO3);
|
||||
_presso4 = msk.get(F_PRESSO4);
|
||||
_datacart = msk.get(F_DATACART);
|
||||
_orario = msk.get(F_ORARIO);
|
||||
_note = msk.get(F_NOTE);
|
||||
_usasez = msk.get_bool(F_USASEZ);
|
||||
return cartoline;
|
||||
}
|
||||
else
|
||||
return undefined;
|
||||
}
|
||||
|
||||
void TScadenze_application::filtra_sezioni()
|
||||
{
|
||||
const TString16 sezini = _msk->get(F_SEZINI);
|
||||
const TString16 sotini = _msk->get(F_SOTINI);
|
||||
const TString16 sezfin = _msk->get(F_SEZFIN);
|
||||
const TString16 sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
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()))
|
||||
TRectype da(LF_SOGGETTI);
|
||||
TRectype a(LF_SOGGETTI);
|
||||
if (sezini.not_empty())
|
||||
da.put(SOG_CODSEZ, sezini);
|
||||
if ((sotini.not_empty()) && (sotini.ok()))
|
||||
if (sotini.not_empty())
|
||||
da.put(SOG_CODSOT, sotini);
|
||||
if ((sezfin.not_empty()) && (sezfin.ok()))
|
||||
if (sezfin.not_empty())
|
||||
a.put(SOG_CODSEZ, sezfin);
|
||||
if ((sotfin.not_empty()) && (sotfin.ok()))
|
||||
if (sotfin.not_empty())
|
||||
a.put(SOG_CODSOT, sotfin);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
void TSitsan_application::set_page(int file, int cnt)
|
||||
void TScadenze_application::set_page(int file, int cnt)
|
||||
{
|
||||
// costruzione etichette
|
||||
switch (_tipo_stampa)
|
||||
@ -100,7 +127,54 @@ void TSitsan_application::set_page(int file, int cnt)
|
||||
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 cartoline:
|
||||
{
|
||||
TPrint_section& corpo = _form_car->get_body();
|
||||
const TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
const TString16 codsot = current_cursor()->curr().get(SOG_CODSOT);
|
||||
if ((_codsez!=codsez)||(_codsot!=codsot))
|
||||
{
|
||||
_codsez = codsez;
|
||||
_codsot = codsot;
|
||||
dati_sezione(codsez, codsot);
|
||||
corpo.reset();
|
||||
TForm_item& intest1 = corpo.find_field(CAR_INTEST1);
|
||||
intest1.set(_intest1);
|
||||
TForm_item& intest2 = corpo.find_field(CAR_INTEST2);
|
||||
intest2.set(_intest2);
|
||||
TForm_item& intest3 = corpo.find_field(CAR_INTEST3);
|
||||
intest3.set(_intest3);
|
||||
TForm_item& intest4 = corpo.find_field(CAR_INTEST4);
|
||||
intest4.set(_intest4);
|
||||
TForm_item& invito = corpo.find_field(CAR_INVITOPER);
|
||||
invito.set(_invitoper);
|
||||
TForm_item& data = corpo.find_field(CAR_DATA);
|
||||
data.set(_data);
|
||||
TForm_item& presso1 = corpo.find_field(CAR_PRESSO1);
|
||||
presso1.set(_presso1);
|
||||
TForm_item& presso2 = corpo.find_field(CAR_PRESSO2);
|
||||
presso2.set(_presso2);
|
||||
TForm_item& presso3 = corpo.find_field(CAR_PRESSO3);
|
||||
presso3.set(_presso3);
|
||||
TForm_item& presso4 = corpo.find_field(CAR_PRESSO4);
|
||||
presso4.set(_presso4);
|
||||
TForm_item& orario = corpo.find_field(CAR_ORARIO);
|
||||
orario.set(_orario);
|
||||
TForm_item& datacart = corpo.find_field(CAR_DATACART);
|
||||
datacart.set(_datacart);
|
||||
TForm_item& note = corpo.find_field(CAR_NOTE);
|
||||
note.set(_note);
|
||||
}
|
||||
corpo.update();
|
||||
for (int i = 0; i < corpo.height(); i++)
|
||||
{
|
||||
@ -113,133 +187,137 @@ void TSitsan_application::set_page(int file, int cnt)
|
||||
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));
|
||||
set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"#########"));
|
||||
set_row(1,"@10g@S", FLD(LF_SOGGETTI,SOG_CATDON));
|
||||
set_row(1,"@13g@S", FLD(LF_SOGGETTI,SOG_COGNOME));
|
||||
set_row(1,"@39g@ld", FLD(LF_SOGGETTI,SOG_DATANASC));
|
||||
set_row(1,"@50g@ld", FLD(LF_SOGGETTI,SOG_DATAPROSSI));
|
||||
set_row(1,"@61g@ld", FLD(LF_SOGGETTI,SOG_DATAPROSAF));
|
||||
set_row(1,"@72g@ld", FLD(LF_SOGGETTI,SOG_DATAULTDON));
|
||||
set_row(1,"@83g@ld", FLD(LF_SOGGETTI,SOG_DATAULTID));
|
||||
set_row(1,"@94g@S", FLD(LF_SOGGETTI,SOG_IDON1));
|
||||
set_row(1,"@97g@S", FLD(LF_SOGGETTI,SOG_IDON2));
|
||||
set_row(1,"@100g@S", FLD(LF_SOGGETTI,SOG_GRUPPOAB0));
|
||||
|
||||
set_row(2,"@13g@S", FLD(LF_SOGGETTI,SOG_NOME));
|
||||
set_row(2,"@53g@pn", FLD(LF_SOGGETTI,SOG_INTSI,"###"));
|
||||
set_row(2,"@64g@pn", FLD(LF_SOGGETTI,SOG_INTAF,"###"));
|
||||
set_row(2,"@76g@S", FLD(LF_SOGGETTI,SOG_TIPOULTDON));
|
||||
set_row(2,"@87g@S", FLD(LF_SOGGETTI,SOG_TIPOULTID));
|
||||
set_row(2,"@94g@S", FLD(LF_SOGGETTI,SOG_IDON3));
|
||||
set_row(2,"@97g@S", FLD(LF_SOGGETTI,SOG_IDON4));
|
||||
set_row(2,"@100g@S", FLD(LF_SOGGETTI,SOG_RHANTID));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool TSitsan_application::filter_func_sitsan(const TRelation * rel)
|
||||
bool TScadenze_application::filter_func_scadenze(const TRelation* rel)
|
||||
{
|
||||
|
||||
bool filtrato = TRUE;
|
||||
|
||||
TLocalisamfile* sog = &(rel->lfile(LF_SOGGETTI));
|
||||
|
||||
TAssoc_array categorie;
|
||||
|
||||
TMask& msk = app().app_mask();
|
||||
|
||||
TString cat = msk.get(F_CAT1);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
cat = msk.get(F_CAT2);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
cat = msk.get(F_CAT3);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
cat = msk.get(F_CAT4);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
cat = msk.get(F_CAT5);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
cat = msk.get(F_CAT6);
|
||||
if (cat.not_empty() && cat.ok())
|
||||
categorie.add((const char*) cat);
|
||||
|
||||
TLocalisamfile& sog = rel->lfile();
|
||||
// filtro per categorie
|
||||
TAssoc_array& categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
TString catsog = sog->curr().get(SOG_CATDON);
|
||||
if (categorie.is_key((const char*) catsog))
|
||||
filtrato = TRUE;
|
||||
else
|
||||
filtrato = FALSE;
|
||||
const TString16 cat = sog.get(SOG_CATDON);
|
||||
filtrato = categorie.is_key((const char*) cat);
|
||||
}
|
||||
if (filtrato)
|
||||
// filtro per modalita' di convocazione
|
||||
if (filtrato && app()._usomodo)
|
||||
{
|
||||
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;
|
||||
const TString16 modconv = sog.get(SOG_MODCONV);
|
||||
filtrato = (modconv == app()._modo);
|
||||
}
|
||||
// filtro per data ultima idoneita'
|
||||
if (filtrato && app()._dataultid.ok())
|
||||
{
|
||||
const TDate dataultid = sog.get(SOG_DATAULTID);
|
||||
filtrato = (dataultid >= app()._dataultid);
|
||||
}
|
||||
// filtro per tipizzazione
|
||||
if (filtrato && (app()._ab01.not_empty() || app()._ab02.not_empty() || app()._ab03.not_empty()))
|
||||
{
|
||||
const TString16 ab0 = sog.get(SOG_GRUPPOAB0);
|
||||
filtrato = (ab0 == app()._ab01 || ab0 == app()._ab02 || ab0 == app()._ab03);
|
||||
}
|
||||
if (filtrato && app()._rh.not_empty())
|
||||
{
|
||||
const TString16 rh = sog.get(SOG_RHANTID);
|
||||
filtrato = (rh == app()._rh);
|
||||
}
|
||||
// filtro per data di prossima donazione
|
||||
if (filtrato)
|
||||
{
|
||||
TDate datapross(NULLDATE);
|
||||
if (app()._procdon == IDON_SI)
|
||||
datapross = sog.get(SOG_DATAPROSSI);
|
||||
else
|
||||
datapross = sog.get(SOG_DATAPROSAF);
|
||||
if (datapross.ok())
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (app()._dataini.ok())
|
||||
filtrato = datapross >= app()._dataini;
|
||||
if (filtrato)
|
||||
if (app()._datafin.ok())
|
||||
filtrato = datapross <= app()._datafin;
|
||||
}
|
||||
else
|
||||
filtrato = FALSE;
|
||||
}
|
||||
// filtro per giorno preferito
|
||||
const TString16& giorni = app()._giorni;
|
||||
if (filtrato && giorni != "NNNNNNN")
|
||||
{
|
||||
bool almenoungiorno = FALSE;
|
||||
const TString16 giopredon = sog.get(SOG_GIOPREDON);
|
||||
for (int i = 0; i < giorni.len(); i++)
|
||||
{
|
||||
if (giorni[i] == 'X')
|
||||
almenoungiorno = (almenoungiorno || giopredon[i] == 'X');
|
||||
}
|
||||
filtrato = almenoungiorno;
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TSitsan_application::preprocess_page(int file, int counter)
|
||||
bool TScadenze_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
|
||||
switch (_tipo_stampa)
|
||||
{
|
||||
TString nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
case elenco:
|
||||
{
|
||||
const TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
const TString16 codsot = current_cursor()->curr().get(SOG_CODSOT);
|
||||
TString80 nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
|
||||
// salto pagina se cambio sezione
|
||||
TString codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
TString codsot = current_cursor()->curr().get(SOG_CODSOT);
|
||||
//const TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
//const TString16 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void TSitsan_application::header_sezione(TString codsez, TString codsot)
|
||||
void TScadenze_application::header_sezione(const TString16 codsez, const TString16 codsot)
|
||||
{
|
||||
TString densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
TString densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << codsez;
|
||||
@ -257,7 +335,30 @@ void TSitsan_application::header_sezione(TString codsez, TString codsot)
|
||||
return;
|
||||
}
|
||||
|
||||
bool TSitsan_application::set_print(int m)
|
||||
void TScadenze_application::dati_sezione(const TString16 codsez, const TString16 codsot)
|
||||
{
|
||||
_intest1 = current_cursor()->curr(LF_SEZIONI).get(SEZ_INTESTAZ1);
|
||||
_intest2 = current_cursor()->curr(LF_SEZIONI).get(SEZ_INTESTAZ2);
|
||||
_intest3 = current_cursor()->curr(LF_SEZIONI).get(SEZ_INTESTAZ3);
|
||||
_intest4 = current_cursor()->curr(LF_SEZIONI).get(SEZ_INTESTAZ4);
|
||||
if (_usasez)
|
||||
{
|
||||
if (_presso1.blank())
|
||||
{
|
||||
_presso1 = current_cursor()->curr(LF_SEZIONI).get(SEZ_CONVSEDE1);
|
||||
_presso2 = current_cursor()->curr(LF_SEZIONI).get(SEZ_CONVSEDE2);
|
||||
_presso3 = current_cursor()->curr(LF_SEZIONI).get(SEZ_CONVSEDE3);
|
||||
_presso4 = current_cursor()->curr(LF_SEZIONI).get(SEZ_CONVSEDE4);
|
||||
}
|
||||
if (_orario.blank())
|
||||
_orario = current_cursor()->curr(LF_SEZIONI).get(SEZ_CONVORA);
|
||||
if (_note.blank())
|
||||
_note = current_cursor()->curr(LF_SEZIONI).get(SEZ_CONVNOTE);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
bool TScadenze_application::set_print(int m)
|
||||
{
|
||||
_tipo_stampa = undefined;
|
||||
KEY tasto;
|
||||
@ -266,37 +367,73 @@ bool TSitsan_application::set_print(int m)
|
||||
{
|
||||
case F_ELENCO:
|
||||
_tipo_stampa = elenco;
|
||||
//_codsez.spaces(2);
|
||||
//_codsot.spaces(2);
|
||||
_codsez = "**";
|
||||
_codsot = "**";
|
||||
break;
|
||||
break;
|
||||
case F_ETICHETTE:
|
||||
_tipo_stampa = etichette;
|
||||
break;
|
||||
break;
|
||||
case F_CARTOLINE:
|
||||
_tipo_stampa = dati_cartoline();
|
||||
break;
|
||||
}
|
||||
if (_tipo_stampa != undefined)
|
||||
{
|
||||
_codsez = "**";
|
||||
_codsot = "**";
|
||||
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
|
||||
_dataini = _msk->get(F_DATAINI);
|
||||
_datafin = _msk->get(F_DATAFIN);
|
||||
_dataultid = _msk->get(F_DATAULTID);
|
||||
_procdon = _msk->get(F_PROCDON1);
|
||||
_usomodo = _msk->get_bool(F_USOMODO);
|
||||
_modo = _msk->get(F_MODO);
|
||||
_ab01 = _msk->get(F_AB01);
|
||||
_ab02 = _msk->get(F_AB02);
|
||||
_ab03 = _msk->get(F_AB03);
|
||||
_rh = _msk->get(F_RHANTID);
|
||||
_giorni = "NNNNNNN";
|
||||
if (_msk->get_bool(F_GPD_LUN))
|
||||
_giorni[0] = 'X';
|
||||
if (_msk->get_bool(F_GPD_MAR))
|
||||
_giorni[1] = 'X';
|
||||
if (_msk->get_bool(F_GPD_MER))
|
||||
_giorni[2] = 'X';
|
||||
if (_msk->get_bool(F_GPD_GIO))
|
||||
_giorni[3] = 'X';
|
||||
if (_msk->get_bool(F_GPD_VEN))
|
||||
_giorni[4] = 'X';
|
||||
if (_msk->get_bool(F_GPD_SAB))
|
||||
_giorni[5] = 'X';
|
||||
if (_msk->get_bool(F_GPD_DOM))
|
||||
_giorni[6] = 'X';
|
||||
// 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);
|
||||
// filtro per categorie
|
||||
const TString16 catpri = _msk->get(F_CAT1);
|
||||
const TString16 catsec = _msk->get(F_CAT2);
|
||||
const TString16 catter = _msk->get(F_CAT3);
|
||||
const TString16 catqua = _msk->get(F_CAT4);
|
||||
const TString16 catqui = _msk->get(F_CAT5);
|
||||
const TString16 catses = _msk->get(F_CAT6);
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
_categorie.add((const char*) catpri);
|
||||
if (catsec.not_empty() && catsec.ok())
|
||||
_categorie.add((const char*) catsec);
|
||||
if (catter.not_empty() && catter.ok())
|
||||
_categorie.add((const char*) catter);
|
||||
if (catqua.not_empty() && catqua.ok())
|
||||
_categorie.add((const char*) catqua);
|
||||
if (catqui.not_empty() && catqui.ok())
|
||||
_categorie.add((const char*) catqui);
|
||||
if (catses.not_empty() && catses.ok())
|
||||
_categorie.add((const char*) catses);
|
||||
// filtro per idoneo e non escluso
|
||||
//if (_usomodo)
|
||||
//current_cursor()->setfilter(format("(TCS->S6 == \"I\" || TCS->S6 == \"F\") && (ESCLUSO == \"\") && (MODCONV == \"%s\")",(const char*)_modo), TRUE);
|
||||
//else
|
||||
current_cursor()->setfilter("((TCS->S6 == \"I\" ) || (TCS->S6 == \"F\")) && (ESCLUSO == \"\")", TRUE);
|
||||
// filtro per categorie e altro
|
||||
current_cursor()->set_filterfunction(filter_func_scadenze);
|
||||
reset_print();
|
||||
crea_intestazione();
|
||||
return TRUE;
|
||||
@ -305,26 +442,31 @@ bool TSitsan_application::set_print(int m)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TSitsan_application::crea_intestazione()
|
||||
void TScadenze_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 = "SCADENZE DI DONAZIONE ";
|
||||
TString16 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();
|
||||
TString16 data_stampa = _data_stampa.string();
|
||||
set_header(2,"@0g%10s", (const char*) data_stampa);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
@ -334,22 +476,21 @@ void TSitsan_application::crea_intestazione()
|
||||
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-- -- -- --");
|
||||
set_header(5,"@0gCod.@10gC.@13gCognome@39gNato il@50gData pr.SI@61gData pr.AF@72gData/Tipo@83gData/Tipo@94gIdon.@100gAB0");
|
||||
set_header(6,"@13gNome@50gInterv. SI@61gInterv. AF@72gult. don.@83gult. idon.@94gper@100gRh");
|
||||
set_header(7,"@0g---------@10g--@13g-------------------------@39g----------@50g----------@61g----------@72g----------@83g----------@94g-----");
|
||||
}
|
||||
}
|
||||
|
||||
bool TSitsan_application::user_create()
|
||||
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");
|
||||
_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS);
|
||||
_rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCP);
|
||||
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
|
||||
// per stampare la denominazione della sezione nell'intestazione
|
||||
_rel->add(LF_SEZIONI,"CODSEZ==CODSEZ|CODSOT==CODSOT");
|
||||
_rel->add(LF_CONTSAN,"CODICE==CODICE");
|
||||
|
||||
_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
|
||||
@ -357,25 +498,27 @@ bool TSitsan_application::user_create()
|
||||
|
||||
_msk = new TMask("at4100a");
|
||||
|
||||
_form_eti = new TSitsan_form("AT_ETSOG");
|
||||
|
||||
_form_eti = new TScadenze_form("AT_ETSOG");
|
||||
_form_car = new TScadenze_form("AT_ETCAR");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TSitsan_application::user_destroy()
|
||||
bool TScadenze_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_eti;
|
||||
delete _form_car;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at4100(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TSitsan_application a;
|
||||
TScadenze_application a;
|
||||
|
||||
a.run(argc, argv, "Situazione sanitaria attuale");
|
||||
a.run(argc, argv, "Scadenze di donazione");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
32
at/at4100a.h
32
at/at4100a.h
@ -1,4 +1,4 @@
|
||||
// situazione sanitaria attuale
|
||||
// Scadenze di donazione
|
||||
// definizione campi per maschera di selezione
|
||||
|
||||
#define F_SEZINI 101
|
||||
@ -23,17 +23,25 @@
|
||||
#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_PROCDON1 301
|
||||
//#define F_PROCDON2 302
|
||||
#define F_DATAINI 303
|
||||
#define F_DATAFIN 304
|
||||
#define F_GPD_LUN 305
|
||||
#define F_GPD_MAR 306
|
||||
#define F_GPD_MER 307
|
||||
#define F_GPD_GIO 308
|
||||
#define F_GPD_VEN 309
|
||||
#define F_GPD_SAB 310
|
||||
#define F_GPD_DOM 311
|
||||
#define F_USOMODO 312
|
||||
#define F_MODO 313
|
||||
#define F_DATAULTID 314
|
||||
#define F_AB01 315
|
||||
#define F_AB02 316
|
||||
#define F_AB03 317
|
||||
#define F_RHANTID 318
|
||||
|
||||
#define F_ELENCO 401
|
||||
#define F_ETICHETTE 402
|
||||
#define F_CARTOLINE 403
|
||||
|
||||
235
at/at4100a.uml
235
at/at4100a.uml
@ -4,12 +4,12 @@ PAGE "Definizione Stampe" -1 -1 78 20
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
PROMPT 1 1 "Scelta sezioni/sottogruppi"
|
||||
PROMPT 1 0 "Scelta sezioni/sottogruppi"
|
||||
END
|
||||
|
||||
STRING F_SEZINI 2
|
||||
BEGIN
|
||||
PROMPT 2 2 "Da "
|
||||
PROMPT 2 1 "Da "
|
||||
FLAGS "U"
|
||||
USE LF_SEZIONI
|
||||
INPUT CODSEZ F_SEZINI
|
||||
@ -28,7 +28,7 @@ END
|
||||
|
||||
STRING F_D_SEZINI 25
|
||||
BEGIN
|
||||
PROMPT 11 2 ""
|
||||
PROMPT 11 1 ""
|
||||
FLAGS "U"
|
||||
USE LF_SEZIONI KEY 2
|
||||
INPUT DENSEZ F_D_SEZINI
|
||||
@ -43,7 +43,7 @@ END
|
||||
|
||||
STRING F_SOTINI 2
|
||||
BEGIN
|
||||
PROMPT 2 3 " "
|
||||
PROMPT 2 2 " "
|
||||
COPY ALL F_SEZINI
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Codice sottogruppo da cui partire"
|
||||
@ -51,7 +51,7 @@ END
|
||||
|
||||
STRING F_D_SOTINI 25
|
||||
BEGIN
|
||||
PROMPT 11 3 ""
|
||||
PROMPT 11 2 ""
|
||||
FLAGS "U"
|
||||
COPY USE F_D_SEZINI
|
||||
INPUT DENSEZ F_D_SEZINI
|
||||
@ -64,7 +64,7 @@ END
|
||||
|
||||
STRING F_SEZFIN 2
|
||||
BEGIN
|
||||
PROMPT 41 2 "A "
|
||||
PROMPT 41 1 "A "
|
||||
FLAGS "U"
|
||||
USE LF_SEZIONI
|
||||
INPUT CODSEZ F_SEZFIN
|
||||
@ -83,7 +83,7 @@ END
|
||||
|
||||
STRING F_D_SEZFIN 25
|
||||
BEGIN
|
||||
PROMPT 49 2 ""
|
||||
PROMPT 49 1 ""
|
||||
FLAGS "U"
|
||||
USE LF_SEZIONI KEY 2
|
||||
INPUT DENSEZ F_D_SEZFIN
|
||||
@ -98,7 +98,7 @@ END
|
||||
|
||||
STRING F_SOTFIN 2
|
||||
BEGIN
|
||||
PROMPT 41 3 " "
|
||||
PROMPT 41 2 " "
|
||||
COPY ALL F_SEZFIN
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Codice sottogruppo finale"
|
||||
@ -106,7 +106,7 @@ END
|
||||
|
||||
STRING F_D_SOTFIN 25
|
||||
BEGIN
|
||||
PROMPT 49 3 ""
|
||||
PROMPT 49 2 ""
|
||||
FLAGS "U"
|
||||
COPY USE F_D_SEZFIN
|
||||
INPUT DENSEZ F_D_SEZFIN
|
||||
@ -119,13 +119,13 @@ END
|
||||
|
||||
GROUPBOX DLG_NULL 77 5
|
||||
BEGIN
|
||||
PROMPT 1 5 "Categorie"
|
||||
PROMPT 1 4 "Categorie"
|
||||
END
|
||||
|
||||
|
||||
STRING F_CAT1 2
|
||||
BEGIN
|
||||
PROMPT 2 6 ""
|
||||
PROMPT 2 5 ""
|
||||
FLAGS "U"
|
||||
USE CTD
|
||||
INPUT CODTAB F_CAT1
|
||||
@ -140,13 +140,13 @@ END
|
||||
|
||||
STRING F_D_CAT1 30
|
||||
BEGIN
|
||||
PROMPT 8 6 ""
|
||||
PROMPT 8 5 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT2 2
|
||||
BEGIN
|
||||
PROMPT 2 7 ""
|
||||
PROMPT 2 6 ""
|
||||
FLAGS "U"
|
||||
USE CTD
|
||||
INPUT CODTAB F_CAT2
|
||||
@ -160,13 +160,13 @@ END
|
||||
|
||||
STRING F_D_CAT2 30
|
||||
BEGIN
|
||||
PROMPT 8 7 ""
|
||||
PROMPT 8 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT3 2
|
||||
BEGIN
|
||||
PROMPT 2 8 ""
|
||||
PROMPT 2 7 ""
|
||||
FLAGS "U"
|
||||
USE CTD
|
||||
INPUT CODTAB F_CAT3
|
||||
@ -180,13 +180,13 @@ END
|
||||
|
||||
STRING F_D_CAT3 30
|
||||
BEGIN
|
||||
PROMPT 8 8 ""
|
||||
PROMPT 8 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT4 2
|
||||
BEGIN
|
||||
PROMPT 40 6 ""
|
||||
PROMPT 40 5 ""
|
||||
FLAGS "U"
|
||||
USE CTD
|
||||
INPUT CODTAB F_CAT4
|
||||
@ -200,13 +200,13 @@ END
|
||||
|
||||
STRING F_D_CAT4 30
|
||||
BEGIN
|
||||
PROMPT 46 6 ""
|
||||
PROMPT 46 5 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT5 2
|
||||
BEGIN
|
||||
PROMPT 40 7 ""
|
||||
PROMPT 40 6 ""
|
||||
FLAGS "U"
|
||||
USE CTD
|
||||
INPUT CODTAB F_CAT5
|
||||
@ -220,13 +220,13 @@ END
|
||||
|
||||
STRING F_D_CAT5 30
|
||||
BEGIN
|
||||
PROMPT 46 7 ""
|
||||
PROMPT 46 6 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
STRING F_CAT6 2
|
||||
BEGIN
|
||||
PROMPT 40 8 ""
|
||||
PROMPT 40 7 ""
|
||||
FLAGS "U"
|
||||
USE CTD
|
||||
INPUT CODTAB F_CAT6
|
||||
@ -240,131 +240,122 @@ END
|
||||
|
||||
STRING F_D_CAT6 30
|
||||
BEGIN
|
||||
PROMPT 46 8 ""
|
||||
PROMPT 46 7 ""
|
||||
FLAGS "D"
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
GROUPBOX DLG_NULL 50 8
|
||||
BEGIN
|
||||
PROMPT 1 10 "Situazione sanitaria"
|
||||
PROMPT 1 9 "Opzioni di convocazione"
|
||||
END
|
||||
|
||||
BOOLEAN F_USOTIPO
|
||||
LISTBOX F_PROCDON1 17
|
||||
BEGIN
|
||||
PROMPT 2 11 "Seleziona Tipo/Esito "
|
||||
MESSAGE TRUE ENABLE,F_TIPO
|
||||
MESSAGE FALSE RESET,F_TIPO|DISABLE,F_TIPO
|
||||
PROMPT 2 10 "Procedura di donazione "
|
||||
#include "procdon.h"
|
||||
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
|
||||
//LISTBOX F_PROCDON2 17
|
||||
//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"
|
||||
// PROMPT 50 10 ""
|
||||
// #include "procdon.h"
|
||||
//END
|
||||
|
||||
DATE F_DATAINI
|
||||
BEGIN
|
||||
PROMPT 2 12 "Data iniziale "
|
||||
PROMPT 2 11 "Data prossima don. da "
|
||||
END
|
||||
|
||||
DATE F_DATAFIN
|
||||
BEGIN
|
||||
PROMPT 35 12 "Data finale "
|
||||
PROMPT 37 11 "a "
|
||||
END
|
||||
|
||||
GROUPBOX DLG_NULL 77 3
|
||||
TEXT DLG_NULL
|
||||
BEGIN
|
||||
PROMPT 1 14 "Medico di base"
|
||||
PROMPT 2 12 "Giorni: Lu Ma Me Gi Ve Sa Do"
|
||||
END
|
||||
|
||||
NUMBER F_CODMED 6
|
||||
BOOLEAN F_GPD_LUN
|
||||
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"
|
||||
PROMPT 12 13 ""
|
||||
END
|
||||
|
||||
STRING F_COGNMED 25
|
||||
BOOLEAN F_GPD_MAR
|
||||
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"
|
||||
PROMPT 16 13 ""
|
||||
END
|
||||
|
||||
STRING F_NOMMED 25
|
||||
BOOLEAN F_GPD_MER
|
||||
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"
|
||||
PROMPT 20 13 ""
|
||||
END
|
||||
|
||||
BOOLEAN F_GPD_GIO
|
||||
BEGIN
|
||||
PROMPT 24 13 ""
|
||||
END
|
||||
|
||||
BOOLEAN F_GPD_VEN
|
||||
BEGIN
|
||||
PROMPT 28 13 ""
|
||||
END
|
||||
|
||||
BOOLEAN F_GPD_SAB
|
||||
BEGIN
|
||||
PROMPT 32 13 ""
|
||||
END
|
||||
|
||||
BOOLEAN F_GPD_DOM
|
||||
BEGIN
|
||||
PROMPT 36 13 ""
|
||||
END
|
||||
|
||||
BOOLEAN F_USOMODO
|
||||
BEGIN
|
||||
PROMPT 2 14 "Uso modalita' 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
|
||||
|
||||
|
||||
@ -375,19 +366,25 @@ END
|
||||
|
||||
BUTTON F_ELENCO 9 2
|
||||
BEGIN
|
||||
PROMPT -13 18 "Elenco"
|
||||
PROMPT -14 18 "Elenco"
|
||||
MESSAGE EXIT,F_ELENCO
|
||||
END
|
||||
|
||||
BUTTON F_ETICHETTE 9 2
|
||||
BEGIN
|
||||
PROMPT -23 18 "Etichette"
|
||||
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 -33 18 ""
|
||||
PROMPT -44 18 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
13
at/at4100b.h
Executable file
13
at/at4100b.h
Executable file
@ -0,0 +1,13 @@
|
||||
// stampa cartoline
|
||||
// definizione campi per maschera
|
||||
|
||||
#define F_INVITOPER 101
|
||||
#define F_DATA 102
|
||||
#define F_PRESSO1 103
|
||||
#define F_PRESSO2 104
|
||||
#define F_PRESSO3 105
|
||||
#define F_PRESSO4 106
|
||||
#define F_ORARIO 107
|
||||
#define F_DATACART 108
|
||||
#define F_NOTE 109
|
||||
#define F_USASEZ 110
|
||||
71
at/at4100b.uml
Executable file
71
at/at4100b.uml
Executable file
@ -0,0 +1,71 @@
|
||||
#include "at4100b.h"
|
||||
#include "lf.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
|
||||
BUTTON DLG_OK 10 2
|
||||
BEGIN
|
||||
PROMPT -12 -11 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_CANCEL 10 2
|
||||
BEGIN
|
||||
PROMPT -22 -11 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Stampa cartoline" -1 -1 78 20
|
||||
|
||||
STRING F_INVITOPER 25
|
||||
BEGIN
|
||||
PROMPT 2 5 "Invito per "
|
||||
END
|
||||
|
||||
STRING F_DATA 25
|
||||
BEGIN
|
||||
PROMPT 2 6 "Data "
|
||||
END
|
||||
|
||||
STRING F_PRESSO1 25
|
||||
BEGIN
|
||||
PROMPT 2 7 "Presso "
|
||||
END
|
||||
|
||||
STRING F_PRESSO2 25
|
||||
BEGIN
|
||||
PROMPT 2 8 " "
|
||||
END
|
||||
|
||||
STRING F_PRESSO3 25
|
||||
BEGIN
|
||||
PROMPT 2 9 " "
|
||||
END
|
||||
|
||||
STRING F_PRESSO4 25
|
||||
BEGIN
|
||||
PROMPT 2 10 " "
|
||||
END
|
||||
|
||||
STRING F_ORARIO 14
|
||||
BEGIN
|
||||
PROMPT 2 11 "Orario "
|
||||
END
|
||||
|
||||
DATE F_DATACART
|
||||
BEGIN
|
||||
PROMPT 2 12 "Data cart. "
|
||||
END
|
||||
|
||||
STRING F_NOTE 25
|
||||
BEGIN
|
||||
PROMPT 2 13 "Note "
|
||||
END
|
||||
|
||||
BOOLEAN F_USASEZ
|
||||
BEGIN
|
||||
PROMPT 2 14 "Usa dati cartolina della sezione"
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
||||
15
at/at4100c.h
Executable file
15
at/at4100c.h
Executable file
@ -0,0 +1,15 @@
|
||||
// definizione campi di stampa cartoline
|
||||
|
||||
#define CAR_INVITOPER 10
|
||||
#define CAR_DATA 11
|
||||
#define CAR_PRESSO1 12
|
||||
#define CAR_PRESSO2 13
|
||||
#define CAR_PRESSO3 14
|
||||
#define CAR_PRESSO4 15
|
||||
#define CAR_ORARIO 16
|
||||
#define CAR_DATACART 17
|
||||
#define CAR_NOTE 18
|
||||
#define CAR_INTEST1 19
|
||||
#define CAR_INTEST2 20
|
||||
#define CAR_INTEST3 21
|
||||
#define CAR_INTEST4 22
|
||||
356
at/at4200.cpp
Executable file
356
at/at4200.cpp
Executable file
@ -0,0 +1,356 @@
|
||||
#include <form.h>
|
||||
#include <mask.h>
|
||||
#include <printapp.h>
|
||||
|
||||
#include "lf.h"
|
||||
#include "soggetti.h"
|
||||
#include "sezioni.h"
|
||||
#include <comuni.h>
|
||||
|
||||
#include "at4.h"
|
||||
#include "at4200a.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* rel);
|
||||
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TUrgenze_form* _form_eti;
|
||||
TRectype* _sangue;
|
||||
TAssoc_array _categorie;
|
||||
long _giorni;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TParagraph_string _cognome_nome, _dencom;
|
||||
|
||||
TDate _data_stampa;
|
||||
TDate _dataini, _datafin;
|
||||
ts _tipo_stampa;
|
||||
TString16 _codsez, _codsot;
|
||||
|
||||
|
||||
protected:
|
||||
virtual bool user_create();
|
||||
virtual bool user_destroy();
|
||||
virtual bool set_print(int m);
|
||||
virtual void set_page(int file, int cnt);
|
||||
virtual bool preprocess_page (int file, int counter);
|
||||
|
||||
public:
|
||||
void crea_intestazione();
|
||||
void filtra_sezioni();
|
||||
void header_sezione(const TString16 codsez, const TString16 codsot);
|
||||
TMask& app_mask() { return *_msk; }
|
||||
TRectype& get_sangue() { return *_sangue; }
|
||||
|
||||
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()
|
||||
{
|
||||
const TString16 sezini = _msk->get(F_SEZINI);
|
||||
const TString16 sotini = _msk->get(F_SOTINI);
|
||||
const TString16 sezfin = _msk->get(F_SEZFIN);
|
||||
const TString16 sotfin = _msk->get(F_SOTFIN);
|
||||
select_cursor(_cur4);
|
||||
TRectype da(LF_SOGGETTI);
|
||||
TRectype a(LF_SOGGETTI);
|
||||
if (sezini.not_empty())
|
||||
da.put(SOG_CODSEZ, sezini);
|
||||
if (sotini.not_empty())
|
||||
da.put(SOG_CODSOT, sotini);
|
||||
if (sezfin.not_empty())
|
||||
a.put(SOG_CODSEZ, sezfin);
|
||||
if (sotfin.not_empty())
|
||||
a.put(SOG_CODSOT, sotfin);
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
|
||||
void 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_DOM_INDIR));
|
||||
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();
|
||||
//filtro per categorie
|
||||
TAssoc_array& categorie = app()._categorie;
|
||||
if (categorie.items() != 0)
|
||||
{
|
||||
const TString16 cat = sog.get(SOG_CATDON);
|
||||
filtrato = categorie.is_key((const char*) cat);
|
||||
}
|
||||
// filtro per tipizzazione
|
||||
if (filtrato)
|
||||
{
|
||||
TRectype from = app().get_sangue();
|
||||
filtrato = (sog.curr()==from);
|
||||
}
|
||||
// filtro su data donazione
|
||||
if (filtrato)
|
||||
{
|
||||
const long giorni_sez = rel->lfile(LF_SEZIONI).get_long(SEZ_INTMINCONV);
|
||||
const long giorni = (giorni_sez > app()._giorni) ? giorni_sez : app()._giorni;
|
||||
TDate data(TODAY);
|
||||
data = data - (const long) giorni;
|
||||
const TDate dataultdon = sog.get(SOG_DATAULTDON);
|
||||
filtrato = (dataultdon <= data);
|
||||
}
|
||||
return filtrato;
|
||||
}
|
||||
|
||||
bool TUrgenze_application::preprocess_page(int file, int counter)
|
||||
{
|
||||
// contatore soggetti stampati
|
||||
// per ora non c'è
|
||||
if (_tipo_stampa == elenco)
|
||||
{
|
||||
TString80 nome = current_cursor()->curr().get(SOG_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(SOG_NOME);
|
||||
_cognome_nome = nome;
|
||||
TString256 localita = "";
|
||||
localita << current_cursor()->curr(-ALIAS_LCP).get("S6");
|
||||
if (localita.not_empty() && localita.ok())
|
||||
{
|
||||
localita << " ";
|
||||
localita << current_cursor()->curr(-ALIAS_LCP).get("S0");
|
||||
localita << " - ";
|
||||
}
|
||||
else
|
||||
{
|
||||
localita = current_cursor()->curr(LF_COMUNI).get(COM_CAPCOM);
|
||||
localita << " ";
|
||||
}
|
||||
localita << current_cursor()->curr(LF_COMUNI).get(COM_DENCOM);
|
||||
localita.trim();
|
||||
_dencom = localita;
|
||||
|
||||
// salto pagina se cambio sezione
|
||||
const TString16 codsez = current_cursor()->curr().get(SOG_CODSEZ);
|
||||
const TString16 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 TUrgenze_application::header_sezione(const TString16 codsez, const TString16 codsot)
|
||||
{
|
||||
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << codsez;
|
||||
intestazione << "/";
|
||||
intestazione << codsot;
|
||||
intestazione << " ";
|
||||
intestazione << densez;
|
||||
if ((densot.ok())&& (densot.not_empty()))
|
||||
{
|
||||
intestazione << "/";
|
||||
intestazione << densot;
|
||||
}
|
||||
intestazione.center_just();
|
||||
set_header(1,"@0g%s", (const char*) intestazione);
|
||||
return;
|
||||
}
|
||||
|
||||
bool TUrgenze_application::set_print(int)
|
||||
{
|
||||
_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;
|
||||
break;
|
||||
}
|
||||
if (_tipo_stampa != undefined)
|
||||
{
|
||||
reset_files();
|
||||
add_file(LF_SOGGETTI);
|
||||
filtra_sezioni();
|
||||
// filtro per categorie
|
||||
const TString16 catpri = _msk->get(F_CAT1);
|
||||
const TString16 catsec = _msk->get(F_CAT2);
|
||||
const TString16 catter = _msk->get(F_CAT3);
|
||||
const TString16 catqua = _msk->get(F_CAT4);
|
||||
const TString16 catqui = _msk->get(F_CAT5);
|
||||
const TString16 catses = _msk->get(F_CAT6);
|
||||
if (catpri.not_empty() && catpri.ok())
|
||||
_categorie.add((const char*) catpri);
|
||||
if (catsec.not_empty() && catsec.ok())
|
||||
_categorie.add((const char*) catsec);
|
||||
if (catter.not_empty() && catter.ok())
|
||||
_categorie.add((const char*) catter);
|
||||
if (catqua.not_empty() && catqua.ok())
|
||||
_categorie.add((const char*) catqua);
|
||||
if (catqui.not_empty() && catqui.ok())
|
||||
_categorie.add((const char*) catqui);
|
||||
if (catses.not_empty() && catses.ok())
|
||||
_categorie.add((const char*) catses);
|
||||
// filtro per tipizzazione
|
||||
_sangue->zero();
|
||||
const TString16 gruppoab0 = _msk->get(F_GRUPPOAB0);
|
||||
const TString16 rhantid = _msk->get(F_RHANTID);
|
||||
const TString16 kell = _msk->get(F_KELL);
|
||||
const TString16 fenotiporh = _msk->get(F_FENOTIPORH);
|
||||
const TString16 du = _msk->get(F_DU);
|
||||
if ((gruppoab0.ok()) && (gruppoab0.not_empty()))
|
||||
_sangue->put(SOG_GRUPPOAB0, gruppoab0);
|
||||
if ((rhantid.ok()) && (rhantid.not_empty()))
|
||||
_sangue->put(SOG_RHANTID, rhantid);
|
||||
if ((kell.ok()) && (kell.not_empty()))
|
||||
_sangue->put(SOG_KELL, kell);
|
||||
if ((fenotiporh.ok()) && (fenotiporh.not_empty()))
|
||||
_sangue->put(SOG_FENOTIPORH, fenotiporh);
|
||||
if ((du.ok()) && (du.not_empty()))
|
||||
_sangue->put(SOG_DU, du);
|
||||
_giorni = _msk->get_long(F_GIORNI);
|
||||
// filtra solo idonei
|
||||
current_cursor()->setfilter("TCS->S6 == \"I\"", TRUE);
|
||||
// filtra per categorie, 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);
|
||||
TString16 data_stampa = _data_stampa.string();
|
||||
set_header(2,"@0g%10s", (const char*) data_stampa);
|
||||
sep = "";
|
||||
sep << "Pag. @#";
|
||||
set_header(2, "@120g%s", (const char*) sep);
|
||||
|
||||
sep = "";
|
||||
sep.fill('-');
|
||||
set_header(3, (const char *) sep);
|
||||
|
||||
set_header(4,"@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==DOM_CODLOC",1,0,ALIAS_LCP);
|
||||
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
|
||||
// per stampare nell'intestazione la denominazione della sezione
|
||||
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
|
||||
|
||||
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
|
||||
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
|
||||
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
|
||||
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
|
||||
|
||||
_form_eti = new TUrgenze_form("AT_ETSOG");
|
||||
_msk = new TMask("at4200a");
|
||||
_sangue = new TRectype(LF_SOGGETTI);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TUrgenze_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_eti;
|
||||
delete _sangue;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at4200(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TUrgenze_application a;
|
||||
|
||||
a.run(argc, argv, "Urgenze");
|
||||
|
||||
return 0;
|
||||
}
|
||||
37
at/at4200a.h
Executable file
37
at/at4200a.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/at4200a.uml
Executable file
335
at/at4200a.uml
Executable file
@ -0,0 +1,335 @@
|
||||
#include "at4200a.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
|
||||
445
at/at4300.cpp
Executable file
445
at/at4300.cpp
Executable file
@ -0,0 +1,445 @@
|
||||
#include <form.h>
|
||||
#include <mask.h>
|
||||
#include <msksheet.h>
|
||||
#include <printapp.h>
|
||||
|
||||
#include "lf.h"
|
||||
#include "soggetti.h"
|
||||
#include "sezioni.h"
|
||||
|
||||
#include "at4.h"
|
||||
#include "at4300a.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
|
||||
// tpi di stampa
|
||||
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* rel);
|
||||
|
||||
TRelation* _rel;
|
||||
TMask* _msk;
|
||||
TConv_form* _form_eti; // per etichette
|
||||
TConv_form* _form_car; // per cartoline
|
||||
TAssoc_array _asezioni;
|
||||
|
||||
int _cur1, _cur2, _cur3, _cur4;
|
||||
TDate _data_stampa;
|
||||
|
||||
int _sez_corrente;
|
||||
ts _tipo_stampa;
|
||||
bool _intesta;
|
||||
|
||||
// completare con tutti i dati selezionabili
|
||||
TString16 _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);
|
||||
|
||||
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();
|
||||
const TDate dataprossi = sog.get_date(SOG_DATAPROSSI);
|
||||
const char stato = rel->curr(-ALIAS_TABTCS).get_char("S6");
|
||||
const bool dimesso = rel->curr(-ALIAS_TABCTD).get_char("B0");
|
||||
//TDate dataultconv = sog.curr().get_date(SOG_DATAULTCONV);
|
||||
if (dataprossi.ok())
|
||||
{
|
||||
// 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
|
||||
TString16 _giorno = row.get();
|
||||
_intmin = row.get_int();
|
||||
_intmax = row.get_int();
|
||||
// deve diventare un membro
|
||||
TString16 _tipoconv = row.get();
|
||||
|
||||
select_cursor(_cur4);
|
||||
TRectype da(LF_SOGGETTI);
|
||||
TRectype a(LF_SOGGETTI);
|
||||
da.zero();
|
||||
a.zero('Z');
|
||||
if (_codsez.not_empty())
|
||||
{
|
||||
da.put(SOG_CODSEZ, _codsez);
|
||||
a.put(SOG_CODSEZ, _codsez);
|
||||
}
|
||||
if (_codsot.not_empty())
|
||||
{
|
||||
da.put(SOG_CODSOT, _codsot);
|
||||
a.put(SOG_CODSOT, _codsot);
|
||||
}
|
||||
current_cursor()->freeze(FALSE);
|
||||
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);
|
||||
TString16 codice = row.get(0);
|
||||
TString16 codsot = row.get();
|
||||
codice << codsot;
|
||||
if (codice.not_empty())
|
||||
_asezioni.add(codice);
|
||||
}
|
||||
_tipo_stampa = undefined;
|
||||
KEY tasto;
|
||||
tasto = _msk->run();
|
||||
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()
|
||||
{
|
||||
const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
|
||||
const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
|
||||
TString intestazione(132);
|
||||
intestazione = "Sezione: ";
|
||||
intestazione << _codsez;
|
||||
intestazione << "/";
|
||||
intestazione << _codsot;
|
||||
intestazione << " ";
|
||||
intestazione << densez;
|
||||
if ((densot.ok())&& (densot.not_empty()))
|
||||
{
|
||||
intestazione << "/";
|
||||
intestazione << densot;
|
||||
}
|
||||
intestazione.center_just();
|
||||
set_header(1,"@0g%s", (const char*) intestazione);
|
||||
|
||||
intestazione = "ELENCO CONVOCATI PER IL ";
|
||||
intestazione << _dataconv.string();
|
||||
intestazione.center_just();
|
||||
set_header(2, "@0g%s", (const char*) intestazione);
|
||||
TString16 data_stampa = _data_stampa.string();
|
||||
set_header(2,"@0g%10s", (const char*) data_stampa);
|
||||
intestazione = "";
|
||||
intestazione << "Pag. @#";
|
||||
set_header(2, "@120g%s", (const char*) intestazione);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
bool TConv_application::user_create()
|
||||
{
|
||||
_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==DOM_CODLOC", 1, 0, ALIAS_TABLCP); // per verificare che sia DONATORE NON DIMESSO
|
||||
_rel->add(LF_COMUNI, "COM==DOM_CODCOM");
|
||||
_rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT");
|
||||
|
||||
_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice
|
||||
_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome
|
||||
_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice
|
||||
_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome
|
||||
|
||||
_msk = new TMask("at4300a");
|
||||
TSheet_field& sc = (TSheet_field&)_msk->field(F_CONVOCAZIONI);
|
||||
sc.set_notify(convocazioni_notify);
|
||||
_form_eti = new TConv_form("AT_ETSOG");
|
||||
_form_car = new TConv_form("AT_CARTO");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TConv_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_eti;
|
||||
delete _form_car;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TConv_application::check_sez_sheet(const char* codice)
|
||||
{
|
||||
TAssoc_array& sez = app()._asezioni;
|
||||
if (sez.is_key(codice))
|
||||
return FALSE;
|
||||
else
|
||||
{
|
||||
sez.add(codice);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool TConv_application::convocazioni_notify(TSheet_field& s, int r, KEY k)
|
||||
{
|
||||
bool ok = TRUE;
|
||||
switch (k)
|
||||
{
|
||||
case K_TAB:
|
||||
// entrata riga
|
||||
{
|
||||
TToken_string& row = s.row(r);
|
||||
TString16 codice = row.get(0);
|
||||
TString16 codsot = row.get();
|
||||
codice << codsot;
|
||||
if (codice.not_empty())
|
||||
{
|
||||
TAssoc_array& array_sez = app()._asezioni;
|
||||
if (array_sez.is_key(codice))
|
||||
array_sez.remove(codice);
|
||||
}
|
||||
if ((r == s.items()-1) && (r == s.first_empty()))
|
||||
{
|
||||
add_rows_convocazioni(s,8,r+1);
|
||||
s.select(r);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case K_CTRL+K_TAB:
|
||||
// uscita riga
|
||||
{
|
||||
TToken_string& row = s.row(r);
|
||||
TString16 codice = row.get(0);
|
||||
TString16 codsot = row.get();
|
||||
codice << codsot;
|
||||
if (codice.not_empty())
|
||||
{
|
||||
ok = check_sez_sheet(codice);
|
||||
if (!ok)
|
||||
return s.error_box("Sezione già convocata");
|
||||
}
|
||||
if ((r == s.items()-1) && (r == s.first_empty()))
|
||||
{
|
||||
add_rows_convocazioni(s,8,r+1);
|
||||
s.select(r);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
int at4300(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TConv_application a;
|
||||
|
||||
a.run(argc, argv, "Convocazioni Parma");
|
||||
|
||||
return 0;
|
||||
}
|
||||
18
at/at4300a.h
Executable file
18
at/at4300a.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/at4300a.uml
Executable file
173
at/at4300a.uml
Executable file
@ -0,0 +1,173 @@
|
||||
#include "at4300a.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
|
||||
38
at/at5.url
38
at/at5.url
@ -1,21 +1,43 @@
|
||||
#define APPNAME AVIS
|
||||
#define QAPPNAME "AVIS"
|
||||
#define LIBDIR f:\xvt.403\win_x86\ptk\lib
|
||||
#define QFIRMNAME "AGA Informatica S.r.l."
|
||||
|
||||
#include <default.url>
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at5 -0
|
||||
* ---------------------------------------------------- */
|
||||
/* at5 -0 */
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* ----------------------------------------------------
|
||||
* at5 -1
|
||||
* ---------------------------------------------------- */
|
||||
|
||||
/* at5 -1 */
|
||||
MENUBAR MENU_BAR(1)
|
||||
|
||||
MENU MENU_BAR(1)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
|
||||
/* at5 -2 */
|
||||
MENUBAR MENU_BAR(2)
|
||||
|
||||
MENU MENU_BAR(2)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* at5 -3 */
|
||||
MENUBAR MENU_BAR(3)
|
||||
|
||||
MENU MENU_BAR(3)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* at5 -4 */
|
||||
MENUBAR MENU_BAR(4)
|
||||
|
||||
MENU MENU_BAR(4)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
/* at5 -5 */
|
||||
MENUBAR MENU_BAR(5)
|
||||
|
||||
MENU MENU_BAR(5)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
|
||||
310
at/at5100.cpp
310
at/at5100.cpp
@ -1,155 +1,155 @@
|
||||
// trasferimenti
|
||||
|
||||
#include <applicat.h>
|
||||
#include <config.h>
|
||||
#include <mask.h>
|
||||
#include <relation.h>
|
||||
#include <urldefid.h>
|
||||
|
||||
#include "atfield.cpp"
|
||||
#include "lf.h"
|
||||
|
||||
// nomi delle variabili in .ini per i campi
|
||||
#define FIELD "FIELD"
|
||||
#define LEN "LEN"
|
||||
#define DEC "DEC"
|
||||
#define FLAGS "FLAGS"
|
||||
|
||||
// nomi delle variabili in .ini per HEADER
|
||||
#define HEADER "HEADER"
|
||||
#define NOMEFILE "NOMEFILE"
|
||||
#define LUNGHEZZA "LUNGHEZZA"
|
||||
#define RECORDSEP "RECORDSEP"
|
||||
#define FIELDSEP "FIELDSEP"
|
||||
|
||||
class TTransfer_app : public TApplication
|
||||
{
|
||||
TMask* _msk;
|
||||
TRelation* _rel;
|
||||
|
||||
protected:
|
||||
virtual bool create();
|
||||
virtual bool destroy();
|
||||
virtual bool menu(MENU_TAG m) ;
|
||||
virtual TMask& get_mask() { return *_msk; }
|
||||
virtual TRelation* get_relation() const { return _rel; }
|
||||
virtual void scarica();
|
||||
|
||||
public:
|
||||
TTransfer_app() {}
|
||||
|
||||
};
|
||||
|
||||
HIDDEN inline TTransfer_app& app() { return (TTransfer_app&) main_app(); }
|
||||
|
||||
bool TTransfer_app::create()
|
||||
{
|
||||
_msk = new TMask("at5100a");
|
||||
_rel = new TRelation(LF_SOGGETTI);
|
||||
|
||||
/*
|
||||
_rel->add("CTD", "CODTAB==CATDON",1,0,ALIAS_CTD);
|
||||
_donaz = new TLocalisamfile(LF_DONAZ);
|
||||
_contsan = new TLocalisamfile(LF_CONTSAN);
|
||||
_sdonazioni = new TRecord_array(LF_DONAZ,DON_PROGDON);
|
||||
_scontrolli = new TRecord_array(LF_CONTSAN,CON_PROGCON);
|
||||
_asoggetti = new TAssoc_array();
|
||||
|
||||
_msk->set_handler(F_INS_CONTROLLI,ins_controlli_handler);
|
||||
TSheet_field& ss = (TSheet_field&)_msk->field(F_SOGGETTI);
|
||||
ss.set_notify(soggetti_notify);
|
||||
|
||||
//ss.sheet_mask().set_handler(F_S_CODICE,codice_handler);
|
||||
ss.sheet_mask().set_handler(F_S_NOME,nome_handler);
|
||||
*/
|
||||
|
||||
dispatch_e_menu(BAR_ITEM(1));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TTransfer_app::destroy()
|
||||
{
|
||||
delete _rel;
|
||||
delete _msk;
|
||||
/*
|
||||
delete _donaz;
|
||||
delete _contsan;
|
||||
delete _sdonazioni;
|
||||
delete _scontrolli;
|
||||
delete _asoggetti;
|
||||
*/
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TTransfer_app::menu(MENU_TAG m)
|
||||
{
|
||||
TMask& msk = get_mask();
|
||||
const TDate oggi(TODAY);
|
||||
KEY tasto;
|
||||
do
|
||||
{
|
||||
tasto = msk.run();
|
||||
switch (tasto)
|
||||
{
|
||||
case K_ESC: // annulla
|
||||
msk.reset();
|
||||
break;
|
||||
case K_ENTER: // registra
|
||||
{
|
||||
TTransfer_app::scarica();
|
||||
msk.reset();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (tasto != K_QUIT);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TTransfer_app::scarica()
|
||||
{
|
||||
|
||||
TArray arr_exprs; // array delle TExpr corrispondenti ai campi da scaricare
|
||||
TArray arr_fields; // array dei TField_text (campi indicati in .ini)
|
||||
|
||||
TConfig ini("esporta.ini");
|
||||
TString_array campi;
|
||||
int i = ini.list_paragraphs(campi);
|
||||
int poshead = campi.find("HEADER");
|
||||
campi.remove(poshead,TRUE);
|
||||
for ( int k = 0; k < campi.items(); k++ )
|
||||
{
|
||||
const char* campo = campi.row(k);
|
||||
TString_array vl;
|
||||
int i = ini.list_variables(vl, TRUE, campo);
|
||||
//for ( int j = 0; j < vl.items(); j++ )
|
||||
int pos = vl.find(FIELD);
|
||||
TExpr* espressione = vl.row(pos).get(1);
|
||||
arr_exprs.add(espressione)
|
||||
TToken_string variabile = vl.row(pos);
|
||||
int pos = vl.find(LEN);
|
||||
TToken_string variabile = vl.row(pos);
|
||||
int pos = vl.find(DEC);
|
||||
TToken_string variabile = vl.row(pos);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
TText_field campo()
|
||||
|
||||
arr_fields.add();
|
||||
*/
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
int at5100(int argc, char* argv[])
|
||||
{
|
||||
TTransfer_app a;
|
||||
a.run(argc, argv, "Scarico dati");
|
||||
return 0;
|
||||
}
|
||||
// trasferimenti
|
||||
|
||||
#include <applicat.h>
|
||||
#include <config.h>
|
||||
#include <mask.h>
|
||||
#include <relation.h>
|
||||
#include <urldefid.h>
|
||||
|
||||
#include "atfield.cpp"
|
||||
#include "lf.h"
|
||||
|
||||
// nomi delle variabili in .ini per i campi
|
||||
#define FIELD "FIELD"
|
||||
#define LEN "LEN"
|
||||
#define DEC "DEC"
|
||||
#define FLAGS "FLAGS"
|
||||
|
||||
// nomi delle variabili in .ini per HEADER
|
||||
#define HEADER "HEADER"
|
||||
#define NOMEFILE "NOMEFILE"
|
||||
#define LUNGHEZZA "LUNGHEZZA"
|
||||
#define RECORDSEP "RECORDSEP"
|
||||
#define FIELDSEP "FIELDSEP"
|
||||
|
||||
class TTransfer_app : public TApplication
|
||||
{
|
||||
TMask* _msk;
|
||||
TRelation* _rel;
|
||||
|
||||
protected:
|
||||
virtual bool create();
|
||||
virtual bool destroy();
|
||||
virtual bool menu(MENU_TAG m) ;
|
||||
virtual TMask& get_mask() { return *_msk; }
|
||||
virtual TRelation* get_relation() const { return _rel; }
|
||||
virtual void scarica();
|
||||
|
||||
public:
|
||||
TTransfer_app() {}
|
||||
|
||||
};
|
||||
|
||||
HIDDEN inline TTransfer_app& app() { return (TTransfer_app&) main_app(); }
|
||||
|
||||
bool TTransfer_app::create()
|
||||
{
|
||||
_msk = new TMask("at5100a");
|
||||
_rel = new TRelation(LF_SOGGETTI);
|
||||
|
||||
/*
|
||||
_rel->add("CTD", "CODTAB==CATDON",1,0,ALIAS_CTD);
|
||||
_donaz = new TLocalisamfile(LF_DONAZ);
|
||||
_contsan = new TLocalisamfile(LF_CONTSAN);
|
||||
_sdonazioni = new TRecord_array(LF_DONAZ,DON_PROGDON);
|
||||
_scontrolli = new TRecord_array(LF_CONTSAN,CON_PROGCON);
|
||||
_asoggetti = new TAssoc_array();
|
||||
|
||||
_msk->set_handler(F_INS_CONTROLLI,ins_controlli_handler);
|
||||
TSheet_field& ss = (TSheet_field&)_msk->field(F_SOGGETTI);
|
||||
ss.set_notify(soggetti_notify);
|
||||
|
||||
//ss.sheet_mask().set_handler(F_S_CODICE,codice_handler);
|
||||
ss.sheet_mask().set_handler(F_S_NOME,nome_handler);
|
||||
*/
|
||||
|
||||
dispatch_e_menu(BAR_ITEM(1));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TTransfer_app::destroy()
|
||||
{
|
||||
delete _rel;
|
||||
delete _msk;
|
||||
/*
|
||||
delete _donaz;
|
||||
delete _contsan;
|
||||
delete _sdonazioni;
|
||||
delete _scontrolli;
|
||||
delete _asoggetti;
|
||||
*/
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TTransfer_app::menu(MENU_TAG m)
|
||||
{
|
||||
TMask& msk = get_mask();
|
||||
const TDate oggi(TODAY);
|
||||
KEY tasto;
|
||||
do
|
||||
{
|
||||
tasto = msk.run();
|
||||
switch (tasto)
|
||||
{
|
||||
case K_ESC: // annulla
|
||||
msk.reset();
|
||||
break;
|
||||
case K_ENTER: // registra
|
||||
{
|
||||
TTransfer_app::scarica();
|
||||
msk.reset();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (tasto != K_QUIT);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void TTransfer_app::scarica()
|
||||
{
|
||||
|
||||
TArray arr_exprs; // array delle TExpr corrispondenti ai campi da scaricare
|
||||
TArray arr_fields; // array dei TField_text (campi indicati in .ini)
|
||||
|
||||
TConfig ini("esporta.ini");
|
||||
TString_array campi;
|
||||
int i = ini.list_paragraphs(campi);
|
||||
int poshead = campi.find("HEADER");
|
||||
campi.remove(poshead,TRUE);
|
||||
for ( int k = 0; k < campi.items(); k++ )
|
||||
{
|
||||
const char* campo = campi.row(k);
|
||||
TString_array vl;
|
||||
int i = ini.list_variables(vl, TRUE, campo);
|
||||
//for ( int j = 0; j < vl.items(); j++ )
|
||||
int pos = vl.find(FIELD);
|
||||
TExpr* espressione = vl.row(pos).get(1);
|
||||
arr_exprs.add(espressione)
|
||||
TToken_string variabile = vl.row(pos);
|
||||
int pos = vl.find(LEN);
|
||||
TToken_string variabile = vl.row(pos);
|
||||
int pos = vl.find(DEC);
|
||||
TToken_string variabile = vl.row(pos);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
TText_field campo()
|
||||
|
||||
arr_fields.add();
|
||||
*/
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
int at5100(int argc, char* argv[])
|
||||
{
|
||||
TTransfer_app a;
|
||||
a.run(argc, argv, "Scarico dati");
|
||||
return 0;
|
||||
}
|
||||
|
||||
26
at/at5100a.h
26
at/at5100a.h
@ -1,13 +1,13 @@
|
||||
// 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_DATAINI 109
|
||||
#define F_DATAFIN 110
|
||||
// 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_DATAINI 109
|
||||
#define F_DATAFIN 110
|
||||
|
||||
300
at/at5100a.uml
300
at/at5100a.uml
@ -1,150 +1,150 @@
|
||||
#include "at5100a.h"
|
||||
#include "lf.h"
|
||||
PAGE "Scarico dati" -1 -1 78 11
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
PROMPT 1 1 "Scelta sezioni/sottogruppi"
|
||||
END
|
||||
|
||||
STRING F_SEZINI 2
|
||||
BEGIN
|
||||
PROMPT 2 2 "Da "
|
||||
FLAGS "U"
|
||||
USE LF_SEZIONI
|
||||
INPUT CODSEZ F_SEZINI
|
||||
INPUT CODSOT F_SOTINI
|
||||
DISPLAY "Cod.sez" CODSEZ
|
||||
DISPLAY "Cod.sot." CODSOT
|
||||
DISPLAY "Sezione@25" DENSEZ
|
||||
DISPLAY "Sottogruppo@25" DENSOT
|
||||
OUTPUT F_SEZINI CODSEZ
|
||||
OUTPUT F_D_SEZINI DENSEZ
|
||||
OUTPUT F_SOTINI CODSOT
|
||||
OUTPUT F_D_SOTINI DENSOT
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Codice sezione da cui partire"
|
||||
END
|
||||
|
||||
STRING F_D_SEZINI 25
|
||||
BEGIN
|
||||
PROMPT 11 2 ""
|
||||
FLAGS "U"
|
||||
USE LF_SEZIONI KEY 2
|
||||
INPUT DENSEZ F_D_SEZINI
|
||||
DISPLAY "Sezione@25" DENSEZ
|
||||
DISPLAY "Sottogruppo@25" DENSOT
|
||||
DISPLAY "Cod.sez" CODSEZ
|
||||
DISPLAY "Cod.sot." CODSOT
|
||||
COPY OUTPUT F_SEZINI
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Sezione da cui partire"
|
||||
END
|
||||
|
||||
STRING F_SOTINI 2
|
||||
BEGIN
|
||||
PROMPT 2 3 " "
|
||||
COPY ALL F_SEZINI
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Codice sottogruppo da cui partire"
|
||||
END
|
||||
|
||||
STRING F_D_SOTINI 25
|
||||
BEGIN
|
||||
PROMPT 11 3 ""
|
||||
FLAGS "U"
|
||||
COPY USE F_D_SEZINI
|
||||
INPUT DENSEZ F_D_SEZINI
|
||||
INPUT DENSOT F_D_SOTINI
|
||||
COPY DISPLAY F_D_SEZINI
|
||||
COPY OUTPUT F_D_SEZINI
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Sottogruppo da cui partire"
|
||||
END
|
||||
|
||||
STRING F_SEZFIN 2
|
||||
BEGIN
|
||||
PROMPT 41 2 "A "
|
||||
FLAGS "U"
|
||||
USE LF_SEZIONI
|
||||
INPUT CODSEZ F_SEZFIN
|
||||
INPUT CODSOT F_SOTFIN
|
||||
DISPLAY "Cod.sez" CODSEZ
|
||||
DISPLAY "Cod.sot." CODSOT
|
||||
DISPLAY "Sezione@25" DENSEZ
|
||||
DISPLAY "Sottogruppo@25" DENSOT
|
||||
OUTPUT F_SEZFIN CODSEZ
|
||||
OUTPUT F_D_SEZFIN DENSEZ
|
||||
OUTPUT F_SOTFIN CODSOT
|
||||
OUTPUT F_D_SOTFIN DENSOT
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Codice sezione finale"
|
||||
END
|
||||
|
||||
STRING F_D_SEZFIN 25
|
||||
BEGIN
|
||||
PROMPT 49 2 ""
|
||||
FLAGS "U"
|
||||
USE LF_SEZIONI KEY 2
|
||||
INPUT DENSEZ F_D_SEZFIN
|
||||
DISPLAY "Sezione@25" DENSEZ
|
||||
DISPLAY "Sottogruppo@25" DENSOT
|
||||
DISPLAY "Cod.sez" CODSEZ
|
||||
DISPLAY "Cod.sot." CODSOT
|
||||
COPY OUTPUT F_SEZFIN
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Sezione finale"
|
||||
END
|
||||
|
||||
STRING F_SOTFIN 2
|
||||
BEGIN
|
||||
PROMPT 41 3 " "
|
||||
COPY ALL F_SEZFIN
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Codice sottogruppo finale"
|
||||
END
|
||||
|
||||
STRING F_D_SOTFIN 25
|
||||
BEGIN
|
||||
PROMPT 49 3 ""
|
||||
FLAGS "U"
|
||||
COPY USE F_D_SEZFIN
|
||||
INPUT DENSEZ F_D_SEZFIN
|
||||
INPUT DENSOT F_D_SOTFIN
|
||||
COPY DISPLAY F_D_SEZFIN
|
||||
COPY OUTPUT F_D_SEZFIN
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Sottogruppo finale"
|
||||
END
|
||||
|
||||
|
||||
GROUPBOX DLG_NULL 77 3
|
||||
BEGIN
|
||||
PROMPT 1 5 "Intervallo date ultimo aggiornamento"
|
||||
END
|
||||
|
||||
DATE F_DATAINI
|
||||
BEGIN
|
||||
PROMPT 2 6 "Data ultimo aggiornamento dal "
|
||||
HELP "Data di ultimo aggiornamento iniziale"
|
||||
END
|
||||
|
||||
DATE F_DATAFIN
|
||||
BEGIN
|
||||
PROMPT 46 6 "al "
|
||||
HELP "Data di ultimo aggiornamento finale"
|
||||
END
|
||||
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
BEGIN
|
||||
PROMPT -12 9 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -22 9 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
||||
#include "at5100a.h"
|
||||
#include "lf.h"
|
||||
PAGE "Scarico dati" -1 -1 78 11
|
||||
|
||||
GROUPBOX DLG_NULL 77 4
|
||||
BEGIN
|
||||
PROMPT 1 1 "Scelta sezioni/sottogruppi"
|
||||
END
|
||||
|
||||
STRING F_SEZINI 2
|
||||
BEGIN
|
||||
PROMPT 2 2 "Da "
|
||||
FLAGS "U"
|
||||
USE LF_SEZIONI
|
||||
INPUT CODSEZ F_SEZINI
|
||||
INPUT CODSOT F_SOTINI
|
||||
DISPLAY "Cod.sez" CODSEZ
|
||||
DISPLAY "Cod.sot." CODSOT
|
||||
DISPLAY "Sezione@25" DENSEZ
|
||||
DISPLAY "Sottogruppo@25" DENSOT
|
||||
OUTPUT F_SEZINI CODSEZ
|
||||
OUTPUT F_D_SEZINI DENSEZ
|
||||
OUTPUT F_SOTINI CODSOT
|
||||
OUTPUT F_D_SOTINI DENSOT
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Codice sezione da cui partire"
|
||||
END
|
||||
|
||||
STRING F_D_SEZINI 25
|
||||
BEGIN
|
||||
PROMPT 11 2 ""
|
||||
FLAGS "U"
|
||||
USE LF_SEZIONI KEY 2
|
||||
INPUT DENSEZ F_D_SEZINI
|
||||
DISPLAY "Sezione@25" DENSEZ
|
||||
DISPLAY "Sottogruppo@25" DENSOT
|
||||
DISPLAY "Cod.sez" CODSEZ
|
||||
DISPLAY "Cod.sot." CODSOT
|
||||
COPY OUTPUT F_SEZINI
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Sezione da cui partire"
|
||||
END
|
||||
|
||||
STRING F_SOTINI 2
|
||||
BEGIN
|
||||
PROMPT 2 3 " "
|
||||
COPY ALL F_SEZINI
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Codice sottogruppo da cui partire"
|
||||
END
|
||||
|
||||
STRING F_D_SOTINI 25
|
||||
BEGIN
|
||||
PROMPT 11 3 ""
|
||||
FLAGS "U"
|
||||
COPY USE F_D_SEZINI
|
||||
INPUT DENSEZ F_D_SEZINI
|
||||
INPUT DENSOT F_D_SOTINI
|
||||
COPY DISPLAY F_D_SEZINI
|
||||
COPY OUTPUT F_D_SEZINI
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Sottogruppo da cui partire"
|
||||
END
|
||||
|
||||
STRING F_SEZFIN 2
|
||||
BEGIN
|
||||
PROMPT 41 2 "A "
|
||||
FLAGS "U"
|
||||
USE LF_SEZIONI
|
||||
INPUT CODSEZ F_SEZFIN
|
||||
INPUT CODSOT F_SOTFIN
|
||||
DISPLAY "Cod.sez" CODSEZ
|
||||
DISPLAY "Cod.sot." CODSOT
|
||||
DISPLAY "Sezione@25" DENSEZ
|
||||
DISPLAY "Sottogruppo@25" DENSOT
|
||||
OUTPUT F_SEZFIN CODSEZ
|
||||
OUTPUT F_D_SEZFIN DENSEZ
|
||||
OUTPUT F_SOTFIN CODSOT
|
||||
OUTPUT F_D_SOTFIN DENSOT
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Codice sezione finale"
|
||||
END
|
||||
|
||||
STRING F_D_SEZFIN 25
|
||||
BEGIN
|
||||
PROMPT 49 2 ""
|
||||
FLAGS "U"
|
||||
USE LF_SEZIONI KEY 2
|
||||
INPUT DENSEZ F_D_SEZFIN
|
||||
DISPLAY "Sezione@25" DENSEZ
|
||||
DISPLAY "Sottogruppo@25" DENSOT
|
||||
DISPLAY "Cod.sez" CODSEZ
|
||||
DISPLAY "Cod.sot." CODSOT
|
||||
COPY OUTPUT F_SEZFIN
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Sezione finale"
|
||||
END
|
||||
|
||||
STRING F_SOTFIN 2
|
||||
BEGIN
|
||||
PROMPT 41 3 " "
|
||||
COPY ALL F_SEZFIN
|
||||
CHECKTYPE SEARCH
|
||||
HELP "Codice sottogruppo finale"
|
||||
END
|
||||
|
||||
STRING F_D_SOTFIN 25
|
||||
BEGIN
|
||||
PROMPT 49 3 ""
|
||||
FLAGS "U"
|
||||
COPY USE F_D_SEZFIN
|
||||
INPUT DENSEZ F_D_SEZFIN
|
||||
INPUT DENSOT F_D_SOTFIN
|
||||
COPY DISPLAY F_D_SEZFIN
|
||||
COPY OUTPUT F_D_SEZFIN
|
||||
CHECKTYPE NORMAL
|
||||
HELP "Sottogruppo finale"
|
||||
END
|
||||
|
||||
|
||||
GROUPBOX DLG_NULL 77 3
|
||||
BEGIN
|
||||
PROMPT 1 5 "Intervallo date ultimo aggiornamento"
|
||||
END
|
||||
|
||||
DATE F_DATAINI
|
||||
BEGIN
|
||||
PROMPT 2 6 "Data ultimo aggiornamento dal "
|
||||
HELP "Data di ultimo aggiornamento iniziale"
|
||||
END
|
||||
|
||||
DATE F_DATAFIN
|
||||
BEGIN
|
||||
PROMPT 46 6 "al "
|
||||
HELP "Data di ultimo aggiornamento finale"
|
||||
END
|
||||
|
||||
|
||||
BUTTON DLG_OK 9 2
|
||||
BEGIN
|
||||
PROMPT -12 9 ""
|
||||
END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -22 9 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
||||
|
||||
23
at/at6.cpp
Executable file
23
at/at6.cpp
Executable file
@ -0,0 +1,23 @@
|
||||
#include <xvt.h>
|
||||
#include <checks.h>
|
||||
|
||||
#include "at6.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 = at6100(argc, argv); break;
|
||||
case 1:
|
||||
rt = at6200(argc, argv); break;
|
||||
default:
|
||||
error_box(usage, argv[0]) ; rt = 1; break;
|
||||
}
|
||||
return rt;
|
||||
}
|
||||
7
at/at6.h
Executable file
7
at/at6.h
Executable file
@ -0,0 +1,7 @@
|
||||
#ifndef __AT6_H
|
||||
#define __AT6_H
|
||||
|
||||
int at6100(int argc, char* argv[]); // stampa tabella medici
|
||||
int at6200(int argc, char* argv[]); // stampa tabella sezioni/sottogruppi
|
||||
#endif // __AT6_H
|
||||
|
||||
19
at/at6.url
Executable file
19
at/at6.url
Executable file
@ -0,0 +1,19 @@
|
||||
#define APPNAME AVIS
|
||||
#define QAPPNAME "AVIS"
|
||||
#define LIBDIR f:\xvt.403\win_x86\ptk\lib
|
||||
#define QFIRMNAME "AGA Informatica S.r.l."
|
||||
|
||||
#include <default.url>
|
||||
|
||||
/* at6 -0 stampa archivio medici*/
|
||||
MENU TASK_MENUBAR
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
|
||||
/* at6 -1 stampa archivio sezioni */
|
||||
MENUBAR MENU_BAR(1)
|
||||
|
||||
MENU MENU_BAR(1)
|
||||
SUBMENU MENU_FILE "~File"
|
||||
|
||||
|
||||
223
at/at6100.cpp
Executable file
223
at/at6100.cpp
Executable file
@ -0,0 +1,223 @@
|
||||
#include <form.h>
|
||||
#include <mask.h>
|
||||
#include <printapp.h>
|
||||
|
||||
#include "lf.h"
|
||||
#include "medici.h"
|
||||
#include <comuni.h>
|
||||
|
||||
#include "at6.h"
|
||||
#include "at6100a.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)
|
||||
{
|
||||
TString80 nome = current_cursor()->curr().get(MED_COGNOME);
|
||||
nome << " ";
|
||||
nome << current_cursor()->curr().get(MED_NOME);
|
||||
_cognome_nome = nome;
|
||||
TString256 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;
|
||||
TString80 cogfr, cogto;
|
||||
const 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);
|
||||
TString16 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("at6100a");
|
||||
|
||||
_form_eti = new TMed_form("AT_ETMED");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TMedprint_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_eti;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at6100(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TMedprint_application a;
|
||||
|
||||
a.run(argc, argv, "Stampa Medici");
|
||||
|
||||
return 0;
|
||||
}
|
||||
10
at/at6100a.h
Executable file
10
at/at6100a.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/at6100a.uml
Executable file
94
at/at6100a.uml
Executable file
@ -0,0 +1,94 @@
|
||||
#include "at6100a.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/at6200.cpp
Executable file
234
at/at6200.cpp
Executable file
@ -0,0 +1,234 @@
|
||||
#include <form.h>
|
||||
#include <mask.h>
|
||||
#include <printapp.h>
|
||||
|
||||
#include <lffiles.h>
|
||||
#include "lf.h"
|
||||
#include "sezioni.h"
|
||||
#include <comuni.h>
|
||||
|
||||
#include "at6.h"
|
||||
#include "at6200a.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)
|
||||
{
|
||||
TString256 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)
|
||||
{
|
||||
TString16 codfr, codto;
|
||||
TString80 denfr, dento;
|
||||
const int sort = _msk->get_int(F_SORT);
|
||||
|
||||
reset_files();
|
||||
add_file(LF_SEZIONI);
|
||||
if (sort == 1)
|
||||
{
|
||||
codfr = _msk->get(F_CODFR);
|
||||
codto = _msk->get(F_CODTO);
|
||||
|
||||
select_cursor(_cur1);
|
||||
TLocalisamfile& fl = current_cursor()->file(LF_SEZIONI);
|
||||
TRectype da(fl.curr());
|
||||
TRectype a(fl.curr());
|
||||
|
||||
da.zero();
|
||||
a.zero();
|
||||
|
||||
da.put(SEZ_CODSEZ, codfr);
|
||||
a.put(SEZ_CODSEZ, codto);
|
||||
|
||||
current_cursor()->setregion(da, a);
|
||||
}
|
||||
else
|
||||
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);
|
||||
TString16 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("at6200a");
|
||||
|
||||
_form_eti = new TSez_form("AT_ETSEZ");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool TSezprint_application::user_destroy()
|
||||
{
|
||||
delete _msk;
|
||||
delete _rel;
|
||||
delete _form_eti;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int at6200(int argc, char* argv[])
|
||||
{
|
||||
|
||||
TSezprint_application a;
|
||||
|
||||
a.run(argc, argv, "Stampa Sezioni");
|
||||
|
||||
return 0;
|
||||
}
|
||||
10
at/at6200a.h
Executable file
10
at/at6200a.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/at6200a.uml
Executable file
94
at/at6200a.uml
Executable file
@ -0,0 +1,94 @@
|
||||
#include "at6200a.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
|
||||
235
at/at_etcar.frm
235
at/at_etcar.frm
@ -1,117 +1,118 @@
|
||||
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
|
||||
USE 90
|
||||
JOIN 13 INTO COM==DOM_CODCOM
|
||||
JOIN LCP ALIAS 100 INTO CODTAB==DOM_CODLOC
|
||||
|
||||
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->DOM_INDIR
|
||||
END
|
||||
|
||||
STRINGA 5 4
|
||||
BEGIN
|
||||
KEY "Codice localita'"
|
||||
PROMPT 0 0 ""
|
||||
FLAG "H"
|
||||
FIELD 90->DOM_CODLOC
|
||||
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
|
||||
FLAG "D"
|
||||
GROUP 2
|
||||
END
|
||||
|
||||
STRINGA 9 50
|
||||
BEGIN
|
||||
KEY "Comune"
|
||||
PROMPT 0 0 ""
|
||||
FIELD 13->DENCOM
|
||||
GROUP 2
|
||||
FLAG "HD"
|
||||
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
|
||||
|
||||
235
at/at_etsog.frm
235
at/at_etsog.frm
@ -1,117 +1,118 @@
|
||||
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
|
||||
USE 90
|
||||
JOIN 13 INTO COM==DOM_CODCOM
|
||||
JOIN LCP ALIAS 100 INTO CODTAB==DOM_CODLOC
|
||||
|
||||
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->DOM_INDIR
|
||||
END
|
||||
|
||||
STRINGA 5 4
|
||||
BEGIN
|
||||
KEY "Codice localita'"
|
||||
PROMPT 0 0 ""
|
||||
FLAG "H"
|
||||
FIELD 90->DOM_CODLOC
|
||||
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
|
||||
FLAG "D"
|
||||
GROUP 2
|
||||
END
|
||||
|
||||
STRINGA 9 50
|
||||
BEGIN
|
||||
KEY "Comune"
|
||||
PROMPT 0 0 ""
|
||||
FIELD 13->DENCOM
|
||||
GROUP 2
|
||||
FLAG "HD"
|
||||
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
|
||||
|
||||
897
at/at_pagin.frm
897
at/at_pagin.frm
@ -1,260 +1,637 @@
|
||||
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
|
||||
USE 90
|
||||
JOIN 13 ALIAS 300 INTO COM==DOM_CODCOM
|
||||
JOIN 13 ALIAS 200 INTO COM==RES_CODCOM
|
||||
JOIN LCP ALIAS 700 INTO CODTAB==DOM_CODLOC
|
||||
JOIN LCP ALIAS 100 INTO CODTAB==RES_CODLOC
|
||||
JOIN 96 INTO CODSEZ==CODSEZ
|
||||
JOIN CTD ALIAS 800 INTO CODTAB==CATDON
|
||||
JOIN CTN ALIAS 500 INTO CODTAB==CATNOND1
|
||||
JOIN CTN ALIAS 600 INTO CODTAB==CATNOND2
|
||||
JOIN TCS ALIAS 900 INTO CODTAB==STATO
|
||||
JOIN 13 ALIAS 400 INTO COM==COMNASC
|
||||
JOIN 97 INTO CODMED==CODMED
|
||||
|
||||
END
|
||||
|
||||
DESCRIPTION
|
||||
BEGIN
|
||||
90->* "Soggetti Sezioni AVIS"
|
||||
13->* "COMUNI"
|
||||
LCP->* "Localita' postali"
|
||||
96->* "Sezioni AVIS"
|
||||
CTD->* "Categorie donatori"
|
||||
CTN->* "Categorie non donatori"
|
||||
TCS->* "Tipi/Esiti controlli sanitari"
|
||||
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 15 1 "Cognome "
|
||||
END
|
||||
|
||||
STRINGA 3 30
|
||||
BEGIN
|
||||
KEY "Nome"
|
||||
FIELD 90->NOME
|
||||
PROMPT 50 1 "Nome "
|
||||
END
|
||||
|
||||
DATA 4 18
|
||||
BEGIN
|
||||
KEY "Data nascita"
|
||||
FIELD 90->DATANASC
|
||||
PROMPT 1 2 "Nato il "
|
||||
END
|
||||
|
||||
STRINGA 5 30
|
||||
BEGIN
|
||||
KEY "Comune di nascita"
|
||||
PROMPT 0 0 ""
|
||||
FIELD 400@->DENCOM
|
||||
FLAG "H"
|
||||
MESSAGE RESET,7|COPY,7
|
||||
END
|
||||
|
||||
STRINGA 6 5
|
||||
BEGIN
|
||||
KEY "Provincia di nascita"
|
||||
PROMPT 0 0 ""
|
||||
FIELD 400@->PROVCOM
|
||||
FLAG "H"
|
||||
MESSAGE APPEND,7
|
||||
END
|
||||
|
||||
STRINGA 7 40
|
||||
BEGIN
|
||||
KEY "Comune e provincia di nascita"
|
||||
PROMPT 20 2 "Nato a "
|
||||
END
|
||||
|
||||
STRINGA 8 6
|
||||
BEGIN
|
||||
KEY "Testo"
|
||||
PROMPT 62 2 "Sesso "
|
||||
END
|
||||
|
||||
LISTA 9
|
||||
BEGIN
|
||||
KEY "Sesso"
|
||||
PROMPT 68 2 "Sesso "
|
||||
FIELD 90->SESSO
|
||||
ITEM "0|Sconosciuto"
|
||||
ITEM "1|Maschio"
|
||||
ITEM "2|Femmina"
|
||||
ITEM "9|Non specif."
|
||||
END
|
||||
|
||||
STRINGA 10 7
|
||||
BEGIN
|
||||
KEY "Codice sezione"
|
||||
FIELD 90->CODSEZ
|
||||
PROMPT 1 4 "Sez. "
|
||||
END
|
||||
|
||||
STRINGA 11 25
|
||||
BEGIN
|
||||
KEY "Denominazione sezione"
|
||||
FIELD 96->DENSEZ
|
||||
PROMPT 9 4 ""
|
||||
END
|
||||
|
||||
STRINGA 12 7
|
||||
BEGIN
|
||||
KEY "Codice sottog."
|
||||
FIELD 90->CODSOT
|
||||
PROMPT 41 4 "Sot. "
|
||||
END
|
||||
|
||||
STRINGA 13 25
|
||||
BEGIN
|
||||
KEY "Denominazione sottog."
|
||||
FIELD 96->DENSOT
|
||||
PROMPT 49 4 ""
|
||||
END
|
||||
|
||||
STRINGA 14 7
|
||||
BEGIN
|
||||
KEY "Categoria don."
|
||||
FIELD 90->CATDON
|
||||
PROMPT 1 5 "Cat. "
|
||||
END
|
||||
|
||||
STRINGA 15 25
|
||||
BEGIN
|
||||
KEY "Descrizione categoria"
|
||||
FIELD 800@->S0
|
||||
PROMPT 9 5 ""
|
||||
END
|
||||
|
||||
DATA 16 21
|
||||
BEGIN
|
||||
KEY "Data iscrizione"
|
||||
FIELD 90->DATAISC
|
||||
PROMPT 36 5 "Data iscr. "
|
||||
END
|
||||
|
||||
DATA 17 20
|
||||
BEGIN
|
||||
KEY "Data dimissione"
|
||||
FIELD 90->DATADIM
|
||||
PROMPT 59 5 "Data dim. "
|
||||
END
|
||||
|
||||
STRINGA 18 16
|
||||
BEGIN
|
||||
KEY "Tessera AVIS"
|
||||
FIELD 90->TESSAVIS
|
||||
PROMPT 1 7 "Tess.AVIS "
|
||||
END
|
||||
|
||||
STRINGA 19 13
|
||||
BEGIN
|
||||
KEY "Codice Centro Trasfusionale"
|
||||
FIELD 90->CODCT
|
||||
PROMPT 18 7 "Cod.CT "
|
||||
END
|
||||
|
||||
STRINGA 20 16
|
||||
BEGIN
|
||||
KEY "Cartella clinica"
|
||||
FIELD 90->CODCL
|
||||
PROMPT 33 7 "Car.clin. "
|
||||
END
|
||||
|
||||
STRINGA 21 28
|
||||
BEGIN
|
||||
KEY "Documento di identita'"
|
||||
FIELD 90->DOCID
|
||||
PROMPT 51 7 "Doc.id. "
|
||||
END
|
||||
|
||||
STRINGA 22 26
|
||||
BEGIN
|
||||
KEY "Codice fiscale"
|
||||
FIELD 90->CF
|
||||
PROMPT 1 8 "Cod.fisc. "
|
||||
END
|
||||
|
||||
STRINGA 23 10
|
||||
BEGIN
|
||||
KEY "Testo"
|
||||
PROMPT 1 10 "Domicilio:"
|
||||
END
|
||||
|
||||
STRINGA 24 30
|
||||
BEGIN
|
||||
KEY "Domicilio: indirizzo"
|
||||
FIELD 90->DOM_INDIR
|
||||
PROMPT 1 11 ""
|
||||
MESSAGE RESET,30
|
||||
END
|
||||
|
||||
STRINGA 25 4
|
||||
BEGIN
|
||||
KEY "Domicilio: codice localita'"
|
||||
FIELD 90->DOM_CODLOC
|
||||
PROMPT 0 0 ""
|
||||
FLAG "H"
|
||||
END
|
||||
|
||||
STRINGA 26 5
|
||||
BEGIN
|
||||
KEY "Domicilio: CAP"
|
||||
FIELD 700@->S6
|
||||
FIELD 300@->CAPCOM
|
||||
PROMPT 0 0 ""
|
||||
FLAG "H"
|
||||
MESSAGE APPEND,30
|
||||
END
|
||||
|
||||
STRINGA 27 30
|
||||
BEGIN
|
||||
KEY "Domicilio: localita'"
|
||||
FIELD 700@->S0
|
||||
PROMPT 0 0 ""
|
||||
FLAG "H"
|
||||
MESSAGE APPEND,30
|
||||
END
|
||||
|
||||
STRINGA 28 50
|
||||
BEGIN
|
||||
KEY "Domicilio: comune"
|
||||
FIELD 300@->DENCOM
|
||||
PROMPT 0 0 ""
|
||||
FLAG "H"
|
||||
MESSAGE APPEND,30
|
||||
END
|
||||
|
||||
STRINGA 29 5
|
||||
BEGIN
|
||||
KEY "Domicilio: provincia"
|
||||
FIELD 300@->PROVCOM
|
||||
PROMPT 0 0 ""
|
||||
FLAG "H"
|
||||
MESSAGE APPEND,30
|
||||
END
|
||||
|
||||
STRINGA 30 39 3
|
||||
BEGIN
|
||||
KEY "Domicilio: Loc/Com/Prov"
|
||||
PROMPT 1 12 ""
|
||||
END
|
||||
|
||||
STRINGA 31 10
|
||||
BEGIN
|
||||
KEY "Testo"
|
||||
PROMPT 41 10 "Residenza:"
|
||||
END
|
||||
|
||||
STRINGA 32 30
|
||||
BEGIN
|
||||
KEY "Residenza: indirizzo"
|
||||
FIELD 90->RES_INDIR
|
||||
PROMPT 41 11 ""
|
||||
MESSAGE RESET,38
|
||||
END
|
||||
|
||||
STRINGA 33 4
|
||||
BEGIN
|
||||
KEY "Residenza: codice localita'"
|
||||
FIELD 90->RES_CODLOC
|
||||
PROMPT 0 0 ""
|
||||
FLAG "H"
|
||||
END
|
||||
|
||||
STRINGA 34 5
|
||||
BEGIN
|
||||
KEY "Residenza: CAP"
|
||||
FIELD 100@->S6
|
||||
FIELD 200@->CAPCOM
|
||||
PROMPT 0 0 ""
|
||||
FLAG "H"
|
||||
MESSAGE APPEND,38
|
||||
END
|
||||
|
||||
STRINGA 35 30
|
||||
BEGIN
|
||||
KEY "Residenza: localita'"
|
||||
FIELD 100@->S0
|
||||
PROMPT 0 0 ""
|
||||
FLAG "H"
|
||||
MESSAGE APPEND,38
|
||||
END
|
||||
|
||||
STRINGA 36 50
|
||||
BEGIN
|
||||
KEY "Residenza: comune"
|
||||
FIELD 200@->DENCOM
|
||||
PROMPT 0 0 ""
|
||||
FLAG "H"
|
||||
MESSAGE APPEND,38
|
||||
END
|
||||
|
||||
STRINGA 37 5
|
||||
BEGIN
|
||||
KEY "Residenza: provincia"
|
||||
FIELD 200@->PROVCOM
|
||||
PROMPT 0 0 ""
|
||||
FLAG "H"
|
||||
MESSAGE APPEND,38
|
||||
END
|
||||
|
||||
STRINGA 38 39 3
|
||||
BEGIN
|
||||
KEY "Residenza: Loc/Com/Prov"
|
||||
PROMPT 41 12 ""
|
||||
END
|
||||
|
||||
STRINGA 39 23
|
||||
BEGIN
|
||||
KEY "Telefono abitazione"
|
||||
FIELD 90->TELABI
|
||||
PROMPT 1 15 "Tel.abi. "
|
||||
END
|
||||
|
||||
STRINGA 40 23
|
||||
BEGIN
|
||||
KEY "Telefono lavoro"
|
||||
FIELD 90->TELLAV
|
||||
PROMPT 25 15 "Tel.lav. "
|
||||
END
|
||||
|
||||
STRINGA 41 25
|
||||
BEGIN
|
||||
KEY "Telefono altro"
|
||||
FIELD 90->TELALT
|
||||
PROMPT 49 15 "Tel.altro "
|
||||
END
|
||||
|
||||
STRINGA 42
|
||||
BEGIN
|
||||
KEY "Testo"
|
||||
PROMPT 1 16 "Escluso "
|
||||
END
|
||||
|
||||
LISTA 43
|
||||
BEGIN
|
||||
KEY "Esclusione"
|
||||
FIELD 90->ESCLUSO
|
||||
ITEM " | "
|
||||
ITEM "TI|T. indeterminato"
|
||||
ITEM "TD|T. determinato"
|
||||
PROMPT 10 16 "Escluso "
|
||||
END
|
||||
|
||||
DATA 44 18
|
||||
BEGIN
|
||||
KEY "Data termine esclusione"
|
||||
FIELD 90->TERMESCL
|
||||
PROMPT 27 16 "Termine "
|
||||
END
|
||||
|
||||
STRINGA 45 35
|
||||
BEGIN
|
||||
KEY "Motivo esclusione"
|
||||
FIELD 90->MOTESCL
|
||||
PROMPT 46 16 "Per "
|
||||
END
|
||||
|
||||
STRINGA 46 26
|
||||
BEGIN
|
||||
KEY "Descrizione stato"
|
||||
FIELD 900@->S3
|
||||
PROMPT 1 17 "Stato "
|
||||
END
|
||||
|
||||
DATA 47 15
|
||||
BEGIN
|
||||
KEY "Data stato"
|
||||
FIELD 90->DATASTATO
|
||||
PROMPT 28 17 "Data "
|
||||
END
|
||||
|
||||
STRINGA 48 11
|
||||
BEGIN
|
||||
KEY "Tipo ultima idoneita'"
|
||||
FIELD 90->TIPOULTID
|
||||
PROMPT 45 17 "Ult. id. "
|
||||
END
|
||||
|
||||
DATA 49 10
|
||||
BEGIN
|
||||
KEY "Data ultima idoneita'"
|
||||
FIELD 90->DATAULTID
|
||||
PROMPT 58 17 ""
|
||||
END
|
||||
|
||||
STRINGA 50 2
|
||||
BEGIN
|
||||
KEY "Idoneita' alla donazione 1"
|
||||
FIELD 90->IDON1
|
||||
PROMPT 70 17 ""
|
||||
END
|
||||
|
||||
STRINGA 51 2
|
||||
BEGIN
|
||||
KEY "Idoneita' alla donazione 2"
|
||||
FIELD 90->IDON2
|
||||
PROMPT 73 17 ""
|
||||
END
|
||||
|
||||
STRINGA 52 2
|
||||
BEGIN
|
||||
KEY "Idoneita' alla donazione 3"
|
||||
FIELD 90->IDON3
|
||||
PROMPT 76 17 ""
|
||||
END
|
||||
|
||||
STRINGA 53 2
|
||||
BEGIN
|
||||
KEY "Idoneita' alla donazione 4"
|
||||
FIELD 90->IDON4
|
||||
PROMPT 79 17 ""
|
||||
END
|
||||
|
||||
STRINGA 54
|
||||
BEGIN
|
||||
KEY "Testo"
|
||||
PROMPT 1 19 "Situazione donazioni:"
|
||||
END
|
||||
|
||||
NUMERO 55 8
|
||||
BEGIN
|
||||
KEY "Totale donazioni"
|
||||
FIELD 90->TOTDON
|
||||
PROMPT 1 20 "Tot. "
|
||||
END
|
||||
|
||||
STRINGA 56 11
|
||||
BEGIN
|
||||
KEY "Tipo ultima donazione"
|
||||
FIELD 90->TIPOULTDON
|
||||
PROMPT 1 21 "Ult.don. "
|
||||
END
|
||||
|
||||
DATA 57 10
|
||||
BEGIN
|
||||
KEY "Data ultima donazione"
|
||||
FIELD 90->DATAULTDON
|
||||
PROMPT 13 21 ""
|
||||
END
|
||||
|
||||
STRINGA 58 13
|
||||
BEGIN
|
||||
KEY "Testo"
|
||||
PROMPT 26 20 "Donazioni SI:"
|
||||
END
|
||||
|
||||
STRINGA 59 13
|
||||
BEGIN
|
||||
KEY "Testo"
|
||||
PROMPT 26 21 "Donazioni AF:"
|
||||
END
|
||||
|
||||
STRINGA 60 4
|
||||
BEGIN
|
||||
KEY "Testo"
|
||||
PROMPT 42 19 "Tot."
|
||||
END
|
||||
|
||||
STRINGA 61 10
|
||||
BEGIN
|
||||
KEY "Testo"
|
||||
PROMPT 48 19 "Ultima"
|
||||
END
|
||||
|
||||
STRINGA 62 4
|
||||
BEGIN
|
||||
KEY "Testo"
|
||||
PROMPT 60 19 "Int."
|
||||
END
|
||||
|
||||
STRINGA 63 10
|
||||
BEGIN
|
||||
KEY "Testo"
|
||||
PROMPT 66 19 "Prossima"
|
||||
END
|
||||
|
||||
NUMERO 64 3
|
||||
BEGIN
|
||||
KEY "Totale donazioni SI"
|
||||
FIELD 90->TOTDONSI
|
||||
PROMPT 42 20 ""
|
||||
END
|
||||
|
||||
NUMERO 65 3
|
||||
BEGIN
|
||||
KEY "Totale donazioni AF"
|
||||
FIELD 90->TOTDONAF
|
||||
PROMPT 42 21 ""
|
||||
END
|
||||
|
||||
DATA 66 10
|
||||
BEGIN
|
||||
KEY "Data ultima donazione SI"
|
||||
FIELD 90->DATAULTSI
|
||||
PROMPT 48 20 ""
|
||||
END
|
||||
|
||||
DATA 67 10
|
||||
BEGIN
|
||||
KEY "Data ultima donazione AF"
|
||||
FIELD 90->DATAULTAF
|
||||
PROMPT 48 21 ""
|
||||
END
|
||||
|
||||
NUMERO 68 4
|
||||
BEGIN
|
||||
KEY "Intervallo SI"
|
||||
FIELD 90->INTSI
|
||||
PROMPT 60 20 ""
|
||||
END
|
||||
|
||||
NUMERO 69 4
|
||||
BEGIN
|
||||
KEY "Intervallo AF"
|
||||
FIELD 90->INTAF
|
||||
PROMPT 60 21 ""
|
||||
END
|
||||
|
||||
DATA 70 10
|
||||
BEGIN
|
||||
KEY "Data prossima SI"
|
||||
FIELD 90->DATAPROSSI
|
||||
PROMPT 66 20 ""
|
||||
END
|
||||
|
||||
DATA 71 10
|
||||
BEGIN
|
||||
KEY "Data prossima AF"
|
||||
FIELD 90->DATAPROSAF
|
||||
PROMPT 66 21 ""
|
||||
END
|
||||
|
||||
STRINGA 72 14
|
||||
BEGIN
|
||||
KEY "Gruppo AB0"
|
||||
FIELD 90->GRUPPOAB0
|
||||
PROMPT 1 23 "Gruppo AB0 "
|
||||
END
|
||||
|
||||
STRINGA 73 12
|
||||
BEGIN
|
||||
KEY "Rh/AntiD"
|
||||
FIELD 90->RHANTID
|
||||
PROMPT 16 23 "Rh/AntiD "
|
||||
END
|
||||
|
||||
STRINGA 74 8
|
||||
BEGIN
|
||||
KEY "Kell"
|
||||
FIELD 90->KELL
|
||||
PROMPT 30 23 "Kell "
|
||||
END
|
||||
|
||||
STRINGA 75 18
|
||||
BEGIN
|
||||
KEY "Fenotipo Rh"
|
||||
FIELD 90->FENOTIPORH
|
||||
PROMPT 40 23 "Fenotipo Rh "
|
||||
END
|
||||
|
||||
STRINGA 76 12
|
||||
BEGIN
|
||||
KEY "Du"
|
||||
FIELD 90->DU
|
||||
PROMPT 60 23 "Du "
|
||||
END
|
||||
|
||||
NUMERO 77 13
|
||||
BEGIN
|
||||
KEY "Codice medico"
|
||||
FIELD 90->CODMED
|
||||
PROMPT 1 24 "Medico "
|
||||
END
|
||||
|
||||
STRINGA 78 25
|
||||
BEGIN
|
||||
KEY "Cognome medico"
|
||||
FIELD 97->COGNOME
|
||||
FLAGS "H"
|
||||
MESSAGE RESET,80|COPY,80
|
||||
END
|
||||
|
||||
STRINGA 79 25
|
||||
BEGIN
|
||||
KEY "Nome medico"
|
||||
FIELD 97->NOME
|
||||
FLAGS "H"
|
||||
MESSAGE APPEND,80
|
||||
END
|
||||
|
||||
STRINGA 80 51
|
||||
BEGIN
|
||||
KEY "Cognome e nome medico"
|
||||
PROMPT 15 24 ""
|
||||
END
|
||||
|
||||
STRINGA 81 10
|
||||
BEGIN
|
||||
KEY "Testo"
|
||||
PROMPT 1 25 "Mod.conv. "
|
||||
END
|
||||
|
||||
LISTA 83 22
|
||||
BEGIN
|
||||
KEY "Modalita' di convocazione"
|
||||
FIELD 90->MODCONV
|
||||
PROMPT 11 25 ""
|
||||
ITEM " |"
|
||||
ITEM "PO|Postale"
|
||||
ITEM "T1|Tel. abitaz."
|
||||
ITEM "T2|Tel. lavoro"
|
||||
ITEM "T3|Tel. altro"
|
||||
ITEM "TE|Telefonica"
|
||||
ITEM "IN|Indifferente"
|
||||
END
|
||||
|
||||
END
|
||||
|
||||
342
at/atfield.cpp
Executable file
342
at/atfield.cpp
Executable file
@ -0,0 +1,342 @@
|
||||
// definizione dei record_text per trasferimento da/a file di testo
|
||||
|
||||
#include <config.h>
|
||||
#include <fstream.h>
|
||||
#include <object.h>
|
||||
#include <strings.h>
|
||||
|
||||
// nomi delle variabili in .ini per HEADER
|
||||
#define HEADER "HEADER"
|
||||
#define NOMEFILE "NOMEFILE"
|
||||
#define LUNGHEZZA "LUNGHEZZA"
|
||||
#define RECORDSEP "RECORDSEP"
|
||||
#define FIELDSEP "FIELDSEP"
|
||||
|
||||
|
||||
class TFile_text;
|
||||
class TRecord_text : public TToken_string
|
||||
{
|
||||
|
||||
// lunghezza del record (se a lunghezza fissa)
|
||||
int _length;
|
||||
|
||||
// separatore di record (se necessario)
|
||||
TString16 _recordsep;
|
||||
|
||||
// il separatore di campi esiste già (_separator)
|
||||
|
||||
public:
|
||||
|
||||
// restituisce la lunghezza del record
|
||||
int length() { return _length; }
|
||||
// restituisce il separatore di record (se esiste)
|
||||
const char* recordsep() { return _recordsep; }
|
||||
|
||||
// ritorna il campo alla posizione <pos>
|
||||
// aggiungere la possibilità di estrarlo <da> <a>
|
||||
const char* get(int pos) const;
|
||||
|
||||
// ritorna il campo che va dal carattere <da> al carattere <a>
|
||||
const char* get(int da, int a) const;
|
||||
|
||||
// scrive il campo <c> nel record alla posizione <pos>
|
||||
|
||||
void put(const char* c, int pos = -1);
|
||||
|
||||
// scrive il campo <c> nel record partendo dal carattere <da> fino al carattere <a>
|
||||
// se il campo <c> è più lungo viene troncato
|
||||
|
||||
void put(const char* c, int da, int a);
|
||||
|
||||
// costruttore
|
||||
TRecord_text(const char* recordsep = "\n", char fieldsep = '|')
|
||||
: _length(-1), _recordsep(recordsep)
|
||||
{
|
||||
TToken_string::TToken_string("",fieldsep);
|
||||
}
|
||||
|
||||
// costruttore
|
||||
TRecord_text(int length, const char* recordsep = "\n")
|
||||
: _length(length)
|
||||
{
|
||||
TToken_string::TToken_string(length);
|
||||
spaces();
|
||||
}
|
||||
|
||||
// distruttore
|
||||
~TRecord_text() {};
|
||||
|
||||
};
|
||||
|
||||
|
||||
const char* TRecord_text::get(int pos) const
|
||||
{
|
||||
return ((TToken_string*)this)->get(pos);
|
||||
}
|
||||
|
||||
const char* TRecord_text::get(int da, int a) const
|
||||
{
|
||||
CHECK(_length > 0, "Get non consentita su record non a lunghezza fissa");
|
||||
|
||||
return sub(da, a);
|
||||
}
|
||||
|
||||
void TRecord_text::put(const char* c, int pos)
|
||||
{
|
||||
add(c, pos);
|
||||
}
|
||||
|
||||
void TRecord_text::put(const char* c, int da, int a)
|
||||
{
|
||||
CHECK(_length > 0, "Put non consentita su record non a lunghezza fissa");
|
||||
|
||||
TString s = c;
|
||||
int len = da-a+1;
|
||||
if ( s.len() > len) s = s.cut(len);
|
||||
// sistemare se è più corta (la fill non va bene)
|
||||
TToken_string::overwrite(s, da);
|
||||
}
|
||||
|
||||
// definizione dei field_text per trasferimento da/a file di testo
|
||||
|
||||
class TField_text : public TObject
|
||||
{
|
||||
// nome del campo
|
||||
TString16 _name;
|
||||
// posizione assoluta nel record (se con separatore)
|
||||
int _pos;
|
||||
// posizione iniziale nel record (se a lunghezza fissa)
|
||||
int _from;
|
||||
// posizione finale /se a lunghezza fissa)
|
||||
int _to;
|
||||
|
||||
protected:
|
||||
|
||||
public:
|
||||
// costruttore
|
||||
TField_text() : _name(0), _pos(-1), _from(-1), _to(-1) {}
|
||||
// costruttore
|
||||
TField_text(const char* name, int pos = -1, int from = -1, int to = -1)
|
||||
: _name(name), _pos(pos), _from(from), _to(to) {}
|
||||
|
||||
// ritorna il nome del campo
|
||||
const char* name() const { return _name; }
|
||||
// setta il nome del campo
|
||||
void set_name(const char* name) { _name = name; }
|
||||
|
||||
// ritorna la posizione iniziale del campo
|
||||
int from() const { return _from; }
|
||||
// setta la posizione iniziale del campo
|
||||
void set_from(int from) { _from = from; }
|
||||
|
||||
// ritorna la posizione finale del campo
|
||||
int to() const { return _to; }
|
||||
// setta la posizione finale del campo
|
||||
void set_to(int to) { _to = to; }
|
||||
|
||||
// ritorna la posizione del campo
|
||||
int pos() const { return _pos; }
|
||||
// setta la posizione del campo
|
||||
void set_pos(int pos) { _pos = pos; }
|
||||
|
||||
// cerca nel record il campo e ne ritorna il contenuto
|
||||
const char* read(const TRecord_text& rec) const;
|
||||
|
||||
// cerca nel record il campo e vi scrive <val>
|
||||
void write(const char* val, TRecord_text& rec);
|
||||
|
||||
virtual ~TField_text() {};
|
||||
|
||||
};
|
||||
|
||||
const char* TField_text::read(const TRecord_text& rec) const
|
||||
{
|
||||
int pos = TField_text::pos();
|
||||
if (pos = -1)
|
||||
{
|
||||
int from = TField_text::from();
|
||||
int to = TField_text::to();
|
||||
if (from != -1 && to != -1)
|
||||
return rec.get(from, to);
|
||||
else
|
||||
return "";
|
||||
}
|
||||
else
|
||||
return rec.get(pos);
|
||||
}
|
||||
|
||||
void TField_text::write(const char* val, TRecord_text& rec)
|
||||
{
|
||||
int pos = TField_text::pos();
|
||||
if (pos != -1)
|
||||
{
|
||||
int from = TField_text::from();
|
||||
int to = TField_text::to();
|
||||
if (from != -1 && to != -1)
|
||||
rec.put(val, from, to);
|
||||
}
|
||||
else
|
||||
rec.put(val, pos);
|
||||
}
|
||||
|
||||
// definizione dei file_text per trasferimento da/a file di testo
|
||||
|
||||
class TFile_text: public fstream
|
||||
{
|
||||
TFilename _name;
|
||||
TRecord_text _current;
|
||||
TString _buffer;
|
||||
TArray _arr_exprs;
|
||||
TArray _arr_fields;
|
||||
|
||||
public:
|
||||
|
||||
// apre il file, se create = TRUE e il file non esiste lo crea
|
||||
int open(TFilename name, bool create = FALSE);
|
||||
// chiude il file
|
||||
int close();
|
||||
// crea il file
|
||||
int create(TFilename name) { return open(name, TRUE); };
|
||||
// cancella il file
|
||||
int remove();
|
||||
|
||||
// ritorna il record corrente
|
||||
TRecord_text& curr() { return _current; }
|
||||
|
||||
// setta _current a rec
|
||||
void set_curr(TRecord_text& rec);
|
||||
|
||||
// restituisce il nome del file
|
||||
const char* name() { return _name; }
|
||||
|
||||
// setta il nome del file
|
||||
void set_name(TFilename name) { _name = name;}
|
||||
|
||||
// si posiziona sul primo record del file
|
||||
int first();
|
||||
// si posiziona sul prossimo record del file
|
||||
int next();
|
||||
|
||||
// aggiunge il record rec in fondo
|
||||
int write(TRecord_text& rec);
|
||||
// aggiunge il record corrente in fondo
|
||||
int write();
|
||||
|
||||
// costruttore
|
||||
TFile_text(const char* file_name, const char* config_name)
|
||||
: _name(file_name), _buffer(1024*16)
|
||||
{
|
||||
setbuf((char*)(const char*)_buffer, _buffer.size());
|
||||
TConfig config(config_name);
|
||||
const TString_array fields;
|
||||
const char* recordsep = config.get(RECORDSEP,HEADER);
|
||||
const char* fieldsep = config.get(FIELDSEP,HEADER);
|
||||
int lunghezza = config.get_int(LUNGHEZZA,HEADER);
|
||||
if (lunghezza = 0)
|
||||
_current(recordsep, fieldsep);
|
||||
else
|
||||
_current(lunghezza,recordsep);
|
||||
const int i = config.list_paragraphs(fields);
|
||||
//int posheader = fields.find(HEADER);
|
||||
fields.remove(fields.find(HEADER),TRUE);
|
||||
//for ( int k = 0; k < fields.items(); k++ )
|
||||
};
|
||||
|
||||
// distruttore
|
||||
~TFile_text()
|
||||
{
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
void TFile_text::set_curr(TRecord_text& rec)
|
||||
{
|
||||
//CHECK(rec,"NULL record");
|
||||
_current = rec;
|
||||
}
|
||||
|
||||
int TFile_text::write(TRecord_text& rec)
|
||||
{
|
||||
//CHECK(rec = NULL, "NULL record");
|
||||
const char* record = (char*)&rec;
|
||||
if (rec.length() > 0)
|
||||
fstream::write(record, rec.length());
|
||||
else
|
||||
fstream::write(record, rec.len());
|
||||
const TString16 separator = rec.recordsep();
|
||||
if ( separator.ok())
|
||||
{
|
||||
int lensep = separator.len();
|
||||
fstream::write(separator, lensep);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int TFile_text::write()
|
||||
{
|
||||
//CHECK(_current, "NULL current record");
|
||||
const char* record = (char*)(&_current);
|
||||
if (_current.length() > 0)
|
||||
fstream::write(record, _current.length());
|
||||
else
|
||||
fstream::write(record, _current.len());
|
||||
const TString16 separator = _current.recordsep();
|
||||
if ( separator.ok())
|
||||
{
|
||||
int lensep = separator.len();
|
||||
fstream::write(separator, lensep);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int TFile_text::open(TFilename name, bool create)
|
||||
{
|
||||
set_name(name);
|
||||
if (create)
|
||||
open(name,ios::app|ios::binary|ios::out);
|
||||
else
|
||||
open(name,ios::app|ios::binary|ios::in|ios::nocreate);
|
||||
if (bad())
|
||||
fatal_box("Impossibile aprire %s",name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int TFile_text::next()
|
||||
{
|
||||
//CHECK(_current, "NULL current record");
|
||||
if (_current.length() > 0)
|
||||
fstream::read((char*)(&_current), _current.length());
|
||||
else
|
||||
{
|
||||
TString16 separator = curr().recordsep();
|
||||
if (separator.ok())
|
||||
{
|
||||
TString record;
|
||||
int countsep = 0;
|
||||
do
|
||||
{
|
||||
char c = get();
|
||||
record << c;
|
||||
if (c = separator[countsep])
|
||||
countsep++;
|
||||
else
|
||||
countsep = 0;
|
||||
} while (countsep < separator.len() && good() && !eof());
|
||||
if (countsep = separator.len())
|
||||
record.cut(record.len()-separator.len());
|
||||
(TToken_string&)_current = record;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int TFile_text::close()
|
||||
{
|
||||
_name = "";
|
||||
_current = NULL;
|
||||
_buffer = "";
|
||||
fstream::close();
|
||||
return 0;
|
||||
}
|
||||
|
||||
9
at/atlib.h
Executable file
9
at/atlib.h
Executable file
@ -0,0 +1,9 @@
|
||||
#define IDON_SI "SI"
|
||||
#define IDON_AF "AF"
|
||||
|
||||
bool is_idon_one(TString16 idon, const char* tipo);
|
||||
bool is_idon(TString16 id1, TString16 id2, TString16 id3, TString16 id4, const char* tipo);
|
||||
bool is_donaz(TString16 don, const char* tipo);
|
||||
char modstato_tcs(TString16 tipo);
|
||||
void con_reord(TRectype& soggetto, TRecord_array* controlli);
|
||||
void don_datepross(TRectype& soggetto);
|
||||
176
at/atlib1.cpp
176
at/atlib1.cpp
@ -1,7 +1,11 @@
|
||||
#define XIDON_SI "SI"
|
||||
#define XIDON_AF "AF"
|
||||
#include <recarray.h>
|
||||
#include <tabutil.h>
|
||||
#include "atlib.h"
|
||||
|
||||
bool xis_idon_one(TString idon, const char* tipo)
|
||||
#include "soggetti.h"
|
||||
#include "contsan.h"
|
||||
|
||||
bool is_idon_one(TString16 idon, const char* tipo)
|
||||
// verifica che l'idoneità "idon" sia del tipo "tipo"
|
||||
// esempio: se passo PL, AF restituisce TRUE
|
||||
{
|
||||
@ -18,13 +22,13 @@ bool xis_idon_one(TString idon, const char* tipo)
|
||||
return is_idon;
|
||||
}
|
||||
|
||||
bool xis_idon(TString id1, TString id2, TString id3, TString id4, const char* tipo)
|
||||
bool is_idon(TString16 id1, TString16 id2, TString16 id3, TString16 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));
|
||||
return (is_idon_one(id1,tipo) || is_idon_one(id2,tipo) || is_idon_one(id3,tipo) || is_idon_one(id4,tipo));
|
||||
}
|
||||
|
||||
bool xis_donaz(TString don, const char* tipo)
|
||||
bool is_donaz(TString16 don, const char* tipo)
|
||||
// verifica che il tipo di donazione "don" sia del tipo "tipo"
|
||||
{
|
||||
bool is_don = FALSE;
|
||||
@ -40,8 +44,9 @@ bool xis_donaz(TString don, const char* tipo)
|
||||
return is_don;
|
||||
}
|
||||
|
||||
char xmodstato_tcs(TString tipo)
|
||||
//verifica se il controllo sanitario "tipo" è un controllo che modifica lo stato del soggetto
|
||||
char modstato_tcs(TString16 tipo)
|
||||
// verifica se il controllo sanitario "tipo" e' un controllo che modifica
|
||||
// lo stato del soggetto
|
||||
{
|
||||
char modstato = ' ';
|
||||
TTable tcs("TCS");
|
||||
@ -51,3 +56,158 @@ char xmodstato_tcs(TString tipo)
|
||||
return modstato;
|
||||
}
|
||||
|
||||
void con_reord(TRectype& soggetto, TRecord_array* controlli)
|
||||
{
|
||||
TDate data;
|
||||
TString16 tipo;
|
||||
char modstato = ' ';
|
||||
int r_ultid = -1; // riga ultima idoneità
|
||||
int r_ultstato = -1; // riga ultimo stato valido
|
||||
char penultstato = ' '; // penultimo stato valido
|
||||
char ultstato = ' '; // ultimo stato valido
|
||||
TDate dataultstato(NULLDATE); // data ultimo stato valido
|
||||
|
||||
for (int r=controlli->rows(); r>=1; r--)
|
||||
{
|
||||
const TRectype& row = controlli->row(r);
|
||||
tipo = row.get(CON_TIPOCON);
|
||||
modstato = modstato_tcs(tipo);
|
||||
if ((modstato != ' ') && (r_ultstato == -1))
|
||||
r_ultstato = r;
|
||||
else if ((modstato != ' ') && (penultstato == ' '))
|
||||
penultstato = modstato;
|
||||
if ((modstato == 'I') && (r_ultid == -1))
|
||||
r_ultid = r;
|
||||
}
|
||||
TString16 id1 = ' ';
|
||||
TString16 id2 = ' ';
|
||||
TString16 id3 = ' ';
|
||||
TString16 id4 = ' ';
|
||||
int intsi = 0;
|
||||
int intaf = 0;
|
||||
tipo = ' ';
|
||||
data = TDate(NULLDATE);
|
||||
|
||||
if (r_ultid != -1)
|
||||
{
|
||||
const TRectype& row = controlli->row(r_ultid);
|
||||
data = TDate(row.get(CON_DATACON));
|
||||
tipo = row.get(CON_TIPOCON);
|
||||
id1 = row.get(CON_IDON1);
|
||||
id2 = row.get(CON_IDON2);
|
||||
id3 = row.get(CON_IDON3);
|
||||
id4 = row.get(CON_IDON4);
|
||||
intsi = row.get_int(CON_INTSI);
|
||||
intaf = row.get_int(CON_INTAF);
|
||||
}
|
||||
soggetto.put(SOG_DATAULTID,data);
|
||||
soggetto.put(SOG_TIPOULTID,tipo);
|
||||
soggetto.put(SOG_IDON1,id1);
|
||||
soggetto.put(SOG_IDON2,id2);
|
||||
soggetto.put(SOG_IDON3,id3);
|
||||
soggetto.put(SOG_IDON4,id4);
|
||||
soggetto.put(SOG_INTSI,intsi);
|
||||
soggetto.put(SOG_INTAF,intaf);
|
||||
|
||||
tipo = ' ';
|
||||
if (r_ultstato != -1)
|
||||
{
|
||||
const TRectype& row = controlli->row(r_ultstato);
|
||||
dataultstato = TDate(row.get(CON_DATACON));
|
||||
tipo = row.get(CON_TIPOCON);
|
||||
ultstato = modstato_tcs(tipo);
|
||||
}
|
||||
soggetto.put(SOG_STATO,tipo);
|
||||
soggetto.put(SOG_DATASTATO,dataultstato);
|
||||
|
||||
don_datepross(soggetto);
|
||||
|
||||
if ((penultstato == 'S') && ((ultstato == 'I') || (ultstato == 'F')))
|
||||
{
|
||||
data = soggetto.get_date(SOG_DATAPROSSI);
|
||||
if (data < dataultstato) soggetto.put(SOG_DATAPROSSI,dataultstato);
|
||||
data = soggetto.get_date(SOG_DATAPROSAF);
|
||||
if (data < dataultstato) soggetto.put(SOG_DATAPROSAF,dataultstato);
|
||||
}
|
||||
}
|
||||
|
||||
void don_datepross(TRectype& soggetto)
|
||||
// calcola le date di prossima donazione in base a: donazioni, stato attuale, idoneità
|
||||
{
|
||||
char modstato = ' ';
|
||||
const TString16 stato = soggetto.get(SOG_STATO); // stato attuale
|
||||
const TString16 id1 = soggetto.get(SOG_IDON1); // idon. 1
|
||||
const TString16 id2 = soggetto.get(SOG_IDON2); // idon. 2
|
||||
const TString16 id3 = soggetto.get(SOG_IDON3); // idon. 3
|
||||
const TString16 id4 = soggetto.get(SOG_IDON4); // idon. 4
|
||||
const int intsi = soggetto.get_int(SOG_INTSI); // intervallo per SI
|
||||
const int intaf = soggetto.get_int(SOG_INTAF); // intervallo per AF
|
||||
const TDate dataultdon(soggetto.get_date(SOG_DATAULTDON)); // data ultima donazione
|
||||
const TString16 tipoultdon(soggetto.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 = modstato_tcs(stato);
|
||||
if (modstato == 'I' || modstato == 'F') // il soggetto è idoneo
|
||||
{
|
||||
id_si = (is_idon(id1,id2,id3,id4,IDON_SI) && intsi != 0); // il soggetto è idoneo SI
|
||||
id_af = (is_idon(id1,id2,id3,id4,IDON_AF) && intaf != 0); // il soggetto è idoneo AF
|
||||
|
||||
if (dataultdon.ok()) // se ha fatto almeno una donazione
|
||||
{
|
||||
if (is_donaz(tipoultdon,IDON_SI)) // se l'ultima donazione è una SI
|
||||
{
|
||||
if (id_si)
|
||||
{
|
||||
datasi=dataultdon;
|
||||
datasi+=intsi;
|
||||
}
|
||||
if (id_af)
|
||||
{
|
||||
dataaf=dataultdon;
|
||||
dataaf+=intaf;
|
||||
}
|
||||
}
|
||||
if (is_donaz(tipoultdon,IDON_AF)) // se l'ultima donazione è una AF
|
||||
{
|
||||
dataultsi = soggetto.get(SOG_DATAULTSI);
|
||||
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 = soggetto.get_date(SOG_DATAULTID);
|
||||
if (id_af)
|
||||
dataaf = soggetto.get_date(SOG_DATAULTID);
|
||||
}
|
||||
}
|
||||
soggetto.put(SOG_DATAPROSSI,datasi);
|
||||
soggetto.put(SOG_DATAPROSAF,dataaf);
|
||||
}
|
||||
|
||||
|
||||
7
at/atlib1.h
Executable file
7
at/atlib1.h
Executable file
@ -0,0 +1,7 @@
|
||||
#define IDON_SI "SI"
|
||||
#define IDON_AF "AF"
|
||||
|
||||
bool is_idon_one(TString16 idon, const char* tipo);
|
||||
bool is_idon(TString16 id1, TString16 id2, TString16 id3, TString16 id4, const char* tipo);
|
||||
bool is_donaz(TString16 don, const char* tipo);
|
||||
char modstato_tcs(TString16 tipo);
|
||||
26
at/atnext.cpp
Executable file
26
at/atnext.cpp
Executable file
@ -0,0 +1,26 @@
|
||||
int TFile_text::next()
|
||||
{
|
||||
CHECK(_current, "NULL current record");
|
||||
if (_current->length() > 0)
|
||||
fstream::read((char*)_current, _current->length());
|
||||
else
|
||||
TString record = "";
|
||||
bool trovato = FALSE;
|
||||
while (!trovato && good() && !eof()) do
|
||||
{
|
||||
char readchar = get();
|
||||
const char* separator = separator();
|
||||
if (readchar = separator[0])
|
||||
{
|
||||
int actchar = 1
|
||||
while (actchar < separator.len() && readchar = separator[actchar-1]) do
|
||||
{
|
||||
actchar++;
|
||||
}
|
||||
}
|
||||
else
|
||||
record << readchar;
|
||||
}
|
||||
// manca la lettura per file con separatore
|
||||
return 0;
|
||||
}
|
||||
65
at/avis.mnu
Executable file
65
at/avis.mnu
Executable file
@ -0,0 +1,65 @@
|
||||
0|Menu principale|20
|
||||
0|Archivi|1
|
||||
0|Tabelle|2
|
||||
0|Operazioni periodiche|3
|
||||
0|Elenchi di soggetti|4
|
||||
0|Stampe per convocazioni|5
|
||||
0|Stampe di controllo|6
|
||||
0|Stampa tessere associative|at1 -3
|
||||
0|Manutenzione|99
|
||||
1|Archivi|21
|
||||
1|Soggetti|at0 -0
|
||||
1|Giornaliero donazioni/controlli|at0 -1
|
||||
1|Giornaliero controlli|at0 -2
|
||||
1|Convocazioni Bologna|at0 -3
|
||||
2|Tabelle|23
|
||||
2|Sezioni|ba3 -3 at0700a 96
|
||||
2|Medici|ba3 -3 at0800a 97
|
||||
2|Gruppi aziendali|ba3 -0 gaz
|
||||
2|Benemerenze|ba3 -0 bnz
|
||||
2|Categorie donatori|ba3 -0 ctd
|
||||
2|Categorie non donatori|ba3 -0 ctn
|
||||
2|Idoneita' alla donazione|ba3 -0 ido
|
||||
2|Localita' postali|ba3 -0 lcp
|
||||
2|Luoghi di donazione|ba3 -0 ldn
|
||||
2|Luoghi di lavoro|ba3 -0 ldl
|
||||
2|Professioni|ba3 -0 prf
|
||||
2|Tipi di donazione|ba3 -0 tdn
|
||||
2|Tipi/Esiti controlli sanitari|ba3 -0 tcs
|
||||
2|Stati esteri|ba3 -0 %sta
|
||||
2|Comuni|ba4 -0
|
||||
3|Operazioni periodiche|21
|
||||
3|Chiusura|at1 -0
|
||||
3|Attribuzione benemerenze|at1 -1
|
||||
3|Sblocco sospesi|at1 -2
|
||||
4|Elenchi di soggetti|22
|
||||
4|Elenco sospesi|at2 -0
|
||||
4|Elenco per data di nascita|at2 -1
|
||||
4|Elenco esclusi|at2 -2
|
||||
4|Soggetti modificati|at2 -3
|
||||
4|Elenco idonei|at2 -4
|
||||
4|Elenco iscritti/dimessi|at2 -5
|
||||
5|Stampe per convocazioni|22
|
||||
5|Scadenze di donazione|at4 -1
|
||||
5|Urgenze|at4 -2
|
||||
5|Convocazioni Parma|at4 -3
|
||||
6|Stampe di controllo|25
|
||||
6|Medici|at6 -0
|
||||
6|Sezioni|at6 -1
|
||||
6|Benemerenze|ba3 -1 bnz
|
||||
6|Categorie donatori|ba3 -1 ctd
|
||||
6|Categorie non donatori|ba3 -1 ctn
|
||||
6|Idoneita' alla donazione|ba3 -1 ido
|
||||
6|Localita' postali|ba3 -1 lcp
|
||||
6|Luoghi di donazione|ba3 -1 ldn
|
||||
6|Luoghi di lavoro|ba3 -1 ldl
|
||||
6|Professioni|ba3 -1 prf
|
||||
6|Tipi di donazione|ba3 -1 tdn
|
||||
6|Tipi/Esiti controlli sanitari|ba3 -1 tcs
|
||||
6|Stati esteri|ba3 -1 %sta
|
||||
6|Comuni|ba6 -1
|
||||
99|Manutenzione|04
|
||||
99|Archivi|ba1
|
||||
99|Utenti|ba1 -3
|
||||
99|Attivazione|ba1 -4
|
||||
99|Backup|ba2 -1
|
||||
3
at/batbgaz.h
Executable file
3
at/batbgaz.h
Executable file
@ -0,0 +1,3 @@
|
||||
#define F_TABGAZ_CODTAB 100
|
||||
#define F_TABGAZ_DESCR 101
|
||||
#define DLG_DEL 105
|
||||
40
at/batbgaz.uml
Executable file
40
at/batbgaz.uml
Executable file
@ -0,0 +1,40 @@
|
||||
#include "batbgaz.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
#include <toolbar.h>
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Gruppi Aziendali" -1 -1 78 7
|
||||
|
||||
STRING F_TABGAZ_CODTAB 4
|
||||
BEGIN
|
||||
PROMPT 2 1 "Codice "
|
||||
FIELD CODTAB
|
||||
HELP "Inserire il codice del gruppo aziendale"
|
||||
USE GAZ
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT CODTAB F_TABGAZ_CODTAB
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@30" S0
|
||||
OUTPUT F_TABGAZ_CODTAB CODTAB
|
||||
OUTPUT F_TABGAZ_DESCR S0
|
||||
KEY 1
|
||||
FLAGS "URZ"
|
||||
END
|
||||
|
||||
STRING F_TABGAZ_DESCR 30
|
||||
BEGIN
|
||||
PROMPT 2 3 "Denominazione "
|
||||
FIELD S0
|
||||
HELP "Inserire la denominazione del gruppo aziendale"
|
||||
USE GAZ KEY 2
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT S0 F_TABGAZ_DESCR
|
||||
DISPLAY "Descrizione@30" S0
|
||||
DISPLAY "Codice" CODTAB
|
||||
COPY OUTPUT F_TABGAZ_CODTAB
|
||||
KEY 2
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
||||
@ -4,13 +4,13 @@ TOOLBAR "" 0 20 0 2
|
||||
#include <toolbar.h>
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Località postali" -1 -1 78 7
|
||||
PAGE "Localita' postali" -1 -1 78 7
|
||||
|
||||
STRING F_TABLCP_CODTAB 4
|
||||
BEGIN
|
||||
PROMPT 2 1 "Codice "
|
||||
PROMPT 2 1 "Codice "
|
||||
FIELD CODTAB
|
||||
HELP "Inserire il codice della località"
|
||||
HELP "Inserire il codice della localita'"
|
||||
USE LCP
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT CODTAB F_TABLCP_CODTAB
|
||||
@ -25,9 +25,9 @@ END
|
||||
|
||||
STRING F_TABLCP_LOCALITA 30
|
||||
BEGIN
|
||||
PROMPT 2 3 "Località "
|
||||
PROMPT 2 3 "Localita' "
|
||||
FIELD S0
|
||||
HELP "Inserire la denominazione della località"
|
||||
HELP "Inserire la denominazione della localita'"
|
||||
USE LCP KEY 2
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT S0 F_TABLCP_LOCALITA
|
||||
@ -40,7 +40,7 @@ END
|
||||
|
||||
STRING F_TABLCP_CAP 5
|
||||
BEGIN
|
||||
PROMPT 2 5 "CAP "
|
||||
PROMPT 2 5 "CAP "
|
||||
FIELD S6
|
||||
HELP "Inserire il CAP della località"
|
||||
CHECKTYPE REQUIRED
|
||||
@ -49,7 +49,7 @@ END
|
||||
|
||||
STRING F_TABLCP_COM 4
|
||||
BEGIN
|
||||
PROMPT 2 7 "Comune "
|
||||
PROMPT 2 7 "Comune "
|
||||
FIELD S7
|
||||
FLAGS "U"
|
||||
USE LF_COMUNI
|
||||
|
||||
3
at/batbldl.h
Executable file
3
at/batbldl.h
Executable file
@ -0,0 +1,3 @@
|
||||
#define F_TABLDL_CODTAB 100
|
||||
#define F_TABLDL_DESCR 101
|
||||
#define DLG_DEL 105
|
||||
40
at/batbldl.uml
Executable file
40
at/batbldl.uml
Executable file
@ -0,0 +1,40 @@
|
||||
#include "batbldl.h"
|
||||
|
||||
TOOLBAR "" 0 20 0 2
|
||||
#include <toolbar.h>
|
||||
ENDPAGE
|
||||
|
||||
PAGE "Luoghi di lavoro" -1 -1 78 7
|
||||
|
||||
STRING F_TABLDL_CODTAB 4
|
||||
BEGIN
|
||||
PROMPT 2 1 "Codice "
|
||||
FIELD CODTAB
|
||||
HELP "Inserire il codice del luogo di lavoro"
|
||||
USE LDL
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT CODTAB F_TABLDL_CODTAB
|
||||
DISPLAY "Codice" CODTAB
|
||||
DISPLAY "Descrizione@40" S0
|
||||
OUTPUT F_TABLDL_CODTAB CODTAB
|
||||
OUTPUT F_TABLDL_DESCR S0
|
||||
KEY 1
|
||||
FLAGS "URZ"
|
||||
END
|
||||
|
||||
STRING F_TABLDL_DESCR 40
|
||||
BEGIN
|
||||
PROMPT 2 3 "Descrizione "
|
||||
FIELD S0
|
||||
HELP "Inserire la descrizione del luogo di lavoro"
|
||||
USE LDL KEY 2
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT S0 F_TABLDL_DESCR
|
||||
DISPLAY "Descrizione@40" S0
|
||||
DISPLAY "Codice" CODTAB
|
||||
COPY OUTPUT F_TABLDL_CODTAB
|
||||
KEY 2
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
ENDMASK
|
||||
3
at/batbprf.h
Executable file
3
at/batbprf.h
Executable file
@ -0,0 +1,3 @@
|
||||
#define F_TABPRF_CODTAB 100
|
||||
#define F_TABPRF_DESCR 101
|
||||
#define DLG_DEL 105
|
||||
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