diff --git a/at/at4500.cpp b/at/at4500.cpp index e24d80d2a..1135ee467 100755 --- a/at/at4500.cpp +++ b/at/at4500.cpp @@ -260,9 +260,8 @@ bool TStampaTessere::preprocess_page(int file, int counter) if (_aggiorna) { sogg.put(SOG_T_STAMPATA,TRUE); - int totdon = sogg.get_int(SOG_TOTDON); TString16 catdon = sogg.get(SOG_CATDON); - if ((totdon >= _numdon2) && (catdon == _catini2)) + if ((totdon >= _numdon2) && (catdon == _catini2) && _sttess2) sogg.put(SOG_CATDON, _catfin2); sogg.rewrite(); } diff --git a/at/at4600.cpp b/at/at4600.cpp index 9d752c183..5bf85d8d3 100755 --- a/at/at4600.cpp +++ b/at/at4600.cpp @@ -46,6 +46,9 @@ class TStampaTessereS : public TPrintapp ts _tipostampa; TString _riepilogodon; int _totfinestampa; + bool _sttess2; + int _numdon2; + TString16 _catini2, _catfin2; protected: virtual bool user_create(); @@ -168,11 +171,24 @@ bool TStampaTessereS::preprocess_page(int file, int counter) _riepilogodon << totdon; } if (_aggiorna) - { - sogg.put(SOG_T_STAMPATA,TRUE); - sogg.rewrite(); + { + // se non faccio cosi' non mi registra le variazioni!!!! + // provato come in at4500.cpp ma non va + // forse perche' la relazione e' su un'altro file principale???? + TLocalisamfile filesogg(LF_SOGGETTI); + filesogg.setkey(1); + filesogg.zero(); + filesogg.put(SOG_CODICE, sogg.get_long(SOG_CODICE)); + if (filesogg.read() == NOERR) + { + filesogg.put(SOG_T_STAMPATA,TRUE); + TString16 catdon = filesogg.get(SOG_CATDON); + const int totdon = filesogg.get_int(SOG_TOTDON); + if ((totdon >= _numdon2) && (catdon == _catini2) && _sttess2) + filesogg.put(SOG_CATDON, _catfin2); + filesogg.rewrite(); + } } - //current_cursor()->file().remove(); } else _totfinestampa++; @@ -317,6 +333,11 @@ bool TStampaTessereS::user_create() //cursore ordinamento per sezione+sottogruppo+cognome+nome _cur = add_cursor(new TCursor(_rel, "", 3)); _msk = new TMask("at4600a"); + TConfig config(CONFIG_STUDIO); + _numdon2 = config.get_int("NumDon2"); + _catini2 = config.get("CatIni2"); + _catfin2 = config.get("CatFin2"); + _sttess2 = config.get_bool("StTess2"); _form_pag = new TTessereS_form("ATTESSER"); TSheet_field& ss = (TSheet_field&)_msk->field(F_SOGGETTI); add_rows_soggetti(ss,50);