From 7cbc9ed5e2c00b47020169716fc8d0e496257098 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 23 Dec 2011 10:15:42 +0000 Subject: [PATCH] =?UTF-8?q?Patch=20level=20=20=20=20=20=20=20=20=20:=2010.?= =?UTF-8?q?0=20Files=20correlati=20=20=20=20=20:=20fe0100a.msk=20fe0.exe?= =?UTF-8?q?=20Ricompilazione=20Demo=20:=20[=20]=20Commento=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20:=20Aggiunta=20gestione=20codice=20stato?= =?UTF-8?q?=20per=20modello=20UNICO=20(non=20pi=C3=B9=20ISTAT)?= 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@22532 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- fe/fe0100.cpp | 40 +++++++++++++++++++++++----------------- fe/fe0100a.uml | 6 +++--- fe/felib.cpp | 15 +++++++++++++++ fe/felib.h | 4 +++- 4 files changed, 44 insertions(+), 21 deletions(-) diff --git a/fe/fe0100.cpp b/fe/fe0100.cpp index 808211467..e2c7a7256 100755 --- a/fe/fe0100.cpp +++ b/fe/fe0100.cpp @@ -352,7 +352,7 @@ TExclusion_mode TDati_rilevanti_array::add(const TRectype& alleg, bool send_all, return segnala_riga(alleg, em_importo_limite, log); const TAnagrafica a(alleg); - if (a.codice_fiscale().blank() && a.partita_IVA().blank() && a.stato_estero() == 0) + if (a.codice_fiscale().blank() && a.partita_IVA().blank() && a.italiano()) return segnala_riga(alleg, em_no_allegato, log); if (is_nota_variazione(alleg)) @@ -566,6 +566,10 @@ TExclusion_mode TDati_rilevanti_msk::validate_clifo(const TRectype& mov) if (tipocf <= ' ' || (codcf <= 0 && ocfpi.blank())) return segnala_movimento(mov, em_no_allegato); + TString8 key; key.format("%c|%ld", tipocf, codcf); + const TRectype& rec_clifo = cache().get(LF_CLIFO, key); + const int alleg = rec_clifo.get_int(CLI_ALLEG); + TString4 stato; if (ocfpi.full()) { @@ -574,10 +578,6 @@ TExclusion_mode TDati_rilevanti_msk::validate_clifo(const TRectype& mov) } else { - TString8 key; key.format("%c|%ld", tipocf, codcf); - const TRectype& rec_clifo = cache().get(LF_CLIFO, key); - - const int alleg = rec_clifo.get_int(CLI_ALLEG); if (alleg == 1) return segnala_movimento(mov, em_no_allegato); @@ -589,11 +589,17 @@ TExclusion_mode TDati_rilevanti_msk::validate_clifo(const TRectype& mov) if (stato.full()) { - const TRectype& rec_sta = cache().get("%STA", stato); - if (rec_sta.get_bool("B0")) - return segnala_movimento(mov, em_fiscalita_agevolata); - - if (tipocf == 'F') + if (tipocf == 'C') + { + // I clienti privati vanno inclusi anche se residenti in stati esteri in black list + if (ocfpi.blank() && alleg != 6) + { + const TRectype& rec_sta = cache().get("%STA", stato); + if (rec_sta.get_bool("B0")) + return segnala_movimento(mov, em_fiscalita_agevolata); + } + } + else return segnala_movimento(mov, em_estero); } @@ -1058,7 +1064,7 @@ bool TDati_rilevanti_msk::send_nota_variazione(const TRectype& alleg, TDati_rile else imposta = -imposta; - if (anag.stato_estero() > 0) + if (anag.estero()) { operaz.new_rec("5"); // Note di variazione a soggetti non residenti if (anag.fisica()) @@ -1068,13 +1074,13 @@ bool TDati_rilevanti_msk::send_nota_variazione(const TRectype& alleg, TDati_rile operaz.set(4, anag.data_nascita()); operaz.set(5, anag.comune_nascita()); operaz.set(6, anag.provincia_nascita()); - operaz.set(7, anag.stato_estero()); + operaz.set(7, anag.stato_estero_UNICO()); } else { operaz.set(8, anag.ragione_sociale()); operaz.set(9, anag.comune_residenza()); - operaz.set(10, anag.stato_estero()); + operaz.set(10, anag.stato_estero_UNICO()); operaz.set(11, anag.indirizzo_residenza()); } operaz.set(12, alleg.get(ALL_DATAREG)); @@ -1118,7 +1124,7 @@ bool TDati_rilevanti_msk::send_fatt(const TRectype& alleg, TDati_rilevanti_set& if (!anag.ok()) return false; - if (anag.stato_estero() > 0) + if (anag.estero()) { operaz.new_rec("3"); // Operazioni con soggetti non residenti if (anag.fisica()) @@ -1128,7 +1134,7 @@ bool TDati_rilevanti_msk::send_fatt(const TRectype& alleg, TDati_rilevanti_set& operaz.set(4, anag.data_nascita()); operaz.set(5, anag.comune_nascita()); operaz.set(6, anag.provincia_nascita()); - operaz.set(7, anag.stato_estero()); + operaz.set(7, anag.stato_estero_UNICO()); } else { @@ -1137,7 +1143,7 @@ bool TDati_rilevanti_msk::send_fatt(const TRectype& alleg, TDati_rilevanti_set& operaz.set(9, anag.localita_residenza()); else operaz.set(9, anag.comune_residenza()); - operaz.set(10, anag.stato_estero()); + operaz.set(10, anag.stato_estero_UNICO()); operaz.set(11, anag.indirizzo_residenza()); } operaz.set(12, alleg.get(ALL_DATAREG)); @@ -1804,7 +1810,7 @@ bool TDati_rilevanti_msk::on_field_event(TOperable_field& o, TField_event e, lon } else if (e == se_notify_modify) { - set_dirty( true); + set_dirty(true); enable_buttons(); } else if (e == se_query_add) diff --git a/fe/fe0100a.uml b/fe/fe0100a.uml index 2b6bd51fe..1e7441549 100755 --- a/fe/fe0100a.uml +++ b/fe/fe0100a.uml @@ -84,13 +84,13 @@ END DATE F_DATA BEGIN - PROMPT 15 1 "Data limite " + PROMPT 15 1 "Limite note variazione " CHECKTYPE REQUIRED END LIST F_SHOWALL 1 13 BEGIN - PROMPT 45 1 "Mostra movimenti " + PROMPT 52 1 "Movimenti " ITEM "1|Rilevanti" ITEM "2|NON rilevanti" ITEM "4|Scartati" @@ -442,7 +442,7 @@ BEGIN INPUT CODCF A_CODCF SELECT INPUT DATAREG A_DATARETT COPY DISPLAY A_DATAREG - OUTPUT A_DATARETT DATADOC + OUTPUT A_DATARETT DATAREG OUTPUT A_NUMRETT NUMDOC ADD RUN cg2 -0 NUM_EXPR IF((#A_IMPORTO<0)&&(#A_IGNORA<=0);#A_DATARETT!="";1) diff --git a/fe/felib.cpp b/fe/felib.cpp index e186d0f4d..538196ea7 100644 --- a/fe/felib.cpp +++ b/fe/felib.cpp @@ -71,6 +71,21 @@ void TAnagrafica::build_ind_res(const TRectype& rec, const char* ind, const char } } +bool TAnagrafica::italiano() const +{ return _stato_estero <= 0; } + +const TString& TAnagrafica::stato_estero_UNICO() const +{ + if (italiano()) + return EMPTY_STRING; + TString4 u; + u.format("%03d", _stato_estero); + const TString& cod = cache().get("%STA", u, "S8"); // S8=UNICO S9=ISTAT + if (cod.len() == 3) + u = cod; + return get_tmp_string() = u; +} + bool TAnagrafica::init(const TRectype& rec) { _tipo = '\0'; diff --git a/fe/felib.h b/fe/felib.h index da9d84dea..0248e8857 100644 --- a/fe/felib.h +++ b/fe/felib.h @@ -41,7 +41,9 @@ public: const TString& nome() const { CHECK(fisica(), "Non chiedere nome giuridico!"); return _ragsoc.mid(30,20); } char sesso() const { CHECK(fisica(), "Solo sesso fisico!"); return (_cofi[9] >= '4') ? 'F' : 'M'; } const TDate& data_nascita() const { return _data_nasc; } - int stato_estero() const { return _stato_estero; } + bool italiano() const; + bool estero() const { return !italiano(); } + const TString& stato_estero_UNICO() const; int inserimento_in_allegato() const { return _allegato; } const TString& comune_nascita() const;