diff --git a/server/biz/GlobalBizSettingsBiz.cs b/server/biz/GlobalBizSettingsBiz.cs index 883086d..c73762e 100644 --- a/server/biz/GlobalBizSettingsBiz.cs +++ b/server/biz/GlobalBizSettingsBiz.cs @@ -262,7 +262,9 @@ namespace Sockeye.Biz { //create product if not exist then import //Get product id if exists - var p = await ct.Product.AsNoTracking().FirstOrDefaultAsync(z => z.Name == jPurchase["name"].Value()); + var ProductName = jPurchase["name"].Value(); + ProductName = ProductName.Replace("- Renewal", "").Replace(" Renewal", "").Replace(" RENEWAL", "").Replace("CANCELLED ", ""); + var p = await ct.Product.AsNoTracking().FirstOrDefaultAsync(z => z.Name == ProductName); if (p == null) { //Create it here @@ -290,7 +292,7 @@ namespace Sockeye.Biz s.RenewNoticeSent = jPurchase["renewNoticeSent"].Value(); s.SalesOrderNumber = jPurchase["salesOrderNumber"].Value(); s.VendorData = jPurchase["notes"].Value(); - PurchaseBiz biz=PurchaseBiz.GetBiz(ct); + PurchaseBiz biz = PurchaseBiz.GetBiz(ct); await biz.CreateAsync(s); } diff --git a/server/util/DateUtil.cs b/server/util/DateUtil.cs index 1a66ef7..f0085fb 100644 --- a/server/util/DateUtil.cs +++ b/server/util/DateUtil.cs @@ -155,17 +155,15 @@ namespace Sockeye.Util public static DateTime? EpochToDateNullIsNull(long? uepoch) { - DateTime dt = DateTime.Now; if (uepoch == null) return null; - return DateTimeOffset.FromUnixTimeSeconds(uepoch.Value).DateTime; + return DateTimeOffset.FromUnixTimeSeconds(uepoch.Value).UtcDateTime; } public static DateTime EpochToDateNullIsMin(long? uepoch) { - DateTime dt = DateTime.Now; if (uepoch == null) return DateTime.MinValue; - return DateTimeOffset.FromUnixTimeSeconds(uepoch.Value).DateTime; + return DateTimeOffset.FromUnixTimeSeconds(uepoch.Value).UtcDateTime; }