diff --git a/ba/ba3600.cpp b/ba/ba3600.cpp index 9fe56f5db..d9996990b 100755 --- a/ba/ba3600.cpp +++ b/ba/ba3600.cpp @@ -5,6 +5,7 @@ //#include #include #include +#include #include #include @@ -39,7 +40,6 @@ class BA3600_application : public TPrintapp TMask* _msk; TTable* _tab_lbu; - TTable* _tab_reg; TLocalisamfile* _indlib; TLocalisamfile* _nditte; TLocalisamfile* _anag; @@ -389,7 +389,13 @@ bool BA3600_application::preprocess_page(int file, int counter) _rag_soc = ragsoc_ditta(_codditta); dati_anagrafici_ditta(_ind_dta,_civ_dta,_cap_dta,_com_dta,_prov_dta); _cod_reg = lib->cod_reg; - _descrizione = descrizione_codreg(_cod_reg); + if (prefix().exist(_codditta)) + { + set_firm(_codditta); // change firm to get register description + _descrizione = descrizione_codreg(_cod_reg); + } + else + _descrizione = ""; _cod_vidimaz = lib->cod_vid; _numini_pagut = lib->nini_put; _numfin_pagut = lib->nfin_put; @@ -579,14 +585,15 @@ const char* BA3600_application::descrizione_codreg(const TString& codreg) { TString16 dep; dep.format("%4d%-3s", _anno, (const char*)codreg); + TTable tab_reg("REG"); + + tab_reg.zero(); + tab_reg.put("CODTAB", dep); + tab_reg.read(); - _tab_reg->zero(); - _tab_reg->put("CODTAB", dep); - _tab_reg->read(); - - if (_tab_reg->bad()) - _tab_reg->zero(); - tmp = _tab_reg->get("S0"); + if (tab_reg.bad()) + tab_reg.zero(); + tmp = tab_reg.get("S0"); return tmp; } @@ -700,7 +707,6 @@ bool BA3600_application::user_create() _indlib = new TLocalisamfile (LF_INDLIB); _tab_lbu = new TTable (TAB_LBU); - _tab_reg = new TTable (TAB_REG); _msk = new TMask("ba3600a"); return TRUE; @@ -711,7 +717,6 @@ bool BA3600_application::user_destroy() delete _msk; delete _tab_lbu; - delete _tab_reg; delete _indlib; delete _nditte; delete _anag;