diff --git a/source/Plugins/AyaNova.Plugin.V8/V8.cs b/source/Plugins/AyaNova.Plugin.V8/V8.cs index 31b9a0f..85289f0 100644 --- a/source/Plugins/AyaNova.Plugin.V8/V8.cs +++ b/source/Plugins/AyaNova.Plugin.V8/V8.cs @@ -383,6 +383,7 @@ namespace AyaNova.PlugIn.V8 await ExportClientServiceRequests(progress); + await SynchronizeInventory(progress); if (progress.KeepGoing) { @@ -3601,6 +3602,73 @@ namespace AyaNova.PlugIn.V8 } #endregion ClientServiceRequests + #region Synchronize inventory + private async System.Threading.Tasks.Task SynchronizeInventory(ProgressForm progress) + { + + if (!progress.KeepGoing) return; + progress.Op("Synchronize inventory"); + progress.SubOp(""); + + //fetch all v7 inventory?? (or part by part??) + // string xcrit= "" + //+" " + // +"" + // +"" + // +"" + // +"" + // +"" + // +"" + // +"" + // +"" + // +"" + // +"" + //+""; + // PartWarehouseInventoryList l = PartWarehouseInventoryList.GetList(xcrit); + // //foreach v7 inventory get v8 balance, calc adjustment then issue it + // //also make a partstocklevel entry if required + + // foreach (PartWarehouseInventoryList.PartWarehouseInventoryListInfo i in l) + // { + // long? v8 + // } + + //get all parts in list + PartPickList pl = PartPickList.GetAllParts(); + + foreach (PartPickList.PartPickListInfo i in pl) + { + progress.SubOp("sync part " + i.Name); + PartInventoryValuesFetcher v7inv = PartInventoryValuesFetcher.GetItem(i.ID); + var v8inv = (await util.GetAsync("part/latest-inventory/" + Getv7v8IdMap(i.ID, "part id for synchronize inventory"))).ObjectResponse; + + } + //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 + + } + #endregion sync inventory + + + + + + + + + + + + + + + + + + //############################################################################################################### //############################################################################################################### //###############################################################################################################