diff --git a/at/at0700.cpp b/at/at0700.cpp index 17263ee3a..5e4874079 100755 --- a/at/at0700.cpp +++ b/at/at0700.cpp @@ -161,9 +161,17 @@ bool TSbloccoSospesi::preprocess_page(int file, int counter) TDate datafinesi(NULLDATE); TDate datafineaf(NULLDATE); if (statosi == "SO") - datafinesi = recsog.get_date(SOG_FINESOSSI); + { + datafinesi = recsog.get_date(SOG_FINESOSSI); + if ((datafine == datafinesi) && (stato == statosi) && (pros_stato != FINE_SOSPENSIONE)) + datafinesi = NULLDATE; + } if (statoaf == "SO") + { 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) @@ -398,10 +406,19 @@ bool TSbloccoSospesi::filter_func_sbloccosospesi(const TRelation* rel) datafine = recsog.get_date(SOG_DATA_PROS); TDate datafinesi(NULLDATE); TDate datafineaf(NULLDATE); - if (statosi == "SO") - datafinesi = recsog.get_date(SOG_FINESOSSI); + if (statosi == "SO") + { + datafinesi = recsog.get_date(SOG_FINESOSSI); + if ((stato == statosi) && (statopros != FINE_SOSPENSIONE)) + datafinesi = NULLDATE; + } + if (statoaf == "SO") + { datafineaf = recsog.get_date(SOG_FINESOSAF); + if ((stato == statoaf) && (statopros != FINE_SOSPENSIONE)) + datafineaf = NULLDATE; + } filtrato = (datafine.ok()) && (datafine <= app()._data_sblocco) && (statopros == FINE_SOSPENSIONE); if ((!filtrato) && (datafinesi.ok() || datafineaf.ok())) filtrato = ((datafinesi.ok() && (datafinesi <= app()._data_sblocco)) || (datafineaf.ok() && (datafineaf <= app()._data_sblocco)));