diff --git a/server/generator/SockBotProcessVendorNotifications.cs b/server/generator/SockBotProcessVendorNotifications.cs index eb77706..b7be9b1 100644 --- a/server/generator/SockBotProcessVendorNotifications.cs +++ b/server/generator/SockBotProcessVendorNotifications.cs @@ -206,11 +206,14 @@ namespace Sockeye.Biz var product = await ct.Product.AsNoTracking().FirstOrDefaultAsync(z => z.VendorCode == SalesItemProductVendorCode) ?? throw new System.ArgumentOutOfRangeException($"Vendor product code:{SalesItemProductVendorCode} was not found in Sockeye Products, record not processed"); p.ProductId = product.Id; p.PGroup = product.PGroup; - p.Currency = jPurchase["accounting"]["currency"].Value(); - p.ProductNet = jPurchase["accounting"]["product_net"].Value(); - p.Discount = jPurchase["accounting"]["discount"].Value(); - p.VendorFee = jPurchase["accounting"]["margin_net"].Value(); - p.Revenue = jPurchase["accounting"]["your_revenue"].Value(); + if (jPurchase["accounting"] != null) + { + p.Currency = jPurchase["accounting"]["currency"].Value(); + p.ProductNet = jPurchase["accounting"]["product_net"].Value(); + p.Discount = jPurchase["accounting"]["discount"].Value(); + p.VendorFee = jPurchase["accounting"]["margin_net"].Value(); + p.Revenue = jPurchase["accounting"]["your_revenue"].Value(); + } p.CouponCode = "UNKNOWN WHERE IN VENDOR DATA CONTAINS COUPON CODE"; p.Quantity = jPurchase["quantity"].Value(); p.VendorNotificationId = vn.Id;