This commit is contained in:
2023-02-08 23:45:00 +00:00
parent c64c1ad11a
commit 33d43a4e78
3 changed files with 6 additions and 4 deletions

View File

@@ -253,6 +253,7 @@ namespace Sockeye.Biz
//create product if not exist then import
//Get product id if exists
var ProductName = jPurchase["name"].Value<string>();
bool maybeRenewal=ProductName.ToLowerInvariant().Contains("renew");
ProductName = ProductName.Replace("- Renewal", "").Replace(" Renewal", "").Replace(" RENEWAL", "").Replace("CANCELLED ", "").Replace("CANCELED ", "");
var p = await ct.Product.AsNoTracking().FirstOrDefaultAsync(z => z.VendorCode == jPurchase["productCode"].Value<string>());
@@ -304,6 +305,7 @@ namespace Sockeye.Biz
s.RenewNoticeSent = jPurchase["renewNoticeSent"].Value<bool>();
s.SalesOrderNumber = jPurchase["salesOrderNumber"].Value<string>();
s.Notes = jPurchase["notes"].Value<string>();
s.IsRenewal=maybeRenewal;
PurchaseBiz biz = PurchaseBiz.GetBiz(ct);
await biz.CreateAsync(s);
}