From 1a5e0b37af94e7cf89a422353199cc74bf07685e Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 20 Jan 2012 11:51:26 +0000 Subject: [PATCH] Patch level : 10.0 Files correlati : fe0.exe Ricompilazione Demo : [ ] Commento : Corretto blocco anteprima in assenza di Partita IVA in anagrafica git-svn-id: svn://10.65.10.50/branches/R_10_00@22555 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- fe/felib.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/fe/felib.cpp b/fe/felib.cpp index 0266837a6..9f20546db 100644 --- a/fe/felib.cpp +++ b/fe/felib.cpp @@ -707,6 +707,7 @@ TObject* TCofi_cache::find_ragsoc(bool piva, char tipocf, const TString& code) TISAM_recordset occas(query); if (occas.move_first()) return new TString80(occas.get(OCC_RAGSOC).as_string()); + return NULL; } @@ -734,25 +735,37 @@ TObject* TCofi_cache::key2obj(const char* key) const TString& TCofi_cache::cofi2ragsoc(char tipocf, const TString& cofi) { - const TString* ragsoc = &EMPTY_STRING; + const TString* ragsoc = NULL; if (cofi.full()) { TString80 key; key.format("CF|%c|%s", tipocf, (const char*)cofi); ragsoc = (const TString*)objptr(key); } + if (ragsoc == NULL) + { + TString& str = get_tmp_string(); + str << TR("C.F. sconosciuto ") << cofi; + ragsoc = &str; + } return *ragsoc; } const TString& TCofi_cache::paiv2ragsoc(char tipocf, const TString& paiv) { - const TString* ragsoc = &EMPTY_STRING; + const TString* ragsoc = NULL; if (paiv.full()) { TString80 key; key.format("PI|%c|%s", tipocf, (const char*)paiv); ragsoc = (const TString*)objptr(key); } + if (ragsoc == NULL) + { + TString& str = get_tmp_string(); + str << TR("P.I. sconosciuta ") << paiv; + ragsoc = &str; + } return *ragsoc; }