From a164cd92decf37d320e5ac5d3dfc05032c36c9fb Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 20 Aug 2021 17:03:05 +0000 Subject: [PATCH] --- source/Plugins/AyaNova.Plugin.V8/V8.cs | 64 +++++++++++++++----------- 1 file changed, 36 insertions(+), 28 deletions(-) diff --git a/source/Plugins/AyaNova.Plugin.V8/V8.cs b/source/Plugins/AyaNova.Plugin.V8/V8.cs index 3cc816c..9c40a49 100644 --- a/source/Plugins/AyaNova.Plugin.V8/V8.cs +++ b/source/Plugins/AyaNova.Plugin.V8/V8.cs @@ -227,6 +227,38 @@ namespace AyaNova.PlugIn.V8 } + //UNKNOWN / MISSING RECORD OBJECT STAND INs + private long XUnknownV7PartId = 0;//used when there is no part id on a workorderitempart record + private string MissingDataNamePrefix = "zV8migrate_substitute";//append guid to ensure uniqueness + + + private async System.Threading.Tasks.Task CreateSubstitute(Guid id, RootObjectTypes desiredType) + { + //create the simplest possible version of this object desired + switch (desiredType) + { + case RootObjectTypes.Part: + { + + } + break; + case RootObjectTypes.PartWarehouse: + { + + } + break; + case RootObjectTypes.Client: + { + + } + break; + default: + throw new Exception("Error: CreateSubstitute (source id: " + id.ToString() + " for type: " + desiredType.ToString() + ") THIS TYPE NOT CODED YET"); + } + } + + + private long XXSafeGetUserMap(Guid id) { if (!V7ToV8IdMap.ContainsKey(id)) return 1;//1=raven administrator account @@ -262,26 +294,7 @@ namespace AyaNova.PlugIn.V8 private bool V7UseInventory = false; private List Allv8WarehouseIds = new List(); - //UNKNOWN / MISSING RECORD OBJECT STAND INs - private long XUnknownV7PartId = 0;//used when there is no part id on a workorderitempart record - private string MissingDataNamePrefix = "zV8migrate_substitute";//append guid to ensure uniqueness - - - private async System.Threading.Tasks.Task CreateSubstitute(Guid id, RootObjectTypes desiredType) - { - //create the simplest possible version of this object desired - switch (desiredType) - { - case RootObjectTypes.Client: - { - - } - break; - default: - throw new Exception("Error: CreateSubstitute (source id: " + id.ToString() + " for type: " + desiredType.ToString() + ") THIS TYPE NOT CODED YET"); - } - } - + @@ -3143,14 +3156,9 @@ namespace AyaNova.PlugIn.V8 dwipr.workOrderId = RavenId; dwipr.workOrderItemId = ravenwoitemid; dwipr.quantity = wipr.Quantity; - var tryPartId = Getv7v8IdMapNullOk(wipr.PartID); - if (tryPartId == null) - { - dwipr.partId = UnknownV7PartId; - } - else - dwipr.partId = tryPartId; - dwipr.partWarehouseId = Getv7v8IdMap(wipr.PartWarehouseID, "warehouse"); + dwipr.partId = await Getv7v8IdMap(wipr.PartID, RootObjectTypes.Part); + + dwipr.partWarehouseId = await Getv7v8IdMap(wipr.PartWarehouseID, RootObjectTypes.PartWarehouse); poitemtowoitempartrequest pto = PoItemPartRequestMap.FirstOrDefault(z => z.v7woitempartrequestid == wipr.ID); if (pto != null)