From f72364a9bd697bf5e9ab2d513c270193c5230a43 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 3 Aug 2021 20:16:25 +0000 Subject: [PATCH] --- server/AyaNova/biz/PMBiz.cs | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/server/AyaNova/biz/PMBiz.cs b/server/AyaNova/biz/PMBiz.cs index 5068a808..9400d161 100644 --- a/server/AyaNova/biz/PMBiz.cs +++ b/server/AyaNova/biz/PMBiz.cs @@ -4780,12 +4780,12 @@ namespace AyaNova.Biz log.LogInformation($"Found {l.Count} inventory checkable PM orders for subscription id {sub.Id}"); #endif -//Get the translations for this user -List transl=new List(); -transl.Add("Part"); -transl.Add("PartWarehouse"); -transl.Add("required"); -TranslationBiz.GetSubsetForUserStaticAsync(,sub.UserId); + //Get the translations for this user + List transl = new List(); + transl.Add("Part"); + transl.Add("PartWarehouse"); + transl.Add("QuantityRequired"); + var Trans = await TranslationBiz.GetSubsetForUserStaticAsync(transl, sub.UserId); //process those pms foreach (long pmid in l) @@ -4794,17 +4794,17 @@ TranslationBiz.GetSubsetForUserStaticAsync(,sub.UserId); log.LogInformation($"processing pm id {pmid}"); #endif -//############### TODO UNCOMMENT THIS AFTER TESTING ############################ -// //look for same delivery already made and skip if already notified (sb one time only but will repeat for > 90 days as delivery log gets pruned) -// if (await ct.NotifyDeliveryLog.AnyAsync(z => z.NotifySubscriptionId == sub.Id && z.ObjectId == pmid)) -// { -// log.LogTrace($"PM {pmid} insufficient inventory already notified to subscriber within last 90 days, no need to send again, skipping"); + //############### TODO UNCOMMENT THIS AFTER TESTING ############################ + // //look for same delivery already made and skip if already notified (sb one time only but will repeat for > 90 days as delivery log gets pruned) + // if (await ct.NotifyDeliveryLog.AnyAsync(z => z.NotifySubscriptionId == sub.Id && z.ObjectId == pmid)) + // { + // log.LogTrace($"PM {pmid} insufficient inventory already notified to subscriber within last 90 days, no need to send again, skipping"); -// #if (DEBUG) -// log.LogInformation($"PM {pmid} insufficient inventory already notified to subscriber within last 90 days, no need to send again, skipping"); -// #endif -// continue; -// } + // #if (DEBUG) + // log.LogInformation($"PM {pmid} insufficient inventory already notified to subscriber within last 90 days, no need to send again, skipping"); + // #endif + // continue; + // } //Ok, it's worth checking out and could be a potential notification @@ -4861,7 +4861,7 @@ TranslationBiz.GetSubsetForUserStaticAsync(,sub.UserId); { var part = await ct.Part.AsNoTracking().Where(x => x.Id == i.PartId).Select(x => x.PartNumber).FirstOrDefaultAsync(); var whs = await ct.PartWarehouse.AsNoTracking().Where(x => x.Id == i.WarehouseId).Select(x => x.Name).FirstOrDefaultAsync(); - var qty=(i.QuantityRequired-dBalance).ToString("G29", System.Globalization.CultureInfo.InvariantCulture); + var qty = (i.QuantityRequired - dBalance).ToString("G29", System.Globalization.CultureInfo.InvariantCulture); sb.Append($"~part~ {part}, ~whs~ {whs} ~required~ {qty}\n"); } }