diff --git a/ve/ve2401.cpp b/ve/ve2401.cpp index 28578e3ab..ac4a184e5 100755 --- a/ve/ve2401.cpp +++ b/ve/ve2401.cpp @@ -159,7 +159,7 @@ void TCodart_mask::create_level(int level, const TString& subcode) const int length = picture.len(); TEdit_field& kfld = add_string(100+level, 0, prompt, 1, level, length, "BU"); - TEdit_field& dfld = add_string(200+level, 0, "", 40, level, 50, "D", 36); + TEdit_field& dfld = add_string(200+level, 0, "", 40, level, 50, "B", 36); TFilename tmp; tmp.temp(); ofstream out(tmp); @@ -177,6 +177,7 @@ void TCodart_mask::create_level(int level, const TString& subcode) out << "OU " << dfld.dlg() << " S0" << endl; out << "CH RE" << endl; + out << "ADD RU mg0 -0 GSA " << code << endl; out << "EN" << endl; out.close(); @@ -184,6 +185,28 @@ void TCodart_mask::create_level(int level, const TString& subcode) while (scan.pop() != "EN") kfld.parse_item(scan); + xvt_fsys_remove_file(tmp); + ofstream outd(tmp); + + outd << "USE GSA KEY 2 SELECT CODTAB[1,3]==\"" << code << "\"" << endl; //usa la tabella dei sottolivelli articolo + + outd << "IN S0 " << dfld.dlg() << endl; + outd << "DI \"" << HR("Descrizione") << "@50\" S0" << endl; + outd << "DI \"" << prompt; + if (length > prompt.len()) + outd << '@' << length; + outd << "\" CODTAB[4,0]" << endl; + outd << "CO OU " << kfld.dlg() << endl; + + outd << "CH SE" << endl; + outd << "ADD RU mg0 -0 GSA " << code << endl; + outd << "EN" << endl; + outd.close(); + + TScanner scand(tmp); + while (scand.pop() != "EN") + dfld.parse_item(scand); + xvt_fsys_remove_file(tmp); set_handlers(); } @@ -275,9 +298,14 @@ bool advanced_codart_ask(TString& code, TString& desc) { const int dlg = el + 101; order[el] = 1001; - if (desc.full()) - desc << m.get_descr_separator(el); - desc << esc(m.get(dlg + 100)); + const TString descpiece(esc(m.get(dlg + 100))); + + if (descpiece.full()) + { + if (desc.full()) + desc << m.get_descr_separator(el); + desc << descpiece; + } } } running = false;