Patch level : 12.0 986
Files correlati : f90.exe Commento : - Modifica creazione query per creazione prospetto integrativo: aggiunti doppi apici. - Aggiunta possibilita' di salvare messaggio di errore in sqlite.
This commit is contained in:
parent
d0734d97e8
commit
cb5a7ffe65
@ -512,6 +512,8 @@ public:
|
||||
|
||||
class TProspetto_recset final : public TSQL_recordset
|
||||
{
|
||||
TString _query;
|
||||
|
||||
TString* _numreg;
|
||||
TString* _today;
|
||||
TString* _ragsoc;
|
||||
@ -545,6 +547,7 @@ class TProspetto_recset final : public TSQL_recordset
|
||||
void precarica_tabelle();
|
||||
|
||||
public:
|
||||
const TString& get_query() const { return _query; }
|
||||
static void get_sum_imponibile_imposta(const char* numreg_ven, real& s_imponibili, real& s_imposte);
|
||||
|
||||
TProspetto_recset(const char* numreg_acq, const char* numreg_ven);
|
||||
|
@ -1113,6 +1113,11 @@ TEstrazione::TEstrazione(const TString& ambiente, const bool flag_prov, const ch
|
||||
_escluso = escluso;
|
||||
_error_sql = new ofstream;
|
||||
_error_sql->open("f9_TEstrazione_error_sql.txt");
|
||||
|
||||
// Svuoto log.
|
||||
FILE* f = fopen("TF9Prospetto_integr_error.txt", "w");
|
||||
fwrite("\n", sizeof(char), 1, f);
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
|
||||
|
@ -519,6 +519,7 @@ TProspetto_recset::TProspetto_recset(const char* numreg_acq, const char* numreg_
|
||||
"JOIN TABCOM\n"
|
||||
"ON COD = 'IVA' AND CODTAB = B.CODIVA";
|
||||
|
||||
_query = sql;
|
||||
set(sql);
|
||||
}
|
||||
|
||||
@ -596,18 +597,27 @@ bool TF9Prospetto_integr::operator()(const char* numreg_acq, const char* numreg_
|
||||
TProspetto_recset* _prosp_rs = new TProspetto_recset(numreg_acq, numreg_ven);
|
||||
|
||||
_items = _prosp_rs->items();
|
||||
if (_items > 0)
|
||||
if (_items == 0)
|
||||
{
|
||||
FILE* log = fopen("TF9Prospetto_integr_error.txt", "a");
|
||||
if (!_prosp_rs->last_exec())
|
||||
{
|
||||
ofstream fout("TF9Prospetto_integr_error.txt");
|
||||
fout << _prosp_rs->get_err_msg();
|
||||
fout.close();
|
||||
if (log != nullptr)
|
||||
{
|
||||
TString msg("\n"); msg << _prosp_rs->get_err_msg() << "\n";
|
||||
fwrite((const char*)msg, sizeof(char), msg.len(), log);
|
||||
}
|
||||
fclose(log);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (log != nullptr)
|
||||
{
|
||||
TString msg("\n"); msg << _prosp_rs->get_query() << "\n - Nessun record trovato!\n\n";
|
||||
fwrite(msg, sizeof(char), msg.len(), log);
|
||||
}
|
||||
fclose(log);
|
||||
return false;
|
||||
}
|
||||
|
||||
_rep.set_recordset(_prosp_rs);
|
||||
_book.add(_rep);
|
||||
|
Loading…
x
Reference in New Issue
Block a user