From 7a178220cb37384236a2b8a18d7815f5486d6d59 Mon Sep 17 00:00:00 2001 From: bonazzi Date: Mon, 30 Jan 2017 17:08:22 +0000 Subject: [PATCH] Patch level : 12.0 336 Files correlati : patch 336 git-svn-id: svn://10.65.10.50/branches/R_10_00@23569 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- src/cg/cg2100.cpp | 5 +++-- src/cg/cglib01.cpp | 8 ++++++++ src/cg/cglib01.h | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/cg/cg2100.cpp b/src/cg/cg2100.cpp index 93be54af9..4f37f8059 100755 --- a/src/cg/cg2100.cpp +++ b/src/cg/cg2100.cpp @@ -910,8 +910,9 @@ void TPrimanota_application::init_insert_mode(TMask& m) TRegistro& reg = causale().reg(); const TString4 codreg = reg.name(); const int regyear = reg.year(); - TRegistro r(codreg, regyear); - const long protiva = r.protocol() + 1; + + reg.force_read(codreg, regyear); + const long protiva = reg.protocol() + 1; m.set(F_PROTIVA, protiva, true); // Aggiorna protocollo IVA } diff --git a/src/cg/cglib01.cpp b/src/cg/cglib01.cpp index b360445aa..4bc5e8061 100755 --- a/src/cg/cglib01.cpp +++ b/src/cg/cglib01.cpp @@ -417,6 +417,14 @@ bool TRegistro::read(const char* cod, int year) return !_rec.empty(); } +bool TRegistro::force_read(const char* cod, int year) +{ + TString8 chiave; chiave.format("%04d%s", year, cod); + + cache().discard("REG", chiave); + return read(cod, year); +} + bool TRegistro::reread() { if (ok()) diff --git a/src/cg/cglib01.h b/src/cg/cglib01.h index 9cebb5e99..ce4eb3996 100755 --- a/src/cg/cglib01.h +++ b/src/cg/cglib01.h @@ -93,6 +93,7 @@ protected: public: bool read(const char* code, int year); + bool force_read(const char* code, int year); bool reread(); TRegistro& operator =(const TRegistro& r);