This commit is contained in:
@@ -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= "<?xml version=\"1.0\" encoding=\"utf-16\" standalone=\"yes\"?>"
|
||||
//+"<GRIDCRITERIA> <COLUMNITEM CM=\"aPartWarehouse.aName\" UI=\"LT_O_PartWarehouse\" SORT=\"ASC\" />"
|
||||
// +"<COLUMNITEM CM=\"aPart.aPartNumber\" UI=\"LT_O_Part\" SORT=\"ASC\" />"
|
||||
// +"<COLUMNITEM CM=\"aPartByWarehouseInventory.aQuantityOnHand\" UI=\"LT_PartByWarehouseInventory_Label_QuantityOnHand\" PIN=\"0\" WIDTH=\"81\" />"
|
||||
// +"<COLUMNITEM CM=\"aPartByWarehouseInventory.aMinStockLevel\" UI=\"LT_PartByWarehouseInventory_Label_MinStockLevel\" PIN=\"0\" WIDTH=\"76\" />"
|
||||
// +"<COLUMNITEM CM=\"AREORDERQUANTITY\" UI=\"LT_PartByWarehouseInventory_Label_ReorderQuantity\" PIN=\"0\" WIDTH=\"100\" />"
|
||||
// +"<COLUMNITEM CM=\"aPartByWarehouseInventory.aQuantityOnOrder\" UI=\"LT_PartByWarehouseInventory_Label_QuantityOnOrder\" PIN=\"0\" WIDTH=\"66\" />"
|
||||
// +"<COLUMNITEM CM=\"AVENDWHOLE.ANAME\" UI=\"LT_Part_Label_WholesalerID\" PIN=\"0\" WIDTH=\"104\" />"
|
||||
// +"<COLUMNITEM CM=\"aPartCategory.aName\" UI=\"LT_O_PartCategory\" PIN=\"0\" WIDTH=\"139\" />"
|
||||
// +"<COLUMNITEM CM=\"aPart.aActive\" UI=\"LT_Part_Label_Active\" PIN=\"0\" WIDTH=\"78\" />"
|
||||
// +"<COLUMNITEM CM=\"aPart.aRetail\" UI=\"LT_Part_Label_Retail\" PIN=\"0\" WIDTH=\"79\" />"
|
||||
// +"<COLUMNITEM CM=\"aPart.aCost\" UI=\"LT_Part_Label_Cost\" PIN=\"0\" WIDTH=\"79\" />"
|
||||
//+"</GRIDCRITERIA>";
|
||||
// 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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//###############################################################################################################
|
||||
//###############################################################################################################
|
||||
//###############################################################################################################
|
||||
|
||||
Reference in New Issue
Block a user