Patch level : 12.0 984

Files correlati     : f90.exe
Commento            :
- Corretta query per fppro.
- Corretta query per check ultimo id estrazione.
This commit is contained in:
Simone Palacino 2020-07-28 17:32:40 +02:00
parent b57dd59e8f
commit 52fc0be3d7
2 changed files with 5 additions and 5 deletions

View File

@ -472,7 +472,7 @@ void TMonitor_mask::delete_pack(const bool all) const
void TMonitor_mask::fill() const
{
TString query;
query << "SELECT * FROM F9DRD00K WHERE " DRD_CODSOC " = '" << F9CONF.get_ambiente() << "' ORDER BY " << DRD_TIME << " DESC;";
query << "SELECT * FROM " F9_DRD " WHERE " DRD_CODSOC " = '" << F9CONF.get_ambiente() << "' ORDER BY " << DRD_TIME << " DESC;";
fp_db().sq_set_exec(query, false);
TSheet_field& sf = sfield(S_ELAB);

View File

@ -538,14 +538,14 @@ TString TEstrazione::next_estr_today(char tipo) const
{
char estr[] = { 0,0,0,0,0,0,0,0,0 };
TString query;
query << "SELECT TOP 1 " DRD_ID_EST " AS IDESTR\n"
query << "SELECT TOP 1 SUBSTRING(" DRD_ID_EST ", 11, 8) AS IDESTR\n"
"FROM " F9_DRD "\n"
"WHERE " DRD_CODSOC " = '" << _head.cod_soc << "' AND\n"
DRD_ID_EST " LIKE '" << today.date2ansi() << "%'\n" <<
"ORDER BY " DRD_ID_EST " DESC";
DRD_ID_EST " LIKE '" << today.date2ansi() << "%'\n"
"ORDER BY IDESTR DESC";
fp_db().sq_set_exec(query);
const int last_estr = fp_db().sq_items() > 0 ? real(fp_db().sq_get("IDESTR").ltrim(10)).integer() : -1;
const int last_estr = fp_db().sq_items() > 0 ? real(fp_db().sq_get("IDESTR")).integer() : -1;
if (last_estr < -1 || last_estr == 99999999)
{