From 8e703892668278af964bd50b18858b39842acefc Mon Sep 17 00:00:00 2001 From: guy Date: Wed, 15 Feb 1995 17:00:56 +0000 Subject: [PATCH] Corretto annullamento stampa etichette Aggiunte nuove procedure di conversione speciale a bacnv Corretto programma conversione archivi git-svn-id: svn://10.65.10.50/trunk@1006 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ba/ba1100.cpp | 7 +++- ba/ba1100d.uml | 6 ++-- ba/ba3200.cpp | 29 ++++++++--------- ba/ba6100.cpp | 87 +++++++++++++++++++++++++------------------------- ba/ba6100.h | 4 +-- ba/ba6101.cpp | 24 +++++++------- ba/bacnv.cpp | 64 +++++++++++++++++++++++++++++++------ ba/batbban.rpt | 2 +- ba/batbinl.uml | 6 ++-- ba/fconv.ini | 2 ++ ba/prassi.mnu | 3 +- 11 files changed, 143 insertions(+), 91 deletions(-) diff --git a/ba/ba1100.cpp b/ba/ba1100.cpp index 2ea0e0cf2..b16e07082 100755 --- a/ba/ba1100.cpp +++ b/ba/ba1100.cpp @@ -594,7 +594,8 @@ void TManutenzione_app::update() update_dir(); convert_dir(); - TLocalisamfile ditte(LF_NDITTE); + TSystemisamfile ditte(LF_NDITTE); + ditte.open(); for (ditte.first(); !ditte.eof(); ditte.next()) { @@ -603,12 +604,16 @@ void TManutenzione_app::update() if (prefhndl->exist(codditta)) { + ditte.close(); set_firm(codditta); update_dir(); convert_dir(); + ditte.open(); } ditte.readat(rec); } + ditte.close(); + if (firm > 0) set_firm(firm); else prefhndl->set(pref); diff --git a/ba/ba1100d.uml b/ba/ba1100d.uml index c2df42c5f..a0b0ec86a 100755 --- a/ba/ba1100d.uml +++ b/ba/ba1100d.uml @@ -60,7 +60,7 @@ END SPREADSHEET F_KEYS BEGIN - PROMPT 1 13 "" + PROMPT 0 13 "" ITEM "Espressione@60" ITEM "Chiavi duplicate" END @@ -121,9 +121,9 @@ END NUMBER FLD_DEC 2 BEGIN PROMPT 2 5 "Decimali " - FLAGS "R" + FLAGS "UR" HELP "Decimali del campo" - NUM_EXPR {(#THIS_FIELD>=0) && (#THIS_FIELD+2<=#FLD_LEN)} + NUM_EXPR {(#FLD_TIPO!=4)||(#THIS_FIELD+2<=#FLD_LEN)} WARNING "Numero di decimali errato" END diff --git a/ba/ba3200.cpp b/ba/ba3200.cpp index 5492d27e2..141d7488d 100755 --- a/ba/ba3200.cpp +++ b/ba/ba3200.cpp @@ -79,10 +79,12 @@ bool BA3200_application::set_print(int) _cur->setregion (from, to); - set_background(); - if (_stampa_ca7) - set_background("W1l{1 3 132 3}W1l{1 5 132 5}"); - else set_background("W1l{1 3 132 3}W1l{1 6 132 6}"); + /* + if (_stampa_ca7) + set_background("W1l{1 3 132 3}W1l{1 5 132 5}"); + else set_background("W1l{1 3 132 3}W1l{1 6 132 6}"); + */ + set_headers(); return TRUE; } return FALSE; @@ -205,10 +207,12 @@ void BA3200_application::set_headers() if (riga_intesta) last_riga += riga_intesta; last_riga++; + //set_header (last_riga, (const char *)sep); - last_riga++; sep.fill(' '); set_header (last_riga, (const char *)sep); + + set_background(format("W1l{1 3 %d 3}W1l{1 %d %d %d}", LungRiga, last_riga, LungRiga, last_riga)); } void BA3200_application::set_rows() @@ -357,21 +361,16 @@ bool BA3200_application::user_create() t.ltrim(1); _rptname << "batb" << t << ".rpt" ; + if (!fexist(_rptname)) + return error_box("Impossibile aprire il file '%s'", (const char*)_rptname); // Flag per la stampa tabella registri - _stampa_registri = (_tabname.upper() == "REG"); - _stampa_ca7 = (_tabname.upper() == "%CA7"); + _tabname.upper(); + _stampa_registri = (_tabname == "REG"); + _stampa_ca7 = (_tabname == "%CA7"); - if (!fexist(_rptname)) - fatal_box("Impossibile aprire il file '%s'", (const char*)_rptname); - _rel = new TRelation (_tabname); _cur = new TCursor (_rel); - t = _tabname; - - if (t[0] == '%') - t.ltrim(1); - _maskname << "bast" << t; _msk = new TMask (_maskname) ; diff --git a/ba/ba6100.cpp b/ba/ba6100.cpp index 00f4d5a5b..4db59637a 100755 --- a/ba/ba6100.cpp +++ b/ba/ba6100.cpp @@ -11,7 +11,7 @@ // ------- utils -------------------------------------------- -TRectype& BA6100_App::look_com(const char* cod) +TRectype& TAnaprint_app::look_com(const char* cod) { _comuni->curr().zero(); if (*cod) @@ -24,8 +24,8 @@ TRectype& BA6100_App::look_com(const char* cod) return _comuni->curr(); } -const char* BA6100_App::look_tab(const char* tabname, const char* cod, - const char* fld) +const char* TAnaprint_app::look_tab(const char* tabname, const char* cod, + const char* fld) { if (*cod == 0) return ""; TTable tab(tabname); @@ -38,7 +38,7 @@ const char* BA6100_App::look_tab(const char* tabname, const char* cod, // link -void BA6100_App::process_link(int id, const char* txt) +void TAnaprint_app::process_link(int id, const char* txt) { if (id == _ana_link) { @@ -61,7 +61,7 @@ void BA6100_App::process_link(int id, const char* txt) // ---- here we go ------------------------------------------------- -void BA6100_App::set_page(int file, int cnt) +void TAnaprint_app::set_page(int file, int cnt) { switch(file) { @@ -101,7 +101,7 @@ void BA6100_App::set_page(int file, int cnt) } -bool BA6100_App::preprocess_page(int file, int counter) +bool TAnaprint_app::preprocess_page(int file, int counter) { // non stampa la prima ditta se sta facendo l'elenco visto // che la stampa a fianco dell'anagrafica @@ -137,7 +137,7 @@ bool mask_reset_fields(TMask_field& mf, KEY k) if (k == K_SPACE) { TMask& m = mf.mask(); - BA6100_App& a = (BA6100_App&)main_app(); + TAnaprint_app& a = (TAnaprint_app&)main_app(); m.set(FLD_BA6B_INDROW, a._ind_row); m.set(FLD_BA6B_INDCOL, a._ind_col); m.set(FLD_BA6B_PIVROW, a._piv_row); @@ -153,7 +153,7 @@ bool mask_reset_fields(TMask_field& mf, KEY k) } -void BA6100_App::preprocess_etichette() +void TAnaprint_app::preprocess_etichette() { // everything goes into strings _name = get_field(LF_ANAG,"RAGSOC"); @@ -211,7 +211,7 @@ void BA6100_App::preprocess_etichette() } -void BA6100_App::init_print() +void TAnaprint_app::init_print() { reset_print(); reset_files(); @@ -258,7 +258,7 @@ void BA6100_App::init_print() set_headers(); } -bool BA6100_App::set_print(int) +bool TAnaprint_app::set_print(int) { TMask mask("ba6100a.msk"); // set print type @@ -286,50 +286,51 @@ bool BA6100_App::set_print(int) TMask mask2("ba6100b.msk"); mask2.set_workfile("ba6100.set"); - mask2.set_handler(BUT_BA6B_RESET, mask_reset_fields); + mask2.set_handler(BUT_BA6B_RESET, mask_reset_fields); if (fexist("ba6100b.set")) { mask2.load(); - _ind_what = (in)atoi(mask2.get(RDB_BA6B_INDIR)); - _ind_row = atoi(mask2.get(FLD_BA6B_INDROW)); - _piv_row = atoi(mask2.get(FLD_BA6B_PIVROW)); - _cod_row = atoi(mask2.get(FLD_BA6B_CODROW)); - _rows_et = atoi(mask2.get(FLD_BA6B_TOTROW)); - _ind_col = atoi(mask2.get(FLD_BA6B_INDCOL)); - _piv_col = atoi(mask2.get(FLD_BA6B_PIVCOL)); - _cod_col = atoi(mask2.get(FLD_BA6B_CODCOL)); - _cols_et = atoi(mask2.get(FLD_BA6B_TOTCOL)); + _ind_what = (in)mask2.get_int(RDB_BA6B_INDIR); + _ind_row = mask2.get_int(FLD_BA6B_INDROW); + _piv_row = mask2.get_int(FLD_BA6B_PIVROW); + _cod_row = mask2.get_int(FLD_BA6B_CODROW); + _rows_et = mask2.get_int(FLD_BA6B_TOTROW); + _ind_col = mask2.get_int(FLD_BA6B_INDCOL); + _piv_col = mask2.get_int(FLD_BA6B_PIVCOL); + _cod_col = mask2.get_int(FLD_BA6B_CODCOL); + _cols_et = mask2.get_int(FLD_BA6B_TOTCOL); _is_piv = mask2.get(CHK_BA6B_PIVA) == "X"; _is_cod = mask2.get(CHK_BA6B_CODICE) == "X"; } else { - mask2.field(FLD_BA6B_INDROW).set(format("%d",_ind_row)); - mask2.field(FLD_BA6B_INDCOL).set(format("%d",_ind_col)); - mask2.field(FLD_BA6B_PIVROW).set(format("%d",_piv_row)); - mask2.field(FLD_BA6B_PIVCOL).set(format("%d",_piv_col)); - mask2.field(FLD_BA6B_CODROW).set(format("%d",_cod_row)); - mask2.field(FLD_BA6B_CODCOL).set(format("%d",_cod_col)); - mask2.field(FLD_BA6B_TOTROW).set(format("%d",_rows_et)); - mask2.field(FLD_BA6B_TOTCOL).set(format("%d",_cols_et)); - mask2.field(CHK_BA6B_PIVA).set(_is_piv ? "X" : " "); - mask2.field(CHK_BA6B_CODICE).set(_is_cod ?"X": " "); + mask2.set(FLD_BA6B_INDROW,_ind_row); + mask2.set(FLD_BA6B_INDCOL,_ind_col); + mask2.set(FLD_BA6B_PIVROW,_piv_row); + mask2.set(FLD_BA6B_PIVCOL,_piv_col); + mask2.set(FLD_BA6B_CODROW,_cod_row); + mask2.set(FLD_BA6B_CODCOL,_cod_col); + mask2.set(FLD_BA6B_TOTROW,_rows_et); + mask2.set(FLD_BA6B_TOTCOL,_cols_et); + mask2.set(CHK_BA6B_PIVA,_is_piv ? "X" : " "); + mask2.set(CHK_BA6B_CODICE,_is_cod ?"X": " "); } - mask2.run(); + if (mask2.run() == K_ESC) + return FALSE; - _ind_what = (in)atoi(mask2.get(RDB_BA6B_INDIR)); - _ind_row = atoi(mask2.get(FLD_BA6B_INDROW)); - _piv_row = atoi(mask2.get(FLD_BA6B_PIVROW)); - _cod_row = atoi(mask2.get(FLD_BA6B_CODROW)); - _rows_et = atoi(mask2.get(FLD_BA6B_TOTROW)); - _ind_col = atoi(mask2.get(FLD_BA6B_INDCOL)); - _piv_col = atoi(mask2.get(FLD_BA6B_PIVCOL)); - _cod_col = atoi(mask2.get(FLD_BA6B_CODCOL)); - _cols_et = atoi(mask2.get(FLD_BA6B_TOTCOL)); + _ind_what = (in)mask2.get_int(RDB_BA6B_INDIR); + _ind_row = mask2.get_int(FLD_BA6B_INDROW); + _piv_row = mask2.get_int(FLD_BA6B_PIVROW); + _cod_row = mask2.get_int(FLD_BA6B_CODROW); + _rows_et = mask2.get_int(FLD_BA6B_TOTROW); + _ind_col = mask2.get_int(FLD_BA6B_INDCOL); + _piv_col = mask2.get_int(FLD_BA6B_PIVCOL); + _cod_col = mask2.get_int(FLD_BA6B_CODCOL); + _cols_et = mask2.get_int(FLD_BA6B_TOTCOL); _is_piv = mask2.get(CHK_BA6B_PIVA) == "X"; _is_cod = mask2.get(CHK_BA6B_CODICE) == "X"; @@ -450,7 +451,7 @@ bool BA6100_App::set_print(int) return TRUE; } -bool BA6100_App::user_create() +bool TAnaprint_app::user_create() { TToken_string rxp(40); @@ -542,7 +543,7 @@ bool BA6100_App::user_create() return TRUE; } -bool BA6100_App::user_destroy() +bool TAnaprint_app::user_destroy() { if (_rel_fis) delete _rel_fis; if (_rel_giu) delete _rel_giu; @@ -556,7 +557,7 @@ bool BA6100_App::user_destroy() int ba6100(int argc, char* argv[]) { - BA6100_App app; + TAnaprint_app app; app.run(argc, argv, "Stampa Anagrafiche"); return 0; } diff --git a/ba/ba6100.h b/ba/ba6100.h index db1042de4..aba7e9f9d 100755 --- a/ba/ba6100.h +++ b/ba/ba6100.h @@ -20,7 +20,7 @@ enum in { residenza = 1, domfisc = 2, corrispondenza = 3 }; bool mask_reset_fields(TMask_field& mf, KEY k); -class BA6100_App : public TPrintapp +class TAnaprint_app : public TPrintapp { friend bool mask_reset_fields(TMask_field& mf, KEY k); @@ -86,7 +86,7 @@ public: void init_print(); - BA6100_App() : TPrintapp(), _cod(5), _cofi(30), _name(20), _surname(30), + TAnaprint_app() : TPrintapp(), _cod(5), _cofi(30), _name(20), _surname(30), _address(50), _cap(10), _prov(2), _com(50), _civ(5), _stato(40), _phone(30) diff --git a/ba/ba6101.cpp b/ba/ba6101.cpp index 2b1fcc95b..c46e20df7 100755 --- a/ba/ba6101.cpp +++ b/ba/ba6101.cpp @@ -8,7 +8,7 @@ static const char sep[] = "-----------------------------------------------------------------" "-----------------------------------------------------------------" ; -void BA6100_App::set_scheda_anagiu() +void TAnaprint_app::set_scheda_anagiu() { set_row(1,"SCHEDA SOCIETA'"); set_row(2,""); @@ -172,7 +172,7 @@ void BA6100_App::set_scheda_anagiu() set_row(i, ""); } -void BA6100_App::set_scheda_anafis() +void TAnaprint_app::set_scheda_anafis() { set_row(1,"SCHEDA PERSONA FISICA"); set_row(2,""); @@ -335,7 +335,7 @@ void BA6100_App::set_scheda_anafis() set_row(i, ""); } -void BA6100_App::set_scheda_ditta() +void TAnaprint_app::set_scheda_ditta() { set_row(1,"@bSCHEDA DITTA @r@u@pn@r@20g@bDenominaz. sociale @r@u@s", FLD(LF_NDITTE,"CODDITTA","@@@@@"), @@ -380,7 +380,7 @@ void BA6100_App::set_scheda_ditta() set_row(15,""); set_row(16,""); } -void BA6100_App::set_scheda_attiv() +void TAnaprint_app::set_scheda_attiv() { TString dio = look_tab("%AIS",current_cursor()-> curr(LF_ATTIV).get("CODATT"),"S0"); @@ -445,12 +445,12 @@ void BA6100_App::set_scheda_attiv() set_row(17,""); set_row(18,""); } -void BA6100_App::set_scheda_registro() +void TAnaprint_app::set_scheda_registro() { /* TBI */ } -void BA6100_App::set_scheda_unloc() +void TAnaprint_app::set_scheda_unloc() { set_row(1,"@bUNITA' LOCALE@20gCodice @r@u@pn@r", FLD(LF_UNLOC,"CODULC","@@@")); @@ -499,7 +499,7 @@ void BA6100_App::set_scheda_unloc() set_row(17,""); set_row(18,""); } -void BA6100_App::set_scheda_socio() +void TAnaprint_app::set_scheda_socio() { int rw; TString b1, b2, b3; @@ -637,7 +637,7 @@ void BA6100_App::set_scheda_socio() } -void BA6100_App::set_rubriche() +void TAnaprint_app::set_rubriche() { // preprocess_page will fill the vars set_row(2,"@32g@35S", FLD(LF_ANAG,"INDRES")); @@ -666,7 +666,7 @@ void BA6100_App::set_rubriche() -void BA6100_App::set_elenco() +void TAnaprint_app::set_elenco() { switch(_pr_what) { @@ -714,7 +714,7 @@ void BA6100_App::set_elenco() set_row(2,""); } -void BA6100_App::set_schede() +void TAnaprint_app::set_schede() { switch(_pr_what) { @@ -725,7 +725,7 @@ void BA6100_App::set_schede() } -void BA6100_App::set_headers() +void TAnaprint_app::set_headers() { reset_header(); set_background(); @@ -801,7 +801,7 @@ void BA6100_App::set_headers() } -void BA6100_App::set_etichette() +void TAnaprint_app::set_etichette() { int namerow = 0; diff --git a/ba/bacnv.cpp b/ba/bacnv.cpp index a5a0f2f7e..c5c9ee43c 100755 --- a/ba/bacnv.cpp +++ b/ba/bacnv.cpp @@ -5,12 +5,13 @@ #include #include #include +#include #include #include #include -#define usage "Errore - uso : bacnv 1 ditta" +#define usage "Errore - uso : bacnv [1|2] ditta" class TConversione_archivi : public TApplication { @@ -19,15 +20,17 @@ class TConversione_archivi : public TApplication long _oldditta; int _error; -protected: +protected: // TApplication virtual bool create() ; virtual bool destroy() ; virtual bool menu(MENU_TAG); +public: bool convert_rmov(TLocalisamfile & rmov, TArray & recs, int nrecs); void contropartita_rmov(); -public: + void liala(const char* table); + TConversione_archivi() : _oldditta(0), _codditta(0), _error(0) {} }; @@ -79,12 +82,21 @@ bool TConversione_archivi::menu(MENU_TAG) { case 1: contropartita_rmov(); break; + case 2: + liala("LIA"); + liala("PLA"); + break; default: break; } return FALSE; } +/////////////////////////////////////////////////////////// +// Cambia i movimenti contabili in modo che abbiano un +// conto di contropartita e non una riga di riferimento +/////////////////////////////////////////////////////////// + bool TConversione_archivi::convert_rmov(TLocalisamfile & rmov, TArray & recs, int nrecs) { const TRecnotype pos = rmov.recno(); @@ -131,7 +143,7 @@ void TConversione_archivi::contropartita_rmov() int nrow = 0; TProgind p(nitems ? nitems : 1, format("Conversione righe di movimento della ditta %ld", get_firm()), - TRUE, TRUE, 70); + FALSE, TRUE, 70); for (rmov.first(); rmov.good(); rmov.next()) { p.addstatus(1); @@ -152,23 +164,55 @@ void TConversione_archivi::contropartita_rmov() return; } -HIDDEN void bacnv(int argc, char** argv) -{ - TConversione_archivi a ; - a.run(argc, argv, "Conversione archivi"); + +/////////////////////////////////////////////////////////// +// Passa le tabelle LIA e PLA a %LIA e %PLA +/////////////////////////////////////////////////////////// + +void TConversione_archivi::liala(const char* table) +{ + TString16 tab(table); + + TTable lia(tab); + tab.insert("%", 0); + TTable cia(tab); + + const long n = lia.items()+1; + TProgind p(n, format("Conversione tabella %s della ditta %ld", table, get_firm()), FALSE, TRUE, 70); + + TString16 firm; firm.format("%05ld", get_firm()); + TString16 codtab; + + for (lia.first(); lia.good(); lia.next()) + { + codtab = lia.get("CODTAB"); + codtab.insert(firm, 0); + lia.put("CODTAB", codtab); + cia.write(lia.curr()); + } + + for (lia.first(); lia.good(); lia.next()) + lia.remove(); } + +/////////////////////////////////////////////////////////// +// Programma di conversione archivi speciale +/////////////////////////////////////////////////////////// + int main(int argc,char** argv) { const int r = (argc > 1) ? atoi(argv[1]) : 0; - if (r <= 0 || r > 1) + if (r <= 0 || r > 2) { error_box(usage); return 100; } - bacnv(argc, argv); + TConversione_archivi a ; + a.run(argc, argv, "Conversione archivi"); + return 0; } diff --git a/ba/batbban.rpt b/ba/batbban.rpt index 3975f7315..d18892919 100755 --- a/ba/batbban.rpt +++ b/ba/batbban.rpt @@ -3,7 +3,7 @@ LF_COMUNI,COM==S5 [Headers] 132 -Tabella delle banche +Tabella Banche 1|@2g%s|Codice ABI 1|@14g%s|Codice CAB 1|@26g%s|Istituto diff --git a/ba/batbinl.uml b/ba/batbinl.uml index 329dabe4b..ae1e1a1b4 100755 --- a/ba/batbinl.uml +++ b/ba/batbinl.uml @@ -10,7 +10,7 @@ PAGE "Tabella Indici Libro Unico" -1 -1 71 20 NUMBER F_ANNO 4 BEGIN - PROMPT 1 1 "Anno esercizio " + PROMPT 1 1 "Anno " FLAGS "A" FIELD ANNO USE %LBU @@ -22,6 +22,7 @@ BEGIN OUTPUT F_ANNO CODTAB[1,4] OUTPUT F_CODLIB CODTAB[5,7] CHECKTYPE REQUIRED + MESSAGE COPY,F_ANNOREG KEY 1 END @@ -57,8 +58,7 @@ NUMBER F_ANNOREG 4 BEGIN PROMPT 1 2 "Anno registrazione " FIELD ANNOREG - FLAGS "A" - CHECKTYPE REQUIRED + FLAGS "D" END LIST F_MESE 2 12 diff --git a/ba/fconv.ini b/ba/fconv.ini index 359d237ff..5f615ba66 100755 --- a/ba/fconv.ini +++ b/ba/fconv.ini @@ -4,5 +4,7 @@ F(4)=COD=CODTAB[1,3]|CODTAB=CODTAB[4,] F(5)=COD=CODTAB[1,3]|CODTAB=CODTAB[4,] [199404] ACNV(24)=bacnv 1 +[199407] +ACNV(5)=bacnv 2 [EOF] diff --git a/ba/prassi.mnu b/ba/prassi.mnu index 92f4d3dc9..4d758dbae 100755 --- a/ba/prassi.mnu +++ b/ba/prassi.mnu @@ -139,7 +139,8 @@ 15|Salvataggi|ba2 -1 16|Servizio| 16|Copia Archivi|cg4 -1 -16|Ripristino stampa registri|cg5 -4 +16|Ripristino stampa registri|cg5 -4 reg +16|Ripristino indici libro unico|cg5 -4 inl 16|Ripristino liquidazione|cg5 -6 17|Modello 770|2 17|Manutenzione dichiarazioni|18|F,4