diff --git a/at/atlib1.cpp b/at/atlib1.cpp index e7e4757d2..cc788ca72 100755 --- a/at/atlib1.cpp +++ b/at/atlib1.cpp @@ -146,7 +146,8 @@ void con_reord(TRectype& soggetto, TRecord_array* controlli, TRecord_array* idon { soggetto.put(SOG_STATOSI, tipo); soggetto.put(SOG_DATASI, dataultstato); - if (prosstipo == "FS") + //if (prosstipo == "FS") + if (modstato_tcs(prosstipo)=='F') soggetto.put(SOG_FINESOSSI, prossdata); else soggetto.put(SOG_FINESOSSI, datanulla); @@ -161,7 +162,8 @@ void con_reord(TRectype& soggetto, TRecord_array* controlli, TRecord_array* idon { soggetto.put(SOG_STATOAF, tipo); soggetto.put(SOG_DATAAF, dataultstato); - if (prosstipo == "FS") + //if (prosstipo == "FS") + if (modstato_tcs(prosstipo)=='F') soggetto.put(SOG_FINESOSAF, prossdata); else soggetto.put(SOG_FINESOSAF, datanulla); @@ -245,13 +247,18 @@ void con_reord(TRectype& soggetto, TRecord_array* controlli, TRecord_array* idon { TString16 stato = soggetto.get(SOG_STATO); char modstato = modstato_tcs(stato); - if ((statosi == IDONEITA) || (statoaf == IDONEITA)) + const char tipostatosi = modstato_tcs(statosi); + const char tipostatoaf = modstato_tcs(statoaf); + //if ((statosi == IDONEITA) || (statoaf == IDONEITA)) + if ((tipostatosi == 'I') || (tipostatoaf == 'I')) if ((modstato != 'I') || (modstato != 'F')) stato = IDONEITA; //if ((statosi == SOSPENSIONE || statosi.empty()) && (statoaf == SOSPENSIONE || statoaf.empty())) - if ((statosi == SOSPENSIONE) && (statoaf == SOSPENSIONE)) + //if ((statosi == SOSPENSIONE) && (statoaf == SOSPENSIONE)) + if ((tipostatosi == 'S') && (tipostatoaf == 'S')) if (modstato != 'S') - stato = SOSPENSIONE; + //stato = SOSPENSIONE; + stato == statosi; char statocalcolato = modstato_tcs(stato); if (modstato != statocalcolato) { @@ -372,18 +379,25 @@ void don_datepross(TRectype& soggetto) } TString16 statoparziale; TDate datastatoparziale; + char tipostato; statoparziale = soggetto.get(SOG_STATOSI); datastatoparziale = soggetto.get_date(SOG_DATASI); - if (statoparziale == SOSPENSIONE) + tipostato = modstato_tcs(statoparziale); + //if (statoparziale == SOSPENSIONE) + if (tipostato == 'S') datasi = NULLDATE; - if (statoparziale == IDONEITA) + //if (statoparziale == IDONEITA) + if (tipostato == 'I') if (datastatoparziale > datasi) datasi = datastatoparziale; statoparziale = soggetto.get(SOG_STATOAF); datastatoparziale = soggetto.get_date(SOG_DATAAF); - if (statoparziale == SOSPENSIONE) + tipostato = modstato_tcs(statoparziale); + //if (statoparziale == SOSPENSIONE) + if (tipostato == 'S') dataaf = NULLDATE; - if (statoparziale == IDONEITA) + //if (statoparziale == IDONEITA) + if (tipostato = 'I') if (datastatoparziale > dataaf) dataaf = datastatoparziale; soggetto.put(SOG_DATAPROSSI,datasi);