This commit is contained in:
2021-08-25 23:30:07 +00:00
parent bddfb42508
commit a596f41083
2 changed files with 44 additions and 17 deletions

View File

@@ -1809,7 +1809,7 @@ namespace AyaNova.PlugIn.V8
dx.retail = 0; dx.retail = 0;
dx.uPC = string.Empty; dx.uPC = string.Empty;
dx.unitOfMeasure = "each"; dx.unitOfMeasure = "each";
dx.active = true; dx.active = false;
dx.notes = "This part created by v8 migrate plugin so work order item part records with no (or no valid) selected part can be migrated to v8\nv7 allowed work order item part entry without a corresponding Part record but v8 does not\nThis part stands in for those missing parts from v7\nThis record can be deleted after migration if no work order item parts rely on it"; dx.notes = "This part created by v8 migrate plugin so work order item part records with no (or no valid) selected part can be migrated to v8\nv7 allowed work order item part entry without a corresponding Part record but v8 does not\nThis part stands in for those missing parts from v7\nThis record can be deleted after migration if no work order item parts rely on it";
List<string> dxtags = new List<string>(); List<string> dxtags = new List<string>();
AddImportTag(dxtags); AddImportTag(dxtags);
@@ -4324,6 +4324,12 @@ namespace AyaNova.PlugIn.V8
d.userId = V7ToV8IdMap[c.SourceID]; d.userId = V7ToV8IdMap[c.SourceID];
d.assignedByUserId = await Getv7v8IdMap(c.Creator, RootObjectTypes.User); d.assignedByUserId = await Getv7v8IdMap(c.Creator, RootObjectTypes.User);
d.objectId = V7ToV8IdMap[c.FollowID]; d.objectId = V7ToV8IdMap[c.FollowID];
if (c.FollowType == RootObjectTypes.Workorder)
{
//going to need to be way more specific here to map to v8
Workorder.getty
}
else
d.objectType = util.RootObjectToAyaType(c.FollowType); d.objectType = util.RootObjectToAyaType(c.FollowType);
SetTags(d, tags); SetTags(d, tags);
progress.Op("FollowUp " + c.ID.ToString()); progress.Op("FollowUp " + c.ID.ToString());
@@ -4627,19 +4633,28 @@ namespace AyaNova.PlugIn.V8
await util.PutAsync("part/stock-levels/" + v8PartId, ja);//ja.ToString()); await util.PutAsync("part/stock-levels/" + v8PartId, ja);//ja.ToString());
} }
} }
//find matching v7 item and adjust
//no v7 item then set to zeros
} }
//iterate the parts
//use v7 partinventoryvalues fetcher
//use v8 part/latest-inventory/partid route to get same from v8
//where they differ issue an adjustment to v8 for each part/warehouse combo
//also make a partstockelvel entry if required
//Clear out inventory for special unknown missing part created in v8 for potentially missing parts
{
JObject v8inv = (await util.GetAsync("part/latest-inventory/" + UnknownV7PartId)).ObjectResponse;
//iterate v8 inventory
foreach (JObject v8o in v8inv["data"])
{
decimal dAdjust = 0;
decimal v8OnHand = (decimal)v8o["balance"];
dAdjust = v8OnHand * -1;
{
dynamic di = new JObject();
di.description = "v8 migrate synchronize inventory";
di.partId = UnknownV7PartId;
di.partWarehouseId = (long)v8o["partWarehouseId"];
di.quantity = dAdjust;
await util.PostAsync("part-inventory", di.ToString());
}
}
}
} }
#endregion sync inventory #endregion sync inventory

View File

@@ -646,6 +646,18 @@ namespace AyaNova.PlugIn.V8
default: default:
throw new NotImplementedException("V8:util:RootObjectToAyaType -> type " + rot.ToString() + "," + specificWoType.ToString() + " is not coded yet"); throw new NotImplementedException("V8:util:RootObjectToAyaType -> type " + rot.ToString() + "," + specificWoType.ToString() + " is not coded yet");
} }
case biz.RootObjectTypes.Workorder:
switch (specificWoType)
{
case biz.WorkorderTypes.PreventiveMaintenance:
return AyaType.PM;
case biz.WorkorderTypes.Quote:
return AyaType.Quote;
case biz.WorkorderTypes.Service:
return AyaType.WorkOrder;
default:
throw new NotImplementedException("V8:util:RootObjectToAyaType -> type " + rot.ToString() + ", needs specific wotype which was not provided");
}
case biz.RootObjectTypes.Memo: case biz.RootObjectTypes.Memo:
return AyaType.Memo; return AyaType.Memo;
@@ -668,7 +680,7 @@ namespace AyaNova.PlugIn.V8
default: default:
throw new NotImplementedException("V8:util:RootObjectToAyaType -> type " + rot.ToString() + " is not coded yet"); throw new NotImplementedException("V8:util:RootObjectToAyaType -> v7 type " + rot.ToString() + " is not coded");
} }
} }
/// <summary> /// <summary>