diff --git a/at/at0100a.uml b/at/at0100a.uml index 5f3560b89..d2a8a55a7 100755 --- a/at/at0100a.uml +++ b/at/at0100a.uml @@ -89,8 +89,9 @@ BEGIN PROMPT 38 3 "Tessera " FIELDS TESSAVIS FLAGS "U" - KEY 5 - USE LF_SOGGETTI KEY 5 + KEY 4 + MESSAGE COPY,5@ + USE LF_SOGGETTI KEY 4 INPUT TESSAVIS F_TESSAVIS DISPLAY "Tessera" TESSAVIS DISPLAY "Codice@8" CODICE @@ -114,6 +115,7 @@ BEGIN PROMPT 2 6 "Sez. " FIELD CODSEZ FLAGS "U" + MESSAGE COPY,13@ USE LF_SEZIONI INPUT CODSEZ F_CODSEZ INPUT CODSOT F_CODSOT @@ -134,6 +136,7 @@ END STRING F_DENSEZ 24 BEGIN PROMPT 12 6 "" + MESSAGE COPY,14@ USE LF_SEZIONI KEY 2 INPUT DENSEZ F_DENSEZ DISPLAY "Sezione@25" DENSEZ @@ -152,6 +155,7 @@ BEGIN PROMPT 40 6 "Sot. " FIELD CODSOT FLAGS "U" + MESSAGE COPY,15@ COPY ALL F_CODSEZ CHECKTYPE NORMAL HELP "Codice sottogruppo di appartenenza" @@ -162,6 +166,7 @@ END STRING F_DENSOT 24 BEGIN PROMPT 50 6 "" + MESSAGE COPY,16@ COPY USE F_DENSEZ INPUT DENSEZ F_DENSEZ INPUT DENSOT F_DENSOT @@ -177,6 +182,7 @@ STRING F_CATDON 2 BEGIN PROMPT 2 7 "Cat. " FIELD CATDON + MESSAGE COPY,11@ FLAGS "U" USE CTD INPUT CODTAB F_CATDON @@ -193,6 +199,7 @@ STRING F_DESC_CATDON 25 BEGIN PROMPT 12 7 "" FLAGS "D" + MESSAGE COPY,12@ END DATE F_DATAISC @@ -253,7 +260,7 @@ BEGIN HELP "Codice comune di residenza" END -STRING F_DOM_DENCOM 30 +STRING F_DOM_DENCOM 50 30 BEGIN PROMPT 30 11 "" USE LF_COMUNI KEY 2 @@ -340,7 +347,7 @@ BEGIN HELP "Codice comune di residenza" END -STRING F_RES_DENCOM 30 +STRING F_RES_DENCOM 50 30 BEGIN PROMPT 30 14 "" USE LF_COMUNI KEY 2 @@ -484,38 +491,89 @@ PAGE "Assoc." -1 -1 78 20 GROUPBOX DLG_NULL 77 5 BEGIN - PROMPT 1 0 "" + PROMPT 1 0 "Dati identificativi" FLAGS "R" END NUMBER DLG_NULL 8 BEGIN - PROMPT 2 1 "Codice " + // codice + PROMPT 2 1 "" FLAGS "D" GROUP 1 END STRING DLG_NULL 25 BEGIN - PROMPT 2 2 "Cognome e nome " + // cognome + PROMPT 12 1 "" FLAGS "D" GROUP 2 END STRING DLG_NULL 25 BEGIN - PROMPT 46 2 "" + // nome + PROMPT 38 1 "" FLAGS "D" GROUP 3 END DATE DLG_NULL BEGIN - PROMPT 2 3 "Nato il " + // data nascita + PROMPT 66 1 "" FLAGS "D" GROUP 4 END +TEXT DLG_NULL +BEGIN + PROMPT 2 2 "Sez./Sot." +END + +STRING DLG_NULL 25 +BEGIN + // denominazione sezione + PROMPT 12 2 "" + FLAGS "D" + GROUP 14 +END + +STRING DLG_NULL 25 +BEGIN + // denominazione sottogruppo + PROMPT 38 2 "" + FLAGS "D" + GROUP 16 +END + +TEXT DLG_NULL +BEGIN + PROMPT 2 3 "Categoria" +END + +STRING DLG_NULL 25 +BEGIN + // descrizione categoria + PROMPT 12 3 "" + FLAGS "D" + GROUP 12 +END + +TEXT DLG_NULL +BEGIN + PROMPT 57 3 "Tessera" +END + +STRING DLG_NULL 6 +BEGIN + // tessera + PROMPT 66 3 "" + FLAGS "D" + GROUP 5 +END + GROUPBOX DLG_NULL 77 7 BEGIN PROMPT 1 5 "Altri dati associativi/identificativi" @@ -690,7 +748,7 @@ END GROUPBOX DLG_NULL 77 4 BEGIN - PROMPT 1 12 "Tipizzazione" + PROMPT 1 12 "Dati gruppo-ematici" END LISTBOX F_GRUPPOAB0 5 @@ -698,7 +756,7 @@ BEGIN PROMPT 2 13 "Gruppo AB0 " FIELD GRUPPOAB0 FLAGS "U" -#include "gruppo.h" +#include "sgruppo.h" END LISTBOX F_RHANTID 4 @@ -706,13 +764,14 @@ BEGIN PROMPT 22 13 "Rh/AntiD " FIELD RHANTID FLAGS "U" -#include "rh.h" +#include "srh.h" END STRING F_FENOTIPORH 6 BEGIN PROMPT 39 13 "Fen.Rh " FIELD FENOTIPORH + MESSAGE COPY,8@ END LISTBOX F_KELL 4 @@ -720,7 +779,7 @@ BEGIN PROMPT 54 13 "Kell " FIELD KELL FLAGS "U" -#include "kell.h" +#include "skell.h" END LISTBOX F_DU 4 @@ -728,7 +787,7 @@ BEGIN PROMPT 67 13 "Du " FIELD DU FLAGS "U" -#include "rh.h" +#include "sdu.h" END LISTBOX F_ANTICORPI 4 @@ -763,7 +822,7 @@ END STRING F_PUNTORACC 4 BEGIN - PROMPT 32 17 "Punto racc. " + PROMPT 32 17 "Punto prel. " FIELD PUNTORACC FLAGS "U" USE LDN @@ -773,11 +832,11 @@ BEGIN OUTPUT F_PUNTORACC CODTAB OUTPUT F_DESC_PUNTORACC S0 CHECKTYPE NORMAL - WARNING "Codice punto di raccolta non presente" - HELP "Punto di raccolta per la convocazione" + WARNING "Codice punto di prelievo non presente" + HELP "Punto di prelievo per la convocazione" END -STRING F_DESC_PUNTORACC 40 25 +STRING F_DESC_PUNTORACC 50 25 BEGIN PROMPT 51 17 "" FLAGS "D" @@ -893,46 +952,132 @@ PAGE "Situaz." -1 -1 78 20 GROUPBOX DLG_NULL 77 5 BEGIN - PROMPT 1 0 "" + PROMPT 1 0 "Dati identificativi" FLAGS "R" END NUMBER DLG_NULL 8 BEGIN - PROMPT 2 1 "Codice " + // codice + PROMPT 2 1 "" FLAGS "D" GROUP 1 END STRING DLG_NULL 25 BEGIN - PROMPT 2 2 "Cognome e nome " + // cognome + PROMPT 12 1 "" FLAGS "D" GROUP 2 END STRING DLG_NULL 25 BEGIN - PROMPT 46 2 "" + // nome + PROMPT 38 1 "" FLAGS "D" GROUP 3 END DATE DLG_NULL BEGIN - PROMPT 2 3 "Nato il " + // data nascita + PROMPT 66 1 "" FLAGS "D" GROUP 4 END -GROUPBOX DLG_NULL 77 7 +TEXT DLG_NULL +BEGIN + PROMPT 2 2 "Sez./Sot." +END + +STRING DLG_NULL 25 +BEGIN + // denominazione sezione + PROMPT 12 2 "" + FLAGS "D" + GROUP 14 +END + +STRING DLG_NULL 25 +BEGIN + // denominazione sottogruppo + PROMPT 38 2 "" + FLAGS "D" + GROUP 16 +END + +TEXT DLG_NULL +BEGIN + PROMPT 2 3 "Categoria" +END + +STRING DLG_NULL 25 +BEGIN + // descrizione categoria + PROMPT 12 3 "" + FLAGS "D" + GROUP 12 +END + +TEXT DLG_NULL +BEGIN + PROMPT 57 3 "Tessera" +END + +STRING DLG_NULL 6 +BEGIN + // tessera + PROMPT 66 3 "" + FLAGS "D" + GROUP 5 +END + +GROUPBOX DLG_NULL 77 8 BEGIN PROMPT 1 5 "Situazione sanitaria" END +STRING DLG_NULL 5 +BEGIN + PROMPT 2 6 "Gruppo AB0 " + FLAGS "D" + GROUP 6 +END + +STRING DLG_NULL 4 +BEGIN + PROMPT 22 6 "Rh/AntiD " + FLAGS "D" + GROUP 7 +END + +STRING DLG_NULL 6 +BEGIN + PROMPT 39 6 "Fen.Rh " + FLAGS "D" + GROUP 8 +END + +STRING DLG_NULL 4 +BEGIN + PROMPT 54 6 "Kell " + FLAGS "D" + GROUP 9 +END + +STRING DLG_NULL 4 +BEGIN + PROMPT 67 6 "Du " + FLAGS "D" + GROUP 10 +END + STRING F_STATO 2 BEGIN - PROMPT 2 6 "Stato attuale " + PROMPT 2 7 "Stato attuale " FIELD STATO FLAGS "D" USE TCS @@ -943,20 +1088,20 @@ END STRING F_DESCSTATO 20 BEGIN - PROMPT 20 6 "" + PROMPT 20 7 "" FLAGS "D" END DATE F_DATASTATO BEGIN - PROMPT 52 6 "Data stato " + PROMPT 52 7 "Data stato " FIELD DATASTATO FLAGS "D" END STRING F_PROS_STATO 2 BEGIN - PROMPT 2 7 "Stato pross. " + PROMPT 2 8 "Stato pross. " FIELD PROS_STATO FLAGS "D" USE TCS @@ -967,20 +1112,20 @@ END STRING F_DESCPROS_STATO 20 BEGIN - PROMPT 20 7 "" + PROMPT 20 8 "" FLAGS "D" END DATE F_DATA_PROS BEGIN - PROMPT 52 7 "Data prossimo " + PROMPT 52 8 "Data prossimo " FIELD DATA_PROS FLAGS "D" END STRING F_IDON1 2 BEGIN - PROMPT 2 8 "Tipi di idon. " + PROMPT 2 9 "Tipi di idon. " FIELD IDON1 FLAGS "D" USE IDO @@ -991,13 +1136,13 @@ END STRING F_DESC_ID1 25 BEGIN - PROMPT 20 8 "" + PROMPT 20 9 "" FLAGS "D" END STRING F_IDON2 2 BEGIN - PROMPT 47 8 "" + PROMPT 47 9 "" FIELD IDON2 FLAGS "D" USE IDO @@ -1008,13 +1153,13 @@ END STRING F_DESC_ID2 25 BEGIN - PROMPT 51 8 "" + PROMPT 51 9 "" FLAGS "D" END STRING F_IDON3 2 BEGIN - PROMPT 2 9 " " + PROMPT 2 10 " " FIELD IDON3 FLAGS "D" USE IDO @@ -1025,13 +1170,13 @@ END STRING F_DESC_ID3 25 BEGIN - PROMPT 20 9 "" + PROMPT 20 10 "" FLAGS "D" END STRING F_IDON4 2 BEGIN - PROMPT 47 9 "" + PROMPT 47 10 "" FIELD IDON4 FLAGS "D" USE IDO @@ -1042,46 +1187,46 @@ END STRING F_DESC_ID4 25 BEGIN - PROMPT 51 9 "" + PROMPT 51 10 "" FLAGS "D" END DATE F_DATAULTID BEGIN - PROMPT 2 10 "Data ult. id. " + PROMPT 2 11 "Data ult. id. " FIELD DATAULTID FLAGS "D" END STRING F_TIPOULTID 2 BEGIN - PROMPT 30 10 "Tipo " + PROMPT 30 11 "Tipo " FIELD TIPOULTID FLAGS "D" END GROUPBOX DLG_NULL 77 8 BEGIN - PROMPT 1 12 "Situazione donazioni" + PROMPT 1 13 "Situazione donazioni" END NUMBER F_TOTDON 3 BEGIN - PROMPT 2 13 "Totale " + PROMPT 2 14 "Totale " FIELD TOTDON FLAGS "D" END DATE F_DATAULTDON BEGIN - PROMPT 15 13 "Data/tipo ultima " + PROMPT 15 14 "Data/tipo ultima " FIELD DATAULTDON FLAGS "D" END STRING F_TIPOULTDON 2 BEGIN - PROMPT 44 13 "" + PROMPT 44 14 "" FIELD TIPOULTDON FLAGS "D" USE TDN @@ -1092,76 +1237,76 @@ END STRING F_DESC_ULTDON 25 BEGIN - PROMPT 48 13 "" + PROMPT 48 14 "" FLAGS "D" END NUMBER F_TOTDONSI 3 BEGIN - PROMPT 2 14 "Totale don. : Sangue intero " + PROMPT 2 15 "Totale don. : Sangue intero " FIELD TOTDONSI FLAGS "D" END NUMBER F_TOTDONAF 3 BEGIN - PROMPT 48 14 "Aferesi " + PROMPT 48 15 "Aferesi " FIELD TOTDONAF FLAGS "D" END DATE F_DATAULTSI BEGIN - PROMPT 2 15 "Date ultima : Sangue intero " + PROMPT 2 16 "Date ultima : Sangue intero " FIELD DATAULTSI FLAGS "D" END DATE F_DATAULTAF BEGIN - PROMPT 48 15 "Aferesi " + PROMPT 48 16 "Aferesi " FIELD DATAULTAF FLAGS "D" END NUMBER F_INTSI 3 BEGIN - PROMPT 2 16 "Intervalli : Sangue intero " + PROMPT 2 17 "Intervalli : Sangue intero " FIELD INTSI FLAGS "D" END NUMBER F_INTAF 3 BEGIN - PROMPT 48 16 "Aferesi " + PROMPT 48 17 "Aferesi " FIELD INTAF FLAGS "D" END DATE F_DATAPROSSI BEGIN - PROMPT 2 17 "Date prossima : Sangue intero " + PROMPT 2 18 "Date prossima : Sangue intero " FIELD DATAPROSSI FLAGS "D" END DATE F_DATAPROSAF BEGIN - PROMPT 48 17 "Aferesi " + PROMPT 48 18 "Aferesi " FIELD DATAPROSAF FLAGS "D" END DATE F_DATACONV BEGIN - PROMPT 2 18 "Convocazioni : Data ultima " + PROMPT 2 19 "Convocazioni : Data ultima " FIELD DATACONV //FLAGS "D" END NUMBER F_NUMCONV 3 BEGIN - PROMPT 48 18 "Numero " + PROMPT 48 19 "Numero " FIELD NUMCONV //FLAGS "D" END @@ -1172,38 +1317,89 @@ PAGE "Vari" -1 -1 78 20 GROUPBOX DLG_NULL 77 5 BEGIN - PROMPT 1 0 "" + PROMPT 1 0 "Dati identificativi" FLAGS "R" END NUMBER DLG_NULL 8 BEGIN - PROMPT 2 1 "Codice " + // codice + PROMPT 2 1 "" FLAGS "D" GROUP 1 END STRING DLG_NULL 25 BEGIN - PROMPT 2 2 "Cognome e nome " + // cognome + PROMPT 12 1 "" FLAGS "D" GROUP 2 END STRING DLG_NULL 25 BEGIN - PROMPT 46 2 "" + // nome + PROMPT 38 1 "" FLAGS "D" GROUP 3 END DATE DLG_NULL BEGIN - PROMPT 2 3 "Nato il " + // data nascita + PROMPT 66 1 "" FLAGS "D" GROUP 4 END +TEXT DLG_NULL +BEGIN + PROMPT 2 2 "Sez./Sot." +END + +STRING DLG_NULL 25 +BEGIN + // denominazione sezione + PROMPT 12 2 "" + FLAGS "D" + GROUP 14 +END + +STRING DLG_NULL 25 +BEGIN + // denominazione sottogruppo + PROMPT 38 2 "" + FLAGS "D" + GROUP 16 +END + +TEXT DLG_NULL +BEGIN + PROMPT 2 3 "Categoria" +END + +STRING DLG_NULL 25 +BEGIN + // descrizione categoria + PROMPT 12 3 "" + FLAGS "D" + GROUP 12 +END + +TEXT DLG_NULL +BEGIN + PROMPT 57 3 "Tessera" +END + +STRING DLG_NULL 6 +BEGIN + // tessera + PROMPT 66 3 "" + FLAGS "D" + GROUP 5 +END + GROUPBOX DLG_NULL 77 6 BEGIN PROMPT 1 5 "Dati statistici" @@ -1380,38 +1576,89 @@ PAGE "Donazioni" -1 -1 78 20 GROUPBOX DLG_NULL 77 5 BEGIN - PROMPT 1 0 "" + PROMPT 1 0 "Dati identificativi" FLAGS "R" END NUMBER DLG_NULL 8 BEGIN - PROMPT 2 1 "Codice " + // codice + PROMPT 2 1 "" FLAGS "D" GROUP 1 END STRING DLG_NULL 25 BEGIN - PROMPT 2 2 "Cognome e nome " + // cognome + PROMPT 12 1 "" FLAGS "D" GROUP 2 END STRING DLG_NULL 25 BEGIN - PROMPT 46 2 "" + // nome + PROMPT 38 1 "" FLAGS "D" GROUP 3 END DATE DLG_NULL BEGIN - PROMPT 2 3 "Nato il " + // data nascita + PROMPT 66 1 "" FLAGS "D" GROUP 4 END +TEXT DLG_NULL +BEGIN + PROMPT 2 2 "Sez./Sot." +END + +STRING DLG_NULL 25 +BEGIN + // denominazione sezione + PROMPT 12 2 "" + FLAGS "D" + GROUP 14 +END + +STRING DLG_NULL 25 +BEGIN + // denominazione sottogruppo + PROMPT 38 2 "" + FLAGS "D" + GROUP 16 +END + +TEXT DLG_NULL +BEGIN + PROMPT 2 3 "Categoria" +END + +STRING DLG_NULL 25 +BEGIN + // descrizione categoria + PROMPT 12 3 "" + FLAGS "D" + GROUP 12 +END + +TEXT DLG_NULL +BEGIN + PROMPT 57 3 "Tessera" +END + +STRING DLG_NULL 6 +BEGIN + // tessera + PROMPT 66 3 "" + FLAGS "D" + GROUP 5 +END + GROUPBOX DLG_NULL 77 3 BEGIN PROMPT 1 5 "Donazioni non dettagliate" @@ -1451,8 +1698,8 @@ BEGIN PROMPT 1 8 "" ITEM "Data@10F" ITEM "Tipo@F" - ITEM "Luogo@6" - ITEM "Descrizione luogo@40" + ITEM "Punto@6" + ITEM "Descrizione punto@40" ITEM "Et. sacca" ITEM "1ø" ITEM "Sez." @@ -1465,38 +1712,89 @@ PAGE "Controlli" -1 -1 78 20 GROUPBOX DLG_NULL 77 5 BEGIN - PROMPT 1 0 "" + PROMPT 1 0 "Dati identificativi" FLAGS "R" END NUMBER DLG_NULL 8 BEGIN - PROMPT 2 1 "Codice " + // codice + PROMPT 2 1 "" FLAGS "D" GROUP 1 END STRING DLG_NULL 25 BEGIN - PROMPT 2 2 "Cognome e nome " + // cognome + PROMPT 12 1 "" FLAGS "D" GROUP 2 END STRING DLG_NULL 25 BEGIN - PROMPT 46 2 "" + // nome + PROMPT 38 1 "" FLAGS "D" GROUP 3 END DATE DLG_NULL BEGIN - PROMPT 2 3 "Nato il " + // data nascita + PROMPT 66 1 "" FLAGS "D" GROUP 4 END +TEXT DLG_NULL +BEGIN + PROMPT 2 2 "Sez./Sot." +END + +STRING DLG_NULL 25 +BEGIN + // denominazione sezione + PROMPT 12 2 "" + FLAGS "D" + GROUP 14 +END + +STRING DLG_NULL 25 +BEGIN + // denominazione sottogruppo + PROMPT 38 2 "" + FLAGS "D" + GROUP 16 +END + +TEXT DLG_NULL +BEGIN + PROMPT 2 3 "Categoria" +END + +STRING DLG_NULL 25 +BEGIN + // descrizione categoria + PROMPT 12 3 "" + FLAGS "D" + GROUP 12 +END + +TEXT DLG_NULL +BEGIN + PROMPT 57 3 "Tessera" +END + +STRING DLG_NULL 6 +BEGIN + // tessera + PROMPT 66 3 "" + FLAGS "D" + GROUP 5 +END + SPREADSHEET F_CONTROLLI BEGIN PROMPT 1 5 "Controlli sanitari" @@ -1512,7 +1810,6 @@ BEGIN ITEM "Pr.data" ITEM "Mot." ITEM "Responsabile@50" - END ENDPAGE @@ -1521,38 +1818,89 @@ PAGE "Ben./Sto." -1 -1 78 20 GROUPBOX DLG_NULL 77 5 BEGIN - PROMPT 1 0 "" + PROMPT 1 0 "Dati identificativi" FLAGS "R" END NUMBER DLG_NULL 8 BEGIN - PROMPT 2 1 "Codice " + // codice + PROMPT 2 1 "" FLAGS "D" GROUP 1 END STRING DLG_NULL 25 BEGIN - PROMPT 2 2 "Cognome e nome " + // cognome + PROMPT 12 1 "" FLAGS "D" GROUP 2 END STRING DLG_NULL 25 BEGIN - PROMPT 46 2 "" + // nome + PROMPT 38 1 "" FLAGS "D" GROUP 3 END DATE DLG_NULL BEGIN - PROMPT 2 3 "Nato il " + // data nascita + PROMPT 66 1 "" FLAGS "D" GROUP 4 END +TEXT DLG_NULL +BEGIN + PROMPT 2 2 "Sez./Sot." +END + +STRING DLG_NULL 25 +BEGIN + // denominazione sezione + PROMPT 12 2 "" + FLAGS "D" + GROUP 14 +END + +STRING DLG_NULL 25 +BEGIN + // denominazione sottogruppo + PROMPT 38 2 "" + FLAGS "D" + GROUP 16 +END + +TEXT DLG_NULL +BEGIN + PROMPT 2 3 "Categoria" +END + +STRING DLG_NULL 25 +BEGIN + // descrizione categoria + PROMPT 12 3 "" + FLAGS "D" + GROUP 12 +END + +TEXT DLG_NULL +BEGIN + PROMPT 57 3 "Tessera" +END + +STRING DLG_NULL 6 +BEGIN + // tessera + PROMPT 66 3 "" + FLAGS "D" + GROUP 5 +END + SPREADSHEET F_BENEMERENZE -1 7 BEGIN PROMPT 2 5 "Benemerenze" @@ -1618,7 +1966,7 @@ END STRING F_D_LUOGODON 4 BEGIN - PROMPT 2 4 "Luogo donazione " + PROMPT 2 4 "Punto prelievo " FIELD LF_DONAZ->LUOGODON FLAGS "U" USE LDN @@ -1628,8 +1976,8 @@ BEGIN OUTPUT F_D_LUOGODON CODTAB OUTPUT F_D_DESC_LUOGODON S0 CHECKTYPE NORMAL - WARNING "Codice luogo donazione non presente" - HELP "Luogo donazione" + WARNING "Codice punto di prelievo non presente" + HELP "Punto di prelievo" END STRING F_D_DESC_LUOGODON 50 40 diff --git a/at/at0100b.uml b/at/at0100b.uml index 42554016d..c5a308593 100755 --- a/at/at0100b.uml +++ b/at/at0100b.uml @@ -68,7 +68,7 @@ END STRING F_LUOGOGEN 4 BEGIN - PROMPT 2 9 "Luogo don. " + PROMPT 2 9 "Punto prel." FLAGS "U" USE LDN INPUT CODTAB F_LUOGOGEN @@ -77,8 +77,8 @@ BEGIN OUTPUT F_LUOGOGEN CODTAB OUTPUT F_D_LUOGOGEN S0 CHECKTYPE NORMAL - WARNING "Codice luogo donazione non presente" - HELP "Luogo donazione" + WARNING "Codice punto di prelievo non presente" + HELP "Punto di prelievo" END STRING F_D_LUOGOGEN 25 @@ -97,7 +97,7 @@ BEGIN PROMPT 50 2 "" ITEM "Data@10" ITEM "Tipo" - ITEM "Luogo" + ITEM "Punto" END ENDPAGE @@ -129,7 +129,7 @@ END STRING F_G_LUOGO 4 BEGIN - PROMPT 2 5 "Luogo donazione " + PROMPT 2 5 "Punto prelievo " FLAGS "U" USE LDN INPUT CODTAB F_G_LUOGO @@ -138,8 +138,8 @@ BEGIN OUTPUT F_G_LUOGO CODTAB OUTPUT F_G_D_LUOGO S0 CHECKTYPE NORMAL - WARNING "Codice luogo donazione non presente" - HELP "Luogo donazione" + WARNING "Codice punto di prelievo non presente" + HELP "Punto di prelievo" END STRING F_G_D_TIPO 25 diff --git a/at/at0200.cpp b/at/at0200.cpp index 0e743d9c2..b8187bc19 100755 --- a/at/at0200.cpp +++ b/at/at0200.cpp @@ -27,7 +27,7 @@ #define ALIAS_CTD 100 -class TDonaz_app : public TApplication +class TGiornalieroDC : public TApplication { TMask* _msk; TRelation* _rel; @@ -40,6 +40,11 @@ class TDonaz_app : public TApplication TRecord_array* _scontrolli; TAssoc_array* _asoggetti; // array dei soggetti inseriti per controllare doppio ins. bool _modified; + long _progins; + // parametri di sezione + int _numdon1, _numdon2; + TString16 _catini1, _catfin1, _catini2, _catfin2; + bool _sttess2, _dataisc; protected: @@ -54,18 +59,19 @@ protected: bool check_sog_sheet(const char* codsog); static bool nome_handler(TMask_field& f, KEY k); + static bool codice_handler(TMask_field& f, KEY k); static bool soggetti_notify(TSheet_field& s, int r, KEY k); void add_rows_soggetti(TSheet_field& s, int count = 20, int start = 0); static bool ins_controlli_handler(TMask_field& f, KEY k); public: - TDonaz_app() {} + TGiornalieroDC() {} }; -HIDDEN inline TDonaz_app& app() { return (TDonaz_app&) main_app(); } +HIDDEN inline TGiornalieroDC& app() { return (TGiornalieroDC&) main_app(); } -bool TDonaz_app::ins_controlli_handler(TMask_field& f, KEY k) +bool TGiornalieroDC::ins_controlli_handler(TMask_field& f, KEY k) { if (k == K_SPACE) { @@ -77,16 +83,17 @@ bool TDonaz_app::ins_controlli_handler(TMask_field& f, KEY k) return TRUE; } -void TDonaz_app::add_rows_soggetti(TSheet_field& s, int count, int start) +void TGiornalieroDC::add_rows_soggetti(TSheet_field& s, int count, int start) { if (start == 0) s.destroy(); for (int r=start; r<=start+count-1; r++) - TToken_string& row = s.row(r); + s.row(r); } -bool TDonaz_app::create() +bool TGiornalieroDC::create() { + TApplication::create(); _modified = FALSE; _msk = new TMask("at0200a"); _rel = new TRelation(LF_SOGGETTI); @@ -97,19 +104,29 @@ bool TDonaz_app::create() _sdonazioni = new TRecord_array(LF_DONAZ,DON_PROGDON); _scontrolli = new TRecord_array(LF_CONTSAN,CON_PROGCON); _asoggetti = new TAssoc_array(); - _msk->set_handler(F_INS_CONTROLLI,ins_controlli_handler); TSheet_field& ss = (TSheet_field&)_msk->field(F_SOGGETTI); ss.set_notify(soggetti_notify); - ss.sheet_mask().set_handler(F_S_NOME,nome_handler); - + ss.sheet_mask().set_handler(F_S_CODICE,codice_handler); + TConfig config(CONFIG_STUDIO); + _numdon1 = config.get_int("NumDon1"); + _numdon2 = config.get_int("NumDon2"); + _catini1 = config.get("CatIni1"); + _catfin1 = config.get("CatFin1"); + _catini2 = config.get("CatIni2"); + _catfin2 = config.get("CatFin2"); + _sttess2 = config.get_bool("StTess2"); + _dataisc = config.get_bool("DataIsc"); + _donaz->setkey(3); + _donaz->last(); + _progins = _donaz->get_long(DON_PROGINS); + _donaz->setkey(1); dispatch_e_menu(BAR_ITEM(1)); - return TRUE; } -bool TDonaz_app::destroy() +bool TGiornalieroDC::destroy() { delete _rel; delete _msk; @@ -119,10 +136,10 @@ bool TDonaz_app::destroy() delete _sdonazioni; delete _scontrolli; delete _asoggetti; - return TRUE; + return TApplication::destroy(); } -bool TDonaz_app::menu(MENU_TAG m) +bool TGiornalieroDC::menu(MENU_TAG m) { TMask& msk = get_mask(); const TDate oggi(TODAY); @@ -130,8 +147,9 @@ bool TDonaz_app::menu(MENU_TAG m) do { TSheet_field& s = (TSheet_field&)msk.field(F_SOGGETTI); - s.reset(); - add_rows_soggetti(s); + //s.reset(); + if (s.items() == 0) + add_rows_soggetti(s); _asoggetti->destroy(); msk.set(F_DATADON,oggi); tasto = msk.run(); @@ -141,21 +159,23 @@ bool TDonaz_app::menu(MENU_TAG m) { if (_modified) if (yesno_box("Registrare le modifiche?")) - TDonaz_app::write(s); + TGiornalieroDC::write(s); _modified = FALSE; msk.reset(); } break; case K_SAVE: // registra { - TDonaz_app::write(s); + TGiornalieroDC::write(s); _modified = FALSE; - msk.reset(); + msk.reset(); //verificare se va tolta } break; case K_INS: // nuovo { - TDonaz_app::write(s); + if (_modified) + if (yesno_box("Registrare le modifiche?")) + TGiornalieroDC::write(s); _modified = FALSE; msk.reset(); } @@ -164,7 +184,7 @@ bool TDonaz_app::menu(MENU_TAG m) { if (_modified) if (yesno_box("Registrare le modifiche?")) - TDonaz_app::write(s); + TGiornalieroDC::write(s); msk.reset(); _modified = FALSE; } @@ -175,7 +195,7 @@ bool TDonaz_app::menu(MENU_TAG m) return FALSE; } -int TDonaz_app::write(TSheet_field& s) +int TGiornalieroDC::write(TSheet_field& s) { const TMask& m = s.mask(); @@ -186,17 +206,14 @@ int TDonaz_app::write(TSheet_field& s) pi = new TProgind(items,"Registrazione donazioni e controlli", FALSE, TRUE, 10); pi->setstatus(1); TLocalisamfile& sog = get_relation()->lfile(); - TLocalisamfile& rconv(LF_RCONVOC); + TLocalisamfile rconv(LF_RCONVOC); for (int r=1; r<=s.items(); r++) { - pi->addstatus(1); - TToken_string& row = s.row(r-1); const long codsog = row.get_long(0); if (codsog != 0) { - //TLocalisamfile& sog = get_relation()->lfile(); sog.setkey(1); sog.zero(); sog.put(SOG_CODICE, codsog); @@ -251,7 +268,7 @@ int TDonaz_app::write(TSheet_field& s) if (!exist) _scontrolli->write(TRUE); } - + _progins++; TRectype* rec = new TRectype(LF_DONAZ); rec->put(DON_CODICE, row.get(0)); rec->put(DON_DATADON, m.get(F_DATADON)); @@ -261,6 +278,7 @@ int TDonaz_app::write(TSheet_field& s) rec->put(DON_CODSEZ,sog.get(SOG_CODSEZ)); rec->put(DON_CODSOT,sog.get(SOG_CODSOT)); + rec->put(DON_PROGINS,_progins); bool insert = FALSE; bool exist = FALSE; @@ -318,7 +336,7 @@ int TDonaz_app::write(TSheet_field& s) int err = rconv.read(); if (err == NOERR) { - rconv.put(RCV_ANNULLATO,TRUE) + rconv.put(RCV_ANNULLATO,TRUE); rconv.rewrite(); } sog.put(SOG_DATACONV, NULLDATE); @@ -440,7 +458,23 @@ int TDonaz_app::write(TSheet_field& s) bool dimissione = ctd.get_bool("B0"); if (dimissione) sog.put(SOG_CATDON,ctd.get("S6")); + else + { + if ((catdon == _catini1 || _catini1.empty()) && (totdon+1>=_numdon1) && _catfin1.not_empty()) + sog.put(SOG_CATDON, _catfin1); + if ((catdon == _catini2 || _catini2.empty()) && (totdon+1>=_numdon2) && _catfin2.not_empty() && !_sttess2) + sog.put(SOG_CATDON, _catfin2); + } + // per bologna + // if (catdon == "06") + // sog.put(SOG_CATDON,"04"); } + TDate dataisc = sog.get_date(SOG_DATAISC); + if (dataisc.empty() && _dataisc) + { + const TRectype& riga = _sdonazioni->row(1); + sog.put(SOG_DATAISC,riga.get(DON_DATADON)); + } // aggiorno data e utente ultimo aggiornamento sog.put(SOG_DATAULTAGG,TODAY); @@ -457,7 +491,7 @@ int TDonaz_app::write(TSheet_field& s) return NOERR; } -bool TDonaz_app::check_sog_sheet(const char* codsog) +bool TGiornalieroDC::check_sog_sheet(const char* codsog) { TAssoc_array& array_sogg = app().get_array_sogg(); if (array_sogg.is_key(codsog)) @@ -466,7 +500,7 @@ bool TDonaz_app::check_sog_sheet(const char* codsog) return TRUE; } -bool TDonaz_app::soggetti_notify(TSheet_field& s, int r, KEY k) +bool TGiornalieroDC::soggetti_notify(TSheet_field& s, int r, KEY k) { bool ok = TRUE; switch (k) @@ -479,24 +513,28 @@ bool TDonaz_app::soggetti_notify(TSheet_field& s, int r, KEY k) break; case K_TAB: // entrata riga - { - if ((r == s.items()-1) && (r == s.first_empty())) - { - app().add_rows_soggetti(s,10,r+1); - s.select(r); - } - TToken_string& row = s.row(r); - if (row.empty_items()) - s.set_focus_cell(r,1); + { + static bool entering = TRUE; + if (entering) + { + entering = FALSE; + if ((r == s.items()-1) && (r == s.first_empty())) + app().add_rows_soggetti(s,10,r+1); + TToken_string& row = s.row(r); + if (row.empty_items()) + s.select(r); + entering = TRUE; + } } break; case K_ENTER: // uscita da riga modificata case K_CTRL+K_TAB: // uscita riga - { - app()._modified = TRUE; + { TToken_string& row = s.row(r); + if (!row.empty_items()) + app()._modified = TRUE; const long codsog = row.get_long(0); if (codsog != 0) for (int i=s.items()-1; i>=0; i--) @@ -512,16 +550,8 @@ bool TDonaz_app::soggetti_notify(TSheet_field& s, int r, KEY k) { const char* cognome = row.get(1); if ((cognome != NULL) && (cognome != "\0")) - { s.sheet_mask().field(F_S_NOME).set_focusdirty(); - s.set_focus_cell(r,2); - } - } - s.force_update(r); - if (r == s.items()-1) - { - app().add_rows_soggetti(s,10,r+1); - s.select(r); + //s.set_focus_cell(r,2); } } break; @@ -529,10 +559,9 @@ bool TDonaz_app::soggetti_notify(TSheet_field& s, int r, KEY k) return ok; } -bool TDonaz_app::nome_handler(TMask_field& f, KEY k) +bool TGiornalieroDC::nome_handler(TMask_field& f, KEY k) { bool ok = TRUE; - //if (k == K_TAB && f.focusdirty()) if (f.to_check(k)) { TMask& m = f.mask(); @@ -543,10 +572,41 @@ bool TDonaz_app::nome_handler(TMask_field& f, KEY k) return ok; } +bool TGiornalieroDC::codice_handler(TMask_field& f, KEY k) +{ + bool ok = TRUE; + if (f.to_check(k)) + { + TMask& m = f.mask(); + long codsog = m.get_long(F_S_CODICE); + if (codsog != 0) + { + TLocalisamfile& sog = app().get_relation()->lfile(); + sog.setkey(1); + sog.zero(); + sog.put(SOG_CODICE, codsog); + int err = sog.read(); + if (err == NOERR) + { + m.set(F_S_COGNOME, sog.get(SOG_COGNOME)); + m.set(F_S_NOME, sog.get(SOG_NOME)); + m.set(F_S_DATANASC, sog.get(SOG_DATANASC)); + m.set(F_S_TESSAVIS, sog.get(SOG_TESSAVIS)); + m.set(F_S_CODSEZ, sog.get(SOG_CODSEZ)); + m.set(F_S_CODSOT, sog.get(SOG_CODSOT)); + m.set(F_S_CATDON, sog.get(SOG_CATDON)); + } + else + ok = FALSE; // codice non esistente + } + } + return ok; +} + int at0200(int argc, char* argv[]) { - TDonaz_app a; + TGiornalieroDC a; a.run(argc, argv, "Giornaliero donazioni/controlli"); return 0; } \ No newline at end of file diff --git a/at/at0200a.h b/at/at0200a.h index 3e3d8c296..eec387f79 100755 --- a/at/at0200a.h +++ b/at/at0200a.h @@ -2,14 +2,14 @@ // GIORNALIERO DONAZIONI/CONTROLLI // dati fissi -#define F_DATADON 101 -#define F_TIPODON 102 -#define F_LUOGODON 103 -#define F_DESC_TIPODON 104 -#define F_DESC_LUOGODON 105 -#define F_INS_CONTROLLI 106 +#define F_DATADON 201 +#define F_TIPODON 202 +#define F_LUOGODON 203 +#define F_DESC_TIPODON 204 +#define F_DESC_LUOGODON 205 +#define F_INS_CONTROLLI 206 // spreadsheet -#define F_SOGGETTI 107 +#define F_SOGGETTI 207 // pagina soggetti #define F_S_CODICE 101 diff --git a/at/at0200a.uml b/at/at0200a.uml index bc1bce84e..9a83ca67a 100755 --- a/at/at0200a.uml +++ b/at/at0200a.uml @@ -2,10 +2,10 @@ #include "lf.h" TOOLBAR "" 0 20 0 2 - + BUTTON DLG_SAVEREC 10 2 BEGIN - PROMPT -14 -11 "~Registra" + PROMPT -15 -11 "~Registra" MESSAGE EXIT,K_SAVE PICTURE BMP_SAVEREC PICTURE BMP_SAVERECDN @@ -13,7 +13,7 @@ END BUTTON DLG_NEWREC 10 2 BEGIN - PROMPT -24 -11 "~Nuovo" + PROMPT -25 -11 "~Nuovo" MESSAGE EXIT,K_INS PICTURE BMP_NEWREC PICTURE BMP_NEWRECDN @@ -21,14 +21,20 @@ END BUTTON DLG_CANCEL 10 2 BEGIN - PROMPT -34 -11 "~Annulla" + PROMPT -35 -11 "~Annulla" MESSAGE EXIT,K_ESC PICTURE 102 END +BUTTON DLG_PRINT 10 2 +BEGIN + PROMPT -45 -11 "~Stampa" + MESSAGE RUN,at6,-2 +END + BUTTON DLG_QUIT 10 2 BEGIN - PROMPT -44 -11 "~Fine" + PROMPT -55 -11 "~Fine" MESSAGE EXIT,K_QUIT PICTURE BMP_QUIT PICTURE BMP_QUITDN @@ -38,7 +44,6 @@ ENDPAGE PAGE "Giornaliero donazioni/controlli" -1 -1 78 20 - GROUPBOX DLG_NULL 77 6 BEGIN PROMPT 1 0 "Dati fissi" @@ -49,7 +54,6 @@ DATE F_DATADON BEGIN PROMPT 2 1 "Data donazione " VALIDATE NOT_EMPTY_FUNC - CHECKTYPE REQUIRED HELP "Data donazione" END @@ -71,7 +75,7 @@ END STRING F_LUOGODON 4 BEGIN - PROMPT 2 3 "Luogo donazione " + PROMPT 2 3 "Punto prelievo " FLAGS "U" USE LDN INPUT CODTAB F_LUOGODON @@ -81,7 +85,7 @@ BEGIN OUTPUT F_DESC_LUOGODON S0 CHECKTYPE NORMAL WARNING "Codice non presente" - HELP "Luogo donazione" + HELP "Punto di prelievo" END STRING F_DESC_TIPODON 30 @@ -142,6 +146,8 @@ BEGIN DISPLAY "Sot." CODSOT DISPLAY "C." CATDON DISPLAY "Tessera" TESSAVIS + DISPLAY "Gr.AB0" GRUPPOAB0 + DISPLAY "Rh " RHANTID OUTPUT F_S_CODICE CODICE OUTPUT F_S_COGNOME COGNOME OUTPUT F_S_NOME NOME @@ -150,8 +156,8 @@ BEGIN OUTPUT F_S_CODSOT CODSOT OUTPUT F_S_CATDON CATDON OUTPUT F_S_TESSAVIS TESSAVIS - CHECKTYPE NORMAL - ADD RUN at0 -0 +// CHECKTYPE NORMAL +// ADD RUN at0 -0 END STRING F_S_COGNOME 25 @@ -159,7 +165,6 @@ BEGIN PROMPT 2 2 "Cognome e nome " USE LF_SOGGETTI KEY 2 INPUT COGNOME F_S_COGNOME - //INPUT NOME F_S_NOME DISPLAY "Cognome@25" COGNOME DISPLAY "Nome@25" NOME DISPLAY "Nato il@10" DATANASC @@ -168,10 +173,19 @@ BEGIN DISPLAY "Sot." CODSOT DISPLAY "C." CATDON DISPLAY "Tessera" TESSAVIS - COPY OUTPUT F_S_CODICE - CHECKTYPE SEARCH + DISPLAY "Gr.AB0" GRUPPOAB0 + DISPLAY "Rh " RHANTID + OUTPUT F_S_CODICE CODICE + OUTPUT F_S_COGNOME COGNOME + OUTPUT F_S_NOME NOME + OUTPUT F_S_DATANASC DATANASC + OUTPUT F_S_CODSEZ CODSEZ + OUTPUT F_S_CODSOT CODSOT + OUTPUT F_S_CATDON CATDON + OUTPUT F_S_TESSAVIS TESSAVIS HELP "Cognome del soggetto" - ADD RUN at0 -0 +// CHECKTYPE NORMAL +// ADD RUN at0 -0 END STRING F_S_NOME 25 @@ -180,11 +194,27 @@ BEGIN USE LF_SOGGETTI KEY 2 INPUT COGNOME F_S_COGNOME INPUT NOME F_S_NOME - COPY DISPLAY F_S_COGNOME - COPY OUTPUT F_S_COGNOME - CHECKTYPE SEARCH + DISPLAY "Cognome@25" COGNOME + DISPLAY "Nome@25" NOME + DISPLAY "Nato il@10" DATANASC + DISPLAY "Codice@8" CODICE + DISPLAY "Sez." CODSEZ + DISPLAY "Sot." CODSOT + DISPLAY "C." CATDON + DISPLAY "Tessera" TESSAVIS + DISPLAY "Gr.AB0" GRUPPOAB0 + DISPLAY "Rh " RHANTID + OUTPUT F_S_CODICE CODICE + OUTPUT F_S_COGNOME COGNOME + OUTPUT F_S_NOME NOME + OUTPUT F_S_DATANASC DATANASC + OUTPUT F_S_CODSEZ CODSEZ + OUTPUT F_S_CODSOT CODSOT + OUTPUT F_S_CATDON CATDON + OUTPUT F_S_TESSAVIS TESSAVIS HELP "Nome del soggetto" - ADD RUN at0 -0 +// CHECKTYPE NORMAL +// ADD RUN at0 -0 END GROUPBOX DLG_NULL 77 9 diff --git a/at/at0300.cpp b/at/at0300.cpp index 904bf11c7..8dbe81de6 100755 --- a/at/at0300.cpp +++ b/at/at0300.cpp @@ -26,7 +26,7 @@ #define ALIAS_CTD 100 -class TContsan_app : public TApplication +class TGiornalieroC : public TApplication { TMask* _msk; TRelation* _rel; @@ -51,27 +51,29 @@ protected: bool check_sog_sheet(const char* codsog); static bool nome_handler(TMask_field& f, KEY k); + static bool codice_handler(TMask_field& f, KEY k); static bool tipocon_handler(TMask_field& f, KEY k); static bool soggetti_notify(TSheet_field& s, int r, KEY k); void add_rows_soggetti(TSheet_field& s, int count = 20, int start = 0); public: - TContsan_app() {} + TGiornalieroC() {} }; -HIDDEN inline TContsan_app& app() { return (TContsan_app&) main_app(); } +HIDDEN inline TGiornalieroC& app() { return (TGiornalieroC&) main_app(); } -void TContsan_app::add_rows_soggetti(TSheet_field& s, int count, int start) +void TGiornalieroC::add_rows_soggetti(TSheet_field& s, int count, int start) { if (start == 0) s.destroy(); for (int r=start; r<=start+count-1; r++) - TToken_string& row = s.row(r); + s.row(r); } -bool TContsan_app::create() +bool TGiornalieroC::create() { + TApplication::create(); _modified = FALSE; _msk = new TMask("at0300a"); _rel = new TRelation(LF_SOGGETTI); @@ -86,6 +88,8 @@ bool TContsan_app::create() ss.set_notify(soggetti_notify); ss.sheet_mask().set_handler(F_S_NOME,nome_handler); + ss.sheet_mask().set_handler(F_S_CODICE,codice_handler); + //ss.sheet_mask().set_handler(F_S_TIPOCON,tipocon_handler); dispatch_e_menu(BAR_ITEM(1)); @@ -93,7 +97,7 @@ bool TContsan_app::create() return TRUE; } -bool TContsan_app::destroy() +bool TGiornalieroC::destroy() { delete _rel; delete _msk; @@ -102,10 +106,10 @@ bool TContsan_app::destroy() delete _sdonazioni; delete _scontrolli; delete _asoggetti; - return TRUE; + return TApplication::destroy(); } -bool TContsan_app::menu(MENU_TAG m) +bool TGiornalieroC::menu(MENU_TAG m) { TMask& msk = get_mask(); const TDate oggi(TODAY); @@ -113,8 +117,9 @@ bool TContsan_app::menu(MENU_TAG m) do { TSheet_field& s = (TSheet_field&)msk.field(F_SOGGETTI); - s.reset(); - add_rows_soggetti(s); + //s.reset(); + if (s.items() == 0) + add_rows_soggetti(s); _asoggetti->destroy(); msk.set(F_DATACON,oggi); tasto = msk.run(); @@ -124,21 +129,23 @@ bool TContsan_app::menu(MENU_TAG m) { if (_modified) if (yesno_box("Registrare le modifiche?")) - TContsan_app::write(s); + TGiornalieroC::write(s); _modified = FALSE; msk.reset(); } break; case K_SAVE: // registra { - TContsan_app::write(s); + TGiornalieroC::write(s); _modified = FALSE; msk.reset(); } break; case K_INS: // nuovo - { - TContsan_app::write(s); + { + if (_modified) + if (yesno_box("Registrare le modifiche?")) + TGiornalieroC::write(s); _modified = FALSE; msk.reset(); } @@ -147,7 +154,7 @@ bool TContsan_app::menu(MENU_TAG m) { if (_modified) if (yesno_box("Registrare le modifiche?")) - TContsan_app::write(s); + TGiornalieroC::write(s); msk.reset(); _modified = FALSE; } @@ -158,7 +165,7 @@ bool TContsan_app::menu(MENU_TAG m) return FALSE; } -int TContsan_app::write(TSheet_field& s) +int TGiornalieroC::write(TSheet_field& s) { const TMask& m = s.mask(); @@ -248,7 +255,7 @@ int TContsan_app::write(TSheet_field& s) return NOERR; } -bool TContsan_app::check_sog_sheet(const char* codsog) +bool TGiornalieroC::check_sog_sheet(const char* codsog) { TAssoc_array& array_sogg = app().get_array_sogg(); if (array_sogg.is_key(codsog)) @@ -257,7 +264,7 @@ bool TContsan_app::check_sog_sheet(const char* codsog) return TRUE; } -bool TContsan_app::soggetti_notify(TSheet_field& s, int r, KEY k) +bool TGiornalieroC::soggetti_notify(TSheet_field& s, int r, KEY k) { bool ok = TRUE; switch (k) @@ -271,16 +278,16 @@ bool TContsan_app::soggetti_notify(TSheet_field& s, int r, KEY k) case K_TAB: // entrata riga { - if (r > 1) + static bool entering = TRUE; + if (entering) { + entering = FALSE; if ((r == s.items()-1) && (r == s.first_empty())) - { app().add_rows_soggetti(s,10,r+1); - s.select(r); - } TToken_string& row = s.row(r); - if (row.empty_items()) - s.set_focus_cell(r,1); + if (row.empty_items()) + s.select(r); + entering = TRUE; } } break; @@ -289,8 +296,9 @@ bool TContsan_app::soggetti_notify(TSheet_field& s, int r, KEY k) case K_CTRL+K_TAB: // uscita riga { - app()._modified = TRUE; TToken_string& row = s.row(r); + if (!row.empty_items()) + app()._modified = TRUE; const long codsog = row.get_long(0); if (codsog != 0) for (int i=s.items()-1; i>=0; i--) @@ -306,16 +314,8 @@ bool TContsan_app::soggetti_notify(TSheet_field& s, int r, KEY k) { const char* cognome = row.get(1); if ((cognome != NULL) && (cognome != "\0")) - { s.sheet_mask().field(F_S_NOME).set_focusdirty(); - s.set_focus_cell(r,2); - } - } - s.force_update(r); - if (r == s.items()-1) - { - app().add_rows_soggetti(s,10,r+1); - s.select(r); + //s.set_focus_cell(r,2); } } break; @@ -323,10 +323,9 @@ bool TContsan_app::soggetti_notify(TSheet_field& s, int r, KEY k) return ok; } -bool TContsan_app::nome_handler(TMask_field& f, KEY k) +bool TGiornalieroC::nome_handler(TMask_field& f, KEY k) { bool ok = TRUE; - //if (k == K_TAB && f.focusdirty()) if (f.to_check(k)) { TMask& m = f.mask(); @@ -337,7 +336,38 @@ bool TContsan_app::nome_handler(TMask_field& f, KEY k) return ok; } -bool TContsan_app::tipocon_handler(TMask_field& f, KEY k) +bool TGiornalieroC::codice_handler(TMask_field& f, KEY k) +{ + bool ok = TRUE; + if (f.to_check(k)) + { + TMask& m = f.mask(); + long codsog = m.get_long(F_S_CODICE); + if (codsog != 0) + { + TLocalisamfile& sog = app().get_relation()->lfile(); + sog.setkey(1); + sog.zero(); + sog.put(SOG_CODICE, codsog); + int err = sog.read(); + if (err == NOERR) + { + m.set(F_S_COGNOME, sog.get(SOG_COGNOME)); + m.set(F_S_NOME, sog.get(SOG_NOME)); + m.set(F_S_DATANASC, sog.get(SOG_DATANASC)); + m.set(F_S_TESSAVIS, sog.get(SOG_TESSAVIS)); + m.set(F_S_CODSEZ, sog.get(SOG_CODSEZ)); + m.set(F_S_CODSOT, sog.get(SOG_CODSOT)); + m.set(F_S_CATDON, sog.get(SOG_CATDON)); + } + else + ok = FALSE; // codice non esistente + } + } + return ok; +} + +bool TGiornalieroC::tipocon_handler(TMask_field& f, KEY k) { bool ok = TRUE; if (k == K_TAB && !f.focusdirty()) @@ -360,7 +390,7 @@ bool TContsan_app::tipocon_handler(TMask_field& f, KEY k) int at0300(int argc, char* argv[]) { - TContsan_app a; + TGiornalieroC a; a.run(argc, argv, "Giornaliero controlli"); return 0; } \ No newline at end of file diff --git a/at/at0300a.h b/at/at0300a.h index e480fa914..3475d30d7 100755 --- a/at/at0300a.h +++ b/at/at0300a.h @@ -2,15 +2,15 @@ // GIORNALIERO CONTROLLI // dati fissi -#define F_DATACON 101 -#define F_TIPOCON 102 -#define F_PROSSTIPO 103 -#define F_PROSSDATA 104 -#define F_DESC_TIPOCON 105 -#define F_DESC_PROSSTIPO 106 +#define F_DATACON 201 +#define F_TIPOCON 202 +#define F_PROSSTIPO 203 +#define F_PROSSDATA 204 +#define F_DESC_TIPOCON 205 +#define F_DESC_PROSSTIPO 206 // spreadsheet -#define F_SOGGETTI 107 +#define F_SOGGETTI 207 // pagina soggetti #define F_S_CODICE 101 diff --git a/at/at0300a.uml b/at/at0300a.uml index edc799aee..6eb6c6eaa 100755 --- a/at/at0300a.uml +++ b/at/at0300a.uml @@ -151,8 +151,8 @@ BEGIN OUTPUT F_S_CODSOT CODSOT OUTPUT F_S_CATDON CATDON OUTPUT F_S_TESSAVIS TESSAVIS - CHECKTYPE NORMAL - ADD RUN at0 -0 + //CHECKTYPE NORMAL + //ADD RUN at0 -0 END STRING F_S_COGNOME 25 @@ -170,9 +170,9 @@ BEGIN DISPLAY "C." CATDON DISPLAY "Tessera" TESSAVIS COPY OUTPUT F_S_CODICE - CHECKTYPE SEARCH HELP "Cognome del soggetto" - ADD RUN at0 -0 + //CHECKTYPE SEARCH + //ADD RUN at0 -0 END STRING F_S_NOME 25 @@ -183,9 +183,9 @@ BEGIN INPUT NOME F_S_NOME COPY DISPLAY F_S_COGNOME COPY OUTPUT F_S_COGNOME - CHECKTYPE SEARCH HELP "Nome del soggetto" - ADD RUN at0 -0 + //CHECKTYPE SEARCH + //ADD RUN at0 -0 END GROUPBOX DLG_NULL 77 9 diff --git a/at/at0400.cpp b/at/at0400.cpp index 5ff1ad0e0..93b8e4b14 100755 --- a/at/at0400.cpp +++ b/at/at0400.cpp @@ -24,7 +24,7 @@ #define IDON_SI "SI" #define IDON_AF "AF" -class TConvoc_app: public TRelation_application +class TGestioneConvocazioni: public TRelation_application { static bool filter_func_convoc(const TRelation* rel); @@ -38,7 +38,7 @@ class TConvoc_app: public TRelation_application long _lastcod; // progressivo convocazione da assegnare long _numero; // numero convocazione TDate _data; // data convocazione - TString16 _punto; // punto di raccolta + TString16 _punto; // punto di prelievo TString16 _tipo; // tipo donazione TString16 _codsez; // codice sezione convocata TString16 _codsot; // codice sottogruppo @@ -64,13 +64,13 @@ protected: static bool data_handler(TMask_field&f, KEY k); public: - TConvoc_app() {} + TGestioneConvocazioni() {} }; -HIDDEN inline TConvoc_app& app() { return (TConvoc_app&) main_app(); } +HIDDEN inline TGestioneConvocazioni& app() { return (TGestioneConvocazioni&) main_app(); } -bool TConvoc_app::filter_func_convoc(const TRelation* rel) +bool TGestioneConvocazioni::filter_func_convoc(const TRelation* rel) { bool filtrato = FALSE; TRectype& sog = rel->curr(); @@ -130,7 +130,7 @@ bool TConvoc_app::filter_func_convoc(const TRelation* rel) return filtrato; } -bool TConvoc_app::data_handler(TMask_field& f, KEY k) +bool TGestioneConvocazioni::data_handler(TMask_field& f, KEY k) { if (f.to_check(k)) { @@ -166,13 +166,12 @@ bool TConvoc_app::data_handler(TMask_field& f, KEY k) return TRUE; } -bool TConvoc_app::esegui_handler(TMask_field& f, KEY k) +bool TGestioneConvocazioni::esegui_handler(TMask_field& f, KEY k) { if (k == K_SPACE) { TMask& m = f.mask(); TCursor* cur = app()._cur; - app()._numero = m.get_long(F_NUMERO); app()._data = m.get(F_DATA); app()._punto = m.get(F_PUNTO); @@ -182,10 +181,8 @@ bool TConvoc_app::esegui_handler(TMask_field& f, KEY k) app()._dataini = m.get(F_DATAINI); app()._ritarda = m.get_bool(F_RITARDA); app()._maxrit = m.get_int(F_MAXRIT); - if (app()._numero == 0 || !app()._data.ok() || app()._punto.empty() || app()._tipo.empty()) return f.error_box("Mancano i dati fondamentali per la convocazione"); - // filtro per sezione //TRectype da(LF_SOGGETTI); //if (app()._codsez.not_empty()) @@ -198,7 +195,7 @@ bool TConvoc_app::esegui_handler(TMask_field& f, KEY k) // filtro per categoria donatori non vuota e non dimessi // e non escluso e idoneo //filtro.format("(CATDON != \"\") && (%d->B0 == \"\") && (ESCLUSO == \"\") && ((%d->S6 == \"I\" ) || (%d->S6 == \"F\"))",ALIAS_CTD,ALIAS_TCS,ALIAS_TCS); - // filtro per punto di raccolta + // filtro per punto di prelievo //filtro << " && "; //if (app()._codsez.empty()) // filtro << format("(PUNTORACC == \"%s\")",(const char*)app()._punto); @@ -221,14 +218,11 @@ bool TConvoc_app::esegui_handler(TMask_field& f, KEY k) da.put(SOG_DATAPROSSI,datalimite); a.put(SOG_DATAPROSSI,data); cur->setregion(da, a); - cur->set_filterfunction(filter_func_convoc, TRUE); - TSheet_field& s = (TSheet_field&)m.field(F_CONVOCATI); s.destroy(); TRectype& rec = cur->curr(); TRectype& sez = cur->curr(LF_SEZIONI); - int nconv=0; int nsoll=0; int nrit=0; @@ -329,7 +323,7 @@ bool TConvoc_app::esegui_handler(TMask_field& f, KEY k) return TRUE; } -bool TConvoc_app::user_create() +bool TGestioneConvocazioni::user_create() { _msk = new TMask("at0400a"); _rel = new TRelation(LF_CONVOC); @@ -337,7 +331,8 @@ bool TConvoc_app::user_create() _relsog->add("CTD", "CODTAB==CATDON",1,0,-ALIAS_CTD); _relsog->add("TCS", "CODTAB==STATO",1,0,-ALIAS_TCS); _relsog->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT"); - _cur = new TCursor(_relsog, "", 6); //cursore ordinamento per data prossima donazione + // ordinamento per data prossima donazione + _cur = new TCursor(_relsog, "", 5); _rconvoc = new TLocalisamfile(LF_RCONVOC); _soggetti = new TLocalisamfile(LF_SOGGETTI); _sconvocati = new TRecord_array(LF_RCONVOC,RCV_PROGCONV); @@ -345,13 +340,12 @@ bool TConvoc_app::user_create() _msk->set_handler(F_DATA,data_handler); TSheet_field& sc = (TSheet_field&)_msk->field(F_CONVOCATI); sc.set_notify(convocati_notify); - //TMask& scmask = sc.sheet_mask(); _rel->lfile().last(); _lastcod = _rel->lfile().get_long(COV_NUMERO); return TRUE; } -bool TConvoc_app::user_destroy() +bool TGestioneConvocazioni::user_destroy() { delete _rel; delete _relsog; @@ -363,13 +357,13 @@ bool TConvoc_app::user_destroy() return TRUE; } -const char* TConvoc_app::get_next_key() +const char* TGestioneConvocazioni::get_next_key() { // autonumerazione progressiva delle convocazioni return format("%d|%ld", F_NUMERO, _lastcod+1 ); } -bool TConvoc_app::remove() +bool TGestioneConvocazioni::remove() { // cancella convocati // cancella testata convocazione @@ -383,7 +377,7 @@ bool TConvoc_app::remove() return (ok && err == NOERR); } -int TConvoc_app::read(TMask& m) +int TGestioneConvocazioni::read(TMask& m) { int err = TRelation_application::read(m); if (err == NOERR) @@ -423,19 +417,19 @@ int TConvoc_app::read(TMask& m) return err; } -int TConvoc_app::write(const TMask& m) +int TGestioneConvocazioni::write(const TMask& m) { long curcod = m.get_long(F_NUMERO); if (curcod > _lastcod) _lastcod = curcod; - return TConvoc_app::scrivi(m, FALSE); + return TGestioneConvocazioni::scrivi(m, FALSE); } -int TConvoc_app::rewrite(const TMask& m) +int TGestioneConvocazioni::rewrite(const TMask& m) { - return TConvoc_app::scrivi(m, TRUE); + return TGestioneConvocazioni::scrivi(m, TRUE); } -int TConvoc_app::scrivi(const TMask& m, bool ri) +int TGestioneConvocazioni::scrivi(const TMask& m, bool ri) { // questo trucco è autorizzato dal capo! //TMask& hmask = (TMask&) m; @@ -483,7 +477,7 @@ int TConvoc_app::scrivi(const TMask& m, bool ri) return err; } -bool TConvoc_app::convocati_notify(TSheet_field& s, int r, KEY k) +bool TGestioneConvocazioni::convocati_notify(TSheet_field& s, int r, KEY k) { bool result = TRUE; switch (k) @@ -509,7 +503,7 @@ bool TConvoc_app::convocati_notify(TSheet_field& s, int r, KEY k) int at0400(int argc, char* argv[]) { - TConvoc_app a; + TGestioneConvocazioni a; a.run(argc, argv, "Gestione convocazione"); return 0; } \ No newline at end of file diff --git a/at/at0400a.uml b/at/at0400a.uml index d0d3663f9..685ebda46 100755 --- a/at/at0400a.uml +++ b/at/at0400a.uml @@ -63,7 +63,7 @@ END STRING F_PUNTO 4 BEGIN - PROMPT 2 3 "Punto di raccolta " + PROMPT 2 3 "Punto di prelievo " FIELD PUNTO FLAGS "U" USE LDN @@ -74,7 +74,7 @@ BEGIN OUTPUT F_D_PUNTO S0 CHECKTYPE REQUIRED WARNING "Codice non presente" - HELP "Punto di raccolta per la convocazione" + HELP "Punto di prelievo per la convocazione" VALIDATE NOT_EMPTY_FUNC END diff --git a/at/at0500.cpp b/at/at0500.cpp index 4756d2678..6d7d8106c 100755 --- a/at/at0500.cpp +++ b/at/at0500.cpp @@ -12,11 +12,11 @@ #include "at0.h" #include "at0500a.h" -class TSpostamento_app : public TPrintapp +class TSpostamentoConv : public TPrintapp { TRelation* _rel; TMask* _msk; - int _cur1; + int _cur; TLocalisamfile* _rconvoc; TLocalisamfile* _soggetti; TDate _dataini, _datafin, _spostadal, _spostaal; @@ -36,12 +36,12 @@ protected: public: TMask& app_mask() { return *_msk; } - TSpostamento_app() {} + TSpostamentoConv() {} }; -HIDDEN inline TSpostamento_app& app() { return (TSpostamento_app&) main_app(); } +HIDDEN inline TSpostamentoConv& app() { return (TSpostamentoConv&) main_app(); } -void TSpostamento_app::set_page(int file, int cnt) +void TSpostamentoConv::set_page(int file, int cnt) { set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"#########")); @@ -56,7 +56,7 @@ void TSpostamento_app::set_page(int file, int cnt) set_row(3, ""); } -bool TSpostamento_app::preprocess_page(int file, int counter) +bool TSpostamentoConv::preprocess_page(int file, int counter) { TDate& data = app()._data; app()._spostati++; @@ -76,7 +76,7 @@ bool TSpostamento_app::preprocess_page(int file, int counter) return TRUE; } -bool TSpostamento_app::set_print(int m) +bool TSpostamentoConv::set_print(int m) { KEY tasto; tasto = _msk->run(); @@ -91,7 +91,7 @@ bool TSpostamento_app::set_print(int m) _spostadal = _msk->get(F_SPOSTADAL); _spostaal = _msk->get(F_SPOSTAAL); TString80 filtro = ""; - // filtro per punto di raccolta + // filtro per punto di prelievo if (_punto.not_empty()) { if (filtro.not_empty()) @@ -125,7 +125,7 @@ bool TSpostamento_app::set_print(int m) da.put(RCV_DATACONV, _dataini); if (_datafin.ok()) a.put(RCV_DATACONV, _datafin); - _cur1 = add_cursor(new TCursor(_rel,"", 2, &da, &a)); + _cur = add_cursor(new TCursor(_rel,"", 2, &da, &a)); // non posso metterlo nel costruttore del tcursor perchè // non c'è la possibilità di specificare il parametro TRUE che c'è // nella setfilter @@ -146,7 +146,7 @@ bool TSpostamento_app::set_print(int m) return FALSE; } -bool TSpostamento_app::user_create() +bool TSpostamentoConv::user_create() { _rel = new TRelation(LF_RCONVOC); _rel->add(LF_SOGGETTI, "CODICE==CODICE"); @@ -161,7 +161,7 @@ bool TSpostamento_app::user_create() return TRUE; } -bool TSpostamento_app::user_destroy() +bool TSpostamentoConv::user_destroy() { delete _msk; delete _rel; @@ -170,10 +170,7 @@ bool TSpostamento_app::user_destroy() int at0500(int argc, char* argv[]) { - - TSpostamento_app a; - - a.run(argc, argv, "Spostamento convocazioni su punto di raccolta"); - + TSpostamentoConv a; + a.run(argc, argv, "Spostamento convocazioni"); return 0; } diff --git a/at/at0500a.uml b/at/at0500a.uml index 0b97198b3..f34a5e7ab 100755 --- a/at/at0500a.uml +++ b/at/at0500a.uml @@ -4,7 +4,7 @@ PAGE "Spostamento convocazioni" -1 -1 78 20 GROUPBOX DLG_NULL 77 8 BEGIN - PROMPT 1 1 "Convocoazioni da spostare" + PROMPT 1 1 "Convocazioni da spostare" END DATE F_DATAINI @@ -19,7 +19,7 @@ END STRING F_PUNTO 4 BEGIN - PROMPT 2 4 "Punto raccolta " + PROMPT 2 4 "Punto prelievo " FLAGS "U" USE LDN INPUT CODTAB F_PUNTO diff --git a/at/at1100.cpp b/at/at1100.cpp index cb8fdd514..8b6c33efa 100755 --- a/at/at1100.cpp +++ b/at/at1100.cpp @@ -16,17 +16,16 @@ #include "storico.h" #include "sezioni.h" -class TChiusura_app : public TPrintapp +class TChiusuraPeriodica : public TPrintapp { static bool filter_func_chiusura(const TRelation* rel); TMask* _msk; TRelation* _rel; - int _cur; TDate _data_chiusura; TParagraph_string _operazione; - + bool _definitiva; protected: virtual bool user_create(); @@ -34,18 +33,17 @@ protected: virtual bool set_print(int m); virtual void set_page(int file, int cnt); virtual bool preprocess_page(int file, int counter); - virtual TMask& get_mask() { return *_msk; } public: void filtra_sezioni(); void crea_intestazione(); - TChiusura_app() : _data_chiusura(TODAY), _operazione("",30) {} + TChiusuraPeriodica() : _data_chiusura(TODAY), _operazione("",30) {} }; -HIDDEN inline TChiusura_app& app() { return (TChiusura_app&) main_app(); } +HIDDEN inline TChiusuraPeriodica& app() { return (TChiusuraPeriodica&) main_app(); } -void TChiusura_app::filtra_sezioni() +void TChiusuraPeriodica::filtra_sezioni() { const TString16 sezini = _msk->get(F_SEZINI); const TString16 sotini = _msk->get(F_SOTINI); @@ -65,7 +63,7 @@ void TChiusura_app::filtra_sezioni() } -bool TChiusura_app::preprocess_page(int file, int counter) +bool TChiusuraPeriodica::preprocess_page(int file, int counter) { _operazione = "Nulla"; @@ -81,18 +79,27 @@ bool TChiusura_app::preprocess_page(int file, int counter) const int donemer = recsez.get_int(SEZ_DONEMER); const TString16 catsog = recsog.get(SOG_CATDON); - if (catsog==cat_estinti || catsog==cat_cancellati) + + + if ((catsog==cat_estinti && cat_estinti.not_empty()) + || (catsog==cat_cancellati && cat_cancellati.not_empty())) { const int totdon = recsog.get_int(SOG_TOTDON); if (totdon >= donemer && donemer != 0) { _operazione = "Passaggio a emeriti"; - recsog.put(SOG_CATDON,cat_emeriti); - filesog.rewrite(); + if (_definitiva) + { + recsog.put(SOG_CATDON,cat_emeriti); + filesog.rewrite(); + } } else + { _operazione = "Cancellato"; - filesog.remove(); + if (_definitiva) + filesog.remove(); + } } else { @@ -103,8 +110,11 @@ bool TChiusura_app::preprocess_page(int file, int counter) if (dataultdon < _data_chiusura) { _operazione = "Passaggio a estinti"; - recsog.put(SOG_CATDON,cat_estinti); - filesog.rewrite(); + if (_definitiva) + { + recsog.put(SOG_CATDON,cat_estinti); + filesog.rewrite(); + } } else _operazione = "Non doveva essere filtrato: data ancora valida"; @@ -116,7 +126,7 @@ bool TChiusura_app::preprocess_page(int file, int counter) } -void TChiusura_app::set_page(int file, int cnt) +void TChiusuraPeriodica::set_page(int file, int cnt) { set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########")); set_row(1,"@9g@S", FLD(LF_SOGGETTI,SOG_CATDON)); @@ -125,7 +135,7 @@ void TChiusura_app::set_page(int file, int cnt) set_row(1,"@65g#a", &_operazione); } -bool TChiusura_app::filter_func_chiusura(const TRelation* rel) +bool TChiusuraPeriodica::filter_func_chiusura(const TRelation* rel) { bool filtrato = FALSE; @@ -138,7 +148,8 @@ bool TChiusura_app::filter_func_chiusura(const TRelation* rel) const int intesti = recsez.get_int(SEZ_INTESTI); const TString16 catsog = recsog.get(SOG_CATDON); - filtrato = (catsog == cat_estinti || catsog == cat_cancellati); + filtrato = ((catsog == cat_estinti && cat_estinti.not_empty()) || + (catsog == cat_cancellati && cat_cancellati.not_empty())); if (!filtrato && catsog != cat_emeriti) { TDate dataultdon = recsog.get(SOG_DATAULTDON); @@ -151,12 +162,13 @@ bool TChiusura_app::filter_func_chiusura(const TRelation* rel) return filtrato; } -bool TChiusura_app::set_print(int) +bool TChiusuraPeriodica::set_print(int) { KEY tasto; tasto = _msk->run(); if (tasto == K_ENTER) { + _definitiva = _msk->get_bool(F_DEFINITIVA); _data_chiusura = _msk->get(F_DATA); reset_files(); add_file(LF_SOGGETTI); @@ -171,7 +183,7 @@ bool TChiusura_app::set_print(int) } -void TChiusura_app::crea_intestazione() +void TChiusuraPeriodica::crea_intestazione() { reset_header(); @@ -184,27 +196,29 @@ void TChiusura_app::crea_intestazione() sep << "Pag. @#"; sep.right_just(132); set_header(2,(const char*) sep); - - set_header(2,"@0gCHIUSURA PERIODICA ALLA DATA"); + + if (_definitiva) + set_header(2,"@0gCHIUSURA PERIODICA - DEFINITIVA - ALLA DATA"); + else + set_header(2,"@0gCHIUSURA PERIODICA - PROVVISORIA - ALLA DATA"); data_stampa = _data_chiusura.string(); - set_header(2,"@30g%10s", (const char*) data_stampa); - + set_header(2,"@47g%10s", (const char*) data_stampa); sep = ""; sep.fill('-'); set_header(3, (const char *) sep); } -bool TChiusura_app::user_create() +bool TChiusuraPeriodica::user_create() { _msk = new TMask("at1100a"); _rel = new TRelation(LF_SOGGETTI); _rel->add(LF_SEZIONI,"CODSEZ==CODSEZ|CODSOT==CODSOT"); - - _cur = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice + //cursore ordinamento per sezione+sottogruppo+cognome+nome + _cur = add_cursor(new TCursor(_rel, "", 3)); return TRUE; } -bool TChiusura_app::user_destroy() +bool TChiusuraPeriodica::user_destroy() { delete _rel; delete _msk; @@ -213,7 +227,7 @@ bool TChiusura_app::user_destroy() int at1100(int argc, char* argv[]) { - TChiusura_app a; + TChiusuraPeriodica a; a.run(argc, argv, "Chiusura periodica"); return 0; } \ No newline at end of file diff --git a/at/at1100a.h b/at/at1100a.h index 6a647ca38..d8e1f31a7 100755 --- a/at/at1100a.h +++ b/at/at1100a.h @@ -10,3 +10,4 @@ #define F_SOTFIN 107 #define F_D_SOTFIN 108 #define F_DATA 109 +#define F_DEFINITIVA 110 diff --git a/at/at1100a.uml b/at/at1100a.uml index 366ef2f4a..7182c91f2 100755 --- a/at/at1100a.uml +++ b/at/at1100a.uml @@ -1,6 +1,6 @@ #include "at1100a.h" #include "lf.h" -PAGE "Chiusura annuale" -1 -1 78 20 +PAGE "Chiusura Periodica" -1 -1 78 12 GROUPBOX DLG_NULL 77 4 BEGIN @@ -117,22 +117,32 @@ BEGIN HELP "Sottogruppo finale" END +GROUPBOX DLG_NULL 77 3 +BEGIN + PROMPT 1 6 "Opzioni per la chiusura" +END + DATE F_DATA BEGIN - PROMPT 2 5 "Data chiusura " + PROMPT 2 7 "Data di riferimento " CHECKTYPE REQUIRED HELP "Data di riferimento per i conteggi di chiusura" END +BOOLEAN F_DEFINITIVA +BEGIN + PROMPT 43 7 "Chiusura definitiva" + HELP "Se chiusura definitiva, le operazioni stampate verranno registrate" +END + BUTTON DLG_OK 9 2 BEGIN - PROMPT -12 14 "" + PROMPT -12 10 "" END BUTTON DLG_QUIT 9 2 BEGIN - PROMPT -22 14 "" + PROMPT -22 10 "" END - ENDPAGE ENDMASK diff --git a/at/at1200.cpp b/at/at1200.cpp index 309befa9d..8cb036205 100755 --- a/at/at1200.cpp +++ b/at/at1200.cpp @@ -17,16 +17,14 @@ #include "benem.h" #include "sezioni.h" -class TAttriben_app : public TPrintapp +class TAttribuzioneBenemerenze : public TPrintapp { TMask* _msk; TRelation* _rel; - TLocalisamfile* _donaz; TLocalisamfile* _benem; TRecord_array* _sdonazioni; TRecord_array* _sbenemerenze; - int _cur; TDate _data_attribuzione; // data attribuzione benemerenza TDate _data_stampa; @@ -48,12 +46,12 @@ public: void filtra_sezioni(); void crea_intestazione(); void header_sezione(const TString16 codsez, const TString16 codsot); - TAttriben_app() : _data_attribuzione(TODAY), _data_stampa(TODAY), _tipoben(""), _cognome_nome("",25) {} + TAttribuzioneBenemerenze() : _data_attribuzione(TODAY), _data_stampa(TODAY), _tipoben(""), _cognome_nome("",25) {} }; -HIDDEN inline TAttriben_app& app() { return (TAttriben_app&) main_app(); } +HIDDEN inline TAttribuzioneBenemerenze& app() { return (TAttribuzioneBenemerenze&) main_app(); } -void TAttriben_app::filtra_sezioni() +void TAttribuzioneBenemerenze::filtra_sezioni() { const TString16 sezini = _msk->get(F_SEZINI); const TString16 sotini = _msk->get(F_SOTINI); @@ -72,7 +70,7 @@ void TAttriben_app::filtra_sezioni() current_cursor()->setregion(da, a); } -bool TAttriben_app::preprocess_page(int file, int counter) +bool TAttribuzioneBenemerenze::preprocess_page(int file, int counter) { TRectype& recsez = current_cursor()->curr(LF_SEZIONI); TRectype& recsog = current_cursor()->curr(); @@ -99,7 +97,7 @@ bool TAttriben_app::preprocess_page(int file, int counter) return TRUE; } -void TAttriben_app::set_page(int file, int cnt) +void TAttribuzioneBenemerenze::set_page(int file, int cnt) { set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########")); set_row(1,"@9g@S", FLD(LF_SOGGETTI,SOG_CATDON)); @@ -108,7 +106,7 @@ void TAttriben_app::set_page(int file, int cnt) set_row(1,"@49g@pn", FLD(LF_SOGGETTI,SOG_TOTDON,"###")); } -bool TAttriben_app::filter_func_attriben(const TRelation* rel) +bool TAttribuzioneBenemerenze::filter_func_attriben(const TRelation* rel) { bool filtrato; // filtro chi non ha già ricevuto la benemerenza richiesta @@ -125,7 +123,7 @@ bool TAttriben_app::filter_func_attriben(const TRelation* rel) return filtrato; } -void TAttriben_app::header_sezione(const TString16 codsez, const TString16 codsot) +void TAttribuzioneBenemerenze::header_sezione(const TString16 codsez, const TString16 codsot) { const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ); const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT); @@ -146,7 +144,7 @@ void TAttriben_app::header_sezione(const TString16 codsez, const TString16 codso return; } -bool TAttriben_app::set_print(int) +bool TAttribuzioneBenemerenze::set_print(int) { KEY tasto; tasto = _msk->run(); @@ -176,7 +174,7 @@ bool TAttriben_app::set_print(int) } -void TAttriben_app::crea_intestazione() +void TAttribuzioneBenemerenze::crea_intestazione() { reset_header(); @@ -204,22 +202,21 @@ void TAttriben_app::crea_intestazione() set_header(5,"@0g------@9g--@12g-------------------------@38g----------@49g--------"); } -bool TAttriben_app::user_create() +bool TAttribuzioneBenemerenze::user_create() { _msk = new TMask("at1200a"); _rel = new TRelation(LF_SOGGETTI); _rel->add(LF_SEZIONI,"CODSEZ==CODSEZ|CODSOT==CODSOT"); - _cur = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice - + //cursore ordinamento per sezione+sottogruppo+cognome+nome + _cur = add_cursor(new TCursor(_rel, "", 3)); _donaz = new TLocalisamfile(LF_DONAZ); _benem = new TLocalisamfile(LF_BENEM); - _sdonazioni = new TRecord_array(LF_DONAZ,DON_PROGDON); _sbenemerenze = new TRecord_array(LF_BENEM, BEN_PROGBEN); return TRUE; } -bool TAttriben_app::user_destroy() +bool TAttribuzioneBenemerenze::user_destroy() { delete _rel; delete _msk; @@ -232,7 +229,7 @@ bool TAttriben_app::user_destroy() int at1200(int argc, char* argv[]) { - TAttriben_app a; + TAttribuzioneBenemerenze a; a.run(argc, argv, "Attribuzione benemerenze"); return 0; } \ No newline at end of file diff --git a/at/at1300.cpp b/at/at1300.cpp index 5f753c451..d4c69d1ab 100755 --- a/at/at1300.cpp +++ b/at/at1300.cpp @@ -20,21 +20,22 @@ #include "contsan.h" #include "sezioni.h" -class TSbloccoSO_app : public TPrintapp +class TSbloccoSospesi : public TPrintapp { TMask* _msk; TRelation* _rel; - TLocalisamfile* _contsan; TRecord_array* _scontrolli; - int _cur; TDate _data_sblocco; // data scadenza sospensione fino a _data_sblocco TDate _data_stampa; TString16 _tiposo; // tipo sospesione da sbloccare TString16 _codsez, _codsot; + bool _definitiva; + TParagraph_string _cognome_nome; + TString16 _finesospensione; - static bool filter_func_sbloccoSO(const TRelation* rel); + static bool filter_func_sbloccosospesi(const TRelation* rel); protected: virtual bool user_create(); @@ -47,12 +48,32 @@ public: void filtra_sezioni(); void crea_intestazione(); void header_sezione(const TString16 codsez, const TString16 codsot); - TSbloccoSO_app() : _data_sblocco(TODAY), _data_stampa(TODAY), _tiposo("") {} + TSbloccoSospesi() : _data_sblocco(TODAY), _data_stampa(TODAY), _tiposo(""), _cognome_nome("",25) {} }; -HIDDEN inline TSbloccoSO_app& app() { return (TSbloccoSO_app&) main_app(); } +HIDDEN inline TSbloccoSospesi& app() { return (TSbloccoSospesi&) main_app(); } -void TSbloccoSO_app::filtra_sezioni() +HIDDEN bool printer_handler(TMask_field& f, KEY k) +{ + if (k == K_SPACE) + { + TMask& m = f.mask(); + if (!m.query_mode()) + { + TString16 config; + config << "SBLOCCOSO"; + + TPrinter& p = printer(); + p.set_printtype(normprinter); // Force configuration update + p.read_configuration(config); + if (p.set()) + f.message_box("Stampante configurata per sblocco sospesi"); + } + } + return TRUE; +} + +void TSbloccoSospesi::filtra_sezioni() { const TString16 sezini = _msk->get(F_SEZINI); const TString16 sotini = _msk->get(F_SOTINI); @@ -71,25 +92,31 @@ void TSbloccoSO_app::filtra_sezioni() current_cursor()->setregion(da, a); } -bool TSbloccoSO_app::preprocess_page(int file, int counter) +bool TSbloccoSospesi::preprocess_page(int file, int counter) { TRectype& recsog = current_cursor()->curr(); - TRectype* key = new TRectype(LF_CONTSAN); - long codice = recsog.get_long(SOG_CODICE); - key->put(CON_CODICE, codice); - int err = _scontrolli->read(key); - int progcon = _scontrolli->rows()+1; - TRectype& reccon = _contsan->curr(); - reccon.zero(); - reccon.put(CON_CODICE, codice); - reccon.put(CON_PROGCON, progcon); - reccon.put(CON_DATACON, _data_stampa); - reccon.put(CON_TIPOCON, FINE_SOSPENSIONE); - _scontrolli->add_row(reccon); - _scontrolli->rewrite(); - con_reord(recsog, _scontrolli); - current_cursor()->file().rewrite(); - + TString80 nome = recsog.get(SOG_COGNOME); + nome << " "; + nome << recsog.get(SOG_NOME); + _cognome_nome = nome; + if (_definitiva) + { + TRectype* key = new TRectype(LF_CONTSAN); + long codice = recsog.get_long(SOG_CODICE); + key->put(CON_CODICE, codice); + int err = _scontrolli->read(key); + int progcon = _scontrolli->rows()+1; + TRectype& reccon = _contsan->curr(); + reccon.zero(); + reccon.put(CON_CODICE, codice); + reccon.put(CON_PROGCON, progcon); + reccon.put(CON_DATACON, _data_stampa); + reccon.put(CON_TIPOCON, FINE_SOSPENSIONE); + _scontrolli->add_row(reccon); + _scontrolli->rewrite(); + con_reord(recsog, _scontrolli); + current_cursor()->file().rewrite(); + } // salto pagina se cambio sezione const TString16 codsez = recsog.get(SOG_CODSEZ); const TString16 codsot = recsog.get(SOG_CODSOT); @@ -104,16 +131,19 @@ bool TSbloccoSO_app::preprocess_page(int file, int counter) return TRUE; } -void TSbloccoSO_app::set_page(int file, int cnt) +void TSbloccoSospesi::set_page(int file, int cnt) { set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########")); set_row(1,"@9g@S", FLD(LF_SOGGETTI,SOG_CATDON)); - set_row(1,"@12g@S", FLD(LF_SOGGETTI,SOG_COGNOME)); - set_row(1,"@38g@S", FLD(LF_SOGGETTI,SOG_NOME)); - set_row(1,"@63g@ld", FLD(LF_SOGGETTI,SOG_DATANASC)); + set_row(1,"@12g#a", &_cognome_nome); + set_row(1,"@38g@ld", FLD(LF_SOGGETTI,SOG_DATANASC)); + set_row(1,"@49g@S", FLD(LF_SOGGETTI,SOG_TESSAVIS)); + set_row(1,"@57g@S", FLD(LF_SOGGETTI,SOG_PROS_STATO)); + set_row(1,"@68g@S", FLD(LF_SOGGETTI,SOG_STATO)); + set_row(1,"@80g@ld", FLD(LF_SOGGETTI,SOG_DATA_PROS)); } -bool TSbloccoSO_app::filter_func_sbloccoSO(const TRelation* rel) +bool TSbloccoSospesi::filter_func_sbloccosospesi(const TRelation* rel) { bool filtrato = FALSE; TRectype& recsog = rel->lfile().curr(); @@ -136,7 +166,7 @@ bool TSbloccoSO_app::filter_func_sbloccoSO(const TRelation* rel) if (modstato_tcs(prosstipo) == 'F') { TDate datafine = riga.get(CON_PROSSDATA); - filtrato = datafine <= app()._data_sblocco; + filtrato = (datafine.ok()) && (datafine <= app()._data_sblocco); } } } @@ -144,11 +174,11 @@ bool TSbloccoSO_app::filter_func_sbloccoSO(const TRelation* rel) return filtrato; } -void TSbloccoSO_app::header_sezione(const TString16 codsez, const TString16 codsot) +void TSbloccoSospesi::header_sezione(const TString16 codsez, const TString16 codsot) { const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ); const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT); - TString intestazione(132); + TString intestazione(100); intestazione = "Sezione: "; intestazione << codsez; intestazione << "/"; @@ -165,7 +195,7 @@ void TSbloccoSO_app::header_sezione(const TString16 codsez, const TString16 cods return; } -bool TSbloccoSO_app::set_print(int) +bool TSbloccoSospesi::set_print(int) { KEY tasto; tasto = _msk->run(); @@ -175,6 +205,7 @@ bool TSbloccoSO_app::set_print(int) _codsot = "**"; _data_sblocco = _msk->get(F_DATA); _tiposo = _msk->get(F_TIPO); + _definitiva = _msk->get_bool(F_DEFINITIVA); reset_files(); add_file(LF_SOGGETTI); filtra_sezioni(); @@ -183,7 +214,7 @@ bool TSbloccoSO_app::set_print(int) current_cursor()->setfilter(format("STATO == \"%s\"",(const char*)_tiposo)); else current_cursor()->setfilter("TCS->S6 == \"S\"", TRUE); - current_cursor()->set_filterfunction(filter_func_sbloccoSO,TRUE); + current_cursor()->set_filterfunction(filter_func_sbloccosospesi,TRUE); reset_print(); crea_intestazione(); return TRUE; @@ -192,12 +223,15 @@ bool TSbloccoSO_app::set_print(int) return FALSE; } -void TSbloccoSO_app::crea_intestazione() +void TSbloccoSospesi::crea_intestazione() { reset_header(); - TString sep(132); - sep = "SBLOCCO SOSPESI "; + TString sep(100); + if (_definitiva) + sep = "SBLOCCO DEFINITIVO SOSPESI "; + else + sep = "STAMPA PROVVISORIA PER SBLOCCO SOSPESI "; sep << _tiposo; sep << " FINO ALLA DATA "; TString16 data_stampa = _data_sblocco.string(); @@ -208,40 +242,45 @@ void TSbloccoSO_app::crea_intestazione() set_header(2,"@0g%10s", (const char*) data_stampa); sep = ""; sep << "Pag. @#"; - set_header(2, "@120g%s", (const char*) sep); + set_header(2, "@88g%s", (const char*) sep); sep = ""; sep.fill('-'); set_header(3, (const char *) sep); - set_header(4,"@0gCod.@9gC.@12gCognome e nome@38gNato il"); - set_header(5,"@0g------@9g--@12g-------------------------@38g----------"); + set_header(4,"@0gCod.@9gC.@12gCognome e nome@38gNato il@49gTessera@57gStato att.@68gStato prec.@80gScadenza"); + set_header(5,"@0g------@9g--@12g-------------------------@38g----------@49g-------@57g----------@68g-----------@80g----------"); } -bool TSbloccoSO_app::user_create() +bool TSbloccoSospesi::user_create() { _msk = new TMask("at1300a"); _rel = new TRelation(LF_SOGGETTI); _rel->add(LF_SEZIONI,"CODSEZ==CODSEZ|CODSOT==CODSOT"); _rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS); - _cur = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice - + //cursore ordinamento per sezione+sottogruppo+cognome+nome + _cur = add_cursor(new TCursor(_rel, "", 3)); + _msk->set_handler(F_PRINTER, printer_handler); _contsan = new TLocalisamfile(LF_CONTSAN); _scontrolli = new TRecord_array(LF_CONTSAN, CON_PROGCON); + TString16 config; + config << "SBLOCCOSO"; + printer().read_configuration(config); return TRUE; } -bool TSbloccoSO_app::user_destroy() +bool TSbloccoSospesi::user_destroy() { delete _rel; delete _msk; delete _contsan; delete _scontrolli; + printer().read_configuration(); return TRUE; } int at1300(int argc, char* argv[]) { - TSbloccoSO_app a; + TSbloccoSospesi a; a.run(argc, argv, "Sblocco sospesi"); return 0; } \ No newline at end of file diff --git a/at/at1300a.h b/at/at1300a.h index 1844365f1..85708adb5 100755 --- a/at/at1300a.h +++ b/at/at1300a.h @@ -12,3 +12,5 @@ #define F_DATA 109 #define F_TIPO 110 #define F_D_TIPO 111 +#define F_DEFINITIVA 112 +#define F_PRINTER 113 diff --git a/at/at1300a.uml b/at/at1300a.uml index 8e6218bd8..d525b0525 100755 --- a/at/at1300a.uml +++ b/at/at1300a.uml @@ -117,7 +117,7 @@ BEGIN HELP "Sottogruppo finale" END -GROUPBOX DLG_NULL 77 4 +GROUPBOX DLG_NULL 77 5 BEGIN PROMPT 1 5 "Opzioni per lo sblocco" END @@ -150,14 +150,26 @@ BEGIN FLAGS "D" END +BOOLEAN F_DEFINITIVA +BEGIN + PROMPT 2 8 "Sblocco definitivo" + HELP "Se sblocco definitivo, i soggetti stampati vengono sbloccati" +END + BUTTON DLG_OK 9 2 BEGIN - PROMPT -12 -1 "" + PROMPT -13 -1 "" END +BUTTON F_PRINTER 19 2 +BEGIN + PROMPT -23 -1 "Imposta stampante" +END + + BUTTON DLG_QUIT 9 2 BEGIN - PROMPT -22 -1 "" + PROMPT -33 -1 "" END ENDPAGE diff --git a/at/at1400.cpp b/at/at1400.cpp index 7b4319fca..04d1a9c22 100755 --- a/at/at1400.cpp +++ b/at/at1400.cpp @@ -35,18 +35,16 @@ public: }; */ -class TTessere_application : public TPrintapp +class TStampaTessere : public TPrintapp { TRelation* _rel; TMask* _msk; TAssoc_array _categorie; //TTessere_form* _form_pag; TAssoc_array _asoggetti; - int _numdon; bool _aggiorna; - - int _cur1, _cur2, _cur3, _cur4; + int _cur; TDate _data_stampa; TString _riepilogodon; @@ -67,10 +65,10 @@ public: void filtra_sezioni(); void filtra_codici(); TMask& app_mask() { return *_msk; } - TTessere_application() : _data_stampa(TODAY), _riepilogodon(50) {} + TStampaTessere() : _data_stampa(TODAY), _riepilogodon(50) {} }; -HIDDEN inline TTessere_application& app() { return (TTessere_application&) main_app(); } +HIDDEN inline TStampaTessere& app() { return (TStampaTessere&) main_app(); } //TCursor* TTessere_form::cursor() const { return app().current_cursor(); } @@ -97,7 +95,7 @@ HIDDEN bool printer_handler(TMask_field& f, KEY k) } -void TTessere_application::add_rows_soggetti(TSheet_field& s, int count, int start) +void TStampaTessere::add_rows_soggetti(TSheet_field& s, int count, int start) { if (start == 1) s.destroy(); @@ -105,9 +103,8 @@ void TTessere_application::add_rows_soggetti(TSheet_field& s, int count, int sta TToken_string& row = s.row(r-1); } -void TTessere_application::filtra_codici() +void TStampaTessere::filtra_codici() { - select_cursor(_cur4); TRectype da(LF_SOGGETTI); TRectype a (LF_SOGGETTI); TSheet_field& s = (TSheet_field&)_msk->field(F_SOGGETTI); @@ -132,13 +129,12 @@ void TTessere_application::filtra_codici() current_cursor()->setregion(da, a); } -void TTessere_application::filtra_sezioni() +void TStampaTessere::filtra_sezioni() { const TString16 sezini = _msk->get(F_SEZINI); const TString16 sotini = _msk->get(F_SOTINI); const TString16 sezfin = _msk->get(F_SEZFIN); const TString16 sotfin = _msk->get(F_SOTFIN); - select_cursor(_cur4); TRectype da(LF_SOGGETTI); TRectype a(LF_SOGGETTI); if (sezini.not_empty()) @@ -152,7 +148,7 @@ void TTessere_application::filtra_sezioni() current_cursor()->setregion(da, a); } -void TTessere_application::set_page(int file, int cnt) +void TStampaTessere::set_page(int file, int cnt) { TString16 data_stampa = _data_stampa.string(); set_row(3, "@30g@S", FLD(LF_SEZIONI,SEZ_DENSEZ)); @@ -177,7 +173,7 @@ void TTessere_application::set_page(int file, int cnt) set_row(72,""); } -bool TTessere_application::filter_func_auto(const TRelation* rel) +bool TStampaTessere::filter_func_auto(const TRelation* rel) { bool filtrato = TRUE; TLocalisamfile& sog = rel->lfile(); @@ -197,7 +193,7 @@ bool TTessere_application::filter_func_auto(const TRelation* rel) return filtrato; } -bool TTessere_application::filter_func_manuale(const TRelation* rel) +bool TStampaTessere::filter_func_manuale(const TRelation* rel) { TLocalisamfile& sog = rel->lfile(); TAssoc_array& array_sogg = app()._asoggetti; @@ -205,13 +201,13 @@ bool TTessere_application::filter_func_manuale(const TRelation* rel) return (array_sogg.is_key(codice)); } -print_action TTessere_application::postprocess_page(int file, int counter) +print_action TStampaTessere::postprocess_page(int file, int counter) { printer().formfeed(); return NEXT_PAGE; } -bool TTessere_application::preprocess_page(int file, int counter) +bool TStampaTessere::preprocess_page(int file, int counter) { TLocalisamfile& sogg = current_cursor()->file(LF_SOGGETTI); const int totdon = sogg.get_int(SOG_TOTDON); @@ -232,13 +228,13 @@ bool TTessere_application::preprocess_page(int file, int counter) return TRUE; } -bool TTessere_application::set_print(int m) +bool TStampaTessere::set_print(int m) { TSheet_field& s = (TSheet_field&)_msk->field(F_SOGGETTI); s.destroy(); s.force_update(); if (s.items()==0) - add_rows_soggetti(s,8); + add_rows_soggetti(s,50); KEY tasto; tasto = _msk->run(); if (tasto == K_ENTER) @@ -297,7 +293,7 @@ bool TTessere_application::set_print(int m) return FALSE; } -bool TTessere_application::user_create() +bool TStampaTessere::user_create() { _rel = new TRelation(LF_SOGGETTI); _rel->add(LF_COMUNI, "COM==COMNASC",1,0,ALIAS_COMNAS); @@ -308,39 +304,29 @@ bool TTessere_application::user_create() //_rel->add("CTN", "CODTAB==CATNOND1",1,0,ALIAS_CTN1); //_rel->add("CTN", "CODTAB==CATNOND2",1,0,ALIAS_CTN2); _rel->add("CTD", "CODTAB==CATDON",1,0,ALIAS_CTD); - - _cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice - _cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome - _cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice - _cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome - + //cursore ordinamento per sezione+sottogruppo+cognome+nome + _cur = add_cursor(new TCursor(_rel, "", 3)); _msk = new TMask("at1400a"); _msk->set_handler(F_PRINTER, printer_handler); - //_form_pag = new TTessere_form("AT_PAGIN"); // dovrà esserci PAGINE - TString16 config; config << "TESSERE"; printer().read_configuration(config); return TRUE; } -bool TTessere_application::user_destroy() +bool TStampaTessere::user_destroy() { delete _msk; delete _rel; //delete _form_pag; - printer().read_configuration(); return TRUE; } int at1400(int argc, char* argv[]) { - - TTessere_application a; - + TStampaTessere a; a.run(argc, argv, "Stampa tessere associative"); - return 0; } diff --git a/at/at1500.cpp b/at/at1500.cpp index 7cef2963d..c2674bb04 100755 --- a/at/at1500.cpp +++ b/at/at1500.cpp @@ -20,7 +20,7 @@ #include "contsan.h" #include "sezioni.h" -class TCambiaInt_app : public TPrintapp +class TModificaIntervalli : public TPrintapp { TMask* _msk; TRelation* _rel; @@ -34,7 +34,7 @@ class TCambiaInt_app : public TPrintapp TDate _data_stampa; TString16 _codsez, _codsot; - static bool filter_func_cambiaint(const TRelation* rel); + static bool filter_func_intervalli(const TRelation* rel); protected: virtual bool user_create(); @@ -47,12 +47,12 @@ public: void filtra_sezioni(); void crea_intestazione(); void header_sezione(const TString16 codsez, const TString16 codsot); - TCambiaInt_app() : _data_stampa(TODAY) {} + TModificaIntervalli() : _data_stampa(TODAY) {} }; -HIDDEN inline TCambiaInt_app& app() { return (TCambiaInt_app&) main_app(); } +HIDDEN inline TModificaIntervalli& app() { return (TModificaIntervalli&) main_app(); } -void TCambiaInt_app::filtra_sezioni() +void TModificaIntervalli::filtra_sezioni() { const TString16 sezini = _msk->get(F_SEZINI); const TString16 sotini = _msk->get(F_SOTINI); @@ -71,7 +71,7 @@ void TCambiaInt_app::filtra_sezioni() current_cursor()->setregion(da, a); } -bool TCambiaInt_app::preprocess_page(int file, int counter) +bool TModificaIntervalli::preprocess_page(int file, int counter) { TRectype& recsog = current_cursor()->curr(); TRectype* key = new TRectype(LF_CONTSAN); @@ -116,7 +116,7 @@ bool TCambiaInt_app::preprocess_page(int file, int counter) return TRUE; } -void TCambiaInt_app::set_page(int file, int cnt) +void TModificaIntervalli::set_page(int file, int cnt) { set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"######")); set_row(1,"@9g@S", FLD(LF_SOGGETTI,SOG_CATDON)); @@ -125,7 +125,7 @@ void TCambiaInt_app::set_page(int file, int cnt) set_row(1,"@63g@ld", FLD(LF_SOGGETTI,SOG_DATANASC)); } -bool TCambiaInt_app::filter_func_cambiaint(const TRelation* rel) +bool TModificaIntervalli::filter_func_intervalli(const TRelation* rel) { bool filtrato = FALSE; TRectype& recsog = rel->lfile().curr(); @@ -136,7 +136,7 @@ bool TCambiaInt_app::filter_func_cambiaint(const TRelation* rel) return filtrato; } -void TCambiaInt_app::header_sezione(const TString16 codsez, const TString16 codsot) +void TModificaIntervalli::header_sezione(const TString16 codsez, const TString16 codsot) { const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ); const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT); @@ -157,7 +157,7 @@ void TCambiaInt_app::header_sezione(const TString16 codsez, const TString16 cods return; } -bool TCambiaInt_app::set_print(int) +bool TModificaIntervalli::set_print(int) { KEY tasto; tasto = _msk->run(); @@ -176,7 +176,7 @@ bool TCambiaInt_app::set_print(int) filtra_sezioni(); // non si puo' fare il filtro per intervalli perche' la setfilter // non funziona bene con i campi numerici - current_cursor()->set_filterfunction(filter_func_cambiaint, TRUE); + current_cursor()->set_filterfunction(filter_func_intervalli, TRUE); reset_print(); crea_intestazione(); return TRUE; @@ -185,7 +185,7 @@ bool TCambiaInt_app::set_print(int) return FALSE; } -void TCambiaInt_app::crea_intestazione() +void TModificaIntervalli::crea_intestazione() { reset_header(); @@ -222,20 +222,21 @@ void TCambiaInt_app::crea_intestazione() set_header(5,"@0g------@9g--@12g-------------------------@38g----------"); } -bool TCambiaInt_app::user_create() +bool TModificaIntervalli::user_create() { _msk = new TMask("at1500a"); _rel = new TRelation(LF_SOGGETTI); _rel->add(LF_SEZIONI,"CODSEZ==CODSEZ|CODSOT==CODSOT"); _rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS); - _cur = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice + //cursore ordinamento per sezione+sottogruppo+cognome+nome + _cur = add_cursor(new TCursor(_rel, "", 3)); _contsan = new TLocalisamfile(LF_CONTSAN); _scontrolli = new TRecord_array(LF_CONTSAN, CON_PROGCON); return TRUE; } -bool TCambiaInt_app::user_destroy() +bool TModificaIntervalli::user_destroy() { delete _rel; delete _msk; @@ -246,7 +247,7 @@ bool TCambiaInt_app::user_destroy() int at1500(int argc, char* argv[]) { - TCambiaInt_app a; + TModificaIntervalli a; a.run(argc, argv, "Modifica intervalli di donazione"); return 0; } \ No newline at end of file diff --git a/at/at1600.cpp b/at/at1600.cpp index 7e085141e..c2c60fc03 100755 --- a/at/at1600.cpp +++ b/at/at1600.cpp @@ -15,7 +15,7 @@ #include "soggetti.h" #include "sezioni.h" -class TSbloccoES_app : public TPrintapp +class TSbloccoEsclusi : public TPrintapp { TMask* _msk; TRelation* _rel; @@ -24,8 +24,9 @@ class TSbloccoES_app : public TPrintapp TDate _data_sblocco; // data scadenza esclusione fino a _data_sblocco TDate _data_stampa; TString16 _codsez, _codsot; + bool _definitiva; - static bool filter_func_sbloccoES(const TRelation* rel); + static bool filter_func_sbloccoesclusi(const TRelation* rel); protected: virtual bool user_create(); @@ -38,12 +39,12 @@ public: void filtra_sezioni(); void crea_intestazione(); void header_sezione(const TString16 codsez, const TString16 codsot); - TSbloccoES_app() : _data_sblocco(TODAY), _data_stampa(TODAY) {} + TSbloccoEsclusi() : _data_sblocco(TODAY), _data_stampa(TODAY) {} }; -HIDDEN inline TSbloccoES_app& app() { return (TSbloccoES_app&) main_app(); } +HIDDEN inline TSbloccoEsclusi& app() { return (TSbloccoEsclusi&) main_app(); } -void TSbloccoES_app::filtra_sezioni() +void TSbloccoEsclusi::filtra_sezioni() { const TString16 sezini = _msk->get(F_SEZINI); const TString16 sotini = _msk->get(F_SOTINI); @@ -62,13 +63,15 @@ void TSbloccoES_app::filtra_sezioni() current_cursor()->setregion(da, a); } -bool TSbloccoES_app::preprocess_page(int file, int counter) +bool TSbloccoEsclusi::preprocess_page(int file, int counter) { TRectype& recsog = current_cursor()->curr(); - recsog.put(SOG_ESCLUSO, " "); - recsog.put(SOG_TERMESCL, NULLDATE); - current_cursor()->file().rewrite(); - + if (_definitiva) + { + recsog.put(SOG_ESCLUSO, " "); + recsog.put(SOG_TERMESCL, NULLDATE); + current_cursor()->file().rewrite(); + } // salto pagina se cambio sezione const TString16 codsez = recsog.get(SOG_CODSEZ); const TString16 codsot = recsog.get(SOG_CODSOT); @@ -83,7 +86,7 @@ bool TSbloccoES_app::preprocess_page(int file, int counter) return TRUE; } -void TSbloccoES_app::set_page(int file, int cnt) +void TSbloccoEsclusi::set_page(int file, int cnt) { set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########")); set_row(1,"@9g@S", FLD(LF_SOGGETTI,SOG_CATDON)); @@ -92,14 +95,14 @@ void TSbloccoES_app::set_page(int file, int cnt) set_row(1,"@63g@ld", FLD(LF_SOGGETTI,SOG_DATANASC)); } -bool TSbloccoES_app::filter_func_sbloccoES(const TRelation* rel) +bool TSbloccoEsclusi::filter_func_sbloccoesclusi(const TRelation* rel) { TRectype& recsog = rel->lfile().curr(); TDate scadenza = recsog.get(SOG_TERMESCL); return (scadenza.ok() && scadenza <= app()._data_sblocco); } -void TSbloccoES_app::header_sezione(const TString16 codsez, const TString16 codsot) +void TSbloccoEsclusi::header_sezione(const TString16 codsez, const TString16 codsot) { const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ); const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT); @@ -120,7 +123,7 @@ void TSbloccoES_app::header_sezione(const TString16 codsez, const TString16 cods return; } -bool TSbloccoES_app::set_print(int) +bool TSbloccoEsclusi::set_print(int) { KEY tasto; tasto = _msk->run(); @@ -129,11 +132,12 @@ bool TSbloccoES_app::set_print(int) _codsez = "**"; _codsot = "**"; _data_sblocco = _msk->get(F_DATA); + _definitiva = _msk->get_bool(F_DEFINITIVA); reset_files(); add_file(LF_SOGGETTI); filtra_sezioni(); current_cursor()->setfilter("ESCLUSO == \"TD\"", TRUE); - current_cursor()->set_filterfunction(filter_func_sbloccoES, TRUE); + current_cursor()->set_filterfunction(filter_func_sbloccoesclusi, TRUE); reset_print(); crea_intestazione(); return TRUE; @@ -142,12 +146,15 @@ bool TSbloccoES_app::set_print(int) return FALSE; } -void TSbloccoES_app::crea_intestazione() +void TSbloccoEsclusi::crea_intestazione() { reset_header(); TString sep(132); - sep = "SBLOCCO ESCLUSO "; + if (_definitiva) + sep = "SBLOCCO DEFINITIVO ESCLUSI "; + else + sep = "STAMPA PROVVISORIA PER SBLOCCO ESCLUSI "; sep << " FINO ALLA DATA "; TString16 data_stampa = _data_sblocco.string(); sep << data_stampa; @@ -166,16 +173,17 @@ void TSbloccoES_app::crea_intestazione() set_header(5,"@0g--------@9g--@12g-------------------------@38g----------"); } -bool TSbloccoES_app::user_create() +bool TSbloccoEsclusi::user_create() { _msk = new TMask("at1600a"); _rel = new TRelation(LF_SOGGETTI); _rel->add(LF_SEZIONI,"CODSEZ==CODSEZ|CODSOT==CODSOT"); - _cur = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice + //cursore ordinamento per sezione+sottogruppo+cognome+nome + _cur = add_cursor(new TCursor(_rel, "", 3)); return TRUE; } -bool TSbloccoES_app::user_destroy() +bool TSbloccoEsclusi::user_destroy() { delete _rel; delete _msk; @@ -184,7 +192,7 @@ bool TSbloccoES_app::user_destroy() int at1600(int argc, char* argv[]) { - TSbloccoES_app a; + TSbloccoEsclusi a; a.run(argc, argv, "Sblocco esclusi"); return 0; } \ No newline at end of file diff --git a/at/at1600a.h b/at/at1600a.h index 1deddc417..f173c4c62 100755 --- a/at/at1600a.h +++ b/at/at1600a.h @@ -10,3 +10,4 @@ #define F_SOTFIN 107 #define F_D_SOTFIN 108 #define F_DATA 109 +#define F_DEFINITIVA 110 diff --git a/at/at1600a.uml b/at/at1600a.uml index fef622dc2..a0541d115 100755 --- a/at/at1600a.uml +++ b/at/at1600a.uml @@ -129,6 +129,12 @@ BEGIN HELP "Data di riferimento per la scadenza (fino al)" END +BOOLEAN F_DEFINITIVA +BEGIN + PROMPT 35 6 "Sblocco definitivo" + HELP "Se sblocco definitivo, i soggetti stampati vengono sbloccati" +END + BUTTON DLG_OK 9 2 BEGIN PROMPT -12 -1 "" diff --git a/at/at2100.cpp b/at/at2100.cpp index 90ddc3cbc..5da68e879 100755 --- a/at/at2100.cpp +++ b/at/at2100.cpp @@ -29,19 +29,17 @@ public: virtual ~TEti_sospesi_form() {}; }; -class TSospesi_application : public TPrintapp +class TStampaSospesi : public TPrintapp { TRelation* _rel; TMask* _msk; TEti_sospesi_form* _form_eti; - TAssoc_array _categorie; - - int _cur1, _cur2, _cur3, _cur4; - TParagraph_string _cognome_nome; - TDate _data_stampa; - ts _tipo_stampa; - TString16 _codsez, _codsot; + int _cur; + TParagraph_string _cognome_nome; + TDate _data_stampa; + ts _tipo_stampa; + TString16 _codsez, _codsot; static bool filter_func_sospesi(const TRelation* rel); @@ -57,22 +55,21 @@ public: void filtra_sezioni(); void header_sezione(const TString16 codsez, const TString16 codsot); TMask& app_mask() { return *_msk; } - TSospesi_application() : _data_stampa(TODAY), _cognome_nome("",25) {} + TStampaSospesi() : _data_stampa(TODAY), _cognome_nome("",25) {} }; -HIDDEN inline TSospesi_application& app() { return (TSospesi_application&) main_app(); } +HIDDEN inline TStampaSospesi& app() { return (TStampaSospesi&) main_app(); } TCursor* TEti_sospesi_form::cursor() const { return app().current_cursor(); } TRelation* TEti_sospesi_form::relation() const { return cursor()->relation(); } -void TSospesi_application::filtra_sezioni() +void TStampaSospesi::filtra_sezioni() { const TString16 sezini = _msk->get(F_SEZINI); const TString16 sotini = _msk->get(F_SOTINI); const TString16 sezfin = _msk->get(F_SEZFIN); const TString16 sotfin = _msk->get(F_SOTFIN); - select_cursor(_cur4); TRectype da(LF_SOGGETTI); TRectype a (LF_SOGGETTI); if (sezini.not_empty()) @@ -86,7 +83,7 @@ void TSospesi_application::filtra_sezioni() current_cursor()->setregion(da, a); } -void TSospesi_application::set_page(int file, int cnt) +void TStampaSospesi::set_page(int file, int cnt) { // costruzione etichette switch (_tipo_stampa) @@ -124,7 +121,7 @@ void TSospesi_application::set_page(int file, int cnt) } } -bool TSospesi_application::filter_func_sospesi(const TRelation* rel) +bool TStampaSospesi::filter_func_sospesi(const TRelation* rel) { bool filtrato = TRUE; TLocalisamfile& sog = rel->lfile(); @@ -138,7 +135,7 @@ bool TSospesi_application::filter_func_sospesi(const TRelation* rel) return filtrato; } -bool TSospesi_application::preprocess_page(int file, int counter) +bool TStampaSospesi::preprocess_page(int file, int counter) { if (_tipo_stampa == elenco) { @@ -147,7 +144,6 @@ bool TSospesi_application::preprocess_page(int file, int counter) nome << " "; nome << recsog.get(SOG_NOME); _cognome_nome = nome; - // salto pagina se cambio sezione const TString16 codsez = recsog.get(SOG_CODSEZ); const TString16 codsot = recsog.get(SOG_CODSOT); @@ -163,7 +159,7 @@ bool TSospesi_application::preprocess_page(int file, int counter) return TRUE; } -void TSospesi_application::header_sezione(const TString16 codsez, const TString16 codsot) +void TStampaSospesi::header_sezione(const TString16 codsez, const TString16 codsot) { const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ); const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT); @@ -184,7 +180,7 @@ void TSospesi_application::header_sezione(const TString16 codsez, const TString1 return; } -bool TSospesi_application::set_print(int m) +bool TStampaSospesi::set_print(int m) { _tipo_stampa = undefined; KEY tasto; @@ -204,17 +200,14 @@ bool TSospesi_application::set_print(int m) { reset_files(); add_file(LF_SOGGETTI); - // filtro per sezioni selezionati filtra_sezioni(); - // filtro per tipo sospensione const TString16 tiposo = _msk->get(F_TIPO); if (tiposo.not_empty() && tiposo.ok()) current_cursor()->setfilter(format("STATO == \"%s\"",(const char*)tiposo)); else current_cursor()->setfilter("TCS->S6 == \"S\"", TRUE); - // filtro per categorie const TString16 catpri = _msk->get(F_CAT1); const TString16 catsec = _msk->get(F_CAT2); @@ -235,7 +228,6 @@ bool TSospesi_application::set_print(int m) if (catses.not_empty() && catses.ok()) _categorie.add((const char*) catses); current_cursor()->set_filterfunction(filter_func_sospesi); - reset_print(); crea_intestazione(); return TRUE; @@ -244,7 +236,7 @@ bool TSospesi_application::set_print(int m) return FALSE; } -void TSospesi_application::crea_intestazione() +void TStampaSospesi::crea_intestazione() { reset_header(); @@ -268,18 +260,16 @@ void TSospesi_application::crea_intestazione() sep = ""; sep << "Pag. @#"; set_header(2, "@120g%s", (const char*) sep); - sep = ""; sep.fill('-'); set_header(3, (const char *) sep); - set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gSospensione@63gUltima idon.@77gIntervalli@88gUltima donaz.@102gUlt.controllo@116gPross.contr."); set_header(5,"@78gSI AF"); set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g-------------@63g-------------@77g----------@88g-------------@102g-------------@116g-------------"); } } -bool TSospesi_application::user_create() +bool TStampaSospesi::user_create() { _rel = new TRelation(LF_SOGGETTI); _rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS); @@ -287,20 +277,14 @@ bool TSospesi_application::user_create() _rel->add(LF_COMUNI, "COM==DOM_CODCOM"); // per stampare nell'intestazione la denominazione della sezione _rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT"); - - _cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice - _cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome - _cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice - _cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome - + // ordinamento per sezione+sottogruppo+cognome e nome + _cur = add_cursor(new TCursor(_rel, "", 3)); _msk = new TMask("at2100a"); - _form_eti = new TEti_sospesi_form("AT_ETSOG"); - return TRUE; } -bool TSospesi_application::user_destroy() +bool TStampaSospesi::user_destroy() { delete _msk; delete _rel; @@ -310,10 +294,7 @@ bool TSospesi_application::user_destroy() int at2100(int argc, char* argv[]) { - - TSospesi_application a; - + TStampaSospesi a; a.run(argc, argv, "Elenco sospesi"); - return 0; } diff --git a/at/at2100a.uml b/at/at2100a.uml index a8f4c6ac0..234ad1c62 100755 --- a/at/at2100a.uml +++ b/at/at2100a.uml @@ -1,6 +1,6 @@ #include "at2100a.h" #include "lf.h" -PAGE "Definizione Stampe" -1 -1 78 20 +PAGE "Stampa soggetti sospesi" -1 -1 78 20 GROUPBOX DLG_NULL 77 4 BEGIN diff --git a/at/at2200.cpp b/at/at2200.cpp index 9958f7b46..cecb86c2a 100755 --- a/at/at2200.cpp +++ b/at/at2200.cpp @@ -29,19 +29,16 @@ public: virtual ~TEti_pereta_form() {}; }; -class TPereta_application : public TPrintapp +class TStampaPerEta : public TPrintapp { static bool filter_func_pereta(const TRelation* rel); TRelation* _rel; TMask* _msk; TEti_pereta_form* _form_eti; - TAssoc_array _categorie; - - int _cur1, _cur2, _cur3, _cur4; + int _cur; TParagraph_string _cognome_nome, _dencom; - TDate _data_stampa; TDate _dataini, _datafin; ts _tipo_stampa; @@ -61,22 +58,21 @@ public: void header_sezione(const TString16 codsez, const TString16 codsot); TMask& app_mask() { return *_msk; } - TPereta_application() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {} + TStampaPerEta() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {} }; -HIDDEN inline TPereta_application& app() { return (TPereta_application&) main_app(); } +HIDDEN inline TStampaPerEta& app() { return (TStampaPerEta&) main_app(); } TCursor* TEti_pereta_form::cursor() const { return app().current_cursor(); } TRelation* TEti_pereta_form::relation() const { return cursor()->relation(); } -void TPereta_application::filtra_sezioni() +void TStampaPerEta::filtra_sezioni() { const TString16 sezini = _msk->get(F_SEZINI); const TString16 sotini = _msk->get(F_SOTINI); const TString16 sezfin = _msk->get(F_SEZFIN); const TString16 sotfin = _msk->get(F_SOTFIN); - select_cursor(_cur4); TRectype da(LF_SOGGETTI); TRectype a(LF_SOGGETTI); if (sezini.not_empty()) @@ -90,7 +86,7 @@ void TPereta_application::filtra_sezioni() current_cursor()->setregion(da, a); } -void TPereta_application::set_page(int file, int cnt) +void TStampaPerEta::set_page(int file, int cnt) { switch (_tipo_stampa) { @@ -104,8 +100,9 @@ void TPereta_application::set_page(int file, int cnt) TPrintrow& riga = corpo.row(i); set_row(i+1,riga); } - force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage - // altrimenti stampa sempre la stessa etichetta + // serve perchè alla prossima etichetta rifaccia la setpage + // altrimenti stampa sempre la stessa etichetta + force_setpage(TRUE); } break; case elenco: @@ -124,7 +121,7 @@ void TPereta_application::set_page(int file, int cnt) } } -bool TPereta_application::filter_func_pereta(const TRelation* rel) +bool TStampaPerEta::filter_func_pereta(const TRelation* rel) { bool filtrato = TRUE; TLocalisamfile& sog = rel->lfile(); @@ -147,7 +144,7 @@ bool TPereta_application::filter_func_pereta(const TRelation* rel) return filtrato; } -void TPereta_application::header_sezione(const TString16 codsez, const TString16 codsot) +void TStampaPerEta::header_sezione(const TString16 codsez, const TString16 codsot) { const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ); const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT); @@ -168,7 +165,7 @@ void TPereta_application::header_sezione(const TString16 codsez, const TString16 return; } -bool TPereta_application::preprocess_page(int file, int counter) +bool TStampaPerEta::preprocess_page(int file, int counter) { if (_tipo_stampa == elenco) { @@ -209,7 +206,7 @@ bool TPereta_application::preprocess_page(int file, int counter) return TRUE; } -bool TPereta_application::set_print(int m) +bool TStampaPerEta::set_print(int m) { _tipo_stampa = undefined; KEY tasto; @@ -230,7 +227,6 @@ bool TPereta_application::set_print(int m) reset_files(); add_file(LF_SOGGETTI); filtra_sezioni(); - _dataini = _msk->get(F_DATAINI); _datafin = _msk->get(F_DATAFIN); const TString16 catpri = _msk->get(F_CAT1); @@ -252,7 +248,6 @@ bool TPereta_application::set_print(int m) if (catses.not_empty() && catses.ok()) _categorie.add((const char*) catses); current_cursor()->set_filterfunction (filter_func_pereta); - reset_print(); crea_intestazione(); return TRUE; @@ -261,10 +256,9 @@ bool TPereta_application::set_print(int m) return FALSE; } -void TPereta_application::crea_intestazione() +void TStampaPerEta::crea_intestazione() { reset_header(); - if (_tipo_stampa == elenco) { TString sep(132); @@ -288,18 +282,16 @@ void TPereta_application::crea_intestazione() sep = ""; sep << "Pag. @#"; set_header(2, "@120g%s", (const char*) sep); - sep = ""; sep.fill('-'); set_header(3, (const char *) sep); - set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gIndirizzo@100gTelefono abit.@116gTelefono lavoro"); set_header(5,"@49gCAP/Località/Comune/Prov.@116gTelefono altro"); set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g---------------"); } } -bool TPereta_application::user_create() +bool TStampaPerEta::user_create() { _rel = new TRelation(LF_SOGGETTI); _rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS); @@ -307,18 +299,14 @@ bool TPereta_application::user_create() _rel->add(LF_COMUNI, "COM==DOM_CODCOM"); // per stampare nell'intestazione la denominazione della sezione _rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT"); - - _cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice - _cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome - _cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice - _cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome - + // ordinamento per sezione+sottogruppo+cognome e nome + _cur = add_cursor(new TCursor(_rel, "", 3)); _form_eti = new TEti_pereta_form("AT_ETSOG"); _msk = new TMask("at2200a"); return TRUE; } -bool TPereta_application::user_destroy() +bool TStampaPerEta::user_destroy() { delete _msk; delete _rel; @@ -328,10 +316,7 @@ bool TPereta_application::user_destroy() int at2200(int argc, char* argv[]) { - - TPereta_application a; - + TStampaPerEta a; a.run(argc, argv, "Elenco per data nascita"); - return 0; } diff --git a/at/at2200a.uml b/at/at2200a.uml index c0da81700..d1f0ca601 100755 --- a/at/at2200a.uml +++ b/at/at2200a.uml @@ -1,6 +1,6 @@ #include "at2200a.h" #include "lf.h" -PAGE "Definizione Stampe" -1 -1 78 20 +PAGE "Stampa soggetti per data nascita" -1 -1 78 20 GROUPBOX DLG_NULL 77 4 BEGIN diff --git a/at/at2300.cpp b/at/at2300.cpp index e63f432ac..63b16fce9 100755 --- a/at/at2300.cpp +++ b/at/at2300.cpp @@ -29,19 +29,17 @@ public: virtual ~TEti_esclusi_form() {}; }; -class TEsclusi_application : public TPrintapp +class TStampaEsclusi : public TPrintapp { static bool filter_func_esclusi(const TRelation* rel); TRelation* _rel; TMask* _msk; TEti_esclusi_form* _form_eti; - TAssoc_array _categorie; TString16 _tipoesc; TDate _termineesc; - - int _cur1, _cur2, _cur3, _cur4; + int _cur; TParagraph_string _cognome_nome; TDate _data_stampa; ts _tipo_stampa; @@ -59,22 +57,21 @@ public: void filtra_sezioni(); void header_sezione(const TString16 codsez, const TString16 codsot); TMask& app_mask() { return *_msk; } - TEsclusi_application() : _data_stampa(TODAY), _cognome_nome("",25) {} + TStampaEsclusi() : _data_stampa(TODAY), _cognome_nome("",25) {} }; -HIDDEN inline TEsclusi_application& app() { return (TEsclusi_application&) main_app(); } +HIDDEN inline TStampaEsclusi& app() { return (TStampaEsclusi&) main_app(); } TCursor* TEti_esclusi_form::cursor() const { return app().current_cursor(); } TRelation* TEti_esclusi_form::relation() const { return cursor()->relation(); } -void TEsclusi_application::filtra_sezioni() +void TStampaEsclusi::filtra_sezioni() { const TString16 sezini = _msk->get(F_SEZINI); const TString16 sotini = _msk->get(F_SOTINI); const TString16 sezfin = _msk->get(F_SEZFIN); const TString16 sotfin = _msk->get(F_SOTFIN); - select_cursor(_cur4); TRectype da(LF_SOGGETTI); TRectype a(LF_SOGGETTI); if (sezini.not_empty()) @@ -88,7 +85,7 @@ void TEsclusi_application::filtra_sezioni() current_cursor()->setregion(da, a); } -void TEsclusi_application::set_page(int file, int cnt) +void TStampaEsclusi::set_page(int file, int cnt) { // costruzione etichette switch (_tipo_stampa) @@ -103,8 +100,9 @@ void TEsclusi_application::set_page(int file, int cnt) TPrintrow& riga = corpo.row(i); set_row(i+1,riga); } - force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage - // altrimenti stampa sempre la stessa etichetta + // serve perchè alla prossima etichetta rifaccia la setpage + // altrimenti stampa sempre la stessa etichetta + force_setpage(TRUE); } break; case elenco: @@ -121,7 +119,7 @@ void TEsclusi_application::set_page(int file, int cnt) } } -bool TEsclusi_application::filter_func_esclusi(const TRelation * rel) +bool TStampaEsclusi::filter_func_esclusi(const TRelation * rel) { bool filtrato = TRUE; TLocalisamfile& sog = rel->lfile(); @@ -141,7 +139,7 @@ bool TEsclusi_application::filter_func_esclusi(const TRelation * rel) return filtrato; } -bool TEsclusi_application::preprocess_page(int file, int counter) +bool TStampaEsclusi::preprocess_page(int file, int counter) { if (_tipo_stampa == elenco) { @@ -165,7 +163,7 @@ bool TEsclusi_application::preprocess_page(int file, int counter) return TRUE; } -void TEsclusi_application::header_sezione(const TString16 codsez, const TString16 codsot) +void TStampaEsclusi::header_sezione(const TString16 codsez, const TString16 codsot) { const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ); const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT); @@ -186,7 +184,7 @@ void TEsclusi_application::header_sezione(const TString16 codsez, const TString1 return; } -bool TEsclusi_application::set_print(int) +bool TStampaEsclusi::set_print(int) { _tipo_stampa = undefined; KEY tasto; @@ -207,14 +205,12 @@ bool TEsclusi_application::set_print(int) reset_files(); add_file(LF_SOGGETTI); filtra_sezioni(); - // filtro per tipo esclusione _tipoesc = _msk->get(F_TIPO); if (_tipoesc.not_empty() && _tipoesc.ok()) current_cursor()->setfilter(format("ESCLUSO == \"%s\"",(const char*)_tipoesc)); else current_cursor()->setfilter("ESCLUSO != \"\""); - // filtro per categorie const TString16 catpri = _msk->get(F_CAT1); const TString16 catsec = _msk->get(F_CAT2); @@ -236,9 +232,7 @@ bool TEsclusi_application::set_print(int) _categorie.add((const char*) catses); // filtro per termine esclusione _termineesc = _msk->get(F_DATA); - current_cursor()->set_filterfunction(filter_func_esclusi); - reset_print(); crea_intestazione(); return TRUE; @@ -247,10 +241,9 @@ bool TEsclusi_application::set_print(int) return FALSE; } -void TEsclusi_application::crea_intestazione() +void TStampaEsclusi::crea_intestazione() { reset_header(); - if (_tipo_stampa == elenco) { TString sep(90); @@ -272,18 +265,16 @@ void TEsclusi_application::crea_intestazione() sep = ""; sep << "Pag. @#"; set_header(2, "@78g%s", (const char*) sep); - sep = ""; sep.fill('-'); set_header(3, (const char *) sep); - set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gEsclusione@63gMotivo"); set_header(5,"@49gTipo Termine"); set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g-------------@63g------------------------------"); } } -bool TEsclusi_application::user_create() +bool TStampaEsclusi::user_create() { _rel = new TRelation(LF_SOGGETTI); _rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS); @@ -291,19 +282,14 @@ bool TEsclusi_application::user_create() _rel->add(LF_COMUNI, "COM==DOM_CODCOM"); // per stampare le denominazione della sezione nell'intestazione _rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT"); - - _cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice - _cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome - _cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice - _cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome - + // ordinamento per sezione+sottogruppo+cognome+nome + _cur = add_cursor(new TCursor(_rel, "", 3)); _msk = new TMask("at2300a"); _form_eti = new TEti_esclusi_form("AT_ETSOG"); - return TRUE; } -bool TEsclusi_application::user_destroy() +bool TStampaEsclusi::user_destroy() { delete _msk; delete _rel; @@ -313,10 +299,7 @@ bool TEsclusi_application::user_destroy() int at2300(int argc, char* argv[]) { - - TEsclusi_application a; - + TStampaEsclusi a; a.run(argc, argv, "Elenco esclusi"); - return 0; } diff --git a/at/at2300a.uml b/at/at2300a.uml index 99fa5e806..c65310348 100755 --- a/at/at2300a.uml +++ b/at/at2300a.uml @@ -1,6 +1,6 @@ #include "at2300a.h" #include "lf.h" -PAGE "Definizione Stampe" -1 -1 78 20 +PAGE "Stampa soggetti esclusi" -1 -1 78 20 GROUPBOX DLG_NULL 77 4 BEGIN diff --git a/at/at2400.cpp b/at/at2400.cpp index 06613a4ba..e3ad4b774 100755 --- a/at/at2400.cpp +++ b/at/at2400.cpp @@ -15,7 +15,7 @@ #define ALIAS_CTN2 120 // categoria non donatori 2 #define ALIAS_TCS 200 // tipi/esiti controlli sanitari -#define ALIAS_LDN 300 // luoghi di donazione/punti di raccolta +#define ALIAS_LDN 300 // punti di prelievo #define ALIAS_LCPRES 400 // localita' postale di residenza #define ALIAS_LCPDOM 410 // localita' postale di domicilio @@ -39,7 +39,7 @@ public: virtual ~TModificati_form() {}; }; -class TModificati_application : public TPrintapp +class TStampaModificati : public TPrintapp { static bool filter_func_modificati(const TRelation* rel); @@ -47,15 +47,12 @@ class TModificati_application : public TPrintapp TMask* _msk; TModificati_form* _form_pag; TAssoc_array _categorie; - - int _cur1, _cur2, _cur3, _cur4; + int _cur; TParagraph_string _cognome_nome, _dencom; - TDate _data_stampa, _dataini; ts _tipo_stampa; TString16 _codsez, _codsot; - protected: virtual bool user_create(); virtual bool user_destroy(); @@ -69,22 +66,21 @@ public: void header_sezione(const TString16 codsez, const TString16 codsot); TMask& app_mask() { return *_msk; } - TModificati_application() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {} + TStampaModificati() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {} }; -HIDDEN inline TModificati_application& app() { return (TModificati_application&) main_app(); } +HIDDEN inline TStampaModificati& app() { return (TStampaModificati&) main_app(); } TCursor* TModificati_form::cursor() const { return app().current_cursor(); } TRelation* TModificati_form::relation() const { return cursor()->relation(); } -void TModificati_application::filtra_sezioni() +void TStampaModificati::filtra_sezioni() { const TString16 sezini = _msk->get(F_SEZINI); const TString16 sotini = _msk->get(F_SOTINI); const TString16 sezfin = _msk->get(F_SEZFIN); const TString16 sotfin = _msk->get(F_SOTFIN); - select_cursor(_cur4); TRectype da(LF_SOGGETTI); TRectype a(LF_SOGGETTI); if (sezini.not_empty()) @@ -98,7 +94,7 @@ void TModificati_application::filtra_sezioni() current_cursor()->setregion(da, a); } -void TModificati_application::set_page(int file, int cnt) +void TStampaModificati::set_page(int file, int cnt) { switch (_tipo_stampa) { @@ -112,8 +108,9 @@ void TModificati_application::set_page(int file, int cnt) TPrintrow& riga = corpo.row(i); set_row(i+1,riga); } - force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage - // altrimenti stampa sempre la stessa etichetta + // serve perchè alla prossima etichetta rifaccia la setpage + // altrimenti stampa sempre la stessa etichetta + force_setpage(TRUE); } break; case elenco: @@ -132,7 +129,7 @@ void TModificati_application::set_page(int file, int cnt) } } -bool TModificati_application::filter_func_modificati(const TRelation* rel) +bool TStampaModificati::filter_func_modificati(const TRelation* rel) { bool filtrato = TRUE; TLocalisamfile& sog = rel->lfile(); @@ -152,7 +149,7 @@ bool TModificati_application::filter_func_modificati(const TRelation* rel) return filtrato; } -bool TModificati_application::preprocess_page(int file, int counter) +bool TStampaModificati::preprocess_page(int file, int counter) { if (_tipo_stampa == elenco) { @@ -177,7 +174,6 @@ bool TModificati_application::preprocess_page(int file, int counter) localita << current_cursor()->curr(-ALIAS_COMDOM).get(COM_DENCOM); localita.trim(); _dencom = localita; - // salto pagina se cambio sezione const TString16 codsez = recsog.get(SOG_CODSEZ); const TString16 codsot = recsog.get(SOG_CODSOT); @@ -193,7 +189,7 @@ bool TModificati_application::preprocess_page(int file, int counter) return TRUE; } -void TModificati_application::header_sezione(const TString16 codsez, const TString16 codsot) +void TStampaModificati::header_sezione(const TString16 codsez, const TString16 codsot) { const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ); const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT); @@ -214,7 +210,7 @@ void TModificati_application::header_sezione(const TString16 codsez, const TStri return; } -bool TModificati_application::set_print(int) +bool TStampaModificati::set_print(int) { _tipo_stampa = undefined; KEY tasto; @@ -236,7 +232,6 @@ bool TModificati_application::set_print(int) add_file(LF_SOGGETTI); _dataini = _msk->get(F_DATAINI); filtra_sezioni(); - // filtro per categorie const TString16 catpri = _msk->get(F_CAT1); const TString16 catsec = _msk->get(F_CAT2); @@ -256,7 +251,6 @@ bool TModificati_application::set_print(int) _categorie.add((const char*) catqui); if (catses.not_empty() && catses.ok()) _categorie.add((const char*) catses); - current_cursor()->set_filterfunction(filter_func_modificati); reset_print(); crea_intestazione(); @@ -266,10 +260,9 @@ bool TModificati_application::set_print(int) return FALSE; } -void TModificati_application::crea_intestazione() +void TStampaModificati::crea_intestazione() { reset_header(); - if (_tipo_stampa == elenco) { TString sep(132); @@ -287,18 +280,16 @@ void TModificati_application::crea_intestazione() sep = ""; sep << "Pag. @#"; set_header(2, "@120g%s", (const char*) sep); - sep = ""; sep.fill('-'); set_header(3, (const char *) sep); - set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gIndirizzo@100gTelefono abit.@116gTelefono lavoro"); set_header(5,"@49gCAP/Località/Comune/Prov.@116gTelefono altro"); set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g---------------"); } } -bool TModificati_application::user_create() +bool TStampaModificati::user_create() { _rel = new TRelation(LF_SOGGETTI); _rel->add("CTD", "CODTAB==CATDON",1,0,ALIAS_CTD); @@ -313,18 +304,14 @@ bool TModificati_application::user_create() _rel->add(LF_COMUNI, "COM==COMNASC",1,0,ALIAS_COMNAS); _rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT"); _rel->add(LF_MEDICI, "CODMED==CODMED"); - - _cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice - _cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome - _cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice - _cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome - + // ordinamento per sezione+sottogruppo+cognome+nome + _cur = add_cursor(new TCursor(_rel, "", 3)); _form_pag = new TModificati_form("AT_PAGIN"); _msk = new TMask("at2400a"); return TRUE; } -bool TModificati_application::user_destroy() +bool TStampaModificati::user_destroy() { delete _msk; delete _rel; @@ -334,10 +321,7 @@ bool TModificati_application::user_destroy() int at2400(int argc, char* argv[]) { - - TModificati_application a; - + TStampaModificati a; a.run(argc, argv, "Elenco soggetti modificati"); - return 0; } diff --git a/at/at2400a.uml b/at/at2400a.uml index 1ee3a7165..d92679425 100755 --- a/at/at2400a.uml +++ b/at/at2400a.uml @@ -1,6 +1,6 @@ #include "at2400a.h" #include "lf.h" -PAGE "Definizione Stampe" -1 -1 78 20 +PAGE "Stampa soggetti modificati" -1 -1 78 20 GROUPBOX DLG_NULL 77 4 BEGIN diff --git a/at/at2500.cpp b/at/at2500.cpp index ebedd707c..38cae2093 100755 --- a/at/at2500.cpp +++ b/at/at2500.cpp @@ -29,7 +29,7 @@ public: virtual ~TEti_idonei_form() {}; }; -class TIdonei_application : public TPrintapp +class TStampaIdonei : public TPrintapp { TRelation* _rel; TMask* _msk; @@ -38,7 +38,7 @@ class TIdonei_application : public TPrintapp TString16 _tipoidon; TString16 _idon1, _idon2, _idon3, _idon4; - int _cur1, _cur2, _cur3, _cur4; + int _cur; TParagraph_string _cognome_nome; TDate _data_stampa; ts _tipo_stampa; @@ -58,22 +58,21 @@ public: void filtra_sezioni(); void header_sezione(const TString16 codsez, const TString16 codsot); TMask& app_mask() { return *_msk; } - TIdonei_application() : _data_stampa(TODAY), _cognome_nome("",25) {} + TStampaIdonei() : _data_stampa(TODAY), _cognome_nome("",25) {} }; -HIDDEN inline TIdonei_application& app() { return (TIdonei_application&) main_app(); } +HIDDEN inline TStampaIdonei& app() { return (TStampaIdonei&) main_app(); } TCursor* TEti_idonei_form::cursor() const { return app().current_cursor(); } TRelation* TEti_idonei_form::relation() const { return cursor()->relation(); } -void TIdonei_application::filtra_sezioni() +void TStampaIdonei::filtra_sezioni() { const TString16 sezini = _msk->get(F_SEZINI); const TString16 sotini = _msk->get(F_SOTINI); const TString16 sezfin = _msk->get(F_SEZFIN); const TString16 sotfin = _msk->get(F_SOTFIN); - select_cursor(_cur4); TRectype da(LF_SOGGETTI); TRectype a(LF_SOGGETTI); if (sezini.not_empty()) @@ -87,7 +86,7 @@ void TIdonei_application::filtra_sezioni() current_cursor()->setregion(da, a); } -void TIdonei_application::set_page(int file, int cnt) +void TStampaIdonei::set_page(int file, int cnt) { // costruzione etichette switch (_tipo_stampa) @@ -102,8 +101,9 @@ void TIdonei_application::set_page(int file, int cnt) TPrintrow& riga = corpo.row(i); set_row(i+1,riga); } - force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage - // altrimenti stampa sempre la stessa etichetta + // serve perchè alla prossima etichetta rifaccia la setpage + // altrimenti stampa sempre la stessa etichetta + force_setpage(TRUE); } break; case elenco: @@ -117,14 +117,13 @@ void TIdonei_application::set_page(int file, int cnt) set_row(1,"@63g@S", FLD(LF_SOGGETTI,SOG_IDON2)); set_row(1,"@66g@S", FLD(LF_SOGGETTI,SOG_IDON3)); set_row(1,"@69g@S", FLD(LF_SOGGETTI,SOG_IDON4)); - set_row(2,"@52g@S", FLD(LF_SOGGETTI,SOG_STATO)); } break; } } -bool TIdonei_application::filter_func_idonei(const TRelation * rel) +bool TStampaIdonei::filter_func_idonei(const TRelation * rel) { bool filtrato = TRUE; TLocalisamfile& sog = rel->lfile(); @@ -166,7 +165,7 @@ bool TIdonei_application::filter_func_idonei(const TRelation * rel) return filtrato; } -bool TIdonei_application::preprocess_page(int file, int counter) +bool TStampaIdonei::preprocess_page(int file, int counter) { if (_tipo_stampa == elenco) { @@ -175,7 +174,6 @@ bool TIdonei_application::preprocess_page(int file, int counter) nome << " "; nome << recsog.get(SOG_NOME); _cognome_nome = nome; - // salto pagina se cambio sezione const TString16 codsez = recsog.get(SOG_CODSEZ); const TString16 codsot = recsog.get(SOG_CODSOT); @@ -191,7 +189,7 @@ bool TIdonei_application::preprocess_page(int file, int counter) return TRUE; } -void TIdonei_application::header_sezione(const TString16 codsez, const TString16 codsot) +void TStampaIdonei::header_sezione(const TString16 codsez, const TString16 codsot) { const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ); const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT); @@ -212,7 +210,7 @@ void TIdonei_application::header_sezione(const TString16 codsez, const TString16 return; } -bool TIdonei_application::set_print(int m) +bool TStampaIdonei::set_print(int m) { _tipo_stampa = undefined; KEY tasto; @@ -221,8 +219,6 @@ bool TIdonei_application::set_print(int m) { case F_ELENCO: _tipo_stampa = elenco; - //_codsez.spaces(2); - //_codsot.spaces(2); _codsez = "**"; _codsot = "**"; break; @@ -234,17 +230,14 @@ bool TIdonei_application::set_print(int m) { reset_files(); add_file(LF_SOGGETTI); - // filtro per sezioni selezionati filtra_sezioni(); - // filtro per tipo idoneità _tipoidon = _msk->get(F_TIPO); if (_tipoidon.not_empty() && _tipoidon.ok()) current_cursor()->setfilter(format("STATO == \"%s\"",(const char*)_tipoidon)); else current_cursor()->setfilter("(TCS->S6 == \"I\") || (TCS->S6 == \"F\")", TRUE); - // filtro per categorie const TString16 catpri = _msk->get(F_CAT1); const TString16 catsec = _msk->get(F_CAT2); @@ -264,15 +257,12 @@ bool TIdonei_application::set_print(int m) _categorie.add((const char*) catqui); if (catses.not_empty() && catses.ok()) _categorie.add((const char*) catses); - // filtro per idoneita _idon1 = _msk->get(F_IDON1); _idon2 = _msk->get(F_IDON2); _idon3 = _msk->get(F_IDON3); _idon4 = _msk->get(F_IDON4); - current_cursor()->set_filterfunction(filter_func_idonei); - reset_print(); crea_intestazione(); return TRUE; @@ -281,10 +271,9 @@ bool TIdonei_application::set_print(int m) return FALSE; } -void TIdonei_application::crea_intestazione() +void TStampaIdonei::crea_intestazione() { reset_header(); - if (_tipo_stampa == elenco) { TString sep(132); @@ -324,18 +313,16 @@ void TIdonei_application::crea_intestazione() sep = ""; sep << "Pag. @#"; set_header(2, "@120g%s", (const char*) sep); - sep = ""; sep.fill('-'); set_header(3, (const char *) sep); - set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gData ID@60gTipi idon."); set_header(5,"@49gTipo/Esito"); set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g----------@60g-- -- -- --"); } } -bool TIdonei_application::user_create() +bool TStampaIdonei::user_create() { _rel = new TRelation(LF_SOGGETTI); _rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS); @@ -343,20 +330,14 @@ bool TIdonei_application::user_create() _rel->add(LF_COMUNI, "COM==DOM_CODCOM"); // per stampare la denominazione della sezione nell'intestazione _rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT"); - - _cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice - _cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome - _cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice - _cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome - + // ordinamento per sezione+sottogruppo+cognome+nome + _cur = add_cursor(new TCursor(_rel, "", 3)); _msk = new TMask("at2500a"); - _form_eti = new TEti_idonei_form("AT_ETSOG"); - return TRUE; } -bool TIdonei_application::user_destroy() +bool TStampaIdonei::user_destroy() { delete _msk; delete _rel; @@ -366,10 +347,7 @@ bool TIdonei_application::user_destroy() int at2500(int argc, char* argv[]) { - - TIdonei_application a; - + TStampaIdonei a; a.run(argc, argv, "Elenco idonei"); - return 0; } diff --git a/at/at2500a.uml b/at/at2500a.uml index e299d9637..b6ababc30 100755 --- a/at/at2500a.uml +++ b/at/at2500a.uml @@ -1,6 +1,6 @@ #include "at2500a.h" #include "lf.h" -PAGE "Definizione Stampe" -1 -1 78 20 +PAGE "Stampa soggetti idonei alla donazione" -1 -1 78 20 GROUPBOX DLG_NULL 77 4 BEGIN diff --git a/at/at2600.cpp b/at/at2600.cpp index c3c050d39..9a10f8540 100755 --- a/at/at2600.cpp +++ b/at/at2600.cpp @@ -29,15 +29,13 @@ public: virtual ~TEti_iscritti_form() {}; }; -class TIscritti_application : public TPrintapp +class TStampaIscritti : public TPrintapp { TRelation* _rel; TMask* _msk; TEti_iscritti_form* _form_eti; - TAssoc_array _categorie; - - int _cur1, _cur2, _cur3, _cur4; + int _cur; TParagraph_string _cognome_nome; TDate _data_stampa; ts _tipo_stampa; @@ -59,22 +57,21 @@ public: void filtra_sezioni(); void header_sezione(const TString16 codsez, const TString16 codsot); TMask& app_mask() { return *_msk; } - TIscritti_application() : _data_stampa(TODAY), _cognome_nome("",25) {} + TStampaIscritti() : _data_stampa(TODAY), _cognome_nome("",25) {} }; -HIDDEN inline TIscritti_application& app() { return (TIscritti_application&) main_app(); } +HIDDEN inline TStampaIscritti& app() { return (TStampaIscritti&) main_app(); } TCursor* TEti_iscritti_form::cursor() const { return app().current_cursor(); } TRelation* TEti_iscritti_form::relation() const { return cursor()->relation(); } -void TIscritti_application::filtra_sezioni() +void TStampaIscritti::filtra_sezioni() { const TString16 sezini = _msk->get(F_SEZINI); const TString16 sotini = _msk->get(F_SOTINI); const TString16 sezfin = _msk->get(F_SEZFIN); const TString16 sotfin = _msk->get(F_SOTFIN); - const select_cursor(_cur4); TRectype da(LF_SOGGETTI); TRectype a(LF_SOGGETTI); if (sezini.not_empty()) @@ -88,7 +85,7 @@ void TIscritti_application::filtra_sezioni() current_cursor()->setregion(da, a); } -void TIscritti_application::set_page(int file, int cnt) +void TStampaIscritti::set_page(int file, int cnt) { // costruzione etichette switch (_tipo_stampa) @@ -103,8 +100,9 @@ void TIscritti_application::set_page(int file, int cnt) TPrintrow& riga = corpo.row(i); set_row(i+1,riga); } - force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage - // altrimenti stampa sempre la stessa etichetta + // serve perchè alla prossima etichetta rifaccia la setpage + // altrimenti stampa sempre la stessa etichetta + force_setpage(TRUE); } break; case elenco: @@ -120,7 +118,7 @@ void TIscritti_application::set_page(int file, int cnt) } } -bool TIscritti_application::filter_func_iscritti(const TRelation * rel) +bool TStampaIscritti::filter_func_iscritti(const TRelation * rel) { bool filtrato = TRUE; TLocalisamfile& sog = rel->lfile(); @@ -131,7 +129,7 @@ bool TIscritti_application::filter_func_iscritti(const TRelation * rel) const TString16 cat = sog.get(SOG_CATDON); filtrato = categorie.is_key((const char*) cat); } - // filtrp per date iscrizione/dimissione + // filtro per date iscrizione/dimissione if (filtrato) { if (app()._tipo_iscdim == ISCRITTI) @@ -148,7 +146,7 @@ bool TIscritti_application::filter_func_iscritti(const TRelation * rel) return filtrato; } -bool TIscritti_application::preprocess_page(int file, int counter) +bool TStampaIscritti::preprocess_page(int file, int counter) { if (_tipo_stampa == elenco) { @@ -172,7 +170,7 @@ bool TIscritti_application::preprocess_page(int file, int counter) return TRUE; } -void TIscritti_application::header_sezione(const TString16 codsez, const TString16 codsot) +void TStampaIscritti::header_sezione(const TString16 codsez, const TString16 codsot) { const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ); const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT); @@ -193,7 +191,7 @@ void TIscritti_application::header_sezione(const TString16 codsez, const TString return; } -bool TIscritti_application::set_print(int m) +bool TStampaIscritti::set_print(int m) { _tipo_stampa = undefined; KEY tasto; @@ -238,9 +236,7 @@ bool TIscritti_application::set_print(int m) _tipo_iscdim = _msk->get(F_TIPO)[0]; _dataini = _msk->get(F_DATAINI); _datafin = _msk->get(F_DATAFIN); - current_cursor()->set_filterfunction(filter_func_iscritti); - reset_print(); crea_intestazione(); return TRUE; @@ -249,10 +245,9 @@ bool TIscritti_application::set_print(int m) return FALSE; } -void TIscritti_application::crea_intestazione() +void TStampaIscritti::crea_intestazione() { reset_header(); - if (_tipo_stampa == elenco) { TString sep(132); @@ -278,38 +273,29 @@ void TIscritti_application::crea_intestazione() sep = ""; sep << "Pag. @#"; set_header(2, "@120g%s", (const char*) sep); - sep = ""; sep.fill('-'); set_header(3, (const char *) sep); - set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gData isc.@60gData dim."); set_header(5,"@0g--------@9g--@12g-------------------------@38g----------@49g----------@60g----------"); } } -bool TIscritti_application::user_create() +bool TStampaIscritti::user_create() { _rel = new TRelation(LF_SOGGETTI); - //_rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS); _rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCP); _rel->add(LF_COMUNI, "COM==DOM_CODCOM"); // per stampare nell'intestazione la denominazione della sezione _rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT"); - - _cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice - _cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome - _cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice - _cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome - + // ordinamento per sezione+sottogruppo+cognome+nome + _cur = add_cursor(new TCursor(_rel, "", 3)); _msk = new TMask("at2600a"); - _form_eti = new TEti_iscritti_form("AT_ETSOG"); - return TRUE; } -bool TIscritti_application::user_destroy() +bool TStampaIscritti::user_destroy() { delete _msk; delete _rel; @@ -319,10 +305,7 @@ bool TIscritti_application::user_destroy() int at2600(int argc, char* argv[]) { - - TIscritti_application a; - + TStampaIscritti a; a.run(argc, argv, "Elenco iscritti/dimessi"); - return 0; } diff --git a/at/at2600a.uml b/at/at2600a.uml index 672a09b2e..c91a8ed50 100755 --- a/at/at2600a.uml +++ b/at/at2600a.uml @@ -1,6 +1,6 @@ #include "at2600a.h" #include "lf.h" -PAGE "Definizione Stampe" -1 -1 78 20 +PAGE "Stampa iscritti/dimessi" -1 -1 78 20 GROUPBOX DLG_NULL 77 4 BEGIN diff --git a/at/at2700.cpp b/at/at2700.cpp index 56230f019..5c56192fb 100755 --- a/at/at2700.cpp +++ b/at/at2700.cpp @@ -29,7 +29,7 @@ public: virtual ~TEti_percat_form() {}; }; -class TPercat_application : public TPrintapp +class TStampaPerCategorie : public TPrintapp { static bool filter_func_percat(const TRelation* rel); @@ -46,7 +46,7 @@ class TPercat_application : public TPrintapp TDate _data_stampa; ts _tipo_stampa; TString16 _codsez, _codsot; - + char _lettini, _lettfin; protected: virtual bool user_create(); @@ -61,16 +61,16 @@ public: void header_sezione(const TString16 codsez, const TString16 codsot); TMask& app_mask() { return *_msk; } - TPercat_application() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {} + TStampaPerCategorie() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {} }; -HIDDEN inline TPercat_application& app() { return (TPercat_application&) main_app(); } +HIDDEN inline TStampaPerCategorie& app() { return (TStampaPerCategorie&) main_app(); } TCursor* TEti_percat_form::cursor() const { return app().current_cursor(); } TRelation* TEti_percat_form::relation() const { return cursor()->relation(); } -void TPercat_application::filtra_sezioni() +void TStampaPerCategorie::filtra_sezioni() { const TString16 sezini = _msk->get(F_SEZINI); const TString16 sotini = _msk->get(F_SOTINI); @@ -89,7 +89,7 @@ void TPercat_application::filtra_sezioni() current_cursor()->setregion(da, a); } -void TPercat_application::set_page(int file, int cnt) +void TStampaPerCategorie::set_page(int file, int cnt) { switch (_tipo_stampa) { @@ -103,8 +103,9 @@ void TPercat_application::set_page(int file, int cnt) TPrintrow& riga = corpo.row(i); set_row(i+1,riga); } - force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage - // altrimenti stampa sempre la stessa etichetta + // serve perchè alla prossima etichetta rifaccia la setpage + // altrimenti stampa sempre la stessa etichetta + force_setpage(TRUE); } break; case elenco: @@ -123,11 +124,11 @@ void TPercat_application::set_page(int file, int cnt) } } -bool TPercat_application::filter_func_percat(const TRelation* rel) +bool TStampaPerCategorie::filter_func_percat(const TRelation* rel) { bool filtrato = FALSE; TLocalisamfile& sog = rel->lfile(); - // filtro per categorie + // filtro per categorie donatori TAssoc_array& categorie = app()._catdon; if (categorie.items() != 0) { @@ -145,12 +146,21 @@ bool TPercat_application::filter_func_percat(const TRelation* rel) filtrato = (categorie.is_key((const char*) cat1) || categorie.is_key((const char*) cat2)) ; } } + // se non ho selezionato categorie il soggetto va filtrato comunque if (app()._catdon.items() == 0 && app()._catnondon.items() == 0) filtrato = TRUE; + // filtro per iniziale cognome + if (filtrato && (app()._lettini != ' ') && (app()._lettfin != ' ')) + { + TString80 cognome = sog.get(SOG_COGNOME); + const char primalett = cognome[0]; + if (!(primalett >= app()._lettini && primalett <= app()._lettfin)) + filtrato = FALSE; + } return filtrato; } -void TPercat_application::header_sezione(const TString16 codsez, const TString16 codsot) +void TStampaPerCategorie::header_sezione(const TString16 codsez, const TString16 codsot) { const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ); const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT); @@ -171,7 +181,7 @@ void TPercat_application::header_sezione(const TString16 codsez, const TString16 return; } -bool TPercat_application::preprocess_page(int file, int counter) +bool TStampaPerCategorie::preprocess_page(int file, int counter) { if (_tipo_stampa == elenco) { @@ -211,7 +221,7 @@ bool TPercat_application::preprocess_page(int file, int counter) return TRUE; } -bool TPercat_application::set_print(int m) +bool TStampaPerCategorie::set_print(int m) { _tipo_stampa = undefined; KEY tasto; @@ -231,6 +241,11 @@ bool TPercat_application::set_print(int m) { TString80 chiave = ""; bool percap = _msk->get_bool(F_PERCAP); + TString16 lettera; + lettera = _msk->get(F_LETTINI); + _lettini = lettera[0]; + lettera = _msk->get(F_LETTFIN); + _lettfin = lettera[0]; if (percap) chiave = "13->CAPCOM|UPPER(90->COGNOME)|UPPER(90->NOME)"; else @@ -240,8 +255,6 @@ bool TPercat_application::set_print(int m) current_cursor()->setfilter((const char*) filtro, TRUE); reset_files(); add_file(LF_SOGGETTI); - //filtra_sezioni(); - const TString16 catpri = _msk->get(F_CAT1); const TString16 catsec = _msk->get(F_CAT2); const TString16 catter = _msk->get(F_CAT3); @@ -278,9 +291,7 @@ bool TPercat_application::set_print(int m) _catnondon.add((const char*) catnqui); if (catnses.not_empty() && catnses.ok()) _catnondon.add((const char*) catnses); - current_cursor()->set_filterfunction (filter_func_percat); - reset_print(); crea_intestazione(); return TRUE; @@ -289,10 +300,9 @@ bool TPercat_application::set_print(int m) return FALSE; } -void TPercat_application::crea_intestazione() +void TStampaPerCategorie::crea_intestazione() { reset_header(); - if (_tipo_stampa == elenco) { TString sep(132); @@ -304,36 +314,27 @@ void TPercat_application::crea_intestazione() sep = ""; sep << "Pag. @#"; set_header(2, "@120g%s", (const char*) sep); - sep = ""; sep.fill('-'); set_header(3, (const char *) sep); - set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gIndirizzo@100gTelefono abit.@116gTelefono lavoro"); set_header(5,"@49gCAP/Località/Comune/Prov.@116gTelefono altro"); set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g---------------"); } } -bool TPercat_application::user_create() +bool TStampaPerCategorie::user_create() { _rel = new TRelation(LF_SOGGETTI); _rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCP); _rel->add(LF_COMUNI, "COM==DOM_CODCOM"); - // per stampare nell'intestazione la denominazione della sezione _rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT"); - - //_cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice - //_cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome - //_cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice - //_cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome - _form_eti = new TEti_percat_form("AT_ETSOG"); _msk = new TMask("at2700a"); return TRUE; } -bool TPercat_application::user_destroy() +bool TStampaPerCategorie::user_destroy() { delete _msk; delete _rel; @@ -343,10 +344,7 @@ bool TPercat_application::user_destroy() int at2700(int argc, char* argv[]) { - - TPercat_application a; - + TStampaPerCategorie a; a.run(argc, argv, "Elenco per categorie"); - return 0; } diff --git a/at/at2700a.h b/at/at2700a.h index 178ed1342..3026e6c4d 100755 --- a/at/at2700a.h +++ b/at/at2700a.h @@ -37,6 +37,8 @@ #define F_D_CATN6 312 #define F_PERCAP 401 +#define F_LETTINI 402 +#define F_LETTFIN 403 #define F_ELENCO 501 #define F_ETICHETTE 502 diff --git a/at/at2700a.uml b/at/at2700a.uml index b4cf02758..3cb8e3a06 100755 --- a/at/at2700a.uml +++ b/at/at2700a.uml @@ -1,6 +1,6 @@ #include "at2700a.h" #include "lf.h" -PAGE "Definizione Stampe" -1 -1 78 20 +PAGE "Stampa soggetti per categorie" -1 -1 78 20 GROUPBOX DLG_NULL 77 4 BEGIN @@ -372,8 +372,24 @@ END BOOLEAN F_PERCAP BEGIN PROMPT 2 15 "Ordinamento per CAP" + MESSAGE TRUE DISABLE,1@ + MESSAGE FALSE ENABLE,1@ END +STRING F_LETTINI 1 +BEGIN + PROMPT 30 15 "Selezione iniziali cognome: da " + GROUP 1 + PICTURE "!" +END + +STRING F_LETTFIN 1 +BEGIN + PROMPT 63 15 "a " + GROUP 1 + //VALIDATE (#F_LETTINI<=#F_LETTFIN) + PICTURE "!" +END GROUPBOX DLG_NULL 77 4 BEGIN diff --git a/at/at3100.cpp b/at/at3100.cpp index c5e5915dc..1c8d0b770 100755 --- a/at/at3100.cpp +++ b/at/at3100.cpp @@ -44,6 +44,7 @@ HIDDEN inline TCarica_app& app() { return (TCarica_app&) main_app(); } bool TCarica_app::create() { + TApplication::create(); _msk = new TMask("at3100a"); _rel = new TRelation(LF_SOGGETTI); _trasfile = new TFile_text("sogg.txt","sogg.ini"); @@ -57,7 +58,7 @@ bool TCarica_app::destroy() delete _rel; delete _msk; delete _trasfile; - return TRUE; + return TApplication::destroy(); } bool TCarica_app::menu(MENU_TAG m) @@ -95,7 +96,9 @@ int TCarica_app::write() { pi->addstatus(1); if (_trasfile->read(rec) == NOERR) + { _trasfile->autosave(*_rel, rec); + } } delete pi; diff --git a/at/at4100.cpp b/at/at4100.cpp index b97a73cd7..2a27b29cf 100755 --- a/at/at4100.cpp +++ b/at/at4100.cpp @@ -33,15 +33,14 @@ public: virtual ~TScadenze_form() {}; }; -class TScadenze_application : public TPrintapp +class TStampaScadenze : public TPrintapp { TRelation* _rel; TMask* _msk; TScadenze_form* _form_eti; TScadenze_form* _form_car; TAssoc_array _categorie; - - int _cur1, _cur2, _cur3, _cur4; + int _cur; TParagraph_string _cognome_nome; TDate _data_stampa; TDate _dataini, _datafin, _dataultid; @@ -69,16 +68,16 @@ public: void header_sezione(const TString16 codsez, const TString16 codsot); void dati_sezione(const TString16 codsez, const TString16 codsot); TMask& app_mask() { return *_msk; } - TScadenze_application() : _data_stampa(TODAY), _cognome_nome("",25) {} + TStampaScadenze() : _data_stampa(TODAY), _cognome_nome("",25) {} }; -HIDDEN inline TScadenze_application& app() { return (TScadenze_application&) main_app(); } +HIDDEN inline TStampaScadenze& app() { return (TStampaScadenze&) main_app(); } TCursor* TScadenze_form::cursor() const { return app().current_cursor(); } TRelation* TScadenze_form::relation() const { return cursor()->relation(); } -ts TScadenze_application::dati_cartoline() +ts TStampaScadenze::dati_cartoline() { TMask msk("at4100b"); if (msk.run() == K_ENTER) @@ -99,13 +98,12 @@ ts TScadenze_application::dati_cartoline() return undefined; } -void TScadenze_application::filtra_sezioni() +void TStampaScadenze::filtra_sezioni() { const TString16 sezini = _msk->get(F_SEZINI); const TString16 sotini = _msk->get(F_SOTINI); const TString16 sezfin = _msk->get(F_SEZFIN); const TString16 sotfin = _msk->get(F_SOTFIN); - select_cursor(_cur4); TRectype da(LF_SOGGETTI); TRectype a(LF_SOGGETTI); if (sezini.not_empty()) @@ -119,7 +117,7 @@ void TScadenze_application::filtra_sezioni() current_cursor()->setregion(da, a); } -void TScadenze_application::set_page(int file, int cnt) +void TStampaScadenze::set_page(int file, int cnt) { // costruzione etichette switch (_tipo_stampa) @@ -133,8 +131,9 @@ void TScadenze_application::set_page(int file, int cnt) TPrintrow& riga = corpo.row(i); set_row(i+1,riga); } - force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage - // altrimenti stampa sempre la stessa etichetta + // serve perchè alla prossima etichetta rifaccia la setpage + // altrimenti stampa sempre la stessa etichetta + force_setpage(TRUE); } break; case cartoline: @@ -212,7 +211,7 @@ void TScadenze_application::set_page(int file, int cnt) } } -bool TScadenze_application::filter_func_scadenze(const TRelation* rel) +bool TStampaScadenze::filter_func_scadenze(const TRelation* rel) { bool filtrato = TRUE; TLocalisamfile& sog = rel->lfile(); @@ -281,7 +280,7 @@ bool TScadenze_application::filter_func_scadenze(const TRelation* rel) return filtrato; } -bool TScadenze_application::preprocess_page(int file, int counter) +bool TStampaScadenze::preprocess_page(int file, int counter) { switch (_tipo_stampa) { @@ -309,7 +308,7 @@ bool TScadenze_application::preprocess_page(int file, int counter) return TRUE; } -void TScadenze_application::header_sezione(const TString16 codsez, const TString16 codsot) +void TStampaScadenze::header_sezione(const TString16 codsez, const TString16 codsot) { const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ); const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT); @@ -330,7 +329,7 @@ void TScadenze_application::header_sezione(const TString16 codsez, const TString return; } -void TScadenze_application::dati_sezione(const TString16 codsez, const TString16 codsot) +void TStampaScadenze::dati_sezione(const TString16 codsez, const TString16 codsot) { _intest1 = current_cursor()->curr(LF_SEZIONI).get(SEZ_INTESTAZ1); _intest2 = current_cursor()->curr(LF_SEZIONI).get(SEZ_INTESTAZ2); @@ -353,7 +352,7 @@ void TScadenze_application::dati_sezione(const TString16 codsez, const TString16 return; } -bool TScadenze_application::set_print(int m) +bool TStampaScadenze::set_print(int m) { _tipo_stampa = undefined; KEY tasto; @@ -401,7 +400,7 @@ bool TScadenze_application::set_print(int m) _giorni[5] = 'X'; if (_msk->get_bool(F_GPD_DOM)) _giorni[6] = 'X'; - // filtro per sezioni selezionati + // filtro per sezioni selezionati filtra_sezioni(); // filtro per categorie const TString16 catpri = _msk->get(F_CAT1); @@ -437,10 +436,9 @@ bool TScadenze_application::set_print(int m) return FALSE; } -void TScadenze_application::crea_intestazione() +void TStampaScadenze::crea_intestazione() { reset_header(); - if (_tipo_stampa == elenco) { TString sep(132); @@ -466,18 +464,16 @@ void TScadenze_application::crea_intestazione() sep = ""; sep << "Pag. @#"; set_header(2, "@120g%s", (const char*) sep); - sep = ""; sep.fill('-'); set_header(3, (const char *) sep); - set_header(5,"@0gCod.@10gC.@13gCognome@39gNato il@50gData pr.SI@61gData pr.AF@72gData/Tipo@83gData/Tipo@94gIdon.@100gAB0"); set_header(6,"@13gNome@50gInterv. SI@61gInterv. AF@72gult. don.@83gult. idon.@94gper@100gRh"); set_header(7,"@0g---------@10g--@13g-------------------------@39g----------@50g----------@61g----------@72g----------@83g----------@94g-----"); } } -bool TScadenze_application::user_create() +bool TStampaScadenze::user_create() { _rel = new TRelation(LF_SOGGETTI); _rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS); @@ -485,21 +481,15 @@ bool TScadenze_application::user_create() _rel->add(LF_COMUNI, "COM==DOM_CODCOM"); // per stampare la denominazione della sezione nell'intestazione _rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT"); - - _cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice - _cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome - _cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice - _cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome - + //cursore ordinamento per sezione+sottogruppo+cognome+nome + _cur = add_cursor(new TCursor(_rel, "", 3)); _msk = new TMask("at4100a"); - _form_eti = new TScadenze_form("AT_ETSOG"); _form_car = new TScadenze_form("AT_ETCAR"); - return TRUE; } -bool TScadenze_application::user_destroy() +bool TStampaScadenze::user_destroy() { delete _msk; delete _rel; @@ -510,10 +500,7 @@ bool TScadenze_application::user_destroy() int at4100(int argc, char* argv[]) { - - TScadenze_application a; - + TStampaScadenze a; a.run(argc, argv, "Scadenze di donazione"); - return 0; } diff --git a/at/at4100a.uml b/at/at4100a.uml index c68add130..6a575b8c3 100755 --- a/at/at4100a.uml +++ b/at/at4100a.uml @@ -1,6 +1,6 @@ #include "at4100a.h" #include "lf.h" -PAGE "Definizione Stampe" -1 -1 78 20 +PAGE "Stampa scadenze di donazione" -1 -1 78 20 GROUPBOX DLG_NULL 77 4 BEGIN @@ -331,7 +331,7 @@ END GROUPBOX DLG_NULL 25 8 BEGIN - PROMPT 53 9 "Tipizzazione" + PROMPT 53 9 "Dati gruppo-ematici" END LISTBOX F_AB01 5 diff --git a/at/at4200.cpp b/at/at4200.cpp index e74b476df..64a5beb02 100755 --- a/at/at4200.cpp +++ b/at/at4200.cpp @@ -29,7 +29,7 @@ public: virtual ~TUrgenze_form() {}; }; -class TUrgenze_application : public TPrintapp +class TStampaUrgenze : public TPrintapp { static bool filter_func_urgenze(const TRelation* rel); @@ -39,16 +39,13 @@ class TUrgenze_application : public TPrintapp TRectype* _sangue; TAssoc_array _categorie; long _giorni; - - int _cur1, _cur2, _cur3, _cur4; + int _cur; TParagraph_string _cognome_nome, _dencom; - TDate _data_stampa; TDate _dataini, _datafin; ts _tipo_stampa; TString16 _codsez, _codsot; - protected: virtual bool user_create(); virtual bool user_destroy(); @@ -63,22 +60,21 @@ public: TMask& app_mask() { return *_msk; } TRectype& get_sangue() { return *_sangue; } - TUrgenze_application() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {} + TStampaUrgenze() : _data_stampa(TODAY), _cognome_nome("",25), _dencom("",50) {} }; -HIDDEN inline TUrgenze_application& app() { return (TUrgenze_application&) main_app(); } +HIDDEN inline TStampaUrgenze& app() { return (TStampaUrgenze&) main_app(); } TCursor* TUrgenze_form::cursor() const { return app().current_cursor(); } TRelation* TUrgenze_form::relation() const { return cursor()->relation(); } -void TUrgenze_application::filtra_sezioni() +void TStampaUrgenze::filtra_sezioni() { const TString16 sezini = _msk->get(F_SEZINI); const TString16 sotini = _msk->get(F_SOTINI); const TString16 sezfin = _msk->get(F_SEZFIN); const TString16 sotfin = _msk->get(F_SOTFIN); - select_cursor(_cur4); TRectype da(LF_SOGGETTI); TRectype a(LF_SOGGETTI); if (sezini.not_empty()) @@ -92,7 +88,7 @@ void TUrgenze_application::filtra_sezioni() current_cursor()->setregion(da, a); } -void TUrgenze_application::set_page(int file, int cnt) +void TStampaUrgenze::set_page(int file, int cnt) { switch (_tipo_stampa) { @@ -106,8 +102,9 @@ void TUrgenze_application::set_page(int file, int cnt) TPrintrow& riga = corpo.row(i); set_row(i+1,riga); } - force_setpage(TRUE); // serve perchè alla prossima etichetta rifaccia la setpage - // altrimenti stampa sempre la stessa etichetta + // serve perchè alla prossima etichetta rifaccia la setpage + // altrimenti stampa sempre la stessa etichetta + force_setpage(TRUE); } break; case elenco: @@ -127,7 +124,7 @@ void TUrgenze_application::set_page(int file, int cnt) } } -bool TUrgenze_application::filter_func_urgenze(const TRelation* rel) +bool TStampaUrgenze::filter_func_urgenze(const TRelation* rel) { bool filtrato = TRUE; TLocalisamfile& sog = rel->lfile(); @@ -157,7 +154,7 @@ bool TUrgenze_application::filter_func_urgenze(const TRelation* rel) return filtrato; } -bool TUrgenze_application::preprocess_page(int file, int counter) +bool TStampaUrgenze::preprocess_page(int file, int counter) { if (_tipo_stampa == elenco) { @@ -197,7 +194,7 @@ bool TUrgenze_application::preprocess_page(int file, int counter) return TRUE; } -void TUrgenze_application::header_sezione(const TString16 codsez, const TString16 codsot) +void TStampaUrgenze::header_sezione(const TString16 codsez, const TString16 codsot) { const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ); const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT); @@ -218,7 +215,7 @@ void TUrgenze_application::header_sezione(const TString16 codsez, const TString1 return; } -bool TUrgenze_application::set_print(int) +bool TStampaUrgenze::set_print(int) { _tipo_stampa = undefined; KEY tasto; @@ -288,10 +285,9 @@ bool TUrgenze_application::set_print(int) return FALSE; } -void TUrgenze_application::crea_intestazione() +void TStampaUrgenze::crea_intestazione() { reset_header(); - if (_tipo_stampa == elenco) { TString sep(132); @@ -303,18 +299,16 @@ void TUrgenze_application::crea_intestazione() sep = ""; sep << "Pag. @#"; set_header(2, "@120g%s", (const char*) sep); - sep = ""; sep.fill('-'); set_header(3, (const char *) sep); - set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gIndirizzo@100gTelefono abit.@116gTelefono lavoro"); set_header(5,"@49gCAP/Località/Comune/Prov.@116gTelefono altro"); set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g---------------"); } } -bool TUrgenze_application::user_create() +bool TStampaUrgenze::user_create() { _rel = new TRelation(LF_SOGGETTI); _rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS); @@ -322,19 +316,15 @@ bool TUrgenze_application::user_create() _rel->add(LF_COMUNI, "COM==DOM_CODCOM"); // per stampare nell'intestazione la denominazione della sezione _rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT"); - - _cur1 = add_cursor(new TCursor(_rel, "", 1)); //cursore ordinamento per codice - _cur2 = add_cursor(new TCursor(_rel, "", 2)); //cursore ordinamento per cognome e nome - _cur3 = add_cursor(new TCursor(_rel, "", 3)); //cursore ordinamento per sezione+sottogruppo+codice - _cur4 = add_cursor(new TCursor(_rel, "", 4)); //cursore ordinamento per sezione+sottogruppo+cognome e nome - + // ordinamento per sezione+sottogruppo+cognome+nome + _cur = add_cursor(new TCursor(_rel, "", 3)); _form_eti = new TUrgenze_form("AT_ETSOG"); _msk = new TMask("at4200a"); _sangue = new TRectype(LF_SOGGETTI); return TRUE; } -bool TUrgenze_application::user_destroy() +bool TStampaUrgenze::user_destroy() { delete _msk; delete _rel; @@ -345,10 +335,7 @@ bool TUrgenze_application::user_destroy() int at4200(int argc, char* argv[]) { - - TUrgenze_application a; - + TStampaUrgenze a; a.run(argc, argv, "Urgenze"); - return 0; } diff --git a/at/at4200a.uml b/at/at4200a.uml index 363142631..627b2edf8 100755 --- a/at/at4200a.uml +++ b/at/at4200a.uml @@ -1,6 +1,6 @@ #include "at4200a.h" #include "lf.h" -PAGE "Definizione Stampe" -1 -1 78 20 +PAGE "Stampa Urgenze" -1 -1 78 20 GROUPBOX DLG_NULL 77 4 BEGIN @@ -247,7 +247,7 @@ END GROUPBOX DLG_NULL 77 3 BEGIN - PROMPT 1 10 "Tipizzazione richiesta" + PROMPT 1 10 "Dati gruppo-ematici richiesti" END LISTBOX F_GRUPPOAB0 4 diff --git a/at/at4300.cpp b/at/at4300.cpp index dec9c7b84..19b6b9337 100755 --- a/at/at4300.cpp +++ b/at/at4300.cpp @@ -1,7 +1,7 @@ #include