From 64a9566522859a0d2d17d2e41ae137f5dcb82acc Mon Sep 17 00:00:00 2001 From: Mattia Tollari Date: Fri, 2 Aug 2019 11:12:01 +0200 Subject: [PATCH] =?UTF-8?q?Patch=20level=20=20=20=20=20=20=20=20=20:=2012.?= =?UTF-8?q?0=20866=20Files=20correlati=20=20=20=20=20:=20fp0.exe=20Comment?= =?UTF-8?q?o=20=20=20=20=20=20=20=20=20=20=20=20:=20-=20Sistemata=20funzio?= =?UTF-8?q?ne=20cco,=20non=20andava=20a=20causa=20del=20programma=20divers?= =?UTF-8?q?o=20rispetto=20a=20dove=20era=20prima=20-=20Aggiunta=20gestione?= =?UTF-8?q?=20commesse=20sanit=C3=A0=20-=20Tolto=20else=20inutile=20in=20T?= =?UTF-8?q?FP=5Fexpression::parse=5Fsearch()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fp/fplib01.cpp | 40 ++++++++++++++++++++++++++++++---------- src/fp/fplib05.cpp | 6 ++---- 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/src/fp/fplib01.cpp b/src/fp/fplib01.cpp index 7c692157e..b1a6129bc 100644 --- a/src/fp/fplib01.cpp +++ b/src/fp/fplib01.cpp @@ -1024,15 +1024,27 @@ bool TDoc_fp::initialize(TDocumentoEsteso& doc) } const TRectype& TDoc_fp::cco(const TRectype& doc) const { - TString80 conkey; - const TString& con = doc.get(DOC_CONTRATTO); - if (con.full()) - { - char tcon = doc.get_char(DOC_MODPAG); - if (tcon < 'C') tcon = 'C'; - conkey.format("%c%6ld%s", tcon, doc.get_long(DOC_CODCF), static_cast(con)); - } - return cache().get("&CON", conkey); + TString80 conkey; + const TString& con = doc.get(DOC_CONTRATTO); + if (con.full()) + { + char tcon = doc.get_char(DOC_MODPAG); + if (tcon < 'C') tcon = 'C'; + conkey.format("%c%6ld%s", tcon, doc.get_long(DOC_CODCF), static_cast(con)); + } + + static TLocalisamfile tabmod(LF_TABMOD); + // Controllo se non sono già sul record, così evito read inutili + // Lo sto facendo a mano perchè usare cache() metterebbe FP nella colonna "MOD" + if (tabmod.get("MOD") != "PA" || tabmod.get("COD") != "CON" || tabmod.get("CODTAB") != conkey) + { + tabmod.zero(); + tabmod.put("MOD", "PA"); + tabmod.put("COD", "CON"); + tabmod.put("CODTAB", conkey); + tabmod.read(); + } + return tabmod.curr(); } void TDoc_fp::log(int severity, const char* msg) { @@ -1573,7 +1585,15 @@ bool TDoc_fp::doc_to_paf(TDocumentoEsteso& doc) // Fuori dallo scope per dopo const TString16 cup = doc.get(DOC_CUP); const TString16 cig = doc.get(DOC_CIG); - const TString80 com = doc.get(DOC_CODCMS); + + // Codice commessa, spostato nel campo S5 di TABCOM + TString80 com = cco(doc).get("S5"); + // Se è una commessa della sanità bisogna aggiungere un cancelletto davanti e dietro + if(cco(doc).get_bool("B0")) + { + com.add_front_and_back("#"); + } + // SEMPRE // Azzera contratti TPaf_record& paf1000f = _paf_container.get_paf("PAF1000F"); diff --git a/src/fp/fplib05.cpp b/src/fp/fplib05.cpp index 06bc344f3..3874dd69d 100644 --- a/src/fp/fplib05.cpp +++ b/src/fp/fplib05.cpp @@ -639,8 +639,6 @@ TVariant& TFP_expression::parse_search(const TString& str, TRiga_documento& rdoc { return get_value(cache().get(tabella, search, key), campo); } - else - { - return get_value(cache().get(file, search, key), campo); - } + + return get_value(cache().get(file, search, key), campo); }