From f0bba3fd674b2f41c92d259c890ec61e972ed314 Mon Sep 17 00:00:00 2001 From: smen Date: Fri, 25 Nov 2022 12:13:59 +0100 Subject: [PATCH] Patch level : 12.0 1216 Files correlati : f9.exe Correzione errore su fatturazione elettronica. la funzione search() si era rotta. nella specifico la funzione di libreria sq_set_exec() ritornava true anche quando la query non resitituiva nessun recordset. questo comprometteva la funzionalita della funzione search() --- build/fp0.vcxproj | 1 + src/fp/fplib01.cpp | 23 +++++++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/build/fp0.vcxproj b/build/fp0.vcxproj index f308bf34e..0238bddce 100644 --- a/build/fp0.vcxproj +++ b/build/fp0.vcxproj @@ -282,6 +282,7 @@ true + true diff --git a/src/fp/fplib01.cpp b/src/fp/fplib01.cpp index 16b321aea..97be1112e 100644 --- a/src/fp/fplib01.cpp +++ b/src/fp/fplib01.cpp @@ -575,7 +575,7 @@ bool TPaf_record::search() { //CHECKS(_fields.items() > 0, "Can't search with empty key on table ", static_cast(_table)); - TString256 query; + TString query; bool first = true; query << "SELECT TOP 1 * FROM " << _table << " WHERE " << filter_string() << " ORDER BY "; @@ -595,7 +595,13 @@ bool TPaf_record::search() query << ";"; // return xvt_sql_execute(_db, query, paf_search_record, this) == 1; // TODO: Valutare - return fp_db().sq_set_exec(query); + bool exec_query = fp_db().sq_set_exec(query); + int items = fp_db().sq_items(); + + if (items > 0) + return true; + else + return false; } // Carica un record in base ad un massimo di 3 campi chiave @@ -1836,6 +1842,19 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc) paf0200f.set("P2_SEDENAZ", _paese); paf0200f.set("P2_GESTIONE", stato_paf()); + //Contatti Cedente Prestatore + TString80 tel; + TString80 mail; + + tel << get_firm().get(NDT_PTEL) << get_firm().get(NDT_TEL); + mail << get_firm().get(NDT_MAIL); + + if(tel.full()) + paf0200f.set("P2_CONTATTITELEF", tel); + + if (mail.full()) + paf0200f.set("P2_CONTATTIMAIL", mail); + TString rifamm = cco(doc).get("S4"); if (rifamm.blank()) {