From 59874672042acaf6282549ec056e269555b59c70 Mon Sep 17 00:00:00 2001 From: Alessandro Bonazzi Date: Tue, 21 Jun 2022 08:56:53 +0200 Subject: [PATCH] Patch level : 12.0 1174 Files correlati : ba1.exe Commento: Migliorata protezione aggiornamento tracciati sulla base dei dati Team --- src/ba/ba1100.cpp | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/src/ba/ba1100.cpp b/src/ba/ba1100.cpp index 0549a44a9..57d2d95b5 100755 --- a/src/ba/ba1100.cpp +++ b/src/ba/ba1100.cpp @@ -525,6 +525,7 @@ void TManutenzione_app::dump_trc(const char * dir, const bool des_too, const lon fn = dir; fn << "/f"; fn << i; fn.ext("trr"); + dr.set_xml(); ofstream out(fn); out << rc; fn.ext("dir"); @@ -1129,9 +1130,14 @@ void TManutenzione_app::convert_recdef(int firm) TString pref = prefix().name(); const int curr_firm = prefix().get_codditta(); bool all_firms = firm < 0; - const int from_firm = all_firms || firm == 0 ? 1 : firm; TString_array ditte; - const int to_firm = all_firms ? prefix().firms(ditte) : firm; + int nditte = firm > 0 ? 1 : 0; + + if (all_firms) + nditte = prefix().firms(ditte); + else + if (firm > 0) + ditte.add(format("%d", firm)); TFilename dir = firm2dir(0); if (all_firms || firm == 0) @@ -1143,15 +1149,21 @@ void TManutenzione_app::convert_recdef(int firm) clean_recdef(dir); dump_trc(dir); } - for (int i = from_firm; i <= to_firm; i++) + for (int i = 0; i < ditte.items(); i++) { - set_firm(i); - dir = firm2dir(i); - dir.add("recdesc"); - if (!dexist(dir)) - make_dir(dir); - clean_recdef(dir); - dump_trc(dir); + int firm = atoi((TString &)ditte[i]); + + dir = firm2dir(firm); + if (dexist(dir)) + { + set_firm(firm); + load_des(); + dir.add("recdesc"); + if (!dexist(dir)) + make_dir(dir); + clean_recdef(dir); + dump_trc(dir); + } } if (curr_firm > 0) set_firm(curr_firm);