diff --git a/at/at0700.cpp b/at/at0700.cpp index 56d86e79e..ce265f277 100755 --- a/at/at0700.cpp +++ b/at/at0700.cpp @@ -161,36 +161,40 @@ bool TSbloccoSospesi::preprocess_page(int file, int counter) const TDate datafine = recsog.get_date(SOG_DATA_PROS); TDate datafinesi(NULLDATE); TDate datafineaf(NULLDATE); - if (statosi == "SO") + if (statosi == SOSPENSIONE) { datafinesi = recsog.get_date(SOG_FINESOSSI); if ((datafine == datafinesi) && (stato == statosi) && (pros_stato != FINE_SOSPENSIONE)) datafinesi = NULLDATE; } - if (statoaf == "SO") + if (statoaf == SOSPENSIONE) { datafineaf = recsog.get_date(SOG_FINESOSAF); if ((datafine == datafineaf) && (stato == statoaf) && (pros_stato != FINE_SOSPENSIONE)) datafineaf = NULLDATE; } TString80 operazione = ""; - - if (stato=="SO" && pros_stato==FINE_SOSPENSIONE && datafine.ok() && datafine<=app()._data_sblocco) + TString80 motivo = reccon.get(CON_MOTIVO); + if (current_cursor()->curr(-ALIAS_TCS).get("S6") == "S" && pros_stato==FINE_SOSPENSIONE && datafine.ok() && datafine<=app()._data_sblocco) { const TDate datastato = recsog.get_date(SOG_DATASTATO); - operazione.format("%s %s %4s -- -- -- SO FS", datastato.string(), datafine.string(), (const char*) reccon.get(CON_MOTIVO)); + operazione << datastato.string(); + operazione << ' '; + operazione << datafine.string(); + operazione << ' '; + operazione << format("%4s -- -- -- %2s %2s", (const char*) motivo, (const char*) stato, (const char*) pros_stato); } else - if (statosi == "SO" && datafinesi.ok() && datafinesi <= app()._data_sblocco) + if (statosi == SOSPENSIONE && datafinesi.ok() && datafinesi <= app()._data_sblocco) { const TDate datastato = recsog.get_date(SOG_DATASI); - operazione.format("%s %s %4s SI SO ID", datastato.string(), datafinesi.string(), (const char*)reccon.get(CON_MOTIVO)); + operazione.format("%s %s %4s SI SO ID", datastato.string(), datafinesi.string(), (const char*) motivo); } else - if (statoaf == "SO" && datafineaf.ok() && datafineaf <= app()._data_sblocco) + if (statoaf == SOSPENSIONE && datafineaf.ok() && datafineaf <= app()._data_sblocco) { const TDate datastato = recsog.get_date(SOG_DATAAF); - operazione.format("%s %s %4s AF SO ID", datastato.string(), datafineaf.string(), (const char*)reccon.get(CON_MOTIVO)); + operazione.format("%s %s %4s AF SO ID", datastato.string(), datafineaf.string(), (const char*) motivo); } TDate datarif = app()._data_sblocco; datarif.set_year(datarif.year()-2); @@ -214,7 +218,7 @@ bool TSbloccoSospesi::preprocess_page(int file, int counter) _operazione = operazione; if (_definitiva) { - if (stato == "SO" && datafine.ok() && datafine <= app()._data_sblocco) + if (current_cursor()->curr(-ALIAS_TCS).get("S6") == "S" && datafine.ok() && datafine <= app()._data_sblocco) { TRectype* key = new TRectype(LF_CONTSAN); long codice = recsog.get_long(SOG_CODICE); @@ -242,7 +246,7 @@ bool TSbloccoSospesi::preprocess_page(int file, int counter) recsog.put(SOG_NUMCONV,0); //current_cursor()->file().rewrite(); } - if ((statosi == "SO" && datafinesi.ok() && datafinesi <= app()._data_sblocco) || (statoaf == "SO" && datafineaf.ok() && datafineaf <= app()._data_sblocco)) + if ((statosi == SOSPENSIONE && datafinesi.ok() && datafinesi <= app()._data_sblocco) || (statoaf == SOSPENSIONE && datafineaf.ok() && datafineaf <= app()._data_sblocco)) { TRectype* key = new TRectype(LF_IDONEITA); long codice = recsog.get_long(SOG_CODICE); @@ -254,7 +258,7 @@ bool TSbloccoSospesi::preprocess_page(int file, int counter) TRectype* key1 = new TRectype(LF_CONTSAN); key1->put(CON_CODICE, codice); err = _scontrolli->read(key1); - if (statosi == "SO" && datafinesi.ok() && datafinesi <= app()._data_sblocco) + if (statosi == SOSPENSIONE && datafinesi.ok() && datafinesi <= app()._data_sblocco) { int progido = _sidoneita->rows()+1; TRectype& recido = _idoneita->curr(); @@ -289,7 +293,7 @@ bool TSbloccoSospesi::preprocess_page(int file, int counter) recsog.put(SOG_DATAULTSOL,NULLDATE); recsog.put(SOG_NUMCONV,0); } - if (statoaf == "SO" && datafineaf.ok() && datafineaf <= app()._data_sblocco) + if (statoaf == SOSPENSIONE && datafineaf.ok() && datafineaf <= app()._data_sblocco) { int progido = _sidoneita->rows()+1; TRectype& recido = _idoneita->curr(); @@ -401,14 +405,14 @@ bool TSbloccoSospesi::filter_func_sbloccosospesi(const TRelation* rel) datafine = recsog.get_date(SOG_DATA_PROS); TDate datafinesi(NULLDATE); TDate datafineaf(NULLDATE); - if (statosi == "SO") + if (statosi == SOSPENSIONE) { datafinesi = recsog.get_date(SOG_FINESOSSI); if ((stato == statosi) && (statopros != FINE_SOSPENSIONE)) datafinesi = NULLDATE; } - if (statoaf == "SO") + if (statoaf == SOSPENSIONE) { datafineaf = recsog.get_date(SOG_FINESOSAF); if ((stato == statoaf) && (statopros != FINE_SOSPENSIONE)) @@ -524,7 +528,7 @@ bool TSbloccoSospesi::user_create() _msk = new TMask("at0700a"); _msk->set_handler(F_DATA,data_handler); _rel = new TRelation(LF_SOGGETTI); - _rel->add(LF_CONTSAN,"CODICE==CODICE|DATACON==DATASTATO"); + _rel->add(LF_CONTSAN,"DATACON==DATASTATO|CODICE==CODICE", 2); _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);