From 78e4247349bfd799796fbbcda927023605989397 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 27 Aug 2021 21:51:59 +0000 Subject: [PATCH] --- source/Plugins/AyaNova.Plugin.V8/V8.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source/Plugins/AyaNova.Plugin.V8/V8.cs b/source/Plugins/AyaNova.Plugin.V8/V8.cs index bdc3219..00b06cc 100644 --- a/source/Plugins/AyaNova.Plugin.V8/V8.cs +++ b/source/Plugins/AyaNova.Plugin.V8/V8.cs @@ -35,7 +35,7 @@ namespace AyaNova.PlugIn.V8 public string PluginVersion { - get { return "7.6.1-alpha.126B"; } + get { return "7.6.1-alpha.127"; } } public string About @@ -4665,7 +4665,17 @@ namespace AyaNova.PlugIn.V8 { //this is the match, do the fixup //v8 inventory starts with 1 billion so every adjustment will always be *down* - dAdjust = v7o.LT_PartByWarehouseInventory_Label_QuantityOnHand - v8OnHand; + + if (v7o.LT_PartByWarehouseInventory_Label_QuantityOnHand < 0) + { + //don't allow negative inventory, log and set to zero instead + progress.Append("NOTE: Negative on hand for " + i.Name + " v7 (" + v7o.LT_PartByWarehouseInventory_Label_QuantityOnHand.ToString() + ") setting as zero in v8"); + dAdjust = v8OnHand * -1; + } + else + { + dAdjust = v7o.LT_PartByWarehouseInventory_Label_QuantityOnHand - v8OnHand; + } dMinStockLevel = v7o.LT_PartByWarehouseInventory_Label_MinStockLevel; handled = true; break;