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; + }