diff --git a/cg/CGP3.URL b/cg/CGP3.URL deleted file mode 100755 index d5ad6b499..000000000 --- a/cg/CGP3.URL +++ /dev/null @@ -1,4 +0,0 @@ -#include - -MENU TASK_MENUBAR - SUBMENU MENU_FILE "~File" diff --git a/cg/cg0.url b/cg/cg0.url deleted file mode 100755 index 1aa8af7fb..000000000 --- a/cg/cg0.url +++ /dev/null @@ -1,3 +0,0 @@ -#include - -#include diff --git a/cg/cg1.url b/cg/cg1.url deleted file mode 100755 index 1aa8af7fb..000000000 --- a/cg/cg1.url +++ /dev/null @@ -1,3 +0,0 @@ -#include - -#include diff --git a/cg/cg1303.cpp b/cg/cg1303.cpp index 72d155957..7086e2e35 100755 --- a/cg/cg1303.cpp +++ b/cg/cg1303.cpp @@ -19,7 +19,8 @@ HIDDEN bool filtra_mov(const TRelation* r) { const TRectype& mov = r->curr(); const int annoiva = mov.get_int(MOV_ANNOIVA); - const TString& reg = mov.get(MOV_REG); + const TString16 reg = mov.get(MOV_REG); + TAgg_nprot& a = app(); return a.anno() == annoiva && a.reg() == reg; } diff --git a/cg/cg1303.h b/cg/cg1303.h index b5d7f8897..baf50db78 100755 --- a/cg/cg1303.h +++ b/cg/cg1303.h @@ -2,13 +2,11 @@ class TAgg_nprot : public TSkeleton_application { - int _anno; TString16 _reg; + int _anno; -protected: +public: virtual void main_loop(); - -public: int anno() const { return _anno; } const TString& reg() const { return _reg; } diff --git a/cg/cg1304.cpp b/cg/cg1304.cpp index ce693c11f..d1e5de2af 100755 --- a/cg/cg1304.cpp +++ b/cg/cg1304.cpp @@ -12,22 +12,17 @@ HIDDEN TAgg_codatt& app() { return (TAgg_codatt&) main_app(); } bool TAgg_codatt::create() { - TApplication::create(); - - _tab = new TLocalisamfile(LF_TAB); - - dispatch_e_menu (BAR_ITEM(1)); - return TRUE; + open_files(LF_TAB, 0); + + return TSkeleton_application::create(); } bool TAgg_codatt::destroy() { - delete _tab; - - return TApplication::destroy(); + return TSkeleton_application::destroy(); } -bool TAgg_codatt::menu(MENU_TAG m) +void TAgg_codatt::main_loop() { TProgind* pri; TMask msk("cg1300c"); @@ -64,7 +59,6 @@ bool TAgg_codatt::menu(MENU_TAG m) delete pri; message_box(TR("Aggiornamento codice attivita' completato")); } - return FALSE; } void TAgg_codatt::cancella_rec() diff --git a/cg/cg1304.h b/cg/cg1304.h index da7778ff2..4909479d9 100755 --- a/cg/cg1304.h +++ b/cg/cg1304.h @@ -1,27 +1,25 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -class TAgg_codatt : public TApplication -{ - TLocalisamfile* _tab; - TString16 _da, _a; - int _anno; - bool _pass; - -public: - virtual bool create(); - virtual bool destroy(); - virtual bool menu(MENU_TAG m); - - void cancella_rec(); - void aggiorna_att(const char*); - - TAgg_codatt() : _da(""), _a(""), _anno(0) {}; - virtual ~TAgg_codatt() {}; +#include +#include +#include +#include +#include +#include +#include +#include + +class TAgg_codatt : public TSkeleton_application +{ + TString16 _da, _a; + int _anno; + bool _pass; + +public: + virtual bool create(); + virtual bool destroy(); + virtual void main_loop(); + + void cancella_rec(); + void aggiorna_att(const char*); + TAgg_codatt() : _da(""), _a(""), _anno(0) {}; + virtual ~TAgg_codatt() {}; }; \ No newline at end of file diff --git a/cg/cg1306.h b/cg/cg1306.h index 200f8ec99..f555669b0 100755 --- a/cg/cg1306.h +++ b/cg/cg1306.h @@ -5,13 +5,11 @@ #include #include -class TAgg_datacomp : public TApplication +class TAgg_datacomp : public TSkeleton_application { void aggiorna_datacomp(); public: - virtual bool create(); - virtual bool destroy(); - virtual bool menu(MENU_TAG m); + virtual void main_loop(); TAgg_datacomp() {}; virtual ~TAgg_datacomp() {}; diff --git a/cg/cg1307.cpp b/cg/cg1307.cpp index 904306eb3..823ffd28d 100755 --- a/cg/cg1307.cpp +++ b/cg/cg1307.cpp @@ -28,7 +28,7 @@ const char* const APPNAME = TR("Righe prima nota errate"); class TElimina_zoppi : public TSkeleton_application { - TArray _files; +// TArray _files; TArray _decoders; protected: @@ -44,6 +44,7 @@ protected: static bool select_handler(TMask_field& f, KEY k); protected: + const char* decode(int num, const char* key, const char* field); virtual void main_loop(); }; diff --git a/cg/cg1500.cpp b/cg/cg1500.cpp index 62eb467f8..e27ee62d6 100755 --- a/cg/cg1500.cpp +++ b/cg/cg1500.cpp @@ -3577,27 +3577,23 @@ TDate TStampa_bilanci::UltimaData(int g, int c, long s, int anno) // Guy: E tu chi sei? const char* TStampa_bilanci::DescrizioneConto(int g, int c, long s, char tipocf) { - TString80 ragsoc; + static TString80 ragsoc; const char* desc = NULL; - TLocalisamfile pconti(LF_PCON); - TLocalisamfile clifo (LF_CLIFO); - pconti.zero(); - pconti.put(PCN_GRUPPO, g); + TString80 key; key << g; if (c != 0) - pconti.put(PCN_CONTO, c); + key << "|" << c ; if (s != 0) - pconti.put(PCN_SOTTOCONTO, s); - pconti.read(); - if (pconti.good()) + key << "|" << s; + const TRectype & pconti = cache().get(LF_PCON, key); + if (!pconti.empty()) _tmp = pconti.get(PCN_DESCR); else { - clifo.setkey(1); //occorre settare la chiave 1, anche se di solito e' di default, poiche' nella create il file clifo e' stato aperto con la chiave 3 - clifo.zero(); - clifo.put(CLI_CODCF, s); - clifo.put(CLI_TIPOCF,tipocf); - if (clifo.read() == NOERR) + key.format("%c|%ld", tipocf, s); + const TRectype & clifo = cache().get(LF_CLIFO, key); + + if (!clifo.empty()) { char tipoa = clifo.get_char("TIPOAPER"); if (tipoa == 'F') //persona fisica @@ -3617,8 +3613,10 @@ const char* TStampa_bilanci::DescrizioneConto(int g, int c, long s, char tipocf) } else _tmp = ""; + } return _tmp; + } bool TStampa_bilanci::user_create() diff --git a/cg/cg2.url b/cg/cg2.url deleted file mode 100755 index 443d0d3c4..000000000 --- a/cg/cg2.url +++ /dev/null @@ -1,19 +0,0 @@ -#include - -// Prima nota - -#include - SUBMENU M_FONT "~Opzioni" - -MENU M_FONT - ITEM MENU_ITEM(1) "~Colori righe" - -// Gestione movimenti provvisori - -MENUBAR MENU_BAR(1) - -MENU MENU_BAR(1) - SUBMENU M_FILE "~File" - SUBMENU M_HELP "~Help" - - diff --git a/cg/cg3.h b/cg/cg3.h index 0bbd58192..95075e40c 100755 --- a/cg/cg3.h +++ b/cg/cg3.h @@ -9,8 +9,6 @@ #define extern #endif -extern TString256 TMP; - #ifdef __MAIN__ #undef extern #endif diff --git a/cg/cg3.url b/cg/cg3.url deleted file mode 100755 index 99896b202..000000000 --- a/cg/cg3.url +++ /dev/null @@ -1,34 +0,0 @@ -#include - -#include - - -/* ---------------------------------------------------- - * cg3 -2 - * ---------------------------------------------------- */ - -MENUBAR MENU_BAR(2) - -MENU MENU_BAR(2) - SUBMENU M_FILE "~File" - ITEM BAR_ITEM(1) "~Scelta parametri" - ITEM BAR_ITEM(2) "~Ricalcolo" - ITEM BAR_ITEM(3) "~Disco" - -/* ---------------------------------------------------- - * cg3 -5 - * - * cg3600.cpp Mastrini a video - * ---------------------------------------------------- */ -MENUBAR MENU_BAR(5) - -MENU MENU_BAR(5) - SUBMENU M_FILE "~File" - SUBMENU M_FONT "~Opzioni" - SUBMENU M_HELP "~Help" - -MENU M_FONT - ITEM MENU_ITEM(1) "~Colori righe" - - - diff --git a/cg/cg3100.cpp b/cg/cg3100.cpp index 57a8819c2..d584dc574 100755 --- a/cg/cg3100.cpp +++ b/cg/cg3100.cpp @@ -36,33 +36,33 @@ bool annoes_handler(TMask_field&, KEY); bool data_inizio (TMask_field&, KEY); bool data_fine (TMask_field&, KEY); -HIDDEN const char* err_msg[] = {"La data operazione non appartiene a nessun esercizio", - "Anno IVA non compatibile con data operazione", - "Data operazione successiva all'esercizio di competenza", - "Movimento con competenza anno precedente", - "La data di competenza non appartiene a nessun esercizio", - "Data competenza incompatibile con data operazione", - "Esercizio incompatibile con data competenza", - "Codice causale non presente in tabella", - "Codice causale sospeso", - "Nella causale e' stato attivato il segnale non va in allegato", - "Tipo documento non corrisponde a quello indicato in causale", - "Tipo documento non presente in tabella", - "Codice registro non corrisponde a quello indicato in causale", - "Codice registro non presente in tabella", - "Codice registro sospeso", - "Tipo registro incompatibile con tipo documento", - "Non indicato codice cliente/fornitore", - "Tipo cliente/fornitore non compatibile con tipo registro", - "Codice cliente/fornitore sospeso", - "Nel cliente/fornitore e' stato attivato il segnale: non va in allegato", - "Indicato codice C/F per allegato che richiama se stesso", - "Indicato codice C/F per allegato sospeso", - "C/F per allegato riporta un altro C/F per allegato", - "Indicato codice C/F per allegato con segnale: non va in allegato", - "Indicato codice C/F per allegato non presente in anagrafica", - "Codice cliente/fornitore non presente in anagrafica", - "Movimento con data competenza diversa da data operazione"}; +HIDDEN const char* err_msg[] = {TR("La data operazione non appartiene a nessun esercizio"), + TR("Anno IVA non compatibile con data operazione"), + TR("Data operazione successiva all'esercizio di competenza"), + TR("Movimento con competenza anno precedente"), + TR("La data di competenza non appartiene a nessun esercizio"), + TR("Data competenza incompatibile con data operazione"), + TR("Esercizio incompatibile con data competenza"), + TR("Codice causale non presente in tabella"), + TR("Codice causale sospeso"), + TR("Nella causale e' stato attivato il segnale non va in allegato"), + TR("Tipo documento non corrisponde a quello indicato in causale"), + TR("Tipo documento non presente in tabella"), + TR("Codice registro non corrisponde a quello indicato in causale"), + TR("Codice registro non presente in tabella"), + TR("Codice registro sospeso"), + TR("Tipo registro incompatibile con tipo documento"), + TR("Non indicato codice cliente/fornitore"), + TR("Tipo cliente/fornitore non compatibile con tipo registro"), + TR("Codice cliente/fornitore sospeso"), + TR("Nel cliente/fornitore e' stato attivato il segnale: non va in allegato"), + TR("Indicato codice C/F per allegato che richiama se stesso"), + TR("Indicato codice C/F per allegato sospeso"), + TR("C/F per allegato riporta un altro C/F per allegato"), + TR("Indicato codice C/F per allegato con segnale: non va in allegato"), + TR("Indicato codice C/F per allegato non presente in anagrafica"), + TR("Codice cliente/fornitore non presente in anagrafica"), + TR("Movimento con data competenza diversa da data operazione")}; class TListaMov_application : public TPrintapp { @@ -76,7 +76,6 @@ class TListaMov_application : public TPrintapp TRigaiva_array _c; TTable * _tabiva, * _tabtpd, * _tabreg, * _tabes; - TLocalisamfile * _caus,* _comuni,* _rmoviva, * _clifo, * _pcon, * _attiv, *_nditte, *_saldi; TRelation * _relmov1,* _relmov2,* _relmov3; TCursor * _curr1, * _curr2, * _curr3; TBit_array _err; @@ -193,7 +192,7 @@ bool data_inizio(TMask_field& f, KEY k) { if (data < inizio) { - f.error_box("La data indicata non deve essere inferiore alla data di inizio esercizio"); + f.error_box(TR("La data indicata non deve essere inferiore alla data di inizio esercizio")); return FALSE; } } @@ -219,7 +218,7 @@ bool data_fine(TMask_field& f, KEY k) if ( dataini.ok() && datafin.ok() ) if (dataini > datafin) { - f.error_box("La data iniziale non deve essere superiore alla data finale"); + f.error_box(TR("La data iniziale non deve essere superiore alla data finale")); return FALSE; } @@ -232,7 +231,7 @@ bool data_fine(TMask_field& f, KEY k) { if (datafin > fine) { - f.error_box("La data indicata non deve essere superiore alla data di fine esercizio successivo, oppure, in caso questo non esista, dell'esercizio indicato"); + f.error_box(TR("La data indicata non deve essere superiore alla data di fine esercizio successivo, oppure, in caso questo non esista, dell'esercizio indicato")); return FALSE; } } @@ -277,55 +276,47 @@ bool TListaMov_application::RicercaDoc(const char * tipo) void TListaMov_application::compila_clifo() { - _clifo->setkey(1); - _clifo->zero(); - _clifo->put(CLI_TIPOCF,_tipo_elenco); - _clifo->put(CLI_CODCF,_codcf); - _clifo->read(); - if (_clifo->bad()) - _clifo->zero(); - else + TToken_string key; + key.add(_tipo_elenco); + key.add(_codcf); + const TRectype & clifo = cache().get(LF_CLIFO, key); + + char tipoa = clifo.get_char("TIPOAPER"); + _alleg = clifo.get_int(CLI_ALLEG); + _statocf = clifo.get(CLI_STATOCF); + _comcf = clifo.get(CLI_COMCF); + _ragsoc = clifo.get(CLI_RAGSOC); + if (tipoa == 'F') { - char tipoa = _clifo->curr().get_char("TIPOAPER"); - _alleg = _clifo->curr().get_int(CLI_ALLEG); - _statocf = _clifo->curr().get(CLI_STATOCF); - _comcf = _clifo->curr().get(CLI_COMCF); - _ragsoc = _clifo->curr().get(CLI_RAGSOC); - if (tipoa == 'F') - { - TString80 cognome, nome; - cognome = _ragsoc.mid(0,30); - nome = _ragsoc.mid(30,20); - cognome.trim(); nome.trim(); - _ragsoc = cognome; - _ragsoc << " " << nome; - } - _indcf = _clifo->curr().get(CLI_INDCF); - _civcf = _clifo->curr().get(CLI_CIVCF); - _paiv = _clifo->curr().get(CLI_PAIV); - _capcf = _clifo->curr().get(CLI_CAPCF); - _dencom = _clifo->curr().get(CLI_LOCCF); - _cofi = _clifo->curr().get(CLI_COFI); - _codalleg = _clifo->curr().get_long(CLI_CODALLEG); + TString80 cognome, nome; + cognome = _ragsoc.mid(0,30); + nome = _ragsoc.mid(30,20); + cognome.trim(); nome.trim(); + _ragsoc = cognome; + _ragsoc << " " << nome; } + _indcf = clifo.get(CLI_INDCF); + _civcf = clifo.get(CLI_CIVCF); + _paiv = clifo.get(CLI_PAIV); + _capcf = clifo.get(CLI_CAPCF); + _dencom = clifo.get(CLI_LOCCF); + _cofi = clifo.get(CLI_COFI); + _codalleg = clifo.get_long(CLI_CODALLEG); } void TListaMov_application::compila_comuni() { - _comuni->setkey(1); - _comuni->zero(); - _comuni->put(COM_STATO,_statocf); - _comuni->put(COM_COM,_comcf); - _comuni->read(); - if (_comuni->bad()) - _comuni->curr().zero(); + TToken_string key; + key.add(_statocf); + key.add(_comcf); + const TRectype & comuni = cache().get(LF_COMUNI, key); //modifica del 26/04/1995 - _dencom = _comuni->get(COM_DENCOM); + _dencom = comuni.get(COM_DENCOM); if (!_dencom.empty()) _app = "Com"; else _app = "Loc"; //fine modifica - _provcom = _comuni->get(COM_PROVCOM); + _provcom = comuni.get(COM_PROVCOM); } const int AllegClifo (int gruppo, int conto, long sottoconto) @@ -350,83 +341,55 @@ const int AllegClifo (int gruppo, int conto, long sottoconto) const char * DescrConto (long gruppo, long conto, long sottoconto, const char* tipocf) { - TString80 ragsoc; - const char* desc = NULL; - TLocalisamfile pcon (LF_PCON); - TLocalisamfile clifo(LF_CLIFO); + TString key(30); + TString & tmp = get_tmp_string(50); - pcon.setkey(1); - pcon.zero(); - pcon.put(PCN_GRUPPO, gruppo); + key << gruppo; if (conto != 0) - pcon.put(PCN_CONTO, conto); + key << '|' << conto; if (sottoconto != 0) - pcon.put(PCN_SOTTOCONTO,sottoconto); - pcon.read(); - if (pcon.good()) - TMP = pcon.curr().get(PCN_DESCR); - else + key << '|' << sottoconto; + tmp = cache().get(LF_PCON, key, PCN_DESCR); + + if (tmp.empty()) { - clifo.setkey(1); - clifo.zero(); - clifo.put(CLI_CODCF, sottoconto); - clifo.put(CLI_TIPOCF,tipocf); - if (clifo.read() == NOERR) + key.format("%s|%ld",tipocf , sottoconto); + + const TRectype & clifo = cache().get(LF_CLIFO, key); + if (!clifo.empty()) { char tipoa = clifo.get_char("TIPOAPER"); if (tipoa == 'F') //persona fisica { - TString80 cognome, nome; - ragsoc = clifo.get("RAGSOC"); - cognome = ragsoc.mid(0,30); - nome = ragsoc.mid(30,20); - cognome.trim(); nome.trim(); - ragsoc = cognome; - ragsoc << " " << nome; - desc = ragsoc; + const TString & ragsoc = clifo.get("RAGSOC"); + + tmp = ragsoc.mid(0,30); + tmp.trim(); + tmp << ' ' << ragsoc.mid(30); } else - desc = clifo.get("RAGSOC"); - TMP = desc; + tmp = clifo.get("RAGSOC"); } - else - TMP = ""; } - return TMP; + return tmp; } bool CausAlleg (const char * cod) { - TLocalisamfile caus(LF_CAUSALI); - bool allegb; - - caus.setkey(1); - caus.zero(); - caus.put(CAU_CODCAUS,cod); - caus.read(); - if (caus.bad()) - caus.zero(); - allegb = caus.get_bool(CAU_ALLEG); + const TRectype & caus = cache().get(LF_CAUSALI, cod); + const bool allegb = caus.get_bool(CAU_ALLEG); return allegb; } const char * TipoAttivita (const char * attreg, long codice_ditta) { - TLocalisamfile attiv(LF_ATTIV); + TToken_string key; + key.add(codice_ditta); + key.add(attreg); + const TRectype & attiv = cache().get(LF_ATTIV, key); - attiv.setkey(1); - attiv.zero(); - attiv.put(ATT_CODDITTA, codice_ditta); - attiv.put(ATT_CODATT, attreg); - - attiv.read(); - if (attiv.good()) - TMP = attiv.curr().get(ATT_TIPOATT); - else - TMP = ""; - - return TMP; + return attiv.get(ATT_TIPOATT); } const TString& TListaMov_application::SimboloValuta(const char* cod) @@ -441,26 +404,18 @@ const TString& TListaMov_application::DescrDoc(const char* tipo) const char * AttivitaRegistro (const char * cod, int anno) { - TTable tab_reg("REG"); - TString16 codtab; codtab.format ("%04d%-3s", anno, cod); - - tab_reg.zero(); + TString16 key; + + key.format ("%04d%-3s", anno, cod); - tab_reg.put("CODTAB", codtab); - tab_reg.read(); - - if (tab_reg.good()) - TMP = tab_reg.get("S8"); - else - TMP = ""; - - return TMP; + return cache().get("REG", key, "S8"); } int CodiceRegistro (const char* cod, int anno) { TString16 codtab; codtab.format("%4d%-3s", anno, cod); const TString& tipo_reg = cache().get("REG", codtab, "I0"); + return atoi(tipo_reg); } @@ -612,75 +567,72 @@ void TListaMov_application::stampa_errori_rmov() _nr++; if (anno != _annoeser || datareg != _datareg) - set_row(_nr++, "@11gUno o piu' campi non sono costanti nella riga dell' operazione"); + set_row(_nr++, FR("@11gUno o piu' campi non sono costanti nella riga dell' operazione")); if (sez != 'D' && sez != 'A') - set_row(_nr++, "@11gIndicato tipo movimento Dare/Avere errato"); + set_row(_nr++, FR("@11gIndicato tipo movimento Dare/Avere errato")); if (tc.empty()) - set_row(_nr++, "@11gNon presente codice gruppo/conto/sottoconto"); + set_row(_nr++, FR("@11gNon presente codice gruppo/conto/sottoconto")); if (!tc.ok()) - set_row(_nr++, "@11gCodice gruppo/conto/sottoconto non corrisponde ad un sottoconto"); + set_row(_nr++, FR("@11gCodice gruppo/conto/sottoconto non corrisponde ad un sottoconto")); - TRectype pc (_pcon->curr()); + TRectype pc (LF_PCON); tc.set(gruppo,0,0l); if (!tc.read(pc)) g = TRUE; tc.set(gruppo,conto,0l); if (!tc.read(pc)) - set_row(_nr++, "@11gCodice gruppo/conto/sottoconto non presente in Piano dei Conti"); + set_row(_nr++, FR("@11gCodice gruppo/conto/sottoconto non presente in Piano dei Conti")); else { t = pc.get_char(PCN_TMCF); if (t != tipo) - set_row(_nr++, "@11gIl tipo C/F indicato non corrisponde a quello presente su Piano dei Conti"); + set_row(_nr++, FR("@11gIl tipo C/F indicato non corrisponde a quello presente su Piano dei Conti")); else { tc.set(gruppo,conto,sottoconto); if (t != 'C' && t != 'F') { if (!tc.read(pc) || g ) - set_row(_nr++, "@11gCodice gruppo/conto/sottoconto non presente in Piano dei Conti"); + set_row(_nr++, FR("@11gCodice gruppo/conto/sottoconto non presente in Piano dei Conti")); else { bool sosp = tc.sospeso(); if (sosp) - set_row(_nr++, "@11gCodice gruppo/conto/sottoconto sospeso in Piano dei Conti"); + set_row(_nr++, FR("@11gCodice gruppo/conto/sottoconto sospeso in Piano dei Conti")); } } else { - TLocalisamfile clifo(LF_CLIFO); - clifo.setkey(1); - clifo.zero(); - clifo.put(CLI_CODCF, sottoconto); - clifo.put(CLI_TIPOCF,t); - if (clifo.read() == NOERR) + TToken_string key; + key.add(t); + key.add(sottoconto); + const TRectype & clifo = cache().get(LF_CLIFO, key); + + if (!clifo.empty()) { bool sosp = clifo.get_bool(CLI_SOSPESO); if (sosp) - set_row(_nr++, "@11gCodice C/F sospeso in Anagrafica"); + set_row(_nr++, FR("@11gCodice C/F sospeso in Anagrafica")); } - else set_row(_nr++, "@11gCodice C/F non presente in Anagrafica"); + else set_row(_nr++, FR("@11gCodice C/F non presente in Anagrafica")); if (_registro.not_empty()) //se su mov e' indicato il codice registro { TRegistro rg (_registro, _ae); const int tiporeg = rg.tipo(); if ((tiporeg == 1 && t != 'C') || (tiporeg == 2 && t != 'F')) - set_row(_nr++, "@11gTipo C/F non compatibile con tipo registro"); + set_row(_nr++, FR("@11gTipo C/F non compatibile con tipo registro")); } } } } - TLocalisamfile saldi(LF_SALDI); - saldi.setkey(1); - saldi.zero(); - saldi.put(SLD_ANNOES,anno); - saldi.put(SLD_GRUPPO,gruppo); - saldi.put(SLD_CONTO, conto); - saldi.put(SLD_SOTTOCONTO,sottoconto); - saldi.put(SLD_FLSCA, ""); + TString key(30); - if (saldi.read() != NOERR) - set_row(_nr++, "@11gCodice gruppo/conto/sottoconto non presente in Saldi p.d.c."); + key.format("%d||%d|%d|%ld", anno, gruppo, conto, sottoconto); + + const TRectype & saldi = cache().get(LF_SALDI, key); + + if (saldi.empty()) + set_row(_nr++, FR("@11gCodice gruppo/conto/sottoconto non presente in Saldi p.d.c.")); if (gruppoc != 0 || contoc != 0 || sottocontoc != 0l) stampa_errori_contropartita(gruppoc, contoc, sottocontoc, tipoc); @@ -691,13 +643,13 @@ void TListaMov_application::stampa_errori_contropartita(int gruppo, int conto, l bool g = FALSE; TBill tc; - TRectype pc (_pcon->curr()); + TRectype pc (LF_PCON); tc.set(gruppo,0,0l); if (!tc.read(pc)) g = TRUE; tc.set(gruppo,conto,0l); if (!tc.read(pc)) - set_row(_nr++, "@11gCodice gruppo/conto/sottoconto di contropartita non presente in Piano dei Conti"); + set_row(_nr++, FR("@11gCodice gruppo/conto/sottoconto di contropartita non presente in Piano dei Conti")); else { //t = pc.get_char(PCN_TMCF); @@ -705,28 +657,28 @@ void TListaMov_application::stampa_errori_contropartita(int gruppo, int conto, l if (t != 'C' && t != 'F') { if (!tc.read(pc) || g ) - set_row(_nr++, "@11gCodice gruppo/conto/sottoconto di contropartita non presente in Piano dei Conti"); + set_row(_nr++, FR("@11gCodice gruppo/conto/sottoconto di contropartita non presente in Piano dei Conti")); else { bool sosp = tc.sospeso(); if (sosp) - set_row(_nr++, "@11gCodice gruppo/conto/sottoconto di contropartita sospeso in Piano dei Conti"); + set_row(_nr++, FR("@11gCodice gruppo/conto/sottoconto di contropartita sospeso in Piano dei Conti")); } } else if (sottoconto != 0l) { - TLocalisamfile clifo(LF_CLIFO); - clifo.setkey(1); - clifo.zero(); - clifo.put(CLI_CODCF, sottoconto); - clifo.put(CLI_TIPOCF,t); - if (clifo.read() == NOERR) + TToken_string key; + key.add(t); + key.add(sottoconto); + const TRectype & clifo = cache().get(LF_CLIFO, key); + + if (!clifo.empty()) { bool sosp = clifo.get_bool(CLI_SOSPESO); if (sosp) - set_row(_nr++, "@11gCodice C/F di contropartita sospeso in Anagrafica"); + set_row(_nr++, FR("@11gCodice C/F di contropartita sospeso in Anagrafica")); } - else set_row(_nr++, "@11gCodice C/F di contropartita non presente in Anagrafica"); + else set_row(_nr++, FR("@11gCodice C/F di contropartita non presente in Anagrafica")); } } } @@ -742,25 +694,25 @@ void TListaMov_application::stampa_errori_iva(int* nr, const char* cod, const in int allf = tab_iva.get_int("S8"); bool s = tab_iva.get_bool("B2"); if (s) - set_row(++(*nr), "@11gCodice IVA sospeso"); + set_row(++(*nr), FR("@11gCodice IVA sospeso")); if (_stampa_mess_alleg_iva) if (allc == 0 || allf == 0) - set_row(++(*nr), "@11gSul Codice IVA non e' stato indicato un valore per allegato"); + set_row(++(*nr), FR("@11gSul Codice IVA non e' stato indicato un valore per allegato")); } else - set_row(++(*nr), "@11gCodice IVA non presente in tabella"); + set_row(++(*nr), FR("@11gCodice IVA non presente in tabella")); if (tipodet == 1 || tipodet == 3 || tipodet == 5 || tipodet == 9) if (_tiporegistro != 2) - set_row(++(*nr), "@11gCodice di indetraibilita' errato"); + set_row(++(*nr), FR("@11gCodice di indetraibilita' errato")); if (_tiporegistro == 1) if (tipocr != 0 && tipocr != 1 && tipocr != 4 && tipocr != 9) - set_row(++(*nr), "@11gTipo costo/ricavo non valido"); + set_row(++(*nr), FR("@11gTipo costo/ricavo non valido")); if (_tiporegistro == 2) if (tipocr != 0 && tipocr != 1 && tipocr != 2 && tipocr != 3 && tipocr != 5 && tipocr != 8 && tipocr != 9) - set_row(++(*nr), "@11gTipo costo/ricavo non valido"); + set_row(++(*nr), FR("@11gTipo costo/ricavo non valido")); } void TListaMov_application::stampa_errori_mov() @@ -845,11 +797,11 @@ void TListaMov_application::set_page(int file, int count) { _n = 1; set_row (_n++,""); - set_row (_n, "Operazione n. @14g@7n", FLD(LF_MOV,MOV_NUMREG)); - set_row (_n, "@22gdel@26g@d",FLD(LF_MOV,MOV_DATAREG)); + set_row (_n, FR("Operazione n. @14g@7n"), FLD(LF_MOV,MOV_NUMREG)); + set_row (_n, FR("@22gdel@26g@d"),FLD(LF_MOV,MOV_DATAREG)); set_row (_n, "@37g@36s",FLD(LF_MOV,MOV_DESCR)); - set_row (_n, "@75gdoc. @7s",FLD(LF_MOV,MOV_NUMDOC)); - set_row (_n, "@88gdel@92g@d", FLD(LF_MOV,MOV_DATADOC)); + set_row (_n, FR("@75gdoc. @7s"),FLD(LF_MOV,MOV_NUMDOC)); + set_row (_n, FR("@88gdel@92g@d"), FLD(LF_MOV,MOV_DATADOC)); int annoese = current_cursor()->curr(LF_MOV).get_int(MOV_ANNOES); TDate data = current_cursor()->curr(LF_MOV).get_date(MOV_DATAREG); TDate dcomp = current_cursor()->curr(LF_MOV).get_date(MOV_DATACOMP); @@ -862,17 +814,11 @@ void TListaMov_application::set_page(int file, int count) int ae = esc.date2esc(data); if ( (tipo == 1) || (tipo == 2) ) { - set_row (_n, "@103greg @3s",FLD(LF_MOV,MOV_REG)); - set_row (_n, "@111gpr @5n",FLD(LF_MOV,MOV_PROTIVA)); + set_row (_n, FR("@103greg @3s"),FLD(LF_MOV,MOV_REG)); + set_row (_n, FR("@111gpr @5n"),FLD(LF_MOV,MOV_PROTIVA)); } else if (_provvis == 2 && prov >= ' ') - set_row (_n, "@103gMov.Provvisorio"); - //15/12/1995 - /* - if (ae != annoese) - if (_annoes == 0) //se non indicato l'anno nella maschera - set_row (_n, "@120gcomp @4n", FLD(LF_MOV,MOV_ANNOES)); - */ + set_row (_n, FR("@103gMov.Provvisorio")); if (data != dcomp) set_row (_n, "@119gc.%s", (const char*)dcomp.string(brief, '-')); //fine @@ -889,25 +835,22 @@ void TListaMov_application::stampa_intestazione() { set_row (1,""); if (_tipo_elenco == "C") - set_row (2, "@bCliente@8g@6n", FLD(LF_MOV,MOV_CODCF)); + set_row (2, FR("@bCliente@8g@6n"), FLD(LF_MOV,MOV_CODCF)); else - set_row (2, "@bFornitore@10g@6n", FLD(LF_MOV,MOV_CODCF)); + set_row (2, FR("@bFornitore@10g@6n"), FLD(LF_MOV,MOV_CODCF)); set_row (2, "@b@18g#.35t", &_ragsoc); - //set_row (2, "@b@54gInd #.29t", &_indcf); - //set_row (2, "@b@84g#.10t", &_civcf); - set_row (2, "@b@54gInd #-.29t #-.10t", &_indcf, &_civcf); - set_row (2, "@b@98gP.I. #11t", &_paiv); + set_row (2, FR("@b@54gInd #-.29t #-.10t"), &_indcf, &_civcf); + set_row (2, FR("@b@98gP.I. #11t"), &_paiv); if (_alleg == 0) - set_row (2, "@b@121gAllegato SI"); + set_row (2, FR("@b@121gAllegato SI")); else - set_row (2, "@b@121gAllegato NO"); - set_row (3, "@b@54gCap #5t", &_capcf); + set_row (2, FR("@b@121gAllegato NO")); + set_row (3, FR("@b@54gCap #5t"), &_capcf); set_row (3,"@b@64g%s #-.20t Pr #-.5t", (const char*)_app, &_dencom, &_provcom); - //set_row (3,"@b@89gPr #-.5t", &_provcom); - set_row (3, "@b@98gC.F. #-16t", &_cofi); + set_row (3, FR("@b@98gC.F. #-16t"), &_cofi); if (_alleg == 0) - set_row (3, "@b@120gRifer@126g#6d", &_codalleg); + set_row (3, FR("@b@120gRifer@126g#6d"), &_codalleg); } bool TListaMov_application::preprocess_page(int file,int counter) @@ -969,16 +912,13 @@ bool TListaMov_application::preprocess_page(int file,int counter) a.put(MOV_REG, _registro_fin); if ((fl.curr() >= da) && (fl.curr() <= a)) - { - _caus->setkey(1); - _caus->curr().put(CAU_CODCAUS,_causale); - _caus->read(); - if (_caus->bad()) - _caus->curr().zero(); - _reg_causale = _caus->curr().get(CAU_REG); - _descr_causale = _caus->curr().get(CAU_DESCR); - _alleg_causale = _caus->curr().get_bool(CAU_ALLEG); - _tipodocumento = _caus->curr().get(CAU_TIPODOC); + { + const TRectype & caus = cache().get(LF_CAUSALI, _causale); + + _reg_causale = caus.get(CAU_REG); + _descr_causale = caus.get(CAU_DESCR); + _alleg_causale = caus.get_bool(CAU_ALLEG); + _tipodocumento = caus.get(CAU_TIPODOC); if (_controllo_mov_errati == 1 || _controllo_mov_errati == 2) { @@ -1074,14 +1014,11 @@ bool TListaMov_application::preprocess_page(int file,int counter) if ((fl->curr() >= da) && (fl->curr() <= a)) { - _caus->setkey(1); - _caus->curr().put(CAU_CODCAUS,_causale); - _caus->read(); - if (_caus->bad()) - _caus->curr().zero(); - _descr_causale = _caus->curr().get(CAU_DESCR); - _alleg_causale = _caus->curr().get_bool(CAU_ALLEG); - _tipodocumento = _caus->curr().get(CAU_TIPODOC); + const TRectype & caus = cache().get(LF_CAUSALI, _causale); + + _descr_causale = caus.get(CAU_DESCR); + _alleg_causale = caus.get_bool(CAU_ALLEG); + _tipodocumento = caus.get(CAU_TIPODOC); _tiporegistro = CodiceRegistro (_registro, _anno); @@ -1205,13 +1142,13 @@ bool TListaMov_application::preprocess_page(int file,int counter) int gruppo = current_cursor()->curr(LF_RMOV).get_int(RMV_GRUPPO); int conto = current_cursor()->curr(LF_RMOV).get_int(RMV_CONTO); - _pcon->zero(); - _pcon->put("GRUPPO",gruppo); - _pcon->put("CONTO", conto); - _pcon->put("SOTTOCONTO", 0L); + TToken_string key; + key.add(gruppo); + key.add(conto); + key.add(""); + const TRectype & pcon = cache().get(LF_PCON, key); - if (_pcon->read() == NOERR) - _ricser = _pcon->get_int("RICSER"); + _ricser = pcon.get_int("RICSER"); _simbolo = SimboloValuta(_codval); _allegb = CausAlleg(_codcaus); @@ -1295,11 +1232,11 @@ void TListaMov_application::print_intra(int& rr) const TCurrency cl(mov.get_real(MOV_CORRLIRE)); str = cl.string(TRUE); str.right_just(19); - set_row(rr,"Corrispettivo@14g%s", (const char*)str); + set_row(rr,FR("Corrispettivo@14g%s"), (const char*)str); const TCurrency cv(corrval, codval); str = cv.string(TRUE); str.right_just(19); - set_row(rr,"@34gCorr.in valuta@49g%s", (const char*)str); + set_row(rr,FR("@34gCorr.in valuta@49g%s"), (const char*)str); set_row(rr,"@70g%-3s", (const char*)codval); } @@ -1330,8 +1267,6 @@ print_action TListaMov_application::postprocess_page(int file,int count) if (_registro.not_empty() && _mov_di_sola_iva) { compila_clifo(); - // set_row(++r, "@1g%3s %-.19s@25g%-35s %6ld %-50s", (const char*)_causale, (const char*)_descr_causale, - // (const char*) _descr_doc, _codcf, (const char*)_ragsoc); set_row(++r, "@1g%3s %-50s %6ld %-50s", (const char*)_causale, (const char*)_descr_causale, _codcf, (const char*)_ragsoc); } if ( _scelta_stampa == 0 && _stampa_parte_iva ) @@ -1341,18 +1276,18 @@ print_action TListaMov_application::postprocess_page(int file,int count) TRigaiva& riga = (TRigaiva&)_c[j]; //r = j+1; r++; - set_row(r, "Imponibile@11g%r", &riga._imponibile); - set_row(r, "@31gImposta@38g%r", &riga._imposta); - set_row(r, "@58gCodice Iva@69g%3s", (const char*)riga._codiva); + set_row(r, FR("Imponibile@11g%r"), &riga._imponibile); + set_row(r, FR("@31gImposta@38g%r"), &riga._imposta); + set_row(r, FR("@58gCodice Iva@69g%3s"), (const char*)riga._codiva); switch (riga._tipodet) { - case 0 : set_row(r, "@76gDetraibile"); + case 0 : set_row(r, FR("@76gDetraibile")); break; - case 1 : set_row(r, "@76gIndetraibile su op.es."); + case 1 : set_row(r, FR("@76gIndetraibile su op.es.")); break; - case 3 : set_row(r, "@76gPassaggi interni"); + case 3 : set_row(r, FR("@76gPassaggi interni")); break; - case 9 : set_row(r, "@76gIndetraibile art.19"); + case 9 : set_row(r, FR("@76gIndetraibile art.19")); break; default: break; } @@ -1361,19 +1296,19 @@ print_action TListaMov_application::postprocess_page(int file,int count) { const int meseliq = current_cursor()->file(LF_MOV).get_int(MOV_MESELIQ); if (meseliq > 0) // Stampa il mese liquidazione - set_row(r," Mese liq. %2d", meseliq); + set_row(r,FR(" Mese liq. %2d"), meseliq); } if (riga._intra) - set_row(r, "@111gOper.intrac."); + set_row(r, FR("@111gOper.intrac.")); if (_controllo_mov_errati != 3) if (!_esiste_riga_iva && ! _nonesiste_riga_iva) stampa_errori_iva(&r, riga._codiva, riga._tipodet, riga._tipocr); } print_intra(r); if (_esiste_riga_iva) - set_row(++r, "@11gPresenti righe IVA in una registrazione senza IVA"); + set_row(++r, FR("@11gPresenti righe IVA in una registrazione senza IVA")); if (_nonesiste_riga_iva) - set_row(++r, "@11gNon presente alcuna riga IVA in una registrazione con IVA"); + set_row(++r, FR("@11gNon presente alcuna riga IVA in una registrazione con IVA")); _c.destroy(); } if (r > 0) @@ -1381,7 +1316,7 @@ print_action TListaMov_application::postprocess_page(int file,int count) TRecnotype pos, items; bool FINITO = FALSE; if ((_scelta_stampa == 0)&&(_controllo_mov_errati != 3)&&(_tot_dare != _tot_avere)) - set_row(n++, "@11gIl movimento risulta sbilanciato"); + set_row(n++, FR("@11gIl movimento risulta sbilanciato")); pos = current_cursor()->pos(); items = current_cursor()->items(); @@ -1413,7 +1348,7 @@ print_action TListaMov_application::postprocess_page(int file,int count) { if (( _scelta_stampa == 0 && _controllo_mov_errati != 1 && _decidi == 2) || (_scelta_stampa == 1 && _decidi == 2)) { - set_row(n, "@b@60gTotali del giorno %s", _datareg.string()); + set_row(n, FR("@b@60gTotali del giorno %s"), _datareg.string()); set_row(n++, "@b@90g%r %r", &_tot_dare_giornaliero, &_tot_avere_giornaliero); _tot_avere_giornaliero = 0; _tot_dare_giornaliero = 0; @@ -1421,7 +1356,7 @@ print_action TListaMov_application::postprocess_page(int file,int count) if ((_scelta_stampa == 0 && _controllo_mov_errati != 1 && FINITO) || (_scelta_stampa == 1 && FINITO)) { set_row(n++,""); - set_row(n, "@b@60gTotale generale"); + set_row(n, FR("@b@60gTotale generale")); set_row(n++, "@b@90g%r %r", &_tot_dare_generale, &_tot_avere_generale); } } @@ -1473,9 +1408,9 @@ break; TString blank = ""; set_row(rr++,(const char*)blank); if ((_tipo_elenco == "C")||(_tipo_elenco == "c")) - set_row(rr++, "@bTotali Cliente@18gDocumenti Totale documenti@47gAllegati:@63gImponibile@82gImposta@95gop. esenti@110gop. non imp."); + set_row(rr++, FR("@bTotali Cliente@18gDocumenti Totale documenti@47gAllegati:@63gImponibile@82gImposta@95gop. esenti@110gop. non imp.")); else - set_row(rr++, "@bTotali Fornitore@18gDocumenti Totale documenti@49gAllegati:@63gImponibile@82gImposta@95gop. esenti@110gop. non imp."); + set_row(rr++, FR("@bTotali Fornitore@18gDocumenti Totale documenti@49gAllegati:@63gImponibile@82gImposta@95gop. esenti@110gop. non imp.")); set_row(rr, "@b@18g%9d", _documenti); set_row(rr, "@b@28g%r", &_totdocumenti); set_row(rr, "@b@56g%r", &_totimponibile); @@ -1567,11 +1502,12 @@ bool TListaMov_application::segnala_errori_primariga() if (_causale.not_empty()) //se indicata la causale { - if (_caus->curr().empty()) + const TRectype & caus = cache().get(LF_CAUSALI, _causale); + if (caus.empty()) _err.set(7); else { - bool sos = _caus->curr().get_bool(CAU_SOSPESO); + bool sos = caus.get_bool(CAU_SOSPESO); if (sos) _err.set(8); if (_stampa_mess_alleg_iva && _alleg_causale) @@ -1579,11 +1515,6 @@ bool TListaMov_application::segnala_errori_primariga() } if (_tipodoc != _tipodocumento) _err.set(10); - /* - if (_tipodoc != "") - if (!RicercaDoc(_tipodoc)) - _err.set(11); - */ if (_registro != _reg_causale) _err.set(12); @@ -1620,12 +1551,12 @@ bool TListaMov_application::segnala_errori_primariga() if ((tipo == 1 && _tipo_elenco != "C") || (tipo == 2 && _tipo_elenco != "F")) _err.set(17); - TLocalisamfile clifo(LF_CLIFO); - clifo.setkey(1); - clifo.zero(); - clifo.put(CLI_CODCF, _codcf); - clifo.put(CLI_TIPOCF,_tipo_elenco); - if (clifo.read() == NOERR) + TToken_string key; + key.add(_tipo_elenco); + key.add(_codcf); + const TRectype & clifo = cache().get(LF_CLIFO, key); + + if (!clifo.empty()) { bool sosp = clifo.get_bool(CLI_SOSPESO); if (sosp) @@ -1641,10 +1572,11 @@ bool TListaMov_application::segnala_errori_primariga() { if (calleg == _codcf) _err.set(20); - clifo.zero(); - clifo.put(CLI_CODCF, calleg); - clifo.put(CLI_TIPOCF,_tipo_elenco); - if (clifo.read() == NOERR) + TToken_string key; + key.add(_tipo_elenco); + key.add(calleg); + const TRectype & clifo = cache().get(LF_CLIFO, key); + if (!clifo.empty()) { bool sospall = clifo.get_bool(CLI_SOSPESO); long codall = clifo.get_long(CLI_CODALLEG); @@ -1675,7 +1607,7 @@ bool TListaMov_application::segnala_errori_primariga() bool TListaMov_application::contropartita(int gruppo, int conto, long sottoconto, char t) { TBill tc; - TRectype pc (_pcon->curr()); + TRectype pc (LF_PCON); tc.set(gruppo,0,0l); if (!tc.read(pc)) return TRUE; @@ -1697,12 +1629,12 @@ bool TListaMov_application::contropartita(int gruppo, int conto, long sottoconto } else if (sottoconto != 0l) { - TLocalisamfile clifo(LF_CLIFO); - clifo.setkey(1); - clifo.zero(); - clifo.put(CLI_CODCF, sottoconto); - clifo.put(CLI_TIPOCF,t); - if (clifo.read() == NOERR) + TToken_string key; + key.add(t); + key.add(sottoconto); + const TRectype & clifo = cache().get(LF_CLIFO, key); + + if (!clifo.empty()) { bool sosp = clifo.get_bool(CLI_SOSPESO); if (sosp) @@ -1784,7 +1716,7 @@ bool TListaMov_application::segnala_errori_ogniriga() rmov.readat(nrec); return TRUE; } - TRectype pc (_pcon->curr()); + TRectype pc (LF_PCON); tc.set(gruppo,0,0l); if (!tc.read(pc)) @@ -1824,12 +1756,12 @@ bool TListaMov_application::segnala_errori_ogniriga() } else { - TLocalisamfile clifo(LF_CLIFO); - clifo.setkey(1); - clifo.zero(); - clifo.put(CLI_CODCF, sottoconto); - clifo.put(CLI_TIPOCF,t); - if (clifo.read() == NOERR) + TToken_string key; + key.add(t); + key.add(sottoconto); + const TRectype & clifo = cache().get(LF_CLIFO, key); + + if (!clifo.empty()) { bool sosp = clifo.get_bool(CLI_SOSPESO); if (sosp) @@ -2089,7 +2021,6 @@ void TListaMov_application::imposta_parametri_stampa(const TMask& msk) _codice_fin = atol(msk.get(F_CODICEFIN1)); } - // _relmov->add(LF_MOV, "NUMREG=NUMREG",1, LF_RMOVIVA,100); //creo un alias per il file LF_MOV if (tipo == "E") { _tipo_ini = "C"; @@ -2226,14 +2157,8 @@ bool TListaMov_application::user_create() _curr3 = new TCursor (_relmov3, "", 3); _cur3 = add_cursor (_curr3); - _caus = new TLocalisamfile(LF_CAUSALI); - _clifo = new TLocalisamfile(LF_CLIFO); - _comuni = new TLocalisamfile(LF_COMUNI); - _attiv = new TLocalisamfile(LF_ATTIV); - _pcon = new TLocalisamfile(LF_PCON); - _saldi = new TLocalisamfile(LF_SALDI); - _rmoviva = new TLocalisamfile(LF_RMOVIVA); - _nditte = new TLocalisamfile(LF_NDITTE); + open_files(LF_TAB, LF_TABCOM, LF_CAUSALI, LF_CLIFO, LF_COMUNI, LF_ATTIV, + LF_PCON, LF_SALDI, LF_RMOVIVA, LF_NDITTE, 0); _tabiva = new TTable(TAB_IVA); _tabtpd = new TTable(TAB_TPD); _tabreg = new TTable("REG"); @@ -2247,17 +2172,10 @@ bool TListaMov_application::user_destroy() // releasev e arrmask delete _relmov1; delete _relmov2; delete _relmov3; - delete _clifo; - delete _caus; - delete _pcon; - delete _attiv; - delete _comuni; delete _tabiva; delete _tabreg; delete _tabtpd; delete _tabes; - delete _rmoviva; - delete _saldi; return TRUE; @@ -2416,44 +2334,32 @@ void TListaMov_application::set_cdc_header(int& soh) if (_fsc.not_empty()) { const TString& desc_fsc = cache().get("FSC", _fsc, "S0"); - set_header(++soh, "@bCommessa %s %s - Fase %s %s", + set_header(++soh, FR("@bCommessa %s %s - Fase %s %s"), (const char*)_cdc, (const char*)desc_cdc, (const char*)_fsc, (const char*)desc_fsc); } else - set_header(++soh, "@bCommessa %s %s", (const char*)_cdc, (const char*)desc_cdc); + set_header(++soh, FR("@bCommessa %s %s"), (const char*)_cdc, (const char*)desc_cdc); } - /* - if (_cdc.not_empty()) - { - TString str; - str.cut(0) << "@bCommessa " << _cdc << " - " << cache().get("CMS", _cdc, "S0"); - set_header(++soh, str); - } - */ } void TListaMov_application::preprocess_header() { int soh; // riga d'inizio dell'intestazione - TString sep(132); - TString ragsoc(50); - TLocalisamfile nditte(LF_NDITTE); - - nditte.zero(); - nditte.put(NDT_CODDITTA, get_firm()); - if (nditte.read() == NOERR) - ragsoc = nditte.get(NDT_RAGSOC); + + TString sep(132); + TString key; key.format("%d", get_firm()); + const TString & ragsoc = cache().get(LF_NDITTE, key, NDT_RAGSOC); reset_header(); soh=1; - sep << "Ditta " << get_firm(); + sep << TR("Ditta ") << get_firm(); sep << " " << ragsoc; sep.left_just(132); set_header (soh++, (const char*) sep); - sep.cut(0) << "Data @> Pag. @#"; + sep.cut(0) << FR("Data @> Pag. @#"); sep.right_just(122); switch (_tipo_lista) @@ -2461,155 +2367,155 @@ void TListaMov_application::preprocess_header() case movimenti: if (_scelta_stampa == 0) { - sep.overwrite ("Lista movimenti"); + sep.overwrite (TR("Lista movimenti")); set_header (soh++, (const char*)sep); if (_decidi == 2) // se _decidi e' 1 _annoes e' sempre uguale a zero { if (_annoes != 0) { - set_header (soh, "Cod. eserc.%d", _annoes); + set_header (soh, FR("Cod. eserc.%d"), _annoes); if (_flags & ST_DATA) { - set_header (soh, "@16gda@19g%s",_data_ini.string()); - set_header (soh, "@30ga@32g%s",_data_fin.string()); + set_header (soh, FR("@16gda@19g%s"),_data_ini.string()); + set_header (soh, FR("@30ga@32g%s"),_data_fin.string()); } } else // _annoes == 0 if (_flags & ST_DATA) { - set_header (soh, "Dalla data@11g%s",_data_ini.string()); + set_header (soh, FR("Dalla data@11g%s"),_data_ini.string()); if (_data_fin.ok()) - set_header (soh, "@23galla data@33g%s",_data_fin.string()); + set_header (soh, FR("@23galla data@33g%s"),_data_fin.string()); } else - set_header (soh, "Completa in ordine di data"); + set_header (soh, TR("Completa in ordine di data")); } else if (_flags & ST_NUMERO) { - set_header (soh, "dal numero@12g%ld", _numreg_ini); + set_header (soh, FR("dal numero@12g%ld"), _numreg_ini); if (_numreg_fin != 0) - set_header (soh, "@20gal numero@30g%ld", _numreg_fin); + set_header (soh, FR("@20gal numero@30g%ld"), _numreg_fin); } else - set_header (soh, "Completa in ordine di numero"); + set_header (soh, TR("Completa in ordine di numero")); if (_flags & ST_CAUSALE) { - set_header (soh, "@46gdalla causale@60g%s",(const char*)_causale_ini); - set_header (soh++, "@64galla causale@77g%s",(const char*)_causale_fin); + set_header (soh, FR("@46gdalla causale@60g%s"),(const char*)_causale_ini); + set_header (soh++, FR("@64galla causale@77g%s"),(const char*)_causale_fin); } else - set_header (soh++, " tutte le causali"); + set_header (soh++, TR(" tutte le causali")); if (_flags & ST_REGISTRO) { - set_header (soh, "dal registro %s",(const char*)_registro_ini); - set_header (soh, "@17gal registro %s",(const char*)_registro_fin); + set_header (soh, FR("dal registro %s"),(const char*)_registro_ini); + set_header (soh, FR("@17gal registro %s"),(const char*)_registro_fin); } else - set_header (soh, "tutti i registri"); + set_header (soh, TR("tutti i registri")); if (_flags & ST_DATI_IVA) - set_header (soh, "@34gstampa dati iva"); + set_header (soh, FR("@34gstampa dati iva")); if (_flags & ST_CONTROLLO) - set_header (soh, "@50g(controllo movimenti)"); + set_header (soh, FR("@50g(controllo movimenti)")); else if (_flags & ST_SOLO_MOVERR) - set_header (soh, "@50g(solo movimenti errati)"); - else set_header (soh, "@50g(senza controllo movimenti)"); + set_header (soh, FR("@50g(solo movimenti errati)")); + else set_header (soh, FR("@50g(senza controllo movimenti)")); if (_flags & ST_MESS_ALLEG) { if (_flags & ST_ANNO_COMP) - set_header (soh, "@78gcon messaggi: data competenza, allegato iva"); + set_header (soh, FR("@78gcon messaggi: data competenza, allegato iva")); else - set_header (soh, "@78gcon messaggio: allegato iva"); + set_header (soh, FR("@78gcon messaggio: allegato iva")); } else if (_flags & ST_ANNO_COMP) { if (_flags & ST_MESS_ALLEG) - set_header (soh, "@78gcon messaggi: data competenza, allegato iva"); + set_header (soh, FR("@78gcon messaggi: data competenza, allegato iva")); else - set_header (soh, "@78gcon messaggio: data competenza"); + set_header (soh, FR("@78gcon messaggio: data competenza")); } set_cdc_header(soh); sep.fill('_'); set_header (++soh, (const char *) sep); - set_header (++soh, "Rg Cod Causale@30gDescrizione@56gCodice conto@71gDescrizione conto@103gDare@120gAvere@130gSB"); + set_header (++soh, FR("Rg Cod Causale@30gDescrizione@56gCodice conto@71gDescrizione conto@103gDare@120gAvere@130gSB")); } else { - sep.overwrite ("Lista movimenti di sola prima nota"); + sep.overwrite (TR("Lista movimenti di sola prima nota")); set_header (soh++, (const char*)sep); if (_decidi == 2) { if (_annoes != 0) { - set_header (soh, "Cod. comp. %d", _annoes); + set_header (soh, FR("Cod. comp. %d"), _annoes); if (_flags & ST_DATA) { - set_header (soh, "@16gda@19g%s", (const char*)_data_ini.string()); - set_header (soh, "@30ga@32g%s", (const char*)_data_fin.string()); + set_header (soh, FR("@16gda@19g%s"), (const char*)_data_ini.string()); + set_header (soh, FR("@30ga@32g%s"), (const char*)_data_fin.string()); } } else if (_flags & ST_DATA) { - set_header (soh, "Dalla data@11g%s", (const char*)_data_ini.string()); - set_header (soh, "@23galla data@33g%s", (const char*)_data_fin.string()); + set_header (soh, FR("Dalla data@11g%s"), (const char*)_data_ini.string()); + set_header (soh, FR("@23galla data@33g%s"), (const char*)_data_fin.string()); } else - set_header (soh, "Completa in ordine di data"); + set_header (soh, TR("Completa in ordine di data")); } else if (_flags & ST_NUMERO) { - set_header (soh, "@46gdal numero@57g%ld", _numreg_ini); - set_header (soh, "@65gal numero@75g%ld", _numreg_fin); + set_header (soh, FR("@46gdal numero@57g%ld"), _numreg_ini); + set_header (soh, FR("@65gal numero@75g%ld"), _numreg_fin); } else - set_header (soh, "@46gCompleta in ordine di numero"); + set_header (soh, FR("@46gCompleta in ordine di numero")); if (_flags & ST_CAUSALE) { - set_header(soh, "@86gdalla causale@100g%3s",(const char*)_causale_ini); - set_header(soh++,"@104galla causale@117g%3s",(const char*)_causale_fin); + set_header(soh, FR("@86gdalla causale@100g%3s"),(const char*)_causale_ini); + set_header(soh++,FR("@104galla causale@117g%3s"),(const char*)_causale_fin); } else - set_header (soh++, "@86gtutte le causali"); + set_header (soh++, TR("@86gtutte le causali")); set_cdc_header(soh); soh++; sep.fill('_'); set_header (soh++, (const char *) sep); - set_header (soh, "Rg Cod Causale@30gDescrizione@56gCodice conto@71gDescrizione conto@103gDare@120gAvere@130gSB"); + set_header (soh, FR("Rg Cod Causale@30gDescrizione@56gCodice conto@71gDescrizione conto@103gDare@120gAvere@130gSB")); } break; case fatture: - sep.overwrite ("Lista fatture"); + sep.overwrite (TR("Lista fatture")); set_header (soh, (const char*)sep); if (_annoes != 0) { - set_header (soh, "@15gCod. comp %d", _annoes); + set_header (soh, FR("@15gCod. comp %d"), _annoes); if (_flags & ST_DATA) { - set_header (soh, "@30gdalla data@41g%s", (const char*)_data_ini.string()); - set_header (soh, "@52galla data@62g%s", (const char*)_data_fin.string()); + set_header (soh, FR("@30gdalla data@41g%s"), (const char*)_data_ini.string()); + set_header (soh, FR("@52galla data@62g%s"), (const char*)_data_fin.string()); } } else if (_flags & ST_DATA) { - set_header (soh, "@15gdalla data %s", (const char*)_data_ini.string()); - set_header (soh, "@37galla data %s", (const char*)_data_fin.string()); + set_header (soh, FR("@15gdalla data %s"), (const char*)_data_ini.string()); + set_header (soh, FR("@37galla data %s"), (const char*)_data_fin.string()); } else - set_header (soh, "@15gcompleta in ordine di data"); + set_header (soh, TR("@15gcompleta in ordine di data")); if (_flags & ST_CODICE) { - set_header (soh, "@74gdal codice %ld", _codice_ini); - set_header (soh, "@92gal codice %ld", _codice_fin); + set_header (soh, FR("@74gdal codice %ld"), _codice_ini); + set_header (soh, FR("@92gal codice %ld"), _codice_fin); } set_cdc_header(soh); sep.fill('_'); set_header (++soh, (const char *) sep); - set_header (++soh, "Numero Data Cod Prot. M Documento@48gCod Tp @75gTotale@101gCd Tp T O@129gNo"); - set_header (++soh, "Regis. Operaz. Reg Num. L Data@41gNumero@48gCau Dc @55gDescrizione@75gDocumento@90gImponibile@101gIv Det A I@121gImposta@129gAll"); + set_header (++soh, FR("Numero Data Cod Prot. M Documento@48gCod Tp @75gTotale@101gCd Tp T O@129gNo")); + set_header (++soh, FR("Regis. Operaz. Reg Num. L Data@41gNumero@48gCau Dc @55gDescrizione@75gDocumento@90gImponibile@101gIv Det A I@121gImposta@129gAll")); break; default: @@ -2634,10 +2540,10 @@ int cg3100(int argc, char* argv[]) switch (tipo) { case 'C': - title = "Lista fatture clienti/fornitori"; + title = TR("Lista fatture clienti/fornitori"); break; default: - title = "Lista movimenti"; + title = TR("Lista movimenti"); break; } a.run(argc, argv, title); diff --git a/cg/cg3200.cpp b/cg/cg3200.cpp index 68f2dd543..0ee2cdb94 100755 --- a/cg/cg3200.cpp +++ b/cg/cg3200.cpp @@ -84,12 +84,6 @@ class TMastrini_application : public TPrintapp TRelation* _rel; TMask* _msk; TTable* _tabivd, * _tabtpd, * _tabreg; - TLocalisamfile* _mov; - TLocalisamfile* _nditte; - TLocalisamfile* _unloc; - TLocalisamfile* _comuni; - TLocalisamfile* _clifo; - TLocalisamfile* _caus; TSaldo* _sld; TParagraph_string* _d18,* _d22,* _d30; TArray _riga, _lista; @@ -142,8 +136,6 @@ class TMastrini_application : public TPrintapp real _totale_commessa_dare, _totale_commessa_avere, _saldo_commessa; - TConfig* _collins; - protected: virtual bool user_create() ; virtual bool user_destroy(); @@ -166,7 +158,6 @@ protected: bool show_cdc(); public: - //TDate _inizioEs,_fineEs; int date2esc(const TDate& d); void ricerca_clifo(); @@ -176,14 +167,11 @@ public: void calcola_progressivi(bool finali = FALSE); void calcola_progressivi_al(const TDate& data); - void stampa_progressivi(); int stampa_progressivi(int start_riga); - void stampa_progre_riporto(); int stampa_progre_riporto(int start_riga); void documenti_iva(); void ricerca_regiva(); void descrizione_causale(); - void saldi_zero(); int crea_intestazione(int riga); void crea_intestazione(); void fai_stampa132(); @@ -210,22 +198,12 @@ public: void setta_riga (int r, const TString& riga); int righe_rimaste_da_stampare(); - const char* trans(const char* italian); - TMastrini_application() {} virtual ~TMastrini_application() {} }; inline TMastrini_application& app() { return (TMastrini_application&)main_app(); } -const char* TMastrini_application::trans(const char* italian) -{ - TString80 key(italian); - key.replace(' ', '_'); - const TString& str = _collins->get(key, NULL, -1, italian); - return str; -} - int TMastrini_application::righe_rimaste_da_stampare() { int righe_rimaste = 0; @@ -316,7 +294,6 @@ bool TMastrini_application::sottoc_handler_ini(TMask_field& f, KEY key) { const TMask& m = f.mask(); const short id = f.dlg(); - bool warning = FALSE; const int gruppo = m.get_int(F_GRUPPOINI); const int conto = m.get_int(F_CONTOINI_CONTO); @@ -326,70 +303,47 @@ bool TMastrini_application::sottoc_handler_ini(TMask_field& f, KEY key) if ( key == K_ENTER ) { if (sottoconto != 0 && conto == 0) - return f.warning_box("Manca il CONTO"); + return f.warning_box(TR("Manca il CONTO")); if (conto != 0 && gruppo == 0) - return f.warning_box("Manca il GRUPPO"); + return f.warning_box(TR("Manca il GRUPPO")); } if (key == K_TAB && m.is_running()) { - TString ds; if (id == F_SOTTOCINI_CONTO && (gruppo != 0 || conto != 0 || sottoconto != 0L)) { - TLocalisamfile pconti(LF_PCON); - pconti.zero(); - pconti.put(PCN_GRUPPO, gruppo) ; - pconti.put(PCN_CONTO, conto); - pconti.put(PCN_SOTTOCONTO, sottoconto); - pconti.setkey(1); - pconti.read(_isequal, _nolock); - if (pconti.good()) - { - ds = pconti.get(PCN_DESCR); - warning = FALSE; - } - else - { - ds = ""; - warning = TRUE; - } + TString16 key; + + key.format("%d|%d|%ld", gruppo, conto, sottoconto); + const TRectype & pconti = cache().get(LF_PCON, key); + + if (pconti.empty()) + return f.warning_box(TR("Sottoconto inesistente")); + + const TString & ds = pconti.get(PCN_DESCR); f.mask().set(F_DESCRINI_CONTO, ds); f.mask().set(F_DESCRINI_CLIENTE, ds); f.mask().set(F_DESCRINI_FORN, ds); - if (warning) - return f.warning_box("Sottoconto inesistente"); } else if (id == F_SOTTOCINI_CLIENTE || id == F_SOTTOCINI_FORN) { - TString rs; char tipo = id == F_SOTTOCINI_CLIENTE ? 'C' : 'F'; - TLocalisamfile clifo (LF_CLIFO); if (sottoconto != 0) { - clifo.zero(); - clifo.put(CLI_TIPOCF,tipo); - clifo.put(CLI_CODCF, sottoconto) ; - clifo.setkey(1); - if (clifo.read(_isequal, _nolock) == NOERR) - { - rs = clifo.get(CLI_RAGSOC); - warning = FALSE; - } - else - { - rs = ""; - warning = TRUE; - } + TString16 key; + key.format("%c|%ld", tipo, sottoconto); + const TRectype & clifo = cache().get(LF_CLIFO, key); + if (clifo.empty()) + return f.warning_box(TR("Anagrafica inesistente")); + const TString & rs = clifo.get(CLI_RAGSOC); f.mask().set(F_DESCRINI_CLIENTE, rs); f.mask().set(F_DESCRINI_FORN, rs); - if (warning) - return f.warning_box("Anagrafica inesistente"); } } } @@ -403,7 +357,6 @@ bool TMastrini_application::sottoc_handler_fine(TMask_field& f, KEY key) const short id = f.dlg(); TString ds; TString80 rs; - bool warning; const int gruppo = m.get_int(F_GRUPPOFINE); const int conto = m.get_int(F_CONTOFINE_CONTO); @@ -413,10 +366,10 @@ bool TMastrini_application::sottoc_handler_fine(TMask_field& f, KEY key) if ( key == K_ENTER ) { if (sottoconto != 0 && conto == 0) - return f.warning_box("Manca il CONTO"); + return f.warning_box(TR("Manca il CONTO")); if (conto != 0 && gruppo == 0) - return f.warning_box("Manca il GRUPPO"); + return f.warning_box(TR("Manca il GRUPPO")); if (!app().check_ordine(f,key)) return FALSE; @@ -426,58 +379,41 @@ bool TMastrini_application::sottoc_handler_fine(TMask_field& f, KEY key) { if (id == F_SOTTOCFINE_CONTO && (gruppo != 0 || conto != 0 || sottoconto != 0L)) { - TLocalisamfile pconti (LF_PCON); - pconti.zero(); - pconti.put(PCN_GRUPPO, gruppo) ; - pconti.put(PCN_CONTO, conto); - pconti.put(PCN_SOTTOCONTO, sottoconto); - pconti.setkey(1); - pconti.read(_isequal, _nolock); - if (pconti.good()) - { - ds = pconti.get(PCN_DESCR); - warning = FALSE; - } - else - { - ds = ""; - warning = TRUE; - } + TString16 key; + + key.format("%d|%d|%ld", gruppo, conto, sottoconto); + + const TRectype & pconti = cache().get(LF_PCON, key); + + if (pconti.empty()) + return f.warning_box(TR("Sottoconto inesistente")); + const TString & ds = pconti.get(PCN_DESCR); f.mask().set(F_DESCRFINE_CONTO, ds); f.mask().set(F_DESCRFINE_CLIENTE, ds); f.mask().set(F_DESCRFINE_FORN, ds); - if (warning) - return f.warning_box("Sottoconto inesistente"); } else if (id == F_SOTTOCFINE_CLIENTE || id == F_SOTTOCFINE_FORN) { char tipo = id == F_SOTTOCFINE_CLIENTE ? 'C' : 'F'; - TLocalisamfile clifo (LF_CLIFO); if (sottoconto != 0) { - clifo.zero(); - clifo.put(CLI_TIPOCF,tipo); - clifo.put(CLI_CODCF, sottoconto) ; - clifo.setkey(1); - if (clifo.read(_isequal, _nolock) == NOERR) - { - rs = clifo.get(CLI_RAGSOC); - warning = FALSE; - } - else - { - rs = ""; - warning = TRUE; - } + TString16 key; + + key.format("%c|%ld", tipo, sottoconto); + + const TRectype & clifo = cache().get(LF_CLIFO, key); + + if (clifo.empty()) + return f.warning_box(TR("Anagrafica inesistente")); - f.mask().set(F_DESCRFINE_CLIENTE, rs); + const TString & rs = clifo.get(CLI_RAGSOC); + + f.mask().set(F_DESCRFINE_CLIENTE, rs); f.mask().set(F_DESCRFINE_FORN, rs); - if (warning) - return f.warning_box("Anagrafica inesistente"); } } } @@ -496,7 +432,7 @@ bool TMastrini_application::gruppo_hnd (TMask_field& f, KEY k) int gruppoi = f.mask().get_int(F_GRUPPOINI); if (gruppoi > gruppof) - return f.error_box("Il gruppo di partenza deve essere inferiore o uguale al gruppo di arrivo"); + return f.error_box(TR("Il gruppo di partenza deve essere inferiore o uguale al gruppo di arrivo")); } return TRUE; @@ -514,51 +450,40 @@ bool TMastrini_application::contoi_hnd (TMask_field& f, KEY k) if (k == K_TAB && f.focusdirty() && f.mask().is_running()) { TMask& m = f.mask(); - TLocalisamfile pconti (LF_PCON); - TString ds; - const short id = f.dlg(); - const int gruppo = m.get_int(F_GRUPPOINI); - const int conto = m.get_int(id); + const short id = f.dlg(); + const int gruppo = m.get_int(F_GRUPPOINI); + const int conto = m.get_int(id); + - if (gruppo != 0 && conto != 0 && m.field(F_DESCRINI_CONTO).empty()) + if (gruppo != 0 && conto != 0) { - bool warning; - const char tipomsk = m.get(F_TIPOCF_INI)[0]; - - pconti.zero(); - pconti.put(PCN_GRUPPO, gruppo) ; - pconti.put(PCN_CONTO, conto); - pconti.setkey(1); - pconti.read(_isequal, _nolock); - if (pconti.good()) + + TString key(20); + + key.format("%d|%d|", gruppo, conto); + + const TRectype & pconti = cache().get(LF_PCON, key); + + if (!pconti.empty()) { char tipo = pconti.get_char(PCN_TMCF); if (tipomsk != tipo) - return f.warning_box("Conto inesistente"); + return f.warning_box(TR("Conto inesistente")); + } - ds = pconti.get(PCN_DESCR); - warning = FALSE; - } - else - { - ds = ""; - warning = TRUE; - } - - m.set(F_DESCRINI_CLIENTE, ds); + const TString & ds = pconti.get(PCN_DESCR); + + m.set(F_DESCRINI_CLIENTE, ds); m.set(F_DESCRINI_FORN, ds); m.set(F_DESCRINI_CONTO, ds); - if (warning) - return f.warning_box("Conto inesistente"); } else { - ds = ""; - m.set(F_DESCRINI_CLIENTE, ds); - m.set(F_DESCRINI_FORN, ds); - m.set(F_DESCRINI_CONTO, ds); + m.set(F_DESCRINI_CLIENTE, ""); + m.set(F_DESCRINI_FORN, ""); + m.set(F_DESCRINI_CONTO, ""); } } @@ -588,55 +513,43 @@ bool TMastrini_application::contof_hnd (TMask_field& f, KEY k) int contoi = m.get_int(F_CONTOINI_CONTO); if (contoi > contof) - return f.error_box("Il conto di partenza deve essere inferiore o uguale al conto di arrivo"); + return f.error_box(TR("Il conto di partenza deve essere inferiore o uguale al conto di arrivo")); } if (k == K_TAB && f.focusdirty() && f.mask().is_running()) { - TLocalisamfile pconti (LF_PCON); TString ds; int gruppo = m.get_int(F_GRUPPOFINE); int conto = m.get_int(id); if (gruppo != 0 && conto != 0 && m.field(F_DESCRFINE_CONTO).empty()) { - bool warning; + char tipomsk = f.mask().get(F_TIPOCF_FINE)[0]; - char tipomsk = m.get(F_TIPOCF_FINE)[0]; - - pconti.zero(); - pconti.put(PCN_GRUPPO, gruppo) ; - pconti.put(PCN_CONTO, conto); - pconti.setkey(1); - pconti.read(_isequal, _nolock); - if (pconti.good()) - { - char tipo = pconti.get_char(PCN_TMCF); - if (tipomsk != tipo) - return f.warning_box("Conto inesistente"); + TString16 key; + key.format("%d|%d|", gruppo, conto); + + const TRectype & pconti = cache().get(LF_PCON, key); + + if (pconti.empty()) + return f.warning_box(TR("Sottoconto inesistente")); + char tipo = pconti.get_char(PCN_TMCF); + if (tipomsk != tipo) + return f.warning_box(TR("Conto inesistente")); + - ds = pconti.get(PCN_DESCR); - warning = FALSE; - } - else - { - ds = ""; - warning = TRUE; - } + const TString & ds = pconti.get(PCN_DESCR); m.set(F_DESCRFINE_CLIENTE, ds); m.set(F_DESCRFINE_FORN, ds); m.set(F_DESCRFINE_CONTO, ds); - if (warning) - return f.warning_box("Conto inesistente"); } else { - ds = ""; - f.mask().set(F_DESCRFINE_CLIENTE, ds); - f.mask().set(F_DESCRFINE_FORN, ds); - f.mask().set(F_DESCRFINE_CONTO, ds); + f.mask().set(F_DESCRFINE_CLIENTE, ""); + f.mask().set(F_DESCRFINE_FORN, ""); + f.mask().set(F_DESCRFINE_CONTO, ""); } } @@ -665,7 +578,7 @@ bool TMastrini_application::check_ordine(TMask_field& f, KEY k) long sottoci = f.mask().get_long(F_SOTTOCINI_CONTO); if (sottoci > sottocf) - return f.error_box("Il sottoconto di partenza deve essere inferiore o uguale al sottoconto di arrivo"); + return f.error_box(TR("Il sottoconto di partenza deve essere inferiore o uguale al sottoconto di arrivo")); return TRUE; } @@ -736,8 +649,11 @@ bool TMastrini_application::almeno_un_record() const int annoes = rmov.get_int (RMV_ANNOES); const long numreg = rmov.get_long(RMV_NUMREG); - const TDate datacomp = mov.get(MOV_DATACOMP); - const TString16 provvis = mov.get(MOV_PROVVIS); + const TRectype & mov = cache().get(LF_MOV, numreg); + + const TDate datacomp = (mov.get(MOV_DATACOMP)); + const TString16 provvis (mov.get(MOV_PROVVIS)); + TDate datareg; if (_annomsk == 0) @@ -779,7 +695,7 @@ bool TMastrini_application::data_inizio(TMask_field& f, KEY k) { if (data < app()._data_inizioese || data > app()._data_finese) { - f.error_box("La data non appartiene all'esercizio indicato"); + f.error_box(TR("La data non appartiene all'esercizio indicato")); return FALSE; } else @@ -789,10 +705,10 @@ bool TMastrini_application::data_inizio(TMask_field& f, KEY k) else { if (data == botime) - return f.error_box("La data deve essere obbligatoriamente indicata"); + return f.error_box(TR("La data deve essere obbligatoriamente indicata")); if (app().date2esc(data) == 0) - return f.error_box("La data indicata non appartiene ad alcun esercizio"); + return f.error_box(TR("La data indicata non appartiene ad alcun esercizio")); else app()._data_ini = data; } @@ -820,7 +736,7 @@ bool TMastrini_application::data_fine(TMask_field& f, KEY k) { if (data < app()._data_inizioese || data > app()._data_finese) { - f.error_box("La data non appartiene all'esercizio indicato"); + f.error_box(TR("La data non appartiene all'esercizio indicato")); return FALSE; } else @@ -830,26 +746,18 @@ bool TMastrini_application::data_fine(TMask_field& f, KEY k) else { if (data == botime) - return f.error_box("La data deve essere obbligatoriamente indicata"); + return f.error_box(TR("La data deve essere obbligatoriamente indicata")); app()._anno_ghost = app().date2esc(data_ini); if (app()._anno_ghost == 0) - return f.error_box("La data indicata non appartiene ad alcun esercizio"); - //app()._inizioes = app()._inizioEs; - - //if (data < app()._inizioEs || data > app()._fineEs) - //{ - // f.error_box("La data non appartiene all'esercizio indicato"); - // return FALSE; - //} - //else + return f.error_box(TR("La data indicata non appartiene ad alcun esercizio")); app()._data_fine = data; } if (data < data_ini) { - f.error_box("La data finale non puo' essere inferiore alla data di partenza"); + f.error_box(TR("La data finale non puo' essere inferiore alla data di partenza")); return FALSE; } @@ -858,52 +766,6 @@ bool TMastrini_application::data_fine(TMask_field& f, KEY k) return TRUE; } -void TMastrini_application::saldi_zero() -{ - TLocalisamfile& rmov = current_cursor()->file(LF_RMOV); - real saldo_dare, saldo_avere; - long record; - - saldo_dare = saldo_avere = 0.0; - - if (current_cursor()->is_first_match(LF_RMOV)) - { - record = rmov.recno(); - - while (!rmov.eof()) - { - long numreg = rmov.get_long(RMV_NUMREG); - _mov->setkey(1); - _mov->curr().zero(); - _mov->curr().put(MOV_NUMREG,numreg); - _mov->read(); - if (_mov->bad()) - _mov->zero(); - char provvis = _mov->curr().get_char(MOV_PROVVIS); - int gruppo = atoi(rmov.get(RMV_GRUPPO)); - int conto = atoi(rmov.get(RMV_CONTO)); - long sottoc = atol(rmov.get(RMV_SOTTOCONTO)); - - if ((gruppo == _gruppo)&&(conto == _conto)&&(sottoc == _sottoc)) - { - if (_stampa_mov_prov || provvis <= ' ') - { - char sezione = rmov.curr().get(RMV_SEZIONE)[0]; - real importo = rmov.curr().get_real(RMV_IMPORTO); - if (sezione == 'D') - saldo_dare += importo; - else - saldo_avere += importo; - } - } - else break; - rmov.next(); - } - rmov.readat(record); - } - _totale_saldo = saldo_dare - saldo_avere; -} - void TMastrini_application::fai_stampa132() { if (_nummast == 1 || _nummast == 3) @@ -1100,12 +962,10 @@ void TMastrini_application::stampa_totali_commessa() { if (_cdc.not_empty()) { -// _rw = 1; { _saldo_commessa = _totale_commessa_dare - _totale_commessa_avere; -// set_row (++_rw,"@32g@b%s", trans("TOTALI COMMESSA")); - set_row (_rw,"@32g@b%s", trans("PROGRESSIVI COMMESSA")); + set_row (_rw,"@32g@b%s", TR("PROGRESSIVI COMMESSA")); if (_numcarat == 1) { @@ -1137,19 +997,19 @@ void TMastrini_application::stampa_totali132() _saldo_periodo = _totale_periodo_dare - _totale_periodo_avere; _saldo_progre = _totprogre_dare - _totprogre_avere; _saldo_progre_al = _totprogre_dare_al - _totprogre_avere_al; - set_row (_rw,"@32g%s", trans("TOTALI PERIODO")); + set_row (_rw,"@32g%s", TR("TOTALI PERIODO")); set_row (_rw,"@66g%r", &_saldo_periodo); set_row (_rw,"@83g%r", &_totale_periodo_dare); set_row (_rw++,"@100g%r", &_totale_periodo_avere); - set_row (_rw,"@32g%s", trans("TOTALI PROGRESSIVI")); + set_row (_rw,"@32g%s", TR("TOTALI PROGRESSIVI")); set_row (_rw,"@66g%r", &_saldo_progre); set_row (_rw,"@83g%r", &_totprogre_dare); set_row (_rw++,"@100g%r", &_totprogre_avere); if (_stampaprogre) //Progressivi attuali { - set_row (_rw,"@32g%s %s", trans("TOTALI PROGRESSIVI AL"), _ultima_data_reg.string()); + set_row (_rw,"@32g%s %s", TR("TOTALI PROGRESSIVI AL"), _ultima_data_reg.string()); set_row (_rw,"@66g%r", &_saldo_progre_al); set_row (_rw,"@83g%r", &_totprogre_dare_al); set_row (_rw,"@100g%r", &_totprogre_avere_al); @@ -1162,8 +1022,9 @@ void TMastrini_application::stampa_totali132() const char* TMastrini_application::real2str(const real& r) const { - real2currency(TMP, r); - return TMP; + TString & str = get_tmp_string(30); + real2currency(str, r); + return str; } void TMastrini_application::carica_array_totali132() @@ -1193,7 +1054,7 @@ void TMastrini_application::carica_array_totali132() r = ""; r.add("@32g%s@66g%s@83g%s@100g%s"); - r.add(trans("TOTALI PERIODO")); + r.add(TR("TOTALI PERIODO")); r.add(real2str(_saldo_periodo)); r.add(real2str(_totale_periodo_dare)); r.add(real2str(_totale_periodo_avere)); @@ -1201,7 +1062,7 @@ void TMastrini_application::carica_array_totali132() r = ""; r.add("@32g%s@66g%s@83g%s@100g%s"); - r.add(trans("TOTALI PROGRESSIVI")); + r.add(TR("TOTALI PROGRESSIVI")); r.add(real2str(_saldo_progre)); r.add(real2str(_totprogre_dare)); r.add(real2str(_totprogre_avere)); @@ -1211,7 +1072,7 @@ void TMastrini_application::carica_array_totali132() if (_stampaprogre) //Progressivi attuali { r.add("@32g%s@55g%s@66g%s@83g%s@100g%s"); - r.add(trans("TOTALI PROGRESSIVI AL")); + r.add(TR("TOTALI PROGRESSIVI AL")); r.add(_ultima_data_reg.string()); r.add(real2str(_saldo_progre_al)); r.add(real2str(_totprogre_dare_al)); @@ -1331,10 +1192,10 @@ void TMastrini_application::stampa_totali198() _totprogre_dare=_progredare+_totale_periodo_dare; _totprogre_avere=_progreavere+_totale_periodo_avere; - set_row (++_rw,"@32g%s@100g%r", trans("TOTALI PERIODO"), &_totale_periodo_dare); + set_row (++_rw,"@32g%s@100g%r", TR("TOTALI PERIODO"), &_totale_periodo_dare); set_row (_rw,"@117g%r", &_totale_periodo_avere); - set_row (++_rw,"@32g%s@100g%r", trans("TOTALI PROGRESSIVI"), &_totprogre_dare); + set_row (++_rw,"@32g%s@100g%r", TR("TOTALI PROGRESSIVI"), &_totprogre_dare); set_row (_rw,"@117g%r", &_totprogre_avere); set_row (_rw,"@135g%r", &_saldo_progressivi); if (!_stampa_des_contro) @@ -1342,7 +1203,7 @@ void TMastrini_application::stampa_totali198() if (_stampaprogre) //Progressivi attuali { _saldo_progre_al = _totprogre_dare_al - _totprogre_avere_al; - set_row(++_rw,"@32g%s@55g%s", trans("TOTALI PROGRESSIVI AL"), _ultima_data_reg.string()); + set_row(++_rw,"@32g%s@55g%s", TR("TOTALI PROGRESSIVI AL"), _ultima_data_reg.string()); set_row (_rw,"@100g%r", &_totprogre_dare_al); set_row (_rw,"@117g%r", &_totprogre_avere_al); if (!_stampa_des_contro) @@ -1381,7 +1242,7 @@ void TMastrini_application::carica_array_totali198() r.add("@32g%s@100g%s@117g%s"); else r.add("@32g%s@100g%s@117g%s@151g%s"); - r.add(trans("TOTALI PERIODO")); + r.add(TR("TOTALI PERIODO")); r.add(real2str(_totale_periodo_dare)); r.add(real2str(_totale_periodo_avere)); r.add(real2str(_saldo_movimenti)); @@ -1392,7 +1253,7 @@ void TMastrini_application::carica_array_totali198() r.add("@32g%s@100g%s@117g%s"); else r.add("@32g%s@100g%s@117g%s@135g%s"); - r.add(trans("TOTALI PROGRESSIVI")); + r.add(TR("TOTALI PROGRESSIVI")); r.add(real2str(_totprogre_dare)); r.add(real2str(_totprogre_avere)); r.add(real2str(_saldo_progressivi)); @@ -1403,7 +1264,7 @@ void TMastrini_application::carica_array_totali198() { _saldo_progre_al = _totprogre_dare_al - _totprogre_avere_al; r.add("@32g%s@55g%s@100g%s@117g%s@135g%s"); - r.add(trans("TOTALI PROGRESSIVI AL")); + r.add(TR("TOTALI PROGRESSIVI AL")); r.add(_ultima_data_reg.string()); r.add(real2str(_totprogre_dare_al)); r.add(real2str(_totprogre_avere_al)); @@ -1586,12 +1447,9 @@ bool TMastrini_application::preprocess_page(int file, int counter) _saldo_progre_prec = ZERO; if (_tipostampa == 2) { -// saldi_zero(); calcola_progressivi(TRUE); _totale_saldo = _saldo_progre_prec; } -// else -// _totale_saldo = 1.0; if ((_tipostampa == 1) || (_tipostampa == 2)) { @@ -1684,15 +1542,12 @@ bool TMastrini_application::preprocess_page(int file, int counter) _importo = rmov.get_real(RMV_IMPORTO); _importo_str = real2str(_importo); - _mov->setkey(1); - _mov->curr().zero(); - _mov->put(MOV_NUMREG,_numreg); - _mov->read(); - if (_mov->bad()) - _mov->zero(); - _annoes = _mov->get_int(MOV_ANNOES); - _regiva = _mov->get(MOV_REG); - _annoiva = _mov->get_int(MOV_ANNOIVA); + const TRectype & mov = cache().get(LF_MOV, _numreg); + + _annoes = mov.get_int(MOV_ANNOES); + _regiva = mov.get(MOV_REG); + _annoiva = mov.get_int(MOV_ANNOIVA); + // Controlla se saldo e' diverso da 0 @@ -1702,17 +1557,20 @@ bool TMastrini_application::preprocess_page(int file, int counter) if (_annomsk == 0) { - _datareg = _mov->curr().get(MOV_DATAREG); + _datareg = mov.get(MOV_DATAREG); + _datareg_stampa = _datareg; } else if (_annomsk != 0) { - _datareg = _mov->get(MOV_DATACOMP); - _datareg_stampa = _mov->get(MOV_DATAREG); + _datareg = mov.get(MOV_DATACOMP); + _datareg_stampa = mov.get(MOV_DATAREG); } - provvis = _mov->get(MOV_PROVVIS); + + provvis = mov.get(MOV_PROVVIS); + _dataregs = _datareg_stampa.string(); @@ -1734,8 +1592,9 @@ bool TMastrini_application::preprocess_page(int file, int counter) else set_row(_rw, "@195gP"); - _codcaus = _mov->get(MOV_CODCAUS); - _tipodoc = _mov->get(MOV_TIPODOC); + _codcaus = mov.get(MOV_CODCAUS); + _tipodoc = mov.get(MOV_TIPODOC); + if (_stampatotiva && (_tmcf == 'C' || _tmcf == 'F')) { if (_tipodoc != "") @@ -1746,12 +1605,15 @@ bool TMastrini_application::preprocess_page(int file, int counter) _ddociva_len = _descrdociva.len(); } } - _datadoc = _mov->get(MOV_DATADOC); + _datadoc = (mov.get(MOV_DATADOC)); + _datadocs = _datadoc.string(); - _numdoc = _mov->get(MOV_NUMDOC); + _numdoc = mov.get(MOV_NUMDOC); + descrizione_causale(); - _descrizionemov = _mov->get(MOV_DESCR); - _numgio = _mov->get_long(MOV_NUMGIO); + _descrizionemov = mov.get(MOV_DESCR); + _numgio = atol(mov.get(MOV_NUMGIO)); + _descrizione = rmov.get(RMV_DESCR); @@ -1814,8 +1676,6 @@ bool TMastrini_application::preprocess_page(int file, int counter) } else if (_descrizionemov == "") { - //set_row (1,"@46g%.23s", (const char*) _descrcaus); - //set_row (1,"@70g%.30s", (const char*) _descrizione); *_d22 = (const char*) _descrcaus; set_row(_rw, "@46g#a", _d22); set_row(_rw, "@70g#a", _d30); @@ -1824,8 +1684,6 @@ bool TMastrini_application::preprocess_page(int file, int counter) else if (_descrizione == "") if (_descrizionemov.not_empty()) { - //set_row (1,"@46g%.23s", (const char*) _descrcaus); - //set_row (1,"@70g%.30s", (const char*) _descrizionemov); *_d30 = (const char*) _descrizionemov; *_d22 = (const char*) _descrcaus; set_row (_rw,"@46g#a", _d22); @@ -2081,13 +1939,13 @@ bool TMastrini_application::preprocess_page(int file, int counter) TString avere (real2str(dep_avere)); if (_numcarat == 1) { - set_row (_rw,"@32gA RIPORTO@83g%s", (const char*) dare); + set_row (_rw,FR("@32gA RIPORTO@83g%s"), (const char*) dare); set_row (_rw,"@100g%s", (const char*) avere); } else if (_numcarat == 2) { - set_row (_rw,"@32gA RIPORTO@100g%s", (const char*) dare); + set_row (_rw,FR("@32gA RIPORTO@100g%s"), (const char*) dare); set_row (_rw,"@117g%s", (const char*) avere); } } @@ -2099,10 +1957,9 @@ bool TMastrini_application::preprocess_page(int file, int counter) return TRUE; } _rw--; -// return TRUE; } //_riga.destroy(); - } //if (_nummast == 2) + } if (_print_cdc) { @@ -2166,7 +2023,7 @@ bool TMastrini_application::preprocess_page(int file, int counter) if (_numcarat == 2) { ricerca_regiva(); - _protiva = atol(_mov->curr().get(MOV_PROTIVA)); + _protiva = mov.get_long(MOV_PROTIVA); if (_protiva != 0) set_row (_rw,"@191g%5d", _protiva); @@ -2205,7 +2062,7 @@ bool TMastrini_application::preprocess_page(int file, int counter) else { ricerca_regiva(); - _protiva = atol(_mov->curr().get(MOV_PROTIVA)); + _protiva = atol(mov.get(MOV_PROTIVA)); if (_protiva != 0) set_row (_rw,"@127g%5d", _protiva); } @@ -2451,13 +2308,9 @@ void TMastrini_application::stampa_totaliiva() // sull'archivio CAUS.dta void TMastrini_application::descrizione_causale() { - _caus->setkey(1); - _caus->curr().zero(); - _caus->curr().put(CAU_CODCAUS, _codcaus); - _caus->read(); - if (_caus->bad()) - _caus->zero(); - _descrcaus = _caus->curr().get(CAU_DESCR); + const TRectype & caus = cache().get(LF_CAUSALI, _codcaus); + + _descrcaus = caus.get(CAU_DESCR); } // Ricerca sulla tabella dei tipi documento, la descrizione e la natura del @@ -2797,13 +2650,13 @@ void TMastrini_application::preprocess_footer() TString avere (real2str(dep_avere)); if (_numcarat == 1) { - set_footer (2,"@32gA RIPORTO@83g%s", (const char*) dare); + set_footer (2,FR("@32gA RIPORTO@83g%s"), (const char*) dare); set_footer (2,"@100g%s", (const char*) avere); } else if (_numcarat == 2) { - set_footer (2,"@32gA RIPORTO@100g%s", (const char*) dare); + set_footer (2,FR("@32gA RIPORTO@100g%s"), (const char*) dare); set_footer (2,"@117g%s", (const char*) avere); } } @@ -2812,16 +2665,12 @@ void TMastrini_application::preprocess_footer() void TMastrini_application::conto(int gruppo, int conto, bool no_contropartita) { - TLocalisamfile pconti(LF_PCON); + TString16 key; + + key.format("%d|%d|", gruppo, conto); + + const TRectype & pconti = cache().get(LF_PCON, key); - pconti.setkey(1); - pconti.zero(); - pconti.put(PCN_GRUPPO, gruppo); - pconti.put(PCN_CONTO , conto); - pconti.read(); - if (pconti.bad()) - pconti.zero(); - if (no_contropartita) { _indbil = pconti.get_int(PCN_INDBIL); @@ -2835,20 +2684,19 @@ void TMastrini_application::ricerca_dati_ditta() { long app; - _nditte->setkey(1); - _nditte->curr().zero(); - _nditte->curr().put(NDT_CODDITTA,_codice_ditta); - _nditte->read(); - app=_nditte->curr().get_long(NDT_CODDITTA); - _ragsoc=_nditte->curr().get(NDT_RAGSOC); + const TRectype & nditte = cache().get(LF_NDITTE, _codice_ditta); + + app = nditte.get_long(NDT_CODDITTA); + _ragsoc = nditte.get(NDT_RAGSOC); - _unloc->setkey(1); - _unloc->curr().zero(); - _unloc->curr().put(ULC_CODDITTA,app); - _unloc->curr().put(ULC_CODULC,"1"); - _unloc->read(); - _indulc=_unloc->curr().get(ULC_INDULC); - _civulc=_unloc->curr().get(ULC_CIVULC); + TString16 key; + + key.format("%ld|1", app); + + const TRectype & unloc = cache().get(LF_UNLOC, key); + + _indulc= unloc.get(ULC_INDULC); + _civulc= unloc.get(ULC_CIVULC); int len = _indulc.len(); if (len <= 31) { @@ -2862,23 +2710,14 @@ void TMastrini_application::ricerca_dati_ditta() _indulc = _indulc.mid(0,31); _indulc << " " << _civulc.mid(0,5); } - _capulc=_unloc->curr().get(ULC_CAPULC); - _comulc=_unloc->curr().get(ULC_COMULC); + _capulc= unloc.get(ULC_CAPULC); + _comulc= unloc.get(ULC_COMULC); - _comuni->setkey(1); - _comuni->zero(); - _comuni->put(COM_COM,_comulc); - _comuni->read(); - if (_comuni->good()) - { - _com=_comuni->get(COM_DENCOM); - _prov=_comuni->get(COM_PROVCOM); - } - else - { - _com=""; - _prov=""; - } + key.format("|%s", (const char *) _comulc); + const TRectype & comuni = cache().get(LF_COMUNI, key); + + _com = comuni.get(COM_DENCOM); + _prov = comuni.get(COM_PROVCOM); } // Crea l'intestazione per la stampa a 132 e a 198 caratteri @@ -2928,7 +2767,7 @@ void TMastrini_application::crea_intestazione() if (_nummast != 3 || _pagina != np) { - set_header (1, "@0g%s@6g%5ld", trans("DITTA"), _codice_ditta); + set_header (1, "@0g%s@6g%5ld", TR("DITTA"), _codice_ditta); set_header (1, "@12g%-.45s", (const char*) _ragsoc); set_header (1, "@59g%s", (const char*) _indulc); //set_header (1, "@86g%-.9s", (const char*) _civulc); @@ -2943,18 +2782,18 @@ void TMastrini_application::crea_intestazione() if (_fsc.not_empty()) { const TString& desc_fsc = cache().get("FSC", _fsc, "S0"); - set_header(2, "@bCommessa %s %s - Fase %s %s", + set_header(2, FR("@bCommessa %s %s - Fase %s %s"), (const char*)_cdc, (const char*)desc_cdc, (const char*)_fsc, (const char*)desc_fsc); } else - set_header(2, "@bCommessa %s %s", (const char*)_cdc, (const char*)desc_cdc); + set_header(2, FR("@bCommessa %s %s"), (const char*)_cdc, (const char*)desc_cdc); } if (_nummast == 3) - set_header (3, "@0g%s@12g@b%3d %3d %6ld", trans("Sottoconto"), _gruppo, _conto, _sottoc); + set_header (3, "@0g%s@12g@b%3d %3d %6ld", TR("Sottoconto"), _gruppo, _conto, _sottoc); else - set_header (3, "@0g%s@12g%3d %3d %6ld", trans("Sottoconto"), _gruppo, _conto, _sottoc); + set_header (3, "@0g%s@12g%3d %3d %6ld", TR("Sottoconto"), _gruppo, _conto, _sottoc); switch(_tmcf) { @@ -2979,17 +2818,17 @@ void TMastrini_application::crea_intestazione() sep.fill('_'); //Stampa 132 - (sep(132)) set_header (6, (const char *) sep); set_header (7,"%s@19g%s@117g%s@132g%s", - trans("Operazione"), trans("Documento"), trans("Contro"), trans("A")); + TR("Operazione"), TR("Documento"), TR("Contro"), TR("A")); if (_stampa_mov_prov) set_header(7,"@130gM"); - set_header (8, trans("Data")); + set_header (8, TR("Data")); if (_stampanum < 3) - set_header (8,"@11g%s", trans("Numero")); + set_header (8,"@11g%s", TR("Numero")); set_header (8,"@19g%s@30g%s@38g%s@61g%s@95g%s@111g%s@117g%s@127g%s@132g%s", - trans("Data"), trans("Numero"), trans("Cod.Causale"), trans("Descrizione"), - trans("Dare"), trans("Avere"), trans("Partita"), trans("Prot."), trans("C")); + TR("Data"), TR("Numero"), TR("Cod.Causale"), TR("Descrizione"), + TR("Dare"), TR("Avere"), TR("Partita"), TR("Prot."), TR("C")); if (_stampa_mov_prov) - set_header(8,"@130g%s", trans("P")); + set_header(8,"@130g%s", TR("P")); sep.fill('_'); set_header (9, (const char *) sep); } @@ -3000,38 +2839,36 @@ void TMastrini_application::crea_intestazione() if (_stampa_des_contro) { set_header (7,"%s@23g%s@183g%s@190g%s@197g%s", - trans("Operazione"), trans("Documento"), - trans("Reg"), trans("Numero"), trans("A")); + TR("Operazione"), TR("Documento"), + TR("Reg"), TR("Numero"), TR("A")); } else { set_header (7,"%s@23g%s@169g%s@183g%s@190g%s@197g%s", - trans("Operazione"), trans("Documento"), trans("Contro"), - trans("Reg"), trans("Numero"), trans("A")); + TR("Operazione"), TR("Documento"), TR("Contro"), + TR("Reg"), TR("Numero"), TR("A")); } if (_stampa_mov_prov) - set_header(7,"@195g%s", trans("M")); - set_header (8,trans("Data")); + set_header(7,"@195g%s", TR("M")); + set_header (8,TR("Data")); if (_stampanum < 3) - set_header (8,"@11g%s", trans("Numero")); + set_header (8,"@11g%s", TR("Numero")); if (_stampa_des_contro) { set_header (8,"@23g%s@34g%s@42g%s@70g%s@112g%s@127g%s@135g%s@183g%s@189g%s@197g%s", - trans("Data"), trans("Numero"), trans("Cod.Causale"), trans("Descrizione"), trans("Dare"), trans("Avere"), - trans("Contropartita"), trans("Iva"), - trans("Protoc."), trans("C")); + TR("Data"), TR("Numero"), TR("Cod.Causale"), TR("Descrizione"), TR("Dare"), TR("Avere"), + TR("Contropartita"), TR("Iva"), TR("Protoc."), TR("C")); } else { set_header (8,"@23g%s@34g%s@42g%s@70g%s@112g%s@127g%s@135g%s@152g%s@169g%s@183g%s@189g%s@197g%s", - trans("Data"), trans("Numero"), trans("Cod.Causale"), trans("Descrizione"), trans("Dare"), trans("Avere"), - trans("Saldo progre."), trans("Saldo movim."), trans("Partita"), trans("Iva"), - trans("Protoc."), trans("C")); + TR("Data"), TR("Numero"), TR("Cod.Causale"), TR("Descrizione"), TR("Dare"), TR("Avere"), + TR("Saldo progre."), TR("Saldo movim."), TR("Partita"), TR("Iva"), TR("Protoc."), TR("C")); } if (_stampa_mov_prov) - set_header(8,"@195g%s", trans("P")); + set_header(8,"@195g%s", TR("P")); sep1.fill('_'); set_header (9,"@0g%s", (const char*)sep1); } @@ -3043,13 +2880,13 @@ void TMastrini_application::crea_intestazione() { if (_numcarat == 1) { - set_header (10,"@42g%s@66g%s", trans("PROGRESSIVI PRECEDENTI"), real2str(_saldo_progre_prec)); + set_header (10,"@42g%s@66g%s", TR("PROGRESSIVI PRECEDENTI"), real2str(_saldo_progre_prec)); set_header (10,"@83g%s", real2str(_progredare)); set_header (10,"@100g%s", real2str(_progreavere)); } if (_numcarat == 2) { - set_header (10,"@70g%s@100g%s", trans("PROGRESSIVI PRECEDENTI"), real2str(_progredare)); + set_header (10,"@70g%s@100g%s", TR("PROGRESSIVI PRECEDENTI"), real2str(_progredare)); set_header (10,"@117g%s", real2str(_progreavere)); if (!_stampa_des_contro) set_header (10,"@135g%s", real2str(_saldo_progre_prec)); @@ -3073,12 +2910,12 @@ void TMastrini_application::crea_intestazione() { if (_numcarat == 1) { - set_header (10,"@32g%s@83g%s", trans("A RIPORTO"), real2str(dep_dare)); + set_header (10,"@32g%s@83g%s", TR("A RIPORTO"), real2str(dep_dare)); set_header (10,"@100g%s", real2str(dep_avere)); } else { - set_header (10,"@32g%s@100g%s", trans("A RIPORTO"), real2str(dep_dare)); + set_header (10,"@32g%s@100g%s", TR("A RIPORTO"), real2str(dep_dare)); set_header (10,"@117g%s", real2str(dep_avere)); } } @@ -3128,12 +2965,12 @@ int TMastrini_application::crea_intestazione(int start_riga) { if (_numcarat == 1) { - sep << "Pag. @#"; + sep << FR("Pag. @#"); set_row(r,"@126g%s", (const char*) sep); } else if (_numcarat == 2) { - sep << "Pagina @#"; + sep << FR("Pagina @#"); set_row(r,"@190g%s", (const char*) sep); } } @@ -3141,13 +2978,13 @@ int TMastrini_application::crea_intestazione(int start_riga) else { if (_numcarat == 1) - set_row(r,"@126g%s %2d", trans("Pag."), _numero_pag++); + set_row(r,"@126g%s %2d", TR("Pag."), _numero_pag++); else if (_numcarat == 2) - set_row(r,"@190g%s %2d", trans("Pagina"),_numero_pag++); + set_row(r,"@190g%s %2d", TR("Pagina"),_numero_pag++); } if (_nummast != 3 || _pagina != np) { - set_row (r, "@0g%s@6g%5ld", trans("DITTA"), _codice_ditta); + set_row (r, "@0g%s@6g%5ld", TR("DITTA"), _codice_ditta); set_row (r, "@12g%-45s", (const char*) _ragsoc); set_row (r, "@59g%s", (const char*) _indulc); //set_row (r, "@86g%-9s", (const char*) _civulc); @@ -3157,9 +2994,9 @@ int TMastrini_application::crea_intestazione(int start_riga) r += 2; } if (_nummast == 3) - set_row (r, "@0g%s@12g@b%3d %3d %6ld", trans("Sottoconto"), _gruppo, _conto, _sottoc); + set_row (r, "@0g%s@12g@b%3d %3d %6ld", TR("Sottoconto"), _gruppo, _conto, _sottoc); else - set_row (r, "@0g%s@12g%3d %3d %6ld", trans("Sottoconto"), _gruppo, _conto, _sottoc); + set_row (r, "@0g%s@12g%3d %3d %6ld", TR("Sottoconto"), _gruppo, _conto, _sottoc); if (_tmcf == 'C') _tipo_mask = 1; @@ -3185,14 +3022,13 @@ int TMastrini_application::crea_intestazione(int start_riga) { sep.fill('_'); //Stampa 132 - (sep(132)) set_row (r++,"@0g%s", (const char *) sep); - set_row (r++,"%s@19g%s@117g%s@131g%s", - trans("Operazione"), trans("Documento"), trans("Contro"), trans("A")); + set_row (r++,"%s@19g%s@117g%s@131g%s", TR("Operazione"), TR("Documento"), TR("Contro"), TR("A")); if (_stampa_mov_prov) - set_header(r-1,"@130g%s", trans("M")); - set_row (r, trans("Data")); + set_header(r-1,"@130g%s", TR("M")); + set_row (r, TR("Data")); if (_stampanum < 3) - set_row (r,"@11g%s", trans("Numero")); - set_row (r++,"@19gData@30gNumero@38gCod.Causale@61gDescrizione@95gDare@111gAvere@117gPartita@131gC"); + set_row (r,"@11g%s", TR("Numero")); + set_row (r++,FR("@19gData@30gNumero@38gCod.Causale@61gDescrizione@95gDare@111gAvere@117gPartita@131gC")); if (_stampa_mov_prov) set_header(r-1,"@130gP"); sep.fill('_'); @@ -3203,19 +3039,19 @@ int TMastrini_application::crea_intestazione(int start_riga) sep1.fill('_'); //Stampa 198 - (sep1(198)) set_row (r++,"@0g%s", (const char*)sep1); if (_stampa_des_contro) - set_row (r++,"Operazione@23gDocumento@183gReg@190gNumero@197gA"); + set_row (r++,FR("Operazione@23gDocumento@183gReg@190gNumero@197gA")); else - set_row (r++,"Operazione@23gDocumento@169gContro@183gReg@190gNumero@197gA"); + set_row (r++,FR("Operazione@23gDocumento@169gContro@183gReg@190gNumero@197gA")); if (_stampa_mov_prov) set_row(r-1,"@195gM"); set_row (r,"Data"); if (_stampanum < 3) set_row (r,"@11gnumero"); - set_row (r,"@23gData@34gNumero@42gCod.Causale@70gDescrizione@112gDare@127gAvere"); + set_row (r,FR("@23gData@34gNumero@42gCod.Causale@70gDescrizione@112gDare@127gAvere")); if (_stampa_des_contro) - set_row (r++,"@135gContropartita@183gIva@189gProtoc.@197gC"); + set_row (r++,FR("@135gContropartita@183gIva@189gProtoc.@197gC")); else - set_row (r++,"@135gSaldo progre.@152gSaldo movim.@169gPartita@183gIva@189gProtoc.@197gC"); + set_row (r++,FR("@135gSaldo progre.@152gSaldo movim.@169gPartita@183gIva@189gProtoc.@197gC")); if (_stampa_mov_prov) set_row (r-1,"@195gP"); sep1.fill('_'); @@ -3225,59 +3061,6 @@ int TMastrini_application::crea_intestazione(int start_riga) return r; } -void TMastrini_application::stampa_progre_riporto() -{ - TString sep(132),sep1(198); - - if (_nummast == 1 || _nummast == 3) - _rw = 1; - - if (_stampa_progressivi_si) - { - stampa_progressivi(); - _riporto_dare = _progredare; - _riporto_avere = _progreavere; - _stampa_progressivi_si = FALSE; - } - else - { - _riporto_dare += _riporto_parziale_dare; - _riporto_avere += _riporto_parziale_avere; - - real dep_dare,dep_avere,imp_d,imp_a; - imp_d = _sezione == "D" ? _importo : ZERO; - imp_a = _sezione == "A" ? _importo : ZERO; - dep_dare = _stampato ? _riporto_dare : _riporto_dare - imp_d; - dep_avere = _stampato ? _riporto_avere : _riporto_avere - imp_a; - - if (_nummast != 3 || dep_dare != ZERO || dep_avere != 0) - { - if (_numcarat == 1) - { - set_row (_rw,"@32g%s@83g%r", trans("A RIPORTO"), &dep_dare); - set_row (_rw++,"@100g%r",&dep_avere); - } - if (_numcarat == 2) - { - set_row (_rw,"@32g%s@100g%r", trans("A RIPORTO"), &dep_dare); - set_row (_rw++,"@117g%r", &dep_avere); - } - } - _riporto_parziale_dare = ZERO; - _riporto_parziale_avere = ZERO; - } - if (_numcarat == 1) - { - sep =""; - set_row(_rw,"@0g%s",(const char*)sep); - } - else - { - sep1 =""; - set_row(_rw,"@0g%s",(const char*)sep1); - } -} - int TMastrini_application::stampa_progre_riporto(int start_riga) { TString sep(132),sep1(198); @@ -3305,12 +3088,12 @@ int TMastrini_application::stampa_progre_riporto(int start_riga) { if (_numcarat == 1) { - set_row (r,"@32g%s@83g%r", trans("A RIPORTO"), &dep_dare); + set_row (r,"@32g%s@83g%r", TR("A RIPORTO"), &dep_dare); set_row (r++,"@100g%r", &dep_avere); } if (_numcarat == 2) { - set_row (r,"@32g%s@100g%r", trans("A RIPORTO"), &dep_dare); + set_row (r,"@32g%s@100g%r", TR("A RIPORTO"), &dep_dare); set_row (r++,"@117g%r", &dep_avere); } } @@ -3365,10 +3148,12 @@ void TMastrini_application::calcola_progressivi_al(const TDate& data_fin) const real importo = rmov.get(RMV_IMPORTO); long numreg = rmov.get_long(RMV_NUMREG); - const TDate datacomp = mov.get(MOV_DATACOMP); - TDate data; - - const TString16 provvis = mov.get(MOV_PROVVIS); + const TRectype & mov = cache().get(LF_MOV, numreg); + const TDate datacomp = (mov.get(MOV_DATACOMP)); + TDate data; + const TString16 provvis (mov.get(MOV_PROVVIS)); + + if (_stampa_mov_prov || (!_stampa_mov_prov && provvis.blank())) { if (_annomsk == 0) @@ -3540,39 +3325,19 @@ void TMastrini_application::calcola_progressivi(bool finali) } } -void TMastrini_application::stampa_progressivi() -{ - if (_nummast == 1 || _nummast == 3) - _rw = 1; - - if (_numcarat == 1) - { - set_row (_rw,"@42gPROGRESSIVI PRECEDENTI@66g%r", &_saldo_progre_prec); - set_row (_rw,"@83g%r", &_progredare); - set_row (_rw++,"@100g%r", &_progreavere); - } - else - { - set_row (_rw,"@70gPROGRESSIVI PRECEDENTI@100g%r", &_progredare); - set_row (_rw,"@117g%r", &_progreavere); - if (!_stampa_des_contro) - set_row (_rw++,"@135g%r", &_saldo_progre_prec); - } -} - int TMastrini_application::stampa_progressivi(int start_riga) { int r = start_riga; if (_numcarat == 1) { - set_row (r,"@42gPROGRESSIVI PRECEDENTI@66g%r", &_saldo_progre_prec); + set_row (r,FR("@42gPROGRESSIVI PRECEDENTI@66g%r"), &_saldo_progre_prec); set_row (r,"@83g%r", &_progredare); set_row (r++,"@100g%r", &_progreavere); } else { - set_row (r,"@70gPROGRESSIVI PRECEDENTI@100g%r", &_progredare); + set_row (r,FR("@70gPROGRESSIVI PRECEDENTI@100g%r"), &_progredare); set_row (r,"@117g%r", &_progreavere); if (!_stampa_des_contro) set_row (r++,"@135g%r", &_saldo_progre_prec); @@ -3586,21 +3351,17 @@ int TMastrini_application::stampa_progressivi(int start_riga) void TMastrini_application::ricerca_clifo() { TString ragsoc,paiv,cofi,indcf,capcf,ptel,tel,statocf,comcf,dencom,provcom,dep; - TLocalisamfile clifo(LF_CLIFO); - TLocalisamfile pconti(LF_PCON); TString16 dataini,datafine; TString descriz,descriz2; int numrivd; indcf = ""; - clifo.setkey(1); - clifo.zero(); - clifo.put(CLI_TIPOCF, _tmcf); - clifo.put(CLI_CODCF, _sottoc); - clifo.read(); - if (clifo.bad()) - clifo.zero(); + TString16 key; + + key.format("%c|%ld", _tmcf, _sottoc); + + const TRectype & clifo = cache().get(LF_CLIFO, key); TConto tc (_gruppo,_conto,_sottoc,_tmcf); ragsoc = tc.descrizione(); @@ -3615,28 +3376,23 @@ void TMastrini_application::ricerca_clifo() statocf = clifo.get(CLI_STATOCF); comcf = clifo.get(CLI_COMCF); - _comuni->setkey(1); - _comuni->zero(); - _comuni->put(COM_STATO, statocf); - _comuni->put(COM_COM, comcf); - _comuni->read(); - if (_comuni->good()) + key.format("%s|%s", (const char *) statocf, (const char *) comcf); + const TRectype & comuni = cache().get(LF_COMUNI, key); + + if (!comuni.empty()) { - dencom = _comuni->get(COM_DENCOM); - provcom = _comuni->get(COM_PROVCOM); + dencom = comuni.get(COM_DENCOM); + provcom = comuni.get(COM_PROVCOM); } else { - //dencom=""; dencom = clifo.get(CLI_LOCCF); provcom=""; } - - pconti.setkey(1); - pconti.zero(); - pconti.put(PCN_GRUPPO, _gruppo); - pconti.put(PCN_CONTO, _conto); - pconti.read(); + + key.format("%d|%d|", _gruppo, _conto); + + const TRectype & pconti = cache().get(LF_PCON, key); _sezivd = pconti.get_char(PCN_SEZIVD); _lettivd = pconti.get_char(PCN_LETTIVD); numrivd = pconti.get_int(PCN_NUMRIVD); @@ -3662,9 +3418,9 @@ void TMastrini_application::ricerca_clifo() set_header(3,"@59g%-.30s",(const char*) descrizione_conto()); set_header(3, "@91g%-.41s",(const char*) ragsoc); if (_nummast == 3) - set_header(4, "@r%s@8g@b%c", trans("Classe"), _lettivd); + set_header(4, "@r%s@8g@b%c", TR("Classe"), _lettivd); else - set_header(4, "%s@8g%c", trans("Classe") , _lettivd); + set_header(4, "%s@8g%c", TR("Classe") , _lettivd); set_header(4, "@10g%-8s", (const char*) _numrivd); if (_numivd != 0) set_header(4, "@19g%2d", _numivd); @@ -3683,12 +3439,12 @@ void TMastrini_application::ricerca_clifo() { if (_nummast == 3) { - set_header (5, "@rPeriodo@10g@b%s", (const char*) dataini); + set_header (5, FR("@rPeriodo@10g@b%s"), (const char*) dataini); set_header (5, "@22g@b%s@r", (const char*) datafine); } else { - set_header (5, "Periodo@10g%s", (const char*) dataini); + set_header (5, FR("Periodo@10g%s"), (const char*) dataini); set_header (5, "@22g%s", (const char*) datafine); } } @@ -3696,18 +3452,18 @@ void TMastrini_application::ricerca_clifo() { if (_nummast == 3) { - set_header (5, "@rComp. da@9g@b%s", (const char*) dataini); + set_header (5, FR("@rComp. da@9g@b%s"), (const char*) dataini); set_header (5, "@20g@ra@22g@b%s@r", (const char*) datafine); } else { - set_header (5, "Comp. da@9g%s", (const char*) dataini); + set_header (5, FR("Comp. da@9g%s"), (const char*) dataini); set_header (5, "@20ga@22g%s", (const char*) datafine); } } - set_header (5, "@33gP.I.@37g%-11s",(const char*) paiv); - set_header (5, "@49gCF@52g%-16s",(const char*) cofi); + set_header (5, FR("@33gP.I.@37g%-11s"),(const char*) paiv); + set_header (5, FR("@49gCF@52g%-16s"),(const char*) cofi); set_header (5, "@66g%-.25s",(const char*) indcf); set_header (5, "@95g%-5s",(const char*) capcf); set_header (5, "@101g%-.24s",(const char*) dencom); @@ -3724,8 +3480,6 @@ void TMastrini_application::ricerca_clifo() int TMastrini_application::ricerca_clifo(int start) { TString ragsoc,paiv,cofi,indcf,capcf,ptel,tel,statocf,comcf,dencom,provcom,dep; - TLocalisamfile clifo(LF_CLIFO); - TLocalisamfile pconti(LF_PCON); TString16 dataini,datafine; TString descriz,descriz2; int numrivd; @@ -3733,13 +3487,11 @@ int TMastrini_application::ricerca_clifo(int start) indcf = ""; - clifo.setkey(1); - clifo.zero(); - clifo.put(CLI_TIPOCF, _tmcf); - clifo.put(CLI_CODCF, _sottoc); - clifo.read(); - if (clifo.bad()) - clifo.zero(); + TString16 key; + + key.format("%c|%ld", _tmcf, _sottoc); + + const TRectype & clifo = cache().get(LF_CLIFO, key); TConto tc (_gruppo,_conto,_sottoc,_tmcf); ragsoc = tc.descrizione(); @@ -3754,28 +3506,24 @@ int TMastrini_application::ricerca_clifo(int start) statocf = clifo.get(CLI_STATOCF); comcf = clifo.get(CLI_COMCF); - _comuni->setkey(1); - _comuni->zero(); - _comuni->put(COM_STATO, statocf); - _comuni->put(COM_COM, comcf); - _comuni->read(); - if (_comuni->good()) + key.format("%s|%s", (const char *) statocf, (const char *) comcf); + + const TRectype & comuni = cache().get(LF_COMUNI, key); + + if (!comuni.empty()) { - dencom = _comuni->get(COM_DENCOM); - provcom = _comuni->get(COM_PROVCOM); + dencom = comuni.get(COM_DENCOM); + provcom = comuni.get(COM_PROVCOM); } else { - //dencom=""; dencom=clifo.get(CLI_LOCCF); provcom=""; } - pconti.setkey(1); - pconti.zero(); - pconti.put(PCN_GRUPPO, _gruppo); - pconti.put(PCN_CONTO, _conto); - pconti.read(); + key.format("%d|%d|", _gruppo, _conto); + + const TRectype & pconti = cache().get(LF_PCON, key); _sezivd = pconti.get_char(PCN_SEZIVD); _lettivd = pconti.get_char(PCN_LETTIVD); numrivd = pconti.get_int(PCN_NUMRIVD); @@ -3801,9 +3549,9 @@ int TMastrini_application::ricerca_clifo(int start) set_row (r,"@59g%-30s",(const char*) descrizione_conto()); set_row(r++, "@91g%-30s",(const char*) ragsoc); if (_nummast == 3) - set_row(r, "@r%s@8g@b%c", trans("Classe"), _lettivd); + set_row(r, "@r%s@8g@b%c", TR("Classe"), _lettivd); else - set_row(r, "%s@8g%c", trans("Classe"), _lettivd); + set_row(r, "%s@8g%c", TR("Classe"), _lettivd); set_row(r, "@10g%-8s", (const char*) _numrivd); if (_numivd != 0) set_row(r, "@19g%2d", _numivd); @@ -3822,12 +3570,12 @@ int TMastrini_application::ricerca_clifo(int start) { if (_nummast == 3) { - set_row (r, "@r%s@10g@b%s", trans("Periodo"), (const char*) dataini); + set_row (r, "@r%s@10g@b%s", TR("Periodo"), (const char*) dataini); set_row (r, "@22g%s@r", (const char*) datafine); } else { - set_row (r, "%s@10g%s", trans("Periodo"), (const char*) dataini); + set_row (r, "%s@10g%s", TR("Periodo"), (const char*) dataini); set_row (r, "@22g%s", (const char*) datafine); } } @@ -3835,19 +3583,19 @@ int TMastrini_application::ricerca_clifo(int start) { if (_nummast == 3) { - set_row (r, "@r%s@9g@b%s", trans("Comp.dal"), (const char*) dataini); - set_row (r, "@20g@r%s@22g@b%s@r", trans("al"), (const char*) datafine); + set_row (r, "@r%s@9g@b%s", TR("Comp.dal"), (const char*) dataini); + set_row (r, "@20g@r%s@22g@b%s@r", TR("al"), (const char*) datafine); } else { - set_row (r, "%s@9g%s", trans("Comp.dal"), (const char*) dataini); - set_row (r, "@20g%s@22g%s", trans("al"), (const char*) datafine); + set_row (r, "%s@9g%s", TR("Comp.dal"), (const char*) dataini); + set_row (r, "@20g%s@22g%s", TR("al"), (const char*) datafine); } } - set_row (r, "@33gP.I.@37g%-11s",(const char*) paiv); - set_row (r, "@49gCF@52g%-16s",(const char*) cofi); - set_row (r, "@66g%-.25s",(const char*) indcf); + set_row (r, FR("@33gP.I.@37g%-11s"),(const char*) paiv); + set_row (r, FR("@49gCF@52g%-16s"),(const char*) cofi); + set_row (r, "@66g%-.25s",(const char*) indcf); set_row (r, "@95g%-5s",(const char*) capcf); set_row (r, "@101g%-.24s",(const char*) dencom); set_row (r, "@126g%-5s",(const char*) provcom); @@ -3867,15 +3615,14 @@ int TMastrini_application::ricerca_clifo(int start) void TMastrini_application::ricerca_classe_IV(bool scelta) { - TLocalisamfile pconti(LF_PCON); + TString16 key; - pconti.setkey(1); - pconti.zero(); - pconti.put(PCN_GRUPPO, _gruppo); - pconti.put(PCN_CONTO, _conto); - if (scelta) - pconti.put(PCN_SOTTOCONTO, _sottoc); - pconti.read(); + if (scelta) + key.format("%d|%d|%ld", _gruppo, _conto, _sottoc); + else + key.format("%d|%d|", _gruppo, _conto); + + const TRectype & pconti = cache().get(LF_PCON, key); _sezivd = pconti.get_char(PCN_SEZIVD); _lettivd = pconti.get_char(PCN_LETTIVD); _numrivd_int = pconti.get_int (PCN_NUMRIVD); @@ -3912,9 +3659,9 @@ void TMastrini_application::ricerca_gruppo() set_header(3,"@91g%-.41s",(const char*) descrizione_sottoconto()); if (_nummast == 3) - set_header(4, "@0g@r%s@12g@b%c", trans("Classe"), _lettivd); + set_header(4, "@0g@r%s@12g@b%c", TR("Classe"), _lettivd); else - set_header(4, "@0g%s@12g%c", trans("Classe"), _lettivd); + set_header(4, "@0g%s@12g%c", TR("Classe"), _lettivd); set_header(4, "@14g%-8s",(const char*) _numrivd); if (_numivd != 0) set_header(4, "@23g%d", _numivd); @@ -3933,12 +3680,12 @@ void TMastrini_application::ricerca_gruppo() { if (_nummast == 3) { - set_header (5, "@r%s@12g@b%s", trans("Periodo"), (const char*) dataini); + set_header (5, "@r%s@12g@b%s", TR("Periodo"), (const char*) dataini); set_header (5, "@24g@b%s@r", (const char*) datafine); } else { - set_header (5, "%s@12g%s", trans("Periodo"), (const char*) dataini); + set_header (5, "%s@12g%s", TR("Periodo"), (const char*) dataini); set_header (5, "@24g%s", (const char*) datafine); } } @@ -3946,12 +3693,12 @@ void TMastrini_application::ricerca_gruppo() { if (_nummast == 3) { - set_header (5, "@r%s@23g@b%s", trans("Periodo di competenza"), (const char*) dataini); + set_header (5, "@r%s@23g@b%s", TR("Periodo di competenza"), (const char*) dataini); set_header (5, "@35g%s@r", (const char*) datafine); } else { - set_header (5, "%s@23g%s", trans("Periodo di competenza"), (const char*) dataini); + set_header (5, "%s@23g%s", TR("Periodo di competenza"), (const char*) dataini); set_header (5, "@35g%s", (const char*) datafine); } } @@ -3987,9 +3734,9 @@ int TMastrini_application::ricerca_gruppo(int start) set_row(r++,"@91g%-.41s",(const char*) descrizione_sottoconto()); if (_nummast == 3) - set_row(r, "@0g@r%s@12g@b%c", trans("Classe"), _lettivd); + set_row(r, "@0g@r%s@12g@b%c", TR("Classe"), _lettivd); else - set_row(r, "@0g%s@12g%c", trans("Classe"), _lettivd); + set_row(r, "@0g%s@12g%c", TR("Classe"), _lettivd); set_row(r, "@14g%-8s",(const char*) _numrivd); if (_numivd != 0) set_row(r, "@23g%d", _numivd); @@ -4008,12 +3755,12 @@ int TMastrini_application::ricerca_gruppo(int start) { if (_nummast == 3) { - set_row (r, "@r%s@12g@b%s", trans("Periodo"), (const char*) dataini); + set_row (r, "@r%s@12g@b%s", TR("Periodo"), (const char*) dataini); set_row (r, "@24g%s@r", (const char*) datafine); } else { - set_row (r, "%s@12g%s", trans("Periodo"), (const char*) dataini); + set_row (r, "%s@12g%s", TR("Periodo"), (const char*) dataini); set_row (r, "@24g%s", (const char*) datafine); } } @@ -4021,7 +3768,7 @@ int TMastrini_application::ricerca_gruppo(int start) { if (_nummast == 3) { - set_row (r, "@r%s@23g@b%s", trans("Periodo di competenza"), (const char*) dataini); + set_row (r, "@r%s@23g@b%s", TR("Periodo di competenza"), (const char*) dataini); set_row (r, "@35g%s@r", (const char*) datafine); if (_cdc.not_empty()) @@ -4030,17 +3777,17 @@ int TMastrini_application::ricerca_gruppo(int start) if (_fsc.not_empty()) { const TString& desc_fsc = cache().get("FSC", _fsc, "S0"); - set_row(++r, "@bCommessa %s %s - Fase %s %s", + set_row(++r, FR("@bCommessa %s %s - Fase %s %s"), (const char*)_cdc, (const char*)desc_cdc, (const char*)_fsc, (const char*)desc_fsc); } else - set_row(++r, "@bCommessa %s %s", (const char*)_cdc, (const char*)desc_cdc); + set_row(++r, FR("@bCommessa %s %s"), (const char*)_cdc, (const char*)desc_cdc); } } else { - set_row (r, "%s@23g%s", trans("Periodo di competenza"), (const char*) dataini); + set_row (r, "%s@23g%s", TR("Periodo di competenza"), (const char*) dataini); set_row (r, "@35g%s", (const char*) datafine); } } @@ -4049,76 +3796,50 @@ int TMastrini_application::ricerca_gruppo(int start) const char* TMastrini_application::descrizione_classe(char sezione, char lettera, int numr, int numero) { - TTable tabivd(TAB_IVD); - TString dep,dep2; + TString16 key; - tabivd.zero(); if (numr == 0 && numero == 0) - dep = format("%c%c",sezione,lettera); + key.format("%c%c",sezione,lettera); else if (numero == 0) + key.format("%c%c%04d",sezione, lettera, numr); + else { if (numr != 0) - dep = format("%1c%1c%04d",sezione, lettera, numr); + key.format("%c%c%04d%02d",sezione, lettera, numr,numero); else - dep = format("%c%c ",sezione,lettera); - } - else - { - if (numr != 0) - dep = format("%1c%1c%04d%02d",sezione, lettera, numr,numero); - else - dep = format("%c%c %02d",sezione,lettera,numero); - } + key.format("%c%c %02d",sezione,lettera,numero); + } - tabivd.put("CODTAB", dep); - tabivd.read(); - dep2 = tabivd.get("CODTAB"); - if (dep == dep2) - TMP = tabivd.get("S0"); - else - TMP = ""; - return TMP; + return cache().get("%IVD", key, "S0"); } //Ricerca la descrizione relativa al gruppo da stampare const char* TMastrini_application::descrizione_gruppo() { - TLocalisamfile pconti(LF_PCON); + TString16 key; + key.format("%d", _gruppo); - pconti.zero(); - pconti.put(PCN_GRUPPO,_gruppo); - if (pconti.read() != NOERR) pconti.zero(); - TMP = pconti.get(PCN_DESCR); - return TMP; + return cache().get(LF_PCON, key, PCN_DESCR); } // Ricerca la descrizione relativa al conto da stampare const char* TMastrini_application::descrizione_conto() { - TLocalisamfile pconti(LF_PCON); + TString16 key; + key.format("%d|%d", _gruppo, _conto); - pconti.zero(); - pconti.put(PCN_GRUPPO,_gruppo); - pconti.put(PCN_CONTO,_conto); - if (pconti.read() != NOERR) pconti.zero(); - TMP = pconti.get(PCN_DESCR); - return TMP; + return cache().get(LF_PCON, key, PCN_DESCR); } const char* TMastrini_application::descrizione_sottoconto() { - TLocalisamfile pconti(LF_PCON); + TString16 key; + key.format("%d|%d|%ld", _gruppo, _conto, _sottoc); - pconti.zero(); - pconti.put(PCN_GRUPPO, _gruppo); - pconti.put(PCN_CONTO, _conto); - pconti.put(PCN_SOTTOCONTO, _sottoc); - if (pconti.read() != NOERR) pconti.zero(); - TMP = pconti.get(PCN_DESCR); - return TMP; + return cache().get(LF_PCON, key, PCN_DESCR); } // Funzione per settare tutti gli handlers della maschera principale @@ -4212,14 +3933,10 @@ bool TMastrini_application::user_create() _rel->add("FSC", "CODTAB==FASCMS", 1, LF_RMOV, 502); _cur1=add_cursor(new TCursor(_rel,"FLSCA=\" \"",2)); + open_files(LF_TAB, LF_TABCOM,LF_NDITTE, LF_UNLOC, LF_COMUNI, LF_MOV, + LF_CLIFO, LF_CAUSALI, 0); _cur2=add_cursor(new TSorted_cursor(_rel,"DESCR","FLSCA=\" \"",2)); - _nditte = new TLocalisamfile (LF_NDITTE); - _unloc = new TLocalisamfile (LF_UNLOC); - _comuni = new TLocalisamfile (LF_COMUNI); - _mov = new TLocalisamfile (LF_MOV); - _clifo = new TLocalisamfile (LF_CLIFO); - _caus = new TLocalisamfile (LF_CAUSALI); _tabivd = new TTable (TAB_IVD); _tabtpd = new TTable (TAB_TPD); _tabreg = new TTable (TAB_REG); @@ -4240,10 +3957,6 @@ bool TMastrini_application::user_create() _gia_stampata_intestazione = FALSE; - _collins = new TConfig("cg3200.ini", "Main"); - const TString& language = _collins->get("Language"); - _collins->set_paragraph(language); - return TRUE; } @@ -4251,12 +3964,6 @@ bool TMastrini_application::user_destroy() { delete _msk; delete _rel; - delete _mov; - delete _nditte; - delete _unloc; - delete _comuni; - delete _clifo; - delete _caus; delete _tabivd; delete _tabtpd; delete _tabreg; @@ -4265,14 +3972,12 @@ bool TMastrini_application::user_destroy() delete _d22; delete _d30; - delete _collins; - return TRUE; } int cg3200(int argc, char* argv[]) { TMastrini_application a; - a.run(argc, argv, "Stampa Mastrini"); + a.run(argc, argv, TR("Stampa Mastrini")); return 0; } \ No newline at end of file diff --git a/cg/cg3300.cpp b/cg/cg3300.cpp index 658881087..997d305f6 100755 --- a/cg/cg3300.cpp +++ b/cg/cg3300.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -54,9 +55,6 @@ class TStampa_allegati : public TPrintapp TSort* _sort; - TLocalisamfile * _nditte, * _alleg, * _clifo; - TTable * _tpd, * _attiv; - TDate _data_stampa; int _anno_stampa; stampe _tipo_stampa; @@ -109,8 +107,8 @@ public: void calcola(); - bool da_sommare(); - bool buono(); + bool da_sommare(const TRectype & alleg); + bool buono(const TRectype & alleg); bool lo_devo_stampare(char tipo, long codice); @@ -132,7 +130,6 @@ public: TPrintrow * get_record_fine_volume (bool) ; long cerca_codice_all(char tipo, long codcf) ; - const char * decodifica_desc_att (const TString & codatt); bool corrispettivo (const char * tipodoc); TStampa_allegati () {} @@ -169,59 +166,29 @@ const char* filler (int size) long TStampa_allegati::cerca_codice_all(char tipo, long codcf) { - TLocalisamfile& clifo = *_clifo; + TString16 key; + + key.format("%c|%ld", tipo, codcf); - clifo.zero(); - clifo.put (CLI_TIPOCF, tipo); - clifo.put (CLI_CODCF, codcf); - clifo.read(); + const TRectype & clifo = cache().get(LF_CLIFO, key); - if (clifo.good()) - { - long codice_all = clifo.get_long (CLI_CODALLEG); - return codice_all; - } + if (!clifo.empty()) + return clifo.get_long (CLI_CODALLEG); return 0L; } -const char * TStampa_allegati::decodifica_desc_att (const TString & codatt) -{ - TTable& attivita = * _attiv; - - attivita.zero(); - attivita.put ("CODTAB", codatt); - - attivita.read(); - - if (attivita.bad()) - attivita.zero(); - - TMP = attivita.get ("S0"); - - return TMP; -} - bool TStampa_allegati::corrispettivo (const char * tipodoc) { - TTable& tpd = * _tpd; TString natura_doc; bool corrisp; - tpd.zero(); - tpd.put ("CODTAB", tipodoc); - tpd.read(); - if (tpd.bad()) - tpd.zero(); + const TRectype & tpd = cache().get("%TPD", tipodoc); natura_doc = tpd.get("I0"); corrisp = tpd.get_bool ("B0"); - if ((natura_doc == "1") || (natura_doc == "9")) - if (corrisp) - return TRUE; - - return FALSE; + return corrisp && (natura_doc == "1" || natura_doc == "9"); } // -------------------------------------------------------------------- @@ -253,11 +220,7 @@ void TStampa_allegati::init_sort() bool TStampa_allegati::user_create() { - _nditte = new TLocalisamfile (LF_NDITTE); - _alleg = new TLocalisamfile (LF_ALLEG); - _clifo = new TLocalisamfile (LF_CLIFO); - _tpd = new TTable ("%TPD"); - _attiv = new TTable ("%AIS"); + open_files(LF_TABCOM, LF_NDITTE, LF_ALLEG, LF_CLIFO, 0); _RecordSort = new SortRecord; _SortRecLen = _RecordSort->RecSize(); @@ -272,11 +235,6 @@ bool TStampa_allegati::user_create() bool TStampa_allegati::user_destroy() { - delete _alleg; - delete _clifo; - delete _nditte; - delete _tpd; delete _attiv; - // delete _sort; // Adesso e' nella postprocess_print() delete _RecordSort; delete _recb; @@ -441,11 +399,13 @@ void TStampa_allegati::pulisci_alleg (int anno_dic) for (cur = 0l; cur.pos() < items; ++cur) { prn.addstatus(1); - + + const bool immesso = curr.get_bool (ALL_IMMESSO); - if (immesso) - continue; + if (immesso) + continue; + curr.zero(ALL_IMPESC); curr.zero(ALL_IVAESC); curr.zero(ALL_NIESC); @@ -473,7 +433,6 @@ void TStampa_allegati::ricalcola(int anno_dic) char tipo; long codcf; int ndoc = 0; - bool immesso; bool vendite; real imponibile; real imposta; @@ -511,7 +470,7 @@ void TStampa_allegati::ricalcola(int anno_dic) const long items = cur.items(); cur.freeze(); - TString str; str.format("Ricalcolo anno %d...", anno_dic); + TString str; str.format(TR("Ricalcolo anno %d..."), anno_dic); TProgind pi(items, str, FALSE, TRUE); const TRectype& mov_curr = cur.curr(LF_MOV); @@ -563,6 +522,7 @@ void TStampa_allegati::ricalcola(int anno_dic) all_curr.put (ALL_ANNO, anno_dic); all_curr.put (ALL_TIPOCF, tipo); all_curr.put (ALL_CODCF, codcf); + all_curr.put (ALL_CODATT, reg.get("S8")); datareg = mov_curr.get_date (MOV_DATAREG); datadoc = mov_curr.get_date (MOV_DATADOC); @@ -590,21 +550,27 @@ void TStampa_allegati::ricalcola(int anno_dic) ndoc = 0; const TRectype& rmi = cur.curr(LF_RMOVIVA); + bool all_to_save = FALSE; while (cur.next_match (LF_RMOVIVA)) { - immesso = all.get_bool (ALL_IMMESSO); - if (immesso) continue; // scarta i record immessi - int err = all.read(); - if (err != NOERR) // aggiungo un record se non presente + + if (err == NOERR) // aggiungo un record se non presente + { + if (all_curr.get_bool (ALL_IMMESSO)) + continue; // scarta i record immessi + } + else { all_curr.zero(); all_curr.put (ALL_ANNO, anno_dic); all_curr.put (ALL_TIPOCF, tipo); all_curr.put (ALL_CODCF, codcf); + all_curr.put (ALL_CODATT, reg.get("S8")); err = all.write(); } + all_to_save = TRUE; imponibile = rmi.get_real (RMI_IMPONIBILE); imposta = rmi.get_real (RMI_IMPOSTA); @@ -659,19 +625,23 @@ void TStampa_allegati::ricalcola(int anno_dic) } } // while next_match() - all.rewrite(); + if (all_to_save) + all.rewrite(); } // for cur=0; ++cur cur.freeze(FALSE); } bool TStampa_allegati::lo_devo_stampare(char tipo, long codcf) { - _clifo->curr().zero(); - _clifo->curr().put (CLI_TIPOCF, tipo); - _clifo->curr().put (CLI_CODCF, codcf); - if (_clifo->read() == NOERR) + TString16 key ; + + key.format("%c|%ld", tipo, codcf); + + const TRectype & clifo = cache().get(LF_CLIFO, key); + + if (!clifo.empty()) { - const int codice_all = _clifo->curr().get_int(CLI_ALLEG); + const int codice_all = clifo.get_int(CLI_ALLEG); if ((codice_all == 0) || (codice_all == 3) || (codice_all == 4) ) return TRUE; else @@ -682,21 +652,21 @@ bool TStampa_allegati::lo_devo_stampare(char tipo, long codcf) } -bool TStampa_allegati::da_sommare() +bool TStampa_allegati::da_sommare(const TRectype & alleg) { TString tipocf2; long codcf2; int anno2; TString codatt_dett; TString comodo; - tipocf2 = _alleg->curr().get (ALL_TIPOCF); - codcf2 = _alleg->curr().get_long (ALL_CODCF); - anno2 = _alleg->curr().get_int(ALL_ANNO); - codatt_dett = _alleg->curr().get (ALL_CODATT); + tipocf2 = alleg.get (ALL_TIPOCF); + codcf2 = alleg.get_long (ALL_CODCF); + anno2 = alleg.get_int(ALL_ANNO); + codatt_dett = alleg.get (ALL_CODATT); if (_RecordSort->codcf_dett() == -1) { - _RecordSort->compila(_alleg); + _RecordSort->compila(alleg); return TRUE; // vuol dire che e' il primo => va messo nella struttura } @@ -727,54 +697,53 @@ bool TStampa_allegati::da_sommare() // // QUI COMPILO IL RECORD B PER I FORNITORI // -bool TStampa_allegati::buono() +bool TStampa_allegati::buono(const TRectype & alleg) { - const TRectype& curr = _alleg->curr(); - if (curr.empty()) - return FALSE; - - char tipo = curr.get_char(ALL_TIPOCF); - long codcf = curr.get_long(ALL_CODCF); + if (!alleg.empty()) + { + char tipo = alleg.get_char(ALL_TIPOCF); + long codcf = alleg.get_long(ALL_CODCF); // // Se stampo i clienti scarto chi non ha codcf = "C" // - if (_tipoa_richiesto != tipo) - return FALSE; + if (_tipoa_richiesto != tipo) + return FALSE; // -------------------------------------------------------------------- // GESTIONE RECORD B // -------------------------------------------------------------------- - if ((_tipo_stampa == fornitori) || (_tipo_stampa == modulo102)) - { - if (tipo == 'B') - { - _recb->compila(_alleg); - return FALSE; - } - } + if ((_tipo_stampa == fornitori) || (_tipo_stampa == modulo102)) + { + if (tipo == 'B') + { + _recb->compila(alleg); + return FALSE; + } + } - if (_ricerca_att != "") - { - // strcpy (_RecordSort->Strutt()->codatt_dett, _alleg->curr().get (ALL_CODATT)); - const TString& dep = curr.get (ALL_CODATT); - if (_ricerca_att != dep) - return FALSE; - } + if (_ricerca_att != "") + { + // strcpy (_RecordSort->Strutt()->codatt_dett, _alleg->curr().get (ALL_CODATT)); + const TString& dep = alleg.get (ALL_CODATT); + if (_ricerca_att != dep) + return FALSE; + } - if (_anno_stampa > 0) - { - int anno = curr.get_int(ALL_ANNO); - if (anno != _anno_stampa) - return FALSE; - } + if (_anno_stampa > 0) + { + const int anno = alleg.get_int(ALL_ANNO); + if (anno != _anno_stampa) + return FALSE; + } - // se la stampa e' di controllo e voglio tutti i clienti mov. stampo tutti - if ((_destinazione_stampa == controllo) && _stampa_tutti) - return TRUE; + // se la stampa e' di controllo e voglio tutti i clienti mov. stampo tutti + if ((_destinazione_stampa == controllo) && _stampa_tutti) + return TRUE; - if (!lo_devo_stampare(tipo, codcf)) - return FALSE; + if (!lo_devo_stampare(tipo, codcf)) + return FALSE; + } return TRUE; } @@ -799,71 +768,71 @@ void TStampa_allegati::calcola () _num_cf = 0; // contatore C/F - _nditte->zero(); - _nditte->put(NDT_CODDITTA, ditta_da); - for (int err = _nditte->read(_isgteq); err == NOERR; err = _nditte->next()) + TRelation relditte(LF_NDITTE); + TRectype from(relditte.curr()); + TRectype to(relditte.curr()); + + from.put(NDT_CODDITTA, ditta_da); + to.put(NDT_CODDITTA, ditta_a); + + TCursor ditte(&relditte, "", 1, &from, &to); + const long items = ditte.items(); + const TRectype & ditta = ditte.curr(); + + ditte.freeze(); + for (ditte = 0L; ditte.pos() < items; ++ditte) { - const long nuova_ditta = _nditte->get_long(NDT_CODDITTA); - if (nuova_ditta > ditta_a) - break; + const long nuova_ditta = ditta.get_long(NDT_CODDITTA); - if (!prefix().exist(nuova_ditta)) // TBC *** fv mi sembrava ci volesse - continue; - - set_firm(nuova_ditta); + if (prefix().exist(nuova_ditta)) // TBC *** fv mi sembrava ci volesse + { + set_firm(nuova_ditta); - if (_ricalcola) - ricalcola(_anno_stampa); + if (_ricalcola) + ricalcola(_anno_stampa); - // Legge i dati anagrafici del dichiarante - _RecordSort->fill_dati_anag_dic(_nditte); + // Legge i dati anagrafici del dichiarante + _RecordSort->fill_dati_anag_dic(ditta); - // --------------------------------------------------------------------- - // ELABORAZIONE ALLEGATI - // --------------------------------------------------------------------- - _alleg->zero(); - _alleg->put (ALL_ANNO, _anno_stampa); - _alleg->put (ALL_CODCF, _tipoa_richiesto); + // --------------------------------------------------------------------- + // ELABORAZIONE ALLEGATI + // --------------------------------------------------------------------- + TRelation relalleg(LF_ALLEG); + TRectype from(relalleg.curr()); - TProgind prnd(_alleg->items(), "Elaborazione allegati in corso...", FALSE, TRUE); + from.put (ALL_ANNO, _anno_stampa); + from.put (ALL_TIPOCF, _tipoa_richiesto); + if (_ricerca_att != "") + from.put(ALL_CODATT, _ricerca_att); + TCursor alleg(&relalleg, "", _distingui_att ? 1 : 2, &from, &from); + const long items = alleg.items(); + const TRectype & recalleg = alleg.curr(); - if (_ricerca_att != "") - _alleg->curr().put (ALL_CODATT, _ricerca_att); + alleg.freeze(); + + TProgind prnd(items, TR("Elaborazione allegati in corso..."), FALSE, TRUE); - if (_distingui_att) - _alleg->setkey (1); - else - _alleg->setkey (2); // non distinguo le attivita + for (alleg = 0L; alleg.pos() < items; ++alleg) + { + prnd.addstatus(1); - for (int err = _alleg->read(_isgteq); err == NOERR; err = _alleg->next()) - { - prnd.addstatus(1); - - if (buono()) - { - if (da_sommare ()) - _RecordSort->somma(_alleg->curr(), _tipo_stampa); // somma nella struttura - else - { - if (!_RecordSort->importo().is_zero()) - { - _sort->sort (_RecordSort->Strutt_str()); - _num_cf += 1; // incremento contatore numero di C/F - } - _t->incrementa_totali(_RecordSort->Strutt(), _tipo_stampa); - _RecordSort->compila(_alleg->curr()); - } - } // if buono() - } - // Sorta anche l'ultimo: BESTIA! - if (!_RecordSort->importo().is_zero()) - { - _sort->sort (_RecordSort->Strutt_str()); - _num_cf += 1; // incremento contatore numero di C/F - } - - // rimetto all'inizio il puntatore di _alleg dopo averlo scorso tutto una volta - _alleg->first(); + if (buono(recalleg)) + { + if (da_sommare (recalleg)) + _RecordSort->somma(recalleg, _tipo_stampa); // somma nella struttura + else + { + if (!_RecordSort->importo().is_zero()) + { + _sort->sort (_RecordSort->Strutt_str()); + _num_cf += 1; // incremento contatore numero di C/F + } + _t->incrementa_totali(_RecordSort->Strutt(), _tipo_stampa); + _RecordSort->compila(recalleg); + } + } // if buono() + } + } } // for su nditte // @@ -1163,7 +1132,7 @@ void TStampa_allegati::set_rows(int counter) bool TStampa_allegati::preprocess_page(int file,int counter) { static long codditta_curr; - static TFixed_string codatt_curr(" "); // Sono 5 spazi + static TString16 codatt_curr(" "); // Sono 5 spazi struct alleg_sort * buff = (struct alleg_sort *) _buff; int pagina_corrente = printer().getcurrentpage(); @@ -1409,25 +1378,6 @@ bool TStampa_allegati::intesta() return TRUE; } -/****************** - const char * TStampa_allegati::get_paiva_cf (const char * tipoa, long codcf) - { - TString dep; - - _clifo->setkey(1); - _clifo->first (); - _clifo->curr().zero(); - _clifo->curr().put (CLI_TIPOCF, tipoa); - _clifo->curr().put (CLI_CODCF, codcf); - _clifo->read(); - if (_clifo->good()) - dep = _clifo->curr().get(CLI_PAIV); - else - dep = ""; - return dep; - } - ******************/ - // ---------------------------------------------------------------------- // // STAMPA SU DISCO @@ -1972,14 +1922,14 @@ void TStampa_allegati::scrivi_coda_elenco_fornitori() segno[5] = ' '; if (_t->TotE8esc() < 0) - segno[8] = '-'; + segno[6] = '-'; else - segno[8] = ' '; + segno[6] = ' '; if (_t->TotE8esp() < 0) - segno[8] = '-'; + segno[7] = '-'; else - segno[8] = ' '; + segno[7] = ' '; if (_t->TotTotRigac() < 0) segno[8] = '-'; @@ -2228,8 +2178,7 @@ TPrintrow * TStampa_allegati::get_record_fine_volume (bool finito) int cg3300(int argc, char* argv[]) { TStampa_allegati a; - a.run(argc, argv, "Stampa Allegati"); + a.run(argc, argv, TR("Stampa Allegati")); return 0; } - diff --git a/cg/cg3300.h b/cg/cg3300.h index a39b6f240..e0b57684a 100755 --- a/cg/cg3300.h +++ b/cg/cg3300.h @@ -117,32 +117,23 @@ struct alleg_sort { }; class SortRecord { - TLocalisamfile * _clifo; - TLocalisamfile * _comuni; - TLocalisamfile * _anagfis; - TLocalisamfile * _anaggiu; - TLocalisamfile * _anag; - TTable * _attiv; - TTable * _tpd; struct alleg_sort * _all; protected: - TRectype& look_com(const char *); - long cerca_codice_all(char tipo, long codcf) ; + const TRectype & look_com(const char * cod); const char * decodifica_desc_att (const TString & codatt); - bool corrispettivo (const char * tipodoc); public: - void azzera_struttura(); - bool fill_dati_anag_dic (TLocalisamfile *); + void azzera_struttura(); + bool fill_dati_anag_dic (const TRectype & ditta); const char * fill_dati_dettaglio (const char * tipo, long codcf); const char * Strutt_str() { return (const char *) _all; } struct alleg_sort * Strutt() { return _all; } - void compila(const TRectype& alleg); - void somma (const TRectype& rec, stampe); + void compila(const TRectype& alleg); + void somma (const TRectype& rec, stampe); const real& importo() const { return _all->impesc; } - int RecSize () { return sizeof(struct alleg_sort); } - long codcf_dett() { return _all->codcf_dett; } + int RecSize () { return sizeof(struct alleg_sort); } + long codcf_dett() { return _all->codcf_dett; } const real& Impesc() { return _all->impesc; } SortRecord(); diff --git a/cg/cg3300a.uml b/cg/cg3300a.uml index 1440f1d83..17ac4c9e7 100755 --- a/cg/cg3300a.uml +++ b/cg/cg3300a.uml @@ -143,12 +143,12 @@ BEGIN VALIDATE F_A_DITTA>=F_DA_DITTA END -BUTTON DLG_OK 9 2 +BUTTON DLG_OK 10 2 BEGIN PROMPT -12 -1 "" END -BUTTON DLG_CANCEL 9 2 +BUTTON DLG_CANCEL 10 2 BEGIN PROMPT -22 -1 "" END diff --git a/cg/cg3301.cpp b/cg/cg3301.cpp index ca13f6bb9..5c8400e84 100755 --- a/cg/cg3301.cpp +++ b/cg/cg3301.cpp @@ -3,9 +3,10 @@ // classi di supporto per cg3300_application // -#include +#include +#include +#include #include -#include #include #include @@ -18,12 +19,6 @@ #include "cg3300.h" -const int CODTABLEN = 15; - -#define MAXSTR 128 -static char __tmp[MAXSTR]; -static TFixed_string tmp(__tmp, MAXSTR); - // // SortRecord // @@ -31,93 +26,27 @@ static TFixed_string tmp(__tmp, MAXSTR); SortRecord::SortRecord() { _all = new struct alleg_sort; - _clifo = new TLocalisamfile(LF_CLIFO); - _comuni = new TLocalisamfile(LF_COMUNI); - _anagfis = new TLocalisamfile(LF_ANAGFIS); - _anaggiu = new TLocalisamfile(LF_ANAGGIU); - _anag = new TLocalisamfile(LF_ANAG); - _attiv = new TTable("%AIS"); - _tpd = new TTable("%TPD"); azzera_struttura(); } SortRecord::~SortRecord() { - delete _clifo; delete _comuni; delete _attiv; delete _tpd; - delete _anagfis; delete _anaggiu; delete _anag; delete _all; } -long SortRecord::cerca_codice_all(char tipo, long codcf) -{ - TLocalisamfile& clifo = *_clifo; - - clifo.zero(); - clifo.put (CLI_TIPOCF, tipo); - clifo.put (CLI_CODCF, codcf); - clifo.read(); - - if (clifo.good()) - { - long codice_all = clifo.get_long (CLI_CODALLEG); - return codice_all; - } - - return 0L; -} - const char* SortRecord::decodifica_desc_att (const TString& codatt) + { - TTable& attivita = * _attiv; - - attivita.zero(); - attivita.put ("CODTAB", codatt); - - attivita.read(); - - if (attivita.bad()) - attivita.zero(); - - tmp = attivita.get ("S0"); - - return __tmp; + return cache().get("%AIS", codatt, "S0"); } -bool SortRecord::corrispettivo (const char * tipodoc) +const TRectype & SortRecord::look_com(const char * cod) { - TTable& tpd = * _tpd; - TString natura_doc; - bool corrisp; + TString16 key; + + key.format("|%s", cod); - tpd.zero(); - tpd.put ("CODTAB", tipodoc); - tpd.read(); - if (tpd.bad()) - tpd.zero(); - - natura_doc = tpd.get("I0"); - corrisp = tpd.get_bool ("B0"); - - if ((natura_doc == "1") || (natura_doc == "9")) - if (corrisp) - return TRUE; - - return FALSE; -} - -TRectype& SortRecord::look_com (const char * cod) -{ - TLocalisamfile& com = *_comuni; - - com.zero(); - com.put (COM_COM, cod); - - com.read(); - - if (com.bad()) - com.zero(); - - return com.curr(); + return cache().get(LF_COMUNI, key); } // @@ -130,54 +59,37 @@ TRectype& SortRecord::look_com (const char * cod) // const char * SortRecord::fill_dati_dettaglio (const char * tipocf, long codcf) { - TLocalisamfile& clifo = *_clifo; - static char _rag[51]; - TString tipop, cog, nom, rag; - TString indcf, comcf; - TString stato, paiva; + TString16 key; - clifo.zero(); - clifo.put (CLI_TIPOCF, tipocf); - clifo.put (CLI_CODCF, codcf); - clifo.read(); + key.format("%s|%ld", tipocf, codcf); + const TRectype & clifo = cache().get(LF_CLIFO, key); - if ((clifo.good())) + if (!clifo.empty()) { - tipop = clifo.get (CLI_TIPOPERS); - rag = clifo.get (CLI_RAGSOC); + TString indcf; - indcf = clifo.curr().get (CLI_INDCF); - indcf << ", " << clifo.curr().get (CLI_CIVCF); - comcf = clifo.curr().get (CLI_COMCF); - - TRectype dep = look_com ((const char *)comcf); - strcpy (_all->comune_dett , dep.get(COM_DENCOM)); - strcpy (_all->prov_dett , dep.get(COM_PROVCOM)); + indcf = clifo.get (CLI_INDCF); + indcf << ", " << clifo.get (CLI_CIVCF); + strcpy (_all->via_dett, indcf); + strcpy (_all->paiva_dett, clifo.get (CLI_PAIV)); + strcpy (_all->statopaiva_dett, clifo.get (CLI_STATOPAIV)); - strcpy (_all->via_dett , indcf); + const TRectype & dep = look_com ((const char *)clifo.get (CLI_COMCF)); - paiva = clifo.curr().get (CLI_PAIV); - stato = clifo.curr().get (CLI_STATOPAIV); + strcpy (_all->comune_dett, dep.get(COM_DENCOM)); + strcpy (_all->prov_dett, dep.get(COM_PROVCOM)); - strcpy (_all->paiva_dett , paiva); - strcpy (_all->statopaiva_dett , stato); - - strcpy (_all->ragsoc_dett , rag); - - if (tipop == "F") + const TString & rag = clifo.get (CLI_RAGSOC); + if (clifo.get (CLI_TIPOPERS) == "F") { - cog = rag.left(30); - nom = rag.mid (31); - strcpy (_all->cognome_dett , cog.trim()); - strcpy (_all->nome_dett , nom.trim()); - // - // N.B. - // Azzero la ragione sociale se persona fisica. - // - strcpy (_all->ragsoc_dett , "\0"); + strcpy (_all->cognome_dett, rag.left(30)); + strcpy (_all->nome_dett, rag.mid(30)); + strcpy (_all->ragsoc_dett, ""); } - strcpy (_rag, (const char*) rag); - return _rag; + else + strcpy (_all->ragsoc_dett, rag); + + return rag; } return NULL; } @@ -331,112 +243,83 @@ void SortRecord::compila(const TRectype& alleg) fill_dati_dettaglio (tipoa, codcf); } -bool SortRecord::fill_dati_anag_dic (TLocalisamfile * nditte) +bool SortRecord::fill_dati_anag_dic (const TRectype & ditta) { - TLocalisamfile& anagfis = *_anagfis; - TLocalisamfile& anaggiu = *_anaggiu; - TLocalisamfile& anag = *_anag; - TString codanagr; - TString tipoa; - TString comodo; + long codanagr; + TString tipoa; + TString str; - _all->codditta_dic = nditte->get_long(NDT_CODDITTA); - comodo = nditte->get(NDT_CODATTPREV); + _all->codditta_dic = ditta.get_long(NDT_CODDITTA); + str = ditta.get(NDT_CODATTPREV); - strcpy (_all->codatt_dic, comodo); - if (comodo.not_empty()) - comodo = decodifica_desc_att (comodo); + str = decodifica_desc_att (str); + if (str.not_empty()) + strcpy (_all->codatt_dic, str); - if (comodo.not_empty()) - strcpy (_all->attivita_dic, comodo); - else - strcpy (_all->attivita_dic, "\0"); + strcpy (_all->attivita_dic, str); - codanagr = nditte->curr().get(NDT_CODANAGR); - tipoa = nditte->curr().get(NDT_TIPOA); + codanagr = ditta.get_long(NDT_CODANAGR); + tipoa = ditta.get(NDT_TIPOA); strcpy (_all->tipopers_dic, tipoa); - anag.setkey(1); - anag.curr().zero(); - anag.curr().put (ANA_TIPOA, tipoa); - anag.curr().put (ANA_CODANAGR, codanagr); - if (anag.read() == NOERR) - { - strcpy (_all->paiva_dic, anag.curr().get (ANA_PAIV)); - strcpy (_all->ragsoc_dic , anag.curr().get(ANA_RAGSOC)); - strcpy (_all->comunefis_dic, anag.curr().get(ANA_COMRF)); - } - else - { - strcpy (_all->paiva_dic, "\0"); - strcpy (_all->ragsoc_dic , "\0"); - strcpy (_all->comunefis_dic, "\0"); - } + TString16 key; + + key.format("%s|%ld", (const char *) tipoa, codanagr); + + const TRectype & anag = cache().get(LF_ANAG, key); + + strcpy (_all->paiva_dic, anag.get (ANA_PAIV)); + strcpy (_all->ragsoc_dic , anag.get(ANA_RAGSOC)); + strcpy (_all->comunefis_dic, anag.get(ANA_COMRF)); if (_all->comunefis_dic[0] == '\0') { - strcpy (_all->comunefis_dic, anag.curr().get(ANF_COMRES)); + strcpy (_all->comunefis_dic, anag.get(ANF_COMRES)); - TRectype dep = look_com (_all->comunefis_dic); + const TRectype & dep = look_com (_all->comunefis_dic); strcpy (_all->comunefis_dic , dep.get(COM_DENCOM)); strcpy (_all->provfis_dic , dep.get(COM_PROVCOM)); - comodo = anag.curr().get(ANA_INDRES); - comodo.rtrim(); - comodo << " " << anag.curr().get (ANA_CIVRES); - strcpy (_all->viafis_dic , (const char *) comodo); + str = anag.get(ANA_INDRES); + str << " " << anag.get(ANA_CIVRES); + strcpy (_all->viafis_dic , (const char *) str); } else { - TRectype dep = look_com (_all->comunefis_dic); + const TRectype & dep = look_com (_all->comunefis_dic); strcpy (_all->comunefis_dic, dep.get(COM_DENCOM)); strcpy (_all->provfis_dic , dep.get(COM_PROVCOM)); - comodo = anag.curr().get(ANA_INDRF); - comodo.rtrim(); - comodo << " " << anag.curr().get (ANA_CIVRF); - - strcpy (_all->viafis_dic, comodo); + str = anag.get(ANA_INDRF); + str << " " << anag.get (ANA_CIVRF); + strcpy (_all->viafis_dic, str); } + key.format("%ld", codanagr); + if (tipoa[0] == 'F') { - TString cognome, nome; + str = _all->ragsoc_dic; + strcpy (_all->cognome_dic, str.left(30)); + strcpy (_all->nome_dic, str.mid(30)); - comodo = _all->ragsoc_dic; - cognome = comodo.sub(0,29); - cognome.trim(); - strcpy (_all->cognome_dic, cognome); - - comodo = _all->ragsoc_dic; - nome = comodo.mid(30); - nome.trim(); - strcpy (_all->nome_dic, nome); - - anagfis.setkey(1); - anagfis.curr().zero(); - anagfis.curr().put (ANF_CODANAGR, codanagr); - anagfis.read(); + const TRectype &anagfis = cache().get(LF_ANAGFIS, key); - _all->datana_dic = anagfis.curr().get_date(ANF_DATANASC); - strcpy (_all->sesso_dic , anagfis.curr().get(ANF_SESSO)); + _all->datana_dic = anagfis.get_date(ANF_DATANASC); + strcpy (_all->sesso_dic, anagfis.get(ANF_SESSO)); - TRectype dep = look_com (anagfis.curr().get(ANF_COMNASC)); + const TRectype & dep = look_com (anagfis.get(ANF_COMNASC)); strcpy (_all->comunena_dic, dep.get(COM_DENCOM)); - strcpy (_all->provna_dic , dep.get(COM_PROVCOM)); + strcpy (_all->provna_dic, dep.get(COM_PROVCOM)); } else if (tipoa[0] == 'G') { // Leggo natura giuridica dal anagrafe giuridiche - anaggiu.setkey(1); - anaggiu.curr().zero(); - anaggiu.curr().put (ANG_CODANAGR, codanagr); - if (anaggiu.read() == NOERR) - _all->natgiu_dic = anaggiu.curr().get_int (ANG_NATGIU); - else - _all->natgiu_dic = 0; + const TRectype &anaggiu = cache().get(LF_ANAGGIU, key); + + _all->natgiu_dic = anaggiu.get_int(ANG_NATGIU); } return TRUE; @@ -540,7 +423,7 @@ void Array_desc_campi::leggi_modulo (const char * file, const char *modulo) } } else - error_box("Impossibile trovare la sezione '%s' sul file '%s'", modulo, file); + error_box(FR("Impossibile trovare la sezione '%s' sul file '%s'"), modulo, file); } void Array_desc_campi::add(int r, const char* f) diff --git a/cg/cg3400.cpp b/cg/cg3400.cpp index 5bc17a679..a1d8e9e27 100755 --- a/cg/cg3400.cpp +++ b/cg/cg3400.cpp @@ -53,9 +53,6 @@ HIDDEN enum tipo_sospensione { nessuna, normale, vol_affari, liquidazione }; class TContoOccas : public TBill { TString16 _occfpi; - - TDecoder _clifoccas; - TDecoder _occas; TAssoc_array _desc; public: @@ -69,8 +66,6 @@ public: }; TContoOccas::TContoOccas() - : _occfpi(NULL), _clifoccas(LF_CLIFO, CLI_OCCAS), - _occas(LF_OCCAS, "RAGSOC") { } const TContoOccas& TContoOccas::set(int g, int c, long s, char t, const char* occfpi) @@ -85,9 +80,9 @@ const TString& TContoOccas::descrizione() if (_occfpi.not_empty()) { TString16 code; code << tipo() << '|' << sottoconto(); - bool really_occas = _clifoccas.decode(code).not_empty(); + bool really_occas = cache().get(LF_CLIFO, code, CLI_OCCAS).not_empty(); if (really_occas) - return _occas.decode(_occfpi); + return cache().get(LF_OCCAS, _occfpi, "RAGSOC"); } TString16 code; code.format("%c%03d%03d%06ld", @@ -167,12 +162,9 @@ public: TString16 _provfis, _cap, _occfpi; TString80 _cofi; - TLocalisamfile *_clifo,*_pconti,*_nditte,*_anag; - - TLocalisamfile* _attiv; // da togliere in futuro (?) + TTable *_tabreg; - TDecoder *_causali, *_tabiva; // Guy: saggia aggiunta public: virtual void preprocess_header(); @@ -217,7 +209,7 @@ public: int set_totali_pagina(int r); void get_dati_ditta (); - const char* get_descr_caus (const char * codcaus); + const TString& get_descr_caus (const char * codcaus); const TRectype& look_com (const char* cod, const char* stato = ""); const TString& get_codiva_des(const char* codiva); void update_totals (char sezione, real& importo); @@ -286,9 +278,9 @@ const TRectype& TStampa_giornale::look_com (const char* cod, const char* stato) return cache().get(LF_COMUNI, codice); } -const char* TStampa_giornale::get_descr_caus (const char * codcaus) +const TString & TStampa_giornale::get_descr_caus (const char * codcaus) { - return _causali->decode(codcaus); + return cache().get(LF_CAUSALI, codcaus).get("DESCR"); } void TStampa_giornale::get_dati_ditta () @@ -296,30 +288,25 @@ void TStampa_giornale::get_dati_ditta () TString16 codanagr; char tipoa; - _nditte->zero(); - _nditte->put(NDT_CODDITTA, get_firm()); - _nditte->read(); + const TRectype & nditte = cache().get(LF_NDITTE, get_firm()); - if (_nditte->bad()) _nditte->zero(); + _ragsoc = nditte.get(NDT_RAGSOC); + codanagr = nditte.get(NDT_CODANAGR); + tipoa = nditte.get_char(NDT_TIPOA); - _ragsoc = _nditte->get(NDT_RAGSOC); - codanagr = _nditte->curr().get(NDT_CODANAGR); - tipoa = _nditte->curr().get_char(NDT_TIPOA); + TToken_string key ; - _anag->setkey(1); - _anag->zero(); - _anag->put (ANA_TIPOA, tipoa); - _anag->put (ANA_CODANAGR, codanagr); - _anag->read(); - if (_anag->bad()) _anag->zero(); + key.add(tipoa); + key.add(codanagr); + const TRectype & anag = cache().get(LF_ANAG, key); - _cofi = _anag->get(ANA_COFI); - _paiva = _anag->get(ANA_PAIV); - _comunefis = _anag->get(ANA_COMRF); - _cap = _anag->get(ANA_CAPRF); + _cofi = anag.get(ANA_COFI); + _paiva = anag.get(ANA_PAIV); + _comunefis = anag.get(ANA_COMRF); + _cap = anag.get(ANA_CAPRF); if (_comunefis.empty()) - _comunefis = _anag->get(ANF_COMRES); + _comunefis = anag.get(ANF_COMRES); const TRectype& dep = look_com(_comunefis); _comunefis = dep.get(COM_DENCOM); @@ -329,15 +316,15 @@ void TStampa_giornale::get_dati_ditta () if (_comunefis.empty()) { - _viafis = _anag->get(ANA_INDRF); + _viafis = anag.get(ANA_INDRF); _viafis.rtrim(); - _viafis << ' ' << _anag->curr().get (ANA_CIVRF); + _viafis << " " << anag.get (ANA_CIVRF); } else { - _viafis = _anag->get(ANA_INDRES); + _viafis = anag.get(ANA_INDRES); _viafis.rtrim(); - _viafis << ' ' << _anag->get (ANA_CIVRES); + _viafis << " " << anag.get (ANA_CIVRES); } } @@ -352,15 +339,10 @@ bool TStampa_giornale::user_create() { _ae = 0; _ae_solare = 0; + open_files(LF_TABCOM, LF_TAB, LF_NDITTE, LF_ANAG, LF_COMUNI, LF_CLIFO, LF_PCON, LF_OCCAS, 0); _tabreg = new TTable ("REG"); - _tabiva = new TDecoder("%IVA"); - - _nditte = new TLocalisamfile(LF_NDITTE); - _anag = new TLocalisamfile (LF_ANAG); - _clifo = new TLocalisamfile(LF_CLIFO); - _pconti = new TLocalisamfile(LF_PCON); - _attiv = new TLocalisamfile(LF_ATTIV); // da togliere - _causali = new TDecoder(LF_CAUSALI, "DESCR"); + + _rel = new TRelation (LF_MOV); _rel->add (LF_RMOV, "NUMREG==NUMREG"); @@ -386,14 +368,7 @@ bool TStampa_giornale::user_destroy() delete _RecPartoDa; delete _RecArrivoA; - delete _clifo; delete _pconti; - delete _nditte; delete _anag; delete _tabreg; - delete _tabiva; - delete _causali; - - delete _attiv; // da togliere in futuro - return TRUE; } @@ -402,13 +377,10 @@ void TStampa_giornale::aggiorna_mov() TLocalisamfile& mov = _cur->file(LF_MOV); long nprog = _nprog_da + 1; -// const TRectype da(*_RecPartoDa); -// const TRectype a(*_RecArrivoA); -// _cur->setregion(da, a); _cur->setregion(*_RecPartoDa, *_RecArrivoA); const long items = _cur->items(); - TProgind prnd (items, "Aggiornamento movimenti ...", FALSE, TRUE); + TProgind prnd (items, TR("Aggiornamento movimenti ..."), FALSE, TRUE); for ((*_cur) = 0L; _cur->pos() < items; ++(*_cur)) { @@ -431,15 +403,13 @@ int TStampa_giornale::set_totali_giorno(const TDate& data, const int righeiva) const int SHIFT = 15; const int STACC = 51 + SHIFT; -// r = righeiva == 0 ? 1 : righeiva + 1; - // Se e' l'unico totale lo stampo anche se e' zero if (competenza_ec() || (_tot_avere_gg != ZERO || _tot_dare_gg != ZERO)) { TString80 td; real2currency(td, _tot_dare_gg); TString80 ta; real2currency(ta, _tot_avere_gg); - sprintf(dep, "@b@%dgTotale operazioni del %s @%dg%c %s @%dg%c @%dg%s", + sprintf(dep, FR("@b@%dgTotale operazioni del %s @%dg%c %s @%dg%c @%dg%s"), _stampa_width == 132 ? SCRITTA : DARE198-STACC, data.string(), _stampa_width == 132 ? TOTDARE132 : DARE198-2, @@ -460,7 +430,7 @@ int TStampa_giornale::set_totali_giorno(const TDate& data, const int righeiva) TString80 tdp; real2currency(tdp, _tot_dare_gg_ap); TString80 tap; real2currency(tap, _tot_avere_gg_ap); - sprintf (dep, "@b@%dgTotale operazioni del %s Anno precedente @%dg%c %s @%dg%c @%dg%s", + sprintf (dep, FR("@b@%dgTotale operazioni del %s Anno precedente @%dg%c %s @%dg%c @%dg%s"), _stampa_width == 132 ? SCRITTA : DARE198-STACC, data.string(), _stampa_width == 132 ? TOTDARE132 : DARE198-2, @@ -482,7 +452,7 @@ int TStampa_giornale::set_totali_giorno(const TDate& data, const int righeiva) void TStampa_giornale::postclose_print() { - if (_stampa_definitiva && yesno_box("La stampa e' corretta?")) + if (_stampa_definitiva && yesno_box(TR("La stampa e' corretta?"))) { const int ultima_fatta = _pagine_contate; aggiorna_mov(); @@ -518,10 +488,6 @@ void TStampa_giornale::preprocess_footer() // 2. Sono sull'ultima riga // -/* - const bool riporta = _forza_ariportare || - (!_gia_settato_ariportare && _cur->pos() < _cur->items()-1 ); -*/ const int riporta = _devo_riportare; if (riporta) @@ -533,8 +499,7 @@ void TStampa_giornale::preprocess_footer() riga.format ("@b@%dg%s@%dg%c %s @%dg%c @%dg%s", _stampa_width == 132 ? SCRITTA : DARE198-STUMB, -// (_nuovo_mese && !_forza_ariportare) ? "Totale progressivi generali " : "A riportare ", - "A riportare ", + TR("A riportare "), _stampa_width == 132 ? TOTDARE132 : DARE198, 'D', (const char *) dts, @@ -578,7 +543,7 @@ int TStampa_giornale::set_totali_pagina(int righe) real2currency(progr_dare, _tot_dare_progr); real2currency(progr_avere, _tot_avere_progr); riga = ""; - riga.format("@b@%dgTotale progressivi @%dg%c %s @%dg%c @%dg%s", + riga.format(FR("@b@%dgTotale progressivi @%dg%c %s @%dg%c @%dg%s"), _stampa_width == 132 ? SCRITTA : DARE198-STUMB, _stampa_width == 132 ? TOTDARE132 : DARE198-2, 'D', @@ -593,7 +558,7 @@ int TStampa_giornale::set_totali_pagina(int righe) if (ap) { - riga.format("@b@%dgTotale progressivi anno precedente @%dg%c %s @%dg%c @%dg%s", + riga.format(FR("@b@%dgTotale progressivi anno precedente @%dg%c %s @%dg%c @%dg%s"), _stampa_width == 132 ? SCRITTA : DARE198-STUMB, _stampa_width == 132 ? TOTDARE132 : DARE198-2, 'D', @@ -612,7 +577,7 @@ int TStampa_giornale::set_totali_pagina(int righe) real2currency(dts, _tot_dare_generale); real2currency(ats, _tot_avere_generale); - riga.format("@b@%dgTotale progressivi generali @%dg%c %s @%dg%c @%dg%s", + riga.format(FR("@b@%dgTotale progressivi generali @%dg%c %s @%dg%c @%dg%s"), _stampa_width == 132 ? SCRITTA : DARE198-STUMB, _stampa_width == 132 ? TOTDARE132 : DARE198-2, 'D', @@ -643,7 +608,7 @@ int TStampa_giornale::set_totali_pagina(int righe) // "Se il mese e' finito devo scrivere Totale progressivi generali // invece che A riportare" - riga.format ("@b@%dgTotale progressivi generali @%dg%c %s @%dg%c @%dg%s", + riga.format (FR("@b@%dgTotale progressivi generali @%dg%c %s @%dg%c @%dg%s"), _stampa_width == 132 ? SCRITTA : DARE198-STUMB, _stampa_width == 132 ? TOTDARE132 : DARE198-2, 'D', @@ -668,22 +633,22 @@ int TStampa_giornale::stampa_intestazione_ditta() riga.fill('-'); set_header(r, riga); - set_header (++r, "Ditta: %5ld %-.50s %.35s %.5s %.20s %.2s", + set_header (++r, FR("Ditta: %5ld %-.50s %.35s %.5s %.20s %.2s"), get_firm(), (const char *)_ragsoc, (const char *)_viafis, (const char *)_cap, (const char *)_comunefis, (const char *)_provfis); if (_stampa_definitiva) - intes.format ("Partita iva %s @24gCodice fiscale %s", + intes.format (FR("Partita iva %s @24gCodice fiscale %s"), (const char*)_paiva, (const char*)_cofi, _stampa_width == 132 ? 102 : 168 ); else - intes.format ("Partita iva %s @24gCodice fiscale %s @%dg%s @%dgData @>", + intes.format (FR("Partita iva %s @24gCodice fiscale %s @%dg%s @%dgData @>"), (const char*)_paiva, (const char*)_cofi, _stampa_width == 132 ? 102 : 168, - "LIBRO DI PROVA", + FR("LIBRO DI PROVA"), _stampa_width == 132 ? 117 : 183 ); @@ -705,9 +670,9 @@ int TStampa_giornale::set_headers() r += 2; if (_stampa_definitiva) - set_header(r++, "Codice libro: %s %s ",(const char *) _reg_cod, (const char *) _reg_descr); + set_header(r++, FR("Codice libro: %s %s "),(const char *) _reg_cod, (const char *) _reg_descr); else - set_header(r++, "Codice libro: %s %s @%dgdalla data: %s alla data: %s @%dgEsercizio: %04d", + set_header(r++, FR("Codice libro: %s %s @%dgdalla data: %s alla data: %s @%dgEsercizio: %04d"), (const char *) _reg_cod, (const char *) _reg_descr, _stampa_width == 132 ? 69 : 135, (const char *) data_da, (const char *) data_a, @@ -719,33 +684,32 @@ int TStampa_giornale::set_headers() set_header(r++, riga); if (_libro_cronologico) - set_header(r, "@59gCodice Conto"); + set_header(r, FR("@59gCodice Conto")); if (!_stampa_definitiva) { if (_stampa_width == 132) { set_header(r++, "@131gS"); - set_header(r, "@1gN.riga"); + set_header(r, FR("@1gN.riga")); } else { set_header(r++, "@197gS"); - set_header(r, "@1gN.riga"); + set_header(r, FR("@1gN.riga")); } } else if (_libro_cronologico) r++; // NON LASCIARE RIGHE IN BIANCO!! - // set_header(r, "@6gCod.Causale@34gDescrizione operazione"); - set_header(r, "@8gDescrizione operazione@36gCausale"); + set_header(r, FR("@8gDescrizione operazione@36gCausale")); if (_libro_cronologico) // POSCONTO = 74; - set_header(r, "@74gGeneralita' cliente/fornitore"); + set_header(r, FR("@74gGeneralita' cliente/fornitore")); else - set_header(r, "@59gCodice Conto"); + set_header(r, FR("@59gCodice Conto")); if (_stampa_width == 132) - set_header(r, "@120gImporto"); + set_header(r, FR("@120gImporto")); else - set_header(r, "@161gDare @184gAvere"); + set_header(r, FR("@161gDare @184gAvere")); if (!_stampa_definitiva) set_header(r, _stampa_width == 132 ? "@131gB" : "@197gB"); @@ -793,7 +757,7 @@ void TStampa_giornale::preprocess_header() TString80 avere; real2currency(avere, riporto_avere); TString256 riporto; - riporto.format("@b@%dgRiporto: @%dg%c %17s @%dg%c@%dg%17s", // prima erano %15s + riporto.format(FR("@b@%dgRiporto: @%dg%c %17s @%dg%c@%dg%17s"), // prima erano %15s _stampa_width == 132 ? SCRITTA : DARE198-11, _stampa_width == 132 ? TOTDARE132 : DARE198-2, _stampa_width == 132 ? 'D' : ' ', @@ -841,23 +805,6 @@ bool TStampa_giornale::preprocess_print(int file, int counter) return TRUE; } -/*** - bool TStampa_giornale::cancel_hook() - { - int ultima_fatta = printer().getcurrentpage() - 1; - // int stampate = ultima_fatta - _pagina_da + 1; - - if (yesno_box ("Interrompo la stampa ?")) - { - if (_stampa_definitiva) - aggiorna_tabreg (ultima_fatta, ultima_fatta); - return TRUE; - } - else - return FALSE; - } - ***/ - int TStampa_giornale::righe_rimaste() const { const TPrinter& p = printer(); @@ -872,16 +819,7 @@ void TStampa_giornale::fill_page(int righe_da_stampare, int righe_iva_settate) const TPrinter& p = printer(); TString256 rigas; -// int rrr = start_riga + righe_iva_settate + 1; int r = righe_da_stampare + 1; -// int rows_left = p.rows_left(); -/* if (rows_left <= 0) - { - rows_left = p.formlen() - (p.headersize()+1) - p.footersize(); - _forza_ariportare = TRUE; - } -*/ -// int r_l = p.rows_left() - start_riga - righe_iva_settate; int r_l = p.rows_left() - righe_da_stampare; if (r_l < 0) @@ -891,8 +829,6 @@ void TStampa_giornale::fill_page(int righe_da_stampare, int righe_iva_settate) if (r_l > 0) { rigas.fill('=', _stampa_width); -// rigas.cut(_stampa_width+1); -// set_row(rrr++, "%s", (const char*) rigas); set_row(r++, "%s", (const char*) rigas); int j=0; // Calcola una specie di coefficiente angolare @@ -1084,22 +1020,22 @@ void TStampa_giornale::set_rows (int file, int counter) if (_stampa_definitiva) { - set_row(r,"Operazione n. @b%-7ld@r", _nprog_mov); - set_row(r," del @b%s@r", (const char*)datareg_str); // XX/XX/XXXX - set_row(r," doc. n. @b%-7s@r",(const char*)numdoc); - set_row(r," del @b%s@r %-50s",(const char*)datadoc_str, + set_row(r,FR("Operazione n. @b%-7ld@r"), _nprog_mov); + set_row(r,FR(" del @b%s@r"), (const char*)datareg_str); // XX/XX/XXXX + set_row(r,FR(" doc. n. @b%-7s@r"),(const char*)numdoc); + set_row(r,FR(" del @b%s@r %-50s"),(const char*)datadoc_str, (const char*)mov_descr); } else { - set_row(r,"Operazione n. @b%-7ld@r", numreg); - set_row(r," del @b%s@r", (const char*) datareg_str); - set_row(r," doc. n. @b%-7s@r", (const char*) numdoc); - set_row(r," del @b%s@r %-50s", (const char*)datadoc_str,(const char*)mov_descr); + set_row(r,FR("Operazione n. @b%-7ld@r"), numreg); + set_row(r,FR(" del @b%s@r"), (const char*) datareg_str); + set_row(r,FR(" doc. n. @b%-7s@r"), (const char*) numdoc); + set_row(r,FR(" del @b%s@r %-50s"), (const char*)datadoc_str,(const char*)mov_descr); } if (_annoEsMov != _ae) - set_row(r," Comp. %04d", _annoEsMov); + set_row(r,FR(" Comp. %04d"), _annoEsMov); if (_MovGiaStampato && !_stampa_definitiva) { @@ -1111,9 +1047,9 @@ void TStampa_giornale::set_rows (int file, int counter) if (caus.not_empty()) { const char* desc_caus = get_descr_caus(caus); - set_row(r+1, "@36gCausale %3s %-50s", (const char*) caus, desc_caus); + set_row(r+1, FR("@36gCausale %3s %-50s"), (const char*) caus, desc_caus); if (_reg.not_empty()) - set_row(r+1, " (R.IVA @b%3s@r Prot. @b%ld@r) ", (const char*)_reg,protiva); + set_row(r+1, FR(" (R.IVA @b%3s@r Prot. @b%ld@r) "), (const char*)_reg,protiva); } } break; @@ -1319,7 +1255,7 @@ int TStampa_giornale::setta_righe_descr(TParagraph_string& str, enum descr des) const TString& TStampa_giornale::get_codiva_des(const char* codiva) { - return _tabiva->decode(codiva); + return cache().get("%IVA", codiva).get("S0"); } // NB @@ -1337,12 +1273,9 @@ int TStampa_giornale::setta_righe_iva() r = j+1; TString80 impon_str; real2currency(impon_str, riga._imponibile); TString80 impos_str; real2currency(impos_str, riga._imposta); -// set_row(r, " Imponibile@15g%15r", &riga._imponibile); -// set_row(r, "@31gImposta@39g%15r", &riga._imposta); - set_row(r, " Imponibile@15g%15s", (const char*)impon_str); - set_row(r, "@35gImposta@43g%15s", (const char*)impos_str); - // set_row(r, "@58gCod.Iva@68g%3s", (const char*)riga._codiva); - set_row(r, "@64gCod.Iva %3s", (const char*)riga._codiva); + set_row(r, FR(" Imponibile@15g%15s"), (const char*)impon_str); + set_row(r, FR("@35gImposta@43g%15s"), (const char*)impos_str); + set_row(r, FR("@64gCod.Iva %3s"), (const char*)riga._codiva); const TString& codiva_des = get_codiva_des(riga._codiva); const int tipoatt = riga._tipoatt; if (_stampa_width == 132) @@ -1355,16 +1288,16 @@ int TStampa_giornale::setta_righe_iva() switch (riga._tipodet) { case 0 : - rig << "Detraibile "; + rig << TR("Detraibile "); break; case 1 : - rig << "Indetraib. su op.es. "; + rig << TR("Indetraib. su op.es. "); break; case 3 : - rig << "Passaggi interni "; + rig << TR("Passaggi interni "); break; case 9 : - rig << "Indetraibile art.19 "; + rig << TR("Indetraibile art.19 "); break; default: break; } @@ -1372,14 +1305,14 @@ int TStampa_giornale::setta_righe_iva() const int meseliq = _cur->file(LF_MOV).get_int(MOV_MESELIQ); if (meseliq > 0) - set_row(r, " Mese liq. %2d", meseliq); + set_row(r, FR(" Mese liq. %2d"), meseliq); if (tipoatt != 0) { TRegistro reg(_reg, _anno_iva); const bool att_mista_ev = reg.attivita_mista(); if (att_mista_ev) - set_row(r, " Tipo attivita' %d", tipoatt); + set_row(r, FR(" Tipo attivita' %d"), tipoatt); } } _iva_array.destroy(); @@ -1394,11 +1327,11 @@ int TStampa_giornale::setta_righe_valuta(int r) { const TString16 codvali = current_cursor()->file(LF_MOV).get(MOV_CODVALI); const TCurrency cur(corrval, codvali); - set_row(++r,"@56gValuta %3s", (const char*)codvali); + set_row(++r,FR("@56gValuta %3s"), (const char*)codvali); if (_stampa_width == 132) - set_row(r,"@89gCorr.in valuta @109g%20v", &cur); + set_row(r,FR("@89gCorr.in valuta @109g%20v"), &cur); else - set_row(r,"@119gCorr.in valuta @171g%20v", &cur); + set_row(r,FR("@119gCorr.in valuta @171g%20v"), &cur); } return r; } @@ -1410,51 +1343,42 @@ int TStampa_giornale::setta_righe_indirizzo(char tipocf, long codcf,int rdes) { TString16 prov, comcf, capcf, civcf, statocf; TString80 viacf, comune; - bool really_occas = FALSE; char tipoa; long codanagr; char riga[256]; int r = rdes; - _clifo->zero(); - _clifo->put(CLI_CODCF, codcf); - _clifo->put(CLI_TIPOCF, tipocf); + TToken_string key; + key.add(tipocf); + key.add( codcf); - const bool clifo_ok = (_clifo->read() == NOERR); + const TRectype & clifo = cache().get(LF_CLIFO, key); - if (clifo_ok) really_occas = _clifo->get_bool(CLI_OCCAS); - - if (_occfpi.not_empty() && really_occas) // => e' un occasionale... + if (_occfpi.not_empty() && clifo.get_bool(CLI_OCCAS)) // => e' un occasionale... { - TLocalisamfile occ(LF_OCCAS); + const TRectype & occ = cache().get(LF_OCCAS, _occfpi); - occ.zero(); - occ.put(OCC_CFPI, _occfpi); - if (occ.read() != NOERR) occ.zero(); - - viacf = occ.get (OCC_INDIR); - civcf = occ.get (OCC_CIV); - capcf = occ.get (OCC_CAP); - comcf = occ.get (OCC_COM); + viacf = occ.get(OCC_INDIR); + civcf = occ.get(OCC_CIV); + capcf = occ.get(OCC_CAP); + comcf = occ.get(OCC_COM); } else { - // E' possibile cio' ? - if (!clifo_ok) return r; - - viacf = _clifo->get(CLI_INDCF); - civcf = _clifo->get(CLI_CIVCF); - comcf = _clifo->get(CLI_COMCF); - capcf = _clifo->get(CLI_CAPCF); - statocf = _clifo->get(CLI_STATOCF); - tipoa = _clifo->get_char(CLI_TIPOAPER); - codanagr = _clifo->get_long(CLI_CODANAGPER); + viacf = clifo.get(CLI_INDCF); + civcf = clifo.get(CLI_CIVCF); + comcf = clifo.get(CLI_COMCF); + capcf = clifo.get(CLI_CAPCF); + statocf = clifo.get(CLI_STATOCF); + tipoa = clifo.get_char(CLI_TIPOAPER); + codanagr = clifo.get_long(CLI_CODANAGPER); } const TRectype& rec = look_com (comcf, statocf); comune = rec.get(COM_DENCOM); prov = rec.get(COM_PROVCOM); - if (comcf.empty()) comune = _clifo->get(CLI_LOCCF); + if (comcf.empty()) + comune = clifo.get(CLI_LOCCF); if (viacf.not_empty()) { @@ -1483,12 +1407,12 @@ int TStampa_giornale::setta_righe_indirizzo(char tipocf, long codcf,int rdes) TString80 comna; TString16 datana, codcomna, provna, capna, statona; - datana = _clifo->get("DATANASC"); + datana = clifo.get("DATANASC"); if (datana.not_empty()) { - codcomna = _clifo->get("COMNASC"); - statona = _clifo->get("STATONASC"); + codcomna = clifo.get("COMNASC"); + statona = clifo.get("STATONASC"); const TRectype& dep = look_com (codcomna, statona); comna = dep.get(COM_DENCOM); @@ -1521,8 +1445,6 @@ void TStampa_giornale::aggiorna_tabreg(int partito_da, int stampate) if (_tabreg->good()) { - // _tabreg->put ("I8", (long)partito_da); // partito_da = -1 se stampa OK -// _tabreg->put ("I1", (long)_pagine_stampate + stampate); // pagine stampate _tabreg->put ("I1", (long)_pagina_da + stampate); // pagine stampate _tabreg->put ("I6", _nprog_mov); // ultimo numero di riga _tabreg->put ("R1", _tot_dare_generale); @@ -1556,7 +1478,7 @@ bool TStampa_giornale::controlla_mov_aep() const TRecnotype items = _cur->items(); _cur->freeze(); - TProgind pi(items, "Controllo movimenti esercizio precedente", FALSE, TRUE); + TProgind pi(items, TR("Controllo movimenti esercizio precedente"), FALSE, TRUE); bool gia_stampati = TRUE; for (*_cur = 0L ; _cur->pos() < items; ++(*_cur)) @@ -1567,9 +1489,9 @@ bool TStampa_giornale::controlla_mov_aep() } _cur->freeze(FALSE); if (!gia_stampati) - error_box("Impossibile proseguire con la stampa:\n" + error_box(TR("Impossibile proseguire con la stampa:\n" "Esistono movimenti nell'esercizio precedente\n" - "che non sono ancora stati stampati su bollato."); + "che non sono ancora stati stampati su bollato.")); return gia_stampati; } @@ -1585,7 +1507,6 @@ bool TStampa_giornale::leggi_tabreg(const char * reg_cod, int reg_anno) _pagine_stampate = _tabreg->get_int("I1"); _pagine_numerate = _tabreg->get_int("I2"); _stampa_num_pag = _tabreg->get_bool("S11"); - // _stampa_ok = _tabreg->get_int("I8"); _nprog_da = _tabreg->get_long ("I6"); _tot_dare = _tabreg->get_real ("R1"); _tot_avere = _tabreg->get_real ("R2"); @@ -1627,7 +1548,7 @@ bool TStampa_giornale::data_a_hndl (TMask_field& f, KEY k) TEsercizi_contabili esc; if (esc.date2esc(data_a) <= 0) - return f.error_box("La data non appartiene a nessun esercizio"); + return f.error_box(TR("La data non appartiene a nessun esercizio")); app()._ae_solare = data_a.year(); app()._ae = esc.date2esc(data_a); @@ -1648,9 +1569,9 @@ bool TStampa_giornale::data_a_hndl (TMask_field& f, KEY k) if (dtda.not_empty()) { if (data_da.year() != data_a.year()) - return f.warning_box("Le date specificate non appartengono allo stesso anno"); + return f.warning_box(TR("Le date specificate non appartengono allo stesso anno")); if (data_da > data_a) - return f.warning_box("La data di partenza non puo' essere maggiore della data finale"); + return f.warning_box(TR("La data di partenza non puo' essere maggiore della data finale")); } } } // if K_ENTER @@ -1671,7 +1592,7 @@ bool TStampa_giornale::data_da_hndl(TMask_field& f, KEY k) return TRUE; if (data_da.year() != data_a.year()) - return f.error_box("Le due date non appartengono allo stesso anno"); + return f.error_box(TR("Le due date non appartengono allo stesso anno")); } if (k == K_ENTER) @@ -1684,10 +1605,10 @@ bool TStampa_giornale::data_da_hndl(TMask_field& f, KEY k) // se la stampa e' di prova DALLA_DATA e' obbligatoria if (!definitiva && !data_da.ok()) - return f.warning_box("Manca la data di partenza"); + return f.warning_box(TR("Manca la data di partenza")); if (data_da.ok() && data_da > data_a) - return f.warning_box("La data di partenza non puo' essere maggiore della data finale"); + return f.warning_box(TR("La data di partenza non puo' essere maggiore della data finale")); } return TRUE; } @@ -1717,30 +1638,12 @@ bool TStampa_giornale::mask_a_cod_reg (TMask_field& f, KEY k) a._ae = esc.date2esc(data_a); //a._ae_solare; // Anno esercizio } - const TString16 reg_cod(f.get()); - - if (reg_cod.empty()) - { - if (k == K_TAB) // Magari ci ripassa e lo inserisce - return TRUE; - else // Se e' K_ENTER mi serve davvero - return f.error_box("Manca il codice registro"); - } - + const TString16 reg_cod(f.get()); bool reg_ok = a.leggi_tabreg(reg_cod, a._ae_solare); // Output da qui della descrizione del registro e dell'anno m.set(REG_DESC, a._reg_descr); - m.set(ANNO_ESER, a._ae_solare); - /* - // CHECKTYPE NORMAL abolito! (nella maschera non ho l'anno... - if (!reg_ok) - return f.warning_box("Registro inesistente"); - - if (app()._tipo != 5) - return f.warning_box("Il registro %s per l'anno %d non e' di tipo libro giornale", - (const char *) reg_cod, a._ae); - */ + m.set(ANNO_ESER, a._ae_solare); } return TRUE; } @@ -1776,7 +1679,7 @@ bool TStampa_giornale::mask_b_warning (TMask_field& f, KEY k) { if (k == K_SPACE) { - f.warning_box("Le modifiche a questi progressivi saranno scritte nel registro"); + f.warning_box(TR("Le modifiche a questi progressivi saranno scritte nel registro")); gia_detto = TRUE; return TRUE; } @@ -1865,7 +1768,7 @@ bool TStampa_giornale::init_cursor() if (_cur->items() == 0L) { _cur->setfilter(""); - return warning_box("Non ci sono movimenti da stampare nel periodo selezionato.\nLa stampa e' annullata"); + return warning_box(TR("Non ci sono movimenti da stampare nel periodo selezionato.\nLa stampa e' annullata")); } return TRUE; @@ -1955,7 +1858,6 @@ bool TStampa_giornale::set_print(int) int cg3400 (int argc, char * argv[]) { TStampa_giornale app; - app.run(argc, argv, "Stampa libro giornale"); + app.run(argc, argv, TR("Stampa libro giornale")); return TRUE; } - diff --git a/cg/cg3400a.uml b/cg/cg3400a.uml index fad1443e3..dd5403608 100755 --- a/cg/cg3400a.uml +++ b/cg/cg3400a.uml @@ -58,11 +58,8 @@ BEGIN OUTPUT ANNO_ESER CODTAB[1,4] OUTPUT CODREG CODTAB[5,7] OUTPUT REG_DESC S0 -// OUTPUT PAGINA_DA I1 -// OUTPUT DATA_DA D0 -// OUTPUT DATA_A D1 CHECKTYPE REQUIRED - WARNING "Registro inesistente" + WARNING "Registro assente" // VALIDATE ZEROFILL_FUNC 3 FLAGS "UZ" END diff --git a/cg/cg3500.cpp b/cg/cg3500.cpp index c6e22436f..585bc19b9 100755 --- a/cg/cg3500.cpp +++ b/cg/cg3500.cpp @@ -43,7 +43,6 @@ class TStampa_riepilogo : public TPrintapp { TProgind * _prog; TSaldi_list* _lista; - TLocalisamfile* _com, * _pcn, * _clifo, * _saldi, * _nditte,* _anag; TIsamtempfile * _tmp_saldi; tipo _tp; real _prg_dare,_prg_avere,_saldo_dare,_saldo_avere,_prg_dare_tot,_prg_avere_tot,_saldo_tot; @@ -101,13 +100,15 @@ bool TStampa_riepilogo::riepilogo() cp=-1; _udata_max = 0l; - for (_pcn->first(); !_pcn->eof(); _pcn->next()) + TLocalisamfile pcn(LF_PCON); + + for (pcn.first(); !pcn.eof(); pcn.next()) { _prog->addstatus(1); - g = _pcn->get_int (PCN_GRUPPO); - c = _pcn->get_int (PCN_CONTO); - s = _pcn->get_long(PCN_SOTTOCONTO); - tipo_conto = _pcn->get_char(PCN_TMCF); + g = pcn.get_int (PCN_GRUPPO); + c = pcn.get_int (PCN_CONTO); + s = pcn.get_long(PCN_SOTTOCONTO); + tipo_conto = pcn.get_char(PCN_TMCF); TConto conto (g,c,s,tipo_conto); @@ -129,13 +130,11 @@ bool TStampa_riepilogo::riepilogo() _tmp_saldi->put(SLD_PDARE,prg_conto_dare); _tmp_saldi->put(SLD_PAVERE,prg_conto_avere); if (saldo_conto > 0.00) //va stampato in Dare - _tmp_saldi->put(SLD_PDAREPRO,saldo_conto); // W96SALDI del 10-06-96 - //_tmp_saldi->put(SLD_PDARESCA,saldo_conto); + _tmp_saldi->put(SLD_PDAREPRO,saldo_conto); // W96SALDI del 10-06-96 else { saldo_conto = saldo_conto * (-1.00); - _tmp_saldi->put(SLD_PAVEREPRO,saldo_conto); // W96SALDI del 10-06-96 - //_tmp_saldi->put(SLD_PAVERESCA,saldo_conto); + _tmp_saldi->put(SLD_PAVEREPRO,saldo_conto); // W96SALDI del 10-06-96 } _tmp_saldi->write(); esiste_conto = TRUE; @@ -176,16 +175,16 @@ bool TStampa_riepilogo::riepilogo() if ( (tipo_conto == 'C') || (tipo_conto == 'F') ) //si tratta di un conto cliente/fornitore { _udata_max = 0l; - indbil = _pcn->get_int(PCN_INDBIL); + indbil = pcn.get_int(PCN_INDBIL); esiste_sc = ricerca_cf(conto,indbil,prg_conto_dare,prg_conto_avere); if (esiste_sc) { gp = conto.gruppo(); cp = conto.conto(); } - TRecnotype recnum = _pcn->recno(); - _pcn->next(); - if (_pcn->eof()) + TRecnotype recnum = pcn.recno(); + pcn.next(); + if (pcn.eof()) { saldo_conto = prg_conto_dare - prg_conto_avere; prg_gruppo_dare += prg_conto_dare; @@ -237,14 +236,14 @@ bool TStampa_riepilogo::riepilogo() _tmp_saldi->write(); } } - _pcn->readat(recnum); + pcn.readat(recnum); continue; } } if (conto.conto() == 0) - indbil = _pcn->get_int(PCN_INDBIL); + indbil = pcn.get_int(PCN_INDBIL); if ( (conto.conto() == 0) || (conto.sottoconto() == 0) ) //e' un gruppo o un conto { @@ -299,9 +298,9 @@ bool TStampa_riepilogo::riepilogo() cp = conto.conto(); } - TRecnotype recnum = _pcn->recno(); - _pcn->next(); - if (_pcn->eof()) + TRecnotype recnum = pcn.recno(); + pcn.next(); + if (pcn.eof()) { saldo_conto = prg_conto_dare - prg_conto_avere; prg_gruppo_dare += prg_conto_dare; @@ -352,7 +351,7 @@ bool TStampa_riepilogo::riepilogo() _tmp_saldi->write(); } } - _pcn->readat(recnum); + pcn.readat(recnum); } return TRUE; } @@ -727,7 +726,7 @@ void TStampa_riepilogo::setta_riga_conto() if (_scelta == 1) { set_row(r++,"%s",(const char*)riga); - set_row(r,"**** Totali conto %3d %3d",_gconto,_cconto); + set_row(r,FR("**** Totali conto %3d %3d"),_gconto,_cconto); set_row(r,"@27g%.25s@r",(const char*)_descrconto); } @@ -754,7 +753,7 @@ void TStampa_riepilogo::setta_riga_gruppo() if (_scelta == 2) if (_tp == fine) r = 3; else r = 2; - set_row(r,"**** TOTALI GRUPPO %3d",_ggruppo); + set_row(r,FR("**** TOTALI GRUPPO %3d"),_ggruppo); set_row(r,"@27g%.25s@r",(const char*)_descrgruppo); set_row(r++,"@53g%r@73g%r@93g%r@113g%r",&_prg_dare_gruppo,&_prg_avere_gruppo,&_saldo_dare_gruppo,&_saldo_avere_gruppo); set_row(r++,"%s",(const char*)riga); @@ -769,7 +768,7 @@ void TStampa_riepilogo::setta_riga_totale() const int r = _scelta == 1 ? 8 : 6; //17/11/1995 - set_row(r, "**** TOTALE GENERALE @53g%r@73g%r", &_prg_dare_tot, &_prg_avere_tot); + set_row(r, FR("**** TOTALE GENERALE @53g%r@73g%r"), &_prg_dare_tot, &_prg_avere_tot); // Guy: 10/01/97 errore MI6125 if (_saldo_tot != 0.0) @@ -811,24 +810,14 @@ TDate TStampa_riepilogo::UltimaData(int g, int c, long s) bool TStampa_riepilogo::user_create() { - _clifo = new TLocalisamfile(LF_CLIFO); - _com = new TLocalisamfile(LF_COMUNI); - _pcn = new TLocalisamfile(LF_PCON); - _saldi = new TLocalisamfile(LF_SALDI); - _nditte = new TLocalisamfile(LF_NDITTE); - _anag = new TLocalisamfile(LF_ANAG); + open_files(LF_CLIFO, LF_COMUNI, LF_PCON, LF_SALDI, LF_NDITTE, LF_ANAG, + LF_TABCOM, LF_TAB, 0); _tmp_saldi = NULL; return TRUE; } bool TStampa_riepilogo::user_destroy() { - delete _com; - delete _pcn; - delete _clifo; - delete _saldi; - delete _nditte; - delete _anag; delete _tmp_saldi; return TRUE; } @@ -842,7 +831,9 @@ bool TStampa_riepilogo::set_print(int) _scelta = m.get_int(F_STAMPA); _richiesta = m.get_int(F_RICHIESTA); _data = m.get(F_DATASTAMPA); - _prog = new TProgind(_pcn->items(), "Elaborazione in corso...", FALSE); + TLocalisamfile pcn(LF_PCON); + + _prog = new TProgind(pcn.items(), TR("Elaborazione in corso..."), FALSE); riepilogo(); @@ -852,40 +843,22 @@ bool TStampa_riepilogo::set_print(int) return FALSE; } -TRectype& cerca_com (const char * cod, TLocalisamfile *comuni) -{ - comuni->zero(); - comuni->put(COM_COM, cod); - comuni->read(); - if (comuni->bad()) - comuni->zero(); - - return comuni->curr(); -} - void TStampa_riepilogo::get_dati_ditta() { - TLocalisamfile nditte(LF_NDITTE); - TLocalisamfile anag(LF_ANAG); TString codanagr; TString tipoa; - nditte.zero(); - nditte.put(NDT_CODDITTA, get_firm()); - nditte.read(); - - if (nditte.bad()) nditte.zero(); + const TRectype & nditte = cache().get(LF_NDITTE, get_firm()); codanagr = nditte.get(NDT_CODANAGR); tipoa = nditte.get(NDT_TIPOA); _ragsoc = nditte.get(NDT_RAGSOC); - anag.setkey(1); - anag.zero(); - anag.put (ANA_TIPOA, tipoa); - anag.put (ANA_CODANAGR, codanagr); - anag.read(); - if (anag.bad()) anag.zero(); + TToken_string key; + key.add(tipoa); + key.add(codanagr); + + const TRectype & anag = cache().get(LF_ANAG, key); _cofi = anag.get(ANA_COFI); _paiva = anag.get(ANA_PAIV); @@ -894,11 +867,15 @@ void TStampa_riepilogo::get_dati_ditta() if (_comunefis.empty()) _comunefis = anag.get(ANA_COMRES); - TRectype dep = cerca_com (_comunefis, _com); + key.cut(0); + key.add(""); + key.add(_comunefis); - _comunefis = dep.get(COM_DENCOM); - _provfis = dep.get(COM_PROVCOM); - _cap = dep.get(COM_CAPCOM); + const TRectype & com = cache().get(LF_COMUNI, key); + + _comunefis = com.get(COM_DENCOM); + _provfis = com.get(COM_PROVCOM); + _cap = com.get(COM_CAPCOM); if (_comunefis.empty()) { _viafis = anag.get(ANA_INDRF); @@ -922,15 +899,15 @@ int TStampa_riepilogo::stampa_intestazione_ditta() get_dati_ditta(); codice_ditta << get_firm(); - set_header (r, "Ditta %s %s %s %s %s %s", (const char*)codice_ditta, + set_header (r, FR("Ditta %s %s %s %s %s %s"), (const char*)codice_ditta, (const char*)_ragsoc, (const char*)_viafis, (const char*)_cap, (const char*)_comunefis, (const char*)_provfis); r++; printer().setdate(_data); - riga = "Data @< Pag. @#"; + riga = FR("Data @< Pag. @#"); riga.right_just(127); - riga.overwrite (format ("Partita iva %s Codice fiscale %s", (const char*)_paiva, (const char*)_cofi)); + riga.overwrite (format (FR("Partita iva %s Codice fiscale %s"), (const char*)_paiva, (const char*)_cofi)); set_header (r, "%s", (const char*) riga); r++; @@ -946,19 +923,19 @@ void TStampa_riepilogo::preprocess_header() r++; if (_scelta == 1) //stampa riepilogo conti - set_header(r,"*** MASTRO DI CONTO ***"); - else set_header(r,"*** MASTRO DI GRUPPO ***"); - set_header(r,"@33gCod. esercizio %d", _annoese); + set_header(r,TR("*** MASTRO DI CONTO ***")); + else set_header(r,TR("*** MASTRO DI GRUPPO ***")); + set_header(r,FR("@33gCod. esercizio %d"), _annoese); if (_richiesta == 1) - set_header(r,"@70gPROGRESSIVI ATTUALI@114gSALDO ATTUALE"); - else set_header(r,"@70gPROG. MOV. ELIMINATI@110gSALDO MOV. ELIMINATI"); + set_header(r,FR("@70gPROGRESSIVI ATTUALI@114gSALDO ATTUALE")); + else set_header(r,FR("@70gPROG. MOV. ELIMINATI@110gSALDO MOV. ELIMINATI")); r++; r++; if (_scelta == 1) - set_header(r,"SOTTOC DESCRIZIONE"); - else set_header(r,"CONTO DESCRIZIONE"); - set_header(r++,"@40gDATA ULT.MOV@68gDARE@87gAVERE@108gDARE@127gAVERE"); + set_header(r,TR("SOTTOC DESCRIZIONE")); + else set_header(r,TR("CONTO DESCRIZIONE")); + set_header(r++,FR("@40gDATA ULT.MOV@68gDARE@87gAVERE@108gDARE@127gAVERE")); riga.fill('-'); set_header(r,"%s",(const char*)riga); r++; @@ -969,7 +946,7 @@ void TStampa_riepilogo::preprocess_header() int cg3500 (int argc, char* argv[]) { TStampa_riepilogo a; - a.run(argc, argv, "Stampa riepilogo gruppi/conti"); + a.run(argc, argv, TR("Stampa riepilogo gruppi/conti")); return 0; } diff --git a/cg/cg3600.cpp b/cg/cg3600.cpp index 7d6b23cf8..1e5d64716 100755 --- a/cg/cg3600.cpp +++ b/cg/cg3600.cpp @@ -360,20 +360,15 @@ bool TBalance::find(const TBill& b, int esercizio, { CHECK(b.sottoconto() > 0L, "Sottoconto mancante"); - TLocalisamfile saldi(LF_SALDI); - TRectype& curr = saldi.curr(); - curr.put(SLD_GRUPPO, b.gruppo()); - curr.put(SLD_CONTO, b.conto()); - curr.put(SLD_SOTTOCONTO, b.sottoconto()); - curr.put(SLD_ANNOES, esercizio); - curr.put(SLD_FLSCA, FALSE); - const bool ok = saldi.read() == NOERR; - if (ok) + TString key(30); + key.format("%d||%d|%d|%ld", esercizio, b.gruppo(), b.conto(), b.sottoconto()); + const TRectype & saldi = cache().get(LF_SALDI, key); + if (!saldi.empty()) { - si.set(curr.get_char(SLD_FLAGSALINI), curr.get_real(SLD_SALDO)); - da.set('D', curr.get_real(SLD_PDARE)); - av.set('A', curr.get_real(SLD_PAVERE)); - sf.set(curr.get_char(SLD_FLAGSALFIN), curr.get_real(SLD_SALDOFIN)); + si.set(saldi.get_char(SLD_FLAGSALINI), saldi.get_real(SLD_SALDO)); + da.set('D', saldi.get_real(SLD_PDARE)); + av.set('A', saldi.get_real(SLD_PAVERE)); + sf.set(saldi.get_char(SLD_FLAGSALFIN), saldi.get_real(SLD_SALDOFIN)); } else { @@ -761,7 +756,7 @@ void TMastrino::read(const TBill& conto, cur.freeze(); TString caption(80); - caption.format("Caricamento mastrino %03d.%03d.%06ld", + caption.format(FR("Caricamento mastrino %03d.%03d.%06ld"), _conto.gruppo(), _conto.conto(), _conto.sottoconto()); TProgind pi(totrows, caption, FALSE, TRUE); @@ -776,7 +771,7 @@ void TMastrino::read(const TBill& conto, if (sec > 0.0) { TString80 msg; - msg.format("%ld records at %ld rec/sec", num_rec, long(num_rec/sec)); + msg.format(FR("%ld records at %ld rec/sec"), num_rec, long(num_rec/sec)); pi.set_text(msg); } } @@ -2092,7 +2087,7 @@ bool TColor_mask::color_handler(TMask_field& f, KEY k) bool TColor_mask::reset_handler(TMask_field& f, KEY k) { - if (k == K_SPACE && f.yesno_box("Si desidera azzerare tutti i colori?")) + if (k == K_SPACE && f.yesno_box(TR("Si desidera azzerare tutti i colori?"))) { TColor_mask& m = (TColor_mask&) f.mask(); @@ -2136,7 +2131,7 @@ TColor_mask::TColor_mask(COLOR mb, COLOR mf, COLOR cb, COLOR cf) COLOR back, fore; type2colors(*c, back, fore); TToken_string& riga = s.row(-1); - riga << "Riga " << (*c == 'M' ? "mastrino" : "contropartita"); + riga << TR("Riga ") << (*c == 'M' ? TR("mastrino") : TR("contropartita")); s.set_back_and_fore_color(back, fore, row++); } } @@ -2389,7 +2384,7 @@ void TMastrini_grid::on_grid_button() TProgind* pi = NULL; if (total > 50) - pi = new TProgind(total, "Aggiornamento contropartite ...", FALSE, TRUE, 48); + pi = new TProgind(total, TR("Aggiornamento contropartite ..."), FALSE, TRUE, 48); else begin_wait(); @@ -2420,7 +2415,7 @@ void TMastrini_grid::on_grid_button() if (sec > 0.0) { TString80 msg; - msg.format("%ld records at %ld rec/sec", step, long(step/sec)); + msg.format(FR("%ld records at %ld rec/sec"), step, long(step/sec)); pi->set_text(msg); } } @@ -2466,7 +2461,7 @@ void TMastrini_grid::on_record_button(long rec) TMailbox mail; if (mail.next_s(MSG_LN) != NULL) { - if (yesno_box("Si desidera aggiornare il mastrino?")) + if (yesno_box(TR("Si desidera aggiornare il mastrino?"))) reread(); } } @@ -2682,8 +2677,8 @@ void TGrid_mask::handler(WINDOW win, EVENT* ep) xvt_res_free_menu_tree(menu); } #else - ASK_RESPONSE r = xvt_dm_post_ask("Annulla", "Ripristina", "Salva", - "Ordinamento delle colonne"); + ASK_RESPONSE r = xvt_dm_post_ask(TR("Annulla"), TR("Ripristina"), TR("Salva"), + TR("Ordinamento delle colonne")); if (r == RESP_2) sht.reset_columns_order(); if (r == RESP_2 || r == RESP_3) @@ -2762,7 +2757,7 @@ bool TQuery_mask::esercizio_handler(TMask_field& f, KEY k) else { if (anno > 0) - return error_box("Esercizio inesistente: %d", anno); + return error_box(FR("Esercizio inesistente: %d"), anno); } } return TRUE; @@ -2788,7 +2783,7 @@ bool TQuery_mask::data_handler(TMask_field& f, KEY k) if (f.empty()) { if (codice_esercizio == 0) - return error_box("E' necessario specificare almeno una data."); + return error_box(TR("E' necessario specificare almeno una data.")); return TRUE; } @@ -2797,12 +2792,12 @@ bool TQuery_mask::data_handler(TMask_field& f, KEY k) if (codice_esercizio != 0) { if (esercizio != codice_esercizio) - ok = error_box("La data deve appartenere all'esercizio %d", codice_esercizio); + ok = error_box(FR("La data deve appartenere all'esercizio %d"), codice_esercizio); } else { if (esercizio == 0) - ok = error_box("La data deve appartenere ad un esercizio contabile"); + ok = error_box(TR("La data deve appartenere ad un esercizio contabile")); } } return ok; @@ -2867,23 +2862,8 @@ protected: virtual void on_firm_change(); public: - void open_files(int logicnum, ...); -}; -void TMastrini_video::open_files(int logicnum, ...) -{ - va_list marker; - va_start(marker, logicnum); - while (logicnum > 0) - { - if (_file.objptr(logicnum)) - NFCHECK("File gia' aperto: %d", logicnum); - else - _file.add(new TLocalisamfile(logicnum), logicnum); - logicnum = va_arg(marker, int); - } - va_end(marker); -} +}; bool TMastrini_video::create() { @@ -2968,7 +2948,7 @@ bool TMastrini_video::menu(MENU_TAG mt) int cg3600(int argc, char* argv[]) { TMastrini_video mv; - mv.run(argc, argv, "Mastrini"); + mv.run(argc, argv, TR("Mastrini")); return 0; } diff --git a/cg/cg3700.cpp b/cg/cg3700.cpp index 9eecf928a..bfe8bed20 100755 --- a/cg/cg3700.cpp +++ b/cg/cg3700.cpp @@ -44,9 +44,6 @@ enum tipo_st class TLista_fatture : public TPrintapp { - TLocalisamfile *_nditte; // File delle ditte - TDecoder *_reg; - TDecoder *_iva; TRelation* _rel; // Relazione principale int _cur1, _cur2, @@ -120,11 +117,8 @@ inline TLista_fatture& app() { return (TLista_fatture&) main_app(); } int TLista_fatture::tiporeg(const TString& reg) { TString16 s; s.format("%4d%-3s",_date_from.year(),(const char*)reg); -// _reg->put("CODTAB",s); -// if (_reg->read() == NOERR) -// return _reg->get_int("I0"); -// return 0; - return atoi(_reg->decode(s)); + + return atoi(cache().get("REG", s).get("I0")); } bool TLista_fatture::filter_func1(const TRelation *r) @@ -184,9 +178,9 @@ bool TLista_fatture::date_handler(TMask_field& f, KEY key) if (key == K_ENTER && f.empty()) { if (f.dlg() == FLD_DATE_FROM) - return f.error_box("La data di inizio e' obbligatoria."); + return f.error_box(TR("La data di inizio e' obbligatoria.")); else - return f.error_box("La data di fine e' obbligatoria."); + return f.error_box(TR("La data di fine e' obbligatoria.")); } if ((key == K_TAB && f.focusdirty()) || key == K_ENTER) @@ -198,9 +192,9 @@ bool TLista_fatture::date_handler(TMask_field& f, KEY key) if (a.ok() && da.ok()) // Solo se sono entrambi compilati { if (da > a) - return f.error_box("La data di fine deve essere maggiore della data di inizio."); + return f.error_box(TR("La data di fine deve essere maggiore della data di inizio.")); if (da.year() != a.year()) - return f.error_box("Le date devono appartenere allo stesso anno."); + return f.error_box(TR("Le date devono appartenere allo stesso anno.")); } } return TRUE; @@ -227,11 +221,11 @@ bool TLista_fatture::mix_handler(TMask_field& f, KEY key) const long l1 = m.get_long(dlg1); const long l2 = m.get_long(dlg2); if (l1 != 0L && l2 != 0L && l1 < l2) - return f.error_box("Intervallo clienti/fornitori errato."); + return f.error_box(TR("Intervallo clienti/fornitori errato.")); return TRUE; } - const TString msg(dlg1 == FLD_TO_REG ? "Intervallo registri errato." : "Intervallo causali errato."); + const TString msg(dlg1 == FLD_TO_REG ? TR("Intervallo registri errato.") : TR("Intervallo causali errato.")); const TString s1(m.get(dlg1)); const TString s2(m.get(dlg2)); if (s1.not_empty() && s2.not_empty() && s1 < s2) @@ -369,13 +363,15 @@ void TLista_fatture::set_choice_limits(TMask& m) void TLista_fatture::build_ditte_sheet() { _ditte->destroy(); - for (_nditte->first(); _nditte->good(); _nditte->next()) + TLocalisamfile nditte(LF_NDITTE); + + for (nditte.first(); nditte.good(); nditte.next()) { TToken_string* d = new TToken_string(64); d->add(" "); - const long n = _nditte->get_long(NDT_CODDITTA); + const long n = nditte.get_long(NDT_CODDITTA); d->add(n); - d->add(_nditte->get(NDT_RAGSOC)); + d->add(nditte.get(NDT_RAGSOC)); const bool unselectable = !prefix().exist(n); @@ -405,10 +401,10 @@ bool TLista_fatture::preprocess_page(int file, int counter) if (new_det || new_cr) // Stampa totali parziali { const bool is_cr = _tipo == costo_ricavo; - TString256 s("TOTALE TIPO "); + TString256 s(TR("TOTALE TIPO ")); _pr.reset(); _pr.set_style(boldstyle); - s << (is_cr ? "COSTO/RICAVO " : "INDETRAIBILITA' "); + s << (is_cr ? TR("COSTO/RICAVO ") : TR("INDETRAIBILITA' ")); s << (is_cr ? _tipocrprec : _tipodetprec); _pr.put(s,42); if (_tp_doc != 0.0) @@ -491,10 +487,10 @@ print_action TLista_fatture::postprocess_print(int file, int counter) if (_tipo != intra) { const bool is_cr = _tipo == costo_ricavo; - TString256 s("TOTALE TIPO "); + TString256 s(TR("TOTALE TIPO ")); _pr.reset(); _pr.set_style(boldstyle); - s << (is_cr ? "COSTO/RICAVO " : "INDETRAIBILITA' "); + s << (is_cr ? TR("COSTO/RICAVO ") : TR("INDETRAIBILITA' ")); s << (is_cr ? _tipocrprec : _tipodetprec); _pr.put(s,42); if (_tp_doc != 0.0) @@ -508,7 +504,7 @@ print_action TLista_fatture::postprocess_print(int file, int counter) p.print(_pr); p.print(_pr); _pr.set_style(boldstyle); - _pr.put("TOTALE GENERALE :",42); + _pr.put(TR("TOTALE GENERALE :"),42); if (_tot_doc != 0.0) _pr.put(real2string(_tot_doc),73); if (_tot_imp != 0.0) @@ -528,10 +524,10 @@ print_action TLista_fatture::postprocess_print(int file, int counter) _pr.reset(); for (int i=0; i<3; i++) p.print(_pr); - _pr.put("Cod.@57gVENDITE@92gACQUISTI",1); + _pr.put(FR("Cod.@57gVENDITE@92gACQUISTI"),1); p.print(_pr); _pr.reset(); - _pr.put("IVA Descrizione@45gImponibile@66gImposta@82gImponibile@101gImposta",1); + _pr.put(FR("IVA Descrizione@45gImponibile@66gImposta@82gImponibile@101gImposta"),1); p.print(_pr); _pr.reset(); p.print(_pr); @@ -546,7 +542,7 @@ print_action TLista_fatture::postprocess_print(int file, int counter) if (cod == "~A19") { p.print(_pr); - _pr.put("Totale ",1); + _pr.put(TR("Totale "),1); if (tot1 != 0.0) _pr.put(real2string(tot1),40); if (tot2 != 0.0) @@ -558,12 +554,12 @@ print_action TLista_fatture::postprocess_print(int file, int counter) p.print(_pr); _pr.reset(); p.print(_pr); - des = "Totale acquisti indeducibili per ART.19"; + des = TR("Totale acquisti indeducibili per ART.19"); _pr.put(des,1); } else { - des = _iva->decode(cod); + des = cache().get("%IVA", cod).get("S0"); _pr.put(cod,1); _pr.put(des,6); } @@ -583,7 +579,7 @@ print_action TLista_fatture::postprocess_print(int file, int counter) _pr.reset(); } p.print(_pr); - _pr.put("Totale Generale IVA",1); + _pr.put(TR("Totale Generale IVA"),1); if (tot1 != 0.0) _pr.put(real2string(tot1),40); if (tot2 != 0.0) @@ -603,62 +599,58 @@ void TLista_fatture::set_the_header() const long firm = get_firm(); reset_header (); - _nditte->zero(); - _nditte->put(NDT_CODDITTA, firm); - _nditte->read(); - if (_nditte->bad()) - _nditte->zero(); + const TRectype & nditte = cache().get(LF_NDITTE, firm); TDate today(TODAY); TString s(132), rw(132); TString16 s1,s2; - s = _nditte->get(NDT_RAGSOC); + s = nditte.get(NDT_RAGSOC); s1 = _date_from.string(); s2 = _date_to.string(); char c[2]={'N','D'}; - set_header (soh++, "Ditta : %ld %s@100gData@106g%s @123gPag. @#", + set_header (soh++, FR("Ditta : %ld %s@100gData@106g%s @123gPag. @#"), firm, (const char *)s, (const char *)today); - s.format("Dalla data %s Alla data %s",(const char*)s1,(const char*)s2); + s.format(FR("Dalla data %s Alla data %s"),(const char*)s1,(const char*)s2); if (_tipo == indetraibile || _tipo == costo_ricavo) { - s << "@45g Dal fornitore "; + s << FR("@45g Dal fornitore "); if (_from_cf == 0L && _to_cf == 999999L) - s << " Al fornitore"; + s << TR(" Al fornitore"); else { s << _from_cf; - s << " Al fornitore "; + s << TR(" Al fornitore "); s << _to_cf; } - s << "@94g Dal registro "; + s << FR("@94g Dal registro "); if (_from_reg.empty() && _to_reg == "~~~") - s << " Al registro"; + s << TR(" Al registro"); else { s << _from_reg; - s << " Al registro "; + s << TR(" Al registro "); s << _to_reg; } if (_tipo == costo_ricavo) { - set_header(soh++,"@50gLISTA FATTURE PER TIPO COSTO/RICAVO"); + set_header(soh++,FR("@50gLISTA FATTURE PER TIPO COSTO/RICAVO")); strncpy(c,"CR",2); } else - set_header(soh++,"@50gLISTA FATTURE CON IVA INDETRAIBILE"); + set_header(soh++,FR("@50gLISTA FATTURE CON IVA INDETRAIBILE")); } else { - set_header(soh++,"@50gLISTA FATTURE INTRACOMUNITARIE"); - s << "@45g Dal c. causale "; + set_header(soh++,FR("@50gLISTA FATTURE INTRACOMUNITARIE")); + s << FR("@45g Dal c. causale "); if (_from_cau.empty() && _to_cau == "~~~") - s << " Al c. causale"; + s << TR(" Al c. causale"); else { s << _from_cau; - s << " Al codice causale "; + s << TR(" Al codice causale "); s << _to_cau; } } @@ -667,9 +659,9 @@ void TLista_fatture::set_the_header() rw.fill('-'); set_header(soh++, (const char *) rw); - set_header(soh++, "@12gNum@21gDocumento@63gCod.@68gM@70gTipo@106gCod@110g%c@128gNum.",c[0]); - set_header(soh++, "Data reg.@12gprot.@18gData@30gNumero@37gCodice@44gRagione sociale@63gReg.@68gL@70gDoc." - "@75gTot.documento@94gImponibile@106gIva@110g%c@118gImposta@128gReg.",c[1]); + set_header(soh++, FR("@12gNum@21gDocumento@63gCod.@68gM@70gTipo@106gCod@110g%c@128gNum."),c[0]); + set_header(soh++, FR("Data reg.@12gprot.@18gData@30gNumero@37gCodice@44gRagione sociale@63gReg.@68gL@70gDoc." + "@75gTot.documento@94gImponibile@106gIva@110g%c@118gImposta@128gReg."),c[1]); set_header(soh++, (const char *) rw); set_header(soh,""); @@ -717,12 +709,12 @@ bool TLista_fatture::set_print(int m) switch (_tipo) { case costo_ricavo: - msk.set_caption("Lista fatture per costo/ricavo"); - msk.field(FLD_FROM_FOR).set_prompt("Da cli./for. "); - msk.field(FLD_TO_FOR).set_prompt("A cli./for. "); + msk.set_caption(TR("Lista fatture per costo/ricavo")); + msk.field(FLD_FROM_FOR).set_prompt(TR("Da cli./for. ")); + msk.field(FLD_TO_FOR).set_prompt(TR("A cli./for. ")); break; case intra: - msk.set_caption("Lista fatture intracomunitarie"); + msk.set_caption(TR("Lista fatture intracomunitarie")); msk.hide(-1); msk.show(-2); break; @@ -821,11 +813,10 @@ bool TLista_fatture::user_create() break; } } - _ditte = new TArray_sheet(-1, -1, -4, -4, "Selezione Ditte", - "@1|Cod.@5R|Ragione Sociale@50"); - _nditte = new TLocalisamfile(LF_NDITTE); - _reg = new TDecoder("REG", "I0"); - _iva = new TDecoder("%IVA"); + _ditte = new TArray_sheet(-1, -1, -4, -4, TR("Selezione Ditte"), + HR("@1|Cod.@5R|Ragione Sociale@50")); + open_files(LF_NDITTE, LF_TAB, LF_TABCOM, 0); + _rel = new TRelation(LF_RMOVIVA); _rel->add(LF_MOV,"NUMREG==NUMREG"); _rel->add(LF_CAUSALI,"CODCAUS==CODCAUS",1,LF_MOV); // Relazione @@ -842,11 +833,8 @@ bool TLista_fatture::user_create() bool TLista_fatture::user_destroy() { - if (_nditte) delete _nditte; if (_ditte) delete _ditte; if (_rel) delete _rel; - if (_reg) delete _reg; - if (_iva) delete _iva; return TRUE; } @@ -857,7 +845,7 @@ bool TLista_fatture::user_destroy() int cg3700(int argc, char* argv[]) { TLista_fatture lf; - lf.run(argc, argv, "Lista fatture"); + lf.run(argc, argv, TR("Lista fatture")); return 0; } diff --git a/cg/cg4.url b/cg/cg4.url deleted file mode 100755 index 237219453..000000000 --- a/cg/cg4.url +++ /dev/null @@ -1,4 +0,0 @@ -#include -#include - - diff --git a/cg/cg5.url b/cg/cg5.url deleted file mode 100755 index f563b83f3..000000000 --- a/cg/cg5.url +++ /dev/null @@ -1,4 +0,0 @@ -#include - -#include - diff --git a/cg/cg6.url b/cg/cg6.url deleted file mode 100755 index 1aa8af7fb..000000000 --- a/cg/cg6.url +++ /dev/null @@ -1,3 +0,0 @@ -#include - -#include diff --git a/cg/cgp0.url b/cg/cgp0.url deleted file mode 100755 index 5b9a20a00..000000000 --- a/cg/cgp0.url +++ /dev/null @@ -1,4 +0,0 @@ -#include -#include - - diff --git a/cg/cgp1.url b/cg/cgp1.url deleted file mode 100755 index 5b9a20a00..000000000 --- a/cg/cgp1.url +++ /dev/null @@ -1,4 +0,0 @@ -#include -#include - - diff --git a/cg/cgp2.url b/cg/cgp2.url deleted file mode 100755 index 5b9a20a00..000000000 --- a/cg/cgp2.url +++ /dev/null @@ -1,4 +0,0 @@ -#include -#include - - diff --git a/cg/trasfer.xls b/cg/trasfer.xls index b54434cc5..3599f1b01 100755 Binary files a/cg/trasfer.xls and b/cg/trasfer.xls differ