From 78eb00966b57811aa860ed5f49b6ae0451cacf8c Mon Sep 17 00:00:00 2001 From: mtollari Date: Fri, 30 Jun 2017 08:49:03 +0000 Subject: [PATCH] Patch level : 12.0 412 Files correlati : Commento : Sistemate le chiavi interne nel programma, capitava che il codcf e il numero documento si unissero creando errori madornali git-svn-id: svn://10.65.10.50/branches/R_10_00@23893 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- src/tf/tf0100.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/tf/tf0100.cpp b/src/tf/tf0100.cpp index 735ad6014..6e9153628 100644 --- a/src/tf/tf0100.cpp +++ b/src/tf/tf0100.cpp @@ -1487,10 +1487,12 @@ TString TTrFa_app::getHeader(TToken_string* strarr) // Chiave header (20): TIPOCF(1) + CODCF(6) static long int idHeader = 0L; + + // Cerco/Aggiungo il Clifo all'std::map - TString keyMap; keyMap << strarr->get_char(_tipocf) << strarr->get_int(_codcf); + TString keyMap; keyMap << strarr->get_char(_tipocf) << "|" << strarr->get_int(_codcf); clifoDoc app; - // Non è presente e lo inserisco + // Non è presente e lo inserisco per la chiave body if(mCliDoc.find(keyMap) == mCliDoc.end()) { idHeader++; @@ -1498,11 +1500,6 @@ TString TTrFa_app::getHeader(TToken_string* strarr) app.countDoc = 0L; mCliDoc.insert(std::pair(keyMap, app)); } - // É presente lo prendo - else - { - app = mCliDoc[keyMap]; - } TString header; header.format("%c%06ld", strarr->get_char(_tipocf), strarr->get_int(_codcf)); // Ritorno l'header return header; @@ -1520,7 +1517,7 @@ TString TTrFa_app::getBody(TToken_string* strarr, bool add) /* Sembra che utilizzare identificatori chiari e sensati in questo mondo non è concesso, quindi adesso vi sbatto un bell'ID numerico * Ok per OGNI cliente devo assegnarli un identificativo del numero della fattura */ - TString keyMap; keyMap << strarr->get_char(_tipocf) << strarr->get_int(_codcf); + TString keyMap; keyMap << strarr->get_char(_tipocf) << "|" << strarr->get_int(_codcf); clifoDoc app = mCliDoc[keyMap]; if(add) @@ -1812,7 +1809,10 @@ bool TTrFa_app::tff0700(TSheet_field& sheet) return false; if(strcmp(strarr->get(_invio), "X") != 0) continue; // Non mi interessa se non è selezionata - TString checkFatt; checkFatt << strarr->get_char(_tipocf) << strarr->get_long(_codcf) << strarr->get(_numdoc); + if(strcmp(strarr->get(_numero), "86709") == 0 || strcmp(strarr->get(_numero), "86772") == 0) + bool tolla = true; + + TString checkFatt; checkFatt << strarr->get_char(_tipocf) << "|" << strarr->get_long(_codcf) << "|" << strarr->get(_numdoc); if(fattSent.get_pos(checkFatt) < 0) { fattSent.add(checkFatt); @@ -1856,7 +1856,9 @@ bool TTrFa_app::tff2200(TToken_string* strarr, int nriga) tff2200f.set("PL_KEYPRGINVIO", getKey(strarr)); tff2200f.set("PL_KEYHEADERFATT", getHeader(strarr)); tff2200f.set("PL_KEYBODYFATT", getBody(strarr, false)); + TString numriga; numriga.format("%020d", nriga); + tff2200f.set("PL_KEYBODYDETT", numriga); tff2200f.set("PL_IMPONIBILE", real(strarr->get(_imponibile))); // Se li converto in real una volta passati vengono parsati da var2str nel formato che vuole l'agenzia delle entrate