diff --git a/ab/ab0.cpp b/ab/ab0.cpp index 4a7a19f39..24c5a36bd 100755 --- a/ab/ab0.cpp +++ b/ab/ab0.cpp @@ -3,7 +3,7 @@ #include "ab0.h" -#define usage "Error - usage : %s -{0|1|2|3|4|5}" +#define usage "Error - usage : %s -{0|1|2|3}" int main(int argc,char** argv) { @@ -12,19 +12,15 @@ int main(int argc,char** argv) switch (n) { case 0: - ab0100(argc,argv); break; //Gestione Tabelle: Sintassi ab0 -0 tab_name -utente + ab0100(argc,argv); break; case 1: - ab0200(argc,argv); break; //Sintassi ab0 -1 -utente + ab0200(argc,argv); break; case 2: - //ab0300(argc,argv); break; - // case 3: - // m71310(argc,argv); break; - // case 4: - // m71295(argc,argv); break; - // case 5: - // m71230(argc,argv); break; + ab0300(argc,argv); break; + case 3: + ab0400(argc,argv); break; default: error_box(usage, argv[0]) ; } - return 0; + exit(0); } diff --git a/ab/ab0.h b/ab/ab0.h index f5f578bfd..0523b809d 100755 --- a/ab/ab0.h +++ b/ab/ab0.h @@ -2,4 +2,5 @@ extern int ab0100 (int argc, char* argv[]); //Tabella periodi di bilancio extern int ab0200 (int argc, char* argv[]); //Piano dei conti analisi di bilancio extern int ab0300 (int argc, char* argv[]); //Compatta il Piano dei Conti +extern int ab0400 (int argc, char* argv[]); //Riclassifica ed esporta i saldi diff --git a/ab/ab0100.cpp b/ab/ab0100.cpp index f311617b0..4d3d6ca47 100755 --- a/ab/ab0100.cpp +++ b/ab/ab0100.cpp @@ -34,20 +34,20 @@ bool Tabanabil_application::giorno_handler(TMask_field& f, KEY k) { if (k == K_TAB && f.mask().is_running()) { - int giorno = atoi(f.get()); + const int giorno = atoi(f.get()); if (giorno > 31) - return f.warning_box("Valore non valido per il giorno"); + return f.warning_box(TR("Valore non valido per il giorno")); - int mese = (f.dlg() == F_GIORNO_INI ? f.mask().get_int(F_MESE_INI) : f.mask().get_int(F_MESE_FINE)); + const int mese = (f.dlg() == F_GIORNO_INI ? f.mask().get_int(F_MESE_INI) : f.mask().get_int(F_MESE_FINE)); if (mese == 2) if (giorno > 29) - return f.warning_box("Valore non valido per il giorno"); + return f.warning_box(TR("Valore non valido per il giorno")); if (mese == 11 || mese == 4 || mese == 6 || mese == 9) if (giorno > 30) - return f.warning_box("Valore non valido per il giorno"); + return f.warning_box(TR("Valore non valido per il giorno")); } return TRUE; @@ -57,20 +57,20 @@ bool Tabanabil_application::mese_handler(TMask_field& f, KEY k) { if (k == K_TAB && f.mask().is_running()) { - int mese = atoi(f.get()); + const int mese = atoi(f.get()); if (mese < 1 || mese > 12) - return f.warning_box("Valore non valido per il mese"); + return f.warning_box(TR("Valore non valido per il mese")); - int giorno = (f.dlg() == F_MESE_INI ? f.mask().get_int(F_GIORNO_INI) : f.mask().get_int(F_GIORNO_FINE)); + const int giorno = (f.dlg() == F_MESE_INI ? f.mask().get_int(F_GIORNO_INI) : f.mask().get_int(F_GIORNO_FINE)); if (mese == 2) if (giorno > 28) - return f.warning_box("Valore non valido per il giorno"); + return f.warning_box(TR("Valore non valido per il giorno")); if (mese == 11 || mese == 4 || mese == 6 || mese == 9) if (giorno > 30) - return f.warning_box("Valore non valido per il giorno"); + return f.warning_box(TR("Valore non valido per il giorno")); } return TRUE; @@ -81,16 +81,16 @@ bool Tabanabil_application::anni_handler(TMask_field& f, KEY k) if (k == K_ENTER) { TMask & m=f.mask(); - TDate inizio(m.get_int(F_GIORNO_INI),m.get_int(F_MESE_INI),1993); + const TDate inizio(m.get_int(F_GIORNO_INI),m.get_int(F_MESE_INI),1993); if (inizio.empty()) return TRUE; - TDate fine(m.get_int(F_GIORNO_FINE),m.get_int(F_MESE_FINE),1993+m.get_int(F_NUM_ANNI)); + const TDate fine(m.get_int(F_GIORNO_FINE),m.get_int(F_MESE_FINE),1993+m.get_int(F_NUM_ANNI)); if (fine.empty()) return TRUE; if (fine==inizio) - return f.error_box("Date uguali: specificare il numero di anni"); + return f.error_box(TR("Date uguali: specificare il numero di anni")); if (fine +#include +#include +#include #include #include #include #include #include #include -#include -#include #include "ab0200.h" @@ -15,7 +16,6 @@ class TPconAb : public TRelation_application { TMask* _msk; TRelation* _rel; - TLocalisamfile* _pcon; TString _codice; int _indbil,_newindbil; @@ -23,8 +23,6 @@ class TPconAb : public TRelation_application static bool ContoSezBilOpp(TMask_field& f, KEY key); static bool IndBil (TMask_field& f, KEY key); -// static bool LivelloStrutt (TMask_field& f, KEY key); -// const char * extra_modules() const { return format("%d",CGAUT); } void ScriviContoSezOpp (const TString& codice, const TString& val); protected: @@ -43,11 +41,6 @@ protected: public: TPconAb() {} ; }; -/* - TPconAb::TPconAb(const char* codice, char indbil): _codice(codice), _indbil(indbil) - { - } - */ // Handler che controlla, nel caso venga scelto un conto di sezione opposta gia' esistente, // l'indicatore di bilancio del conto di sezione opposta e' "opposto" rispetto al conto // "di partenza". Controlla inoltre, nel caso il conto di sezione opposta abbia a sua volta @@ -55,38 +48,34 @@ public: bool TPconAb::ContoSezBilOpp(TMask_field& f, KEY k) { - if ( (k == K_TAB && f.mask().is_running()) || k == K_ENTER) + if (f.to_check(k)) { - TLocalisamfile pcon (LF_ABPCON); + const TString16 codice (f.get()); + + if (codice.not_empty()) + { + const TRectype & pcon = cache().get(LF_ABPCON, codice); + + const int indbilI = f.mask().get_int(F_INDBIL); + const int indbilII = pcon.get_int("INDBIL"); + + if (indbilI == 1 && indbilII != 2) + return f.warning_box(TR("L'indicatore di bilancio del conto di sezione opposta deve essere una passivita'")); - TString16 codice (f.get()); + if (indbilI == 2 && indbilII != 1) + return f.warning_box(TR("L'indicatore di bilancio del conto di sezione opposta deve essere un'attivita'")); - pcon.setkey(1); - pcon.zero(); - pcon.put("CODCBL", codice); - if (pcon.read() == NOERR) - { - int indbilI = f.mask().get_int(F_INDBIL); - int indbilII = pcon.get_int("INDBIL"); + if (indbilI == 3 && indbilII != 4) + return f.warning_box(TR("L'indicatore di bilancio del conto di sezione opposta deve essere un ricavo")); - if (indbilI == 1 && indbilII != 2) - return f.warning_box("L'indicatore di bilancio del conto di sezione opposta deve essere una passivita'"); + if (indbilI == 4 && indbilII != 3) + return f.warning_box(TR("L'indicatore di bilancio del conto di sezione opposta deve essere un costo")); - if (indbilI == 2 && indbilII != 1) - return f.warning_box("L'indicatore di bilancio del conto di sezione opposta deve essere un'attivita'"); - - if (indbilI == 3 && indbilII != 4) - return f.warning_box("L'indicatore di bilancio del conto di sezione opposta deve essere un ricavo"); - - if (indbilI == 4 && indbilII != 3) - return f.warning_box("L'indicatore di bilancio del conto di sezione opposta deve essere un costo"); - - TString16 codice1 (f.mask().get(F_CODICE)); - TString16 codice2 (pcon.get("CODCONTR")); - - if (codice2 != "" && codice1 != codice2) - return f.warning_box("Il conto di sezione opposta risulta diverso dal conto di sezione di partenza"); - } + const TString16 codopp(pcon.get("CODCONTR")); + + if (codopp.not_empty() && (codopp != f.mask().get(F_CODICE))) + return f.warning_box(TR("Il conto di sezione opposta risulta diverso dal conto di sezione di partenza")); + } } return TRUE; @@ -109,23 +98,7 @@ bool TPconAb::IndBil(TMask_field& f, KEY k) return TRUE; } -/* -// Handler che controlla la validita' del campo "Livello di struttura": -// il suo valore deve essere >= 1 e <= 99. -bool TPconAb::LivelloStrutt(TMask_field& f, KEY k) -{ - if (k == K_TAB && f.mask().is_running()) - { - int livello = atoi(f.get()); - - if (livello < 1 || livello > 99) - return f.warning_box("Valore non valido per livello struttura"); - } - - return TRUE; -} -*/ void TPconAb::init_query_mode(TMask&) { if (_isparametri) @@ -161,7 +134,7 @@ void TPconAb::init_insert_mode(TMask&) void TPconAb::ScriviContoSezOpp(const TString& codice, const TString& val) { - TLocalisamfile pcon (LF_ABPCON); + TLocalisamfile pcon(LF_ABPCON); pcon.setkey(1); pcon.zero(); @@ -209,18 +182,14 @@ bool TPconAb::remove() bool TPconAb::user_create() { - _pcon = new TLocalisamfile (LF_ABPCON); + open_files(LF_TAB, LF_TABCOM, LF_ABPCON, 0); _rel = new TRelation (LF_ABPCON); _msk = new TMask("ab0200a") ; - _pcon->zero(); - _pcon->read(_isgteq); - _msk->set_handler(F_CODCONTR, ContoSezBilOpp); _msk->set_handler(F_INDBIL, IndBil); - // _msk->set_handler(F_LIVELLO, LivelloStrutt); _isparametri = FALSE; @@ -253,7 +222,6 @@ bool TPconAb::user_destroy() { delete _msk; delete _rel; - delete _pcon; return TRUE; } @@ -262,7 +230,7 @@ int ab0200(int argc, char* argv[]) { TPconAb a; - a.run(argc, argv, "Piano dei Conti"); + a.run(argc, argv, TR("Piano dei Conti")); return TRUE; } diff --git a/ab/ab0300.cpp b/ab/ab0300.cpp index d5a7e9283..5c306a427 100755 --- a/ab/ab0300.cpp +++ b/ab/ab0300.cpp @@ -5,57 +5,31 @@ #include #include #include -#include - #include "ab0.h" -class Comp_abpcon : public TApplication +class TComp_abpcon : public TSkeleton_application { - //TSystemisamfile* _abpcon; - TLocalisamfile* _abpcon; public: virtual bool create(); - virtual bool destroy(); - virtual bool menu(MENU_TAG m); + virtual void main_loop() {}; - Comp_abpcon() {} + TComp_abpcon() {} }; -bool Comp_abpcon::create() +bool TComp_abpcon::create() { - TApplication::create(); - - //_abpcon = new TSystemisamfile (LF_ABPCON); - _abpcon = new TLocalisamfile (LF_ABPCON); - - //_abpcon->packfile(); - //_abpcon->packindex(); - - dispatch_e_menu (BAR_ITEM(1)); + open_files(LF_TAB, LF_TABCOM, 0); - return TRUE; + return TSkeleton_application::create(); + } -bool Comp_abpcon::destroy() -{ - delete _abpcon; - - return TApplication::destroy(); -} - -bool Comp_abpcon::menu(MENU_TAG m) -{ - if (m == BAR_ITEM(1)) - return FALSE; - - return FALSE; -} int ab0300 (int argc, char* argv[]) { - Comp_abpcon main_app; - main_app.run(argc, argv, "Compatta"); + TComp_abpcon main_app; + main_app.run(argc, argv, TR("Compatta")); return TRUE; } diff --git a/ab/ab0400.cpp b/ab/ab0400.cpp new file mode 100755 index 000000000..5b1b31578 --- /dev/null +++ b/ab/ab0400.cpp @@ -0,0 +1,608 @@ + +#include "abpcon.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "../cg/cglib01.h" +#include "../cg/cglib02.h" + +#include "ab0.h" +#include "ab0400.h" + +/////////////////////////////////////////////////////////// +// TRicl_mask +/////////////////////////////////////////////////////////// + +class TRicl_mask : public TAutomask +{ + +protected: + virtual bool on_field_event(TOperable_field& o, TField_event e, long jolly); + +public: + TRicl_mask() : TAutomask("ab0400a") { } + virtual ~TRicl_mask() { } +}; + +bool TRicl_mask::on_field_event(TOperable_field& o, TField_event e, long jolly) +{ + const short id = o.dlg(); + switch (id) + { + case F_ESER: + case F_PDB: + if (e == fe_modify) + { + TMask & m = o.mask(); + const TString16 codpdb = m.get(F_PDB); + const int eser = m.get_int(F_ESER); + + if (eser == 0 || codpdb.empty()) + { + m.set(F_DAL, ""); + m.set(F_AL, ""); + } + else + { + TEsercizi_contabili es; + es.update(); + const int anno = es.esercizio(eser).inizio().year(); + const TRectype & pdb = cache().get("%PDB", codpdb); + TDate dal(pdb.get_int("I0"), pdb.get_int("I1"), anno); + TDate al(pdb.get_int("I2"), pdb.get_int("I3"), anno); + + if (al < dal) + al.addyear(1); + m.set(F_DAL, dal); + m.set(F_AL, al); + } + } + break; + default: + break; + } + return TRUE; +} + +enum TCalc_type { _ivdircee = 1, _ricl } ; + +class TRiga_calcolo : public TObject +{ + int _gruppo; + int _conto; + long _sottoconto; + int _indbil; + real _saldo_iniziale; + real _prog_dare; + real _prog_avere; + + virtual TObject* dup() const { return new TRiga_calcolo(*this);} + +public: + void set_conto(int g, int c, long s, int i) { _gruppo = g; _conto = c; _sottoconto = s; _indbil = i;} + void set_saldi(const real & si, const real & pd, const real & pa) { _saldo_iniziale = si; + _prog_dare = pd; + _prog_avere = pa;} + const int gruppo() const { return _gruppo;} + const int conto() const { return _conto;} + const long sottoconto() const { return _sottoconto;} + const int indicatore_bilancio() const { return _indbil;} + real saldo_iniziale() const { return _saldo_iniziale;} + real prog_dare() const { return _prog_dare;} + real prog_avere() const { return _prog_avere;} + real saldo() const { return _saldo_iniziale + _prog_dare - _prog_avere;} + bool sezione_opposta() const; + TRiga_calcolo& copy(const TRiga_calcolo& c); + + TRiga_calcolo(const TRiga_calcolo& c); + TRiga_calcolo() {} + virtual ~TRiga_calcolo() {} +}; + +bool TRiga_calcolo::sezione_opposta() const +{ + bool reverse = FALSE; + const real s = saldo(); + + if (s != ZERO) + { + char sezione = s > ZERO ? 'D' : 'A'; + + if (_indbil == 1 || _indbil == 3) + reverse = sezione == 'A'; + else + if (_indbil == 2 || _indbil == 4) + reverse = sezione == 'D'; + } + return reverse; +} + +TRiga_calcolo & TRiga_calcolo::copy(const TRiga_calcolo & c) +{ + _gruppo = c._gruppo; + _conto = c._conto; + _sottoconto = c._sottoconto; + _indbil = c._indbil; + _saldo_iniziale = c._saldo_iniziale; + _prog_dare = c._prog_dare; + _prog_avere = c._prog_avere; + + return *this; +} + +TRiga_calcolo::TRiga_calcolo(const TRiga_calcolo & c) +{ + copy(c); +} + + +class TRiga_output : public TObject +{ + TString _code; + real _saldo_iniziale; + real _prog_dare; + real _prog_avere; + + virtual TObject* dup() const { return new TRiga_output(*this);} + +public: + TRiga_output & operator +=(const TRiga_calcolo & c); + const TString & code() const { return _code;} + real saldo_iniziale() const { return _saldo_iniziale;} + real prog_dare() const { return _prog_dare;} + real prog_avere() const { return _prog_avere;} + real saldo() const { return _saldo_iniziale + _prog_dare - _prog_avere;} + char sezione_saldo() const { return saldo() > 0 ? 'D' : 'A';} + TRiga_output& copy(const TRiga_output& o); + + TRiga_output(const TRiga_output& o); + TRiga_output(const char * code) : _code(code) {} + virtual ~TRiga_output() {} +}; + +TRiga_output & TRiga_output::operator += (const TRiga_calcolo & c) +{ + _saldo_iniziale += c.saldo_iniziale(); + _prog_dare += c.prog_dare(); + _prog_avere += c.prog_avere(); + + return *this; +} + +TRiga_output & TRiga_output::copy(const TRiga_output & o) +{ + _code = o._code; + _saldo_iniziale = o._saldo_iniziale; + _prog_dare = o._prog_dare; + _prog_avere = o._prog_avere; + + return *this; +} + +TRiga_output::TRiga_output(const TRiga_output& o) +{ + copy(o); +} + +enum TFile_type { _textfile, _csvfile, _dbffile } ; + +class TRicl_saldi : public TSkeleton_application +{ + TRicl_mask *_mask; + TFilename _output_file; + TCalc_type _calc_type; + int _codes; + TDate _dal; + TDate _al; + bool _provv; + TString _codpdb; + TArray _risultati; + TAssoc_array _output; + TString_array _output_keys; + bool _clear; + ofstream * _file; + TExternisamfile * _dbf; + +#ifdef DBG +protected: + FILE * _log; + void open_log(); + void write_log(const char * line); + void close_log(); +#endif + +public: + virtual bool create(); + virtual bool destroy(); + void mask2parms(const TMask & m); + void calculate(); + void transform(); + void get_code(const TRectype & rec, bool cee, bool reverse, TString & code); + void map(int gruppo, int conto, long sottoconto, bool reverse, TString & code); + void output(); + virtual void main_loop(); + TFile_type open_output(); + void output_line(TFile_type t, const char * key, TRiga_output & r); + void close_output(TFile_type t); + + TRicl_saldi() {} + virtual ~TRicl_saldi() {} +}; + +#ifdef DBG +void TRicl_saldi::open_log() +{ + TFilename log("ab0400.log"); + + _log = fopen(log,"a"); + if (_log == NULL) + fatal_box(FR("Non posso aprire il file di log della conversione(%s)"), (const char *) log); +} + +void TRicl_saldi::write_log(const char * line) +{ + fprintf(_log,"%s\n", line); +} + +void TRicl_saldi::close_log() +{ + fclose(_log); +} +#endif + +bool TRicl_saldi::create() +{ + + open_files(LF_TAB, LF_TABCOM, LF_ABPCON, LF_ABSALDI, LF_SALDI, LF_RMOV, LF_MOV, + LF_PCON, 0); + _mask = new TRicl_mask(); + + return TSkeleton_application::create(); +} + +bool TRicl_saldi::destroy() +{ + delete _mask; + + return TSkeleton_application::destroy(); +} + +void TRicl_saldi::mask2parms(const TMask & m) +{ + _calc_type = (TCalc_type) m.get_int(F_TIPO); + _codes = m.get_int(F_ESER); + _dal = m.get(F_DAL); + _al = m.get(F_AL); + if (_dal.ok() && !_al.ok()) + { + const TDate oggi(TODAY); + + if (oggi > _dal) + _al = oggi; + else + { + _al.set_year(_dal.year()); + _al.set_month(12); + _al.set_day(31); + } + } + _provv = m.get_bool(F_PROVV); + _output_file = m.get(F_OUTPUT); + _codpdb = m.get(F_PDB); + _clear = m.get_bool(F_CLEAR); +#ifdef DBG + TString line ; + write_log("---------------------------------------------------"); + line = TR("Tipo di calcolo : "); line << (_calc_type ? TR("IV Direttiva CEE") : TR("Analisi")); + write_log(line); + line = TR("Esercizio : "); line << _codes; + write_log(line); + line = TR("Codice periodo : "); line << _codpdb; + write_log(line); + line = TR("Dal : "); line << _dal.string(); + write_log(line); + line = TR("Al : "); line << _al.string(); + write_log(line); + line = TR("Movimenti provv.: "); line << (_provv ? "Si" : "No"); + write_log(line); + line = TR("Output : "); line << ((const char *) _output_file) << " da ricreare : " << (_clear ? "Si" : "No"); + write_log(line); + write_log(""); +#endif +} + +void TRicl_saldi::calculate() +{ + TRelation relpcon(LF_PCON); + const TRectype & pcon = relpcon.curr(); + TCursor cur(&relpcon, "CONTO!=0"); + int gruppo; + int conto; + long sottoconto; + int indbil; + TSaldo sal; + TRiga_calcolo r; + const bool saldi_attuali = !_dal.ok() && !_al.ok(); + const TRecnotype items = cur.items(); + + cur.freeze(); + + TProgind p(items, TR("Ricalcolo saldi"), FALSE); + for (cur = 0L; !p.iscancelled() && cur.pos() < items; ++cur) + { + gruppo = pcon.get_int(PCN_GRUPPO); + conto = pcon.get_int(PCN_CONTO); + sottoconto = pcon.get_long(PCN_SOTTOCONTO); + if (sottoconto == 0L) + indbil = pcon.get_int(PCN_INDBIL); + else + { + if (saldi_attuali) + sal.ultima_immissione_bilancio(_codes, gruppo, conto, sottoconto, indbil, _provv ? 2 :1, FALSE); + else + sal.valore_al(gruppo, conto, sottoconto, _dal, _al, indbil, _provv); + r.set_conto(gruppo, conto, sottoconto, indbil); + r.set_saldi(sal.saldoini(), sal.prgdare(), sal.prgavere()); +#ifdef DBG + TString line ; + line.format(FR("Conto %03d.%03d.%06ld - "), gruppo, conto, sottoconto); + line << TR("Saldo iniziale ") << sal.saldoini().stringa(18, 3); + line << TR(" Prog.Dare ") << sal.prgdare().stringa(18, 3); + line << TR(" Prog.Avere ") << sal.prgavere().stringa(18, 3); + line << TR(" Saldo ") << sal.saldo().stringa(18, 3); + write_log(line); +#endif + _risultati.add(r); + } + } +} + +void TRicl_saldi::get_code(const TRectype &rec, bool cee, bool reverse, TString & code) +{ + if (cee) + { + bool opp = reverse && rec.get_int(PCN_SEZIVDOPP) != 0; + code = rec.get(opp ? PCN_SEZIVDOPP : PCN_SEZIVD); + if (code == "0") + code.cut(0); + else + { + code << rec.get(opp ? PCN_LETTIVDOPP : PCN_LETTIVD); + code << format("%4s", (const char *) rec.get(opp ? PCN_NUMRIVDOPP : PCN_NUMRIVD)); + const int numrivd = rec.get_int(opp ? PCN_NUMIVDOPP : PCN_NUMIVD); + if (numrivd != 0) + code << format("%02d", numrivd); + code.trim(); + } + } + else + code = rec.get(PCN_CODCBL); +} + +void TRicl_saldi::map(int gruppo, int conto, long sottoconto, bool reverse, TString & code) +{ + const bool cee =_calc_type == _ivdircee; + + code.format("%d|%d|%ld", gruppo, conto, sottoconto); + const TRectype & recs = cache().get(LF_PCON, code); + + get_code(recs, cee, reverse, code); + if (code.empty()) + { + code.format("%d|%d", gruppo, conto); + const TRectype & recc = cache().get(LF_PCON, code); + + get_code(recc, cee, reverse, code); + if (code.empty()) + { + code.format("%d", gruppo); + const TRectype & recg = cache().get(LF_PCON, code); + + get_code(recg, cee, reverse, code); + } + } +} + +void TRicl_saldi::transform() +{ + const int items = _risultati.items(); + TString80 key; + for (int i = 0; i < items; i++) + { + const TRiga_calcolo & c = (const TRiga_calcolo &) _risultati[i]; + const int gruppo = c.gruppo(); + const int conto = c.conto(); + const long sottoconto = c.sottoconto(); + const bool reverse = c.sezione_opposta(); + + map(gruppo, conto, sottoconto, reverse, key); + + if (key.not_empty()) + { + TRiga_output * r = (TRiga_output *)_output.objptr(key); + + if (r == NULL) + { + r = new TRiga_output(key); + _output.add(key, r); + } + *r += c; + } + } +} + +TFile_type TRicl_saldi::open_output() +{ + TString16 ext = _output_file.ext(); + TFile_type t; + + if (ext == "dbf") + t = _dbffile; + else + if (ext == "csv") + t = _csvfile; + else + t = _textfile; + if (t == _dbffile) + _dbf = _clear ? new TExternisamfile(_output_file, "ab0400.trr") : new TExternisamfile(_output_file); + else + _file = new ofstream(_output_file, _clear ? ios::trunc : ios::app); + + return t; +} + +void TRicl_saldi::output_line(TFile_type t, const char * key, TRiga_output & r) +{ + TString descr; + + if (_calc_type == _ivdircee) + descr = cache().get("%IVD", key, "S0"); + else + descr = cache().get(LF_ABPCON, key, ABPC_DESCRIZ); + + real si = r.saldo_iniziale(); + char fsi = 'D'; + real s = r.saldo(); + char fs = 'D'; + real pd = r.prog_dare(); + real pa = r.prog_avere(); + + if (si < ZERO) + { + si = -si; + fsi = 'A'; + } + if (s < ZERO) + { + s = -s; + fs = 'A'; + } +#ifdef DBG + TString line ; + line.format(FR("Chiave %s"), key); + line << TR("Saldo iniziale ") << si.stringa(18, 3) << " " << fsi; + line << TR(" Prog.Dare ") << pd.stringa(18, 3); + line << TR(" Prog.Avere ") << pa.stringa(18, 3); + line << TR(" Saldo ") << s.stringa(18, 3) << " " << fs; + write_log(line); +#endif + + if (t == _dbffile) + { + TRectype & r = _dbf->curr(); + + r.put("ANNOES", _codes); + r.put("KEY", key); + r.put("DESCR", descr); + r.put("SALDOI", si); + r.put("FLAGSI", fsi); + r.put("PDARE", pd); + r.put("PAVERE", pa); + r.put("SALDO", s); + r.put("FLAGS", fs); + r.put("DATAI", _dal); + r.put("DATAF", _al); + r.put("CODPDB", _codpdb); + + if (_dbf->write(r) != NOERR) + _dbf->rewrite(r); + } + else + if (t == _csvfile) + { + *_file << _codes << ";"; + *_file << "\""<< key << "\";"; + *_file << "\"" << descr << "\";"; + *_file << si.string() << ";"; + *_file << fsi << ";"; + *_file << pd.string() << ";"; + *_file << pa.string() << ";"; + *_file << s.string() << ";"; + *_file << fs << ";"; + *_file << _dal << ";"; + *_file << _al << ";"; + *_file << _codpdb << "\n"; + } + else + { + *_file << _codes << "\t"; + *_file << key << "\t"; + *_file << descr << "\t"; + *_file << si.string() << "\t"; + *_file << fsi << "\t"; + *_file << pd.string() << "\t"; + *_file << pa.string() << "\t"; + *_file << s.string() << "\t"; + *_file << fs << "\t"; + *_file << _dal << "\t"; + *_file << _al << "\t"; + *_file << _codpdb << "\n"; + } +} + +void TRicl_saldi::close_output(TFile_type t) +{ + if (t == _dbffile) + { + delete _dbf; + _dbf = NULL; + } + else + { + delete _file; + _file = NULL; + } +} + +void TRicl_saldi::output() +{ + _output_keys.destroy(); + _output.get_keys(_output_keys); + _output_keys.sort(); + const int items = _output_keys.items(); + TFile_type t = open_output(); + for (int i = 0; i < items; i++) + { + TString & key = _output_keys.row(i); + TRiga_output & r = (TRiga_output &) _output[key]; + output_line(t, key, r); + } + close_output(t); +} + +void TRicl_saldi::main_loop() +{ + while (_mask->run() != K_QUIT) + { +#ifdef DBG + open_log(); +#endif + mask2parms(*_mask); + calculate(); + transform(); + output(); +#ifdef DBG + close_log(); +#endif + } +} + +int ab0400 (int argc, char* argv[]) +{ + TRicl_saldi main_app; + main_app.run(argc, argv, "Riclassifica saldi"); + return TRUE; +} + + + + + + + diff --git a/ab/ab0400.h b/ab/ab0400.h new file mode 100755 index 000000000..8bd6a41b7 --- /dev/null +++ b/ab/ab0400.h @@ -0,0 +1,10 @@ +// campi maschera ab0400a.uml + +#define F_TIPO 101 +#define F_ESER 102 +#define F_PDB 103 +#define F_DAL 104 +#define F_AL 105 +#define F_PROVV 106 +#define F_OUTPUT 107 +#define F_CLEAR 108 diff --git a/ab/ab0400.trr b/ab/ab0400.trr new file mode 100755 index 000000000..3fee81959 --- /dev/null +++ b/ab/ab0400.trr @@ -0,0 +1,16 @@ +-1 +12 +ANNOES|9|4|0|Codice esercizio +KEY|1|20|0|Chiave +DESCR|1|70|0|Descrizione +FLAGSI|1|1|0|Saldo iniziale in are, vere +SALDOI|4|18|2|Saldo iniziale +PDARE|4|18|2|Progressivo dare +PAVERE|4|18|2|Progressivo avere +FLAGS|1|1|0|Saldo in are, vere +SALDO|4|18|2|Saldo +DATAI|5|8|0|Data inizio +DATAF|5|8|0|Data fine +CODPDB|1|3|0|Codice +1 +ANNOES+KEY+CODPDB+DATAI+DATAF| diff --git a/ab/ab0400a.uml b/ab/ab0400a.uml new file mode 100755 index 000000000..e94708dae --- /dev/null +++ b/ab/ab0400a.uml @@ -0,0 +1,85 @@ +#include "ab0400.h" + +PAGE "Riclassificazione" -1 -1 76 17 + +LIST F_TIPO 20 +BEGIN + PROMPT 2 1 "Tipo di calcolo " + ITEM "1|IV Direttiva CEE" + ITEM "2|Analisi" +END + +NUMBER F_ESER 4 +BEGIN + PROMPT 2 3 "Esercizio " + HELP "Codice d'esercizio da assegnare" + FLAGS "ZR" + USE ESC + INPUT CODTAB F_ESER + DISPLAY "Codice esercizio" CODTAB + DISPLAY "Data inizio esercizio" D0 + DISPLAY "Data fine esercizio" D1 + DISPLAY "Data di scarico" D2 + DISPLAY "Data chiusura esercizio" D3 + OUTPUT F_ESER CODTAB + CHECKTYPE NORMAL +END + +STRING F_PDB 2 +BEGIN + PROMPT 2 5 "Codice periodo " + HELP "Codice della tabella periodi di bilancio" + FLAGS "U_" + USE %PDB + INPUT CODTAB F_PDB + DISPLAY "Codice" CODTAB + DISPLAY "Descrizione@40" S0 + DISPLAY "gg.inizio" I0 + DISPLAY "mm.inizio" I1 + DISPLAY "gg.fine" I2 + DISPLAY "mm.fine" I3 + OUTPUT F_PDB CODTAB + CHECKTYPE NORMAL +END + +DATE F_DAL +BEGIN + PROMPT 2 7 "Dal " +END + +DATE F_AL +BEGIN + PROMPT 2 9 "Al " + VALIDATE DATE_CMP_FUNC > F_DAL + WARNING "La data finale deve essere maggiore alla data iniziale" +END + +BOOLEAN F_PROVV +BEGIN + PROMPT 2 11 "Anche i movimenti provvisori" +END + +STRING F_OUTPUT 50 30 +BEGIN + PROMPT 2 13 "File di output " + FSELECT "" +END + +BOOLEAN F_CLEAR +BEGIN + PROMPT 55 13 "Azzera" +END + +BUTTON DLG_OK 10 2 +BEGIN + PROMPT -12 -1 "" +END + +BUTTON DLG_QUIT 10 2 +BEGIN + PROMPT -22 -1 "" +END + +ENDPAGE + +ENDMASK diff --git a/ab/ab1100.cpp b/ab/ab1100.cpp index d8f3f7d6b..dc4b9f33c 100755 --- a/ab/ab1100.cpp +++ b/ab/ab1100.cpp @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -143,17 +144,8 @@ bool AB1100_application::preprocess_page(int , int) } } // Stampa tabella registri. Calcolo: pagine residue = pagine - stampate -/* if (_stampa_registri) - { - const int pagine = _cur->file().get_int("I2"); - const int stampate = _cur->file().get_int("I1"); - const int residue = pagine - stampate; - if (residue > 0) - set_row(1, "@126g%4d", residue); - else - set_row(1, "@126g%4s", " "); - } */ - return TRUE; + + return TRUE; } void AB1100_application::set_headers() @@ -184,25 +176,14 @@ void AB1100_application::set_headers() { const long codditta = get_firm(); TString80 ragsoc; - TLocalisamfile nditte(LF_NDITTE); + const TRectype & nditta = cache().get(LF_NDITTE, codditta); - nditte.zero(); - nditte.put(NDT_CODDITTA, codditta); - if (nditte.read() == NOERR) - { - ragsoc = nditte.get(NDT_RAGSOC); - if (LungRiga < 100) ragsoc.cut(40); - } - riga.overwrite(format("Ditta %4ld %s", codditta,(const char *)ragsoc)); + ragsoc = nditta.get(NDT_RAGSOC); + if (LungRiga < 100) ragsoc.cut(40); + riga.overwrite(format(FR("Ditta %4ld %s"), codditta,(const char *)ragsoc)); } -/* if (_stampa_ca7) - { - TDate d (_msk->get(F_DATASTAMPA)); - printer().setdate(d); - } */ - - riga.overwrite ("Data @< Pag. @#", riga.len()-22); + riga.overwrite (FR("Data @< Pag. @#"), riga.len()-22); set_header (last_riga++, "%s", (const char *)riga); @@ -211,17 +192,9 @@ void AB1100_application::set_headers() // Lo lascio anche per le altre stampe // if (_stampa_registri) NomeTabella.left_just (LungRiga); - /* else - NomeTabella.center_just (LungRiga); */ -/* if (_stampa_ca7) - NomeTabella.center_just (LungRiga); */ set_header (last_riga++, "@b%s", (const char *)NomeTabella); - // Aggiungo una riga vuota per separare prima intestazione - //sep.fill ('-', LungRiga); - //set_header (last_riga, "%s", (const char *)sep); - line = rpt.line(); while ( (line != "") && (line[0] != '[') ) { @@ -407,8 +380,6 @@ bool AB1100_application::user_create() // Flag per la stampa tabella registri _tabname.upper(); -// _stampa_registri = (_tabname == "REG"); -// _stampa_ca7 = (_tabname == "%CA7"); _rel = new TRelation (_tabname); _cur = new TCursor (_rel); @@ -452,6 +423,6 @@ bool AB1100_application::user_destroy() int ab1100(int argc, char** argv) { AB1100_application a; - a.run(argc, argv, "Stampa tabella"); + a.run(argc, argv, TR("Stampa tabella")); return 0; } diff --git a/ab/ab1200.cpp b/ab/ab1200.cpp index 9413feb23..fda2abcbd 100755 --- a/ab/ab1200.cpp +++ b/ab/ab1200.cpp @@ -30,7 +30,7 @@ void AB1200_application::main_loop() //Dati validi: (cod_from <= cod_to) and (cod_to = "vuoto") bool err = ((cod_from > cod_to) && (cod_to != "") ); if (err) - error_box("Il campo iniziale deve essere vuoto o minore del campo finale"); + error_box(TR("Il campo iniziale deve essere vuoto o minore del campo finale")); else { TCursor* cur = f.cursor(); //Ritorna il cursore corrente (oggetto) @@ -52,6 +52,6 @@ void AB1200_application::main_loop() int ab1200(int argc, char** argv) { AB1200_application a; - a.run(argc, argv, "Stampa Piano dei Conti"); + a.run(argc, argv, TR("Stampa Piano dei Conti")); return 0; } diff --git a/ab/ab2100.cpp b/ab/ab2100.cpp index 9034d5710..32363af2f 100755 --- a/ab/ab2100.cpp +++ b/ab/ab2100.cpp @@ -51,7 +51,7 @@ int ab2100(int argc, char **argv) break; } default: - error_box ("Sintassi: \n -0 -R - per ricezione \n -0 -T - per trasferimetno"); + error_box (TR("Sintassi: \n -0 -R - per ricezione \n -0 -T - per trasferimenTo")); } return 0; } diff --git a/ab/ab2100.h b/ab/ab2100.h index e245a5a6a..8bd1c461c 100755 --- a/ab/ab2100.h +++ b/ab/ab2100.h @@ -1,22 +1,18 @@ //AB2100.H: Classe principale e definizione di costanti #ifndef _AB2100_H -#ifndef __FILETEXT_H -#include -#endif // __FILETEXT_H - #ifndef __APPLICAT_H #include //Definizione della classe TApplication -#endif //__APPLICAT_H +#endif +#ifndef __FILETEXT_H +#include +#endif + #ifndef __MASK_H #include //Definizione della maschera -#endif //__MASK_H +#endif -#ifndef __URLDEFID_H -#include //Definizione di BAR_ITEM(1) -#endif //__URLDEFID_H - #define ID_NULLO 0 //Costanti di definizione dei tipi record @@ -176,7 +172,9 @@ class TRicezione_AS400 : public TObject_reception TFile_text_AS400 *trasfile() {return (TFile_text_AS400 *)_trasfile;} virtual void leggi_temp_link(TRectype& cur_rec,TToken_string& k); //Questa funzione è da usare solo in fase di debug - //void print_ana_tree(int & level, TRectype&,FILE * stream); +#ifdef DBG + void print_ana_tree(int & level, TRectype&,FILE * stream); +#endif public: virtual void ricevi(TMask &); TRicezione_AS400(const TFilename &percorso); diff --git a/ab/ab2101.cpp b/ab/ab2101.cpp index 8ed696286..5613ddea2 100755 --- a/ab/ab2101.cpp +++ b/ab/ab2101.cpp @@ -1,5 +1,3 @@ -//AB2101.CPP: Ricezione tabelle -#include //Definizione di fexit #include "movdett.h" //Contiene le definizioni di costanti relative ai nomi dei campi di LF_MOVDETT #include "saldi.h" //Contiene le definizioni di costanti relative ai nomi dei campi di LF_SALDI #include "voci.h" //Contiene le definizioni di costanti relative ai nomi dei cmapi di LF_VOCI @@ -9,8 +7,10 @@ #include "colldich.h" //Contiene le definizioni di costanti relative ai nomi dei cmapi di LF_COLLDICH #include "ab2100.h" //Definizione della classe principale e di constanti che indicano l'indice nel file di configurazione #include "ab2100a.h" //Campi della maschera -#include #include +#include +#include //Definizione di fexit + TToken_string TAlbero_record ::wrk_string; @@ -432,7 +432,7 @@ bool TTrasfer::inseriscipercorso(TMask_field& f, KEY k) TString percorso =f.get(); //Leggo il contenuto del campo bool esiste=fexist(percorso); //Controllo l'esistenza del file if (!esiste) - return f.error_box("Il percorso o il file specificato non esiste."); + return f.error_box(TR("Il percorso o il file specificato non esiste.")); modificato=TRUE; } @@ -442,7 +442,7 @@ bool TTrasfer::inseriscipercorso(TMask_field& f, KEY k) TString percorso =f.mask().get(F_PERCORSO); //Leggo il contenuto del campo bool esiste=fexist(percorso); //Controllo l'esistenza del file if (!esiste) - return f.error_box("Il percorso o il file specificato non esiste."); + return f.error_box(TR("Il percorso o il file specificato non esiste.")); modificato=TRUE; } @@ -483,7 +483,7 @@ bool TTrasfer::inseriscipercorso(TMask_field& f, KEY k) f.mask().enable(F_MOVIMENTI,abilita_saldi_movimenti); } else //non sono riuscito a trovare la testato o il tipo record dove me lo aspettavo - error_box ("Non ho trovato il record di testata o non riesco a leggere il file di configurazione"); + error_box (TR("Non ho trovato il record di testata o non riesco a leggere il file di configurazione")); file_temp->close(); delete file_temp; file_temp =NULL; @@ -503,29 +503,8 @@ bool TTrasfer::inseriscipercorso(TMask_field& f, KEY k) }// Non sono sul campo F_PERCORSO return TRUE; } - - -/* ********************************************************************************************************* */ -/* TRicezione */ -/*********************************************************************************************************** */ -/* -bool TRicezione::create() -{ - _files.add(new TLocalisamfile(LF_CARADD),1); - _files.add(new TLocalisamfile(LF_COLLDICH),2); - dispatch_e_menu(BAR_ITEM(1)); //Simula la scelta di una voce di menu - return TRUE; -} - -bool TRicezione::destroy() //Distruttore -{ - return TRUE; -} */ - - //Funzione membro che effettua la conversione -//bool TRicezione::menu(MENU_TAG) void TRicezione::main_loop() { _files.add(new TLocalisamfile(LF_CARADD),1); @@ -542,7 +521,7 @@ void TRicezione::main_loop() if (msk.run()== K_ENTER) //Eseguo la maschera { //Visualizza una finestra di attesa - TIndwin idle(0,"Attendere: aggiornamento della tabella in corso. \n L'operazione potrebbe richiedere qualche minuto ... ",FALSE,FALSE,60); + TIndwin idle(0,TR("Attendere: aggiornamento della tabella in corso. \n L'operazione potrebbe richiedere qualche minuto ... "),FALSE,FALSE,60); percorso=msk.get(F_PERCORSO); //Leggo il contenuto di F_PERCORSO @@ -571,7 +550,7 @@ void TRicezione::main_loop() /* if (msk.get_bool(F_SRELAZ)) build_relana(config_file,msk,percorso); */ //messaggio finale - message_box(" ... aggiornamento delle tabelle selezionate effettuato"); + message_box(TR(" ... aggiornamento delle tabelle selezionate effettuato")); } //end if (msk.run()) // return FALSE; } @@ -677,7 +656,7 @@ void TAlbero_record::dept_first(TToken_string key, TRectype * padre, TRectype * else {// ... questa situazione non dovrebbe accadere: se succede si è verificata una //inconsistenza nei dati - fatal_box("Si è verificato una inconsistenza nei dati: \n controllare che tutti i movimenti abbiano il relativo saldo"); + fatal_box(TR("Si è verificato una inconsistenza nei dati: \n controllare che tutti i movimenti abbiano il relativo saldo")); } } TToken_string key_figlio, key_fratello; @@ -877,7 +856,7 @@ void TRicezione_AS400::scrivi_array(TAssoc_array &s_rec, int logic_num) //non dovrebbe mai succedere if (err != NOERR) { - message_box("Si è verificato un errore nella costruzione dell'albero"); + message_box(TR("Si è verificato un errore nella costruzione dell'albero")); err = rel->write(); } rec=(TRectype*)s_rec.succ_item(); @@ -983,18 +962,15 @@ void TRicezione_AS400::build_relana(TString& config_file, const TMask &msk, cons tabtree.destroy(); //Azzero l'assoc_array long currid=1; - +#ifdef DBG // Questa parte stampa in un file di testo la struttura ad albro // dell'analisi: da usare solo in fase di debug - // *************** - // *************** -/* int level=0; + int level=0; FILE * stream=fopen("\\st1.txt","w"); print_ana_tree(level,radici.curr(),stream); - fclose(stream); */ - // *************** - // *************** + fclose(stream); +#endif build_ana_tree(currid,radici.curr(),NULL,NULL,tabtree); // costruisce l'albero in memoria @@ -1121,9 +1097,9 @@ void TRicezione_AS400::build_ana_tree(long &currid, TRectype & nodo, TRectype * ana_node->put(ABRA_IDSUCC, ID_NULLO); } -/* // Questa funzione serve solo in fase di debug: // naviga per ricostruire il numero di sottorelazione +#ifdef DBG void TRicezione_AS400::print_ana_tree(int &level,TRectype & nodo,FILE * stream) { TToken_string key; @@ -1156,7 +1132,7 @@ void TRicezione_AS400::print_ana_tree(int &level,TRectype & nodo,FILE * stream) print_ana_tree(level,relvoci.curr(),stream); } } -*/ +#endif void TRicezione_AS400::ricevi(TMask & msk) { @@ -1191,9 +1167,8 @@ TObject_reception::TObject_reception(const TFilename &percorso) { if (_trasfile != NULL) delete _trasfile; - _trasfile = new TFile_text(percorso, "C:/SAURO/TEMP/AB2100B.INI"); /*DA CAMBIARE*/ + _trasfile = new TFile_text(percorso, "ab2100b.ini"); /*DA CAMBIARE*/ _trasfile->open('r'); //apro il TFile_text in lettura - //_trasfile = new TFile_text(percorso, config); //Leggo il file di configurazione } TRicezione_AS400::TRicezione_AS400(const TFilename &percorso) @@ -1220,6 +1195,6 @@ TRicezione_userdef ::TRicezione_userdef(const TString & config, const TFilename int ab2101(int argc, char **argv) { TRicezione a; - a.run(argc,argv,"Ricezione da file di testo"); + a.run(argc,argv,TR("Ricezione da file di testo")); return 0; } \ No newline at end of file diff --git a/ab/ab2102.cpp b/ab/ab2102.cpp index 0ae6ac934..abd6ad99a 100755 --- a/ab/ab2102.cpp +++ b/ab/ab2102.cpp @@ -261,7 +261,7 @@ void TObject_send::converti(int logic_num) //Leggo il numero di records da convertire long items =cur->items(); //Barra scorrevole di attesa - TProgind idle(items,"Attendere: conversione in corso ...",TRUE,TRUE,60); + TProgind idle(items,TR("Attendere: conversione in corso ..."),TRUE,TRUE,60); //Ciclo principale di conversione for (*cur=0;cur->pos()items(); //Barra scorrevole di attesa - TProgind idle(items,"Attendere: conversione in corso ...",TRUE,TRUE,60); + TProgind idle(items,TR("Attendere: conversione in corso ..."),TRUE,TRUE,60); //Ciclo principale di conversione for (*cur=0;cur->pos()items(); //Barra scorrevole di attesa - TProgind idle(items,"Attendere: conversione in corso ...",TRUE,TRUE,60); + TProgind idle(items,TR("Attendere: conversione in corso ..."),TRUE,TRUE,60); //Ciclo principale di conversione for (*cur=0;cur->pos()open('w'); //apro il TFile_text in lettura } @@ -490,7 +490,7 @@ TInvio_AS400::TInvio_AS400(const TFilename &percorso) { if (_trasfile != NULL) delete _trasfile; - _trasfile = new TFile_text(percorso, "AB2100A.INI"); /*DA CAMBIARE*/ + _trasfile = new TFile_text(percorso, "ab2100a.ini"); /*DA CAMBIARE*/ _trasfile->open('w'); //apro il TFile_text in lettura } diff --git a/ab/ab3100.cpp b/ab/ab3100.cpp index 9cd69cf0d..f1f7d7c7b 100755 --- a/ab/ab3100.cpp +++ b/ab/ab3100.cpp @@ -155,27 +155,6 @@ bool naviga_tree(TMask_field& f, KEY k) return TRUE; } -/* -void TGestione_tree::gestione_saldi() -{ - TLocalisamfile saldo(LF_ABSALDI); -// TRecnotype nrec = 96; //Abilitare questa riga per testare la readat - - saldo.set_curr(new TABsaldo()); - saldo.put(ABMD_CODDITTA,"00001"); - saldo.put(ABMD_ANNO,"1996"); - saldo.put(ABMD_CODPDB,"001"); - saldo.put(ABMD_TIPOBIL,"E2"); - saldo.put(ABMD_CODCBL,"000000000200"); -// saldo.readat(nrec); //Se si abilita il test della readat, commentare le righe che riguardano la read - int err=saldo.read(); - if (err!=NOERR) - CHECK (FALSE,"Errore nella letture del record di testata"); - - //saldo.write(); - //saldo.remove(); -} */ - TRectype ricava_colldich(TMask & msk) { TRectype coll (LF_COLLDICH); @@ -319,7 +298,7 @@ bool aggiorna_id_caradd(TMask_field& f, KEY k) } else { - error_box ("Voce non presente nell'archivio voci"); + error_box (TR("Voce non presente nell'archivio voci")); } } aggiorna_caradd(sheet_msk); @@ -333,7 +312,7 @@ bool aggiorna_id_caradd(TMask_field& f, KEY k) bool TGestione_tree::user_create() { - _msk = new TMask("AB3100A"); + _msk = new TMask("ab3100a"); _anas = new TRelation(LF_ANALISI); TAnalisi_bil *tree = new TAnalisi_bil(); @@ -365,5 +344,5 @@ bool TGestione_tree::user_destroy() void ab3100(int argc, char **argv) { TGestione_tree a; - a.run(argc,argv, "Gestione dati"); + a.run(argc,argv, TR("Gestione dati")); } diff --git a/ab/abpcon.h b/ab/abpcon.h new file mode 100755 index 000000000..723cc72e2 --- /dev/null +++ b/ab/abpcon.h @@ -0,0 +1,7 @@ +#define ABPC_CODCBL "CODCBL" +#define ABPC_LIVELLO "LIVELLO" +#define ABPC_DESCRIZ "DESCRIZ" +#define ABPC_INDBIL "INDBIL" +#define ABPC_CODCONTR "CODCONTR" +#define ABPC_SOSPESO "SOSPESO" +#define ABPC_DETT "DETT" diff --git a/projects/ab.dsp b/projects/ab.dsp new file mode 100755 index 000000000..aba52eb27 --- /dev/null +++ b/projects/ab.dsp @@ -0,0 +1,63 @@ +# Microsoft Developer Studio Project File - Name="ab" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Generic Project" 0x010a + +CFG=ab - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "ab.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "ab.mak" CFG="ab - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "ab - Win32 Release" (based on "Win32 (x86) Generic Project") +!MESSAGE "ab - Win32 Debug" (based on "Win32 (x86) Generic Project") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +MTL=midl.exe + +!IF "$(CFG)" == "ab - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" + +!ELSEIF "$(CFG)" == "ab - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "ab___Win32_Debug" +# PROP BASE Intermediate_Dir "ab___Win32_Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "ab___Win32_Debug" +# PROP Intermediate_Dir "ab___Win32_Debug" +# PROP Target_Dir "" + +!ENDIF + +# Begin Target + +# Name "ab - Win32 Release" +# Name "ab - Win32 Debug" +# End Target +# End Project diff --git a/projects/ab.dsw b/projects/ab.dsw index 5db449dc2..e571ddf77 100755 --- a/projects/ab.dsw +++ b/projects/ab.dsw @@ -3,6 +3,42 @@ Microsoft Developer Studio Workspace File, Format Version 6.00 ############################################################################### +Project: "AgaLib"=.\AgaLib.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "ab"=.\ab.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name ab0 + End Project Dependency + Begin Project Dependency + Project_Dep_Name ab1 + End Project Dependency + Begin Project Dependency + Project_Dep_Name ab2 + End Project Dependency + Begin Project Dependency + Project_Dep_Name ab3 + End Project Dependency +}}} + +############################################################################### + Project: "ab0"=.\ab0.dsp - Package Owner=<4> Package=<5> @@ -11,6 +47,9 @@ Package=<5> Package=<4> {{{ + Begin Project Dependency + Project_Dep_Name AgaLib + End Project Dependency }}} ############################################################################### @@ -23,6 +62,9 @@ Package=<5> Package=<4> {{{ + Begin Project Dependency + Project_Dep_Name AgaLib + End Project Dependency }}} ############################################################################### @@ -35,6 +77,9 @@ Package=<5> Package=<4> {{{ + Begin Project Dependency + Project_Dep_Name AgaLib + End Project Dependency }}} ############################################################################### @@ -47,18 +92,9 @@ Package=<5> Package=<4> {{{ -}}} - -############################################################################### - -Project: "ab_masktab"=.\ab_masktab.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ + Begin Project Dependency + Project_Dep_Name AgaLib + End Project Dependency }}} ############################################################################### diff --git a/projects/ab0.dsp b/projects/ab0.dsp index 2cccfdd2e..eba5dbebd 100755 --- a/projects/ab0.dsp +++ b/projects/ab0.dsp @@ -110,6 +110,18 @@ SOURCE=..\ab\ab0200.cpp SOURCE=..\ab\ab0300.cpp # End Source File +# Begin Source File + +SOURCE=..\ab\ab0400.cpp +# End Source File +# Begin Source File + +SOURCE=..\cg\cglib01.cpp +# End Source File +# Begin Source File + +SOURCE=..\cg\cglib02.cpp +# End Source File # End Group # Begin Group "Headers" @@ -118,6 +130,69 @@ SOURCE=..\ab\ab0300.cpp # Begin Group "Forms" # PROP Default_Filter "frm" +# Begin Source File + +SOURCE=..\ab\batbarb.rpt + +!IF "$(CFG)" == "ab0 - Win32 Release" + +!ELSEIF "$(CFG)" == "ab0 - Win32 Debug" + +# Begin Custom Build - Compiling rpt $(InputPath)... +TargetDir=\P.32\P_02_00\exed +InputPath=..\ab\batbarb.rpt +InputName=batbarb + +"$(TargetDir)\$(InputName).rpt" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + rpt32 $(InputPath) $(TargetDir)\$(InputName).rpt + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\ab\batbntb.rpt + +!IF "$(CFG)" == "ab0 - Win32 Release" + +!ELSEIF "$(CFG)" == "ab0 - Win32 Debug" + +# Begin Custom Build - Compiling rpt $(InputPath)... +TargetDir=\P.32\P_02_00\exed +InputPath=..\ab\batbntb.rpt +InputName=batbntb + +"$(TargetDir)\$(InputName).rpt" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + rpt32 $(InputPath) $(TargetDir)\$(InputName).rpt + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\ab\batbpdb.rpt + +!IF "$(CFG)" == "ab0 - Win32 Release" + +!ELSEIF "$(CFG)" == "ab0 - Win32 Debug" + +# Begin Custom Build - Compiling rpt $(InputPath)... +TargetDir=\P.32\P_02_00\exed +InputPath=..\ab\batbpdb.rpt +InputName=batbpdb + +"$(TargetDir)\$(InputName).rpt" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + rpt32 $(InputPath) $(TargetDir)\$(InputName).rpt + +# End Custom Build + +!ENDIF + +# End Source File # End Group # Begin Group "Masks" @@ -129,7 +204,7 @@ SOURCE=..\ab\ab0200a.uml !IF "$(CFG)" == "ab0 - Win32 Release" # Begin Custom Build - Compiling mask $(InputPath)... -TargetDir=\U\Luca\r020200.aga\exe +TargetDir=\P.32\P_02_00\exe InputPath=..\ab\ab0200a.uml InputName=ab0200a @@ -141,7 +216,7 @@ InputName=ab0200a !ELSEIF "$(CFG)" == "ab0 - Win32 Debug" # Begin Custom Build - Compiling mask $(InputPath)... -TargetDir=\U\Luca\r020200.aga\exed +TargetDir=\P.32\P_02_00\exed InputPath=..\ab\ab0200a.uml InputName=ab0200a @@ -152,6 +227,132 @@ InputName=ab0200a !ENDIF +# End Source File +# Begin Source File + +SOURCE=..\ab\bastarb.uml + +!IF "$(CFG)" == "ab0 - Win32 Release" + +!ELSEIF "$(CFG)" == "ab0 - Win32 Debug" + +# Begin Custom Build - Compiling mask $(InputPath)... +TargetDir=\P.32\P_02_00\exed +InputPath=..\ab\bastarb.uml +InputName=bastarb + +"$(TargetDir)\$(InputName).msk" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + msk32 $(InputPath) $(TargetDir)\$(InputName).msk + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\ab\bastntb.uml + +!IF "$(CFG)" == "ab0 - Win32 Release" + +!ELSEIF "$(CFG)" == "ab0 - Win32 Debug" + +# Begin Custom Build - Compiling mask $(InputPath)... +TargetDir=\P.32\P_02_00\exed +InputPath=..\ab\bastntb.uml +InputName=bastntb + +"$(TargetDir)\$(InputName).msk" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + msk32 $(InputPath) $(TargetDir)\$(InputName).msk + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\ab\bastpdb.uml + +!IF "$(CFG)" == "ab0 - Win32 Release" + +!ELSEIF "$(CFG)" == "ab0 - Win32 Debug" + +# Begin Custom Build - Compiling mask $(InputPath)... +TargetDir=\P.32\P_02_00\exed +InputPath=..\ab\bastpdb.uml +InputName=bastpdb + +"$(TargetDir)\$(InputName).msk" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + msk32 $(InputPath) $(TargetDir)\$(InputName).msk + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\ab\batbarb.uml + +!IF "$(CFG)" == "ab0 - Win32 Release" + +!ELSEIF "$(CFG)" == "ab0 - Win32 Debug" + +# Begin Custom Build - Compiling mask $(InputPath)... +TargetDir=\P.32\P_02_00\exed +InputPath=..\ab\batbarb.uml +InputName=batbarb + +"$(TargetDir)\$(InputName).msk" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + msk32 $(InputPath) $(TargetDir)\$(InputName).msk + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\ab\batbntb.uml + +!IF "$(CFG)" == "ab0 - Win32 Release" + +!ELSEIF "$(CFG)" == "ab0 - Win32 Debug" + +# Begin Custom Build - Compiling mask $(InputPath)... +TargetDir=\P.32\P_02_00\exed +InputPath=..\ab\batbntb.uml +InputName=batbntb + +"$(TargetDir)\$(InputName).msk" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + msk32 $(InputPath) $(TargetDir)\$(InputName).msk + +# End Custom Build + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\ab\batbpdb.uml + +!IF "$(CFG)" == "ab0 - Win32 Release" + +!ELSEIF "$(CFG)" == "ab0 - Win32 Debug" + +# Begin Custom Build - Compiling mask $(InputPath)... +TargetDir=\P.32\P_02_00\exed +InputPath=..\ab\batbpdb.uml +InputName=batbpdb + +"$(TargetDir)\$(InputName).msk" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + msk32 $(InputPath) $(TargetDir)\$(InputName).msk + +# End Custom Build + +!ENDIF + # End Source File # End Group # Begin Source File @@ -170,33 +371,6 @@ SOURCE=.\ab0.rc !ENDIF -# End Source File -# Begin Source File - -SOURCE=..\Lib\AgaLib.lib - -!IF "$(CFG)" == "ab0 - Win32 Release" - -!ELSEIF "$(CFG)" == "ab0 - Win32 Debug" - -# PROP Intermediate_Dir "..\lib\agalib.lib" -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\Lib\AgaLibD.lib - -!IF "$(CFG)" == "ab0 - Win32 Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "ab0 - Win32 Debug" - -!ENDIF - # End Source File # End Target # End Project diff --git a/projects/ab0.rc b/projects/ab0.rc new file mode 100755 index 000000000..fbc4ec470 --- /dev/null +++ b/projects/ab0.rc @@ -0,0 +1,4 @@ +"9012" ICON DISCARDABLE "../exe/res/campo.ico" + +rcinclude ../../wx240/include/wx/msw/wx.rc + diff --git a/projects/ab1.dsp b/projects/ab1.dsp index b3cd3d9a2..265fc51b3 100755 --- a/projects/ab1.dsp +++ b/projects/ab1.dsp @@ -121,7 +121,7 @@ SOURCE=..\ab\ab1200.frm !IF "$(CFG)" == "ab1 - Win32 Release" # Begin Custom Build - Compiling form $(InputPath)... -TargetDir=\U\Luca\r020200.aga\exe +TargetDir=\P.32\P_02_00\exe InputPath=..\ab\ab1200.frm InputName=ab1200 @@ -133,7 +133,7 @@ InputName=ab1200 !ELSEIF "$(CFG)" == "ab1 - Win32 Debug" # Begin Custom Build - Compiling form $(InputPath)... -TargetDir=\U\Luca\r020200.aga\exed +TargetDir=\P.32\P_02_00\exed InputPath=..\ab\ab1200.frm InputName=ab1200 @@ -156,7 +156,7 @@ SOURCE=..\ab\ab1200.uml !IF "$(CFG)" == "ab1 - Win32 Release" # Begin Custom Build - Compiling mask $(InputPath)... -TargetDir=\U\Luca\r020200.aga\exe +TargetDir=\P.32\P_02_00\exe InputPath=..\ab\ab1200.uml InputName=ab1200 @@ -168,7 +168,7 @@ InputName=ab1200 !ELSEIF "$(CFG)" == "ab1 - Win32 Debug" # Begin Custom Build - Compiling mask $(InputPath)... -TargetDir=\U\Luca\r020200.aga\exed +TargetDir=\P.32\P_02_00\exed InputPath=..\ab\ab1200.uml InputName=ab1200 @@ -197,33 +197,6 @@ SOURCE=.\ab1.rc !ENDIF -# End Source File -# Begin Source File - -SOURCE=..\Lib\AgaLib.lib - -!IF "$(CFG)" == "ab1 - Win32 Release" - -!ELSEIF "$(CFG)" == "ab1 - Win32 Debug" - -# PROP Intermediate_Dir "..\lib\agalib.lib" -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\Lib\AgaLibD.lib - -!IF "$(CFG)" == "ab1 - Win32 Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "ab1 - Win32 Debug" - -!ENDIF - # End Source File # End Target # End Project diff --git a/projects/ab1.rc b/projects/ab1.rc new file mode 100755 index 000000000..fbc4ec470 --- /dev/null +++ b/projects/ab1.rc @@ -0,0 +1,4 @@ +"9012" ICON DISCARDABLE "../exe/res/campo.ico" + +rcinclude ../../wx240/include/wx/msw/wx.rc + diff --git a/projects/ab2.dsp b/projects/ab2.dsp index e03281133..b7094d786 100755 --- a/projects/ab2.dsp +++ b/projects/ab2.dsp @@ -125,7 +125,7 @@ SOURCE=..\ab\ab2100a.uml !IF "$(CFG)" == "ab2 - Win32 Release" # Begin Custom Build - Compiling mask $(InputPath)... -TargetDir=\U\Luca\r020200.aga\exe +TargetDir=\P.32\P_02_00\exe InputPath=..\ab\ab2100a.uml InputName=ab2100a @@ -137,7 +137,7 @@ InputName=ab2100a !ELSEIF "$(CFG)" == "ab2 - Win32 Debug" # Begin Custom Build - Compiling mask $(InputPath)... -TargetDir=\U\Luca\r020200.aga\exed +TargetDir=\P.32\P_02_00\exed InputPath=..\ab\ab2100a.uml InputName=ab2100a @@ -166,33 +166,6 @@ SOURCE=.\ab2.rc !ENDIF -# End Source File -# Begin Source File - -SOURCE=..\Lib\AgaLib.lib - -!IF "$(CFG)" == "ab2 - Win32 Release" - -!ELSEIF "$(CFG)" == "ab2 - Win32 Debug" - -# PROP Intermediate_Dir "..\lib\agalib.lib" -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\Lib\AgaLibD.lib - -!IF "$(CFG)" == "ab2 - Win32 Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "ab2 - Win32 Debug" - -!ENDIF - # End Source File # End Target # End Project diff --git a/projects/ab2.rc b/projects/ab2.rc new file mode 100755 index 000000000..fbc4ec470 --- /dev/null +++ b/projects/ab2.rc @@ -0,0 +1,4 @@ +"9012" ICON DISCARDABLE "../exe/res/campo.ico" + +rcinclude ../../wx240/include/wx/msw/wx.rc + diff --git a/projects/ab3.dsp b/projects/ab3.dsp index 197d0771d..bfb3f629c 100755 --- a/projects/ab3.dsp +++ b/projects/ab3.dsp @@ -117,7 +117,7 @@ SOURCE=..\ab\ab3100a.uml !IF "$(CFG)" == "ab3 - Win32 Release" # Begin Custom Build - Compiling mask $(InputPath)... -TargetDir=\U\Luca\r020200.aga\exe +TargetDir=\P.32\P_02_00\exe InputPath=..\ab\ab3100a.uml InputName=ab3100a @@ -129,7 +129,7 @@ InputName=ab3100a !ELSEIF "$(CFG)" == "ab3 - Win32 Debug" # Begin Custom Build - Compiling mask $(InputPath)... -TargetDir=\U\Luca\r020200.aga\exed +TargetDir=\P.32\P_02_00\exed InputPath=..\ab\ab3100a.uml InputName=ab3100a @@ -158,33 +158,6 @@ SOURCE=.\ab3.rc !ENDIF -# End Source File -# Begin Source File - -SOURCE=..\Lib\AgaLib.lib - -!IF "$(CFG)" == "ab3 - Win32 Release" - -!ELSEIF "$(CFG)" == "ab3 - Win32 Debug" - -# PROP Intermediate_Dir "..\lib\agalib.lib" -# PROP Exclude_From_Build 1 - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=..\Lib\AgaLibD.lib - -!IF "$(CFG)" == "ab3 - Win32 Release" - -# PROP Exclude_From_Build 1 - -!ELSEIF "$(CFG)" == "ab3 - Win32 Debug" - -!ENDIF - # End Source File # End Target # End Project diff --git a/projects/ab3.rc b/projects/ab3.rc new file mode 100755 index 000000000..fbc4ec470 --- /dev/null +++ b/projects/ab3.rc @@ -0,0 +1,4 @@ +"9012" ICON DISCARDABLE "../exe/res/campo.ico" + +rcinclude ../../wx240/include/wx/msw/wx.rc +