From 6922ac56dbedfb54c360b334c3af9c94d2227580 Mon Sep 17 00:00:00 2001 From: mtollari Date: Tue, 27 Mar 2018 16:00:19 +0000 Subject: [PATCH] Patch level : 12.0 550 Files correlati : bs Commento : Articoli: Aggiunta UMS git-svn-id: svn://10.65.10.50/branches/R_10_00@24447 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- src/bs/bs0300.cpp | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/bs/bs0300.cpp b/src/bs/bs0300.cpp index 8260f484b..1765e351f 100644 --- a/src/bs/bs0300.cpp +++ b/src/bs/bs0300.cpp @@ -287,7 +287,7 @@ void TSknet_sync::load_their_origine(TISAM_recordset& out_set, const char* in_ta for (bool ok = odbc.move_first(); ok; ok = odbc.move_next()) { file.zero(); - TString80 cfld, bfld; // Campo field, BeeStore field e cut field + TString80 cfld, bfld, def; // Campo field, BeeStore field e cut field int ffld, tfld; FOR_EACH_ARRAY_ROW(pairs, p, row) { @@ -295,10 +295,11 @@ void TSknet_sync::load_their_origine(TISAM_recordset& out_set, const char* in_ta cfld = row->get(); ffld = row->get_int(); ffld--; tfld = row->get_int(); tfld--; + def = row->get(); const int pos = key_fields.get_pos(cfld); if (pos >= 0) { - const TVariant& var = odbc.get(bfld); + const TVariant& var = !odbc.get(bfld).is_empty() ? odbc.get(bfld) : (def.blank() ? NULL_VARIANT : def); if (!var.is_null()) { if (tfld > 0) @@ -331,11 +332,12 @@ void TSknet_sync::load_their_origine(TISAM_recordset& out_set, const char* in_ta cfld = row->get(); ffld = row->get_int(); ffld--; tfld = row->get_int(); tfld--; + def = row->get(); if (cfld[0] >= 'A' && cfld.find("->") < 0 && key_fields.get_pos(cfld) < 0) // Aggiorno solo i campi NON chiave { const TString& vec = file.get(cfld); - const TString& nov = odbc.get(bfld).as_string(); + const TString& nov = !odbc.get(bfld).is_empty() ? odbc.get(bfld).as_string() : (def.blank() ? "" : def); if (nov != vec) { if (!dirty) @@ -385,9 +387,11 @@ void TSknet_sync::load_their_origine(TISAM_recordset& out_set, const char* in_ta cfld = row->get(); ffld = row->get_int(); ffld--; tfld = row->get_int(); tfld--; + def = row->get(); + if (cfld[0] >= 'A' && cfld.find("->")) { - const TString& nov = odbc.get(bfld).as_string(); + const TString& nov = !odbc.get(bfld).is_empty() ? odbc.get(bfld).as_string() : (def.blank() ? "" : def); if (tfld > 0) file.put(cfld, nov.mid(ffld, tfld - ffld)); else @@ -473,7 +477,7 @@ void TSknet_sync::sync_anamag() fields.add("CodPadre|" ANAMAG_CODART); fields.add("DSArticolo|" ANAMAG_DESCR); fields.add("DSArticoloAgg|" ANAMAG_DESCRAGG "|1|70"); - fields.add("CodUntMagazzino|49->UM"); + fields.add("CodUntMagazzino|49->UM||PZ"); fields.add("CodIva|" ANAMAG_CODIVA); fields.add("CodLinea|" ANAMAG_GRMERC "|1|3"); fields.add("CodCategMerceologica|" ANAMAG_GRMERC); @@ -526,6 +530,19 @@ void TSknet_sync::sync_anamag() } } + // Umart + TLocalisamfile umart(LF_UMART); + TRectype rumart(LF_UMART); + rumart.put("CODART", odbc.get("CodPadre").as_string()); + rumart.put("NRIGA", 1); + rumart.put("UM", "PZ"); + rumart.put("FC", UNO); + if (rumart.rewrite_write(umart) != NOERR) + { + // Eror! + bool tolla = true; + } + // Conai if (hasConai) {