Patch level : 12.0 874

Files correlati     : f9.exe, f90100.sql
Commento            :
- Pulizia codice
- Eliminazione record movimento nella lista di controllo errori (eliminazione da db)
- Cambiato sistema di fetch numero ultima estrazione del giorno
- Cambiato ordinamento visualizzazione pacchetti in ordine decr. di data
- Sistemata query controllo sovrapposizione periodi per definitivo
- Aggiunti messaggi di errore in caso di fallimento creazione/aggiornam. tabelle
This commit is contained in:
Simone Palacino 2019-09-17 16:12:08 +02:00
parent 80c9af27e4
commit a21d4897dd

View File

@ -980,10 +980,22 @@ TString TF9_app::next_estr_today(const char tipo) const
"FROM " F9_DRD "\n"
"WHERE " DRD_ID_EST " LIKE '" << today.date2ansi() << tipo << "%'\n" <<
"ORDER BY " DRD_ID_EST " DESC";
if(!db().sq_set_exec(query))
fatal_box(db().sq_get_text_error());
db().sq_set_exec(query);
const int last_estr = db().sq_items() > 0 ? real(db().sq_get("IDESTR").ltrim(10)).integer() : -1;
if (last_estr < -1 || last_estr == 99999999)
{
ofstream fout; fout.open("f9err_nextestr.txt");
if (fout.is_open())
{
fout << "Errore progressivo nuova estrazione!\n" << today << "\nn:" << last_estr << "\n" << query << "\n";
fout.close();
}
TString msg;
fatal_box(msg << "database error: progressivo nuova estrazione. Ultima estrazione: " << last_estr);
}
const int last_estr = real(db().sq_get("IDESTR").ltrim(10)).integer();
sprintf_s(estr, 9, "%08d", last_estr + 1);
return estr;
}
@ -996,8 +1008,7 @@ bool TF9_app::check_periodo_def(const drd& head)
query << "SELECT *\nFROM F9DRD00K\n" <<
"WHERE " << DRD_DATAA << " >= '" << head.dal.date2ansi() << "' AND " DRD_DATADA " <= '" << head.al.date2ansi() << "' AND "
DRD_FLAG_PD " = 'D' AND\n " DRD_STATO " <> '" D_GEST_ERR "' AND " DRD_STATO " <> '" D_WA_ERR "' AND " DRD_STATO " <> '" D_ERR_SOS "' AND " DRD_TIPODOC " = '" << head.tipo_doc << "';";
if (!db().sq_set_exec(query))
fatal_box(db().sq_get_text_error());
db().sq_set_exec(query);
return db().sq_items() == 0;
}