This commit is contained in:
2021-08-03 20:16:25 +00:00
parent 30363f6c5b
commit f72364a9bd

View File

@@ -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<string> transl=new List<string>();
transl.Add("Part");
transl.Add("PartWarehouse");
transl.Add("required");
TranslationBiz.GetSubsetForUserStaticAsync(,sub.UserId);
//Get the translations for this user
List<string> transl = new List<string>();
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");
}
}