Merge branch 'R_10_00' of http://10.65.20.17:7990/scm/campo/campo into R_10_00

This commit is contained in:
Sirio Builder 2018-10-08 17:45:48 +02:00
commit 0e7eaf51fd
4 changed files with 17 additions and 3413 deletions

File diff suppressed because it is too large Load Diff

View File

@ -177,7 +177,7 @@ void TPA_mask::fill()
bool sent = false;
if (chiave_paf(doc, hfatt, bfatt))
{
if (paf0100f.search(nullptr, hfatt, bfatt))
if (paf0100f.search(nullptr, hfatt, bfatt) && paf0100f.sq_get("P1_GESTIONE") != " " && paf0100f.sq_get("P1_ERRINT") != "*")
{
if (paf0100f.sq_get("P1_GESTIONE") != filter_selected)
continue;

File diff suppressed because it is too large Load Diff

View File

@ -375,7 +375,12 @@ TString& TPaf_record::remove_string()
query << fld << '=' << var2str(fld, var);
}
}
CHECKS(nkf >= 2, "Can't remove partial key on table ", static_cast<const char*>(_table));
// Faccio un triccheballacche per mettere il progressivo non vuoto
TString prefix = _key.get(0);
prefix = prefix.sub(0, prefix.find('_') + 1);
query << " AND " << prefix << "KEYPRGINVIO != ''";
CHECKS(++nkf >= 2, "Can't remove partial key on table ", static_cast<const char*>(_table));
query << ';';
return query;
}
@ -392,7 +397,7 @@ bool TPaf_record::search()
{
CHECKS(_fields.items() > 0, "Can't search with empty key on table ", static_cast<const char*>(_table));
TString256 query;
query << "SELECT * FROM " << _table << " WHERE ";
query << "SELECT TOP 1 * FROM " << _table << " WHERE ";
FOR_EACH_TOKEN(_key, fld)
{
const TVariant& var = get(fld);
@ -400,7 +405,15 @@ bool TPaf_record::search()
query << fld << '=' << var2str(fld, var) << " AND ";
}
query.rtrim(5);
query << ';';
query << " ORDER BY ";
FOR_EACH_TOKEN(_key, fld)
{
const TVariant& var = get(fld);
if (!var.is_null())
query << fld << ", ";
}
query.rtrim(1) << "DESC;";
// return xvt_sql_execute(_db, query, paf_search_record, this) == 1;
// TODO: Valutare