Migrate unused parts to suggestedquantity field

This commit is contained in:
2021-11-09 19:48:25 +00:00
parent cbc2088df1
commit 30776c443c

View File

@@ -2306,7 +2306,7 @@ namespace AyaNova.PlugIn.V8
//Step 2: export the objects //Step 2: export the objects
PartInventoryAdjustmentList pil = PartInventoryAdjustmentList.GetList( PartInventoryAdjustmentList pil = PartInventoryAdjustmentList.GetList(
"<?xml version=\"1.0\" encoding=\"utf-16\" standalone=\"yes\"?><GRIDCRITERIA> <COLUMNITEM CM=\"aPartInventoryAdjustment.aDateAdjusted\" UI=\"LT_PartInventoryAdjustment_Label_DateAdjusted\" PIN=\"0\" WIDTH=\"118\" SORT=\"ASC\" /> <COLUMNITEM CM=\"aPartInventoryAdjustment.AADJUSTMENTNUMBER\" UI=\"LT_PartInventoryAdjustment_Label_AdjustmentNumber\" PIN=\"0\" WIDTH=\"87\" /></GRIDCRITERIA>"); "<?xml version=\"1.0\" encoding=\"utf-16\" standalone=\"yes\"?><GRIDCRITERIA> <COLUMNITEM CM=\"aPartInventoryAdjustment.aDateAdjusted\" UI=\"LT_PartInventoryAdjustment_Label_DateAdjusted\" PIN=\"0\" WIDTH=\"118\" SORT=\"ASC\" /> <COLUMNITEM CM=\"aPartInventoryAdjustment.AADJUSTMENTNUMBER\" UI=\"LT_PartInventoryAdjustment_Label_AdjustmentNumber\" PIN=\"0\" WIDTH=\"87\" /></GRIDCRITERIA>");
progress.Append("Exporting " + pil.Count.ToString()+" inventory adjustments"); progress.Append("Exporting " + pil.Count.ToString() + " inventory adjustments");
foreach (PartInventoryAdjustmentList.PartInventoryAdjustmentListInfo i in pil) foreach (PartInventoryAdjustmentList.PartInventoryAdjustmentListInfo i in pil)
{ {
if (!progress.KeepGoing) return; if (!progress.KeepGoing) return;
@@ -3535,7 +3535,16 @@ namespace AyaNova.PlugIn.V8
dynamic dwip = new JObject(); dynamic dwip = new JObject();
dwip.workOrderId = RavenId; dwip.workOrderId = RavenId;
dwip.workOrderItemId = ravenwoitemid; dwip.workOrderItemId = ravenwoitemid;
dwip.quantity = wip.Quantity; if (wip.Used)
{
dwip.quantity = wip.Quantity;
dwip.suggestedQuantity = 0;
}
else
{
dwip.quantity = 0;
dwip.suggestedQuantity = wip.Quantity;
}
var tryPartId = await Getv7v8IdMapNullOk(wip.PartID, RootObjectTypes.Part); var tryPartId = await Getv7v8IdMapNullOk(wip.PartID, RootObjectTypes.Part);
if (tryPartId == null) if (tryPartId == null)
{ {
@@ -5007,8 +5016,6 @@ namespace AyaNova.PlugIn.V8
#region Global / Regional WIKIPAGES #region Global / Regional WIKIPAGES
private async System.Threading.Tasks.Task ExportGlobalRegionalWiki(ProgressForm progress) private async System.Threading.Tasks.Task ExportGlobalRegionalWiki(ProgressForm progress)
{ {