From 6253ac34a099dbae7387bf88d1e2ae6d6f30a6cc Mon Sep 17 00:00:00 2001 From: mtollari Date: Thu, 5 Oct 2017 14:23:59 +0000 Subject: [PATCH] =?UTF-8?q?Patch=20level=20=20=20=20=20=20=20=20=20:=2012.?= =?UTF-8?q?0=20464=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-=20Aggiornata=20maschera:?= =?UTF-8?q?=20aggiunti=20pi=C3=B9=20filtri=20per=20gli=20stati=20dei=20mov?= =?UTF-8?q?imenti=20-=20Sistemato=20errore=20durante=20il=20salvataggio=20?= =?UTF-8?q?dei=20movimenti=20custom=20-=20Forzato=20salvataggio=20stato=20?= =?UTF-8?q?movimento=20per=20tutti=20gli=20stati=20-=20Tolta=20per=20una?= =?UTF-8?q?=20maggiore=20chiarezza=20la=20forzatura=20del=20flag=20di=20in?= =?UTF-8?q?viato=20per=20tutti=20i=20record=20caricati,=20adesso=20si=20ve?= =?UTF-8?q?de=20lo=20stato=20presente=20sul=20database=20(ovviamente=20se?= =?UTF-8?q?=20i=20record=20non=20hanno=20stato=20sar=C3=A0=20"Inviare"=20d?= =?UTF-8?q?i=20default).=20ATTENZIONE!!=20tutti=20i=20record=20che=20hanno?= =?UTF-8?q?=20uno=20stato=20compreso=20tra=20"Da=20inviare",=20"Forzato"?= =?UTF-8?q?=20o=20"Inviato"=20verranno=20esportati=20una=20volta=20lanciat?= =?UTF-8?q?a=20l'esportazione.=20-=20Sistemata=20tabella=20durante=20l'imp?= =?UTF-8?q?ostazione=20del=20flag=20di=20forzato,=20adesso=20agisce=20sull?= =?UTF-8?q?a=20singola=20riga=20e=20non=20su=20tutto=20il=20documento=20-?= =?UTF-8?q?=20Sistemato=20errore=20di=20moltiplicazione=20dei=20record=20c?= =?UTF-8?q?ustom=20se=20presenti=20in=20prima=20nota=20pi=C3=B9=20righe=20?= =?UTF-8?q?con=20la=20stessa=20aliquota?= 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@24131 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- src/tf/tf0100.cpp | 25 +++++++++++++++++-------- src/tf/tf0100a.h | 2 +- src/tf/tf0100a.uml | 6 +++++- src/tf/tf0100b.h | 12 ++++++++---- src/tf/tf0101.cpp | 30 +++++++++++++++++++++--------- src/tf/tf0102.cpp | 25 ++++++++++++++++++++++--- 6 files changed, 74 insertions(+), 26 deletions(-) diff --git a/src/tf/tf0100.cpp b/src/tf/tf0100.cpp index fafb1ee8a..f956279fc 100644 --- a/src/tf/tf0100.cpp +++ b/src/tf/tf0100.cpp @@ -234,8 +234,8 @@ bool saveRec(TToken_string row, bool esportato) { static TLocalisamfile trasfatt(LF_TRASFATT); static TLocalisamfile mov(LF_MOV); - - TString key = row.get(_numero); key << "|"<< row.get(_aliquota); + static TString invio; invio.cut(0); + static TString key; key.cut(0) << row.get(_numero) << "|"<< row.get(_aliquota); TRectype rCust = cache().get(LF_TRASFATT, key); // Se la riga non esiste metto la chiave @@ -243,10 +243,13 @@ bool saveRec(TToken_string row, bool esportato) { rCust.put("NUMREG", row.get(_numero)); // Se il record viene creato al momento svuoto per sicurezza i valori TFINVIO e TFDATA in MOV - TRectype rOrig = cache().get(LF_MOV, row.get(_numero)); - rOrig.put("TFINVIO", ""); - rOrig.put("TFDATA", ""); - rOrig.rewrite(mov); + if(row.get_int(_numero) < MOV_CUSTOM) + { + TRectype rOrig = cache().get(LF_MOV, row.get(_numero)); + rOrig.put("TFINVIO", ""); + rOrig.put("TFDATA", ""); + rOrig.rewrite(mov); + } } rCust.put("TIPO", row.get(_tipocf)); rCust.put("CODCF", row.get(_codcf)); @@ -262,10 +265,16 @@ bool saveRec(TToken_string row, bool esportato) rCust.put("AUTOFATT", row.get(_autofatt)); if(esportato) { - TString invio = esportato? "I" : row.get(_invio); - rCust.put("TFINVIO", invio); + invio << "I"; rCust.put("TFDATA", TDate(TODAY)); } + else + { + invio << row.get(_invio); + } + + rCust.put("TFINVIO", invio); + return rCust.write_rewrite(trasfatt) == NOERR; } diff --git a/src/tf/tf0100a.h b/src/tf/tf0100a.h index cbb7965e8..e95cffe72 100644 --- a/src/tf/tf0100a.h +++ b/src/tf/tf0100a.h @@ -18,7 +18,7 @@ #define B_TIPO_BOLLADOG 413 #define B_TIPO_STORDOC 414 -#define END_BOOLEAN 414 +#define END_BOOLEAN 415 #define END_MASK 421 diff --git a/src/tf/tf0100a.uml b/src/tf/tf0100a.uml index 12a05b22d..e8dafa974 100644 --- a/src/tf/tf0100a.uml +++ b/src/tf/tf0100a.uml @@ -105,7 +105,11 @@ BEGIN PROMPT 1 6 "Fatture da visualizzare" ITEM "0|Da inviare" ITEM "1|Inviate" - ITEM "2|Disabilitate" + ITEM "2|Mai elaborati" + ITEM "3|Forzate" + ITEM "4|Errate" + ITEM "5|Disabilitate" + ITEM "6|Tutti" END GROUPBOX DLG_NULL 65 4 diff --git a/src/tf/tf0100b.h b/src/tf/tf0100b.h index 5f9bb684e..f53590165 100644 --- a/src/tf/tf0100b.h +++ b/src/tf/tf0100b.h @@ -39,9 +39,13 @@ enum return_code // Su DB: X o ''->Da inviare, F->Forzato, I->Inviato, N->Non inviare enum filter_fatt { - toSend, // Da inviare - sent, // Inviate - disabled // Disabilitate + toSend, // "", "X", "F", "E" + sent, // "I" + untouched, // "", "X" + forced, // "F" + disabled, // "N" + err, // "E" + all // Nessun controllo }; #define SHEET_GAP 101 @@ -107,7 +111,7 @@ bool saveRec(TToken_string row, bool esportato = false); // Ritorno una data in formato ANSI 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; +#define IF_IS_ENABLED(strarr) if(strcmp(strarr->get(_invio), FLAG_INVIO) != 0 && strcmp(strarr->get(_invio), FLAG_FORZATO) != 0 && strcmp(strarr->get(_invio), FLAG_INVIATO) != 0) continue; // Ritorno il carattere senza accento maiuscolo inline const char * noSpecial(char a); // Ritorno se è ancora valida la bolla doganale senza informazioni fornitore diff --git a/src/tf/tf0101.cpp b/src/tf/tf0101.cpp index 3cdfb037d..aa5f86bc7 100644 --- a/src/tf/tf0101.cpp +++ b/src/tf/tf0101.cpp @@ -306,7 +306,7 @@ bool TTrFa_mask::on_field_event(TOperable_field& o, TField_event e, long jolly) else { TString invio = o.mask().get(A_INVIO); - if(invio != FLAG_FORZATO || invio != FLAG_ERRORE) + if(invio != FLAG_FORZATO && invio != FLAG_ERRORE) changeInvio(o.mask().get(A_TIPOCF), o.mask().get(A_CODCF), o.mask().get(A_NUMDOC), invio); } } @@ -655,12 +655,13 @@ void TTrFa_mask::load_sheet() * basta settare i valori negli enum e lo sheet */ TRectype isCust = getTrasFatt(movimento.get("NUMREG"), iva); - +#ifdef DBG if(isCust.full() && (err < foundcust || err > foundidcust)) bool tolla = true; - - row.add(movimento.get("TFINVIO") == "I" ? "X" : "", _spedita); // Spedita - row.add("X"); // Da spedire, sempre! +#endif + const char * toSend = movimento.get("TFINVIO").blank() ? FLAG_INVIO : movimento.get("TFINVIO"); + row.add(movimento.get("TFINVIO") == FLAG_INVIATO ? "X" : "", _spedita); // Spedita + row.add(toSend); // Da spedire row.add(isCust.full() ? "X" : "", _forzata); // Modificato row.add(movimento.get_long("NUMREG"), _numero); // Numero registrazione row.add(movimento.get_date("DATAREG"), _datareg); // Data Registrazione @@ -712,16 +713,27 @@ bool TTrFa_mask::checkInvio(const TString& invio) bool ok; switch(get_int(F_FATTSEL)) { - case 0: + case toSend: ok = invio == "" || invio == FLAG_INVIO || invio == FLAG_FORZATO || invio == FLAG_ERRORE; break; - case 1: + case sent: ok = invio == FLAG_INVIATO; break; - case 2: - default: + case untouched: + ok = invio == "" || invio == FLAG_INVIO; + case forced: + ok = invio == FLAG_FORZATO; + break; + case disabled: ok = invio == FLAG_NINVIO; break; + case err: + ok = invio == FLAG_ERRORE; + break; + case all: + default: + ok = true; + break; } return ok; } diff --git a/src/tf/tf0102.cpp b/src/tf/tf0102.cpp index d4748d0a6..30d3853ea 100644 --- a/src/tf/tf0102.cpp +++ b/src/tf/tf0102.cpp @@ -77,7 +77,7 @@ TRectype TTrFa_cursors::_next(return_code& code, TString& tipocf, TString& codcf int tipoDoc = getTipoDoc(c_rmoviva->get("23.TIPODOC").as_string()); if(!newMov || !checkRecord(c_rmoviva) || tipoDoc == -1 || !msk().get_bool(tipoDoc)) { - TString codiva; + static TString codiva; do { // Se ritorna false ho finito i records @@ -90,6 +90,7 @@ TRectype TTrFa_cursors::_next(return_code& code, TString& tipocf, TString& codcf { // Controllo se ho cambiato movimento _newMov = numMov != c_rmoviva->get("23.NUMREG").as_string(); + codiva.cut(0) << c_rmoviva->get("25.CODIVA").as_string(); } } // Ciclo finchè non trovo un nuovo movimento o trovo cod IVA già presi da cust while(!checkRecord(c_rmoviva) || (!_newMov && _alqCust.get_pos(codiva) > -1)); @@ -105,6 +106,11 @@ TRectype TTrFa_cursors::_next(return_code& code, TString& tipocf, TString& codcf else code = found; +#ifdef DBG + if(c_rmoviva->get("23.NUMREG").as_int() == 1930131) + bool tolla = true; +#endif + // Controllo dell'esistenza di un record custom in tasfatt retRec = getTrasFatt(c_rmoviva->get("23.NUMREG").as_string(), c_rmoviva->get("25.CODIVA").as_string()); if(retRec.empty()) @@ -169,16 +175,29 @@ int TTrFa_cursors::updateFilters(const char tipocf, const long codcf, TDate dal, switch(cod) { case toSend: - query << "&&((23.TFINVIO=\"\")||(23.TFINVIO=\"X\")||(23.TFINVIO=\"F\")||(23.TFINVIO=\"E\"))"; - queryCust << "&&((TFINVIO=\"\")||(TFINVIO=\"X\")||(TFINVIO=\"F\")||(TFINVIO=\"E\"))"; + query << "&&((23.TFINVIO=\"\")||(23.TFINVIO=\"X\")||(23.TFINVIO=\"F\"))"; + queryCust << "&&((TFINVIO=\"\")||(TFINVIO=\"X\")||(TFINVIO=\"F\"))"; break; case sent: query << "&&(23.TFINVIO=\"I\")"; queryCust << "&&(TFINVIO=\"I\")"; break; + case untouched: + query << "&&((23.TFINVIO=\"\")||(23.TFINVIO=\"X\")"; + queryCust << "&&((TFINVIO=\"\")||(TFINVIO=\"X\")"; + break; + case forced: + query << "&&(23.TFINVIO=\"F\")"; + queryCust << "&&(TFINVIO=\"F\")"; + break; case disabled: query << "&&(23.TFINVIO=\"N\")"; queryCust << "&&(TFINVIO=\"N\")"; + case err: + query << "&&(23.TFINVIO=\"E\")"; + queryCust << "&&(TFINVIO=\"E\")"; + break; + case all: default: break; }