From 587d4015b004f4ff5f6b3a1ebda8735ae9f64f0a Mon Sep 17 00:00:00 2001 From: smen Date: Wed, 22 Feb 2023 14:14:06 +0100 Subject: [PATCH] Patch level : 12.0 Files correlati : cg Commento: In prima nota corretta leggermente la logica che fa accendere i pulsanti "Collega" e "Scollega" fattura elettronica --- src/cg/cg2100.cpp | 28 +++++++++++++++++++++++++++- src/cg/cg2102.cpp | 10 +++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/cg/cg2100.cpp b/src/cg/cg2100.cpp index 0fa2e4928..acc65fdd2 100755 --- a/src/cg/cg2100.cpp +++ b/src/cg/cg2100.cpp @@ -139,7 +139,11 @@ TMask* TPrimanota_application::load_mask(int n) if (!has_module(FPAUT)) { if (m->find_by_id(F_COLFPPRO) != nullptr) + { m->hide(F_COLFPPRO); + m->disable(DLG_LINK); + m->enable(DLG_EDIT); + } if (m->find_by_id(DLG_LINK) != nullptr) { m->disable(DLG_LINK); @@ -1012,7 +1016,29 @@ void TPrimanota_application::f1_init(TMask& m, const bool fe_enabled, const bool m.field(F_COLFPPRO).show(fe_enabled); m.field(DLG_LINK).enable(fe_enabled); bool int_td16 = reverse_charge && app().causale().reg().iva() == iva_vendite && cache().get(LF_MOV, _rel->lfile().get(MOV_MOVCOLL), MOV_KEYFPPRO).full(); - m.set(F_COLFPPRO, fe_enabled && (f1_linked || int_td16) ? "X" : "", 0x3); + bool acq = _causale->reg().tipo_registro() == acquisto; + if (fe_enabled && acq) + { + if (m.get(MOV_KEYFPPRO).full()) + { + m.set(F_COLFPPRO, "X"); + m.enable(DLG_LINK, false); + m.enable(DLG_EDIT, true); + } + else + { + m.set(F_COLFPPRO, " "); + m.enable(DLG_LINK, true); + m.enable(DLG_EDIT, false); + } + } + else + { + m.enable(DLG_LINK, false); + m.enable(DLG_EDIT, false); + } + //m.set(F_COLFPPRO, fe_enabled && (f1_linked || int_td16) ? "X" : "", 0x3); + //bool a = m.get(F_COLFPPRO); } void TPrimanota_application::init_modify_mode(TMask& m) diff --git a/src/cg/cg2102.cpp b/src/cg/cg2102.cpp index cabf76af3..198b09319 100755 --- a/src/cg/cg2102.cpp +++ b/src/cg/cg2102.cpp @@ -4225,6 +4225,9 @@ bool TPrimanota_application::scollega_handler(TMask_field& f, KEY key) { app().curr_mask().reset(F_PROKEY); app().curr_mask().reset(F_COLFPPRO); + //m.set(F_COLFPPRO, "X"); + app().curr_mask().enable(DLG_LINK, true); + app().curr_mask().enable(DLG_EDIT, false); } message_box("Il movimento e' stato scollegato dalla fattura elettronica\nin ingresso, precedentemente associata."); } @@ -4321,8 +4324,13 @@ bool TPro_msk::riporta(TMask_field& f) row->add("", 0); } sf.force_update(); - if(!ok) + if (!ok) message_box("Nessun documento selezionato."); + else + { + app().curr_mask().enable(DLG_LINK, false); + app().curr_mask().enable(DLG_EDIT, true); + } msk.stop_run(K_QUIT); return true; }