diff --git a/ve/ve0100.cpp b/ve/ve0100.cpp index 9baf9acc2..9886276a7 100755 --- a/ve/ve0100.cpp +++ b/ve/ve0100.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -9,7 +10,6 @@ #include "veini.h" #include "vepriv.h" -#include "veuml.h" #include "veuml1.h" #include "verig.h" #include "velib04.h" @@ -191,7 +191,11 @@ void TMotore_application::init_modify_mode( TMask& m ) m.enable(DLG_ELABORA); m.disable(F_STATO); - cached_article_balances(NULL); // Azzera cache delle giacenze + if (m.id2pos(F_CURGIAC)>0 && m.efield(F_CURGIAC).shown()) + { + cached_article_balances(NULL); // Azzera cache delle giacenze + edit_mask().update_giacenza(); // Aggiorna giacenza riga corrente + } TString80 key; key << m.get(F_CODNUM); @@ -949,12 +953,17 @@ bool TMotore_application::save_and_print(bool savedoc, TPrtype mode) const TTipo_documento& tipo = doc.tipo(); TFilename rep; - if (tipo.main_print_profile(rep, 0)) + + int filter = has_module(RSAUT) ? 2 : 1; + while (filter > 0 && !tipo.main_print_profile(rep, filter)) + filter--; + + if (filter > 0) { const bool da_stampare = doc.stampabile(); TString commandline; - if (rep.ends_with(".rep")) + if (filter == 2) commandline = "ve1 -2"; // Esiste il nuovo report :-) else commandline = "ve1 -0"; // Esiste il vecchio form :-( @@ -983,7 +992,7 @@ bool TMotore_application::save_and_print(bool savedoc, TPrtype mode) TDocumento& maindoc = m.doc(); maindoc.read(); // Aggiorna STATO e MOVMAG generati da ve1 - // Lo stato del documento vive di vita propria + // Lo stato del documento vive di vita propria const char sfs = maindoc.tipo().stato_finale_stampa(); maindoc.stato(sfs); const char str_sfs[2] = { sfs, '\0' };