From 3023ac833fdb2e10bd3d87b6fa355f29b3ef4473 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 15 Jun 2011 22:54:09 +0000 Subject: [PATCH] Patch level : 10.1026 Files correlati : ve0.exe ve2.exe mg1.exe db0.exe Ricompilazione Demo : [ ] Commento : Aggiunto un parametro nel profilo documento "HCAOPT=X" che rende non obbligatori i campi di analitica sulla testata. ELIMINATA : un parametro (EXTDESCSRC=X) nel paragrafo ve della ditta) per aggiungere la descrizione estesa alle discerche per descrizione degli articoli git-svn-id: svn://10.65.10.50/branches/R_10_00@22272 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- ve/velib.h | 3 ++- ve/velib02.cpp | 4 ++-- ve/velib03a.cpp | 1 + ve/velib06.cpp | 51 ++++++++++++++++++++++++++++++++++++++++++++----- 4 files changed, 51 insertions(+), 8 deletions(-) diff --git a/ve/velib.h b/ve/velib.h index bc3c9ddd0..d201ab4e3 100755 --- a/ve/velib.h +++ b/ve/velib.h @@ -241,7 +241,7 @@ class TTipo_documento : public TRectype // velib03 char _tipocf; char _tipocr; char _check_qta; - bool _cnt_prezzi, _show_evaded_lines, _load_cont, _non_evadere; + bool _cnt_prezzi, _show_evaded_lines, _load_cont, _non_evadere, _hca_req; protected: void add_formula_if_needed(TConfig& profile, TString& variable, const char* varname, const char* formula); @@ -346,6 +346,7 @@ public: const TString& stringa_descrizione_riga() const { return _str_desc_rdoc; } bool mostra_righe_evase_in_elaborazione() const { return _show_evaded_lines; } bool da_evadere() const { return !_non_evadere; } + bool head_ca_required() const { return _hca_req; } TTipo_documento(const char* tipodoc = NULL); TTipo_documento(const TRectype& rec); diff --git a/ve/velib02.cpp b/ve/velib02.cpp index df210ede9..e0dcde453 100755 --- a/ve/velib02.cpp +++ b/ve/velib02.cpp @@ -78,8 +78,8 @@ void TTipo_riga_documento::read_formule() _select_clifo = profile.get_bool("SELCLIFO", NULL, -1, true); _no_desc = profile.get_bool("NODESC"); _formule = profile.get("CAMPICALC"); -// _extended_desc_search = profile.get_bool("EXTDESCSRC"); - _extended_desc_search = ini_get_bool(CONFIG_DITTA, "ve", "EXTDESCSRC"); + _extended_desc_search = profile.get_bool("EXTDESCSRC"); +// _extended_desc_search = ini_get_bool(CONFIG_DITTA, "ve", "EXTDESCSRC"); const TString& calcoli = profile.get("CALCOLI"); if (calcoli == "*") { diff --git a/ve/velib03a.cpp b/ve/velib03a.cpp index dfef04c77..9b566b838 100755 --- a/ve/velib03a.cpp +++ b/ve/velib03a.cpp @@ -425,6 +425,7 @@ void TTipo_documento::read_formule() _show_evaded_lines = !prof.get_bool("NASCONDI_RIGHE_EVASE"); // Normalmente mostra anche evase _non_evadere = prof.get_bool("NON_EVADERE"); // Normalmente mostra anche evase _module = prof.get("MODULE", NULL, -1, "ve").left(2); + _hca_req = !prof.get_bool("HCAOPT"); } diff --git a/ve/velib06.cpp b/ve/velib06.cpp index 8793f75cc..552010184 100755 --- a/ve/velib06.cpp +++ b/ve/velib06.cpp @@ -578,12 +578,12 @@ void TDocumento_mask::insert_anal_page() _cdc_start = dlg; _cdc_end = dlg + ca_multilevel_code_info(LF_CDC).levels()-1; if (use_fsc && fasinfo.parent() == LF_CDC) - insert_anal_fields(*this, newpage, LF_FASI, y, dlg, dlgd, fsc_req); + insert_anal_fields(*this, newpage, LF_FASI, y, dlg, dlgd, fsc_req && doc().tipo().head_ca_required()); else { const bool cdc_req = ini.get_bool("CdcRequired"); - insert_anal_fields(*this, newpage, LF_CDC, y, dlg, dlgd, cdc_req); + insert_anal_fields(*this, newpage, LF_CDC, y, dlg, dlgd, cdc_req && doc().tipo().head_ca_required()); } } else if (level == "CMS") // Crea commessa @@ -591,12 +591,12 @@ void TDocumento_mask::insert_anal_page() _cms_start = dlg; _cms_end = dlg + ca_multilevel_code_info(LF_COMMESSE).levels()-1; if (use_fsc && fasinfo.parent() == LF_COMMESSE) - insert_anal_fields(*this, newpage, LF_FASI, y, dlg, dlgd, fsc_req); + insert_anal_fields(*this, newpage, LF_FASI, y, dlg, dlgd, fsc_req && doc().tipo().head_ca_required()); else { const bool cms_req = ini.get_bool("CmsRequired"); - insert_anal_fields(*this, newpage, LF_COMMESSE, y, dlg, dlgd, cms_req); + insert_anal_fields(*this, newpage, LF_COMMESSE, y, dlg, dlgd, cms_req && doc().tipo().head_ca_required()); } } } @@ -604,7 +604,7 @@ void TDocumento_mask::insert_anal_page() set_field_handler(_cms_end, codcms_handler); if (use_fsc && fasinfo.parent() <= 0) - insert_anal_fields(*this, newpage, LF_FASI, y, dlg, dlgd, fsc_req); + insert_anal_fields(*this, newpage, LF_FASI, y, dlg, dlgd, fsc_req && doc().tipo().head_ca_required()); //aggiunge campi per date di competenza (inizio e fine) add_groupbox(DLG_NULL, newpage, TR("Date di competenza"), 1, 20, 78, 3); @@ -1406,6 +1406,26 @@ bool TDocumento_mask::new_mask(int numriga) const return _maskriga.objptr(name) == NULL; } +static bool descr_filter_handler(TMask_field& f, KEY k) +{ + if (k == K_SPACE) + { + TString expr; + if (!f.get().empty()) // Filtro attivato! + { + const short id = f.dlg()-500; + TString e = f.mask().get(id); // Espressione regolare + e.strip("\"'"); // Tolgo caratteri che potrebbero dare problemi + if (!e.blank()) + expr << "(DESCR+DESCRAGG)" << "?=\"" << e << '"'; + if (expr.empty()) + f.reset(); + } + ((TBrowse_sheet&) f.mask()).add_custom_filter(expr); + } + return true; +} + TVariable_mask* TDocumento_mask::riga_mask(int numriga) { const TRiga_documento& riga = doc()[numriga + 1]; @@ -1474,6 +1494,27 @@ TVariable_mask* TDocumento_mask::riga_mask(int numriga) } } } + if (tiporiga.extended_desc_search()) + { + pos = m->id2pos(FR_DESCRART); + if (pos >= 0) + { + const TMask_field & f = m->fld(pos); + if (f.is_edit()) + { + TBrowse * browse = ((TEdit_field &) f).browse(); + + if (browse ) + { + TRelation * r = new TRelation(LF_ANAMAG); + TSorted_cursor * c = new TSorted_cursor(r,ANAMAG_DESCR "|" ANAMAG_DESCRAGG, "", 2); + + browse->set_cursor(c); + browse->set_custom_filter_handler(descr_filter_handler); + } + } + } + } m->set_handler(FR_QTAEVASA, qta_evasa_handler); m->set_handler(FR_CAUS, causmag_handler);