From fa692af3634573c5a7c79dbd683b5176995ff63c Mon Sep 17 00:00:00 2001 From: Alessandro Bonazzi Date: Wed, 21 Aug 2024 00:42:31 +0200 Subject: [PATCH] Patch level : 12.00 1328 Files correlati : ve1.exe Commento: Aggiunto metodo indsped ai clienti fornitori --- src/cg/cglib.h | 5 +++++ src/cg/cglib07.cpp | 36 ++++++++++++++++++++++++++---------- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/src/cg/cglib.h b/src/cg/cglib.h index 9adf26103..99e574248 100644 --- a/src/cg/cglib.h +++ b/src/cg/cglib.h @@ -67,6 +67,8 @@ class TProgind; #define IVAACQIND "IVAACQIND" // Fatture +#define RIGA_CLIENTE_FORNITORE 1 +#define RIGA_COSTO_RICAVO 2 #define RIGA_IVA_DETRAIBILE 3 #define RIGA_IVA_NON_DETRAIBILE 4 #define RIGA_RITENUTE_FISCALI 8 @@ -1463,6 +1465,8 @@ class TCli_for : public TMultiple_rectype { TRectype _ven_rec; TRectype _letint; + int _codind; + TRectype _indsped; TDate _last_data; bool _use_lettere; bool _extended; @@ -1500,6 +1504,7 @@ public: const TOccasionale & occasionale(const TString& ocfpi = EMPTY_STRING) { return _occasionale = cache().get(LF_OCCAS, ocfpi); } const TAnagrafica & anagrafica() const { return _anagr; } + const TRectype & indsped(int codice = -1); TCli_for(char tipo = ' ', long codice = 0L); TCli_for(const TRectype & rec); diff --git a/src/cg/cglib07.cpp b/src/cg/cglib07.cpp index ab64a15c6..1ae8eb096 100644 --- a/src/cg/cglib07.cpp +++ b/src/cg/cglib07.cpp @@ -340,10 +340,6 @@ bool TAnagrafica::init(const TRectype& rec) _cofiest = rec.get(ANA_COFIEST); _paiv = rec.get(ANA_PAIV); _stato_paiv = rec.get(ANA_STATOPAIV); - - if (_ragsoc.starts_with("EYCK")) - int zingara = 1; - // Comune di residenza fiscale o domicilio _stato_estero = rec.get_int(ANA_STATORES); _com_res = rec.get(ANA_COMRES); @@ -799,6 +795,7 @@ int TCli_for::read(const TRectype & rec, word op, word lockop) _ven_rec.zero(); int err = TMultiple_rectype::read(rec, op, lockop); _last_data = botime; + _codind = -1; return err; } @@ -814,6 +811,7 @@ int TCli_for::read(char tipo, long codice, word op, word lockop) err = TMultiple_rectype::read(op, lockop); } _last_data = botime; + _codind = -1; return err; } @@ -902,8 +900,24 @@ TToken_string& TCli_for::get_ban_pres(int nprog) return ban; } -TCli_for::TCli_for(char tipo, long codice) : TMultiple_rectype( LF_CLIFO ), _ven_rec(LF_CFVEN), - _letint(LF_LETINT), _use_lettere(false), _lettera_found(false), _extended(false) +const TRectype & TCli_for::indsped(int cod) +{ + if (cod != _codind) + { + TToken_string key; + + key << tipo(); + key.add(codice()); + key.add(cod); + _indsped = cache().get(LF_INDSP, key); + _codind = cod; + } + return _indsped; +} + +TCli_for::TCli_for(char tipo, long codice) : TMultiple_rectype( LF_CLIFO ), _ven_rec(LF_CFVEN), _indsped(LF_INDSP), + _letint(LF_LETINT), _use_lettere(false), _lettera_found(false), + _extended(false), _codind(-1) { init(); add_file(LF_INDSP, IND_CODIND); @@ -913,8 +927,9 @@ TCli_for::TCli_for(char tipo, long codice) : TMultiple_rectype( LF_CLIFO ), _ven } -TCli_for::TCli_for(const TRectype & rec) : TMultiple_rectype(rec), _ven_rec(LF_CFVEN), - _letint(LF_LETINT), _use_lettere(false), _lettera_found(false), _extended(false) +TCli_for::TCli_for(const TRectype & rec) : TMultiple_rectype(rec), _ven_rec(LF_CFVEN), _indsped(LF_INDSP), + _letint(LF_LETINT), _use_lettere(false), _lettera_found(false), + _extended(false), _codind(-1) { init(); add_file(LF_INDSP, IND_CODIND); @@ -922,8 +937,9 @@ TCli_for::TCli_for(const TRectype & rec) : TMultiple_rectype(rec), _ven_rec(LF_C _anagr.init(LF_CLIFO, tipo(), codice()); } -TCli_for::TCli_for(const TCli_for & c) : TMultiple_rectype(c), _ven_rec(c._ven_rec), - _letint(LF_LETINT), _use_lettere(false), _lettera_found(false), _extended(false) +TCli_for::TCli_for(const TCli_for & c) : TMultiple_rectype(c), _ven_rec(c._ven_rec), _indsped(LF_INDSP), + _letint(LF_LETINT), _use_lettere(false), _lettera_found(false), + _extended(false), _codind(-1) { init(); _anagr.init(LF_CLIFO, tipo(), codice());