diff --git a/at/at2900.cpp b/at/at2900.cpp index a2c616daf..fdf26d19d 100755 --- a/at/at2900.cpp +++ b/at/at2900.cpp @@ -55,7 +55,7 @@ class TFrequenza : public TPrintapp int _etlarghezza, _etcolonne; bool _stampa80, _ctrltotale; int _contatore, _totale; - char _condizione; + char _condizione, _sesso; protected: virtual bool user_create(); @@ -170,12 +170,18 @@ bool TFrequenza::filter_func_freq(const TRelation* rel) { bool filtrato = TRUE; TLocalisamfile& sog = rel->lfile(); + // filtro per sesso + if (app()._sesso != 'I') + filtrato = (sog.get(SOG_SESSO)[0] == app()._sesso); // filtro per categorie - TAssoc_array& categorie = app()._categorie; - if (categorie.items() != 0) + if (filtrato) { - const TString16 cat = sog.get(SOG_CATDON); - filtrato = categorie.is_key((const char*) cat); + TAssoc_array& categorie = app()._categorie; + if (categorie.items() != 0) + { + const TString16 cat = sog.get(SOG_CATDON); + filtrato = categorie.is_key((const char*) cat); + } } // filtro per numero donazioni nel periodo if (filtrato) @@ -452,6 +458,19 @@ bool TFrequenza::set_print(int m) _categorie.add((const char*) catqui); if (catses.not_empty()) _categorie.add((const char*) catses); + _sesso = _msk->get(F_SESSO)[0]; + const char ordina = _msk->get(F_ORDINA)[0]; + TString256 chiave = ""; + switch (ordina) + { + case 'A': + chiave << "90->CODSEZ|90->CODSOT|UPPER(90->COGNOME)|UPPER(90->NOME)"; + break; + case 'C': + chiave << "90->DOM_CAP|UPPER(90->COGNOME)|UPPER(90->NOME)"; + break; + } + ((TSorted_cursor*) current_cursor())->change_order(chiave); current_cursor()->set_filterfunction (filter_func_freq); reset_print(); printer().footerlen(0); @@ -538,7 +557,7 @@ bool TFrequenza::user_create() _rel->add("LCP", "CODTAB==DOM_CODLOC",1,0,ALIAS_LCPDOM); _rel->add(LF_COMUNI, "COM==DOM_CODCOM"); _rel->add(LF_SEZIONI, "CODSEZ==CODSEZ|CODSOT==CODSOT"); - _cur = add_cursor(new TCursor(_rel, "", 3)); + add_cursor(new TSorted_cursor(_rel, "", "", 3)); _msk = new TMask("at2900a"); _file = new TExternisamfile("$file"); _donaz = new TLocalisamfile(LF_DONAZ); diff --git a/at/at2900a.h b/at/at2900a.h index b62d66257..06d51720a 100755 --- a/at/at2900a.h +++ b/at/at2900a.h @@ -38,7 +38,8 @@ #define F_TIPODON5 313 #define F_D_TIPODON5 314 -#define F_ORDINA 351 +#define F_SESSO 351 +#define F_ORDINA 352 #define F_ELENCO 401 #define F_ETICHETTE 402 diff --git a/at/at2900a.uml b/at/at2900a.uml index 50575afbe..38ef9f3bb 100755 --- a/at/at2900a.uml +++ b/at/at2900a.uml @@ -270,7 +270,7 @@ BEGIN FLAGS "D" END -GROUPBOX DLG_NULL 77 8 +GROUPBOX DLG_NULL 77 11 BEGIN PROMPT 1 10 "Opzioni di elaborazione" END @@ -394,9 +394,17 @@ BEGIN FLAGS "D" END +LISTBOX F_SESSO 12 +BEGIN + PROMPT 2 17 "Sesso " + ITEM "I|Indifferente" + ITEM "1|Maschi" + ITEM "2|Femmine" +END + LISTBOX F_ORDINA 10 BEGIN - PROMPT 2 17 "Ordinamento per sez./sott. e " + PROMPT 2 18 "Ordinamento per sez./sott. e " ITEM "A|Alfabetico" ITEM "C|Cap" END