From 01d70b8140f15883efdd50d9ea86d492e911f6f5 Mon Sep 17 00:00:00 2001 From: augusto Date: Fri, 1 Aug 1997 14:57:44 +0000 Subject: [PATCH] Corretta le stampa del codice articolo e l'abilitazione delle intestazioni per livelli codice (art e giac) quando non abilitato da config git-svn-id: svn://10.65.10.50/trunk@5025 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- mg/mg3300.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/mg/mg3300.cpp b/mg/mg3300.cpp index 275564524..9aaafc16b 100755 --- a/mg/mg3300.cpp +++ b/mg/mg3300.cpp @@ -95,7 +95,9 @@ bool TForm_schedemag::validate(TForm_item &cf, TToken_string &s) } if (subcode=="CODGRUPPOART") { TString valore(relation()->lfile(LF_ANAMAG).get("CODART")); - cf.set(valore.cut(min(valore.len(),_artlev->packed_lenght(_tolivart)))); + if (_artlev->enabled()) + valore.cut(min(valore.len(),_artlev->packed_lenght(_tolivart))); + cf.set(valore); return TRUE; } if (subcode=="GRUPPOART") { @@ -171,18 +173,20 @@ bool TForm_schedemag::ragg_exprs(int livart,int livgiac) // *********** int tolivart,tolivgiac; - tolivart =livart ? livart : (_artlev->enabled() ? _artlev->last_level() : 25) ; - tolivgiac=livgiac ? livgiac : (_giaclev->enabled() ? _giaclev->last_level() : 15); + tolivart =livart ? livart : _artlev->last_level() ; + tolivgiac=livgiac ? livgiac : _giaclev->last_level(); // sezioni livello codice piece="CODART"; - piece << "[1," << _artlev->packed_lenght(tolivart) <<']'; + if (_artlev->enabled()) + piece << "[1," << _artlev->packed_lenght(tolivart) <<']'; *_rmov_raggcond<< (_rmov_raggcond->empty()? "":"+" )<add(piece); _rmov_joinexp->cut(0) << piece << "==" << piece; if (livart==0) { piece="LIVGIAC"; - piece << "[1," << _giaclev->packed_lenght(tolivgiac) <<']'; + if (_giaclev->enabled()) + piece << "[1," << _giaclev->packed_lenght(tolivgiac) <<']'; *_rmov_raggcond << '+' << piece; _rmov_sortexp->add(piece); } @@ -200,7 +204,7 @@ void TForm_schedemag::setdett_percatmer(bool sottocat,int livart,int livgiac,boo TForm_subsection &h_g=(TForm_subsection &)find_field('B',odd_page,"HEADER_GRMOV"); h_g.enable((livart ==0 || livgiac !=0 || sudd_mag)); TForm_subsection &h_l=(TForm_subsection &)find_field('B',odd_page,"HEADER_LIVGIAC"); - h_l.enable(livgiac !=0 ); + h_l.enable(_giaclev->enabled() && livgiac !=0 ); TForm_subsection &h_m=(TForm_subsection &)find_field('B',odd_page,"HEADER_MAG"); h_m.enable(sudd_mag ); TForm_subsection &h_d=(TForm_subsection &)find_field('B',odd_page,"HEADER_DEP"); @@ -244,7 +248,7 @@ void TForm_schedemag::setdett_permag(bool sudd_dep,bool show_dett,int livart,int TForm_subsection &h_a=(TForm_subsection &)find_field('B',odd_page,"HEADER_ARTICOLO"); h_a.enable(show_dett); TForm_subsection &h_g=(TForm_subsection &)find_field('B',odd_page,"HEADER_LIVGIAC"); - h_g.enable((livart ==0 || livgiac !=0 )); + h_g.enable(_giaclev->enabled() && (livart ==0 || livgiac !=0 )); *_rmov_raggcond="CODMAG[1,3]"; _rmov_sortexp->add("CODMAG[1,3]"); @@ -287,7 +291,7 @@ void TForm_schedemag::setdett_perart(bool percatmer,bool sottocatmer,int livart, TForm_subsection &h_g=(TForm_subsection &)find_field('B',odd_page,"HEADER_GRMOV"); h_g.enable((livart ==0 || livgiac !=0 || sudd_mag)); TForm_subsection &h_l=(TForm_subsection &)find_field('B',odd_page,"HEADER_LIVGIAC"); - h_l.enable(livart ==0 || livgiac !=0 ); + h_l.enable(_giaclev->enabled() && (livart ==0 || livgiac !=0 )); TForm_subsection &h_m=(TForm_subsection &)find_field('B',odd_page,"HEADER_MAG"); h_m.enable(sudd_mag ); TForm_subsection &h_d=(TForm_subsection &)find_field('B',odd_page,"HEADER_DEP");