From 86f44673bf04cde414fc542ee71b5935b58acef3 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 10 Apr 2003 14:19:30 +0000 Subject: [PATCH] Patch level : 2..0 448 Files correlati : sc0.exe sc1.exe sc2.exe sc3.exe Ricompilazione Demo : [ ] Commento : Aggiunto il supporto delle lingue a sc fare la patch man mano che ci sono spedizioni git-svn-id: svn://10.65.10.50/trunk@11003 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- sc/sc0100.cpp | 8 +-- sc/sc0101.cpp | 66 ++++++------------- sc/sc1100.cpp | 82 +++++++++-------------- sc/sc1200.cpp | 89 ++++++++----------------- sc/sc1300.cpp | 118 --------------------------------- sc/sc1300a.h | 6 -- sc/sc1300a.uml | 126 ----------------------------------- sc/sc2100.cpp | 176 +++++++------------------------------------------ sc/sc2200.cpp | 107 +++++++++++++----------------- sc/sc2201.cpp | 5 +- sc/sc2300.cpp | 63 ++++++++---------- sc/sc2400.cpp | 30 ++------- sc/sc2401.cpp | 114 +++----------------------------- sc/sc2500.cpp | 21 +++--- sc/sc3100.cpp | 30 ++++----- 15 files changed, 219 insertions(+), 822 deletions(-) delete mode 100755 sc/sc1300.cpp delete mode 100755 sc/sc1300a.h delete mode 100755 sc/sc1300a.uml diff --git a/sc/sc0100.cpp b/sc/sc0100.cpp index e1918660d..27b563ec9 100755 --- a/sc/sc0100.cpp +++ b/sc/sc0100.cpp @@ -53,8 +53,8 @@ bool TSaldaconto_app::create() const bool ges_sal = cnf.get_bool("GesSal"); if (!ges_sal) { - warning_box("Attenzione: La ditta %ld non ha la\n" - "la gestione del saldaconto attivata!", get_firm()); + warning_box(FR("Attenzione: La ditta %ld non ha la\n" + "la gestione del saldaconto attivata!"), get_firm()); } return TSkeleton_application::create(); @@ -80,7 +80,7 @@ void TSaldaconto_app::main_loop() bool ok = TRUE; while (ok) { - xvt_statbar_set("Ricerca", TRUE); + xvt_statbar_set(TR("Ricerca"), TRUE); m.reset(); ok = m.run() == K_ENTER; if (ok) @@ -181,7 +181,7 @@ void TSaldaconto_app::gioca_cambi(TMask& m, int force) int sc0100(int argc, char* argv[]) { TSaldaconto_app* salda = new TSaldaconto_app; - salda->run(argc, argv, "Gestione Saldaconto"); + salda->run(argc, argv, TR("Gestione Saldaconto")); delete salda; return 0; } diff --git a/sc/sc0101.cpp b/sc/sc0101.cpp index 3e878ed93..3abd1e08d 100755 --- a/sc/sc0101.cpp +++ b/sc/sc0101.cpp @@ -58,7 +58,7 @@ TFattura_mask::TFattura_mask(TRiga_partite& fattura) { const bool edit = _fattura.rate() > 0; set_mode(edit ? MODE_MOD : MODE_INS); - xvt_statbar_set(edit ? "Modifica" : "Inserimento", TRUE); + xvt_statbar_set(edit ? TR("Modifica") : TR("Inserimento"), TRUE); enable(DLG_DELREC, edit); @@ -113,7 +113,7 @@ TFattura_mask::TFattura_mask(TRiga_partite& fattura) TFattura_mask::~TFattura_mask() { delete _pag; - xvt_statbar_set("Estratto conto", TRUE); + xvt_statbar_set(TR("Estratto conto"), TRUE); } real TFattura_mask::totale_rate(bool val) const @@ -358,9 +358,9 @@ bool TFattura_mask::pag_handler(TMask_field& f, KEY key) const char* const pic = in_valuta ? ".3" : "."; const TString is(imp.string(pic)); const TString ts(tot.string(pic)); - ok = yesno_box("Il totale delle rate e' %s mentre\n" + ok = yesno_box(FR("Il totale delle rate e' %s mentre\n" "il totale del documento e' %s.\n" - "Si desidera registrare ugualmente?", + "Si desidera registrare ugualmente?"), (const char*)is, (const char*)ts); } } @@ -378,9 +378,9 @@ bool TFattura_mask::pag_handler(TMask_field& f, KEY key) { const TString is(imp.string(".")); const TString ts(totlit.string(".")); - ok = f.yesno_box("Il totale in lire delle rate e' %s mentre\n" + ok = f.yesno_box(FR("Il totale in lire delle rate e' %s mentre\n" "il totale del documento e' %s.\n" - "Si desidera registrare ugualmente?", + "Si desidera registrare ugualmente?"), (const char*)is, (const char*)ts); } } @@ -405,7 +405,7 @@ bool TFattura_mask::datadoc_handler(TMask_field& f, KEY key) } if (key == K_ENTER && f.get().empty()) - return f.error_box("La data del documento e' obbligatoria."); + return f.error_box(TR("La data del documento e' obbligatoria.")); return TRUE; } @@ -415,33 +415,7 @@ bool TFattura_mask::codpag_handler(TMask_field& f, KEY key) bool ok = TRUE; TFattura_mask& m = (TFattura_mask&)f.mask(); - if (key == K_ENTER) - { - if (f.get().empty()) - { - f.error_box("Il codice di pagamento e' obbligatorio!\n" - "Se possibile esso verra' proposto, ma potra'\n" - "essere modificato prima di registrare il movimento."); - const char typ = m.get(E_CLIFO)[0]; - const long cod = m.get_long(typ == 'C' ? E_CLIENTE : E_FORNITORE); - - TLocalisamfile clifo(LF_CLIFO); - clifo.put(CLI_TIPOCF, typ); - clifo.put(CLI_CODCF, cod); - if (clifo.read() == NOERR) - { - const TString& cp = clifo.get(CLI_CODPAG); - if (cp.not_empty()) - { - f.set(cp); - key = K_TAB; - } - } - ok = FALSE; - } - } - if (key == K_TAB && f.focusdirty() && m.insert_mode()) m.set_scadenze(); @@ -514,17 +488,17 @@ bool TFattura_mask::recalc_handler(TMask_field& f, KEY key) if (pag.in_valuta()) yak |= (pag.tval_rata(0) != pag.importo_da_non_dividere(TRUE)); if (yak) { - if (f.yesno_box("L'importo della prima rata e' stato modificato. " + if (f.yesno_box(TR("L'importo della prima rata e' stato modificato. " "Con il ricalcolo automatico esso non sara' piu'" " modificabile. Si desidera " - "riportare le rate alle condizioni iniziali?")) + "riportare le rate alle condizioni iniziali?"))) { pag.set_tipo_prima_rata(pag.tipo_prima_rata() + 3); fm.set(FS_TIPOPR, pag.desc_tpr()); fm.set_scadenze(); } else - f.warning_box("Il tipo prima rata rimane modificato in %s", pag.desc_tpr()); + f.warning_box(FR("Il tipo prima rata rimane modificato in %s"), pag.desc_tpr()); } else { @@ -829,8 +803,8 @@ void TFattura_mask::write_scadenze() const bool sposta = newgame != NULL; if (sposta) { - sposta = yesno_box("Si desidera spostare la fattura e gli eventuali\n" - "pagamenti relativi nella partita %d %s?", anno, (const char*)numpart); + sposta = yesno_box(FR("Si desidera spostare la fattura e gli eventuali\n" + "pagamenti relativi nella partita %d %s?"), anno, (const char*)numpart); } if (sposta) { @@ -996,7 +970,7 @@ bool TSaldaconto_app::descr_handler(TMask_field& f, KEY key) { if (f.empty() && f.mask().field(E_CODCAUS).empty()) { - f.error_box("La descrizione e' obbligatoria in assenza della causale"); + f.error_box(TR("La descrizione e' obbligatoria in assenza della causale")); ok = key == K_TAB; // Non bloccare sul tab } } @@ -1049,7 +1023,7 @@ bool TSaldaconto_app::totale_handler(TMask_field& f, KEY k) { const real totale(f.get()); if (totale.is_zero()) - ok = yesno_box("Totale documento nullo: continuare ugualmente?"); + ok = yesno_box(TR("Totale documento nullo: continuare ugualmente?")); if (ok) { @@ -1059,7 +1033,7 @@ bool TSaldaconto_app::totale_handler(TMask_field& f, KEY k) const real totval(m.get(E_TOTDOCVAL)); const real totlit = cambio.val2lit(totval); if (totale != totlit) - ok = yesno_box("Il totale documento in lire dovrebbe essere %s: continuare ugualmente?", + ok = yesno_box(FR("Il totale documento in lire dovrebbe essere %s: continuare ugualmente?"), totlit.string(".")); } } @@ -1071,9 +1045,9 @@ bool TSaldaconto_app::totale_handler(TMask_field& f, KEY k) if (totdoc != imppag) { TString msg(80); - msg << "Il totale documento inserito " << totdoc.string("."); - msg << "\nnon coincide con l'importo pagato " << imppag.string("."); - msg << ".\nSi desidera modificarli?"; + msg << TR("Il totale documento inserito ") << totdoc.string("."); + msg << TR("\nnon coincide con l'importo pagato ") << imppag.string("."); + msg << TR(".\nSi desidera modificarli?"); ok = !f.yesno_box(msg); } } @@ -1140,9 +1114,9 @@ bool TSaldaconto_app::totval_handler(TMask_field& f, KEY key) if (totdoc != imppag) { TString msg(80); - msg << "Il totale del documento in valuta e' diverso dall'importo pagato " + msg << TR("Il totale del documento in valuta e' diverso dall'importo pagato ") << imppag.string(".3") - << "\nSi desidera continuare ugualmente?"; + << TR("\nSi desidera continuare ugualmente?"); ok = f.yesno_box(msg); } } diff --git a/sc/sc1100.cpp b/sc/sc1100.cpp index f07fa6a44..6b1c33962 100755 --- a/sc/sc1100.cpp +++ b/sc/sc1100.cpp @@ -1,17 +1,12 @@ -#include - #include #include #include #include -#include -#include -#include #include "../cg/cgsaldac.h" #include "sc1100.h" -class TDeletepart_app : public TApplication +class TDeletepart_app : public TSkeleton_application { TArchive _arc; TArray _to_zap; // Array contenente le chiavi delle partite da eliminare @@ -31,7 +26,7 @@ protected: void delete_tmp_files(bool remove=TRUE); virtual bool create(); virtual bool destroy(); - virtual bool menu(MENU_TAG m); + virtual void main_loop(); public: @@ -50,15 +45,15 @@ void TDeletepart_app::backup_delete_partite() err = _part->lock(); if (err != NOERR) { - error_box("Il file partite non puo' essere bloccato in modo esclusivo." - " Nessuna partita cancellata. Errore %d.",err); + error_box(FR("Il file partite non puo' essere bloccato in modo esclusivo." + " Nessuna partita cancellata. Errore %d."),err); return; } create_tmp_files(); _part->zero(); // Scorre il file delle partite { - TProgind p(10, "Ricerca e copia delle partite da eliminare...", TRUE, FALSE, 10); + TProgind p(10, TR("Ricerca e copia delle partite da eliminare..."), TRUE, FALSE, 10); for (_part->first();_part->good() && !p.iscancelled();_part->read(_isgreat)) { const char tipocf = _part->get_char(PART_TIPOCF); @@ -138,8 +133,8 @@ if (total != 0) if (rt) { // Effettiva cancellazione delle partite - TString80 caption("Cancellazione di "); - caption.add_plural(total, "partita"); + TString80 caption(TR("Cancellazione di ")); + caption.add_plural(total, TR("partita")); if (!yesno_box(caption)) _to_zap.destroy(); TProgind pi(total, caption, FALSE, TRUE, 10); @@ -161,10 +156,10 @@ if (total != 0) } } else -error_box("Errore %d scrivendo sui files temporanei." - " La cancellazione delle partite chiuse non verra' effettuata.",err); +error_box(FR("Errore %d scrivendo sui files temporanei." + " La cancellazione delle partite chiuse non verra' effettuata."),err); // Cerca scadenze e pagamenti senza partite: solo su richiesta - TString80 caption("Cancellazione scadenze e pagamenti senza partite"); + TString80 caption(TR("Cancellazione scadenze e pagamenti senza partite")); if (err == NOERR && yesno_box(caption)) { TString16 lastpart; @@ -188,7 +183,7 @@ error_box("Errore %d scrivendo sui files temporanei." err = _scad->remove(); } if (err != NOERR) - error_box("Errore %d nella cancellazione delle scadenze %d/%s", + error_box(FR("Errore %d nella cancellazione delle scadenze %d/%s"), err, lastanno, lastpart); else { @@ -209,7 +204,7 @@ error_box("Errore %d scrivendo sui files temporanei." err = _pagsca->remove(); } if (err != NOERR) - error_box("Errore %d nella cancellazione dei pagamenti %d/%s", + error_box(FR("Errore %d nella cancellazione dei pagamenti %d/%s"), err, lastanno, lastpart); } } @@ -222,8 +217,8 @@ void TDeletepart_app::restore_partite() int err = _part->lock(); if (err != NOERR) { - error_box("Il file partite non puo' essere bloccato in modo esclusivo." - " Nessuna partita ripristinata. Errore %d.",err); + error_box(FR("Il file partite non puo' essere bloccato in modo esclusivo." + " Nessuna partita ripristinata. Errore %d."),err); return ; } const char* dir =& _tmp_dir[1]; // Cut out % sign @@ -235,7 +230,7 @@ void TDeletepart_app::restore_partite() // non dovrebbero esserci piu'... (Colombo's Egg...). Al limite riscrive i record // gia' presenti. const TRecnotype items = _tpart->items() + _tscad->items() + _tpagsca->items(); - TProgind pi(items, "Ripristino partite eliminate", FALSE, TRUE, 10); + TProgind pi(items, TR("Ripristino partite eliminate"), FALSE, TRUE, 10); for (_tpart->first();_tpart->good() && err==NOERR;_tpart->next()) { @@ -245,7 +240,7 @@ void TDeletepart_app::restore_partite() pi.addstatus(1); } if (err != NOERR) - error_box("Errore %d ripristinando il file PARTITE.",err); + error_box(FR("Errore %d ripristinando il file PARTITE."),err); else { for (_tscad->first();_tscad->good() && err==NOERR;_tscad->next()) @@ -255,7 +250,7 @@ void TDeletepart_app::restore_partite() pi.addstatus(1); } if (err != NOERR) - error_box("Errore %d ripristinando il file SCADENZE.",err); + error_box(FR("Errore %d ripristinando il file SCADENZE."),err); else { for (_tpagsca->first();_tpagsca->good() && err==NOERR;_tpagsca->next()) @@ -264,13 +259,13 @@ void TDeletepart_app::restore_partite() err=_pagsca->rewrite(_tpagsca->curr()); pi.addstatus(1); } - if (err != NOERR) error_box("Errore %d ripristinando il file PAGSCA.",err); + if (err != NOERR) error_box(FR("Errore %d ripristinando il file PAGSCA."),err); } } delete_tmp_files(); // Removes tmp files! } else - error_box("Errore nel ripristino dei file da dischetto. Nessuna partita ripristinata."); + error_box(TR("Errore nel ripristino dei file da dischetto. Nessuna partita ripristinata.")); _part->unlock(); } @@ -281,12 +276,12 @@ void TDeletepart_app::delete_partite_restored() int err = _part->lock(); if (err != NOERR) { - error_box("Il file partite non puo' essere bloccato in modo esclusivo." - " Nessuna partita cancellata. Errore %d.",err); + error_box(FR("Il file partite non puo' essere bloccato in modo esclusivo." + " Nessuna partita cancellata. Errore %d."), err); return; } _part->zero(); - TProgind p(10, "Eliminazione partite ricaricate...", TRUE, FALSE, 10); + TProgind p(10, TR("Eliminazione partite ricaricate..."), TRUE, FALSE); for (_part->first();_part->good();_part->read(_isgreat)) { if (_part->get_bool(PART_RICARICATA)) @@ -303,19 +298,15 @@ void TDeletepart_app::delete_partite_restored() } _part->put(PART_NRIGA,9999); // Forza la rilettura della prossima partita } - if (total != 0) message_box("Eliminate %ld partite ricaricate.",total); + if (total != 0) message_box(FR("Eliminate %ld partite ricaricate."),total); _part->unlock(); } void TDeletepart_app::create_tmp_files(bool create) { - TFilename tf(_tmp_dir); - tf << "/" << "f1"; - _tpart = new TIsamtempfile(LF_PARTITE,tf,create); - tf.rtrim(1);tf << "2"; - _tscad = new TIsamtempfile(LF_SCADENZE,tf,create); - tf.rtrim(1);tf << "3"; - _tpagsca = new TIsamtempfile(LF_PAGSCA,tf,create); + _tpart = new TIsamtempfile(LF_PARTITE, "f1", create); + _tscad = new TIsamtempfile(LF_SCADENZE, "f2", create); + _tpagsca = new TIsamtempfile(LF_PAGSCA, "f3", create); } void TDeletepart_app::delete_tmp_files(bool remove) @@ -333,30 +324,23 @@ void TDeletepart_app::delete_tmp_files(bool remove) bool TDeletepart_app::create() { - TApplication::create(); - _tmp_dir.temp(); - _tmp_dir = _tmp_dir.path(); - _tmp_dir << "SC"; - if (!fexist(_tmp_dir)) make_dir(_tmp_dir); - _tmp_dir.insert("%"); // Add % sign + open_files(LF_TABCOM, LF_TAB, LF_PCON, LF_PARTITE, LF_SCADENZE, LF_PAGSCA, 0); + _part = new TLocalisamfile(LF_PARTITE); _scad = new TLocalisamfile(LF_SCADENZE); _pagsca = new TLocalisamfile(LF_PAGSCA); - dispatch_e_menu(BAR_ITEM(1)); - return TRUE; + return TSkeleton_application::create(); } bool TDeletepart_app::destroy() { - _tmp_dir=_tmp_dir.sub(1); // Cut out % sign - if (fexist(_tmp_dir)) rmdir(_tmp_dir); delete _part; delete _scad; delete _pagsca; - return TApplication::destroy(); + return TSkeleton_application::destroy(); } -bool TDeletepart_app::menu(MENU_TAG) +void TDeletepart_app::main_loop() { TMask m("sc1100a"); @@ -380,16 +364,14 @@ bool TDeletepart_app::menu(MENU_TAG) default: break; } - } - return FALSE; } int sc1100(int argc, char** argv) { TDeletepart_app a; - a.run(argc, argv, "Archiviazione partite pareggiate"); + a.run(argc, argv, TR("Archiviazione partite pareggiate")); return 0; } diff --git a/sc/sc1200.cpp b/sc/sc1200.cpp index d03f27a20..64b0bb875 100755 --- a/sc/sc1200.cpp +++ b/sc/sc1200.cpp @@ -1,10 +1,7 @@ #include -#include #include #include #include -#include -#include #include "../cg/cglib02.h" #include "../cg/cgsaldac.h" @@ -15,22 +12,19 @@ #include -class TCreatepart_app : public TApplication +class TCreatepart_app : public TSkeleton_application { TEsercizi_contabili _esc; bool _num_cli, _num_for; TString _desccl, _descfo; TDate _today; - - TLocalisamfile* _conti; - + protected: // Applicat virtual void on_firm_change(); virtual void on_config_change(); virtual bool create(); - virtual bool destroy(); - virtual bool menu(MENU_TAG m); + virtual void main_loop(); protected: static bool data_handler(TMask_field& f, KEY key); @@ -49,19 +43,9 @@ inline TCreatepart_app& app() { return (TCreatepart_app&)main_app(); } bool TCreatepart_app::create() { - TApplication::create(); - - _conti = new TLocalisamfile(LF_PCON); - - dispatch_e_menu(BAR_ITEM(1)); - return TRUE; -} + open_files(LF_TABCOM, LF_TAB, LF_PCON, LF_SALDI, LF_PARTITE, LF_PAGSCA, LF_SCADENZE, 0); -bool TCreatepart_app::destroy() -{ - delete _conti; - - return TApplication::destroy(); + return TSkeleton_application::create(); } void TCreatepart_app::on_firm_change() @@ -88,7 +72,7 @@ bool TCreatepart_app::data_handler(TMask_field& f, KEY key) const int anno = m.get_int(F_ANNO); const TDate oggi(f.get()); if (app()._esc.date2esc(oggi) != anno) - ok = f.error_box("La data non appartiene all'esercizio %d", anno); + ok = f.error_box(FR("La data non appartiene all'esercizio %d"), anno); if (ok && key == K_TAB) { @@ -96,7 +80,7 @@ bool TCreatepart_app::data_handler(TMask_field& f, KEY key) TEdit_field& dc = m.efield(F_DESCCL); if (dc.empty() || !dc.dirty()) { - desc = "Apertura clienti al "; desc << oggi; + desc = TR("Apertura clienti al "); desc << oggi; dc.set(desc); dc.set_dirty(FALSE); } @@ -104,7 +88,7 @@ bool TCreatepart_app::data_handler(TMask_field& f, KEY key) TEdit_field& df = m.efield(F_DESCFO); if (df.empty() || !df.dirty()) { - desc = "Apertura fornitori al "; desc << oggi; + desc = TR("Apertura fornitori al "); desc << oggi; df.set(desc); df.set_dirty(FALSE); } @@ -115,13 +99,8 @@ bool TCreatepart_app::data_handler(TMask_field& f, KEY key) void TCreatepart_app::zap_file(int logicnum) const { - TDir dir; - dir.get(logicnum, _lock, _nordir, _sysdirop); - dir.eod() = 0; - dir.put(logicnum, _nordir, _sysdirop); - TSystemisamfile f(logicnum); - f.pack(); + f.packfile(FALSE, TRUE); } bool TCreatepart_app::zap_partite() const @@ -135,11 +114,11 @@ bool TCreatepart_app::zap_partite() const if (zap) { - zap = yesno_box("Il saldaconto non e' vuoto.\n" + zap = yesno_box(TR("Il saldaconto non e' vuoto.\n" "La procedura lo azzera completamente.\n" - "Si desidera proseguire?"); + "Si desidera proseguire?")); if (zap) - zap = yesno_box("Confermare l'azzeramento del saldaconto esistente"); + zap = yesno_box(TR("Confermare l'azzeramento del saldaconto esistente")); if (zap) { @@ -157,18 +136,19 @@ bool TCreatepart_app::zap_partite() const char TCreatepart_app::is_clifo(int g, int c, long s, int& indbil) { - _conti->zero(); - _conti->put(PCN_GRUPPO, g); - _conti->put(PCN_CONTO, c); + TString16 key; - if (_conti->read() != NOERR) + key.format("%d|%d", g, c); + const TRectype conti = cache().get(LF_PCON, key); + + if (conti.empty()) { - warning_box("Archivio saldi disallineato con il piano dei conti\n record saldi non elaborato : gruppo %d conto %d sottoconto %ld", g, c, s); + warning_box(FR("Archivio saldi disallineato con il piano dei conti\n record saldi non elaborato : gruppo %d conto %d sottoconto %ld"), g, c, s); return '\0'; } - const char cf = _conti->get_char(PCN_TMCF); - indbil = _conti->get_int(PCN_INDBIL); + const char cf = conti.get_char(PCN_TMCF); + indbil = conti.get_int(PCN_INDBIL); return cf; } @@ -194,7 +174,7 @@ int TCreatepart_app::crea_partite(int anno_es, int anno_rif, int next_anno_es) TLocalisamfile pagamenti(LF_PAGSCA); int n_part = 0; - TProgind prind(items, "Creazione saldaconto", FALSE, TRUE, 45); + TProgind prind(items, TR("Creazione saldaconto"), FALSE, TRUE, 45); for (cur = 0; cur.pos() < items; ++cur) { @@ -247,23 +227,8 @@ int TCreatepart_app::crea_partite(int anno_es, int anno_rif, int next_anno_es) numero.right_just(7); TPartita game(clifo, anno_rif, numero); -/* - if (check) - { - for (int p = game.last(); p > 0; p = game.pred(p)) - { - const TRiga_partite& riga = game.riga(p); - const int g = riga.get_int(PART_GRUPPOCL); - const int c = riga.get_int(PART_CONTOCL); - if (gruppo == g && conto == c) - break; // Esiste gia' una riga con questo conto - } - if (p > 0) // Il cliente esiste gia', per cui ignoro il saldo - continue; - } -*/ - TRiga_partite& riga = game.new_row(); + riga.put(PART_DATAREG, _today); riga.put(PART_DATADOC, _today); riga.put(PART_SEZ, saldo.sezione()); @@ -296,7 +261,7 @@ int TCreatepart_app::crea_partite(int anno_es, int anno_rif, int next_anno_es) n_part++; else { - error_box("Impossibile scrivere la partita %d %s", + error_box(FR("Impossibile scrivere la partita %d %s"), anno_rif, (const char *)numero); break; } @@ -308,7 +273,7 @@ int TCreatepart_app::crea_partite(int anno_es, int anno_rif, int next_anno_es) return n_part; } -bool TCreatepart_app::menu(MENU_TAG) +void TCreatepart_app::main_loop() { TMask m("sc1200a"); m.set_handler(F_DATA, data_handler); @@ -343,19 +308,17 @@ bool TCreatepart_app::menu(MENU_TAG) if (n_part > 0) { TString msg(80); - msg << "Sono state create " << n_part << " partite"; + msg << TR("Sono state create ") << n_part << TR(" partite"); message_box(msg); break; } } // while run - - return FALSE; } int sc1200(int argc, char** argv) { TCreatepart_app a; - a.run(argc, argv, "Apertura scadenze da saldi"); + a.run(argc, argv, TR("Apertura scadenze da saldi")); return 0; } diff --git a/sc/sc1300.cpp b/sc/sc1300.cpp deleted file mode 100755 index 1086825cd..000000000 --- a/sc/sc1300.cpp +++ /dev/null @@ -1,118 +0,0 @@ -#include - -#include "sc1.h" -#include "sc1300a.h" - -class SollecitiStorici_app : public TRelation_application -{ - TMask* _msk; - TRelation* _rel; - -protected: - - virtual TMask* get_mask(int mode) { return _msk;} - virtual bool changing_mask(int mode) { return FALSE;} - virtual TRelation* get_relation() const { return _rel;} - virtual bool user_create() ; - virtual bool user_destroy() ; - virtual int write(const TMask& m); - - static bool zap_handler(TMask_field& f, KEY k); - - static SollecitiStorici_app& app() - { return (SollecitiStorici_app&)main_app();} - -public: - - void zap_cliente(const char* c); - - SollecitiStorici_app() {} - virtual ~SollecitiStorici_app() {} -}; - - -bool SollecitiStorici_app::user_create() -{ - _rel = new TRelation(LF_PAGSCA); - _msk = new TMask("sc1300a"); - - _msk->set_handler(F_ZAP, zap_handler); - set_search_field(F_TIPO); - - return TRUE; -} - -bool SollecitiStorici_app::user_destroy() -{ - delete _rel; - delete _msk; - - return TRUE; -} - -bool SollecitiStorici_app::zap_handler(TMask_field& f, KEY k) -{ - if (k == K_SPACE && !f.mask().get(F_CODICE).empty()) - { - if (yesno_box("Si desidera azzerare l'archivio solleciti per " - "il cliente %s?", (const char*)f.mask().get(F_DESCR))) - { - app().zap_cliente(f.mask().get(F_CODICE)); - return f.mask().stop_run(K_ESC); - } - } - return TRUE; -} - -void SollecitiStorici_app::zap_cliente(const char* cod) -{ - TLocalisamfile& sr = _rel->lfile(); - sr.zero(); sr.put("CODICE", cod); - int err = NOERR; - - for (err = sr.read(_isgteq); - err == NOERR && sr.get("CODICE") == cod; - err = sr.next()) - sr.remove(); -} - -int SollecitiStorici_app::write(const TMask& m) -{ - TLocalisamfile& sr = _rel->lfile(); - _rel->save_status(); - - sr.zero(); sr.put("CODICE", m.get(F_CODICE)); - int err = NOERR; - bool ok = TRUE; - - TDate data; - TDate dmsk(m.get(F_DATA)); - - for (err = sr.read(_isgteq); - err == NOERR && sr.get("CODICE") == m.get(F_CODICE); - err = sr.next()) - { - int tipo = sr.get_int("TIPO"); - data = sr.get_date("DATASPED"); - - if (tipo >= m.get_int(F_TIPO) && data <= dmsk) - { - error_box("Sollecito di grado inferiore ad uno precedente (%s, grado %d)", - (const char*)data.string(), tipo); - ok = FALSE; - break; - } - } - _rel->restore_status(); - - if (ok) return TRelation_application::write(m); - - return ok; -} - -int sc1300(int argc, char** argv) -{ - SollecitiStorici_app a; - a.run(argc, argv, "Archivio Storico Solleciti"); - return 0; -} diff --git a/sc/sc1300a.h b/sc/sc1300a.h deleted file mode 100755 index 31eb71265..000000000 --- a/sc/sc1300a.h +++ /dev/null @@ -1,6 +0,0 @@ -#define F_CODICE 101 -#define F_DESCR 102 -#define F_TIPO 103 -#define F_DATA 104 -#define F_SALDO 105 -#define F_ZAP 106 \ No newline at end of file diff --git a/sc/sc1300a.uml b/sc/sc1300a.uml deleted file mode 100755 index 5c015f821..000000000 --- a/sc/sc1300a.uml +++ /dev/null @@ -1,126 +0,0 @@ -#include "sc1300a.h" - -TOOLBAR "" 0 20 0 2 - -// #include - -BUTTON DLG_SAVEREC 8 2 -BEGIN -PROMPT -17 -1 "~Registra" -MESSAGE EXIT,K_SAVE -END - -BUTTON DLG_NEWREC 8 2 -BEGIN -PROMPT -27 -1 "~Nuovo" -MESSAGE EXIT,K_INS -END - -BUTTON DLG_DELREC 8 2 -BEGIN -PROMPT -37 -1 "~Elimina" -MESSAGE EXIT,K_DEL -END - -BUTTON DLG_FINDREC 8 2 -BEGIN -PROMPT -47 -1 "Ri~cerca" -MESSAGE EXIT,K_F9 -END - -BUTTON DLG_CANCEL 8 2 -BEGIN -PROMPT -57 -1 "" -MESSAGE EXIT,K_ESC -END - -BUTTON DLG_QUIT 8 2 -BEGIN -PROMPT -67 -1 "" -MESSAGE EXIT,K_QUIT -END - -BUTTON F_ZAP 10 2 -BEGIN -PROMPT -77 -1 "Canc. Tutti" -END - -ENDPAGE - -PAGE "Archivio Storico Solleciti" -1 -1 78 8 - -STRING F_CODICE 5 -BEGIN - PROMPT 4 2 "Codice " - HELP "Codice del cliente" - FIELD LF_STOSOLL->CODICE - FLAGS "UR" - KEY 1 - USE LF_CLIFO KEY 1 - INPUT TIPOCF "C" - INPUT CODCF F_CODICE - DISPLAY "Codice" CODCF - DISPLAY "Ragione sociale @30" RAGSOC[1,30] - DISPLAY "Localita @30" LOCALITACF[1,30] - OUTPUT F_CODICE CODCF - OUTPUT F_DESCR RAGSOC - CHECKTYPE REQUIRED -END - -STRING F_DESCR 50 -BEGIN - PROMPT 4 4 "Ragione sociale " - HELP "Ragione sociale del cliente" - USE LF_CLIFO KEY 2 - INPUT TIPOCF "C" - INPUT RAGSOC F_DESCR - DISPLAY "Ragione sociale @30" RAGSOC[1,30] - DISPLAY "Codice" CODCF - DISPLAY "Localita @30" LOCALITACF[1,30] - OUTPUT F_CODICE CODCF - OUTPUT F_DESCR RAGSOC - CHECKTYPE REQUIRED -END - - -NUMBER F_TIPO 2 -BEGIN - PROMPT 4 6 "Grado sollecito " - USE LF_STOSOLL - INPUT CODICE F_CODICE - INPUT TIPO F_TIPO - DISPLAY "Codice" CODICE - DISPLAY "Grado" TIPO - DISPLAY "Data@10" DATASPED - DISPLAY "Saldo@15" SALDO - OUTPUT F_CODICE CODICE - OUTPUT F_DATA DATASPED - OUTPUT F_SALDO SALDO - OUTPUT F_TIPO TIPO - HELP "Numero di solleciti gia' inviati" - FIELD TIPO - KEY 1 - CHECKTYPE REQUIRED - WARNING "Grado sollecito obbligatorio" - FLAGS "U" -END - -DATE F_DATA -BEGIN - PROMPT 4 8 "Data invio sollecito " - HELP "Data di spedizione sollecito" - FIELD LF_STOSOLL->DATASPED - FLAGS "A" -END - -NUMBER F_SALDO 15 -BEGIN - PROMPT 4 10 "Importo totale " - HELP "Ammontare del saldo al momento del sollecito" - FLAGS "R" - PICTURE "." - FIELD LF_STOSOLL->SALDO -END - -ENDPAGE -ENDMASK diff --git a/sc/sc2100.cpp b/sc/sc2100.cpp index 46906168f..cce59772e 100755 --- a/sc/sc2100.cpp +++ b/sc/sc2100.cpp @@ -227,7 +227,7 @@ void TEC_row::print_on(TPrint_section& body) TEC_form& form = (TEC_form&)body.form(); const bool show_value = form.in_valuta() && in_valuta(); - const char* cod_valuta = show_value ? valuta().codice() : EMPTY_STRING; // Stampa nella valuta della ditta + const TString & cod_valuta = (show_value ? valuta().codice() : EMPTY_STRING); // Stampa nella valuta della ditta TForm_item& campo_valuta = body.find_field(PEC_VALUTA); campo_valuta.set(cod_valuta); @@ -530,25 +530,9 @@ void TEC_array::add_row(const TRiga_partite& row) bool sbf = FALSE; TImporto esposto(row.esposto(in_valuta, dls, dir, sbf)); bool esp = !esposto.is_zero(); -/* - const int gr = form().giorni_rischio(); - if (gr > 0) - { - const TDate& dir = form().data_inizio_rischio(); - sbf = data_pag > dir && data_pag <= dls; - riga.salvo_buon_fine(sbf); // Esposto salvo buon fine - } - - bool esp = sbf; - if (!esp) - { - esp = gr > 0 ? data_pag >= dls : data_pag > dls; // Esposto normale - } -*/ if (esp) { -// TImporto esposto(imp); const char sezione = row.get_char(PART_TIPOCF) == 'C' ? 'A' : 'D'; esposto.normalize(sezione); riga.salvo_buon_fine(sbf); // Esposto salvo buon fine @@ -1066,14 +1050,13 @@ void TEC_form::init_header(const TMask& m) TForm_item& fi = head.find_field(PEC_MEMO); if (fi.shown()) { - TLocalisamfile f(LF_RFORM); - f.put("TIPOPROF", name()); - f.put("CODPROF", code()); - f.put("SEZ", "H0"); - f.put("ID", PEC_MEMO); - const int err = f.read(); - if (err == NOERR) - fi.set(f.get("TESTO")); + TString key; + + key.format("%s|%s|H0|%d", (const char *) name(), (const char *) code(), PEC_MEMO); + + const TRectype & rform = cache().get(LF_RFORM, key); + if (!rform.empty()) + fi.set(rform.get("TESTO")); } TPrint_section& fink = section('G'); @@ -1310,9 +1293,9 @@ bool TStampaEC_application::print_selected() if (analfabeti > 0) { - const char* anag = who == 'C' ? "clienti" : "fornitori"; - warning_box("%ld %s non sono stati stampati in quanto " - "il codice lingua non corrispondeva al profilo di stampa", + const char* anag = who == 'C' ? TR("clienti") : TR("fornitori"); + warning_box(FR("%ld %s non sono stati stampati in quanto " + "il codice lingua non corrispondeva al profilo di stampa"), analfabeti, anag); } @@ -1342,7 +1325,7 @@ void TStampaEC_application::find_agents_scads(TAssoc_array& agents) const long items = cur.items(); cur.freeze(); - TProgind pi(items, "Ricerca scadenze aperte per agente...", TRUE, TRUE); + TProgind pi(items, TR("Ricerca scadenze aperte per agente..."), TRUE, TRUE); for (cur = 0L; cur.pos() < items; ++cur) { pi.addstatus(1); @@ -1478,9 +1461,9 @@ bool TStampaEC_application::print_agents() if (analfabeti > 0) { - const char* anag = who == 'C' ? "clienti" : "fornitori"; - warning_box("%ld %s non sono stati stampati in quanto " - "il codice lingua non corrispondeva al profilo di stampa", + const char* anag = who == 'C' ? TR("clienti") : TR("fornitori"); + warning_box(FR("%ld %s non sono stati stampati in quanto " + "il codice lingua non corrispondeva al profilo di stampa"), analfabeti, anag); } @@ -1495,9 +1478,9 @@ void TStampaEC_application::save_numec() { if (_lastnumcf.items() > 0) // Ho numerato qualche estratto conto? { - if (yesno_box("Si desidera aggiornare il numero di estratto conto stampato definitivamente?")) + if (yesno_box(TR("Si desidera aggiornare il numero di estratto conto stampato definitivamente?"))) { - TProgind pi(_lastnumcf.items(), "Aggiornamento numero estratto conto...", FALSE, TRUE); + TProgind pi(_lastnumcf.items(), TR("Aggiornamento numero estratto conto..."), FALSE, TRUE); const char tipocf = mask().get_who(); // Dovrebbe essere sempre 'C' TLocalisamfile cfven(LF_CFVEN); FOR_EACH_ASSOC_STRING(_lastnumcf, obj, key, str) @@ -1551,11 +1534,13 @@ void TStampaEC_application::update_numec(const TRectype& clf, int sign) case 'A': if (sign > 0) { - TLocalisamfile cfven(LF_CFVEN); - cfven.put(CFV_TIPOCF, clf.get(CLI_TIPOCF)); - cfven.put(CFV_CODCF, clf.get(CLI_CODCF)); - if (cfven.read() != NOERR) - cfven.zero(); + TString16 key; + + key.format("%s|%s", (const char *) clf.get(CLI_TIPOCF), + (const char *) clf.get(CLI_CODCF)); + + const TRectype & cfven = cache().get(LF_CFVEN, key); + num << (cfven.get_long("NUMESC")+1); } break; @@ -1582,117 +1567,6 @@ void TStampaEC_application::update_numec(const TRectype& clf, int sign) } } -/* Old mode -int TStampaEC_application::print_ec(TEC_Game_list* games) -{ - TWait_cursor hourglass; - - TEC_form& f = form(); - - const TRectype& clf = f.cursor()->curr(); - const TString16 lincf(clf.get(CLI_CODLIN)); - - bool ok = TRUE; - - // make controllations per lingua profilo/CF - if ((f.lingua() == _lingua_ditta && !lincf.empty()) || - f.lingua() != _lingua_ditta) - ok = lincf == f.lingua(); - - if (!ok) // Cliente analfabeta - return -1; - - f.azzera_totali(); // Azzera totali di fine pagina - - // Filtra solo le partite del cliente selezionato - TLocalisamfile partite(LF_PARTITE); - partite.zero(); - partite.put(PART_TIPOCF, clf.get(CLI_TIPOCF)); - partite.put(PART_SOTTOCONTO, clf.get(CLI_CODCF)); - const TRectype filter(partite.curr()); - - const bool stampa_chiuse = mask().get_bool(F_STAMPCHIU); - const TDate data_chiuse = mask().get(F_DATACHIU); - - TString status; - - bool one_printed = FALSE; // Non ho stampato ancora nulla - update_numec(clf, +1); // Incrementa contatore - - for (int err = partite.read(_isgteq); - err == NOERR && partite.curr() == filter; - err = partite.read(_isgreat)) - { - // Non fregare i clienti agli altri agenti! - if (games != NULL && !games->has_game(partite.curr())) - continue; - - TPartita game(partite.curr()); - - status.cut(0); - status << game.anno() << ' ' << game.numero(); - xvt_statbar_set(status); - do_events(); - - const TDate& dir = f.data_inizio_rischio(); - const TDate& dlo = f.data_limite_operazione(); - const TDate& dls = f.data_limite_scaduto(); - const TImporto saldo = game.calcola_saldo_al(f.in_valuta(), dlo, dls, dir); - if (saldo.is_zero()) - { - int r = 0; - if (stampa_chiuse) - { - for (r = game.last(); r > 0 ; r = game.pred(r)) - { - const TRiga_partite& riga = game.riga(r); - if (riga.is_fattura()) - { - const TDate dd(riga.get(PART_DATADOC)); - if (dd >= data_chiuse) - break; - } - } - } - if (r == 0) - continue; - } - - if (one_printed) - { - TPrintrow empty; // Salta una riga vuota - printer().print(empty); // (Non farlo alla fine di ogni partita!) - } - - const bool printed = form().print_game(game); - if (printed) - one_printed = TRUE; - - partite.put(PART_NRIGA, 9999); // Forza il posizionamento sull'ultima riga di partita - - if (printer().frozen()) - break; - } - - if (one_printed) - { - f.ultima_pagina(); - printer().formfeed(); - if (printer().isfax()) - { - const char* tipo = clf.get_char(CLI_TIPOCF) == 'C' ? "Clienti" : "Fornitori"; - const char* codice = clf.get(CLI_CODCF); - printer().send_fax(tipo, codice); - } - } - else - update_numec(clf, -1); - - xvt_statbar_set(NULL); - - return one_printed ? 1 : 0; -} -*/ // Nuovo modo con cursore int TStampaEC_application::print_ec(TEC_Game_list* games) @@ -1880,7 +1754,7 @@ TStampaEC_application::TStampaEC_application() int sc2100(int argc, char** argv) { TStampaEC_application app; - app.run(argc, argv, "Stampa Estratti Conto"); + app.run(argc, argv, TR("Stampa Estratti Conto")); return 0; } diff --git a/sc/sc2200.cpp b/sc/sc2200.cpp index d293d429b..4e7cb582e 100755 --- a/sc/sc2200.cpp +++ b/sc/sc2200.cpp @@ -35,8 +35,8 @@ struct _LinearTotal : public TObject // Oggetto base per gli elementi di tlg, t enum tipo_st {nessuno=0, tutti=1, clienti=2, fornitori=3, altri=4}; enum tipo_pe {daily, monthly, period, single, bank}; -const char * tipi_tab[10] = {"Altro","Rimesse dirette","Tratte","Ricevute bancarie","Cessioni","Paghero'", - "Lettere di acc.","Tratte accettate","Rapp. interb. dir.","Bonifici"} ; +const char * tipi_tab[10] = {TR("Altro"),TR("Rimesse dirette"),TR("Tratte"),TR("Ricevute bancarie"),TR("Cessioni"),TR("Paghero'"), + TR("Lettere di acc."),TR("Tratte accettate"),TR("Rapp. interb. dir."),TR("Bonifici")} ; class TStampaScadenzario : public TPrintapp { @@ -47,7 +47,7 @@ class TStampaScadenzario : public TPrintapp TSelection_ext_mask *_m; TPartita *_p; // Oggetto partita corrente. Viene ricaricato ad ogni cambio partita, // ovvero ogni volta che la rata corrente cambia i "connotati" - TLocalisamfile *_caus, *_partite, *_pagsca; // File delle causali, serve per reperire le descrizioni, nel caso non ci siano sul file parite + TLocalisamfile *_pagsca; TString _annopart,_datareg,_numdoc,_datadoc, // Anno partita (2 cifre), data registrazione, nr. documento, data doc. _protiva, _codval; // Numero di protocollo IVA (TString perche' se vale 0 non stampa nulla), e codice valuta TString _last_ban, _desc_ban; // Banca correntemente in corso di raggruppamento @@ -582,22 +582,14 @@ bool TStampaScadenzario::preprocess_page(int file, int counter) _codval = row.get(PART_CODVAL); //Per indicare che non e' indicata la valuta o e' LIRA (se la stampa in valuta is disabled) if (_codval.empty() || !_stvaluta) _codval = " "; - if (_descrizione->items() == 0) // Se sulla partita non c'e' descrizione - { // allora va leggerla sulla causale. - _caus->zero(); _caus->put(CAU_CODCAUS,row.get(PART_CODCAUS)); - if (_caus->read() == NOERR) - *_descrizione = _caus->get(CAU_DESCR); - } + if (_descrizione->items() == 0) // Se sulla partita non c'e' descrizione allora va leggerla sulla causale. + *_descrizione = cache().get(LF_CAUSALI, row.get(PART_CODCAUS), CAU_DESCR); } calcola_pagamenti(imp_scad,nrigap,nratap, bill); // Se la rata e' stata saldata e non e' abilitato il flag di stampa // oppure l'importo in scadenza e' 0 allora salta alla prossima scadenza - /* - if (_w_imp_res == 0.0 && !_ratesald || imp_scad == 0.0) - return FALSE; // - */ if (!_ratesald && _w_imp_res == 0.0) return FALSE; @@ -842,8 +834,8 @@ bool TStampaScadenzario::user_create() _rel3->lfile().set_curr(new TScadenza_rec); _cur7 = add_cursor(new TCursor(_rel3,"",2)); - _caus = new TLocalisamfile(LF_CAUSALI); - _partite = new TLocalisamfile(LF_PARTITE); + open_files(LF_TABCOM, LF_TAB, LF_CAUSALI, LF_PARTITE, LF_PAGSCA, 0); + _pagsca = new TLocalisamfile(LF_PAGSCA); _descrizione = new TParagraph_string("",17); _ragsoc = new TParagraph_string("",17); @@ -878,10 +870,6 @@ bool TStampaScadenzario::user_destroy() if (_rel1) delete _rel1; if (_rel2) delete _rel2; if (_rel3) delete _rel3; - if (_caus) - delete _caus; - if (_partite) - delete _partite; if (_pagsca) delete _pagsca; if (_descrizione) @@ -1096,17 +1084,12 @@ void TStampaScadenzario::print_header() // Setta le righe dell'intestazione { int soh = 1; - const long firm = get_firm(); - - reset_header (); - TLocalisamfile ditte(LF_NDITTE); - ditte.zero(); - ditte.put(NDT_CODDITTA, firm); - ditte.read(); - if (ditte.bad()) ditte.zero(); + const long firm = get_firm(); + const TRectype & ditta = cache().get(LF_NDITTE, firm); + reset_header (); TString s; - s = ditte.get(NDT_RAGSOC); + s = ditta.get(NDT_RAGSOC); TString data = _datas.string(); TString datai = _datai.string(); TString dataf = _dataf.string(); @@ -1124,60 +1107,60 @@ void TStampaScadenzario::print_header() if (_tipost==fornitori) { - set_header(soh++,"@72g** SCADENZARIO FORNITORI **"); + set_header(soh++,FR("@72g** SCADENZARIO FORNITORI **")); s1 = "Ns."; s2 = "Banca"; } else { - set_header(soh++,"@73g** SCADENZARIO CLIENTI **"); + set_header(soh++,FR("@73g** SCADENZARIO CLIENTI **")); s1 =""; s2 = ""; } - set_header (soh++,"@64gPer il periodo dal %s al %s",(const char*)datai,(const char*)dataf); + set_header (soh++,FR("@64gPer il periodo dal %s al %s"),(const char*)datai,(const char*)dataf); if (_codag.not_empty()) - set_header (soh++,"@bAgente: %s %s@r",(const char*)_codag,(const char*)_m->get(F_CODAG_D)); + set_header (soh++,FR("@bAgente: %s %s@r"),(const char*)_codag,(const char*)_m->get(F_CODAG_D)); if (_tipopag != 0) { TList_field& fld_tipopag = (TList_field&) _m->field(F_TIPOPAG); TToken_string& pagam = (TToken_string) fld_tipopag.get_values(); - set_header (soh++,"@bTipo pagamento: %d %s@r",_tipopag, (const char*)pagam.get(_tipopag)); + set_header (soh++,FR("@bTipo pagamento: %d %s@r"),_tipopag, (const char*)pagam.get(_tipopag)); } rw.fill('_'); set_header(soh++, (const char *) rw); - set_header(soh++,"@28gRif.@38gData@47gData@77gCd/Tp@91g%s",(const char*)s1); - set_header(soh++,"Codice@9gRagione sociale@28gpartita@38gscadenza@47gRegistr." - "@56gDescrizione@77gPag.@86gRata@91g%s@97gVal." - "@106gImp. in sca.@125gImp. pagati@144gRimesse dir.@163gRi.ba./Tratte@182gAltri",(const char*)s2); - set_header(soh++,"@28gData e Nr doc. @46gProt. IVA"); + set_header(soh++,FR("@28gRif.@38gData@47gData@77gCd/Tp@91g%s"),(const char*)s1); + set_header(soh++,FR("Codice@9gRagione sociale@28gpartita@38gscadenza@47gRegistr." + "@56gDescrizione@77gPag.@86gRata@91g%s@97gVal." + "@106gImp. in sca.@125gImp. pagati@144gRimesse dir.@163gRi.ba./Tratte@182gAltri"), (const char*)s2); + set_header(soh++,FR("@28gData e Nr doc. @46gProt. IVA")); set_header(soh++,(const char *)rw); break; } case altri: // Piano dei conti { TString rw(201); - set_header (soh++, "Ditta : %ld %s@152gData@157g%s @190gPag. @#", + set_header (soh++, FR("Ditta : %ld %s@152gData@157g%s @190gPag. @#"), firm, (const char *)s, (const char *)data); - set_header(soh++,"@79g** SCADENZARIO **"); - set_header (soh++,"@66gPer il periodo dal %s al %s",(const char*)datai,(const char*)dataf); + set_header(soh++,FR("@79g** SCADENZARIO **")); + set_header (soh++,FR("@66gPer il periodo dal %s al %s"),(const char*)datai,(const char*)dataf); if (_codag.not_empty()) - set_header (soh++,"@bAgente: %s %s@r",(const char*)_codag,(const char*)_m->get(F_CODAG_D)); + set_header (soh++,FR("@bAgente: %s %s@r"),(const char*)_codag,(const char*)_m->get(F_CODAG_D)); if (_tipopag != 0) { TList_field& fld_tipopag = (TList_field&) _m->field(F_TIPOPAG); TToken_string& pagam = (TToken_string) fld_tipopag.get_values(); - set_header (soh++,"@bTipo pagamento: %d %s@r",_tipopag, (const char*)pagam.get(_tipopag)); + set_header (soh++,FR("@bTipo pagamento: %d %s@r"),_tipopag, (const char*)pagam.get(_tipopag)); } rw.fill('_'); set_header(soh++, (const char *) rw); - set_header(soh++,"@33gRif.@43gData@53gData@82gCd/Tp"); - set_header(soh++,"Gr. Co. So.@16gDescrizione@33gpartita@43gscadenza@53gRegistr." + set_header(soh++,FR("@33gRif.@43gData@53gData@82gCd/Tp")); + set_header(soh++,FR("Gr. Co. So.@16gDescrizione@33gpartita@43gscadenza@53gRegistr." "@61gDescrizione@82gPag.@89gRata@97gVal." - "@106gImp. in sca.@125gImp. pagati@144gRimesse dir.@163gRi.ba./Tratte@182gAltri"); + "@106gImp. in sca.@125gImp. pagati@144gRimesse dir.@163gRi.ba./Tratte@182gAltri")); - set_header(soh++,"@36gData e Nr doc. @54gProt. IVA"); + set_header(soh++,FR("@36gData e Nr doc. @54gProt. IVA")); set_header(soh++,(const char *)rw); break; @@ -1323,7 +1306,7 @@ void TStampaScadenzario::print_riepilogo(int &nriga, bool type) } } else { - set_row(nriga,"!@5gTotali dal %s al ",_datai.string(brief)); + set_row(nriga,FR("!@5gTotali dal %s al "),_datai.string(brief)); set_row(nriga++,"%s@82g!",_dataf.string(brief)); set_row(nriga++,"%s",(const char *)s); } @@ -1348,8 +1331,8 @@ void TStampaScadenzario::print_riepilogo(int &nriga, bool type) } else { - if (val.blank()) val = "LIT"; - set_row(nriga++,"! Partite pareggiate in %s. @82g!",(const char*) val); + if (val.blank()) val = "EUR"; + set_row(nriga++,FR("! Partite pareggiate in %s. @82g!"),(const char*) val); } } set_row(nriga++,"%s",(const char *)s); @@ -1422,11 +1405,11 @@ void TStampaScadenzario::print_totali(int &nriga, bool month_changed, bool ended // Setta le righe per stampare i totali (giorno e mese) delle scadenze clienti/fornitori // Ordinamento primario per data! { - set_row(nriga,"@36g** TOTALI DEL @51g%s",_cur_data.string(brief)); + set_row(nriga,FR("@36g** TOTALI DEL @51g%s"),_cur_data.string(brief)); print_rows_totali(nriga, daily); if (month_changed) { - set_row(nriga,"@36g** TOTALI DI @51g%s",itom(_cur_data.month())); + set_row(nriga,FR("@36g** TOTALI DI @51g%s"),itom(_cur_data.month())); print_rows_totali(nriga, monthly); if (_striepilogo) print_riepilogo(nriga,FALSE); } @@ -1438,7 +1421,7 @@ void TStampaScadenzario::print_totali(int &nriga, bool month_changed, bool ended set_row(nriga++,""); } set_row(nriga++,""); - set_row(nriga,"@36g** TOTALI PERIODO"); + set_row(nriga,FR("@36g** TOTALI PERIODO")); print_rows_totali(nriga, period); if (_striepilogo) print_riepilogo(nriga,TRUE); set_row(nriga++,"");set_row(nriga++,""); @@ -1451,12 +1434,12 @@ void TStampaScadenzario::print_totali_c(int &nriga, bool ended) // Ordinamento primario per codice o ragione sociale! { if (_tipost==clienti) - set_row(nriga,"@70g** TOTALE CLIENTE"); + set_row(nriga,FR("@70g** TOTALE CLIENTE")); else if (_tipost ==fornitori) - set_row(nriga,"@70g** TOTALE FORNITORE"); + set_row(nriga,FR("@70g** TOTALE FORNITORE")); else // altri... - set_row(nriga,"@70g** TOTALE CONTO"); + set_row(nriga,FR("@70g** TOTALE CONTO")); print_rows_totali(nriga, single); if (_striepilogo) print_riepilogo(nriga,FALSE); if (ended) @@ -1466,7 +1449,7 @@ void TStampaScadenzario::print_totali_c(int &nriga, bool ended) print_totali_bank(nriga); set_row(nriga++,"");set_row(nriga++,""); } - set_row(nriga,"@70g** TOTALE GENERALE"); + set_row(nriga,FR("@70g** TOTALE GENERALE")); print_rows_totali(nriga, period); if (_striepilogo) print_riepilogo(nriga,TRUE); set_row(nriga++,"");set_row(nriga++,""); @@ -1480,9 +1463,9 @@ void TStampaScadenzario::print_totali_bank(int &nriga) { set_row(nriga++, ""); if (_ordata) - set_row(nriga,"@36g** TOTALI BANCA"); + set_row(nriga,FR("@36g** TOTALI BANCA")); else - set_row(nriga,"@70g** TOTALE BANCA"); + set_row(nriga,FR("@70g** TOTALE BANCA")); print_rows_totali(nriga, bank); _totbank_printed = TRUE; } @@ -1506,7 +1489,7 @@ void TStampaScadenzario::print_intestazione_banca(int &nriga) _desc_ban << " - " << cache().get("%BAN", _last_ban, "S0"); } else - _desc_ban = "NON INDICATA"; + _desc_ban = FR("NON INDICATA"); _last_bank_rec = current_cursor()->pos(); print_bank = TRUE; } @@ -1522,7 +1505,7 @@ void TStampaScadenzario::print_intestazione_banca(int &nriga) print_totali_bank(nriga); set_row(nriga++, ""); - set_row(nriga++, "@bBANCA DI PRESENTAZIONE %s@r", (const char*)_desc_ban); + set_row(nriga++, FR("@bBANCA DI PRESENTAZIONE %s@r"), (const char*)_desc_ban); set_row(nriga++, ""); } } @@ -1536,6 +1519,6 @@ TStampaScadenzario::TStampaScadenzario() int sc2200(int argc, char** argv) { TStampaScadenzario app; - app.run(argc, argv, "Stampa Scadenzario"); + app.run(argc, argv, FR("Stampa Scadenzario")); return 0; } diff --git a/sc/sc2201.cpp b/sc/sc2201.cpp index d2a532e19..2b05e4dac 100755 --- a/sc/sc2201.cpp +++ b/sc/sc2201.cpp @@ -7,6 +7,7 @@ #endif #include +#include #include "sc2201.h" @@ -24,9 +25,9 @@ TSelection_ext_mask::TSelection_ext_mask(const char* name) : TSelection_mask(nam _pcon_sh_k1 = new TCursor_sheet(_pcon_cur_k1, " |GRUPPO|CONTO|SOTTOCONTO|DESCR", "Selezione conti per gruppo/conto/sottoconto", - "@1|Gruppo|Conto|Sottoconto|Descrizione@50",0,1); + HR("@1|Gruppo|Conto|Sottoconto|Descrizione@50"),0,1); _pcon_sh_k2 = new TCursor_sheet(_pcon_cur_k2, " |DESCR|GRUPPO|CONTO|SOTTOCONTO", "Selezione conti per descrizione", - "@1|Descrizione@50|Gruppo|Conto|Sottoconto",0,1); + HR("@1|Descrizione@50|Gruppo|Conto|Sottoconto"),0,1); set_handler(SC_CLIFO, rpcon_handler); // Redefined handler... set_handler(SC_SORTCF, rsortpcon_handler); // Redefined handler... diff --git a/sc/sc2300.cpp b/sc/sc2300.cpp index f4147d52f..5e386a487 100755 --- a/sc/sc2300.cpp +++ b/sc/sc2300.cpp @@ -44,7 +44,6 @@ class TStampaScaduto : public TPrintapp TSelection_ext_mask *_m; - TLocalisamfile *_scad,*_pagsca; tipo_st _tipost; // Tipo di stampa impostato bool _end_printed, _stvaluta, @@ -258,8 +257,6 @@ void TStampaScaduto::compute_all(TPartita& p, TBill& bill) real gap = (res_pagati > res ? res : res_pagati); res -= gap; res_pagati -= gap; -/* res -= res_pagati; - res_pagati = ZERO; */ // Guy farebbe cosė } if (d <= _limscad && d >= (TDate&)_s_date[0]) s1 += res; @@ -369,7 +366,7 @@ bool TStampaScaduto::preprocess_page(int file, int counter) TAssoc_array& gen_tot = (TAssoc_array&) _t[1]; if (gen_tot.items() > 0) { - set_row(nriga,"TOTALE GENERALE"); + set_row(nriga,TR("TOTALE GENERALE")); print_totali_rows(nriga,1); } return TRUE; // Go back, print and exit! @@ -461,20 +458,18 @@ print_action TStampaScaduto::postprocess_page(int file, int counter) bool TStampaScaduto::user_create() { + open_files(LF_TAB, LF_TABCOM, LF_NDITTE, LF_PARTITE, LF_SCADENZE, LF_PAGSCA, 0); + _rel1 = new TRelation(LF_PARTITE); _rel1->add(LF_CLIFO,"TIPOCF=TIPOC|CODCF=SOTTOCONTO",1); -// _cur1 = add_cursor(new TSorted_cursor(_rel1,"SOTTOCONTO|ANNO|NUMPART","",1)); _cur1 = add_cursor(new TCursor(_rel1)); _cur2 = add_cursor(new TSorted_cursor(_rel1,"UPPER(20->RAGSOC)|ANNO|NUMPART","",1)); _rel2 = new TRelation(LF_PARTITE); _rel2->add(LF_PCON,"GRUPPO=GRUPPO|CONTO=CONTO|SOTTOCONTO=SOTTOCONTO",1); -// _cur3 = add_cursor(new TSorted_cursor(_rel2,"GRUPPO|CONTO|SOTTOCONTO|ANNO|NUMPART","",1)); _cur3 = add_cursor(new TCursor(_rel2)); _cur4 = add_cursor(new TSorted_cursor(_rel2,"UPPER(19->DESCR)|ANNO|NUMPART","",1)); - _scad = new TLocalisamfile(LF_SCADENZE); - _pagsca = new TLocalisamfile(LF_PAGSCA); _t.add(new TAssoc_array);_t.add(new TAssoc_array); for (int i = 0; i < 6; i++) _s_date.add(new TDate); @@ -491,8 +486,6 @@ bool TStampaScaduto::user_destroy() { if (_rel1) delete _rel1; if (_rel2) delete _rel2; - if (_scad) delete _scad; - if (_pagsca) delete _pagsca; if (_m) delete _m; _t.destroy(); _s_date.destroy(); @@ -667,7 +660,7 @@ void TStampaScaduto::print_totali(int& nriga) reset_row(nriga); set_row(nriga++,""); reset_row(nriga); - set_row(nriga,"TOTALE %s",(const char*) s); + set_row(nriga,FR("TOTALE %s"),(const char*) s); print_totali_rows(nriga,0); set_row(++nriga,""); nriga++; @@ -677,23 +670,20 @@ void TStampaScaduto::print_header() // Setta le righe dell'intestazione { int soh = 1; - const long firm = get_firm(); TString rw(230); + const long firm = get_firm(); reset_header (); - TLocalisamfile ditte(LF_NDITTE); - ditte.zero(); - ditte.put(NDT_CODDITTA, firm); - ditte.read(); - if (ditte.bad()) ditte.zero(); + const TRectype & ditta = cache().get(LF_NDITTE, firm); + TString s; - s = ditte.get(NDT_RAGSOC); + s = ditta.get(NDT_RAGSOC); TString datas = _datas.string(); TString limop = _limop.string(); TString limscad = _limscad.string(); - set_header (soh++, "Ditta : %ld %s@158gData@163g%s @190gPag. @#", + set_header (soh++, FR("Ditta : %ld %s@158gData@163g%s @190gPag. @#"), firm, (const char *)s, (const char *)datas); switch (_tipost) @@ -705,25 +695,25 @@ void TStampaScaduto::print_header() int o = 0; // Offset per scaglioni. if (_tipost==fornitori) { - set_header(soh++,"@72g** SCADUTO FORNITORI **"); + set_header(soh++,FR("@72g** SCADUTO FORNITORI **")); s1 = ""; s2 = scaglioni[7]; // +90 gg per fornitori s3 = scaglioni[8]; // +120 gg per fornitori } else { - set_header(soh++,"@73g** SCADUTO CLIENTI **"); - s1 ="In Attesa B.F."; s2 = ""; s3 = ""; + set_header(soh++,FR("@73g** SCADUTO CLIENTI **")); + s1 =TR("In Attesa B.F."); s2 = ""; s3 = ""; o = 4; } - set_header (soh++,"@73gAl %s Operazioni al %s",(const char*)limscad, (const char*)limop); + set_header (soh++,FR("@73gAl %s Operazioni al %s"),(const char*)limscad, (const char*)limop); rw.fill('-'); set_header(soh++, (const char *) rw); - set_header(soh++,"CODICE@18gC O G N O M E E N O M E "); - set_header(soh++,"Riferim.@12gNumero@20gNumero@27gData@50gResiduo@102g" + set_header(soh++,FR("CODICE@18gC O G N O M E E N O M E ")); + set_header(soh++,FR("Riferim.@12gNumero@20gNumero@27gData@50gResiduo@102g" "-------------------------------------------------------- S C A D U T O " - "-------------------------------------------------------"); - set_header(soh++,"partita@12gDocum.@20gProt.@27gDocumento@38gValuta" - "@50gDocumento@67gNon Scaduto@86g%s@112g%s@129g%s@148g%s@167g%s@185g%s@204g%s@223g%s", + "-------------------------------------------------------")); + set_header(soh++,FR("partita@12gDocum.@20gProt.@27gDocumento@38gValuta" + "@50gDocumento@67gNon Scaduto@86g%s@112g%s@129g%s@148g%s@167g%s@185g%s@204g%s@223g%s"), (const char*)s1,scaglioni[0],scaglioni[1+o],scaglioni[2+o], scaglioni[3+o],scaglioni[4+o],(const char*) s2, (const char*) s3); set_header(soh++,(const char *)rw); @@ -731,16 +721,15 @@ void TStampaScaduto::print_header() } case altri: // Piano dei conti { - set_header(soh++,"@79g** SCADUTO **"); - set_header (soh++,"@73gAl %s Operazioni al %s",(const char*)limscad, (const char*)limop); -// set_header (soh++,"@79gAl %s",(const char*)limop); + set_header(soh++,FR("@79g** SCADUTO **")); + set_header (soh++,FR("@73gAl %s Operazioni al %s"),(const char*)limscad, (const char*)limop); rw.fill('-'); set_header(soh++, (const char *) rw); - set_header(soh++,"CONTO@18gD E S C R I Z I O N E"); - set_header(soh++,"Riferim.@12gNumero@20gNumero@27gData@50gResiduo@102g" - "-------------------------- S C A D U T O -------------------------"); - set_header(soh++,"partita@12gDocum.@20gProt.@27gDocumento@38gValuta" - "@50gDocumento@67gNon Scaduto@112g%s@129g%s@148g%s@167g%s@185g%s", + set_header(soh++,FR("CONTO@18gD E S C R I Z I O N E")); + set_header(soh++,FR("Riferim.@12gNumero@20gNumero@27gData@50gResiduo@102g" + "-------------------------- S C A D U T O -------------------------")); + set_header(soh++,FR("partita@12gDocum.@20gProt.@27gDocumento@38gValuta" + "@50gDocumento@67gNon Scaduto@112g%s@129g%s@148g%s@167g%s@185g%s"), scaglioni[0],scaglioni[5],scaglioni[6], scaglioni[7],scaglioni[8]); set_header(soh++,(const char *)rw); @@ -790,6 +779,6 @@ TStampaScaduto::TStampaScaduto() int sc2300(int argc, char** argv) { TStampaScaduto app; - app.run(argc, argv, "Stampa Scaduto"); + app.run(argc, argv, TR("Stampa Scaduto")); return 0; } diff --git a/sc/sc2400.cpp b/sc/sc2400.cpp index d29d573b3..39da68c80 100755 --- a/sc/sc2400.cpp +++ b/sc/sc2400.cpp @@ -82,10 +82,9 @@ bool TStampaSol_application::print_selected() } printer().close(); - if (analfabeti > 0) { - warning_box("%ld clienti non sono stati stampati in quanto " - "il codice lingua non corrispondeva al profilo di stampa", analfabeti); - } + if (analfabeti > 0) + warning_box(FR("%ld clienti non sono stati stampati in quanto " + "il codice lingua non corrispondeva al profilo di stampa"), analfabeti); return TRUE; } @@ -141,24 +140,7 @@ int TStampaSol_application::print_sol() TImporto unreferenced; //Totale non assegnati per questa partita. { - // Tutto questo ha senso se e solo se la partita e' espressa in un'unica valuta. - /* Questo e' il vecchio modo di calcolare i non assegnati. - TString valuta; - TRecord_array& unassigned = game.unassigned(); - for (int r = unassigned.last_row(); r > 0; r = unassigned.pred_row(r)) - { - const TRectype& rec = unassigned.row(r); - const TRiga_partite& sum = game.riga(rec.get_int(PAGSCA_NRIGP)); - const char * field = (sum.in_valuta() && f.in_valuta() ? PAGSCA_IMPORTOVAL : PAGSCA_IMPORTO); - if (valuta.empty()) valuta = sum.get(PART_CODVAL); - if (sum.get_date(PART_DATAPAG)<=data_limite_soll) - { - TImporto r(sum.sezione(),rec.get_real(field)); - unreferenced += r; - } - } - */ - // E' piu' giusto calcolare il saldo, comprendente i non assegnati. + // E' giusto calcolare il saldo, comprendente i non assegnati. // se il saldo della partita chiude in avere va sommato ad unreferenced const TRiga_partite& sum = game.riga(game.first()); unreferenced = game.calcola_saldo_al(game.in_valuta() && f.in_valuta(),data_limite_soll, data_limite_scad, data_limite_scad); @@ -230,7 +212,7 @@ void TStampaSol_application::main_loop() const TDate dlimsol(m.get(F_DATALIMSOL)); const TDate dsped(m.get(F_DATASEND)); if (dlimsol > dsped) - error_box("La data limite sollecito deve essere specificata e non puo' essere superiore alla data di invio"); + error_box(TR("La data limite sollecito deve essere specificata e non puo' essere superiore alla data di invio")); else { _form= new TSol_form(m, _gesval, F_DATALIMOP, F_DATALIMSOL); @@ -246,6 +228,6 @@ TStampaSol_application::TStampaSol_application(): _lingua_ditta(1), _msk(NULL), int sc2400(int argc, char** argv) { TStampaSol_application app; - app.run(argc, argv, "Stampa solleciti"); + app.run(argc, argv, TR("Stampa solleciti")); return 0; } diff --git a/sc/sc2401.cpp b/sc/sc2401.cpp index 150a7c3c1..c9f53f604 100755 --- a/sc/sc2401.cpp +++ b/sc/sc2401.cpp @@ -165,36 +165,6 @@ void TESSL_row::reset_uguali() void TESSL_row::set_imp(TForm_item& fi, const real& imp, const char* cod_val) const { -/* - TString old_picture(20); - if (valuta) - { - old_picture = fi.picture(); - - TString new_picture(20); - - if (old_picture.empty()) - { - new_picture = valuta ? ".3" : "."; - } - else - { - new_picture = old_picture; - if (old_picture.find(',') > 0) - new_picture << ".@@@"; - else - new_picture << ",@@@"; - } - const int w = fi.width(); - int exceed = w - new_picture.len(); - if (exceed<0 && w>0) - { - exceed=::abs(exceed); - new_picture = new_picture.mid(exceed,new_picture.len()-exceed); - } - fi.set_picture(new_picture); - } -*/ fi.set(imp.string()); } @@ -247,13 +217,10 @@ void TESSL_row::print_on(TPrint_section& body) TForm_item& datapag = body.find_field(PEC_DATAPAG); datapag.set(_data.string()); - //TString_array old_pictures; const real& imp = _importo.valore(); TForm_item& dare = body.find_field(PEC_DARE); TForm_item& avere = body.find_field(PEC_AVERE); - //old_pictures.add(dare.picture()); - //old_pictures.add(avere.picture()); if (_importo.sezione() == 'D') { set_imp(dare, imp, cod_valuta); @@ -266,15 +233,12 @@ void TESSL_row::print_on(TPrint_section& body) } TForm_item& importo_in_lire = body.find_field(PEC_IMPEURO); - //importo_in_lire.set(_importo_lire.string()); set_imp(importo_in_lire, _importo_lire, ""); // In generale va espresso nella valuta della ditta TForm_item& scaduto = body.find_field(PEC_SCADUTO); - //old_pictures.add(scaduto.picture()); set_imp(scaduto, _scaduto, cod_valuta); TForm_item& esposto = body.find_field(PEC_ESPOSTO); - //old_pictures.add(esposto.picture()); set_imp(esposto, _esposto, cod_valuta); esposto.set_prompt(_salvo_buon_fine ? "*" : " "); @@ -513,23 +477,9 @@ void TESSL_array::add_row(const TRiga_partite& row) bool sbf = FALSE; TImporto esposto(row.esposto(in_valuta, dls, dir, sbf)); bool esp = !esposto.is_zero(); -/* - if (gr > 0) - { - const TDate& dir = form().data_inizio_rischio(); - sbf = data_pag > dir && data_pag <= dls; - riga.salvo_buon_fine(sbf); // Esposto salvo buon fine - } - - bool esp = sbf; - if (!esp) - { - esp = gr > 0 ? data_pag >= dls : data_pag > dls; // Esposto normale - } -*/ + if (esp) { -// TImporto esposto(imp); esposto.normalize(sezione); riga.salvo_buon_fine(sbf); // Esposto salvo buon fine riga.esposto(esposto.valore()); @@ -792,42 +742,6 @@ void TESSL_form::change_magic_footer(const THash_object& o, TString& s) } } -/* -void TESSL_form::modify_picture(TForm_item& fi, TString_array& op, const bool in_valuta) -{ - TString pic(20); - pic = fi.picture(); - op.add(pic); - const int w = fi.width(); - if (in_valuta && _in_valuta) - { - if (pic.find(',') > 0) - pic << ".###"; - else - pic << ",@@@"; - int exceed = w - pic.len(); - if (exceed<0 && w>0) - { - exceed=::abs(exceed); - pic = pic.mid(exceed,pic.len()-exceed); - } - } - // oltre a cio' deve correggere la picture, in modo che tutti gli importi del - // footer risultino incolonnati correttamente. - // (nel body cio' e' fatto in TForm_number::put_paragraph()) - const int l = pic.len(); - if (w>l) - { - int gap = w-l; - TString stmp(gap); // cosi' mette gli spazi necessari davanti alla picture - stmp.fill(' '); // in modo da colmare il vuoto - pic.insert(stmp); - } - - fi.set_picture(pic); -} -*/ - void TESSL_form::print_total(int riga, const THash_object& o) { const short MAXID = 5; @@ -948,17 +862,6 @@ void TESSL_form::print_total(int riga, const THash_object& o) desc_field.set_prompt(*p); } } -/* - if (old_pictures.items() > 0)//restore old pictures - { - dare.set_picture(old_pictures.row(0)); - avere.set_picture(old_pictures.row(1)); - scaduto.set_picture(old_pictures.row(2)); - esposto.set_picture(old_pictures.row(3)); - implire.set_picture(old_pictures.row(4)); - unreferenced.set_picture(old_pictures.row(5)); - } -*/ for (word r = 0; r < _total_rows; r++) printer().setfooterline(riga + r, foot.row(r)); } @@ -1113,14 +1016,13 @@ void TESSL_form::init_header(const TMask& m) TForm_item& fi = head.find_field(PEC_MEMO); if (fi.shown()) { - TLocalisamfile f(LF_RFORM); - f.put("TIPOPROF", name()); - f.put("CODPROF", code()); - f.put("SEZ", "H0"); - f.put("ID", PEC_MEMO); - const int err = f.read(); - if (err == NOERR) - fi.set(f.get("TESTO")); + TString key; + + key.format("%s|%s|H0|%d", (const char *) name(), (const char *) code(), PEC_MEMO); + + const TRectype & rform = cache().get(LF_RFORM, key); + if (!rform.empty()) + fi.set(rform.get("TESTO")); } } diff --git a/sc/sc2500.cpp b/sc/sc2500.cpp index 585de992f..540a47928 100755 --- a/sc/sc2500.cpp +++ b/sc/sc2500.cpp @@ -189,7 +189,7 @@ void TConfronta_mask::show_progress(long pos, long tot) const int perc = int((pos+1) * 100L / tot); if (perc != _last_perc) { - TString80 str; str.format("%d%% completato", perc); + TString80 str; str.format(FR("%d%% completato"), perc); xvt_statbar_set(str); _last_perc = perc; do_events(); @@ -204,23 +204,20 @@ void TConfronta_mask::fill_browse() w.destroy_lines(); //crea la nuova intestazione TString intestazione; - TString ragsoc(50); - TLocalisamfile nditte(LF_NDITTE); - nditte.zero(); - nditte.put(NDT_CODDITTA, main_app().get_firm()); - if (nditte.read() == NOERR) - ragsoc = nditte.get(NDT_RAGSOC); - intestazione << "@bDitta " << main_app().get_firm(); + const long firm = main_app().get_firm(); + const TString & ragsoc = cache().get(LF_NDITTE, firm, NDT_RAGSOC); + + intestazione << FR("@bDitta ") << firm; intestazione << " " << ragsoc; intestazione.rpad(97); TDate oggi(TODAY); intestazione << oggi; b.add_line(intestazione); - b.add_line("@bSTAMPA CONTROLLO SALDI"); + b.add_line(FR("@bSTAMPA CONTROLLO SALDI")); b.add_line("@b_________________________________________________________________________________________________________"); b.add_line(""); - b.add_line("@bGrp Cnt Sottoc Descrizione Saldo Contabile Saldo Partite Sbilancio"); + b.add_line(FR("@bGrp Cnt Sottoc Descrizione Saldo Contabile Saldo Partite Sbilancio")); b.add_line("@b_________________________________________________________________________________________________________"); b.add_line(""); @@ -231,7 +228,7 @@ void TConfronta_mask::fill_browse() const char tipoc = get(F_TIPOC)[0]; _running = TRUE; - xvt_statbar_set("Inizializzazione..."); + xvt_statbar_set(TR("Inizializzazione...")); _last_perc = -1; do_events(); @@ -410,6 +407,6 @@ int sc2500(int argc, char** argv) { TConfronta_saldi app; - app.run(argc, argv, "Stampa controllo saldi"); + app.run(argc, argv, TR("Stampa controllo saldi")); return 0; } \ No newline at end of file diff --git a/sc/sc3100.cpp b/sc/sc3100.cpp index e84c6d022..8c2de9b81 100755 --- a/sc/sc3100.cpp +++ b/sc/sc3100.cpp @@ -216,7 +216,7 @@ bool TForm_EC_editor::cpy_handler(TMask_field& f, KEY k) frm.put("TIPOPROF",form);frm.put("CODPROF",dcod); if (frm.read()==NOERR) { - error_box("Il profilo specificato come destinazione e' gia' esistente."); + error_box(TR("Il profilo specificato come destinazione e' gia' esistente.")); continue; } //Effettua la copia dei record. @@ -237,10 +237,10 @@ bool TForm_EC_editor::cpy_handler(TMask_field& f, KEY k) frm.rewrite(); if (frm.status() != NOERR) { - error_box("Errore %d in scrittura testata profilo.",frm.status()); + error_box(FR("Errore %d in scrittura testata profilo."),frm.status()); break; } - TProgind pi(50,"Copia in corso...",FALSE,FALSE,10); + TProgind pi(50,FR("Copia in corso..."),FALSE,FALSE); rfr.zero();rfr.put("TIPOPROF",form); rfr.put("CODPROF",scod); //Profilo sorgente rfr.read(_isgteq); @@ -255,12 +255,12 @@ bool TForm_EC_editor::cpy_handler(TMask_field& f, KEY k) pi.cancel(); if (rfr_to_write.status() != NOERR) { - error_box("Errore %d in scrittura righe profilo.",rfr_to_write.status()); + error_box(FR("Errore %d in scrittura righe profilo."),rfr_to_write.status()); break ; } break; } else - error_box("Non esiste il profilo sorgente specificato."); + error_box(TR("Non esiste il profilo sorgente specificato.")); } } return TRUE; @@ -366,7 +366,7 @@ bool TForm_EC_editor::load_fonts() TList_field& lst = (TList_field&)_msk->field(F_SFONT); if (!font_found) { - warning_box("Il font %s non esiste per la stampante di default.",(const char*) form().fontname()); + warning_box(FR("Il font %s non esiste per la stampante di default."),(const char*) form().fontname()); pn1.add(form().fontname()); pn2.add(form().fontname()); } @@ -634,7 +634,7 @@ bool TForm_EC_editor::edit(char s, pagetype p) font_changed = TRUE; TString ff(_msk->get(F_SFONT)); int ss=_msk->get_int(F_SSIZE); - if (font_found && yesno_box("E' stato cambiato il font o la dimensione del carattere\ndevo aggiornare le coordinate dei campi")) + if (font_found && yesno_box(TR("E' stato cambiato il font o la dimensione del carattere\ndevo aggiornare le coordinate dei campi"))) dirty = recalculate_positions(ff, ss); // Va bene dirty e non local_dirty form().fontname() = ff; form().fontsize() = ss; @@ -651,9 +651,9 @@ bool TForm_EC_editor::edit(char s, pagetype p) local_dirty = TRUE; if (!form().exist(s, odd_page)) { - const KEY k = yesnocancel_box("La sezione %s non esiste:\n" - "si desidera generarla?", - (const char*)caption); + const KEY k = yesnocancel_box(FR("La sezione %s non esiste:\n" + "si desidera generarla?"), + (const char*)caption); if (k == K_ESC) local_dirty = FALSE; else @@ -720,7 +720,7 @@ bool TForm_EC_editor::edit(char s, pagetype p) form().set_dirty(); if (!dirty) dirty = TRUE; } - if ((dirty && k==K_ESC && yesno_box("Salvare le modifiche?")) || (dirty && k==K_ENTER)) + if ((dirty && k==K_ESC && yesno_box(TR("Salvare le modifiche?"))) || (dirty && k==K_ENTER)) { // Se si preme annulla e sono state effettuate modifiche chiede la conferma per salvare // Se invece si preme conferma e sono state effettuate modifiche non chiede la conferma if (form().code().empty()) @@ -864,7 +864,7 @@ bool TForm_EC_editor::ask_profile() cod.format("%04ld%c",fcode,flng); if (!extra() && fcode == 0 && flng=='\0') { - error_box("Non e' possibile modificare il profilo standard."); + error_box(TR("Non e' possibile modificare il profilo standard.")); continue; } if (k == K_ENTER) @@ -890,9 +890,9 @@ bool TForm_EC_editor::ask_profile() else if (k == K_DEL) { if (fcode != 0 && - yesno_box("Confermare la cancellazione del profilo %04ld%c", fcode,flng)) + yesno_box(FR("Confermare la cancellazione del profilo %04ld%c"), fcode,flng)) { - TProgind pi(50,"Cancellazione in corso...",FALSE,FALSE,10); + TProgind pi(50,TR("Cancellazione in corso..."),FALSE,FALSE); remove_form(frm,rfr,fform,cod); pi.cancel(); mask().set(F_BASE,BASE_EC_PROFILE); @@ -975,6 +975,6 @@ bool TForm_EC_editor::check_mailbox(TMask& m) int sc3100(int argc, char** argv) { TForm_EC_editor a; - a.run(argc, argv, "Parametrizzazione profili EC"); + a.run(argc, argv, TR("Parametrizzazione profili EC")); return 0; }