diff --git a/at/at0100a.uml b/at/at0100a.uml index cf80bca12..af4079b22 100755 --- a/at/at0100a.uml +++ b/at/at0100a.uml @@ -1,6 +1,6 @@ #include "at0100a.h" -TOOLBAR "" 0 20 0 2 +TOOLBAR "" 0 -2 0 2 #include ENDPAGE @@ -83,9 +83,9 @@ BEGIN FIELD DATANASC KEY 2 MESSAGE COPY,4@ - CHECKTYPE REQUIRED - VALIDATE NOT_EMPTY_CHECK_FIELD - HELP "Data di nascita" + //CHECKTYPE REQUIRED + //VALIDATE NOT_EMPTY_CHECK_FIELD + //HELP "Data di nascita" END STRING F_TESSAVIS 6 diff --git a/at/at0100b.uml b/at/at0100b.uml index 1e41e7e36..8f60ba702 100755 --- a/at/at0100b.uml +++ b/at/at0100b.uml @@ -1,6 +1,6 @@ #include "at0100b.h" -TOOLBAR "" 0 20 0 2 +TOOLBAR "" 0 -2 0 2 BUTTON DLG_OK 10 2 diff --git a/at/at0100c.uml b/at/at0100c.uml index a36ee8e3d..f59ff9c09 100755 --- a/at/at0100c.uml +++ b/at/at0100c.uml @@ -1,6 +1,6 @@ #include "at0100c.h" -TOOLBAR "" 0 20 0 2 +TOOLBAR "" 0 -2 0 2 BUTTON DLG_OK 10 2 BEGIN @@ -160,7 +160,7 @@ BEGIN DISPLAY "C." CATDON DISPLAY "Tessera" TESSAVIS COPY OUTPUT F_F_CODICE - CHECKTYPE SEARCH + //CHECKTYPE SEARCH HELP "Cognome del soggetto" ADD RUN at0 -0 END @@ -170,7 +170,7 @@ BEGIN PROMPT 46 3 "" COPY ALL F_F_COGNOME COPY OUTPUT F_F_CODICE - CHECKTYPE SEARCH + //CHECKTYPE SEARCH HELP "Nome del soggetto" ADD RUN at0 -0 END diff --git a/at/at0200.cpp b/at/at0200.cpp index eaa429c82..cc825b518 100755 --- a/at/at0200.cpp +++ b/at/at0200.cpp @@ -122,6 +122,7 @@ bool TGiornalieroDC::create() ss.sheet_mask().set_handler(F_S_CODICE,codice_handler); ss.sheet_mask().set_handler(F_S_TIPODON,tipodon_handler); TConfig config(CONFIG_STUDIO); + _autoid = config.get_bool("AutoId"); _numdon1 = config.get_int("NumDon1"); _numdon2 = config.get_int("NumDon2"); _catini1 = config.get("CatIni1"); @@ -506,7 +507,7 @@ int TGiornalieroDC::write(TSheet_field& s) sog.put(SOG_DATAULTAF,datadonazione); } dataultdon = sog.get_date(SOG_DATAULTDON); // data ultima donazione - const TString16 tipoultdon(sog.get(SOG_TIPOULTDON)); // tipo ultima donazione + const TString16 tipoultdon = (sog.get(SOG_TIPOULTDON)); // tipo ultima donazione TDate datasi(NULLDATE); // data prossima si calcolata TDate dataaf(NULLDATE); // data prossima af calcolata TDate dataultsi(NULLDATE); // data ultima donazione si @@ -697,11 +698,12 @@ int TGiornalieroDC::write(TSheet_field& s) } 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 || dimissione)) + const bool tstampata = sog.get_bool(SOG_T_STAMPATA); + if ((catdon == _catini2 || _catini2.empty()) && (totdon+1>=_numdon2) && _catfin2.not_empty() && (!_sttess2 || tstampata)) sog.put(SOG_CATDON, _catfin2); } TDate dataisc = sog.get_date(SOG_DATAISC); - if (dataisc.ok() && _dataisc) + if (!dataisc.ok() && _dataisc) { if (sog.get_date(SOG_DATAPRISI).ok()) sog.put(SOG_DATAISC,sog.get(SOG_DATAPRISI)); diff --git a/at/at0400.cpp b/at/at0400.cpp index 683424340..6cd0bacff 100755 --- a/at/at0400.cpp +++ b/at/at0400.cpp @@ -50,7 +50,8 @@ class TGestioneConvocazioni: public TRelation_application TDate _dataini; bool _tutti, _ritarda; int _maxrit; - bool _inserimento; + bool _inserimento; + TBit_array _modified; protected: virtual bool user_create(); @@ -80,7 +81,7 @@ protected: static bool sezione_handler(TMask_field&f, KEY k); public: - virtual void print(); + virtual void print(); TGestioneConvocazioni() {} }; @@ -316,6 +317,7 @@ bool TGestioneConvocazioni::esegui_handler(TMask_field& f, KEY k) a.put(SOG_DATAPROSSI,data); cur->setregion(da, a); cur->set_filterfunction(filter_func_convoc, TRUE); + app()._modified.reset(); TSheet_field& s = (TSheet_field&)m.field(F_CONVOCATI); s.destroy(); TRectype& rec = cur->curr(); @@ -419,10 +421,11 @@ bool TGestioneConvocazioni::esegui_handler(TMask_field& f, KEY k) } if (!datasog.ok()) { - if (dataprossi < dataini) - datasog = dataini; - else - datasog = dataprossi; + //if (dataprossi < dataini) + // datasog = dataini; + //else + // datasog = dataprossi; + datasog = datarif; //aggiunto da Marco in data 24/09/99 per sostituire le azioni commentate in quanto non rispettava gli intervalli fra cartoline } } TToken_string& row = s.row(r); @@ -590,6 +593,8 @@ const char* TGestioneConvocazioni::get_next_key() bool TGestioneConvocazioni::remove() { + TWait_cursor hourglass; + // cancella convocati // cancella testata convocazione bool ok = TRUE; @@ -671,16 +676,18 @@ bool TGestioneConvocazioni::remove() { TLocalisamfile sez(LF_SEZIONI); sez.setkey(1); - sez.zero(); - sez.put(SEZ_CODSEZ, app()._codsez); - sez.put(SEZ_CODSOT, app()._codsot); + sez.zero(); + + TMask& m = curr_mask(); + sez.put(SEZ_CODSEZ, m.get(F_CODSEZ)); + sez.put(SEZ_CODSOT, m.get(F_CODSOT)); if (sez.read() == NOERR) { TLocalisamfile convoc(LF_CONVOC); convoc.setkey(3); - convoc.put(COV_CODSEZ, app()._codsez); - convoc.put(COV_CODSOT, app()._codsot); - convoc.put(COV_DATA, app()._data); + convoc.put(COV_CODSEZ, m.get(F_CODSEZ)); + convoc.put(COV_CODSOT, m.get(F_CODSOT)); + convoc.put(COV_DATA, m.get(F_DATA)); convoc.read(); --convoc; TDate dataini = convoc.get_date(COV_DATAINI); @@ -690,7 +697,7 @@ bool TGestioneConvocazioni::remove() --convoc; dataini = convoc.get_date(COV_DATAINI); } - if ((convoc.get(COV_CODSEZ) == app()._codsez) && (convoc.get(COV_CODSOT) == app()._codsot)) + if ((convoc.get(COV_CODSEZ) == m.get(F_CODSEZ)) && (convoc.get(COV_CODSOT) == m.get(F_CODSOT))) sez.put(SEZ_DATAULTCON, convoc.get_date(COV_DATA)); else sez.put(SEZ_DATAULTCON,NULLDATE); @@ -706,14 +713,15 @@ int TGestioneConvocazioni::read(TMask& m) { int err = TRelation_application::read(m); if (err == NOERR) - { - TRectype* key = new TRectype(LF_RCONVOC); + { + TRectype* key = new TRectype(LF_RCONVOC); key->put(RCV_NUMERO, m.get(F_NUMERO)); err = _sconvocati->read(key); if (err == NOERR) { TLocalisamfile soggetti(LF_SOGGETTI); TSheet_field& s = (TSheet_field&)m.field(F_CONVOCATI); + app()._modified.reset(); s.destroy(); for (int r=1; r<=_sconvocati->rows(); r++) { @@ -792,6 +800,7 @@ int TGestioneConvocazioni::scrivi(const TMask& m, bool ri) const long codice = row.get_long(0); const TDate dataconv = row.get(3); const char chiamata = row.get_char(4); + const bool annullato = (row.get(6)[0] == 'X'); rec.put(RCV_CODICE,codice); rec.put(RCV_DATACONV,dataconv); rec.put(RCV_CHIAMATA,chiamata); @@ -799,16 +808,127 @@ int TGestioneConvocazioni::scrivi(const TMask& m, bool ri) rec.put(RCV_ANNULLATO,row.get(6)); // aggiornamento archivio soggetti soggetti.put(SOG_CODICE,codice); + /* Messo il < invece del != nel primo if, spostato il controllo se sollecito + o meno all'interno del controllo sulla data da Marco in data 23/08/99 + */ if (soggetti.read() == NOERR) { - if (chiamata == 'S') - soggetti.put(SOG_DATAULTSOL,dataconv); - if (!(soggetti.get_date(SOG_DATACONV) == dataconv)) + if (soggetti.get_date(SOG_DATACONV) < dataconv) //Aggiungo 30/08/99 da qui { - soggetti.put(SOG_DATACONV,dataconv); - int numconv = soggetti.get_int(SOG_NUMCONV); - soggetti.put(SOG_NUMCONV,numconv+1); - } + if (!_modified[r-1] && (!annullato)) + { //Fino a qui + if (chiamata == 'S') + soggetti.put(SOG_DATAULTSOL,dataconv); + soggetti.put(SOG_DATACONV,dataconv); + int numconv = soggetti.get_int(SOG_NUMCONV); + soggetti.put(SOG_NUMCONV,numconv+1); + } //Aggiungo 30/08/99 da qui + else + { + if (_modified[r-1] && (!annullato)) + { + if (chiamata == 'S') + soggetti.put(SOG_DATAULTSOL,dataconv); + soggetti.put(SOG_DATACONV,dataconv); + } + else + { + if (_modified[r-1] && (annullato)) + { + const TDate dataprossi = soggetti.get_date(SOG_DATAPROSSI); + int numconv = soggetti.get_int(SOG_NUMCONV); + numconv--; + soggetti.put(SOG_NUMCONV,numconv); + TRectype da(LF_RCONVOC); + da.put(RCV_CODICE,codice); + TRectype a(LF_RCONVOC); + a.put(RCV_CODICE,codice); + TRelation rel(LF_RCONVOC); + TCursor cur(&rel,"",3,&da,&a); + const TRecnotype convocazioni = cur.items(); + for (TRecnotype pos = convocazioni-2; pos>=0; pos--) + { + cur = pos; + TRectype& rec = cur.curr(); + if (rec.get(RCV_ANNULLATO)[0] != 'X') + { + soggetti.put(SOG_DATACONV, rec.get(RCV_DATACONV)); + break; + } + } + if (pos < 0) + { + soggetti.put(SOG_NUMCONV, 0); + soggetti.put(SOG_DATACONV, NULLDATE); + soggetti.put(SOG_DATAULTSOL, NULLDATE); + } + else + { + if (numconv > 1) + soggetti.put(SOG_DATAULTSOL, rec.get(RCV_DATACONV)); + else + soggetti.put(SOG_DATAULTSOL, NULLDATE); + } + const TDate dataconvsog = soggetti.get_date(SOG_DATACONV); + if (dataconvsog < dataprossi) + { + soggetti.put(SOG_NUMCONV, 0); + soggetti.put(SOG_DATACONV, NULLDATE); + soggetti.put(SOG_DATAULTSOL, NULLDATE); + } + } + } + } + } + else + { + if ((annullato) && (dataconv == soggetti.get_date(SOG_DATACONV))) + { + const TDate dataprossi = soggetti.get_date(SOG_DATAPROSSI); + int numconv = soggetti.get_int(SOG_NUMCONV); + numconv--; + soggetti.put(SOG_NUMCONV,numconv); + TLocalisamfile rconvoc(LF_RCONVOC); + rconvoc.setkey(3); + rconvoc.put(RCV_CODICE,codice); + rconvoc.put(RCV_DATACONV,dataconv); + if (rconvoc.read() == NOERR) + { + bool ok = TRUE; + while (ok) + { + --rconvoc; + const long codprec = rconvoc.get_long(RCV_CODICE); + if (codprec == codice) + { + if (rconvoc.get(RCV_ANNULLATO)[0] != 'X') + { + ok = FALSE; + soggetti.put(SOG_DATACONV, rconvoc.get(RCV_DATACONV)); + } + } + else + { + ok = FALSE; + soggetti.put(SOG_NUMCONV, 0); + soggetti.put(SOG_DATACONV, NULLDATE); + soggetti.put(SOG_DATAULTSOL, NULLDATE); + } + } + if (numconv > 1) + soggetti.put(SOG_DATAULTSOL, rconvoc.get(RCV_DATACONV)); + else + soggetti.put(SOG_DATAULTSOL, NULLDATE); + } + const TDate dataconvsog = soggetti.get_date(SOG_DATACONV); + if (dataconvsog < dataprossi) + { + soggetti.put(SOG_NUMCONV, 0); + soggetti.put(SOG_DATACONV, NULLDATE); + soggetti.put(SOG_DATAULTSOL, NULLDATE); + } + } + } //Fino a qui soggetti.rewrite(); } } @@ -819,15 +939,57 @@ int TGestioneConvocazioni::scrivi(const TMask& m, bool ri) bool TGestioneConvocazioni::convocati_notify(TSheet_field& s, int r, KEY k) { + static TToken_string oldrow; bool result = TRUE; switch (k) - { - case K_CTRL+K_DEL: // avvenuta cancellazione riga + { + /* Tolto da Marco in data 26/08/99 in quanto si vuole impedire l'eliminazione di una singola riga + dello sheet dei convocati + case K_CTRL+K_DEL: // avvenuta cancellazione riga { int numconv = s.mask().get_int(F_NUMCONV); s.mask().set(F_NUMCONV,numconv-1); } - break; + break; + + Aggiunto da Marco in data 26/08/99 per impedire l'eliminazione di una singola riga dallo sheet + dei convocati + */ + case K_DEL: //richiesta cancellazione riga + { + message_box("Impossibile eliminare la convocazione di un singolo soggetto!/n Eventualmente annullarla."); + result = FALSE; + } + break; + // Aggiunto da Marco in data 26/08/99 per gestire la modifica di una singola convocazione + case K_SPACE: + { + oldrow = s.row(r); + TDate olddata = oldrow.get(s.cid2index(F_S_DATACONV)); // Le righe seguenti impostano un blocco per impedire di modificare una convocazione che non sia l'ultima per il soggetto + const long codice = oldrow.get_long(0); + TLocalisamfile soggetti(LF_SOGGETTI); + soggetti.put(SOG_CODICE,codice); + if (soggetti.read() == NOERR) + if (olddata != soggetti.get_date(SOG_DATACONV)) + { + message_box("Impossibile modificare una convocazione che non sia l'ultima per il soggetto in questione."); + result = FALSE; + s.row(r) = oldrow; + s.force_update(); + } + } + break; + case K_ENTER: + { + TToken_string& newrow = s.row(r); + TDate olddata = oldrow.get(s.cid2index(F_S_DATACONV)); + TDate newdata = newrow.get(s.cid2index(F_S_DATACONV)); + if (newdata != olddata) + { + app()._modified.set(r); + } + } + break; case K_CTRL+K_TAB: // uscita riga { @@ -859,7 +1021,7 @@ bool TGestioneConvocazioni::convocati_notify(TSheet_field& s, int r, KEY k) } break; case K_INS: - //result = FALSE; + result = FALSE; break; } return result; diff --git a/at/at0400a.uml b/at/at0400a.uml index 7f292d234..d55f8b841 100755 --- a/at/at0400a.uml +++ b/at/at0400a.uml @@ -370,7 +370,7 @@ ENDMASK PAGE "Soggetto " -1 -1 78 20 -GROUPBOX DLG_NULL 77 6 +GROUPBOX DLG_NULL 77 7 BEGIN PROMPT 1 0 "Dati identificativi soggetto" FLAGS "R" @@ -379,67 +379,69 @@ END NUMBER F_S_CODICE 8 BEGIN PROMPT 2 1 "Codice " - FLAGS "RG" - USE LF_SOGGETTI KEY 1 - INPUT CODICE F_S_CODICE - DISPLAY "Codice@8" CODICE - DISPLAY "Cognome@25" COGNOME - DISPLAY "Nome@25" NOME - DISPLAY "Nato il@10" DATANASC - DISPLAY "Sez." CODSEZ - DISPLAY "Sot." CODSOT - DISPLAY "C." CATDON - DISPLAY "Tessera" TESSAVIS - OUTPUT F_S_CODICE CODICE - OUTPUT F_S_COGNOME COGNOME - OUTPUT F_S_NOME NOME - OUTPUT F_S_DATANASC DATANASC - OUTPUT F_S_CATDON CATDON - OUTPUT F_S_TESSAVIS TESSAVIS - OUTPUT F_S_CODSEZ CODSEZ - OUTPUT F_S_CODSOT CODSOT + FLAGS "D" + //USE LF_SOGGETTI KEY 1 + //INPUT CODICE F_S_CODICE + //DISPLAY "Codice@8" CODICE + //DISPLAY "Cognome@25" COGNOME + //DISPLAY "Nome@25" NOME + //DISPLAY "Nato il@10" DATANASC + //DISPLAY "Sez." CODSEZ + //DISPLAY "Sot." CODSOT + //DISPLAY "C." CATDON + //DISPLAY "Tessera" TESSAVIS + //OUTPUT F_S_CODICE CODICE + //OUTPUT F_S_COGNOME COGNOME + //OUTPUT F_S_NOME NOME + //OUTPUT F_S_DATANASC DATANASC + //OUTPUT F_S_CATDON CATDON + //OUTPUT F_S_TESSAVIS TESSAVIS + //OUTPUT F_S_CODSEZ CODSEZ + //OUTPUT F_S_CODSOT CODSOT //CHECKTYPE NORMAL - ADD RUN at0 -0 + //ADD RUN at0 -0 END STRING F_S_COGNOME 25 BEGIN PROMPT 2 2 "Cognome e nome " - USE LF_SOGGETTI KEY 2 - INPUT COGNOME F_S_COGNOME - INPUT NOME F_S_NOME - DISPLAY "Cognome@25" COGNOME - DISPLAY "Nome@25" NOME - DISPLAY "Nato il@10" DATANASC - DISPLAY "Codice@8" CODICE - DISPLAY "Sez." CODSEZ - DISPLAY "Sot." CODSOT - DISPLAY "C." CATDON - DISPLAY "Tessera" TESSAVIS - COPY OUTPUT F_S_CODICE + FLAGS "D" + //USE LF_SOGGETTI KEY 2 + //INPUT COGNOME F_S_COGNOME + //INPUT NOME F_S_NOME + //DISPLAY "Cognome@25" COGNOME + //DISPLAY "Nome@25" NOME + //DISPLAY "Nato il@10" DATANASC + //DISPLAY "Codice@8" CODICE + //DISPLAY "Sez." CODSEZ + //DISPLAY "Sot." CODSOT + //DISPLAY "C." CATDON + //DISPLAY "Tessera" TESSAVIS + //COPY OUTPUT F_S_CODICE //CHECKTYPE SEARCH HELP "Cognome del soggetto" - ADD RUN at0 -0 + //ADD RUN at0 -0 END STRING F_S_NOME 25 BEGIN PROMPT 46 2 "" - USE LF_SOGGETTI KEY 2 - INPUT COGNOME F_S_COGNOME - INPUT NOME F_S_NOME - 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 - COPY OUTPUT F_S_CODICE + FLAGS "D" + //USE LF_SOGGETTI KEY 2 + //INPUT COGNOME F_S_COGNOME + //INPUT NOME F_S_NOME + //DISPLAY "Cognome@25" COGNOME + //DISPLAY "Nome@25" NOME + //DISPLAY "Nato il@10" DATANASC + //DISPLAY "Codice@8" CODICE + //DISPLAY "Sez." CODSEZ + //DISPLAY "Sot." CODSOT + //DISPLAY "C." CATDON + //DISPLAY "Tessera" TESSAVIS + //COPY OUTPUT F_S_CODICE HELP "Nome del soggetto" // CHECKTYPE NORMAL - ADD RUN at0 -0 + //ADD RUN at0 -0 END GROUPBOX DLG_NULL 77 5 @@ -456,7 +458,7 @@ END LISTBOX F_S_CHIAMATA 15 BEGIN PROMPT 30 8 "Tipo convocazione " - FLAGS "U" + FLAGS "UD" ITEM "C|Convocato" ITEM "S|Sollecitato" ITEM "R|Ritardatario" @@ -514,13 +516,13 @@ END DATE F_S_DATAULTDON BEGIN - PROMPT 2 5 "" + PROMPT 2 5 "Data ult. don." FLAGS "D" END DATE F_S_DATAPROSSI BEGIN - PROMPT 2 50 "" + PROMPT 35 5 "Data pross. don." FLAGS "D" END @@ -544,19 +546,19 @@ END BUTTON DLG_OK 9 2 BEGIN - PROMPT -13 -1 "" + PROMPT -12 -1 "" END BUTTON DLG_CANCEL 9 2 BEGIN - PROMPT -23 -1 "" + PROMPT -22 -1 "" END -BUTTON DLG_DELREC 9 2 -BEGIN - PROMPT -33 -1 "" - MESSAGE EXIT, K_DEL -END +//BUTTON DLG_DELREC 9 2 +//BEGIN +// PROMPT -33 -1 "" +// MESSAGE EXIT, K_DEL +//END ENDPAGE diff --git a/at/at0500.cpp b/at/at0500.cpp index 7b722c2e7..da647b1f9 100755 --- a/at/at0500.cpp +++ b/at/at0500.cpp @@ -23,6 +23,7 @@ class TSpostamentoConv : public TPrintapp TString16 _punto,_tipo, _sezione, _sottog; int _quanti; // numero di convocazioni per giorni int _spostati; // contatore dei soggetti spostati per giorno + int _nonspostati; // donatori di sezioni non selezianate che hanno la convocazione che corrisponde alle selezioni fatte int _contatore; TDate _data; // data a cui spostare bool _stampa; @@ -60,33 +61,45 @@ void TSpostamentoConv::set_page(int file, int cnt) print_action TSpostamentoConv::postprocess_print(int file, int counter) { - if (_contatore > 0) + //if (_contatore > 0) _msk->set(F_SPOSTATI,_contatore); + //if (_nonspostati > 0) + _msk->set(F_NONSPOSTATI,_nonspostati); return NEXT_PAGE; } bool TSpostamentoConv::preprocess_page(int file, int counter) -{ - TDate& data = app()._data; - app()._contatore++; - app()._spostati++; - if (app()._spostati > app()._quanti) +{ + TString16 sez = current_cursor()->file(LF_SOGGETTI).get(SOG_CODSEZ); + TString16 sot = current_cursor()->file(LF_SOGGETTI).get(SOG_CODSOT); + if ((sez == app()._sezione || app()._sezione.blank()) && (sot == app()._sottog || app()._sottog.blank())) { - ++data; - if (data > app()._spostaal) - data = app()._spostaal; - app()._spostati = 1; + TDate& data = app()._data; + app()._contatore++; + app()._spostati++; + if (app()._spostati > app()._quanti) + { + ++data; + if (data > app()._spostaal) + data = app()._spostaal; + app()._spostati = 1; + } + current_cursor()->curr().put(RCV_DATACONV,data); + current_cursor()->file().setkey(1); + const int err = current_cursor()->file().rewrite(); + current_cursor()->file().setkey(2); + current_cursor()->curr(LF_SOGGETTI).put(SOG_DATACONV,data); + TDate dataultsol = current_cursor()->curr(LF_SOGGETTI).get_date(SOG_DATAULTSOL); + if (dataultsol == data) + current_cursor()->curr(LF_SOGGETTI).put(SOG_DATAULTSOL,data); + current_cursor()->file(LF_SOGGETTI).rewrite(); + return app()._stampa; + } + else + { + app()._nonspostati++; + return FALSE; } - current_cursor()->curr().put(RCV_DATACONV,data); - current_cursor()->file().setkey(1); - const int err = current_cursor()->file().rewrite(); - current_cursor()->file().setkey(2); - current_cursor()->curr(LF_SOGGETTI).put(SOG_DATACONV,data); - TDate dataultsol = current_cursor()->curr(LF_SOGGETTI).get_date(SOG_DATAULTSOL); - if (dataultsol == data) - current_cursor()->curr(LF_SOGGETTI).put(SOG_DATAULTSOL,data); - current_cursor()->file(LF_SOGGETTI).rewrite(); - return app()._stampa; } bool TSpostamentoConv::set_print(int m) @@ -112,6 +125,7 @@ bool TSpostamentoConv::set_print(int m) _spostadal = _msk->get(F_SPOSTADAL); _spostaal = _msk->get(F_SPOSTAAL); _contatore = 0; + _nonspostati = 0; TString256 filtro = "(116->STAMPATO != \"X\")"; // filtro per punto di prelievo if (_punto.not_empty()) @@ -128,6 +142,7 @@ bool TSpostamentoConv::set_print(int m) filtro << format("(115->TIPO == \"%s\")",(const char*)_tipo); } // filtro per sezione/sottogruppo + /* if (_sezione.not_empty()) { if (filtro.not_empty()) @@ -140,6 +155,7 @@ bool TSpostamentoConv::set_print(int m) filtro << format("(90->CODSOT == \"%s\")",(const char*)_sottog); } } + */ // filtro per data TRectype da(LF_RCONVOC); TRectype a (LF_RCONVOC); @@ -154,7 +170,7 @@ bool TSpostamentoConv::set_print(int m) current_cursor()->setfilter((const char*) filtro, TRUE); current_cursor()->freeze(); const int giorni = (int)(_spostaal-_spostadal)+1; // giorni su cui suddividere la chiamata - _quanti = ((int)(current_cursor()->items())/giorni); // quanti donatori per giorno + _quanti = ((int)(current_cursor()->items())/giorni)+1; // quanti donatori per giorno if (_quanti < 1) _quanti = 1; _spostati = 0; diff --git a/at/at0500a.h b/at/at0500a.h index 4b6a0638b..d03e1e24a 100755 --- a/at/at0500a.h +++ b/at/at0500a.h @@ -14,5 +14,6 @@ #define F_SPOSTADAL 111 #define F_SPOSTAAL 112 #define F_SPOSTATI 113 +#define F_NONSPOSTATI 114 #define F_STAMPA 201 #define F_AZZERA 202 diff --git a/at/at0500a.uml b/at/at0500a.uml index a67674005..40a734d8a 100755 --- a/at/at0500a.uml +++ b/at/at0500a.uml @@ -37,11 +37,15 @@ END DATE F_DATAINI BEGIN PROMPT 2 2 "Data iniziale " + CHECKTYPE REQUIRED END DATE F_DATAFIN BEGIN PROMPT 2 3 "Data finale " + CHECKTYPE REQUIRED + VALIDATE DATE_CMP_FUNC >= F_DATAINI + WARNING "La data finale non puo' essere inferiore alla iniziale" END STRING F_PUNTO 4 @@ -149,11 +153,17 @@ END DATE F_SPOSTADAL BEGIN PROMPT 2 11 "Data iniziale " + CHECKTYPE REQUIRED + VALIDATE DATE_CMP_FUNC > F_DATAFIN + WARNING "Non e' possibile effettuare spostamenti a date inferiori" END DATE F_SPOSTAAL BEGIN PROMPT 2 12 "Data finale " + CHECKTYPE REQUIRED + VALIDATE DATE_CMP_FUNC >= F_SPOSTADAL + WARNING "La data finale dello spostamento non puo' essere inferiore all'iniziale" END NUMBER F_SPOSTATI 4 @@ -162,5 +172,21 @@ BEGIN FLAGS "D" END +NUMBER F_NONSPOSTATI 4 +BEGIN + PROMPT 50 12 "Non spostati " + FLAGS "D" +END + +TEXT DLG_NULL +BEGIN + PROMPT 2 14 "I soggetti non spostati sono quelli che hanno una convocazione corrispondente" +END + +TEXT DLG_NULL +BEGIN + PROMPT 2 15 "alle selezioni fatte, ma che non appartengono alla sezione/sottogruppo scelta " +END + ENDPAGE ENDMASK diff --git a/at/at0600.cpp b/at/at0600.cpp index 030b86143..3a45b71f6 100755 --- a/at/at0600.cpp +++ b/at/at0600.cpp @@ -178,7 +178,7 @@ void TChiusuraPeriodica::header_sezione(const TString16 codsez, const TString16 { 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(116); intestazione = "Sezione: "; intestazione << codsez; intestazione << "/"; @@ -201,9 +201,10 @@ void TChiusuraPeriodica::set_page(int file, int cnt) 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,"@65g@ld", FLD(LF_SOGGETTI,SOG_DATAULTDON)); - set_row(1,"@76g@n", FLD(LF_SOGGETTI,SOG_TOTDON)); - set_row(1,"@80g#a", &_operazione); + set_row(1,"@64g@ld", FLD(LF_SOGGETTI,SOG_DATAULTDON)); + set_row(1,"@75g@pn", FLD(LF_SOGGETTI,SOG_TOTDON, "###")); + set_row(1,"@79g@6,rs", FLD(LF_SOGGETTI,SOG_TESSAVIS)); + set_row(1,"@86g#a", &_operazione); } bool TChiusuraPeriodica::filter_func_chiusura(const TRelation* rel) @@ -268,7 +269,7 @@ bool TChiusuraPeriodica::set_print(int) void TChiusuraPeriodica::crea_intestazione() { reset_header(); - TString sep(132); + TString sep(116); sep = ""; if (_definitiva) sep << "CHIUSURA - DEFINITIVA - ALLA DATA "; @@ -281,10 +282,12 @@ void TChiusuraPeriodica::crea_intestazione() set_header(2,"@0g%10s", (const char*) data_stampa.string()); sep = ""; sep << "Pag. @#"; - set_header(2, "@120g%s", (const char*) sep); + set_header(2, "@100g%s", (const char*) sep); sep = ""; sep.fill('-'); - set_header(3, (const char *) sep); + set_header(3, (const char *) sep); + set_header(4,"@0gCodice@9gC.@12gCognome@38gNome@64gData u.d.@75gTot@79gTess.@86gOperazione"); + set_header(5,"@0g--------@9g--@12g-------------------------@38g-------------------------@64g----------@75g---@79g------@86g------------------------------"); } bool TChiusuraPeriodica::user_create() diff --git a/at/at0700.cpp b/at/at0700.cpp index d75891bbc..6502f4554 100755 --- a/at/at0700.cpp +++ b/at/at0700.cpp @@ -178,7 +178,26 @@ bool TSbloccoSospesi::preprocess_page(int file, int counter) operazione << datafineaf.string(); operazione << " "; operazione << "AF SO ID"; - } + } + TDate datarif = app()._data_sblocco; + datarif.set_year(datarif.year()-2); + TDate dataultdon = recsog.get_date(SOG_DATAULTDON); + if (dataultdon.ok()) + { + if (dataultdon < datarif) + operazione << " **"; + } + else + { + TDate dataultido = recsog.get_date(SOG_DATAULTID); + TString16 idon1 = recsog.get(SOG_IDON1); + TString16 idon2 = recsog.get(SOG_IDON2); + TString16 idon3 = recsog.get(SOG_IDON3); + TString16 idon4 = recsog.get(SOG_IDON4); + if (dataultido.ok() && is_idon(idon1, idon2, idon3, idon4, IDON_SI)) + if (dataultido < datarif) + operazione << " **"; + } _operazione = operazione; if (_definitiva) { @@ -209,8 +228,14 @@ bool TSbloccoSospesi::preprocess_page(int file, int counter) { TRectype* key = new TRectype(LF_IDONEITA); long codice = recsog.get_long(SOG_CODICE); - key->put(IDO_CODICE, codice); + key->put(IDO_CODICE, codice); int err = _sidoneita->read(key); + // Aggiunte le righe relative a key1 da Marco in data 20/12/99 + // per gestire le sospensioni parziali in quanto per tali soggetti non veniva mai passato, + // alla funzione CON_REORD, lo spreadsheet dei controlli sanitari ma solo quello delle idoneita'. + TRectype* key1 = new TRectype(LF_CONTSAN); + key1->put(CON_CODICE, codice); + err = _scontrolli->read(key1); if (statosi == "SO" && datafinesi.ok() && datafinesi <= app()._data_sblocco) { int progido = _sidoneita->rows()+1; @@ -295,9 +320,6 @@ void TSbloccoSospesi::set_page(int file, int cnt) set_row(1,"@49g@S", FLD(LF_SOGGETTI,SOG_TESSAVIS)); set_row(1,"@56g@S", FLD(LF_SOGGETTI,SOG_CODSEZ)); set_row(1,"@59g@S", FLD(LF_SOGGETTI,SOG_CODSOT)); - //set_row(1,"@57g@ld", FLD(LF_SOGGETTI,SOG_DATASTATO)); - //set_row(1,"@68g@ld", FLD(LF_SOGGETTI,SOG_DATA_PROS)); - //set_row(1,"@79g#a", &_operazione); set_row(1,"@62g#a", &_operazione); } @@ -428,8 +450,8 @@ void TSbloccoSospesi::crea_intestazione() sep = ""; sep.fill('-'); set_header(3, (const char *) sep); - set_header(4,"@0gCod.@9gC.@12gCognome e nome@38gNato il@49gTessera@57gSe/So@62gData sosp.@73gScadenza@84gDo Da A Sogg."); - set_header(5,"@0g------@9g--@12g-------------------------@38g----------@49g-------@57g-- --@62g----------@73g----------@84g---------------"); + set_header(4,"@0gCod.@9gC.@12gCognome e nome@38gNato il@49gTess.@56gSe/So@62gData sosp.@73gScadenza@84gDo Da A Sogg."); + set_header(5,"@0g------@9g--@12g-------------------------@38g----------@49g------@56g-- --@62g----------@73g----------@84g---------------"); printer().footerlen(3); } diff --git a/at/at0800.cpp b/at/at0800.cpp index fa41d17fc..35085da1a 100755 --- a/at/at0800.cpp +++ b/at/at0800.cpp @@ -92,7 +92,8 @@ void TSbloccoEsclusi::set_page(int file, int cnt) 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,"@64g@ld", FLD(LF_SOGGETTI,SOG_DATANASC)); + set_row(1,"@75g@6,rs", FLD(LF_SOGGETTI,SOG_TESSAVIS)); } bool TSbloccoEsclusi::filter_func_sbloccoesclusi(const TRelation* rel) @@ -106,7 +107,7 @@ void TSbloccoEsclusi::header_sezione(const TString16 codsez, const TString16 cod { const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ); const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT); - TString intestazione(132); + TString intestazione(80); intestazione = "Sezione: "; intestazione << codsez; intestazione << "/"; @@ -150,12 +151,11 @@ void TSbloccoEsclusi::crea_intestazione() { reset_header(); - TString sep(132); + TString sep(80); if (_definitiva) - sep = "SBLOCCO DEFINITIVO ESCLUSI "; + sep = "SBLOCCO DEFINITIVO ESCLUSI AL "; else - sep = "STAMPA PROVVISORIA PER SBLOCCO ESCLUSI "; - sep << " FINO ALLA DATA "; + sep = "STAMPA PROVVISORIA PER SBLOCCO ESCLUSI AL "; TString16 data_stampa = _data_sblocco.string(); sep << data_stampa; sep.center_just(); @@ -164,13 +164,13 @@ void TSbloccoEsclusi::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, "@70g%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@38gNome@64gNato il@75gTess."); + set_header(5,"@0g--------@9g--@12g-------------------------@38g-------------------------@64g----------@75g------"); } bool TSbloccoEsclusi::user_create() diff --git a/at/at1200.cpp b/at/at1200.cpp index 0b7d00aa9..1bc1ebf8b 100755 --- a/at/at1200.cpp +++ b/at/at1200.cpp @@ -43,12 +43,14 @@ class TAttribuzioneBenemerenze : public TPrintapp bool _definitiva; TParagraph_string _cognome_nome; int _contatore; + int _progope; protected: virtual bool user_create(); virtual bool user_destroy(); virtual bool set_print(int m); virtual void set_page(int file, int cnt); virtual bool preprocess_page(int file, int counter); + virtual void postclose_print(); public: void crea_intestazione(); @@ -58,6 +60,29 @@ public: HIDDEN inline TAttribuzioneBenemerenze& app() { return (TAttribuzioneBenemerenze&) main_app(); } +void TAttribuzioneBenemerenze::postclose_print() +{ + TLocalisamfile atropera(LF_ATROPERA); + atropera.setkey(1); + atropera.zero(); + atropera.put(ROP_PROGOPE, _progope); + TRectype r(atropera.curr()); + for (atropera.read(); !atropera.eof(); atropera.next()) + { + if (atropera.curr() != r) break; + atropera.remove(); + } + if (!_definitiva) + { + TLocalisamfile atopera(LF_ATOPERA); + atopera.setkey(1); + atopera.zero(); + atopera.put(OPE_PROGOPE, _progope); + if (atopera.read() == NOERR) + atopera.remove(); + } +} + bool TAttribuzioneBenemerenze::preprocess_page(int file, int counter) { if (file==LF_ATROPERA) @@ -210,10 +235,10 @@ bool TAttribuzioneBenemerenze::set_print(int) TLocalisamfile atopera(LF_ATOPERA); atopera.last(); - int progope = atopera.get_int(OPE_PROGOPE); - progope++; + _progope = atopera.get_int(OPE_PROGOPE); + _progope++; atopera.zero(); - atopera.put(OPE_PROGOPE, progope); + atopera.put(OPE_PROGOPE, _progope); atopera.put(OPE_CODSEZ,sezini); atopera.put(OPE_CODSOT,sotini); atopera.put(OPE_GRUPPOAZIE,_gruppoazie); @@ -222,11 +247,13 @@ bool TAttribuzioneBenemerenze::set_print(int) atopera.put(OPE_FLAG1,_anchegruppi); atopera.put(OPE_FLAG2,_attgruppi); atopera.put(OPE_UTENTE,user()); + atopera.put(OPE_TIPOOPE,'B'); atopera.write(); TLocalisamfile atropera(LF_ATROPERA); // cancelliamo l'elaborazione precedente - for (atropera.first(); !atropera.eof(); atropera.next()) - atropera.remove(); + // NO! non la cancelliamo piu' cosi' perche ci possono essere le righe di altre elaborazioni (es. tessere!) + //for (atropera.first(); !atropera.eof(); atropera.next()) + // atropera.remove(); TRectype& sog = _cur->curr(); long last = _cur->items(); _benem->setkey(3); @@ -304,7 +331,7 @@ bool TAttribuzioneBenemerenze::set_print(int) if (_benem->bad()) { atropera.zero(); - atropera.put(ROP_PROGOPE, progope); + atropera.put(ROP_PROGOPE, _progope); atropera.put(ROP_CODICE, codice); atropera.put(ROP_S0, tipoben); atropera.write(); @@ -319,10 +346,9 @@ bool TAttribuzioneBenemerenze::set_print(int) TRelation* relope = new TRelation(LF_ATROPERA); relope->add(LF_SOGGETTI, "CODICE==CODICE"); TString80 chiave = "131->S0|UPPER(90->COGNOME)|UPPER(90->NOME)"; + TString80 filtroope = format("131->PROGOPE==%d", _progope); int curope = add_cursor(new TSorted_cursor(relope, (const char*) chiave, "", 1)); - filtro = ""; - current_cursor()->setfilter((const char*) filtro, TRUE); - + current_cursor()->setfilter((const char*) filtroope, TRUE); add_file(LF_ATROPERA); add_file(LF_SOGGETTI,LF_ATROPERA); reset_print(); diff --git a/at/at1200a.h b/at/at1200a.h index d166e29d2..bc0eadce5 100755 --- a/at/at1200a.h +++ b/at/at1200a.h @@ -27,5 +27,12 @@ #define F_ANCHEGRUPPI 314 #define F_DEFINITIVA 315 -#define F_O_CODSEZ 401 -#define F_O_CODSOT 402 +#define F_RCODSEZ 401 +#define F_RCODSOT 402 +#define F_RDATAELA 403 +#define F_RDATAPRE 404 +#define F_RATTGRUPPI 405 +#define F_RGRUPPOAZIE 406 +#define F_D_RGRUPPOAZIE 407 +#define F_RANCHEGRUPPI 408 +#define F_RUTENTE 409 diff --git a/at/at1200a.uml b/at/at1200a.uml index 29af5f363..4bf5541f4 100755 --- a/at/at1200a.uml +++ b/at/at1200a.uml @@ -272,15 +272,15 @@ END ENDPAGE -PAGE "Ricerca" -1 -1 78 18 +PAGE "Visualizzazione attribuzioni fatte" -1 -1 78 18 -STRING F_O_CODSEZ 2 +STRING F_RCODSEZ 2 BEGIN PROMPT 2 1 "Sezione " FLAGS "U" - USE LF_ATOPERA KEY 2 - INPUT CODSEZ F_O_CODSEZ - INPUT CODSOT F_O_CODSOT + USE LF_ATOPERA KEY 2 SELECT TIPOOPE = 'B' + INPUT CODSEZ F_RCODSEZ + INPUT CODSOT F_RCODSOT DISPLAY "Cod.sez" CODSEZ DISPLAY "Cod.sot." CODSOT DISPLAY "Gr.az." GRUPPOAZIE @@ -288,15 +288,81 @@ BEGIN DISPLAY "Data pr.con.@10" DATA2 DISPLAY "Anche gruppi" FLAG1 DISPLAY "Utente" UTENTE - CHECKTYPE NORMAL + OUTPUT F_RCODSEZ CODSEZ + OUTPUT F_RCODSOT CODSOT + OUTPUT F_RDATAELA DATA1 + OUTPUT F_RDATAPRE DATA2 + OUTPUT F_RATTGRUPPI FLAG2 + OUTPUT F_RGRUPPOAZIE GRUPPOAZIE + OUTPUT F_RANCHEGRUPPI FLAG1 + OUTPUT F_RUTENTE UTENTE + CHECKTYPE SEARH END -STRING F_O_CODSOT 2 +STRING F_RCODSOT 2 BEGIN PROMPT 2 2 "Sottogruppo " - COPY ALL F_O_CODSEZ + COPY ALL F_RCODSEZ CHECKTYPE SEARCH - HELP "Codice sottogruppo da stampare" +END + +GROUPBOX DLG_NULL 77 8 +BEGIN + PROMPT 1 4 "Opzioni dell'attribuzione" +END + + +DATE F_RDATAELA +BEGIN + PROMPT 2 5 "Data elaborazione " + FLAGS "D" + HELP "Data di riferimento per l'attribuzione delle benemerenze" +END + +DATE F_RDATAPRE +BEGIN + PROMPT 2 6 "Data prevista consegna " + FLAGS "D" + HELP "Data di prevista consegna" +END + +BOOLEAN F_RATTGRUPPI +BEGIN + PROMPT 2 7 "Attribuzione fatta dai gruppi aziendali" + FLAGS "D" +END + +STRING F_RGRUPPOAZIE 4 +BEGIN + PROMPT 2 8 "Gruppo az. che attribuisce " + FLAGS "D" + USE GAZ + INPUT CODTAB F_RGRUPPOAZIE + DISPLAY "Codice" CODTAB + DISPLAY "Descrizione@30" S0 + OUTPUT F_RGRUPPOAZIE CODTAB + OUTPUT F_D_RGRUPPOAZIE S0 + CHECKTYPE NORMAL + WARNING "Codice gruppo aziendale non presente" + HELP "Gruppo aziendale di appartenenza" +END + +STRING F_D_RGRUPPOAZIE 30 +BEGIN + PROMPT 37 8 "" + FLAGS "D" +END + +BOOLEAN F_RANCHEGRUPPI +BEGIN + PROMPT 2 9 "Includi soggetti appartenenti a gruppi aziendali" + FLAGS "D" +END + +STRING F_RUTENTE 8 +BEGIN + PROMPT 2 10 "Utente che ha attribuito " + FLAGS "D" END diff --git a/at/at1400.cpp b/at/at1400.cpp index e7a05ab12..413365030 100755 --- a/at/at1400.cpp +++ b/at/at1400.cpp @@ -160,8 +160,12 @@ void TStampaBenxGAz::set_page(int file, int cnt) set_row(1,"@49g@S", FLD(LF_SOGGETTI,SOG_DOM_INDIR)); set_row(1,"@100g@S", FLD(LF_SOGGETTI,SOG_TELABI)); set_row(1,"@116g@S", FLD(LF_SOGGETTI,SOG_TELLAV)); + set_row(2,"@0g@S", FLD(LF_SOGGETTI,SOG_TESSAVIS)); set_row(2,"@49g#a", &_dencom); set_row(2,"@116g@S", FLD(LF_SOGGETTI,SOG_TELALT)); + set_row(3,"@100g@pn", FLD(LF_SOGGETTI,SOG_TOTDON,"###")); + set_row(4,""); + } break; case sintetico: @@ -342,9 +346,9 @@ void TStampaBenxGAz::crea_intestazione() sep.fill('-'); if (_tipostampa==completo) { - 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(3,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gIndirizzo@100gTelefono abit.@116gTelefono lavoro"); + set_header(4,"@0gTessera@49gCAP/Località/Comune/Prov.@116gTelefono altro"); + set_header(5,"@100gTot.don."); set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g---------------"); } printer().footerlen(3); diff --git a/at/at1500.cpp b/at/at1500.cpp index 92e5acdf9..f8cc20774 100755 --- a/at/at1500.cpp +++ b/at/at1500.cpp @@ -217,7 +217,7 @@ bool TControlloBenemerenze::preprocess_page(int file, int counter) nome << " "; nome << recsog.get(SOG_NOME); _cognome_nome = nome; - TString80 benemerenza = ""; + TString256 benemerenza = ""; const long codice = recsog.get_long(SOG_CODICE); TRectype* key = new TRectype(LF_BENEM); key->put(BEN_CODICE,codice); diff --git a/at/at2100.cpp b/at/at2100.cpp index 62ebec8b6..a95c4369d 100755 --- a/at/at2100.cpp +++ b/at/at2100.cpp @@ -43,7 +43,7 @@ class TStampaSospesi : public TPrintapp TDate _data_stampa; TDate _dataini, _datafin, _sodataini, _sodatafin; ts _tipostampa; - TString16 _codsez, _codsot, _motivo1, _motivo2, _motivo3, _motivo4, _motivo5; + TString16 _codsez, _codsot, _motivo1, _motivo2, _motivo3, _motivo4, _motivo5, _tiposo, _prosstipo; int _etlarghezza, _etcolonne; bool _motivi; @@ -356,14 +356,14 @@ bool TStampaSospesi::set_print(int m) _motivi = (_motivo1.not_empty() || _motivo2.not_empty() || _motivo3.not_empty() || _motivo4.not_empty() || _motivo5.not_empty()); TString filtro; // filtro per tipo sospensione - const TString16 tiposo = _msk->get(F_TIPO); - if (tiposo.not_empty()) - filtro << '(' << SOG_STATO << "== \"" << tiposo << "\")"; + _tiposo = _msk->get(F_TIPO); + if (_tiposo.not_empty()) + filtro << '(' << SOG_STATO << "== \"" << _tiposo << "\")"; else filtro << "((TCS->S6 == \"S\") || (TCS->S6 == \"B\"))"; - const TString16 prosstipo = _msk->get(F_PROSSTIPO); - if (prosstipo.not_empty()) - filtro << " && (" << SOG_PROS_STATO << "== \"" << prosstipo << "\")"; + _prosstipo = _msk->get(F_PROSSTIPO); + if (_prosstipo.not_empty()) + filtro << " && (" << SOG_PROS_STATO << "== \"" << _prosstipo << "\")"; current_cursor()->setfilter(filtro, TRUE); // filtro per categorie _categorie.destroy(); @@ -404,15 +404,16 @@ void TStampaSospesi::crea_intestazione() if (_tipostampa==sintetico || _tipostampa==completo) { TString sep(132); - sep = "SOGGETTI SOSPESI"; - const TString16 tipo = _msk->get(F_TIPO); - if (tipo.not_empty()) - { - sep << ": tipo "; - sep << tipo; - sep << ' '; - sep << _msk->get(F_D_TIPO); - } + if (_tipostampa==sintetico) + sep = "ELENCO SINTETICO SOSPESI "; + else + sep = "ELENCO COMPLETO SOSPESI "; + if (_tiposo.not_empty()) + sep << _tiposo; + if (_sodataini.ok()) + sep << " DAL " << _sodataini; + if (_sodatafin.ok()) + sep << " AL " << _sodatafin; if (_tipostampa==sintetico) sep.center_just(100); else @@ -426,25 +427,40 @@ void TStampaSospesi::crea_intestazione() set_header(2, "@90g%s", (const char*) sep); else set_header(2, "@120g%s", (const char*) sep); + if (_prosstipo.not_empty() || _dataini.ok() || _datafin.ok()) + { + sep = "CON PROSSIMO TIPO "; + if (_prosstipo.not_empty()) + sep << _prosstipo; + if (_dataini.ok()) + sep << " DAL " << _dataini; + if (_datafin.ok()) + sep << " AL " << _datafin; + if (_tipostampa==sintetico) + sep.center_just(100); + else + sep.center_just(); + set_header(3, "@0g%s", (const char*) sep); + } sep = ""; if (_tipostampa==sintetico) { sep.fill('-',100); - set_header(3, (const char *) sep); - set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gSospensione@63gUltima idon.@77gIntervalli@88gUltima donaz."); - set_header(5,"@0gTessera@38gGr.AB0 Rh@49gPr.tipo@78gSI AF"); - set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g-------------@63g-------------@77g----------@88g---------- --"); + set_header(4, (const char *) sep); + set_header(5,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gSospensione@63gUltima idon.@77gIntervalli@88gUltima donaz."); + set_header(6,"@0gTessera@38gGr.AB0 Rh@49gPr.tipo@78gSI AF"); + set_header(7,"@0g--------@9g--@12g-------------------------@38g----------@49g-------------@63g-------------@77g----------@88g---------- --"); } else { sep.fill('-'); - set_header(3, (const char *) sep); - set_header(4,"@0gCodice@9gCognome@35gIndirizzo@66gTel.abitazione@82gTipiz@94gSospensione@105gUltima id.@116gUlt.donaz."); - set_header(5,"@0gTessera@9gNome@66gTel.lavoro@82gzazione@94gData@105gTipo@116gTipo"); - set_header(6,"@0gCateg.@9gData nascita@66gTel.altro@94gPr.tipo"); - set_header(7,"@94gData pros.@109gInt.SI@118gTot.don."); - set_header(8,"@94gMotivo@109gInt.AF"); - set_header(9,"@0g--------@9g-------------------------@35g------------------------------@66g--------------@82g------------@94g----------@105g----------@116g----------"); + set_header(4, (const char *) sep); + set_header(5,"@0gCodice@9gCognome@35gIndirizzo@66gTel.abitazione@82gTipiz@94gSospensione@105gUltima id.@116gUlt.donaz."); + set_header(6,"@0gTessera@9gNome@66gTel.lavoro@82gzazione@94gData@105gTipo@116gTipo"); + set_header(7,"@0gCateg.@9gData nascita@66gTel.altro@94gPr.tipo"); + set_header(8,"@94gData pros.@109gInt.SI@118gTot.don."); + set_header(9,"@94gMotivo@109gInt.AF"); + set_header(10,"@0g--------@9g-------------------------@35g------------------------------@66g--------------@82g------------@94g----------@105g----------@116g----------"); } } } diff --git a/at/at2200.cpp b/at/at2200.cpp index 7fccbc3f5..8a0c80546 100755 --- a/at/at2200.cpp +++ b/at/at2200.cpp @@ -140,6 +140,7 @@ void TStampaPerEta::set_page(int file, int cnt) else { set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########")); + set_row(2,"@0g@8,rs", FLD(LF_SOGGETTI,SOG_TESSAVIS)); set_row(1,"@9g@S", FLD(LF_SOGGETTI,SOG_CATDON)); set_row(1,"@12g#a", &_cognome_nome); set_row(1,"@38g@ld", FLD(LF_SOGGETTI,SOG_DATANASC)); @@ -349,7 +350,7 @@ void TStampaPerEta::crea_intestazione() { _cognome_nome.set_width(25); 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(5,"@0gTessera@49gCAP/Località/Comune/Prov.@116gTelefono altro"); set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g---------------"); } } diff --git a/at/at2300.cpp b/at/at2300.cpp index 3ed38fcd5..6202ef655 100755 --- a/at/at2300.cpp +++ b/at/at2300.cpp @@ -108,12 +108,13 @@ void TStampaEsclusi::set_page(int file, int cnt) case elenco: { set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########")); - set_row(1,"@9g@S", FLD(LF_SOGGETTI,SOG_CATDON)); - set_row(1,"@12g#a", &_cognome_nome); - set_row(1,"@38g@ld", FLD(LF_SOGGETTI,SOG_DATANASC)); - set_row(1,"@49g@S", FLD(LF_SOGGETTI,SOG_ESCLUSO)); - set_row(1,"@52g@ld", FLD(LF_SOGGETTI,SOG_TERMESCL)); - set_row(1,"@63g@S", FLD(LF_SOGGETTI,SOG_MOTESCL)); + set_row(1,"@9g@6,rs", FLD(LF_SOGGETTI,SOG_TESSAVIS)); + set_row(1,"@16g@S", FLD(LF_SOGGETTI,SOG_CATDON)); + set_row(1,"@19g#a", &_cognome_nome); + set_row(1,"@45g@ld", FLD(LF_SOGGETTI,SOG_DATANASC)); + set_row(1,"@56g@S", FLD(LF_SOGGETTI,SOG_ESCLUSO)); + set_row(1,"@59g@ld", FLD(LF_SOGGETTI,SOG_TERMESCL)); + set_row(1,"@70g@S", FLD(LF_SOGGETTI,SOG_MOTESCL)); } break; } @@ -176,7 +177,7 @@ void TStampaEsclusi::header_sezione(const TString16 codsez, const TString16 cods { 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 << "/"; @@ -260,7 +261,7 @@ void TStampaEsclusi::crea_intestazione() reset_header(); if (_tipostampa == elenco) { - TString sep(90); + TString sep(100); sep = "ELENCO ESCLUSI"; if ((_tipoesc.ok()) && (_tipoesc.not_empty())) { diff --git a/at/at2400.cpp b/at/at2400.cpp index 41973eb96..350b4547e 100755 --- a/at/at2400.cpp +++ b/at/at2400.cpp @@ -53,9 +53,9 @@ class TStampaModificati : public TPrintapp TModificati_form* _form_sch; TAssoc_array _categorie; TParagraph_string _cognome_nome, _dencom; - TDate _data_stampa, _dataini; + TDate _data_stampa, _dataini, _datafin; ts _tipostampa; - TString16 _codsez, _codsot; + TString16 _codsez, _codsot, _utente; TString80 _eledon; TString80 _eleben1,_eleben2; int _lenpage, _schxpag; @@ -127,6 +127,7 @@ void TStampaModificati::set_page(int file, int cnt) case elenco: { set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########")); + set_row(2,"@0g@8,rs", FLD(LF_SOGGETTI,SOG_TESSAVIS)); set_row(1,"@9g@S", FLD(LF_SOGGETTI,SOG_CATDON)); set_row(1,"@12g#a", &_cognome_nome); set_row(1,"@38g@ld", FLD(LF_SOGGETTI,SOG_DATANASC)); @@ -155,9 +156,20 @@ bool TStampaModificati::filter_func_modificati(const TRelation* rel) // filtro per data aggiornamento if (filtrato && app()._dataini.ok()) { - const TDate datamod = sog.get(SOG_DATAULTAGG); - filtrato = (datamod >= app()._dataini); + const TDate dataultagg = sog.get(SOG_DATAULTAGG); + filtrato = (dataultagg >= app()._dataini); } + if (filtrato && app()._datafin.ok()) + { + const TDate dataultagg = sog.get(SOG_DATAULTAGG); + filtrato = (dataultagg <= app()._datafin); + } + if (filtrato && app()._utente.not_empty()) + { + const TString16 utenultagg = sog.get(SOG_UTENULTAGG); + filtrato = (utenultagg == app()._utente); + } + return filtrato; } @@ -264,7 +276,9 @@ bool TStampaModificati::set_print(int) { reset_files(); add_file(LF_SOGGETTI); - _dataini = _msk->get(F_DATAINI); + _dataini = _msk->get_date(F_DATAINI); + _datafin = _msk->get_date(F_DATAFIN); + _utente = _msk->get(F_UTENTE); filtra_sezioni(); // filtro per categorie _categorie.destroy(); @@ -302,12 +316,22 @@ void TStampaModificati::crea_intestazione() { TString sep(132); sep = "ELENCO MODIFICATI"; - const TDate data = _msk->get(F_DATAINI); - if (data.ok()) + if (_dataini.ok()) { - sep << " dal "; - sep << data.string(); + sep << " DAL "; + sep << _dataini.string(); } + if (_datafin.ok()) + { + sep << " AL "; + sep << _datafin.string(); + } + if (_utente.not_empty()) + { + sep << " UTENTE "; + sep << _utente; + } + sep.center_just(); set_header(2, "@0g%s", (const char*) sep); TString16 data_stampa = _data_stampa.string(); @@ -319,7 +343,7 @@ void TStampaModificati::crea_intestazione() 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(5,"@0gTessera@49gCAP/Località/Comune/Prov.@116gTelefono altro"); set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g---------------"); } } diff --git a/at/at2400a.h b/at/at2400a.h index 545f7099f..0677a225a 100755 --- a/at/at2400a.h +++ b/at/at2400a.h @@ -24,7 +24,8 @@ #define F_D_CAT6 212 #define F_DATAINI 301 -//#define F_DATAFIN 302 +#define F_DATAFIN 302 +#define F_UTENTE 303 #define F_ELENCO 401 #define F_SCHEDE 402 diff --git a/at/at2400a.uml b/at/at2400a.uml index e0ec94300..f038f9614 100755 --- a/at/at2400a.uml +++ b/at/at2400a.uml @@ -276,10 +276,23 @@ BEGIN HELP "Data iniziale" END -//DATE F_DATAFIN -//BEGIN -// PROMPT 20 11 "Al " -// HELP "Data di nascita finale" -//END +DATE F_DATAFIN +BEGIN + PROMPT 38 11 "al " + HELP "Data finale" +END + +STRING F_UTENTE 8 +BEGIN + PROMPT 54 11 "dall'utente " + FLAGS "U" + USE LF_USER + INPUT USERNAME F_UTENTE + DISPLAY "Utente@8" USERNAME + DISPLAY "Descrizione@50" USERDESC + OUTPUT F_UTENTE USERNAME + CHECKTYPE SEARCH +END + ENDPAGE ENDMASK diff --git a/at/at2600.cpp b/at/at2600.cpp index 21a4fcac2..3c444a170 100755 --- a/at/at2600.cpp +++ b/at/at2600.cpp @@ -128,6 +128,7 @@ void TStampaIscritti::set_page(int file, int cnt) set_row(1,"@38g@ld", FLD(LF_SOGGETTI,SOG_DATANASC)); set_row(1,"@49g@ld", FLD(LF_SOGGETTI,SOG_DATAISC)); set_row(1,"@60g@ld", FLD(LF_SOGGETTI,SOG_DATADIM)); + set_row(1,"@71g@8,rs", FLD(LF_SOGGETTI,SOG_TESSAVIS)); } break; } @@ -218,7 +219,7 @@ void TStampaIscritti::header_sezione(const TString16 codsez, const TString16 cod { const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ); const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT); - TString intestazione(132); + TString intestazione(80); intestazione = "Sezione: "; intestazione << codsez; intestazione << "/"; @@ -301,20 +302,20 @@ void TStampaIscritti::crea_intestazione() reset_header(); if (_tipostampa == elenco) { - TString sep(132); - sep = "ELENCO "; + TString sep(80); + sep = ""; if (_tipo_iscdim == ISCRITTI) sep << "ISCRITTI"; else sep << "DIMESSI"; if (_dataini.ok()) { - sep << " dal "; + sep << " DAL "; sep << _dataini.string(); } if (_datafin.ok()) { - sep << " al "; + sep << " AL "; sep << _datafin.string(); } sep.center_just(); @@ -323,12 +324,12 @@ void TStampaIscritti::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, "@70g%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----------"); + set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gData isc.@60gData dim.@71gTessera"); + set_header(5,"@0g--------@9g--@12g-------------------------@38g----------@49g----------@60g----------@71g-------"); printer().footerlen(3); } } diff --git a/at/at2700.cpp b/at/at2700.cpp index 2de361052..399d7337a 100755 --- a/at/at2700.cpp +++ b/at/at2700.cpp @@ -1,6 +1,7 @@ #include #include -#include +#include +#include #include #include #include @@ -36,7 +37,7 @@ #define ETI_COGNOME 3 // numero campo cognome e nome in etichetta (deve essere sempre cosi') per famiglie -enum ts { undefined=0, sintetico=1, completo=2, schede=3, etichette=4, cartoline=5, personale=6, notiziario=7 }; +enum ts { undefined=0, sintetico=1, completo=2, schede=3, etichette=4, cartoline=5, personale=6, notiziario=7, stampasufile=8 }; // definizione form per etichette class TEti_percat_form : public TForm @@ -63,6 +64,7 @@ class TStampaPerCategorie : public TPrintapp TLocalisamfile* _benem; TLocalisamfile* _donaz; TLocalisamfile* _famiglie; + TExternisamfile* _file; TRecord_array* _sbenemerenze; TRecord_array* _sfamiglia; TEti_percat_form* _form_eti; @@ -567,8 +569,8 @@ bool TStampaPerCategorie::filter_func_percat(const TRelation* rel) TAssoc_array& categorie = app()._catdon; if (categorie.items() != 0) { - const TString16 cat = sog.get(SOG_CATDON); - filtrato = categorie.is_key((const char*) cat); + const TString& cat = sog.get(SOG_CATDON); + filtrato = categorie.is_key(cat); } if (!filtrato) { @@ -823,6 +825,28 @@ bool TStampaPerCategorie::preprocess_page(int file, int counter) cognome << recsog.get(SOG_NOME); _cognome_nome = cognome; } + if (_tipostampa==stampasufile) + { + _file->zero(); + _file->put("CODICE",recsog.get(SOG_CODICE)); + _file->put("COGNOME",recsog.get(SOG_COGNOME)); + _file->put("NOME",recsog.get(SOG_NOME)); + _file->put("SPOSATA",recsog.get(SOG_COGNOME_SP)); + _file->put("INDIRIZZO",recsog.get(SOG_DOM_INDIR)); + _file->put("PRESSO",recsog.get(SOG_DOM_DISTRI)); + TString80 localita = ""; + localita << recsog.get(SOG_DOM_CAP); + localita << ' '; + if (recsog.get(SOG_DOM_CODLOC).not_empty()) + localita << current_cursor()->curr(-ALIAS_LCPDOM).get("S0"); + else + localita << current_cursor()->curr(LF_COMUNI).get(COM_DENCOM); + localita << ' ' << current_cursor()->curr(LF_COMUNI).get(COM_PROVCOM); + localita.trim(); + _file->put("LOCALITA",localita); + _file->write(); + do_events(); + } if (_tipostampa!=etichette && _tipostampa!=notiziario) _contatore++; return TRUE; @@ -862,6 +886,13 @@ bool TStampaPerCategorie::set_print(int m) case F_CARTOLINE: _tipostampa=cartoline; break; + case F_FILE: + { + _tipostampa=stampasufile; + //operazione aggiunta da Marco il 04/11/99 per svuotare il contenuto del file prima di riempirlo nuovamente + _file->zap(); + } + break; } if (_tipostampa != undefined) { @@ -920,7 +951,7 @@ bool TStampaPerCategorie::set_print(int m) filtro << " && "; filtro << format("(90->DOM_CAP <= \"%s\")",(const char*)_capfin); } - if (_tipostampa==notiziario) + if ((_tipostampa==notiziario) || _msk->get_bool(F_NOTIZIARIO)) { if (filtro.not_empty()) filtro << " && "; @@ -941,7 +972,7 @@ bool TStampaPerCategorie::set_print(int m) if (sotfin.not_empty()) a.put(SOG_CODSOT, sotfin); current_cursor()->setregion(da, a); - current_cursor()->setfilter(filtro, TRUE); + current_cursor()->setfilter(filtro, FALSE); ((TSorted_cursor*)current_cursor())->change_order(chiave); reset_files(); add_file(LF_SOGGETTI); @@ -989,7 +1020,7 @@ bool TStampaPerCategorie::set_print(int m) _catnondon.add((const char*) catnqui); if (catnses.not_empty()) _catnondon.add((const char*) catnses); - current_cursor()->set_filterfunction (filter_func_percat, TRUE); + current_cursor()->set_filterfunction (filter_func_percat, FALSE); reset_print(); printer().footerlen(0); crea_intestazione(); @@ -1117,7 +1148,7 @@ bool TStampaPerCategorie::user_create() _sfamiglia = new TRecord_array(LF_FAMIGLIE,FAM_PROGFAM); add_cursor(new TSorted_cursor(_rel,"SOG_CODSEZ|SOG_CODSOT","",3)); _msk = new TMask("at2700a"); - + _file = new TExternisamfile("$file"); TConfig config(CONFIG_STUDIO); TString16 etformato = config.get("EtFormato"); _etlarghezza = config.get_int("EtLarghezza"); @@ -1146,6 +1177,7 @@ bool TStampaPerCategorie::user_destroy() delete _form_car; delete _form_eti; delete _msk; + delete _file; delete _sfamiglia; delete _sbenemerenze; delete _famiglie; diff --git a/at/at2700a.h b/at/at2700a.h index bd831e36f..a8c82956c 100755 --- a/at/at2700a.h +++ b/at/at2700a.h @@ -57,4 +57,5 @@ #define F_SCHEDE 504 #define F_ETICHETTE 505 #define F_CARTOLINE 506 +#define F_FILE 507 diff --git a/at/at2700a.uml b/at/at2700a.uml index be9007eaf..bbeaac3ab 100755 --- a/at/at2700a.uml +++ b/at/at2700a.uml @@ -1,47 +1,53 @@ #include "at2700a.h" -TOOLBAR "" 0 20 0 2 +TOOLBAR "" 0 -3 0 3 BUTTON F_SINTETICO 9 2 BEGIN - PROMPT -17 -11 "~Sintetico" + PROMPT -18 -11 "~Sintetico" MESSAGE EXIT,F_SINTETICO END BUTTON F_COMPLETO 9 2 BEGIN - PROMPT -27 -11 "~Completo" + PROMPT -28 -11 "~Completo" MESSAGE EXIT,F_COMPLETO END BUTTON F_PERSONALE 9 2 BEGIN - PROMPT -37 -11 "~Personale" + PROMPT -38 -11 "~Personale" MESSAGE EXIT,F_PERSONALE END BUTTON F_SCHEDE 9 2 BEGIN - PROMPT -47 -11 "Sc~hede" + PROMPT -48 -11 "Sc~hede" MESSAGE EXIT,F_SCHEDE END BUTTON F_ETICHETTE 9 2 BEGIN - PROMPT -57 -11 "~Etichette" + PROMPT -58 -11 "~Etichette" MESSAGE EXIT,F_ETICHETTE END BUTTON F_CARTOLINE 9 2 BEGIN - PROMPT -67 -11 "C~artoline" + PROMPT -68 -11 "C~artoline" MESSAGE EXIT,F_CARTOLINE END +BUTTON F_FILE 9 2 +BEGIN + PROMPT -78 -11 "~File" + MESSAGE EXIT,F_FILE +END + BUTTON DLG_QUIT 9 2 BEGIN - PROMPT -77 -11 "" + PROMPT -88 -11 "" END ENDPAGE diff --git a/at/at2800.cpp b/at/at2800.cpp index bfc36f734..51a80a010 100755 --- a/at/at2800.cpp +++ b/at/at2800.cpp @@ -11,7 +11,8 @@ #include "atlib.h" #define ALIAS_LCP 100 -#define ALIAS_TCS 200 +#define ALIAS_TCS 200 +#define ALIAS_TCS1 300 enum ts { undefined = 0, elenco = 1, etichette = 2 }; @@ -41,7 +42,7 @@ class TStampaNonDon : public TPrintapp int _contatore; TParagraph_string _cognome_nome, _dencom; TDate _data_stampa; - TDate _data; + TDate _data,_data2; ts _tipostampa; TString16 _codsez, _codsot; int _etlarghezza, _etcolonne; @@ -137,27 +138,40 @@ void TStampaNonDon::set_page(int file, int cnt) set_row(1,"@74g@pn", FLD(LF_SOGGETTI,SOG_TOTDON,"###")); set_row(2,"@60g@S", FLD(LF_SOGGETTI,SOG_STATO)); set_row(2,"@63g@ld", FLD(LF_SOGGETTI,SOG_DATASTATO)); - set_row(2,"@74g@S", FLD(LF_SOGGETTI,SOG_GRUPPOAB0)); - set_row(3,"@60g@S", FLD(LF_SOGGETTI,SOG_PROS_STATO)); + set_row(2,"@74g@S", FLD(LF_SOGGETTI,SOG_GRUPPOAB0)); + set_row(3,"@71g@S", FLD(LF_SOGGETTI,SOG_PROS_STATO)); set_row(3,"@63g@ld", FLD(LF_SOGGETTI,SOG_DATA_PROS)); set_row(3,"@74g@S", FLD(LF_SOGGETTI,SOG_RHANTID)); - set_row(4,"@9g@S", FLD(LF_SOGGETTI,SOG_DOM_INDIR)); - set_row(4,"@40g#a", &_dencom); - set_row(5,""); + set_row(4,"@66g@S", FLD(LF_SOGGETTI,SOG_STATOSI)); + set_row(4,"@71g@S", FLD(LF_SOGGETTI,SOG_STATOAF)); + set_row(5,"@9g@S", FLD(LF_SOGGETTI,SOG_DOM_INDIR)); + set_row(5,"@40g#a", &_dencom); + set_row(6,""); } else { set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########")); - set_row(1,"@9g@S", FLD(LF_SOGGETTI,SOG_CATDON)); - set_row(1,"@12g#a", &_cognome_nome); - set_row(1,"@38g@ld", FLD(LF_SOGGETTI,SOG_DATANASC)); - set_row(1,"@49g@S", FLD(LF_SOGGETTI,SOG_DOM_INDIR)); - set_row(1,"@100g@S", FLD(LF_SOGGETTI,SOG_TELABI)); - set_row(1,"@116g@S", FLD(LF_SOGGETTI,SOG_TELLAV)); - set_row(1,"@132g@ld", FLD(LF_SOGGETTI,SOG_DATAULTDON)); - set_row(2,"@49g#a", &_dencom); - set_row(2,"@116g@S", FLD(LF_SOGGETTI,SOG_TELALT)); - set_row(2,"@132g@S", FLD(LF_SOGGETTI,SOG_TIPOULTDON)); + set_row(2,"@0g@8,rs", FLD(LF_SOGGETTI,SOG_TESSAVIS)); + set_row(3,"@0g@S", FLD(LF_SOGGETTI,SOG_CATDON)); + set_row(1,"@9g#a", &_cognome_nome); + set_row(1,"@35g@ld", FLD(LF_SOGGETTI,SOG_DATANASC)); + set_row(1,"@46g@S", FLD(LF_SOGGETTI,SOG_DOM_INDIR)); + set_row(2,"@46g#a", &_dencom); + set_row(1,"@97g@S", FLD(LF_SOGGETTI,SOG_TELABI)); + set_row(2,"@97g@S", FLD(LF_SOGGETTI,SOG_TELLAV)); + set_row(3,"@97g@S", FLD(LF_SOGGETTI,SOG_TELALT)); + set_row(1,"@113g@ld", FLD(LF_SOGGETTI,SOG_DATAULTDON)); + set_row(1,"@124g@S", FLD(LF_SOGGETTI,SOG_TIPOULTDON)); + set_row(2,"@113g@ld", FLD(LF_SOGGETTI,SOG_DATASTATO)); + set_row(2,"@124g@S", FLD(LF_SOGGETTI,SOG_STATO)); + set_row(3,"@113g@ld", FLD(LF_SOGGETTI,SOG_DATA_PROS)); + set_row(3,"@124g@S", FLD(LF_SOGGETTI,SOG_PROS_STATO)); + set_row(1,"@127g@pn", FLD(LF_SOGGETTI,SOG_TOTDON,"###")); + set_row(2,"@129g@S", FLD(LF_SOGGETTI,SOG_GRUPPOAB0)); + set_row(3,"@129g@S", FLD(LF_SOGGETTI,SOG_RHANTID)); + set_row(4,"@119g@S", FLD(LF_SOGGETTI,SOG_STATOSI)); + set_row(4,"@124g@S", FLD(LF_SOGGETTI,SOG_STATOAF)); + set_row(5,""); } } break; @@ -179,8 +193,12 @@ bool TStampaNonDon::filter_func_nondon(const TRelation* rel) if (filtrato) { const TDate dataultdon = sog.get(SOG_DATAULTDON); - if (dataultdon.ok()) + if (dataultdon.ok()) + { filtrato = (dataultdon <= app()._data); + if (filtrato && app()._data2.ok()) + filtrato = (dataultdon >= app()._data2); + } else filtrato = FALSE; } @@ -256,7 +274,10 @@ bool TStampaNonDon::preprocess_page(int file, int counter) _contatore = 0; header_sezione(codsez, codsot); } + if (printer().rows_left() < 4) + printer().formfeed(); } + if (_tipostampa==etichette) if (printer().rows_left() < _form_eti->get_body().height()) printer().formfeed(); @@ -298,11 +319,12 @@ bool TStampaNonDon::set_print(int m) add_file(LF_SOGGETTI); filtra_sezioni(); _data = _msk->get(F_DATA); + _data2 = _msk->get(F_DATA2); bool sospesi = _msk->get_bool(F_SOSPESI); if (sospesi) current_cursor()->setfilter(""); - else - current_cursor()->setfilter("(TCS->S6 == \"I\") || (TCS->S6 == \"F\")", TRUE); + else + current_cursor()->setfilter("((TCS->S6 == \"I\") || (TCS->S6 == \"F\"))", TRUE); _categorie.destroy(); const TString16 catpri = _msk->get(F_CAT1); const TString16 catsec = _msk->get(F_CAT2); @@ -338,9 +360,11 @@ void TStampaNonDon::crea_intestazione() { printer().footerlen(5); TString sep(132); - sep = "ELENCO SOGGETTI CHE NON DONANO DAL "; - if (app()._data.ok()) + sep = "SOGGETTI CHE NON DONANO DAL "; + if (_data.ok()) sep << _data.string(); + if (_data2.ok()) + sep << " MA CON ULT.DON. NON PRECEDENTE AL " << _data2.string(); if (_stampa80) sep.center_just(80); else @@ -358,17 +382,20 @@ void TStampaNonDon::crea_intestazione() if (_stampa80) { set_header(4,"@0gCodice@9gCognome e nome@44gTelefono abit.@60gUltima donaz.@74gN.don."); - set_header(5,"@0gTessera@44gTelefono lavoro@60gStato attale@74gGr.AB0"); - set_header(6,"@0gCateg.@9gNato il@44gTelefono altro@60gStato pross.@74gRh"); - set_header(7,"@0g--------@9g----------------------------------@44g--------------@60g-- ----------@74g-----"); + set_header(5,"@0gTessera@44gTelefono lavoro@60gStato attuale@74gGr.AB0"); + set_header(6,"@0gCateg.@9gNato il@44gTelefono altro@60gStato pross.@74gRh"); + set_header(7,"@60gStato SI - Aferesi"); + set_header(8,"@0g--------@9g----------------------------------@44g--------------@60g-- ----------@74g-----"); _cognome_nome.set_width(35); _dencom.set_width(40); } else { - set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gIndirizzo@100gTelefono abit.@116gTelefono lavoro@132gData u.d."); - set_header(5,"@49gCAP/Località/Comune/Prov.@116gTelefono altro@132gTipo u.d."); - set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g---------------@132g----------"); + set_header(4,"@0gCodice@9gCognome e nome@35gNato il@46gIndirizzo@97gTelefono abit.@113gUlt.don.@127gTotD"); + set_header(5,"@0gTessera@46gCAP/Località/Comune/Prov.@97gTelefono lavoro@113gStato attuale@129gGr."); + set_header(6,"@0gCat.@97gTelefono altro@113gStato pross.@129gRh"); + set_header(7,"@113gStato SI - Aferesi"); + set_header(8,"@0g--------@9g-------------------------@35g----------@46g--------------------------------------------------@97g---------------@113g---------- --@127g---"); _cognome_nome.set_width(25); _dencom.set_width(50); } @@ -379,6 +406,7 @@ bool TStampaNonDon::user_create() { _rel = new TRelation(LF_SOGGETTI); _rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS); + _rel->add("TCS", "CODTAB==STATOSI",1,0,ALIAS_TCS1); _rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCP); _rel->add(LF_COMUNI, "COM==DOM_CODCOM"); _rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT"); diff --git a/at/at2800a.h b/at/at2800a.h index c5229d0dc..f1ed0f002 100755 --- a/at/at2800a.h +++ b/at/at2800a.h @@ -24,7 +24,8 @@ #define F_D_CAT6 212 #define F_DATA 301 -#define F_SOSPESI 302 +#define F_DATA2 302 +#define F_SOSPESI 303 #define F_ELENCO 401 #define F_ETICHETTE 402 diff --git a/at/at2800a.uml b/at/at2800a.uml index dcb86e68a..475252f85 100755 --- a/at/at2800a.uml +++ b/at/at2800a.uml @@ -264,7 +264,7 @@ BEGIN FLAGS "D" END -GROUPBOX DLG_NULL 77 3 +GROUPBOX DLG_NULL 77 4 BEGIN PROMPT 1 10 "Opzioni di elaborazione" END @@ -275,9 +275,15 @@ BEGIN HELP "Data massima in cui il soggetto pu• aver fatto l'ultima donazione" END +DATE F_DATA2 +BEGIN + PROMPT 42 11 "ult.don. non prima del " + HELP "Data minima in cui il soggetto pu• aver fatto l'ultima donazione" +END + BOOLEAN F_SOSPESI BEGIN - PROMPT 42 11 "Anche sospesi" + PROMPT 2 12 "Anche sospesi" END ENDPAGE diff --git a/at/at2900.cpp b/at/at2900.cpp index 3968caefa..19a0ca1e1 100755 --- a/at/at2900.cpp +++ b/at/at2900.cpp @@ -146,16 +146,17 @@ void TFrequenza::set_page(int file, int cnt) else { set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########")); + set_row(2,"@0g@8,rs", FLD(LF_SOGGETTI,SOG_TESSAVIS)); set_row(1,"@9g@S", FLD(LF_SOGGETTI,SOG_CATDON)); set_row(1,"@12g#a", &_cognome_nome); set_row(1,"@38g@ld", FLD(LF_SOGGETTI,SOG_DATANASC)); set_row(1,"@49g@S", FLD(LF_SOGGETTI,SOG_DOM_INDIR)); - set_row(1,"@100g@S", FLD(LF_SOGGETTI,SOG_TELABI)); - set_row(1,"@116g@S", FLD(LF_SOGGETTI,SOG_TELLAV)); set_row(2,"@49g#a", &_dencom); - set_row(2,"@116g@S", FLD(LF_SOGGETTI,SOG_TELALT)); - set_row(1,"@132g#a", &_numdonsog); - set_row(2,"@132g#a", &_dataultdon); + set_row(1,"@100g@S", FLD(LF_SOGGETTI,SOG_TELABI)); + set_row(2,"@100g@S", FLD(LF_SOGGETTI,SOG_TELLAV)); + set_row(3,"@100g@S", FLD(LF_SOGGETTI,SOG_TELALT)); + set_row(1,"@116g#a", &_numdonsog); + set_row(2,"@116g#a", &_dataultdon); } } break; @@ -306,6 +307,8 @@ bool TFrequenza::preprocess_page(int file, int counter) _codsot = codsot; header_sezione(codsez, codsot); } + if (printer().rows_left() < 4) + printer().formfeed(); } if (_tipostampa==etichette) if (printer().rows_left() < _form_eti->get_body().height()) @@ -417,12 +420,12 @@ void TFrequenza::crea_intestazione() } sep << _numdon; sep << " DONAZIONI"; + if (_tipodon.not_empty()) + sep << ' ' << _tipodon; if (_dataini.ok()) sep << " DAL " << _dataini.string(); if (_datafin.ok()) - sep << "AL " << _datafin.string(); - if (_tipodon.not_empty()) - sep << " DI TIPO " << _tipodon; + sep << " AL " << _datafin.string(); if (_stampa80) sep.center_just(80); else @@ -447,9 +450,10 @@ void TFrequenza::crea_intestazione() } else { - set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gIndirizzo@100gTelefono abit.@116gTelefono lavoro@132gNum.don."); - set_header(5,"@49gCAP/Località/Comune/Prov.@116gTelefono altro@132gUlt.don."); - set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g---------------@132g----------"); + set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gIndirizzo@100gTelefono abit.@116gNum.don."); + set_header(5,"@0gTessera@49gCAP/Località/Comune/Prov.@100gTelefono lavoro@116gUlt.don."); + set_header(6,"@100gTelefono altro"); + set_header(7,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g----------"); _cognome_nome.set_width(25); } printer().footerlen(3); diff --git a/at/at3.url b/at/at3.url index d4391b1e8..495bd6bbd 100755 --- a/at/at3.url +++ b/at/at3.url @@ -1,6 +1,6 @@ #define APPNAME AVIS #define QAPPNAME "AVIS" -#define LIBDIR f:\xvt.403\win_x86\ptk\lib +#define LIBDIR d:\xvt.458\w16_x86\lib #define QFIRMNAME "AGA Informatica S.r.l." #include diff --git a/at/at3200.cpp b/at/at3200.cpp index 394765e76..0c9b750c2 100755 --- a/at/at3200.cpp +++ b/at/at3200.cpp @@ -598,11 +598,11 @@ bool TMensileDonxGr::riepilogo() if (_tipodon.not_empty()) { if (filtro.empty()) - filtro = format("(92->TIPODON <= \"%s\")",(const char*)_tipodon); + filtro = format("(92->TIPODON == \"%s\")",(const char*)_tipodon); else { filtro << " && "; - filtro << format("(92->TIPODON <= \"%s\")",(const char*)_tipodon); + filtro << format("(92->TIPODON == \"%s\")",(const char*)_tipodon); } } _cur->setfilter((const char*) filtro, TRUE); diff --git a/at/at3300.cpp b/at/at3300.cpp index 5df87a0b5..984bc47c2 100755 --- a/at/at3300.cpp +++ b/at/at3300.cpp @@ -248,8 +248,8 @@ bool TStatSogxCat::stampa() actsez = curstat->curr().get(ATSS_CODSEZ); actsot = curstat->curr().get(ATSS_CODSOT); catdon = curstat->curr().get(ATSS_CATDON); - numero = (double)curstat->curr().get_int(ATSS_NUMERO); - numero2 = (double)curstat->curr().get_int(ATSS_NUMERO2); + numero = (double)curstat->curr().get_long(ATSS_NUMERO); + numero2 = (double)curstat->curr().get_long(ATSS_NUMERO2); if (actsez != oldsez || actsot != oldsot) { if (oldsez != "**" && oldsot != "**") @@ -365,14 +365,15 @@ void TStatSogxCat::stampa_sezione(TString16 codsez, TString16 codsot) real& colonnan = (real&)_colonne->find(indicen); rigatotali.aggiorna_valore((int) colonnan.integer(),riga[(int) colonnan.integer()]); valore = ""; - valore.format("%8d",riga[(int) colonnan.integer()].integer()); + valore.format("%8ld",riga[(int) colonnan.integer()].integer()); rigastampa.overwrite((const char*)valore, pos); pos = pos+8; const char* indicet = "T"; real& colonnat = (real&)_colonne->find(indicet); rigatotali.aggiorna_valore((int) colonnat.integer(),riga[(int) colonnat.integer()]); valore = ""; - valore.format("%8d",riga[(int) colonnat.integer()].integer()); +// valore.format("%8ld",riga[(int) colonnat.integer()].integer()); + valore = riga[(int) colonnat.integer()].string("####.###"); rigastampa.overwrite((const char*)valore, pos); pos = pos+8; row.put((const char*) rigastampa); @@ -392,13 +393,13 @@ void TStatSogxCat::stampa_sezione(TString16 codsez, TString16 codsot) const char* indicen = "N"; real& colonnan = (real&)_colonne->find(indicen); valore = ""; - valore.format("%8d",rigatotali[(int) colonnan.integer()].integer()); + valore.format("%8ld",rigatotali[(int) colonnan.integer()].integer()); rigastampa.overwrite((const char*)valore, pos); pos = pos+8; const char* indicet = "T"; real& colonnat = (real&)_colonne->find(indicet); valore = ""; - valore.format("%8d",rigatotali[(int) colonnat.integer()].integer()); + valore.format("%8ld",rigatotali[(int) colonnat.integer()].integer()); rigastampa.overwrite((const char*)valore, pos); pos = pos+8; row.put((const char*) rigastampa); diff --git a/at/at3500.cpp b/at/at3500.cpp index d9cbfa921..cb27647d4 100755 --- a/at/at3500.cpp +++ b/at/at3500.cpp @@ -293,6 +293,11 @@ bool TRiepilogoGiornaliero::stampa() } TRigaG& riga = (TRigaG&)_righe[data2row(data)]; real& colonna = (real&)_colonne->find((const char*)tipodon); +// real colonna; +// real * valore = (real *) _colonne->objptr((const char*)tipodon); +// if (valore != NULL) +// colonna = *valore; + real n = numero; riga.aggiorna_valore((int) colonna.integer(),n); if (_primedon) diff --git a/at/at4.cpp b/at/at4.cpp index 5e1587315..062efd721 100755 --- a/at/at4.cpp +++ b/at/at4.cpp @@ -1,5 +1,4 @@ #include -#include #include #include "at4.h" diff --git a/at/at4100.cpp b/at/at4100.cpp index 0d61ddc06..55927a893 100755 --- a/at/at4100.cpp +++ b/at/at4100.cpp @@ -307,6 +307,7 @@ void TStampaScadenze::set_page(int file, int cnt) set_row(1,"@105g@S", FLD(LF_SOGGETTI,SOG_TELABI)); set_row(1,"@120g#a", &_giopredon); + set_row(2,"@0g@8,rs", FLD(LF_SOGGETTI,SOG_TESSAVIS)); set_row(2,"@13g@S", FLD(LF_SOGGETTI,SOG_NOME)); set_row(2,"@53g@pn", FLD(LF_SOGGETTI,SOG_INTSI,"###")); set_row(2,"@64g@pn", FLD(LF_SOGGETTI,SOG_INTAF,"###")); @@ -323,6 +324,8 @@ void TStampaScadenze::set_page(int file, int cnt) case completo: { set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"#########")); + set_row(2,"@0g@8,rs", FLD(LF_SOGGETTI,SOG_TESSAVIS)); + set_row(1,"@10g#a", &_cognome_nome); set_row(3,"@10g@ld", FLD(LF_SOGGETTI,SOG_DATANASC)); @@ -745,15 +748,15 @@ void TStampaScadenze::crea_intestazione() set_header(3, (const char *) sep); if (_tipostampa == elenco) { - set_header(5,"@0gCod.@10gC.@13gCognome@39gNato il@50gData pr.SI@61gData pr.AF@72gData/Tipo@83gData/Tipo@94gIdon.@100gAB0@105gTel. abitaz.@120gGio.pre."); - set_header(6,"@13gNome@50gInterv. SI@61gInterv. AF@72gult. don.@83gult. idon.@94gper@100gRh@105gTel. lavoro"); + set_header(5,"@0gCodice@10gC.@13gCognome@39gNato il@50gData pr.SI@61gData pr.AF@72gData/Tipo@83gData/Tipo@94gIdon.@100gAB0@105gTel. abitaz.@120gGio.pre."); + set_header(6,"@0gTessera@13gNome@50gInterv. SI@61gInterv. AF@72gult. don.@83gult. idon.@94gper@100gRh@105gTel. lavoro"); set_header(7,"@105gTel. altro"); set_header(8,"@0g---------@10g--@13g-------------------------@39g----------@50g----------@61g----------@72g----------@83g----------@94g-----@100g----@105g--------------@120g--------"); } if (_tipostampa == completo) { - set_header(5,"@0gCod.@10gCognome e Nome@36gIndirizzo@62gTelefoni@77gData pr.SI@88gData ult.SI@99g Ult.idon."); - set_header(6,"@10gData nasc.@77gData pr.AF@88gData ult.AF@99g Gio.pre."); + set_header(5,"@0gCodice@10gCognome e Nome@36gIndirizzo@62gTelefoni@77gData pr.SI@88gData ult.SI@99g Ult.idon."); + set_header(6,"@0gTessera@10gData nasc.@77gData pr.AF@88gData ult.AF@99g Gio.pre."); set_header(7,"@77gGr. Rh. Fen. Kell Du A CMV"); set_header(8,""); } diff --git a/at/at4100a.uml b/at/at4100a.uml index a1bd6574e..3f6dd6c22 100755 --- a/at/at4100a.uml +++ b/at/at4100a.uml @@ -1,6 +1,6 @@ #include "at4100a.h" -TOOLBAR "" 0 20 0 2 +TOOLBAR "" 0 -2 0 -2 BUTTON F_ELENCO 9 2 BEGIN diff --git a/at/at4200.cpp b/at/at4200.cpp index 254068c3a..cff71b019 100755 --- a/at/at4200.cpp +++ b/at/at4200.cpp @@ -122,11 +122,15 @@ void TStampaUrgenze::set_page(int file, int cnt) case elenco: { set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########")); - set_row(2,"@0g@S", FLD(LF_SOGGETTI,SOG_CODSEZ)); - set_row(2,"@3g@S", FLD(LF_SOGGETTI,SOG_CODSOT)); + set_row(2,"@0g@8,rs", FLD(LF_SOGGETTI,SOG_TESSAVIS)); + set_row(1,"@9g@S", FLD(LF_SOGGETTI,SOG_CATDON)); set_row(1,"@12g#a", &_cognome_nome); + set_row(1,"@38g@ld", FLD(LF_SOGGETTI,SOG_DATANASC)); + set_row(2,"@38g@S", FLD(LF_SOGGETTI,SOG_CODSEZ)); + set_row(2,"@41g@S", FLD(LF_SOGGETTI,SOG_CODSOT)); + set_row(1,"@49g@S", FLD(LF_SOGGETTI,SOG_GRUPPOAB0)); set_row(1,"@53g@S", FLD(LF_SOGGETTI,SOG_RHANTID)); set_row(1,"@57g@S", FLD(LF_SOGGETTI,SOG_FENOTIPORH)); @@ -377,7 +381,7 @@ void TStampaUrgenze::crea_intestazione() sep.fill('-'); set_header(3, (const char *) sep); set_header(4,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gGr.@53gRh@57gFen.Rh@64gKellDu@72gUlt.donaz.@86gTelefono abit.@101gTelefono altro@116gUlt.idon."); - set_header(5,"@0gSe/So@75gTipo@86gTelefono lav.@116gInt.SI AF"); + set_header(5,"@0gTessera@38gSe/So@75gTipo@86gTelefono lav.@116gInt.SI AF"); set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g--- --- ------ --- ---@72g----------@86g--------------@101g--------------@116g----------"); } } diff --git a/at/at4400.cpp b/at/at4400.cpp index f610f97df..4d89bc958 100755 --- a/at/at4400.cpp +++ b/at/at4400.cpp @@ -227,6 +227,7 @@ void TConvocazioniPerPunto::set_page(int file, int cnt) case completo: { set_row(1,"@0g#a", &_cognome_nome); + set_row(3,"@0g@ld", FLD(LF_SOGGETTI,SOG_DATANASC)); set_row(1,"@36g@S", FLD(LF_SOGGETTI,SOG_CATDON)); set_row(1,"@40g@S", FLD(LF_SOGGETTI,SOG_TESSAVIS)); set_row(2,"@40g@S", FLD(LF_SOGGETTI,SOG_CODSEZ)); @@ -235,12 +236,15 @@ void TConvocazioniPerPunto::set_page(int file, int cnt) set_row(2,"@48g#a", &_dencom); set_row(1,"@79g@ld", FLD(LF_SOGGETTI,SOG_DATAULTDON)); set_row(2,"@83g@S", FLD(LF_SOGGETTI,SOG_TIPOULTDON)); + set_row(3,"@79g@S", FLD(LF_SOGGETTI,SOG_DATAPROSSI)); set_row(1,"@90g@ld", FLD(LF_RCONVOC,RCV_DATACONV)); set_row(2,"@94g@S", FLD(LF_RCONVOC,RCV_CHIAMATA)); set_row(1,"@101g@S", FLD(LF_SOGGETTI,SOG_TELABI)); - set_row(1,"@116g@S", FLD(LF_SOGGETTI,SOG_TELLAV)); - set_row(2,"@116g@S", FLD(LF_SOGGETTI,SOG_TELALT)); - set_row(3,""); + set_row(2,"@101g@S", FLD(LF_SOGGETTI,SOG_TELLAV)); + set_row(3,"@101g@S", FLD(LF_SOGGETTI,SOG_TELALT)); + set_row(1,"@117g@S", FLD(LF_SOGGETTI,SOG_GRUPPOAB0)); + set_row(2,"@117g@S", FLD(LF_SOGGETTI,SOG_RHANTID)); + set_row(4,""); } break; } @@ -552,9 +556,10 @@ void TConvocazioniPerPunto::crea_intestazione() } else { - set_header(5,"@0gCognome e nome@36gCat.@40gTessera@48gIndirizzo@79gUltima donaz.@90gData cart.@101gTel.abitazione@116gTel.lavoro"); - set_header(6,"@40gSe/So@79gTipo u.d.@90gTipo cart.@116gTel.altro"); - set_header(7,"@0g-----------------------------------@36g---@40g-------@48g------------------------------@79g----------@90g----------@101g--------------@116g--------------"); + set_header(5,"@0gCognome e nome@36gCat.@40gTessera@48gIndirizzo@79gUltima donaz.@90gData cart.@101gTel.abitazione@117gGr.AB0"); + set_header(6,"@40gSe/So@79gTipo u.d.@90gTipo cart.@101gTel.lavoro@117gRh/Antid"); + set_header(7,"@0gData nascita@101gTel.altro"); + set_header(8,"@0g-----------------------------------@36g---@40g-------@48g------------------------------@79g----------@90g----------@101g--------------@117g--------"); } printer().footerlen(3); } diff --git a/at/at4500.cpp b/at/at4500.cpp index 1135ee467..922069327 100755 --- a/at/at4500.cpp +++ b/at/at4500.cpp @@ -6,6 +6,8 @@ #include "soggetti.h" #include "sezioni.h" +#include "atopera.h" +#include "atropera.h" #include #include "at4.h" @@ -45,7 +47,7 @@ class TStampaTessere : public TPrintapp TString _riepilogodon; ts _tipostampa; TString16 _codsez, _codsot; - int _contatore, _totfinestampa; + int _contatore, _totfinestampa, _progope; bool _sttess2; int _numdon2; TString16 _catini2, _catfin2; @@ -266,6 +268,14 @@ bool TStampaTessere::preprocess_page(int file, int counter) sogg.rewrite(); } } + if (_aggiorna) + { + TLocalisamfile atropera(LF_ATROPERA); + atropera.zero(); + atropera.put(ROP_PROGOPE, _progope); + atropera.put(ROP_CODICE, sogg.get(SOG_CODICE)); + atropera.write(); + } return TRUE; } @@ -328,6 +338,25 @@ bool TStampaTessere::set_print(int m) current_cursor()->set_filterfunction (filter_func_auto, TRUE); _contatore = 0; _totfinestampa = 0; + if (_aggiorna) + { + TLocalisamfile atopera(LF_ATOPERA); + atopera.last(); + _progope = atopera.get_int(OPE_PROGOPE); + _progope++; + atopera.zero(); + atopera.put(OPE_PROGOPE, _progope); + atopera.put(OPE_CODSEZ,_msk->get(F_SEZINI)); + atopera.put(OPE_CODSOT,_msk->get(F_SOTINI)); + atopera.put(OPE_CODSEZ2,_msk->get(F_SEZFIN)); + atopera.put(OPE_CODSOT2,_msk->get(F_SOTFIN)); + atopera.put(OPE_DATA1,_data_stampa); + atopera.put(OPE_DATA2,_datault); + atopera.put(OPE_NUMERO1,_numdon); + atopera.put(OPE_UTENTE,user()); + atopera.put(OPE_TIPOOPE,'T'); + atopera.write(); + } reset_print(); printer().footerlen(0); crea_intestazione(); @@ -393,6 +422,6 @@ bool TStampaTessere::user_destroy() int at4500(int argc, char* argv[]) { TStampaTessere a; - a.run(argc, argv, "Stampa tessere associative"); + a.run(argc, argv, "Stampa tessere associative complessive"); return 0; } diff --git a/at/at4700.cpp b/at/at4700.cpp index 4cf5050af..b6111001a 100755 --- a/at/at4700.cpp +++ b/at/at4700.cpp @@ -379,8 +379,9 @@ bool TStampeSingole::user_create() _sbenemerenze = new TRecord_array(LF_BENEM,BEN_PROGBEN); _cur = add_cursor(new TCursor(_rel, "", 1)); - _msk = new TMask("at4700a"); - _form_car = new TSingole_form("ATCARTO1"); + _msk = new TMask("at4700a"); + //Modificato il form per le cartoline in ATCARTO2 da ATCARTO1 da Marco il 14/09/99 + _form_car = new TSingole_form("ATCARTO2"); _form_don = new TSingole_form("ATDDONAZ"); TConfig config(CONFIG_STUDIO); TString16 etformato = config.get("EtFormato"); diff --git a/at/at4800.cpp b/at/at4800.cpp index 5053e874b..508c088d7 100755 --- a/at/at4800.cpp +++ b/at/at4800.cpp @@ -332,8 +332,9 @@ bool TStampePerCodice::user_create() _sbenemerenze = new TRecord_array(LF_BENEM,BEN_PROGBEN); _cur = add_cursor(new TCursor(_rel, "", 1)); - _msk = new TMask("at4800a"); - _form_car = new TPerCodice_form("ATCARTO1"); + _msk = new TMask("at4800a"); + //Modificato il form per le cartoline in ATCARTO2 da ATCARTO1 da Marco il 14/09/99 + _form_car = new TPerCodice_form("ATCARTO2"); _form_don = new TPerCodice_form("ATDDONAZ"); TConfig config(CONFIG_STUDIO); TString16 etformato = config.get("EtFormato"); diff --git a/at/at6300.cpp b/at/at6300.cpp index 4a8cae0f2..e86229694 100755 --- a/at/at6300.cpp +++ b/at/at6300.cpp @@ -230,10 +230,10 @@ void TControlloDonazioni::footer_stampa() if (_riepfinale) { TString16 valore; - TString256 rigastampa = "TOTALI 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31"; + TString256 rigastampa = "GIO. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31"; set_footer(3,rigastampa); - rigastampa = "GIORNO"; - int pos = 7; + rigastampa = "TOT."; + int pos = 5; for (int i=0;i<31;i++) { valore = ""; @@ -244,9 +244,9 @@ void TControlloDonazioni::footer_stampa() pos=pos+4; } set_footer(4,rigastampa); - rigastampa = "TOTALI GEN. FEB. MAR. APR. MAG. GIU. LUG. AGO. SET. OTT. NOV. DIC. TOTALE"; + rigastampa = "MESE GEN. FEB. MAR. APR. MAG. GIU. LUG. AGO. SET. OTT. NOV. DIC. TOTALE"; set_footer(6,rigastampa); - rigastampa = "MESE "; + rigastampa = "TOT."; pos = 8; real totale = ZERO; for (int j=0;j<12;j++) @@ -290,10 +290,10 @@ void TControlloDonazioni::fine_stampa() if (_riepfinale) { TString16 valore; - TString256 rigastampa = "TOTALI 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31"; + TString256 rigastampa = "GIO. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31"; set_footer(3,rigastampa); - rigastampa = "GIORNO"; - int pos = 7; + rigastampa = "TOT."; + int pos = 5; for (int i=0;i<31;i++) { valore = ""; @@ -513,13 +513,14 @@ bool TControlloDonazioni::set_print(int m) TRectype a (LF_DONAZ); if (_riepfinale) { - TDate inizio = _dataini; - TDate fine = _datafin; + TDate inizio (_dataini); + TDate fine (_datafin); inizio.set_day(1); inizio.set_month(1); fine.set_end_month(); da.put(DON_DATADON, inizio); a.put(DON_DATADON, fine); + _giorni.destroy(); _mesi.destroy(); _giornifinale.destroy(); diff --git a/at/at6400.cpp b/at/at6400.cpp index 51ff3025d..d47e3d0fc 100755 --- a/at/at6400.cpp +++ b/at/at6400.cpp @@ -22,9 +22,10 @@ class TStampaIncompleti : public TPrintapp TAssoc_array _catnondon; TParagraph_string _cognome_nome, _dencom; TDate _data_stampa; - TString16 _codsez, _codsot; + TString16 _codsez, _codsot, _altridati; bool _indirizzo, _datanasc, _categoria, _sezione, _gruppoab0; - bool _rhantid, _tessera, _telabi, _cf; + bool _rhantid, _tessera, _telabi, _cf, _incompleto, _comune; + bool _sottog, _sesso; protected: virtual bool user_create(); @@ -66,15 +67,18 @@ void TStampaIncompleti::filtra_sezioni() void TStampaIncompleti::set_page(int file, int cnt) { set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########")); + set_row(2,"@0g@8,rs", FLD(LF_SOGGETTI,SOG_TESSAVIS)); set_row(1,"@9g@S", FLD(LF_SOGGETTI,SOG_CATDON)); set_row(1,"@12g#a", &_cognome_nome); set_row(1,"@38g@ld", FLD(LF_SOGGETTI,SOG_DATANASC)); set_row(1,"@49g@S", FLD(LF_SOGGETTI,SOG_DOM_INDIR)); - set_row(1,"@100g@S", FLD(LF_SOGGETTI,SOG_TELABI)); - set_row(1,"@116g@S", FLD(LF_SOGGETTI,SOG_TELLAV)); set_row(2,"@49g#a", &_dencom); - set_row(2,"@116g@S", FLD(LF_SOGGETTI,SOG_TELALT)); - set_row(3,""); + set_row(1,"@100g@S", FLD(LF_SOGGETTI,SOG_TELABI)); + set_row(2,"@100g@S", FLD(LF_SOGGETTI,SOG_TELLAV)); + set_row(3,"@100g@S", FLD(LF_SOGGETTI,SOG_TELALT)); + set_row(1,"@116g@ld", FLD(LF_SOGGETTI,SOG_DATAISC)); + set_row(2,"@116g@ld", FLD(LF_SOGGETTI,SOG_DATAULTDON)); + set_row(4,""); } bool TStampaIncompleti::filter_func_incompleti(const TRelation* rel) @@ -102,15 +106,18 @@ bool TStampaIncompleti::filter_func_incompleti(const TRelation* rel) } if (app()._catdon.items() == 0 && app()._catnondon.items() == 0) filtrato = TRUE; - incompleto = !(app()._indirizzo || app()._datanasc || app()._categoria - || app()._sezione || app()._gruppoab0 || app()._rhantid - || app()._tessera || app()._telabi || app()._cf); - + incompleto = app()._incompleto; if (filtrato && app()._indirizzo && !incompleto) { TString80 indirizzo = sog.get(SOG_DOM_INDIR); + //TString16 codcom = sog.get(SOG_DOM_CODCOM); + //incompleto = (indirizzo.empty() || codcom.empty()); + incompleto = indirizzo.empty(); + } + if (filtrato && app()._comune && !incompleto) + { TString16 codcom = sog.get(SOG_DOM_CODCOM); - incompleto = (indirizzo.empty() || codcom.empty()); + incompleto = codcom.empty(); } if (filtrato && app()._datanasc && !incompleto) { @@ -129,6 +136,11 @@ bool TStampaIncompleti::filter_func_incompleti(const TRelation* rel) TString16 codsez = sog.get(SOG_CODSEZ); incompleto = codsez.empty(); } + if (filtrato && app()._sottog && !incompleto) + { + TString16 codsot = sog.get(SOG_CODSOT); + incompleto = codsot.empty(); + } if (filtrato && app()._gruppoab0 && !incompleto) { TString16 gruppoab0 = sog.get(SOG_GRUPPOAB0); @@ -152,8 +164,19 @@ bool TStampaIncompleti::filter_func_incompleti(const TRelation* rel) if (filtrato && app()._cf && !incompleto) { TString16 cf = sog.get(SOG_CF); - incompleto = cf.empty(); + incompleto = cf.empty(); } + if (filtrato && app()._sesso && !incompleto) + { + TString16 sesso = sog.get(SOG_SESSO); + incompleto = (sesso.empty()) || (sesso[0] == '0'); + } + if ((filtrato) && (app()._altridati.not_empty()) && (!incompleto)) + { + TString80 str = sog.get(app()._altridati); + incompleto = str.empty(); + } + filtrato = (filtrato && incompleto); return filtrato; } @@ -208,7 +231,7 @@ bool TStampaIncompleti::preprocess_page(int file, int counter) _codsot = codsot; header_sezione(codsez, codsot); } - if (printer().rows_left()<3) + if (printer().rows_left()<4) printer().formfeed(); return TRUE; } @@ -263,15 +286,23 @@ bool TStampaIncompleti::set_print(int m) if (catnses.not_empty() && catnses.ok()) _catnondon.add((const char*) catnses); _indirizzo = _msk->get_bool(F_INDIRIZZO); + _comune = _msk->get_bool(F_COMUNE); _datanasc = _msk->get_bool(F_DATANASC); _categoria = _msk->get_bool(F_CATEGORIA); _sezione = _msk->get_bool(F_SEZIONE); + _sottog = _msk->get_bool(F_SOTTOG); _gruppoab0 = _msk->get_bool(F_GRUPPOAB0); _rhantid = _msk->get_bool(F_RHANTID); _tessera = _msk->get_bool(F_TESSERA); _telabi = _msk->get_bool(F_TELABI); _cf = _msk->get_bool(F_CF); - //current_cursor()->setfilter("DOM_CODCOM == \"\""); + _sesso = _msk->get_bool(F_SESSO); + _altridati = _msk->get(F_ALTRIDATI); + _incompleto = !(_incompleto || app()._indirizzo || app()._datanasc || + app()._categoria || app()._sezione || app()._gruppoab0 || + app()._rhantid || app()._tessera || app()._telabi || + app()._cf || app()._comune || app()._sottog || app()._sesso + || app()._altridati.not_empty()); current_cursor()->set_filterfunction (filter_func_incompleti); reset_print(); crea_intestazione(); @@ -295,31 +326,43 @@ void TStampaIncompleti::crea_intestazione() set_header(2, "@120g%s", (const char*) sep); sep = "DATI MANCANTI: "; if (_indirizzo) - sep << "INDIRIZZO - "; + sep << "Indirizzo dom.- "; if (_datanasc) - sep << "DATA NASCITA - "; + sep << "Data nascita - "; if (_gruppoab0) - sep << "GRUPPO AB0 - "; + sep << "Gruppo AB0 - "; if (_rhantid) - sep << "RH/ANTID - "; + sep << "Rh/AntiD - "; if (_sezione) - sep << "SEZIONE - "; + sep << "Sesione - "; if (_categoria) - sep << "CATEGORIA - "; + sep << "Categoria - "; if (_tessera) - sep << "TESSERA - "; + sep << "Tess.AVIS - "; if (_telabi) - sep << "TEL. ABIT. - "; + sep << "Tel.abit. - "; if (_cf) - sep << "COD. FISCALE - "; + sep << "Cod.fiscale - "; + if (_comune) + sep << "Comune dom. - "; + if (_sottog) + sep << "Sottog. - "; + if (_sesso) + sep << "Sesso - "; + if (_altridati.not_empty()) + { + TList_field& list = (TList_field&)app_mask().field(F_ALTRIDATI); + sep << list.raw2win(list.get()); + } sep.center_just(); set_header(3, (const char *) sep); sep = ""; sep.fill('-'); set_header(4, (const char *) sep); - set_header(5,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gIndirizzo@100gTelefono abit.@116gTelefono lavoro"); - set_header(6,"@49gCAP/Località/Comune/Prov.@116gTelefono altro"); - set_header(7,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g---------------"); + set_header(5,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gIndirizzo@100gTelefono abit.@116gData iscr."); + set_header(6,"@0gTessera@49gCAP/Località/Comune/Prov.@100gTelefono lavoro@116gUlt. don."); + set_header(7,"@100gTelefono altro"); + set_header(8,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g----------"); } bool TStampaIncompleti::user_create() diff --git a/at/at6400a.h b/at/at6400a.h index 25d3b6051..5ce42d314 100755 --- a/at/at6400a.h +++ b/at/at6400a.h @@ -45,3 +45,7 @@ #define F_TESSERA 407 #define F_TELABI 408 #define F_CF 409 +#define F_COMUNE 410 +#define F_SOTTOG 411 +#define F_SESSO 412 +#define F_ALTRIDATI 413 diff --git a/at/at6400a.uml b/at/at6400a.uml index 9bc7ed28b..dec0c2e84 100755 --- a/at/at6400a.uml +++ b/at/at6400a.uml @@ -383,7 +383,7 @@ BEGIN FLAGS "D" END -GROUPBOX DLG_NULL 77 5 +GROUPBOX DLG_NULL 77 7 BEGIN PROMPT 1 14 "Soggetti con i seguenti dati mancanti" END @@ -393,14 +393,19 @@ BEGIN PROMPT 2 15 "Indirizzo domicilio" END +BOOLEAN F_COMUNE +BEGIN + PROMPT 2 16 "Comune domicilio" +END + BOOLEAN F_DATANASC BEGIN - PROMPT 2 16 "Data di nascita" + PROMPT 2 17 "Data di nascita" END BOOLEAN F_CATEGORIA BEGIN - PROMPT 2 17 "Categoria" + PROMPT 2 18 "Categoria" END BOOLEAN F_SEZIONE @@ -408,14 +413,19 @@ BEGIN PROMPT 27 15 "Sezione di appartenenza" END +BOOLEAN F_SOTTOG +BEGIN + PROMPT 27 16 "Sottogruppo" +END + BOOLEAN F_GRUPPOAB0 BEGIN - PROMPT 27 16 "Gruppo AB0" + PROMPT 27 17 "Gruppo AB0" END BOOLEAN F_RHANTID BEGIN - PROMPT 27 17 "Rh/AntiD" + PROMPT 27 18 "Rh/AntiD" END BOOLEAN F_TESSERA @@ -433,5 +443,27 @@ BEGIN PROMPT 57 17 "Codice fiscale" END +BOOLEAN F_SESSO +BEGIN + PROMPT 57 18 "Sesso" +END + +LISTBOX F_ALTRIDATI 30 +BEGIN + PROMPT 2 19 "Altri dati " + FLAGS "U" + ITEM " | " + ITEM "DATAISC|Data Iscrizione" + ITEM "DATADIM|Data dimissione" + ITEM "COMNASC|Luogo di nascita" + ITEM "DOCID|Documento di identita'" + ITEM "CODCL|Cartella clinica" + ITEM "CODCT|Codice CT" + ITEM "TESSSSN|Tessera SSN" + ITEM "CODMED|Medico" + ITEM "MODCONV|Modalita' di convocazione" + ITEM "PUNTORACC|Punto di prelievo" +END + ENDPAGE ENDMASK diff --git a/at/at6500.cpp b/at/at6500.cpp index 4a9928fb4..a8331a1ea 100755 --- a/at/at6500.cpp +++ b/at/at6500.cpp @@ -33,7 +33,7 @@ protected: public: void crea_intestazione(); - void header_data(const TDate data, const TString16 luogo, const TString16 sezione); + void header_stampa(const TDate data, const TString16 sezione, const TString16 sottog); TMask& app_mask() { return *_msk; } TControlloControlli() : _cognome_nome("",35) {} }; @@ -51,6 +51,16 @@ void TControlloControlli::set_page(int file, int cnt) set_row(1,"@74g@S" , FLD(LF_SOGGETTI,SOG_CODSOT)); set_row(1,"@77g@ld" , FLD(LF_CONTSAN,CON_DATACON)); set_row(1,"@88g@S" , FLD(LF_CONTSAN,CON_TIPOCON)); + set_row(1,"@91g@S" , FLD(LF_CONTSAN,CON_IDON1)); + set_row(1,"@94g@S" , FLD(LF_CONTSAN,CON_IDON2)); + set_row(1,"@97g@S" , FLD(LF_CONTSAN,CON_IDON3)); + set_row(1,"@100g@S" , FLD(LF_CONTSAN,CON_IDON4)); + set_row(1,"@103g@pn" , FLD(LF_CONTSAN,CON_INTSI,"###")); + set_row(1,"@107g@pn" , FLD(LF_CONTSAN,CON_INTAF,"###")); + set_row(1,"@111g@S" , FLD(LF_CONTSAN,CON_PROSSTIPO)); + set_row(1,"@114g@ld" , FLD(LF_CONTSAN,CON_PROSSDATA)); + set_row(1,"@125g@S" , FLD(LF_CONTSAN,CON_MOTIVO)); + set_row(2,"@60g@S" , FLD(LF_CONTSAN,CON_RESPONSAB)); } bool TControlloControlli::preprocess_page(int file, int counter) @@ -73,22 +83,25 @@ bool TControlloControlli::preprocess_page(int file, int counter) if (_dataold.ok()) printer().formfeed(); _dataold = datanew; - header_data(datanew,"",""); + header_stampa(datanew,"",""); _counter = 0; } } break; case 'S': { - TString16 seznew = current_cursor()->curr(LF_SOGGETTI).get(SOG_CODSEZ); - seznew << "/"; - seznew << current_cursor()->curr(LF_SOGGETTI).get(SOG_CODSOT); + TString16 sezione = current_cursor()->curr(LF_SOGGETTI).get(SOG_CODSEZ); + TString16 sottog = current_cursor()->curr(LF_SOGGETTI).get(SOG_CODSOT); + TString16 seznew = ""; + seznew << sezione; + seznew << '/'; + seznew << sottog; if (seznew != _sezold ) { if (_sezold != "****") printer().formfeed(); _sezold = seznew; - header_data(NULLDATE,"",seznew); + header_stampa(NULLDATE,sezione,sottog); _counter = 0; } } @@ -98,10 +111,10 @@ bool TControlloControlli::preprocess_page(int file, int counter) return TRUE; } -void TControlloControlli::header_data(const TDate data, const TString16 luogo, const TString16 sezione) +void TControlloControlli::header_stampa(const TDate data, const TString16 sezione, const TString16 sottog) { TString intestazione(132); - intestazione = "STAMPA DI CONTROLLO CONTROLLI SANITARI "; + intestazione = "STAMPA CONTROLLI SANITARI "; switch (_tipostampa[0]) { case 'D': @@ -111,16 +124,38 @@ void TControlloControlli::header_data(const TDate data, const TString16 luogo, c } break; case 'S': - { + { intestazione << "PER SEZIONE "; intestazione << sezione; - } + if (sottog.not_empty()) + { + intestazione << "/"; + intestazione << sottog; + } + TLocalisamfile sez(LF_SEZIONI); + sez.setkey(1); + TRectype& recsez = sez.curr(); + recsez.zero(); + recsez.put(SEZ_CODSEZ, sezione); + recsez.put(SEZ_CODSOT, sottog); + if (sez.read() == NOERR) + { + intestazione << " "; + intestazione << recsez.get(SEZ_DENSEZ); + TString80 densot = recsez.get(SEZ_DENSOT); + if (densot.not_empty()) + { + intestazione << "/"; + intestazione << densot; + } + } + } break; } intestazione.center_just(); set_header(1,"@0g%s", (const char*) intestazione); intestazione = "Pag. @#"; - set_header(1, "@110g%s", (const char*) intestazione); + set_header(1, "@120g%s", (const char*) intestazione); return; } @@ -205,7 +240,7 @@ void TControlloControlli::crea_intestazione() { reset_header(); TString sep(132); - sep = "Selezioni della stampa: "; + sep = "Selezioni stampa: "; if (_sezini.not_empty()) { sep << "Sez. "; @@ -237,8 +272,9 @@ void TControlloControlli::crea_intestazione() } sep.center_just(); set_header(2,"@0g%s", (const char*) sep); - set_header(3,"@0gProg.@7gCodice@16gTessera@24gCognome e nome@60gNato il@71gSe/So@77gData con.@88gTipo"); - set_header(4,"@0g------@7g--------@16g-------@24g-----------------------------------@60g----------@71g-----@77g----------@88g----"); + set_header(3,"@0gProg.@7gCodice@16gTessera@24gCognome e nome@60gNato il@71gSe/So@77gData con/tipo@91gIdoneita'@103g SI AF@111gPross.tipo@125gMot."); + set_header(4,"@60gResponsabile"); + set_header(5,"@0g------@7g--------@16g-------@24g-----------------------------------@60g----------@71g-----@77g----------@88g--@91g-- -- -- --@103g--- ---@111g-- ----------@125g----"); } bool TControlloControlli::user_create() diff --git a/at/at6600.cpp b/at/at6600.cpp index 84d665d58..81dfb7099 100755 --- a/at/at6600.cpp +++ b/at/at6600.cpp @@ -68,11 +68,12 @@ void TStampaNonDom::filtra_sezioni() void TStampaNonDom::set_page(int file, int cnt) { set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########")); - set_row(2,"@0g@S", FLD(LF_SOGGETTI,SOG_CODSEZ)); - set_row(2,"@3g@S", FLD(LF_SOGGETTI,SOG_CODSOT)); + set_row(2,"@0g@8,rs", FLD(LF_SOGGETTI,SOG_TESSAVIS)); set_row(1,"@9g@S", FLD(LF_SOGGETTI,SOG_CATDON)); set_row(1,"@12g#a", &_cognome_nome); set_row(1,"@38g@ld", FLD(LF_SOGGETTI,SOG_DATANASC)); + set_row(2,"@38g@S", FLD(LF_SOGGETTI,SOG_CODSEZ)); + set_row(2,"@41g@S", FLD(LF_SOGGETTI,SOG_CODSOT)); set_row(1,"@49g@S", FLD(LF_SOGGETTI,SOG_DOM_INDIR)); set_row(1,"@100g@S", FLD(LF_SOGGETTI,SOG_TELABI)); set_row(1,"@116g@S", FLD(LF_SOGGETTI,SOG_TELLAV)); @@ -310,7 +311,7 @@ void TStampaNonDom::crea_intestazione() sep.fill('-'); set_header(4, (const char *) sep); set_header(5,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gIndirizzo@100gTelefono abit.@116gTelefono lavoro"); - set_header(6,"@49gCAP/Località/Comune/Prov.@116gTelefono altro"); + set_header(6,"@0gTessera@38gSe/So@49gCAP/Località/Comune/Prov.@116gTelefono altro"); set_header(7,"@0g--------@9g--@12g-------------------------@38g----------@49g--------------------------------------------------@100g---------------@116g---------------"); printer().footerlen(3); } diff --git a/at/at6800.cpp b/at/at6800.cpp index 6235d7562..a48d55e55 100755 --- a/at/at6800.cpp +++ b/at/at6800.cpp @@ -121,23 +121,14 @@ void TStampaConsenso::set_page(int file, int cnt) case sintetico: { set_row(1,"@0g@pn", FLD(LF_SOGGETTI,SOG_CODICE,"########")); - set_row(2,"@0g@8,rs", FLD(LF_SOGGETTI,SOG_TESSAVIS)); set_row(1,"@9g@S", FLD(LF_SOGGETTI,SOG_CATDON)); set_row(1,"@12g#a", &_cognome_nome); set_row(1,"@38g@ld", FLD(LF_SOGGETTI,SOG_DATANASC)); - set_row(2,"@38g@S", FLD(LF_SOGGETTI,SOG_GRUPPOAB0)); - set_row(2,"@45g@S", FLD(LF_SOGGETTI,SOG_RHANTID)); - set_row(1,"@49g@ld", FLD(LF_SOGGETTI,SOG_DATASTATO)); - set_row(1,"@60g@S", FLD(LF_SOGGETTI,SOG_STATO)); - set_row(2,"@49g@ld", FLD(LF_SOGGETTI,SOG_DATA_PROS)); - set_row(2,"@60g@S", FLD(LF_SOGGETTI,SOG_PROS_STATO)); - set_row(1,"@63g@ld", FLD(LF_SOGGETTI,SOG_DATAULTID)); - set_row(1,"@74g@S", FLD(LF_SOGGETTI,SOG_TIPOULTID)); - set_row(1,"@77g@pn", FLD(LF_SOGGETTI,SOG_INTSI,"###")); - set_row(1,"@81g@pn", FLD(LF_SOGGETTI,SOG_INTAF,"###")); - set_row(1,"@88g@ld", FLD(LF_SOGGETTI,SOG_DATAULTDON)); - set_row(1,"@99g@S", FLD(LF_SOGGETTI,SOG_TIPOULTDON)); - set_row(3,""); + set_row(1,"@49g@6,rs", FLD(LF_SOGGETTI,SOG_TESSAVIS)); + set_row(1,"@56g@ld", FLD(LF_SOGGETTI,SOG_DATAULTDON)); + set_row(1,"@67g@S", FLD(LF_SOGGETTI,SOG_TIPOULTDON)); + set_row(1,"@70g@S", FLD(LF_SOGGETTI,SOG_CONSENSO)); + set_row(2,""); } break; case completo: @@ -163,18 +154,12 @@ void TStampaConsenso::set_page(int file, int cnt) set_row(4,"@82gKe @S", FLD(LF_SOGGETTI,SOG_KELL)); set_row(5,"@82gDu @S", FLD(LF_SOGGETTI,SOG_DU)); - set_row(1,"@94g@S", FLD(LF_SOGGETTI,SOG_STATO)); - set_row(2,"@94g@ld", FLD(LF_SOGGETTI,SOG_DATASTATO)); - set_row(3,"@94g@S", FLD(LF_SOGGETTI,SOG_PROS_STATO)); - set_row(4,"@94g@ld", FLD(LF_SOGGETTI,SOG_DATA_PROS)); + set_row(1,"@94g@ld", FLD(LF_SOGGETTI,SOG_DATAULTDON)); + set_row(2,"@94g@S", FLD(LF_SOGGETTI,SOG_TIPOULTDON)); + set_row(4,"@94g@pn", FLD(LF_SOGGETTI,SOG_TOTDON)); + + set_row(1,"@105g@S", FLD(LF_SOGGETTI,SOG_CONSENSO)); - set_row(1,"@105g@ld", FLD(LF_SOGGETTI,SOG_DATAULTID)); - set_row(2,"@105g@S", FLD(LF_SOGGETTI,SOG_TIPOULTID)); - set_row(3,"@105g@pn", FLD(LF_SOGGETTI,SOG_INTSI,"###")); - set_row(4,"@105g@pn", FLD(LF_SOGGETTI,SOG_INTAF,"###")); - set_row(1,"@116g@ld", FLD(LF_SOGGETTI,SOG_DATAULTDON)); - set_row(2,"@116g@S", FLD(LF_SOGGETTI,SOG_TIPOULTDON)); - set_row(2,"@116g@pn", FLD(LF_SOGGETTI,SOG_TOTDON)); set_row(6,""); } break; @@ -357,9 +342,23 @@ void TStampaConsenso::crea_intestazione() 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."); - set_header(5,"@0gTessera@38gGr.AB0 Rh@49gPr.tipo@78gSI AF"); - set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g-------------@63g-------------@77g----------@88g---------- --"); + if (_tipostampa==sintetico) + { + sep.fill('-',100); + set_header(4, (const char *) sep); + set_header(5,"@0gCodice@9gC.@12gCognome e nome@38gNato il@49gTess.@56gData/Tipo u.d.@70Consenso"); + set_header(6,"@0g--------@9g--@12g-------------------------@38g----------@49g------@56g---------- --@70g--------"); + } + else + { + sep.fill('-'); + set_header(4, (const char *) sep); + set_header(5,"@0gCodice@9gCognome@35gIndirizzo@66gTel.abitazione@82gTipiz@94gUlt.donaz.@105gConsenso"); + set_header(6,"@0gTessera@9gNome@66gTel.lavoro@82gzazione@94gTipo"); + set_header(7,"@0gCateg.@9gData nascita@66gTel.altro"); + set_header(8,"@94gTot.don."); + set_header(10,"@0g--------@9g-------------------------@35g------------------------------@66g--------------@82g------------@94g----------@105g--------"); + } } } diff --git a/at/at7200.cpp b/at/at7200.cpp index 8b870b9ae..14b7fd0e3 100755 --- a/at/at7200.cpp +++ b/at/at7200.cpp @@ -10,6 +10,7 @@ // nomi dei campi #include "soggetti.h" #include "donaz.h" +#include "storico.h" class TPrimaDon : public TPrintapp { @@ -18,6 +19,8 @@ class TPrimaDon : public TPrintapp int _cur; TLocalisamfile* _donaz; TRecord_array* _sdonazioni; + TLocalisamfile* _storico; + TRecord_array* _sstorico; protected: virtual bool user_create(); @@ -36,15 +39,55 @@ bool TPrimaDon::preprocess_page(int file, int counter) { bool rewrite = FALSE; TRectype& recsog = current_cursor()->curr(); + const TString sezsog = recsog.get(SOG_CODSEZ); + const TString sotsog = recsog.get(SOG_CODSOT); + const TDate dataisc = recsog.get_date(SOG_DATAISC); const long codice = recsog.get_long(SOG_CODICE); + TRectype* keys = new TRectype(LF_STORICO); + keys->put(STO_CODICE, codice); + int errs = _sstorico->read(keys); TRectype* keyd = new TRectype(LF_DONAZ); keyd->put(DON_CODICE, codice); int errd = _sdonazioni->read(keyd); if ((errd == NOERR) && (_sdonazioni->rows()>0)) { + for (int d=1; d<=_sdonazioni->rows(); d++) + { + TRectype& riga = _sdonazioni->row(d, TRUE); + TString16 codsez = riga.get(DON_CODSEZ); + TString16 codsot = riga.get(DON_CODSOT); + TDate datadon = riga.get_date(DON_DATADON); + if (codsez.empty() && codsot.empty()) + { + if (_sstorico->rows()>0) + { + for (int s=1; s<=_sstorico->rows(); s++) + { + TRectype& rigas = _sstorico->row(s, TRUE); + TDate dataisc = rigas.get_date(STO_DATAISC); + TDate datadim = rigas.get_date(STO_DATADIM); + if ((datadon >= dataisc) && ( (datadon <= datadim) || (datadim.empty()) )) + { + riga.put(DON_CODSEZ,rigas.get(STO_CODSEZ)); + riga.put(DON_CODSOT,rigas.get(STO_CODSOT)); + s = _sstorico->rows()+1; + rewrite = TRUE; + } + } + } + else + { + if (datadon >= dataisc) + { + riga.put(DON_CODSEZ, sezsog); + riga.put(DON_CODSOT, sotsog); + } + } + } + } + /* TDate dataprisi = recsog.get(SOG_DATAPRISI); TDate datapriaf = recsog.get(SOG_DATAPRIAF); - TRectype& riga = _sdonazioni->row(1, TRUE); TDate datadon = riga.get(DON_DATADON); if (datadon==dataprisi || datadon==datapriaf) @@ -58,6 +101,7 @@ bool TPrimaDon::preprocess_page(int file, int counter) rewrite = TRUE; riga.put(DON_PRIMADON, TRUE); } + */ if (rewrite) _sdonazioni->rewrite(); } @@ -86,17 +130,21 @@ bool TPrimaDon::set_print(int) bool TPrimaDon::user_create() { - _msk = new TMask("at7200a"); - _rel = new TRelation(LF_SOGGETTI); - _donaz = new TLocalisamfile(LF_DONAZ); - _sdonazioni = new TRecord_array(LF_DONAZ,DON_PROGDON); - _cur = add_cursor(new TCursor(_rel, "", 1)); + _msk = new TMask("at7200a"); + _rel = new TRelation(LF_SOGGETTI); + _donaz = new TLocalisamfile(LF_DONAZ); + _storico = new TLocalisamfile(LF_STORICO); + _sdonazioni = new TRecord_array(LF_DONAZ,DON_PROGDON); + _sstorico = new TRecord_array(LF_STORICO,STO_PROGSTO); + _cur = add_cursor(new TCursor(_rel, "", 1)); return TRUE; } bool TPrimaDon::user_destroy() { + delete _sstorico; delete _sdonazioni; + delete _storico; delete _donaz; delete _rel; delete _msk; diff --git a/at/at7600.cpp b/at/at7600.cpp index d387679c0..8568a3852 100755 --- a/at/at7600.cpp +++ b/at/at7600.cpp @@ -13,6 +13,7 @@ #include "soggetti.h" #include "contsan.h" #include "idoneita.h" +#include "donaz.h" #include "sezioni.h" class TRiordinaControlli : public TPrintapp @@ -24,6 +25,8 @@ class TRiordinaControlli : public TPrintapp TRecord_array* _scontrolli; TLocalisamfile* _idoneita; TRecord_array* _sidoneita; + TLocalisamfile* _donaz; + TRecord_array* _sdonazioni; protected: virtual bool user_create(); @@ -70,11 +73,14 @@ bool TRiordinaControlli::preprocess_page(int file, int counter) TRectype* keyi = new TRectype(LF_IDONEITA); keyi->put(IDO_CODICE, codice); int erri = _sidoneita->read(keyi); + TRectype* keyd = new TRectype(LF_DONAZ); + keyd->put(DON_CODICE, codice); + int errd = _sdonazioni->read(keyd); //if ((err == NOERR || erri == NOERR) && (_scontrolli->rows() > 0 || _sidoneita->rows() > 0)) - if (err == NOERR || erri == NOERR) + if (err == NOERR || erri == NOERR || errd == NOERR) { - con_reord(recsog,_scontrolli, _sidoneita); + calcola_donazioni_lib(recsog, _sdonazioni); rewrite = TRUE; } if (rewrite) @@ -114,7 +120,8 @@ bool TRiordinaControlli::set_print(int) } TString256 filtro = ""; //filtro = "(90->STATO==\"ID\") && ((90->STATOSI==\"SO\") || (90->STATOAF==\"SO\"))"; - filtro = "(90->CATDON==\"01\") || (90->CATDON==\"04\") || (90->CATDON==\"07\")"; + //filtro = "(90->CATDON==\"01\") || (90->CATDON==\"04\") || (90->CATDON==\"07\")"; + filtro = "(90->TIPOULTDON!=\"SI\") && (90->TIPOULTDON!=\"SN\") && (90->TIPOULTDON!=\"PL\") && (90->TIPOULTDON!=\"PN\") && (90->TIPOULTDON!=\"PP\") && (90->TIPOULTDON!=\"PI\")"; current_cursor()->setfilter((const char*) filtro, TRUE); reset_files(); @@ -134,12 +141,16 @@ bool TRiordinaControlli::user_create() _scontrolli = new TRecord_array(LF_CONTSAN,CON_PROGCON); _idoneita = new TLocalisamfile(LF_IDONEITA); _sidoneita = new TRecord_array(LF_IDONEITA,IDO_PROGIDO); + _donaz = new TLocalisamfile(LF_DONAZ); + _sdonazioni = new TRecord_array(LF_DONAZ,DON_PROGDON); long items = _rel->lfile().items(); return TRUE; } bool TRiordinaControlli::user_destroy() { + delete _sdonazioni; + delete _donaz; delete _sidoneita; delete _idoneita; delete _scontrolli; diff --git a/at/at8200.cpp b/at/at8200.cpp index bd40a7c8c..fddc5d1c7 100755 --- a/at/at8200.cpp +++ b/at/at8200.cpp @@ -1,17 +1,11 @@ #include -#include #include -#include -#include #include -#include #include #include #include #include #include -#include -#include #include "at8.h" #include "at8200a.h" @@ -105,15 +99,20 @@ bool TAggConSan::destroy() bool TAggConSan::menu(MENU_TAG m) { KEY tasto = _msk->run(); + TPrinter& pr = printer(); + if (tasto == K_ENTER) { + if (!pr.open()) + return error_box("Errore in apertura stampante."); + bool anagrafe = _msk->get_bool(F_ANAGRAFE); _rel->lfile().setkey(2); bool modificato = FALSE; TDate oggi(TODAY); TPrintrow row; TString256 rigastampa; - rigastampa = "SOGGETTI NON TROVATI SU ARCHIVIO PROVINCIALE"; + rigastampa = "SOGGETTI NON TROVATI SU ARCHIVIO PROVINCIALE "; rigastampa << oggi.string(); rigastampa.center_just(120); row.put(rigastampa); @@ -186,6 +185,15 @@ bool TAggConSan::menu(MENU_TAG m) key->put(IDO_CODICE, recsog.get(SOG_CODICE)); _sidoneita->read(key); con_reord(recsog,_scontrolli,_sidoneita); + //Verifico se la categoria del donatore è aggiornata al numero di donazioni dello stesso + //se non lo è eseguo tutti i controlli per il salto automatico di categoria + TString16 catdon = recsog.get(SOG_CATDON); + const int totdon = recsog.get_int(SOG_TOTDON); + if ((catdon == _catini1 || _catini1.empty()) && (totdon>=_numdon1) && _catfin1.not_empty()) + recsog.put(SOG_CATDON, _catfin1); + const bool tstampata = recsog.get_bool(SOG_T_STAMPATA); + if ((catdon == _catini2 || _catini2.empty()) && (totdon>=_numdon2) && _catfin2.not_empty() && (!_sttess2 || tstampata)) + recsog.put(SOG_CATDON, _catfin2); recsog.put(SOG_DATAULTAGG, oggi); recsog.put(SOG_UTENULTAGG, "PORT."); recsog.rewrite(_rel->lfile()); @@ -198,7 +206,7 @@ bool TAggConSan::menu(MENU_TAG m) rigastampa << " " << nome; rigastampa << " " << datanasc.string(); row.reset(); - row.put((const char*) rigastampa); + row.put(rigastampa); printer().print(row); } } @@ -259,6 +267,15 @@ bool TAggConSan::menu(MENU_TAG m) key->put(CON_CODICE, recsog.get(SOG_CODICE)); _scontrolli->read(key); con_reord(recsog,_scontrolli,_sidoneita); + //Verifico se la categoria del donatore è aggiornata al numero di donazioni dello stesso + //se non lo è eseguo tutti i controlli per il salto automatico di categoria + TString16 catdon = recsog.get(SOG_CATDON); + const int totdon = recsog.get_int(SOG_TOTDON); + if ((catdon == _catini1 || _catini1.empty()) && (totdon>=_numdon1) && _catfin1.not_empty()) + recsog.put(SOG_CATDON, _catfin1); + const bool tstampata = recsog.get_bool(SOG_T_STAMPATA); + if ((catdon == _catini2 || _catini2.empty()) && (totdon>=_numdon2) && _catfin2.not_empty() && (!_sttess2 || tstampata)) + recsog.put(SOG_CATDON, _catfin2); recsog.put(SOG_DATAULTAGG, oggi); recsog.put(SOG_UTENULTAGG, "PORT."); recsog.rewrite(_rel->lfile()); @@ -271,7 +288,7 @@ bool TAggConSan::menu(MENU_TAG m) rigastampa << " " << nome; rigastampa << " " << datanasc.string(); row.reset(); - row.put((const char*) rigastampa); + row.put(rigastampa); printer().print(row); } } @@ -350,6 +367,8 @@ bool TAggConSan::menu(MENU_TAG m) delete pi2; delete fs; } + pr.formfeed(); + pr.close(); } return FALSE; } diff --git a/at/at8300.cpp b/at/at8300.cpp index 3a695d44c..4a6e57d55 100755 --- a/at/at8300.cpp +++ b/at/at8300.cpp @@ -144,9 +144,10 @@ bool TCTDon2AT::menu(MENU_TAG m) if (ctd.get("S6").not_empty()) catdon = ctd.get("S6"); } - if ((catdon == _catini1 || _catini1.empty()) && (totdon==_numdon1) && _catfin1.not_empty()) - recsog.put(SOG_CATDON, _catfin1); - if ((catdon == _catini2 || _catini2.empty()) && (totdon>=_numdon2) && _catfin2.not_empty() && (!_sttess2 || dimissione)) + if ((catdon == _catini1 || _catini1.empty()) && (totdon>=_numdon1) && _catfin1.not_empty()) + recsog.put(SOG_CATDON, _catfin1); + const bool tstampata = recsog.get_bool(SOG_T_STAMPATA); + if ((catdon == _catini2 || _catini2.empty()) && (totdon>=_numdon2) && _catfin2.not_empty() && (!_sttess2 || tstampata)) recsog.put(SOG_CATDON, _catfin2); } TDate dataiscsog = recsog.get_date(SOG_DATAISC); @@ -174,7 +175,7 @@ bool TCTDon2AT::menu(MENU_TAG m) if (rconvoc.read() == NOERR) { rconvoc.put(RCV_ANNULLATO, TRUE); - int err = rconvoc.write(); + int err = rconvoc.rewrite(); } const TDate datanulla(NULLDATE); recsog.put(SOG_DATACONV, datanulla); diff --git a/at/at8400.cpp b/at/at8400.cpp index 39880df76..46e064fb2 100755 --- a/at/at8400.cpp +++ b/at/at8400.cpp @@ -155,7 +155,7 @@ bool TReconstruction::menu(MENU_TAG m) if (ctd.get("S6").not_empty()) catdon = ctd.get("S6"); } - if ((catdon == _catini1 || _catini1.empty()) && (totdon==_numdon1) && _catfin1.not_empty()) + if ((catdon == _catini1 || _catini1.empty()) && (totdon>=_numdon1) && _catfin1.not_empty()) recsog.put(SOG_CATDON, _catfin1); if ((catdon == _catini2 || _catini2.empty()) && (totdon>=_numdon2) && _catfin2.not_empty() && (!_sttess2 || dimissione)) recsog.put(SOG_CATDON, _catfin2); diff --git a/at/at8600.cpp b/at/at8600.cpp index fadf376e5..c78ecef6e 100755 --- a/at/at8600.cpp +++ b/at/at8600.cpp @@ -243,6 +243,7 @@ bool TCorreggiDC::modifica(TSheet_field& s) s.destroy(); TLocalisamfile donaz(LF_DONAZ); TLocalisamfile soggetti(LF_SOGGETTI); + TRectype r = donaz.curr(); soggetti.setkey(1); donaz.setkey(4); donaz.zero(); @@ -253,18 +254,19 @@ bool TCorreggiDC::modifica(TSheet_field& s) if (_luogodon.not_empty()) donaz.put(DON_LUOGODON, _luogodon); } - TString16 luogodon; + TString16 luogodon, tipodon; + TDate datadon; bool leggi = TRUE; - TRectype r(donaz.curr()); - TRectype rc(donaz.curr()); int items = 0; for(donaz.read(); !donaz.eof(); donaz.next()) { - //if (donaz.curr() != r) break; - if (rc != r) break; - if (_tipodon.empty() && _luogodon.not_empty()) + luogodon = donaz.get(DON_LUOGODON); + tipodon = donaz.get(DON_TIPODON); + datadon = donaz.get(DON_DATADON); + if ((luogodon!=_luogodon) || (tipodon!=_tipodon) || (datadon!=_datadon)) + break; + if (_tipodon.empty()) { - luogodon = donaz.get(DON_LUOGODON); if (luogodon == _luogodon) leggi = TRUE; else @@ -274,13 +276,21 @@ bool TCorreggiDC::modifica(TSheet_field& s) leggi = TRUE; if (leggi) { - rc = donaz.curr(); if (!_nluogodon.blank()) { donaz.put(DON_LUOGODON, _nluogodon); donaz.rewrite(); } } + donaz.zero(); + donaz.put(DON_DATADON, _datadon); + if (_tipodon.not_empty()) + { + donaz.put(DON_TIPODON, _tipodon); + if (_luogodon.not_empty()) + donaz.put(DON_LUOGODON, _luogodon); + } + } return TRUE; } @@ -302,12 +312,13 @@ int TCorreggiDC::read(TSheet_field& s) } TString16 luogodon; bool leggi = TRUE; - TRectype r(donaz.curr()); + const TRectype r(donaz.curr()); int items = 0; - for(donaz.read(); !donaz.eof(); donaz.next()) + for(donaz.read(_isgteq); !donaz.eof(); donaz.next()) { if (donaz.curr() != r) break; - if (_tipodon.empty() && _luogodon.not_empty()) + //if (_tipodon.empty() && _luogodon.not_empty()) + if (_tipodon.empty()) { luogodon = donaz.get(DON_LUOGODON); if (luogodon == _luogodon) @@ -449,60 +460,49 @@ int TCorreggiDC::modifica(TSheet_field& s) } TRectype* rec = new TRectype(LF_DONAZ); rec->put(DON_CODICE, row.get(0)); - rec->put(DON_DATADON, datadonazione); - TString16 tipodon = row.get(4); - if (tipodon.blank()) - tipodon = _tipodon; - rec->put(DON_TIPODON, tipodon); - rec->put(DON_LUOGODON, _luogodon); + rec->put(DON_ETICHETTA, row.get(6)); rec->put(DON_PRIMADON, row.get(7)); rec->put(DON_CODSEZ,sog.get(SOG_CODSEZ)); rec->put(DON_CODSOT,sog.get(SOG_CODSOT)); - bool insert = FALSE; - bool exist = FALSE; - + bool modified = FALSE; + bool found = FALSE; + TString16 tipodon = row.get(4); + if (tipodon.blank()) + tipodon = _tipodon; TRectype* key = new TRectype(LF_DONAZ); key->put(DON_CODICE, row.get(0)); err = _sdonazioni->read(key); if (err == NOERR) { - int r=_sdonazioni->rows(); - while (r>=1 && !insert && !exist) + int r = _sdonazioni->rows(); + while (r>0 && !found) { const TRectype& riga = _sdonazioni->row(r); const TDate d = riga.get(DON_DATADON); - if (datadonazione==d) // esiste gia' una donazione in questa data + if ((datadonazione==d) && (riga.get(DON_TIPODON)== tipodon) && (riga.get(DON_LUOGODON)==_luogodon)) // ho trovato la donazione da modificare { - exist=TRUE; - r=0; + found=TRUE; } - else - if (datadonazione > d) - { - rec->put(DON_PROGDON,r+1); - _sdonazioni->insert_row(rec); - insert=TRUE; - } r--; } - if (!exist && !insert) - { - rec->put(DON_PROGDON,1); - _sdonazioni->insert_row(rec); - } } - else - if (err == _iseof || err == _isemptyfile) - { - rec->put(DON_PROGDON,1); - _sdonazioni->insert_row(rec); - } - if (!exist) - { - err = _sdonazioni->write(TRUE); + if (found) + { + r++; + TRectype& riga = _sdonazioni->row(r); + if (riga.get(DON_DATADON).blank()) + datadonazione = _ndatadon; + if (riga.get(DON_TIPODON).blank()) + tipodon=_ntipodon; + if (riga.get(DON_LUOGODON).blank()) + luogodon=_nluogodon; + riga.put(DON_DATADON, datadonazione); + riga.put(DON_LUOGODON, luogodon); + riga.put(DON_TIPODON, tipodon); + err= _sdonazioni.rewrite(); // controllo se è idoneo bool ctrlsi = FALSE; //devo controllare se è idoneo SI bool ctrlaf = FALSE; //devo controllare se è idoneo AF diff --git a/at/at8600a.uml b/at/at8600a.uml index 80d007d9e..e49327881 100755 --- a/at/at8600a.uml +++ b/at/at8600a.uml @@ -389,7 +389,6 @@ END NUMBER F_S_INTSI 3 0 BEGIN PROMPT 40 12 "Sangue intero " - FLAGS "D" END STRING F_S_DESC_TIPOCON 25 @@ -505,6 +504,7 @@ END DATE F_S_PROSSDATA BEGIN PROMPT 55 13 "Data " + FLAGS "D" HELP "Data controllo" END @@ -535,7 +535,6 @@ END STRING F_S_DESC_PROSSTIPO 25 BEGIN PROMPT 23 13 "" - FLAGS "D" END BUTTON DLG_OK 9 2 diff --git a/at/at_pagin.frm b/at/at_pagin.frm index 16a56242c..040efe008 100755 --- a/at/at_pagin.frm +++ b/at/at_pagin.frm @@ -439,13 +439,14 @@ BEGIN KEY "Modalita' di convocazione" PROMPT 67 19 "" FIELD 90->MODCONV - ITEM " | " - ITEM "PO|Postale" - ITEM "T1|Tel. abitaz." - ITEM "T2|Tel. lavoro" - ITEM "T3|Tel. altro" - ITEM "TE|Telefonica" - ITEM "IN|Indifferente" +#include "modalita.h" +//ITEM " | " +//ITEM "PO|Postale" +//ITEM "T1|Tel. abitaz." +//ITEM "T2|Tel. lavoro" +//ITEM "T3|Tel. altro" +//ITEM "TE|Telefonica" +//ITEM "IN|Indifferente" END STRINGA 52 19 diff --git a/at/atopera.h b/at/atopera.h index 1500208b5..a982f94c5 100755 --- a/at/atopera.h +++ b/at/atopera.h @@ -8,4 +8,8 @@ #define OPE_DATA2 "DATA2" #define OPE_FLAG1 "FLAG1" #define OPE_FLAG2 "FLAG2" +#define OPE_NUMERO1 "NUMERO1" +#define OPE_CODSEZ2 "CODSEZ2" +#define OPE_CODSOT2 "CODSOT2" #define OPE_UTENTE "UTENTE" +#define OPE_TIPOOPE "TIPOOPE" diff --git a/at/batbsez.uml b/at/batbsez.uml index ffd72cb61..312cada31 100755 --- a/at/batbsez.uml +++ b/at/batbsez.uml @@ -305,9 +305,9 @@ BEGIN GROUP 4 END -GROUPBOX DLG_NULL 35 7 +GROUPBOX DLG_NULL 35 6 BEGIN - PROMPT 1 4 "Parametri convocazione" + PROMPT 1 4 "Parametri convoc. per sezione" END NUMBER F_INTMINCONV 4 @@ -337,56 +337,56 @@ BEGIN ITEM "G|dal Giorno" END -DATE F_DATAULTCON -BEGIN - PROMPT 2 9 "Data ultima conv. " - FIELD DATAULTCON - //FLAGS "D" -END - GROUPBOX DLG_NULL 35 7 BEGIN - PROMPT 1 11 "Parametri convocazione BO" + PROMPT 1 10 "Parametri convoc. su punto prelievo" END NUMBER F_GIOCARSOL 3 BEGIN - PROMPT 2 12 "Gio. tra cart. e soll. " + PROMPT 2 11 "Gio. tra cart. e soll. " FIELD GIOCARSOL HELP "Intervallo in giorni tra cartolina e primo sollecito" END NUMBER F_GIOSOLSOL 3 BEGIN - PROMPT 2 13 "Gio. tra soll. e soll. " + PROMPT 2 12 "Gio. tra soll. e soll. " FIELD GIOSOLSOL HELP "Intervallo in giorni tra solleciti" END NUMBER F_GIOULTSOL 3 BEGIN - PROMPT 2 14 "Gio. tra penult. e ult. soll. " + PROMPT 2 13 "Gio. tra penult. e ult. soll. " FIELD GIOULTSOL HELP "Intervallo tra penultimo e ultimo sollecito" END NUMBER F_GIOPERRIT 3 BEGIN - PROMPT 2 15 "Gio. tra chiamate per ritard. " + PROMPT 2 14 "Gio. tra chiamate per ritard. " FIELD GIOPERRIT HELP "Giorni tra le chiamate per ritardatari" END NUMBER F_NUMMAXSOL 2 BEGIN - PROMPT 2 16 "Num. max di solleciti " + PROMPT 2 15 "Num. max di solleciti " FIELD NUMMAXSOL HELP "Numero massimo di solleciti inviabili per soggetto" END +DATE F_DATAULTCON +BEGIN + PROMPT 2 17 "Data ultima conv. " + FIELD DATAULTCON + //FLAGS "D" +END + GROUPBOX DLG_NULL 41 8 BEGIN - PROMPT 37 4 "Parametri per chiusura fine anno" + PROMPT 37 4 "Parametri per chiusura periodica" END NUMBER F_DONEMER 3 diff --git a/at/f115.dir b/at/f115.dir index 9bcb856f4..7a8276269 100755 --- a/at/f115.dir +++ b/at/f115.dir @@ -1,3 +1,3 @@ 115 0 -$convoc|0|0|151|17|Convocazioni AVIS||| +$convoc|1178|1178|151|17|Convocazioni AVIS||| diff --git a/at/f121.dir b/at/f121.dir index abde04a8e..563100206 100755 --- a/at/f121.dir +++ b/at/f121.dir @@ -1,3 +1,3 @@ 121 0 -$atstatd|0|0|53|17|Statistiche donazioni AVIS||| +$atstatd|204|204|53|17|Statistiche donazioni AVIS||| diff --git a/at/f129.dir b/at/f129.dir index b652785c6..e3d536024 100755 --- a/at/f129.dir +++ b/at/f129.dir @@ -1,3 +1,3 @@ 129 0 -$atstats|0|0|30|17|Statistiche soggetti AVIS||| +$atstats|72|72|30|17|Statistiche soggetti AVIS||| diff --git a/at/f130.dir b/at/f130.dir index dfdb37c31..64397f616 100755 --- a/at/f130.dir +++ b/at/f130.dir @@ -1,3 +1,3 @@ 130 0 -$atopera|0|0|40|17|Operazioni AVIS||| +$atopera|53|53|48|17|Operazioni AVIS||| diff --git a/at/f130.trr b/at/f130.trr index f02caaac8..cf2e9b57c 100755 --- a/at/f130.trr +++ b/at/f130.trr @@ -1,14 +1,19 @@ 130 -9 +13 PROGOPE|3|5|0|Progressivo operazione CODSEZ|1|2|0|Sezione CODSOT|1|2|0|Sottogruppo GRUPPOAZIE|1|4|0|Gruppo aziendale -DATA1|5|8|0|Data 1 (per benemerenze: data elaborazione) -DATA2|5|8|0|Data 2 (per benemerenze: data prevista consegna) -FLAG1|8|1|0|Flag 1 (per benemerenze: includi sogg. appartenti a gruppi az.) -FLAG2|8|1|0|Flag 2 (per benemerenze: attribuzione fatta dai gruppi az.) +DATA1|5|8|0|Data 1 (per B: data elaborazione, per T/S: data del giorno) +DATA2|5|8|0|Data 2 (per B: data prevista consegna, per T: ult.don. successiva al) +FLAG1|8|1|0|Flag 1 (per B: includi sogg. appartenti a gruppi az.) +FLAG2|8|1|0|Flag 2 (per B: attribuzione fatta dai gruppi az.) +CODSEZ2|1|2|0|Sezione finale +CODSOT2|1|2|0|Sottogruppo finale +NUMERO1|2|3|0|Numero 1 (per T: numero minimo don.) UTENTE|1|8|0|Utente che ha registrato l'operazione -2 +TIPOOPE|1|1|0|Tipo operazione (B=benemerenze, T=tessere complessive, S=tessere singole) +3 PROGOPE| CODSEZ+CODSOT+DATA1|X +DATA1+CODSEZ+CODSOT|X diff --git a/at/f90.dir b/at/f90.dir index 45e027798..c5521515b 100755 --- a/at/f90.dir +++ b/at/f90.dir @@ -1,3 +1,3 @@ 90 0 -$soggetti|0|0|676|17|Soggetti AVIS||| +$soggetti|0|16342|676|17|Soggetti AVIS|||