This commit is contained in:
@@ -1404,6 +1404,9 @@ namespace AyaNova.PlugIn.V8
|
|||||||
// PickListAutoComplete pl = PickListAutoComplete.GetList("**", "loanitem");
|
// PickListAutoComplete pl = PickListAutoComplete.GetList("**", "loanitem");
|
||||||
progress.Append("Exporting " + pl.Count.ToString() + " " + ObjectTypeName + "s");
|
progress.Append("Exporting " + pl.Count.ToString() + " " + ObjectTypeName + "s");
|
||||||
|
|
||||||
|
//cache unit of measures
|
||||||
|
UnitOfMeasurePickList umpl=UnitOfMeasurePickList.GetList(false);
|
||||||
|
|
||||||
foreach (PartPickList.PartPickListInfo i in pl)
|
foreach (PartPickList.PartPickListInfo i in pl)
|
||||||
{
|
{
|
||||||
if (!progress.KeepGoing) return;
|
if (!progress.KeepGoing) return;
|
||||||
@@ -1414,15 +1417,27 @@ namespace AyaNova.PlugIn.V8
|
|||||||
var ObjectTID = new TypeAndID(RootObjectTypes.Part, c.ID);
|
var ObjectTID = new TypeAndID(RootObjectTypes.Part, c.ID);
|
||||||
|
|
||||||
dynamic d = new JObject();
|
dynamic d = new JObject();
|
||||||
d.name = GetUniqueName(i.DisplayName(AyaBizUtils.GlobalSettings.DefaultPartDisplayFormat));//todo: temporary for testing
|
if (IsDuplicatev7v8IdMapItem(c.ID, c.PartNumber, progress)) continue;
|
||||||
if (IsDuplicatev7v8IdMapItem(c.ID, c.Name, progress)) continue;
|
progress.Op(ObjectTypeName + " " + d.partNumber + " " + d.name);
|
||||||
progress.Op(ObjectTypeName + " " + 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.active = c.Active;
|
||||||
d.notes = c.Notes;
|
d.notes = c.Notes;
|
||||||
|
|
||||||
SetTags(d, tags);
|
SetTags(d, tags);
|
||||||
|
|
||||||
|
|
||||||
//Custom fields?
|
//Custom fields?
|
||||||
if (ShouldExportCustom)
|
if (ShouldExportCustom)
|
||||||
d.customFields = CustomFieldData(c, DateCustomFields);
|
d.customFields = CustomFieldData(c, DateCustomFields);
|
||||||
@@ -2679,11 +2694,11 @@ namespace AyaNova.PlugIn.V8
|
|||||||
SetTags(d, tags);
|
SetTags(d, tags);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var rMainObject = await util.PostAsync("csr", d.ToString());
|
var rMainObject = await util.PostAsync("csr", d.ToString());
|
||||||
long RavenId = util.IdFromResponse(rMainObject);
|
long RavenId = util.IdFromResponse(rMainObject);
|
||||||
Addv7v8IdMap(c.ID, RavenId);
|
Addv7v8IdMap(c.ID, RavenId);
|
||||||
|
|
||||||
//-----
|
//-----
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user