diff --git a/ba/ba0100.cpp b/ba/ba0100.cpp index 6ca18d578..b9d7ccd8a 100755 --- a/ba/ba0100.cpp +++ b/ba/ba0100.cpp @@ -947,7 +947,7 @@ void TMenu_application::reload_images() const TString& TMenu_application::ask_user_password() { - TString utente = user(); + TString16 utente = user(); #ifndef _DEMO_ // Disabilita le voci di personalizzazione diff --git a/ba/ba1700.cpp b/ba/ba1700.cpp index 8ea51f795..9ac6e7f82 100755 --- a/ba/ba1700.cpp +++ b/ba/ba1700.cpp @@ -35,15 +35,16 @@ HIDDEN int compare_version(const char* v1, int p1, const char* v2, int p2) { TString16 ver1(v1), ver2(v2); - ver1.trim(); - if (ver1.len() == 4) - ver1.insert((v1[0] == '9') ? "19" : "20", 0); - ver2.trim(); - if (ver2.len() == 4) - ver2.insert((v2[0] == '9') ? "19" : "20", 0); - int res = ver1.compare(ver2, -1, true); - if (res == 0) + ver1.trim(); + ver1.ltrim(ver1.len() == 4 ? 2 : 4); + ver2.trim(); + ver2.ltrim(ver2.len() == 4 ? 2 : 4); + + int res = ver1.compare(ver2, -1, TRUE); + + if (res == 0) + res = p1 - p2; return res; @@ -338,9 +339,10 @@ bool TInstaller_mask::autoload() } if (!ininame.exist()) { - bool httpresult; + bool httpresult = http_isredirected_server(http_server, http_path); + TFilename remote_ini = http_path; - remote_ini << TInstall_ini::default_name(); + remote_ini << TInstall_ini::default_name(); { TIndwin contacting(60,TR("Connessione al server HTTP..."),false,false); httpresult=http_get(http_server, remote_ini, ininame); @@ -496,7 +498,8 @@ bool TInstaller_mask::autoload() const TString16 patchversion = ini.get("Versione"); const int patchlevel = ini.get_int("Patch"); TToken_string& row = mask_rows.row(r); - if (patchversion == row.get(C_RELEASE) // se le versioni corrispondono ... + const TString16 release(row.get(C_RELEASE)); + if (patchversion.mid(4) == release.mid(4) // se le versioni corrispondono ... && patchlevel > row.get_int(C_PATCH)) // ..e il patchlevel è superiore { TString16 patch; patch.format("%03d", patchlevel); //aggiunge zeri per avere 3 cifre sempre @@ -506,6 +509,8 @@ bool TInstaller_mask::autoload() row.add(row.get(C_PATCH), C_BASEPATCH); // memorizza patch del modulo } row.add(patch, C_PATCH); // aggiorna il patchlevel mostrato per il modulo + if (release < patchversion) + row.add(patchversion, C_RELEASE); } } else @@ -822,8 +827,7 @@ bool TInstaller_mask::install(const TString& module, int patchlevel) if (is_a_patch) msg << TR(" della patch ") << patchlevel ; msg << TR(" del modulo '") << module << TR("' in corso..."); - xvtil_statbar_set(msg); - + TProgind pi(dischi, msg, false, true); TFilename tempdir; tempdir.tempdir(); // File tottale dei vari sotto-zip @@ -907,8 +911,7 @@ bool TInstaller_mask::install(const TString& module, int patchlevel) { msg.cut(0); msg << TR("Aggiornamento del modulo '") << module << TR("' in corso..."); - xvtil_statbar_set(msg); - + pi.set_text(msg); ok = move_module(module, *ini, true); if (ok) @@ -1111,8 +1114,8 @@ bool TInstaller_mask::install_patches(const TString& module, const TString& last const TString16 patchmodule = ininame.mid(pos-6, 2); TConfig ini(ininame, patchmodule); const int patchlevel = ini.get_int("Patch"); - const char * patchversion = ini.get("Versione"); - if (ok && lastrelease == patchversion // installa solo le patch della stessa ver.. + const TString16 patchversion = ini.get("Versione"); + if (ok && lastrelease.mid(4) == patchversion.mid(4) // installa solo le patch della stessa ver.. && (only_newer ? lastpatch < patchlevel : lastpatch <= patchlevel)) // ... e patch superiore o uguale (reinstalla l'ultima patch) ok = install(module, patchlevel); } @@ -1196,24 +1199,35 @@ void TInstaller_mask::install_selection() bool is_patch = row->get_char(C_ISPATCH) == 'X'; bool has_patch = row->get_char(C_ISPATCH) == '+'; const int cmp = compare_version(oldver, oldpatch, newver, newpatch); + + //versione e patch coincidono if (cmp == 0) ok = noyes_box(FR("Si desidera reinstallare la versione %s.%d del modulo '%s' ?"), (const char*)newver, newpatch, (const char*)modulo); - if (!is_patch && cmp > 0) + + //ci sono ANCHE i pacchi + if (!is_patch && cmp > 0) { TString256 msg; msg.format(FR("Si desidera ritornare alla versione %s.%d del modulo '%s' ?\nAttenzione: non e' garantito il corretto\nfunzionamento di tutti i programmi!"), (const char*)newver, newpatch, (const char*)modulo); ok = noyes_box(msg); } + + //ci sono SOLO patch da installare if (ok && is_patch) { // installo le patch solo se esiste già un modulo installato della stessa versione if (!oldver.blank() ) { - if (oldver != newver) + if (compare_version(oldver, 0, newver, 0)) //controlla SOLO la versione indipendentemente dall'anno! ok = error_box(FR("Il modulo '%s' installato ha versione %s:\nimpossibile installare le patch della versione %s"),(const char *)modulo,(const char *)oldver,(const char *)newver); } else - ok =false;//error_box("Impossibile installare le patch perche' il modulo '%s' non e' installato",(const char *)modulo); - } + if (newpatch < oldpatch) + { + TString256 msg; + msg.format(FR("Si desidera ritornare alla patch %s.%d del modulo '%s' ?\nAttenzione: non e' garantito il corretto\nfunzionamento di tutti i programmi!"), (const char*)newver, newpatch, (const char*)modulo); + ok = noyes_box(msg); + } } + if (ok) { if (has_patch) @@ -1542,4 +1556,4 @@ int ba1700(int argc, char* argv[]) app.run(argc, argv, PROGNAME); } return 0; -} \ No newline at end of file +} diff --git a/ba/ba3100.cpp b/ba/ba3100.cpp index f35d3b588..77abe5ee8 100755 --- a/ba/ba3100.cpp +++ b/ba/ba3100.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -22,6 +23,7 @@ #define TAB_BANCHE "%BAN" #define TAB_CAMBI "CAM" #define TAB_DELEGHE "%DEL" +#define TAB_DET "%DET" #define TAB_IVDIRETTIVA "%IVD" #define TAB_REGISTRI "REG" #define TAB_VALUTE "%VAL" @@ -199,6 +201,13 @@ void TGeneric_table_app::init_modify_mode(TMask& m) { load_rec_in_disabled_fields(m); } + if (n == TAB_DET) + { + const bool prot = get_relation()->curr().get_bool(FPC); + + m.enable(DLG_SAVEREC, !prot); + m.enable(DLG_DELREC, !prot); + } } void TGeneric_table_app::init_query_mode(TMask& m) diff --git a/ba/ba3200.cpp b/ba/ba3200.cpp index 846ea1da9..9729229ee 100755 --- a/ba/ba3200.cpp +++ b/ba/ba3200.cpp @@ -29,19 +29,73 @@ TMask_print_table::TMask_print_table(const char * name) f.enable_check(); } +/////////////////////////////////////////////////////////// +// TTable_recordset +/////////////////////////////////////////////////////////// + +class TTable_recordset : public TISAM_recordset +{ + TMask * _mask; + +protected: + void set_custom_filter(TCursor& cursor) const; + +public: + TTable_recordset(const char* use, TMask * mask) : TISAM_recordset(use), _mask(mask) { } + virtual ~TTable_recordset() { } +}; + +void TTable_recordset::set_custom_filter(TCursor& cursor) const +{ + CHECK(_mask, "NULL selection mask"); + + TRectype from(cursor.curr()); from.zero(); + TRectype to(from); + + for (int i = _mask->fields() - 1; i >= 0; i--) + { + TMask_field& f = _mask->fld(i); + const TString & val = f.get(); + + if (val.full()) + { + const TFieldref * ref = f.field(); + + if (ref != NULL && ref->ok()) + { + const bool is_final = f.in_group(2); + + ref->write(val, is_final ? to : from); + } + } + } + cursor.setregion(from, to); +} + + /////////////////////////////////////////////////////////// // TTable_report /////////////////////////////////////////////////////////// class TTable_report : public TReport { + TMask * _mask; + +protected: + virtual bool set_recordset(const TString& query); + public: virtual bool use_mask() { return false;} - TTable_report() {} + TTable_report(TMask * mask) : _mask(mask) {} virtual ~TTable_report() {} }; +bool TTable_report::set_recordset(const TString& query) +{ + return TReport::set_recordset(new TTable_recordset(query, _mask)); +} + /////////////////////////////////////////////////////////// // TTable_reporter /////////////////////////////////////////////////////////// @@ -79,14 +133,14 @@ void TTable_reporter::main_loop() while (m.run() == K_ENTER) { - TTable_report rep; + TTable_report rep(&m); TReport_book book; TString name(m.get(F_REPORT)); if (name.empty()) name = rptname; rep.load(name); - rep.mask2report(m); +// rep.mask2report(m); book.add(rep); book.print_or_preview(); } diff --git a/ba/bainst00.cpp b/ba/bainst00.cpp index 3c2ef1bdf..7d6c955c4 100755 --- a/ba/bainst00.cpp +++ b/ba/bainst00.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include "bainst.h" #include "bainst00.h" @@ -18,6 +19,7 @@ protected: virtual bool post_installer(); virtual bool preload_mask(); virtual bool some_to_load(); + void check_std_code_det(const char * code, const char * descr); public: virtual ~TInstall_BA () {} @@ -101,19 +103,39 @@ bool TInstall_BA::preload_mask() if (empty) _m->set(F_TAB_CEE,"X"); } + check_std_code_det("1", "IVA indetraibile su acquisti riferiti a ricavi esenti"); + check_std_code_det("3", "IVA indicata per passaggi interni al solo fine del calcolo di ventilazione"); + check_std_code_det("9", "IVA non detraibile per l'articolo 19"); return TInstallmodule_app::preload_mask(); } -bool TInstall_BA ::install_com() +void TInstall_BA::check_std_code_det(const char * code, const char * descr) +{ + const TToken_string key(code); + const TRectype & tab = cache().get("%DET", key); + + if (tab.empty()) + { + TTable det("%DET"); + + det.curr().put("CODTAB", key); + det.curr().put("I0", key); + det.curr().put("S0", descr); + det.curr().put("R0", CENTO); + det.write(); + } +} + +bool TInstall_BA::install_com() { bool ok=TRUE; TStd_filename txtfile; + if (_m->get_bool(F_DEFAULTSDATA) && txtfile.check(TRUE,"lfiva.txt")) { TSystemisamfile tabcom(LF_TABCOM); tabcom.load((const char *)txtfile); } - if (_m->get_bool(F_TAB_CEE) && txtfile.check(TRUE,"batbsce.txt")) { TSystemisamfile tabcom(LF_TABCOM); diff --git a/ba/bainst07.cpp b/ba/bainst07.cpp index 74eb8c046..cb21478b3 100755 --- a/ba/bainst07.cpp +++ b/ba/bainst07.cpp @@ -9,8 +9,6 @@ bool all_ok; class TInstall_CG : public TInstallmodule_app { -private: - bool CreaExeIni(const char * exename); protected: virtual bool modal() const {return FALSE;} @@ -23,19 +21,9 @@ public: }; -// crea il .ini per i files exe copiati nella directory di EASYCAMPO -bool TInstall_CG ::CreaExeIni(const char * exename) -{ - return TRUE; -} - bool TInstall_CG ::post_installer() { bool ok=TRUE; - // copia dll (ex file PRASSI.PR inst.exe -// ok &= CreaExeIni("CB0000.EXE"); -// ok &= CreaExeIni("TRRICE.EXE"); -// ok &= CreaExeIni("VCOPIA.EXE"); return ok; } diff --git a/ba/batbcpg.h b/ba/batbcpg.h deleted file mode 100755 index 91173b824..000000000 --- a/ba/batbcpg.h +++ /dev/null @@ -1,24 +0,0 @@ -// posizione file comuni in _arrfiles - -// campi maschera batb%cpg.msk - -#define F_CODICE 101 -#define F_DESC 102 -#define F_TIPO 103 -#define F_INIZIOSCAD 104 -#define F_MESECOMM 105 -#define F_RATEDIFF 106 - - - - - - - - - - - - - - diff --git a/ba/batbcpg.uml b/ba/batbcpg.uml deleted file mode 100755 index f068698d8..000000000 --- a/ba/batbcpg.uml +++ /dev/null @@ -1,79 +0,0 @@ -#include "batbcpg.h" - -TOOLBAR "" 0 20 0 2 -#include -ENDPAGE - -PAGE "Tabella pagamenti" -1 -1 78 15 - -STRING F_CODICE 4 -BEGIN - PROMPT 4 1 "Codice " - HELP "Codice di pagamento" - FIELD LF_TABCOM->CODTAB - FLAGS "UZ" - USE %CPG - INPUT CODTAB F_CODICE - DISPLAY "Codice" CODTAB - DISPLAY "Tipo di pagamento@50" S0 - OUTPUT F_CODICE CODTAB - OUTPUT F_DESC S0 - CHECKTYPE REQUIRED - KEY 1 -END - -STRING F_DESC 50 -BEGIN - PROMPT 4 3 "Descrizione " - HELP "Descrizione del tipo di pagamento" - FIELD LF_TABCOM->S0 - USE %CPG KEY 2 - CHECKTYPE REQUIRED - INPUT S0 F_DESC - DISPLAY "Tipo di pagamento@50" S0 - DISPLAY "Codice" CODTAB - OUTPUT F_CODICE CODTAB - OUTPUT F_DESC S0 - KEY 2 -END - -LIST F_TIPO 2 32 -BEGIN - PROMPT 4 5 "Tipo " - FIELD LF_TABCOM->I0 - ITEM "1|Rimessa Diretta" - ITEM "2|Tratta" - ITEM "3|Ricevuta Bancaria" - ITEM "4|Cessione" - ITEM "5|Paghero'" - ITEM "6|Lettera di credito" - ITEM "7|Tratta accettata" - ITEM "8|Rapporti interbancari diretti" - ITEM "9|Bonifico" - ITEM "10|Altro" -END - -LIST F_INIZIOSCAD 14 -BEGIN - PROMPT 4 7 "Inizio scadenze " - FIELD LF_TABCOM->S7 - ITEM "F|Data fattura" - ITEM "M|Fine mese" - ITEM "D|Data fissa" -END - -BOOLEAN F_MESECOMM -BEGIN - PROMPT 4 9 "Mese commerciale" - FIELD LF_TABCOM->B0 -END - -BOOLEAN F_RATEDIFF -BEGIN - PROMPT 4 11 "Rate differenziate " - FIELD LF_TABCOM->B1 -END - -ENDPAGE - -ENDMASK diff --git a/ba/batbdet.uml b/ba/batbdet.uml index 48dd4212b..2f0416d25 100755 --- a/ba/batbdet.uml +++ b/ba/batbdet.uml @@ -29,12 +29,12 @@ BEGIN FLAGS "U" END -STRING F_DESC 50 +STRING F_DESC 70 50 BEGIN PROMPT 10 2 "Descrizione " FIELD S0 USE %DET KEY 2 - INPUT CODTAB F_CODICE + INPUT S0 F_DESC DISPLAY "Descrizione@50" S0 DISPLAY "Codice" CODTAB DISPLAY "Percentuale" R0 diff --git a/ba/batbiva.uml b/ba/batbiva.uml index 5244d5d12..63c00a0b3 100755 --- a/ba/batbiva.uml +++ b/ba/batbiva.uml @@ -142,7 +142,8 @@ BEGIN HELP "Inserire il numero della colonna degli allegati clienti relativa all'imposta" ITEM " |Non in allegato" ITEM "1|Imponibili" - ITEM "3|Non imponibili" + ITEM "2|Non imponibili" + ITEM "3|Senza applicaz.imposta" END LIST FLD_TABIVA_S8 1 24 @@ -152,8 +153,8 @@ BEGIN HELP "Inserire il numero della colonna degli allegati fornitori relativa all'imposta" ITEM " |Non in allegato" ITEM "1|Imponibili" + ITEM "2|Non imponibili" ITEM "3|Senza applicaz.imposta" - ITEM "4|Non imponibili" END GROUPBOX DLG_NULL 25 4 diff --git a/ba/batbtrb.h b/ba/batbtrb.h index 6fc7bb1b2..399876663 100755 --- a/ba/batbtrb.h +++ b/ba/batbtrb.h @@ -1,9 +1,8 @@ - - // campi maschera batb%trb.msk -#define F_CODICE 101 -#define F_DESCR 102 +#define F_CODICE 101 +#define F_DESCR 102 +#define F_SEZIONE 103 diff --git a/ba/batbtrb.uml b/ba/batbtrb.uml index c633f89b5..15bc0fa85 100755 --- a/ba/batbtrb.uml +++ b/ba/batbtrb.uml @@ -16,35 +16,45 @@ END STRING F_CODICE 4 BEGIN -PROMPT 4 2 "Codice " -HELP "Codice tributo" -FIELD CODTAB -KEY 1 -USE %TRB -INPUT CODTAB F_CODICE -DISPLAY "Codice" CODTAB -DISPLAY "Descrizione @50" S0 -OUTPUT F_CODICE CODTAB -OUTPUT F_DESCR S0 -FLAGS "Z" -CHECKTYPE REQUIRED + PROMPT 4 2 "Codice " + FIELD CODTAB + KEY 1 + USE %TRB + INPUT CODTAB F_CODICE + DISPLAY "Codice" CODTAB + DISPLAY "Descrizione@50" S0 + DISPLAY "Sezione" S6 + OUTPUT F_CODICE CODTAB + OUTPUT F_DESCR S0 + FLAGS "U" + CHECKTYPE REQUIRED END STRING F_DESCR 50 BEGIN -PROMPT 4 4 "Descrizione " -HELP "Descrizione del codice tributo" -FIELD LF_TABCOM->S0 -KEY 2 -USE %TRB KEY 2 -INPUT CODTAB F_CODICE -INPUT S0 F_DESCR -DISPLAY "Descrizione @50" S0 -DISPLAY "Codice" CODTAB -OUTPUT F_CODICE CODTAB -OUTPUT F_DESCR S0 -CHECKTYPE REQUIRED + PROMPT 4 4 "Descrizione " + FIELD S0 + KEY 2 + USE %TRB KEY 2 + INPUT S0 F_DESCR + DISPLAY "Descrizione@50" S0 + DISPLAY "Codice" CODTAB + DISPLAY "Sezione" S6 + COPY OUTPUT F_CODICE + CHECKTYPE REQUIRED +END + +LIST F_SEZIONE 1 50 +BEGIN + PROMPT 4 5 "Sezione " + ITEM "E|Erario" + ITEM "I|INPS" + ITEM "R|Regioni" + ITEM "L|ICI ed altri tributi locali" + ITEM "P|Altri enti previdenziali ed assicurativi" + FIELD S6 END ENDPAGE + ENDMASK