diff --git a/src/cg/cg2100.cpp b/src/cg/cg2100.cpp index e24c837f9..2b401e498 100755 --- a/src/cg/cg2100.cpp +++ b/src/cg/cg2100.cpp @@ -123,10 +123,11 @@ TMask* TPrimanota_application::load_mask(int n) ism.set_handler(309, sheet_clifo_handler); ism.set_handler(CG_RATEO, sheet_rateo_handler); ism.set_handler(CG_RISCONTO, sheet_risconto_handler); - if (!is_fp(m)) + if (!has_f1_db(m)) { m->hide(F_PROTFPPRO); - m->hide(F_COLFPPRO); + if (m->find_by_id(F_COLFPPRO) != NULL) + m->hide(F_COLFPPRO); if(m->find_by_id(DLG_LINK) != NULL) m->disable(DLG_LINK); } @@ -1578,7 +1579,7 @@ void TPrimanota_application::clean_fppro() // Controlli: solo in mod modifica; che abbia fp (no F8); che non sono in salvataggio if (_mode != MODE_MOD - || !is_fp(&msk) + || !has_f1_db(&msk) || last_key != K_DEL && last_key != K_SAVE && last_key != K_ELIMMAS) return; @@ -1593,12 +1594,12 @@ void TPrimanota_application::clean_fppro() fp_db().sq_commit(); } -bool TPrimanota_application::is_fp(TMask* m) +bool TPrimanota_application::has_f1_db(TMask* m) { static bool is_set_fpcheck = false; if (!is_set_fpcheck) { - _isfp = has_module(FPAUT) && !fp_settings().get_db_indirizzo().empty() && !fp_settings().is_f8(); + _isfp = has_module(F1AUT) && !fp_settings().get_db_indirizzo().empty() && !fp_settings().is_f8(); is_set_fpcheck = true; } return _isfp; @@ -2354,7 +2355,7 @@ int TPrimanota_application::save_fppro() const KEY last = msk.last_key(); // Provo a vedere se hanno l'FP: se c'è l'indirizzo controllo che non sia F8 se non c'è non hanno l'FP - if (!is_fp(&msk)) + if (!has_f1_db(&msk)) return pro_nofp; if (!fp_db().sq_is_connect()) { diff --git a/src/cg/cg2102.cpp b/src/cg/cg2102.cpp index c0dbd4002..ae7d5a85d 100755 --- a/src/cg/cg2102.cpp +++ b/src/cg/cg2102.cpp @@ -2262,7 +2262,7 @@ bool TPrimanota_application::caus_query_handler(TMask_field& f, KEY key) void TPrimanota_application::check_fppro_fields(TMask& m) { - if (app().is_fp(&m)) + if (app().has_f1_db(&m)) { if (!check_causale(m.get(F_CODCAUS)) && m.find_by_id(F_PROTFPPRO) != NULL) { diff --git a/src/cg/cg2102.h b/src/cg/cg2102.h index 7a8435c53..d4539eaa5 100755 --- a/src/cg/cg2102.h +++ b/src/cg/cg2102.h @@ -209,7 +209,7 @@ protected: // TApplication bool save_dbmov() const; // Pulisce il mov e db dai firerimenti FPPRO (in MODE_MOD per edit/delete) void clean_fppro(); - bool is_fp(TMask* m); + bool has_f1_db(TMask* m); virtual bool save(bool check_dirty); bool get_mask_swap_file(TFilename& name) const;