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

@@ -2299,14 +2299,14 @@ namespace AyaNova.PlugIn.V8
{
if (!progress.KeepGoing) return;
progress.Op("Start inventory adjustments");
progress.SubOp("");
//Step 2: export the objects
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>");
progress.Append("Exporting " + pil.Count.ToString()+" inventory adjustments");
progress.Append("Exporting " + pil.Count.ToString() + " inventory adjustments");
foreach (PartInventoryAdjustmentList.PartInventoryAdjustmentListInfo i in pil)
{
if (!progress.KeepGoing) return;
@@ -2335,7 +2335,7 @@ namespace AyaNova.PlugIn.V8
List<string> v8Serials = new List<string>();
foreach (JValue j in v)
v8Serials.Add(j.Value<string>());
if (pi.QuantityAdjustment < 0)
{
//remove serials
@@ -2348,7 +2348,7 @@ namespace AyaNova.PlugIn.V8
foreach (PartSerial ps in pi.SerialNumbers)
v8Serials.Add(ps.SerialNumber);
}
foreach (PartSerial ps in pi.SerialNumbers)
{
dynamic dItem = new JObject();
@@ -3535,7 +3535,16 @@ namespace AyaNova.PlugIn.V8
dynamic dwip = new JObject();
dwip.workOrderId = RavenId;
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);
if (tryPartId == null)
{
@@ -5007,8 +5016,6 @@ namespace AyaNova.PlugIn.V8
#region Global / Regional WIKIPAGES
private async System.Threading.Tasks.Task ExportGlobalRegionalWiki(ProgressForm progress)
{