diff --git a/src/ef/ef0100.cpp b/src/ef/ef0100.cpp index 8a370df70..49020f24f 100755 --- a/src/ef/ef0100.cpp +++ b/src/ef/ef0100.cpp @@ -22,7 +22,6 @@ class TVariazione_effetti: public TRelation_application TMask *_msk; TEffetto *_effetto; TRelation *_rel; - TCli_for * _cli; protected: virtual void init_query_mode(TMask&); @@ -58,7 +57,7 @@ protected: public: virtual bool protected_record(TRectype&); virtual TRelation* get_relation() const {return _rel;} - TVariazione_effetti(): _msk(nullptr), _effetto(nullptr), _rel(nullptr), _cli(nullptr) + TVariazione_effetti(): _msk(nullptr), _effetto(nullptr), _rel(nullptr) { } @@ -372,12 +371,9 @@ bool TVariazione_effetti::clifo_handler(TMask_field& f, KEY k) TMask& m = f.mask(); const char tipocf = m.get(F_TIPOCF)[0]; const long codcf = m.get_long(F_CODCF); - if (app()._cli == nullptr) - app()._cli = new TCli_for(); - if (app()._cli->tipo() != tipocf || app()._cli->codice() != codcf) - app()._cli->read(tipocf, codcf); - const TString & iban = app()._cli->get_iban(); - + TCli_for & cf = (TCli_for &)cached_clifor(tipocf, codcf); + const TString & iban = cf.get_iban(); + if (iban.full()) { m.set(F_IBAN, iban); @@ -390,7 +386,9 @@ bool TVariazione_effetti::clifo_handler(TMask_field& f, KEY k) m.set(F_BBAN_CONTO, iban.mid(15)); m.efield(F_IBAN_STATO).validate(K_TAB); } - TToken_string& banp = app()._cli->get_ban_pres(); + + TToken_string& banp = cf.get_ban_pres(); + if (banp.full()) { m.set(F_CODABIP, banp.get()); diff --git a/src/ef/ef0800.cpp b/src/ef/ef0800.cpp index a554ed933..9f656c65d 100755 --- a/src/ef/ef0800.cpp +++ b/src/ef/ef0800.cpp @@ -34,7 +34,6 @@ #include #include -#include "../cg/cglib.h" #include "../cg/cglib.h" #include "../cg/cgsaldac.h" #include "../ve/velib04.h" @@ -1091,8 +1090,7 @@ void TContabilizzazione_effetti_app::aggiorna_saldi() const TDate datareg(mov.get_date(MOV_DATAREG)); - tiposal tsal = _caus->apertura() ? apertura : - (_caus->chiusura() ? chiusura : normale); + tiposal tsal = _caus->tipo_saldo(); _saldo.reset(); // Inizializza saldi diff --git a/src/ef/ef1100.cpp b/src/ef/ef1100.cpp index ef37cebb7..c9baf37d2 100644 --- a/src/ef/ef1100.cpp +++ b/src/ef/ef1100.cpp @@ -12,6 +12,7 @@ #include #include "../fe/felib.h" +#include "../cg/cglib.h" #include "ef0301.h" #include "ef1100a.h"