diff --git a/at/at0700.cpp b/at/at0700.cpp index 1e2fe27a7..353cbc010 100755 --- a/at/at0700.cpp +++ b/at/at0700.cpp @@ -10,6 +10,7 @@ #include "atlib.h" #define ALIAS_TCS 200 +#define ALIAS_CTD 700 #define FINE_SOSPENSIONE "FS" // nomi campi maschera @@ -35,7 +36,7 @@ class TSbloccoSospesi : public TPrintapp TDate _data_stampa; TString16 _tiposo; // tipo sospesione da sbloccare TString16 _codsez, _codsot; - bool _definitiva; + bool _definitiva, _anchedimessi; TParagraph_string _cognome_nome, _operazione; TString16 _finesospensione; @@ -259,52 +260,31 @@ void TSbloccoSospesi::set_page(int file, int cnt) bool TSbloccoSospesi::filter_func_sbloccosospesi(const TRelation* rel) { - bool filtrato = FALSE; + bool filtrato = TRUE; TRectype& recsog = rel->lfile().curr(); - const TString16 stato = recsog.get(SOG_STATO); - const TString16 statopros = recsog.get(SOG_PROS_STATO); - const TString16 statosi = recsog.get(SOG_STATOSI); - const TString16 statoaf = recsog.get(SOG_STATOAF); - - TDate datafine(NULLDATE); - if (statopros == "FS") - datafine = recsog.get_date(SOG_DATA_PROS); - TDate datafinesi(NULLDATE); - TDate datafineaf(NULLDATE); - if (statosi == "SO") - datafinesi = recsog.get_date(SOG_FINESOSSI); - if (statoaf == "SO") - datafineaf = recsog.get_date(SOG_FINESOSAF); - filtrato = (datafine.ok()) && (datafine <= app()._data_sblocco); - if ((!filtrato) && (datafinesi.ok() || datafineaf.ok())) - filtrato = ((datafinesi.ok() && (datafinesi <= app()._data_sblocco)) || (datafineaf.ok() && (datafineaf <= app()._data_sblocco))); - - /* - TRectype* key = new TRectype(LF_CONTSAN); - long codice = recsog.get_long(SOG_CODICE); - key->put(CON_CODICE, codice); - int err = app()._scontrolli->read(key); - if (err == NOERR) - { - TString16 stato = recsog.get(SOG_STATO); - TDate datastato = recsog.get(SOG_DATASTATO); - for (int r=1; r<=app()._scontrolli->rows(); r++) - { - const TRectype& riga = app()._scontrolli->row(r); - TString16 tipo = riga.get(CON_TIPOCON); - TDate datatipo = riga.get(CON_DATACON); - if (tipo == stato && datatipo == datastato) - { - TString16 prosstipo = riga.get(CON_PROSSTIPO); - if (modstato_tcs(prosstipo) == 'F') - { - TDate datafine = riga.get(CON_PROSSDATA); - filtrato = (datafine.ok()) && (datafine <= app()._data_sblocco); - } - } - } - } - */ + if (!app()._anchedimessi) + filtrato = !(rel->lfile(-ALIAS_CTD).get_bool("B0")); + if (filtrato) + { + filtrato = FALSE; + const TString16 stato = recsog.get(SOG_STATO); + const TString16 statopros = recsog.get(SOG_PROS_STATO); + const TString16 statosi = recsog.get(SOG_STATOSI); + const TString16 statoaf = recsog.get(SOG_STATOAF); + + TDate datafine(NULLDATE); + if (statopros == "FS") + datafine = recsog.get_date(SOG_DATA_PROS); + TDate datafinesi(NULLDATE); + TDate datafineaf(NULLDATE); + if (statosi == "SO") + datafinesi = recsog.get_date(SOG_FINESOSSI); + if (statoaf == "SO") + datafineaf = recsog.get_date(SOG_FINESOSAF); + filtrato = (datafine.ok()) && (datafine <= app()._data_sblocco); + if ((!filtrato) && (datafinesi.ok() || datafineaf.ok())) + filtrato = ((datafinesi.ok() && (datafinesi <= app()._data_sblocco)) || (datafineaf.ok() && (datafineaf <= app()._data_sblocco))); + } return filtrato; } @@ -340,7 +320,7 @@ bool TSbloccoSospesi::set_print(int) _data_sblocco = _msk->get(F_DATA); _tiposo = _msk->get(F_TIPO); _definitiva = _msk->get_bool(F_DEFINITIVA); - + _anchedimessi = _msk->get_bool(F_ANCHEDIMESSI); _contatore = 0; _totale = 0; reset_files(); @@ -349,10 +329,10 @@ bool TSbloccoSospesi::set_print(int) // filtro per tipo sospensione TString256 filtro = ""; if (_tiposo.not_empty()) - filtro.format("((STATO == \"%s\") && (PROS_STATO == \"FS\"))",(const char*)_tiposo); + filtro.format("(((STATO == \"%s\") && (PROS_STATO == \"FS\"))",(const char*)_tiposo); else - filtro << "((TCS->S6 == \"S\") && (PROS_STATO == \"FS\"))"; - filtro << " || (STATOSI == \"SO\") || (STATOAF == \"SO\")"; + filtro << "(((TCS->S6 == \"S\") && (PROS_STATO == \"FS\"))"; + filtro << " || (STATOSI == \"SO\") || (STATOAF == \"SO\"))"; current_cursor()->setfilter(filtro, TRUE); current_cursor()->set_filterfunction(filter_func_sbloccosospesi,TRUE); reset_print(); @@ -398,6 +378,7 @@ bool TSbloccoSospesi::user_create() _rel = new TRelation(LF_SOGGETTI); _rel->add(LF_SEZIONI,"CODSEZ==CODSEZ|CODSOT==CODSOT"); _rel->add("TCS", "CODTAB==STATO",1,0,ALIAS_TCS); + _rel->add("CTD", "CODTAB==CATDON",1,0,ALIAS_CTD); //cursore ordinamento per sezione+sottogruppo+cognome+nome _cur = add_cursor(new TCursor(_rel, "", 3)); _contsan = new TLocalisamfile(LF_CONTSAN); diff --git a/at/at0700a.h b/at/at0700a.h index 1e2143a43..e9c503270 100755 --- a/at/at0700a.h +++ b/at/at0700a.h @@ -1,15 +1,16 @@ // sblocco sospesi // definizione campi per maschera di selezione -#define F_SEZINI 101 -#define F_D_SEZINI 102 -#define F_SOTINI 103 -#define F_D_SOTINI 104 -#define F_SEZFIN 105 -#define F_D_SEZFIN 106 -#define F_SOTFIN 107 -#define F_D_SOTFIN 108 -#define F_DATA 109 -#define F_TIPO 110 -#define F_D_TIPO 111 -#define F_DEFINITIVA 112 +#define F_SEZINI 101 +#define F_D_SEZINI 102 +#define F_SOTINI 103 +#define F_D_SOTINI 104 +#define F_SEZFIN 105 +#define F_D_SEZFIN 106 +#define F_SOTFIN 107 +#define F_D_SOTFIN 108 +#define F_DATA 109 +#define F_TIPO 110 +#define F_D_TIPO 111 +#define F_ANCHEDIMESSI 112 +#define F_DEFINITIVA 113 diff --git a/at/at0700a.uml b/at/at0700a.uml index 1623695bb..c84f6fb41 100755 --- a/at/at0700a.uml +++ b/at/at0700a.uml @@ -132,7 +132,7 @@ BEGIN HELP "Sottogruppo finale" END -GROUPBOX DLG_NULL 77 5 +GROUPBOX DLG_NULL 77 6 BEGIN PROMPT 1 5 "Opzioni per lo sblocco" END @@ -165,9 +165,15 @@ BEGIN FLAGS "D" END +BOOLEAN F_ANCHEDIMESSI +BEGIN + PROMPT 2 8 "Sblocco anche per categorie di dimissione" + HELP "Indicare se si vogliono sbloccare i soggetti con categoria di dimissione" +END + BOOLEAN F_DEFINITIVA BEGIN - PROMPT 2 8 "Sblocco definitivo" + PROMPT 2 9 "Sblocco definitivo" HELP "Se sblocco definitivo, i soggetti stampati vengono sbloccati" END