From 0aca73ec009b7f4c61291aaccdd7afd61f1a89d2 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 24 Feb 2021 18:00:12 +0000 Subject: [PATCH] --- server/AyaNova/biz/PurchaseOrderBiz.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/AyaNova/biz/PurchaseOrderBiz.cs b/server/AyaNova/biz/PurchaseOrderBiz.cs index 66d79c8b..3f91b858 100644 --- a/server/AyaNova/biz/PurchaseOrderBiz.cs +++ b/server/AyaNova/biz/PurchaseOrderBiz.cs @@ -528,6 +528,11 @@ namespace AyaNova.Biz //Update part values into poitem if the vendor has changed if (oldObj.VendorId != newObj.VendorId) SetPoItemDefaultPartValues(newItem, PoParts, newObj.VendorId); + + //Set received cost if appropriate but don't overwrite an existing one + if (newItem.QuantityReceived > 0 && newItem.ReceivedCost == 0 && newItem.PurchaseOrderCost != 0) + newItem.ReceivedCost = newItem.PurchaseOrderCost; + continue;//on to next } @@ -556,8 +561,7 @@ namespace AyaNova.Biz //Costs poItem.PurchaseOrderCost = ThisPart.Cost; - if (poItem.QuantityReceived > 0 && poItem.ReceivedCost == 0 && poItem.PurchaseOrderCost != 0) - poItem.ReceivedCost = poItem.PurchaseOrderCost; + }