From 94b33e50ea8c2edf079c73048fe062347dd4f25e Mon Sep 17 00:00:00 2001 From: mtollari Date: Wed, 27 Sep 2017 15:05:24 +0000 Subject: [PATCH] Patch level : 12.0 458 Files correlati : tf Commento : - Rafforzate chiavi clienti - Ripristinata esclusione Schede Carburanti git-svn-id: svn://10.65.10.50/branches/R_10_00@24112 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- src/tf/tf0100.cpp | 19 ++++++++++--------- src/tf/tfutility.cpp | 5 ++++- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/tf/tf0100.cpp b/src/tf/tf0100.cpp index 2ef6d12d0..3dfad9227 100644 --- a/src/tf/tf0100.cpp +++ b/src/tf/tf0100.cpp @@ -291,12 +291,12 @@ bool bd2017() return today <= lastDay; } -TTrFa_mask& msk() -{ - static TTrFa_mask* msk = NULL; - if (msk == NULL) - msk = new TTrFa_mask("tf0100a"); - return *msk; +TTrFa_mask& msk() +{ + static TTrFa_mask* msk = NULL; + if (msk == NULL) + msk = new TTrFa_mask("tf0100a"); + return *msk; } ///////////////////////////////////////////////////////////////////////////////////// @@ -904,14 +904,15 @@ TString TTrFa_app::getBody(TToken_string* strarr, bool add) static TString keyMap; keyMap.cut(0) << strarr->get_char(_tipocf) << "|" << strarr->get_int(_codcf) << "|" << strarr->get(_occas); clifoDoc app = mCliDoc[keyMap]; + static TString numDoc; numDoc.cut(0) << strarr->get(_numdoc) << "|" << TDate(strarr->get(_datadoc)).year(); if(add) { app.countDoc += 1; - app.docID.insert(std::pair(strarr->get(_numdoc), app.countDoc)); + app.docID.insert(std::pair(numDoc, app.countDoc)); } mCliDoc[keyMap] = app; - static TString body; body.format("%010d%010d", app.contCliFo, app.docID[strarr->get(_numdoc)]); + static TString body; body.format("%010d%010d", app.contCliFo, app.docID[numDoc]); return body; } @@ -1330,7 +1331,7 @@ bool TTrFa_app::tff0700(TSheet_field& sheet) { #ifdef DBG - if(strarr->get_char(_tipocf) == 'F' && strarr->get_long(_codcf) == 2409 && ((strcmp(strarr->get(_numdoc), "28070") == 0) || strcmp(strarr->get(_numdoc), "28072") == 0)) + if(strarr->get_char(_tipocf) == 'F' && strarr->get_long(_codcf) == 3) bool tolla = true; #endif diff --git a/src/tf/tfutility.cpp b/src/tf/tfutility.cpp index 078dc49e3..a51340bd1 100644 --- a/src/tf/tfutility.cpp +++ b/src/tf/tfutility.cpp @@ -84,8 +84,11 @@ TString getRFSO(TString codrfso) bool checkRecord(TISAM_recordset* rec) { TAnagrafica anaCli(rec->get("23.TIPO").as_string()[0], rec->get("23.CODCF").as_int(), rec->get("23.OCFPI").as_string()); + + static TString keyClifo; keyClifo.cut(0) << rec->get("23.TIPO").as_string() << "|" << rec->get("23.CODCF").as_string(); + TRectype rclifo = cache().get(LF_CLIFO, keyClifo); // Salto le schede carburanti - if(anaCli.inserimento_in_allegato() == 'C') + if(rclifo.get("ALLEG") == "C") return false; // Clienti