From b32f7ebef2f81722a1a3fd937146822ad58bf27c Mon Sep 17 00:00:00 2001 From: Simone Palacino Date: Fri, 3 May 2019 12:17:21 +0200 Subject: [PATCH] Patch level : 12.0 782 Files correlati : cg2102 Commento : Aggiunti controlli sul tipodoc per collegamento fppro --- src/cg/cg2102.cpp | 13 +++++++++++-- src/cg/cg2102.h | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/cg/cg2102.cpp b/src/cg/cg2102.cpp index a71d09c4e..6d78d8645 100755 --- a/src/cg/cg2102.cpp +++ b/src/cg/cg2102.cpp @@ -2259,6 +2259,15 @@ bool TPrimanota_application::caus_query_handler(TMask_field& f, KEY key) return true; } +void TPrimanota_application::check_fppro_fields(TMask& m) +{ + if(m.get(F_TIPODOC) != "FA" && m.find_by_id(F_PROTFPPRO) != NULL) + { + m.hide(F_PROTFPPRO); + m.disable(DLG_LINK); + } +} + // Handler of the F_CODCAUS field on the modify mask // Certified 99% bool TPrimanota_application::caus_modify_handler(TMask_field& f, KEY key) @@ -2328,7 +2337,7 @@ bool TPrimanota_application::caus_modify_handler(TMask_field& f, KEY key) m.set(F_RITFATT, app().causale().fattura_in_ritardo() ? "X" : " "); } } - + check_fppro_fields(f.mask()); return true; } @@ -3828,7 +3837,7 @@ bool TPrimanota_application::quadratura_handler(TMask_field& f, KEY key) bool TPrimanota_application::fppro_mask(TMask_field& f, KEY key) { TMask& cg_msk = f.mask(); - if (!app().get_isfp() || key != K_SPACE && key != K_TAB) + if (!app().get_isfp() || key != K_SPACE && key != K_TAB || f.mask().get(F_TIPODOC) != "FA") return true; auto msk = std::make_shared(cg_msk); diff --git a/src/cg/cg2102.h b/src/cg/cg2102.h index b36a780fc..8db50e7f3 100755 --- a/src/cg/cg2102.h +++ b/src/cg/cg2102.h @@ -105,6 +105,7 @@ class TPrimanota_application : public TRelation_application static bool suspended_handler(TMask_field& f, KEY k); static bool num_handler(TMask_field& f, KEY key); static bool caus_query_handler(TMask_field& f, KEY key); + static void check_fppro_fields(TMask& m); static bool caus_modify_handler(TMask_field& f, KEY key); static bool datareg_handler(TMask_field& f, KEY key); static bool datacomp_handler(TMask_field& f, KEY key);