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
This commit is contained in:
mtollari 2018-03-27 16:00:19 +00:00
parent 937a1230ec
commit 6922ac56db

View File

@ -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()) for (bool ok = odbc.move_first(); ok; ok = odbc.move_next())
{ {
file.zero(); 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; int ffld, tfld;
FOR_EACH_ARRAY_ROW(pairs, p, row) 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(); cfld = row->get();
ffld = row->get_int(); ffld--; ffld = row->get_int(); ffld--;
tfld = row->get_int(); tfld--; tfld = row->get_int(); tfld--;
def = row->get();
const int pos = key_fields.get_pos(cfld); const int pos = key_fields.get_pos(cfld);
if (pos >= 0) 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 (!var.is_null())
{ {
if (tfld > 0) if (tfld > 0)
@ -331,11 +332,12 @@ void TSknet_sync::load_their_origine(TISAM_recordset& out_set, const char* in_ta
cfld = row->get(); cfld = row->get();
ffld = row->get_int(); ffld--; ffld = row->get_int(); ffld--;
tfld = row->get_int(); tfld--; 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 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& 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 (nov != vec)
{ {
if (!dirty) if (!dirty)
@ -385,9 +387,11 @@ void TSknet_sync::load_their_origine(TISAM_recordset& out_set, const char* in_ta
cfld = row->get(); cfld = row->get();
ffld = row->get_int(); ffld--; ffld = row->get_int(); ffld--;
tfld = row->get_int(); tfld--; tfld = row->get_int(); tfld--;
def = row->get();
if (cfld[0] >= 'A' && cfld.find("->")) 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) if (tfld > 0)
file.put(cfld, nov.mid(ffld, tfld - ffld)); file.put(cfld, nov.mid(ffld, tfld - ffld));
else else
@ -473,7 +477,7 @@ void TSknet_sync::sync_anamag()
fields.add("CodPadre|" ANAMAG_CODART); fields.add("CodPadre|" ANAMAG_CODART);
fields.add("DSArticolo|" ANAMAG_DESCR); fields.add("DSArticolo|" ANAMAG_DESCR);
fields.add("DSArticoloAgg|" ANAMAG_DESCRAGG "|1|70"); 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("CodIva|" ANAMAG_CODIVA);
fields.add("CodLinea|" ANAMAG_GRMERC "|1|3"); fields.add("CodLinea|" ANAMAG_GRMERC "|1|3");
fields.add("CodCategMerceologica|" ANAMAG_GRMERC); 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 // Conai
if (hasConai) if (hasConai)
{ {