diff --git a/source/Plugins/AyaNova.Plugin.V8/V8.cs b/source/Plugins/AyaNova.Plugin.V8/V8.cs index 2cf6509..b0ee8b5 100644 --- a/source/Plugins/AyaNova.Plugin.V8/V8.cs +++ b/source/Plugins/AyaNova.Plugin.V8/V8.cs @@ -1404,6 +1404,9 @@ namespace AyaNova.PlugIn.V8 // PickListAutoComplete pl = PickListAutoComplete.GetList("**", "loanitem"); progress.Append("Exporting " + pl.Count.ToString() + " " + ObjectTypeName + "s"); + //cache unit of measures + UnitOfMeasurePickList umpl=UnitOfMeasurePickList.GetList(false); + foreach (PartPickList.PartPickListInfo i in pl) { if (!progress.KeepGoing) return; @@ -1414,15 +1417,27 @@ namespace AyaNova.PlugIn.V8 var ObjectTID = new TypeAndID(RootObjectTypes.Part, c.ID); dynamic d = new JObject(); - d.name = GetUniqueName(i.DisplayName(AyaBizUtils.GlobalSettings.DefaultPartDisplayFormat));//todo: temporary for testing - if (IsDuplicatev7v8IdMapItem(c.ID, c.Name, progress)) continue; - progress.Op(ObjectTypeName + " " + d.name); + if (IsDuplicatev7v8IdMapItem(c.ID, c.PartNumber, progress)) continue; + progress.Op(ObjectTypeName + " " + d.partNumber + " " + d.name); + d.name = c.Name; + d.partNumber = c.PartNumber; + d.manufacturerId = Getv7v8IdMapNullOk(c.ManufacturerID); + d.manufacturerNumber = c.ManufacturerNumber; + d.wholeSalerId = Getv7v8IdMapNullOk(c.WholesalerID); + d.wholeSalerNumber = c.WholesalerNumber; + d.alternativeWholeSalerId = Getv7v8IdMapNullOk(c.AlternativeWholesalerID); + d.alternativeWholeSalerNumber = c.AlternativeWholesalerNumber; + d.cost = c.Cost; + d.retail = c.Retail; + d.uPC = c.UPC; + if (c.UnitOfMeasureID != Guid.Empty && umpl.Contains(c.UnitOfMeasureID)) + { + d.unitOfMeasure = umpl[c.UnitOfMeasureID].Name; + } d.active = c.Active; d.notes = c.Notes; - SetTags(d, tags); - //Custom fields? if (ShouldExportCustom) d.customFields = CustomFieldData(c, DateCustomFields); @@ -2679,11 +2694,11 @@ namespace AyaNova.PlugIn.V8 SetTags(d, tags); - + var rMainObject = await util.PostAsync("csr", d.ToString()); long RavenId = util.IdFromResponse(rMainObject); - Addv7v8IdMap(c.ID, RavenId); + Addv7v8IdMap(c.ID, RavenId); //-----