diff --git a/src/tf/tf0100.cpp b/src/tf/tf0100.cpp index d6fd4bbb5..5281d8029 100644 --- a/src/tf/tf0100.cpp +++ b/src/tf/tf0100.cpp @@ -295,18 +295,20 @@ bool saveRec(TToken_string row, bool esportato) return rCust.write_rewrite(trasfatt) == NOERR; } -inline char noAccent(char a) +inline const char * noSpecial(char a) { if(a == 'à') - return 'a'; + return "a''"; else if(a == 'è' || a == 'é') - return 'e'; + return "e''"; else if(a == 'ì') - return 'i'; + return "i''"; else if(a == 'ò') - return 'o'; - // 'ù' altrimenti - return 'u'; + return "o''"; + else if(a == 'ù') + return "u''"; + // Se non trovo nulla lo tolgo + return ""; } ///////////////////////////////////////////////////////////////////////////////////// @@ -418,16 +420,17 @@ const TString& TTrFa_record::var2str(const TString& fldname, const TVariant& var return str; TString& tmp = get_tmp_string(); + TString& tmp2 = get_tmp_string(); tmp = str; - TString accenti = CARATTERI_ACCENTATI; - for(int i = 0; i < accenti.len(); i++) + TString speciali = CARATTERI_SPECIALI; + for(int i = 0; i < speciali.len(); i++) { - for (int a = str.rfind(accenti[i]); a >= 0; a--) + for (int a = str.rfind(speciali[i]); a >= 0; a--) { - if (tmp[a] == accenti[i]) + if (tmp[a] == speciali[i]) { - tmp[a] = noAccent(accenti[i]); - tmp.insert("''", a+1); + tmp2.cut(0) << tmp.left(a) << noSpecial(speciali[i]) << tmp.mid(a+1); + tmp = tmp2; } } } @@ -1105,9 +1108,6 @@ bool TTrFa_app::tff0400(TSheet_field& sheet) TRectype r_cedeprest = getCli(vtipocf.as_string(), vcodcf.as_string(), voccas.as_string()); TAnagrafica cedeprest; - if(vtipocf.as_string() == "C" && vcodcf.as_string() == "3566") - bool tolla = true; - // Con l'uscita di questo programma è stato messo un collegamento in prima nota // per il fornitore a cui è riferita la bolla doganale if(strcmp(strarr->get(_codnum),"BD") == 0) @@ -1457,8 +1457,12 @@ void TTrFa_app::main_loop() while (msk.run() == K_ENTER) { if(msk.checkNotEmpty()) + { + // Sistemo tutti i flag prima di inviare + msk.theFinalCheckDown(); send(&msk); //ini_set_string(CONFIG_DITTA, "tf", "LastSend", ++TDate(msk.get(F_DATAFIN))); + } } } diff --git a/src/tf/tf0100b.h b/src/tf/tf0100b.h index 84e6edc6a..e6b2eb4b1 100644 --- a/src/tf/tf0100b.h +++ b/src/tf/tf0100b.h @@ -57,7 +57,7 @@ enum filter_fatt #define SPESOMETROBASE "ModuliSirio" #define REG_ATT 1 #define REG_PAS 2 -#define CARATTERI_ACCENTATI "àèéìòù" +#define CARATTERI_SPECIALI "àèéìòù°" /* Così facendo basta modificare la maschera (e le dichiarazioni di conseguenza) * per avere l'inserimento nello sheet corretto */ @@ -114,7 +114,7 @@ inline TDate toDate(const char * date) { return TDate(date).string(); } // Salto se la riga non è abilitata #define IF_IS_ENABLED(strarr) if(strcmp(strarr->get(_invio), FLAG_INVIO) != 0 && strcmp(strarr->get(_invio), FLAG_FORZATO) != 0) continue; // Ritorno il carattere senza accento maiuscolo -inline char noAccent(char a); +inline const char * noSpecial(char a); ///////////////////////////////////////////////////////////////////////////////////// // TTrFa_record