From 6a22030d15d8a9098017709ddb4777765a4dfd3a Mon Sep 17 00:00:00 2001 From: bonazzi Date: Wed, 1 Nov 2017 22:54:42 +0000 Subject: [PATCH] Patch level : 12.0 462 Files correlati : ve0.exe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Errore segnalato da Dinamica I controllo di commessa chiusa sui documenti era bloccante, non può esserlo perché devo poter modificare un vecchio documento o evadere fatture da emettere o ricevere La segnalazione non bloccante viene data quanto la commessa è e chiusa e siamo oltre l'eventuale proroga, solo al cambio di commessa. git-svn-id: svn://10.65.10.50/branches/R_10_00@24166 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- src/ve/velib06a.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/ve/velib06a.cpp b/src/ve/velib06a.cpp index d045f9da8..de31cd037 100755 --- a/src/ve/velib06a.cpp +++ b/src/ve/velib06a.cpp @@ -2915,11 +2915,18 @@ bool cms_mag_handler(TMask_field& f, KEY key) const TRectype& curr = m.efield(mask.cms_end_sh()).browse()->cursor()->curr(); const TString80 codcms = curr.get(COMMESSE_CODCMS); - if (curr.get_bool(COMMESSE_CHIUSA)) - return f.error_box(FR("Impossibile operare sulla commessa chiusa %s"), (const char*)codcms); if (mask.codcms_sh() != codcms) // Cambio commessa { + if ((key == K_TAB && f.focusdirty())) + { + bool chiusa = curr.get_bool(COMMESSE_CHIUSA); + + if (chiusa && curr.get_bool(COMMESSE_PROROGA)) + chiusa = mask.get_date(F_DATADOC) > curr.get_date(COMMESSE_DATAPROR); + if (chiusa) + return f.error_box(FR("La commessa chiusa %s, vuoi utilizzarla"), (const char*)codcms); + } mask.codcms_sh() = codcms; const TString80 codcosto = curr.get(COMMESSE_CODCOSTO); @@ -2973,14 +2980,21 @@ bool codcms_handler(TMask_field& f, KEY key) const TRectype& curr_cms = ((TEdit_field&)f).browse()->cursor()->curr(); const TString80 codcms = curr_cms.get(COMMESSE_CODCMS); mask.set(F_CMSH, codcms); - if (curr_cms.get_bool(COMMESSE_CHIUSA)) - return f.error_box(FR("Impossibile operare sulla commessa chiusa %s"), (const char*)codcms); if ((key == K_TAB && f.focusdirty()) || key == K_ENTER) { // Controlla se c'e' la gestione dei centri di costo al secondo livello if (mask.codcms() != codcms) { + if ((key == K_TAB && f.focusdirty())) + { + bool chiusa = curr_cms.get_bool(COMMESSE_CHIUSA); + + if (chiusa && curr_cms.get_bool(COMMESSE_PROROGA)) + chiusa = mask.get_date(F_DATADOC) > curr_cms.get_date(COMMESSE_DATAPROR); + if (chiusa) + return f.error_box(FR("La commessa chiusa %s, vuoi utilizzarla"), (const char*)codcms); + } doc.put(DOC_CODCMS, codcms); FOR_EACH_PHYSICAL_RDOC(doc, r, riga) {