From 0902283d6af14afffcd60bbf0e4d0f934cca5272 Mon Sep 17 00:00:00 2001 From: mtollari Date: Fri, 6 Oct 2017 07:26:58 +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-=20Tolta=20sovrascrittura?= =?UTF-8?q?=20flag=20inviato=20durante=20salvataggio=20record=20custom=20i?= =?UTF-8?q?n=20prima=20nota=20-=20Aggiunto=20flag=20"Inviato"=20nella=20ta?= =?UTF-8?q?bella=20-=20Cambiata=20scritta=20"Forzata"=20a=20"Modificata"?= =?UTF-8?q?=20per=20migliore=20comprensione=20-=20Aggiunta=20nuova=20funzi?= =?UTF-8?q?one=20filtro=20che=20si=20appoggia=20a=20quella=20della=20masch?= =?UTF-8?q?era,=20cos=C3=AC=20facendo=20riesco=20a=20filtrare=20record=20c?= =?UTF-8?q?on=20stati=20differenti=20tra=20prima=20nota=20e=20Trasferiment?= =?UTF-8?q?o=20fatture=20(vedi=20primo=20punto)=20-=20Tolto=20vecchio=20fi?= =?UTF-8?q?ltro=20flag=20invio?= 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@24133 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- src/tf/tf0100.cpp | 8 ------- src/tf/tf0100a.uml | 3 ++- src/tf/tf0100b.h | 1 + src/tf/tf0102.cpp | 53 +++++++++++++++++++--------------------------- 4 files changed, 25 insertions(+), 40 deletions(-) diff --git a/src/tf/tf0100.cpp b/src/tf/tf0100.cpp index f956279fc..ffdb1a3d5 100644 --- a/src/tf/tf0100.cpp +++ b/src/tf/tf0100.cpp @@ -242,14 +242,6 @@ bool saveRec(TToken_string row, bool esportato) if(rCust.empty()) { rCust.put("NUMREG", row.get(_numero)); - // Se il record viene creato al momento svuoto per sicurezza i valori TFINVIO e TFDATA in 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)); diff --git a/src/tf/tf0100a.uml b/src/tf/tf0100a.uml index e8dafa974..2fc654625 100644 --- a/src/tf/tf0100a.uml +++ b/src/tf/tf0100a.uml @@ -186,7 +186,7 @@ BEGIN ITEM "Auto\nfatt.@3" ITEM "Spedita@5" ITEM "Inviare@5" - ITEM "Forzata@10" + ITEM "Modificata@10" ITEM "N.\nRegistraz.@10" ITEM "Codici Errori@10" @@ -209,6 +209,7 @@ LIST A_INVIO 1 15 BEGIN PROMPT 1 10 "Da inviare" ITEM "X|X, Da Inviare" + ITEM "I|I, Inviato" ITEM "N|N, Disabilitato" ITEM "F|F, Forzato" ITEM "E|E, Errato" diff --git a/src/tf/tf0100b.h b/src/tf/tf0100b.h index f53590165..15c6d0a84 100644 --- a/src/tf/tf0100b.h +++ b/src/tf/tf0100b.h @@ -175,6 +175,7 @@ class TTrFa_cursors : TObject TRectype _next(return_code& code, TString& tipocf, TString& codcf, TString& ocfpi); // Si sposta avanti di un elemento TRectype _nextCust(return_code& code, TString& tipocf, TString& codcf, TString& ocfpi); // Si sposta avanti di un elemento tra quelli custom + bool checkEnabled(TISAM_recordset* origCur); public: //TTrFa_cursors(); ~TTrFa_cursors(); diff --git a/src/tf/tf0102.cpp b/src/tf/tf0102.cpp index 30d3853ea..08054f561 100644 --- a/src/tf/tf0102.cpp +++ b/src/tf/tf0102.cpp @@ -93,7 +93,7 @@ TRectype TTrFa_cursors::_next(return_code& code, TString& tipocf, TString& codcf 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)); + while((!_newMov && _alqCust.get_pos(codiva) > -1) || !checkEnabled(c_rmoviva) || !checkRecord(c_rmoviva)); } // Se ho cambiato movimento ritorno, leggerò poi al prossimo giro @@ -159,6 +159,27 @@ TRectype TTrFa_cursors::_nextCust(return_code& code, TString& tipocf, TString& c return c_trasfatt->cursor()->curr(); } +bool TTrFa_cursors::checkEnabled(TISAM_recordset* origCur) +{ + // Controllo che il record sia effettivamente abilitato + static TString flag; flag.cut(0); + // Controllo se sono su un movimento custom + if(origCur->find_column("MOV.REG") >= 0) + { + TRectype rCust = getTrasFatt(c_rmoviva->get("23.NUMREG").as_string(), c_rmoviva->get("25.CODIVA").as_string()); + if(rCust.empty()) + flag << origCur->get("23.TFINVIO"); + else + flag << rCust.get("TFINVIO"); + } + else + { + flag << origCur->get("TFINVIO").as_string(); + } + + return msk().checkInvio(flag); +} + int TTrFa_cursors::updateFilters(const char tipocf, const long codcf, TDate dal, TDate al, int cod) { @@ -172,36 +193,6 @@ int TTrFa_cursors::updateFilters(const char tipocf, const long codcf, TDate dal, queryCust << "&&STR((CODCF=#CODCF))"; } - switch(cod) - { - case toSend: - 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; - } - query << "\nJOIN MOV INTO NUMREG==NUMREG\n"; queryCust << "\nFROM NUMREG=" << MOV_CUSTOM;