Patch level : 12.0 790

Files correlati     : cg2
Commento            : Corretto controllo modulo f1
This commit is contained in:
Simone Palacino 2019-05-16 11:55:51 +02:00
parent c16ac0fcef
commit 061f491938
3 changed files with 9 additions and 8 deletions

View File

@ -123,10 +123,11 @@ TMask* TPrimanota_application::load_mask(int n)
ism.set_handler(309, sheet_clifo_handler); ism.set_handler(309, sheet_clifo_handler);
ism.set_handler(CG_RATEO, sheet_rateo_handler); ism.set_handler(CG_RATEO, sheet_rateo_handler);
ism.set_handler(CG_RISCONTO, sheet_risconto_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_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) if(m->find_by_id(DLG_LINK) != NULL)
m->disable(DLG_LINK); 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 // Controlli: solo in mod modifica; che abbia fp (no F8); che non sono in salvataggio
if (_mode != MODE_MOD if (_mode != MODE_MOD
|| !is_fp(&msk) || !has_f1_db(&msk)
|| last_key != K_DEL && last_key != K_SAVE && last_key != K_ELIMMAS) || last_key != K_DEL && last_key != K_SAVE && last_key != K_ELIMMAS)
return; return;
@ -1593,12 +1594,12 @@ void TPrimanota_application::clean_fppro()
fp_db().sq_commit(); 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; static bool is_set_fpcheck = false;
if (!is_set_fpcheck) 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; is_set_fpcheck = true;
} }
return _isfp; return _isfp;
@ -2354,7 +2355,7 @@ int TPrimanota_application::save_fppro()
const KEY last = msk.last_key(); 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 // 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; return pro_nofp;
if (!fp_db().sq_is_connect()) if (!fp_db().sq_is_connect())
{ {

View File

@ -2262,7 +2262,7 @@ bool TPrimanota_application::caus_query_handler(TMask_field& f, KEY key)
void TPrimanota_application::check_fppro_fields(TMask& m) 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) if (!check_causale(m.get(F_CODCAUS)) && m.find_by_id(F_PROTFPPRO) != NULL)
{ {

View File

@ -209,7 +209,7 @@ protected: // TApplication
bool save_dbmov() const; bool save_dbmov() const;
// Pulisce il mov e db dai firerimenti FPPRO (in MODE_MOD per edit/delete) // Pulisce il mov e db dai firerimenti FPPRO (in MODE_MOD per edit/delete)
void clean_fppro(); void clean_fppro();
bool is_fp(TMask* m); bool has_f1_db(TMask* m);
virtual bool save(bool check_dirty); virtual bool save(bool check_dirty);
bool get_mask_swap_file(TFilename& name) const; bool get_mask_swap_file(TFilename& name) const;