From dbbd6bddcca7cbdc9cf756a0e615667343017437 Mon Sep 17 00:00:00 2001 From: mtollari Date: Fri, 9 Feb 2018 12:00:52 +0000 Subject: [PATCH] =?UTF-8?q?Patch=20level=20=20=20=20=20=20=20=20=20:=2012.?= =?UTF-8?q?0=20530=20Files=20correlati=20=20=20=20=20:=20tf=20Commento=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20:=20-=20Tolto=20tipodoc=20in?= =?UTF-8?q?=20decodTipo(),=20=C3=A8=20gi=C3=A0=20presente=20dentro=20a=20s?= =?UTF-8?q?trarr=20-=20Aggiunto=20controllo=20per=20il=20tipo=20documento?= =?UTF-8?q?=20nei=20record=20custom,=20se=20non=20=C3=A8=20presente=20deco?= =?UTF-8?q?difico=20-=20Aggiunta=20pulizia=20cache=20prima=20di=20ricreare?= =?UTF-8?q?=20i=20cursori?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://10.65.10.50/branches/R_10_00@24360 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- src/tf/tf0100.cpp | 5 +++-- src/tf/tf0100b.h | 2 +- src/tf/tf0101.cpp | 13 +++++++------ src/tf/tf0102.cpp | 3 +++ 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/tf/tf0100.cpp b/src/tf/tf0100.cpp index 9dd392110..c8a9b45e0 100644 --- a/src/tf/tf0100.cpp +++ b/src/tf/tf0100.cpp @@ -133,8 +133,9 @@ bool xvt_fsys_fupdate(const char* src, const char* dst) * TD10: Fatt di acquisto intra beni * TD11: Fatt di acquisto intra servizi */ -const char* decodTipo(TToken_string* strarr, const TString& tipodoc) +const char* decodTipo(TToken_string* strarr) { + const TString tipodoc = strarr->get(_codnum); TRectype mov = cache().get(LF_MOV, strarr->get(_numero)); TCausale caus(mov.get("CODCAUS"), mov.get_int("ANNOIVA")); // Le autofatture possono essere solo di tipo TDO1 e le bolle doganali nel dubbio pure @@ -1354,7 +1355,7 @@ bool TTrFa_app::tff0700(TSheet_field& sheet) TString natura = strarr->get(_natura); - tff0700f.set("P7_TIPODOC", strarr->get(_codnumAE)); + tff0700f.set("P7_TIPODOC", strarr->get(_codnumAE)); // Controllo il tipo di esigilitą tff0700f.set("P7_DATA", toDate(strarr->get(_datadoc))); diff --git a/src/tf/tf0100b.h b/src/tf/tf0100b.h index 8bdf80d71..2f54897cc 100644 --- a/src/tf/tf0100b.h +++ b/src/tf/tf0100b.h @@ -106,7 +106,7 @@ static SLIST_ELT xvt_slist_find_str(SLIST list, const char* str); // Aggiorna il file dst se pił vecchio di src (Potrebbe diventare una funzione di XVT.h) bool xvt_fsys_fupdate(const char* src, const char* dst); // Decodifica il tipo di documento per il trasferimento fatture -const char * decodTipo(TToken_string* strarr, const TString& tipodoc); +const char * decodTipo(TToken_string* strarr); // Salvo un singolo record bool saveRec(TToken_string row, bool esportato = false); // Ritorno una data in formato ANSI diff --git a/src/tf/tf0101.cpp b/src/tf/tf0101.cpp index e87ee50e9..25b7f08b8 100644 --- a/src/tf/tf0101.cpp +++ b/src/tf/tf0101.cpp @@ -674,14 +674,15 @@ void TTrFa_mask::load_sheet() row.add(movimento.get_real("IMPOSTA"), _importoIVA); // Imposta row.add(revCharge(movimento.get("NUMREG"), movimento.get_date("DATAREG").year()), _reverse); // Rev.Charge + + row.add(movimento.get("TIPODOC"), _codnum); // Calcolo il tipo documento alla fine per sicurezza - static TString4 td; - td.cut(0) << movimento.get("TIPODOC"); - row.add(td, _codnum); - if(isCust.full()) - row.add(movimento.get("TIPODOCAE"), _codnumAE); // Tipo documento + if (isCust.full()) + { + row.add(movimento.get("TIPODOCAE").blank() ? decodTipo(&row) : movimento.get("TIPODOCAE"), _codnumAE); // Tipo documento + } else - row.add(decodTipo(&row, td), _codnumAE); // Tipo documento + row.add(decodTipo(&row), _codnumAE); // Tipo documento /* * Possono esistere movimenti custom dove il cliente ha una partita IVA propria diff --git a/src/tf/tf0102.cpp b/src/tf/tf0102.cpp index 08054f561..95899c675 100644 --- a/src/tf/tf0102.cpp +++ b/src/tf/tf0102.cpp @@ -183,6 +183,9 @@ bool TTrFa_cursors::checkEnabled(TISAM_recordset* origCur) int TTrFa_cursors::updateFilters(const char tipocf, const long codcf, TDate dal, TDate al, int cod) { + // Svuoto la cache per aggiornare i file custom + cache().discard(LF_TRASFATT); + TString query = "USE RMOVIVA\n", queryCust = "USE TRASFATT\n"; query << "SELECT (23.REG!=\"\")&&BETWEEN(23.DATAREG,#DADATAREG,#ADATAREG)&&(23.TIPO=\"" << tipocf << "\")"; queryCust << "SELECT BETWEEN(DATAREG,#DADATAREG,#ADATAREG)&&(TIPO=\"" << tipocf << "\")";