From c75e49412de448eeb39a9937882e1dd35fdc1808 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 23 Jan 2023 22:35:15 +0000 Subject: [PATCH] --- .../generator/SockBotProcessVendorNotifications.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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;