This commit is contained in:
@@ -4780,6 +4780,13 @@ namespace AyaNova.Biz
|
|||||||
log.LogInformation($"Found {l.Count} inventory checkable PM orders for subscription id {sub.Id}");
|
log.LogInformation($"Found {l.Count} inventory checkable PM orders for subscription id {sub.Id}");
|
||||||
#endif
|
#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);
|
||||||
|
|
||||||
//process those pms
|
//process those pms
|
||||||
foreach (long pmid in l)
|
foreach (long pmid in l)
|
||||||
{
|
{
|
||||||
@@ -4787,16 +4794,17 @@ namespace AyaNova.Biz
|
|||||||
log.LogInformation($"processing pm id {pmid}");
|
log.LogInformation($"processing pm id {pmid}");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//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)
|
//############### TODO UNCOMMENT THIS AFTER TESTING ############################
|
||||||
if (await ct.NotifyDeliveryLog.AnyAsync(z => z.NotifySubscriptionId == sub.Id && z.ObjectId == pmid))
|
// //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");
|
// {
|
||||||
|
// log.LogTrace($"PM {pmid} insufficient inventory already notified to subscriber within last 90 days, no need to send again, skipping");
|
||||||
|
|
||||||
#if (DEBUG)
|
// #if (DEBUG)
|
||||||
log.LogInformation($"PM {pmid} insufficient inventory already notified to subscriber within last 90 days, no need to send again, skipping");
|
// log.LogInformation($"PM {pmid} insufficient inventory already notified to subscriber within last 90 days, no need to send again, skipping");
|
||||||
#endif
|
// #endif
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
|
|
||||||
//Ok, it's worth checking out and could be a potential notification
|
//Ok, it's worth checking out and could be a potential notification
|
||||||
|
|
||||||
@@ -4853,14 +4861,15 @@ namespace AyaNova.Biz
|
|||||||
{
|
{
|
||||||
var part = await ct.Part.AsNoTracking().Where(x => x.Id == i.PartId).Select(x => x.PartNumber).FirstOrDefaultAsync();
|
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 whs = await ct.PartWarehouse.AsNoTracking().Where(x => x.Id == i.WarehouseId).Select(x => x.Name).FirstOrDefaultAsync();
|
||||||
sb.AppendLine($"{part} @ {whs}: {i.QuantityRequired - dBalance}");
|
var qty=(i.QuantityRequired-dBalance).ToString("G29", System.Globalization.CultureInfo.InvariantCulture);
|
||||||
|
sb.Append($"~part~ {part}, ~whs~ {whs} ~required~ {qty}\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sb.Length > 0)
|
if (sb.Length > 0)
|
||||||
{
|
{
|
||||||
NotifyEvent n = new NotifyEvent()
|
NotifyEvent n = new NotifyEvent()
|
||||||
{
|
{
|
||||||
EventType = NotifyEventType.PMStopGeneratingDateReached,
|
EventType = NotifyEventType.PMInsufficientInventory,
|
||||||
UserId = sub.UserId,
|
UserId = sub.UserId,
|
||||||
AyaType = AyaType.PM,
|
AyaType = AyaType.PM,
|
||||||
ObjectId = p.Id,
|
ObjectId = p.Id,
|
||||||
|
|||||||
@@ -2300,5 +2300,6 @@
|
|||||||
"PMNextWoGenerateDate":"Nächstes Generierungsdatum",
|
"PMNextWoGenerateDate":"Nächstes Generierungsdatum",
|
||||||
"ExcludeDaysOfWeek":"Wochentage ausschließen",
|
"ExcludeDaysOfWeek":"Wochentage ausschließen",
|
||||||
"ErrorGenBeforeTooSmall":"Muss kleiner sein als Wiederholungsintervall",
|
"ErrorGenBeforeTooSmall":"Muss kleiner sein als Wiederholungsintervall",
|
||||||
"ErrorRepeatIntervalTooSmall":"Mindestens eine Stunde"
|
"ErrorRepeatIntervalTooSmall":"Mindestens eine Stunde",
|
||||||
|
"QuantityRequired":"Quantity required"
|
||||||
}
|
}
|
||||||
@@ -2300,6 +2300,7 @@
|
|||||||
"PMNextWoGenerateDate":"Next generate event",
|
"PMNextWoGenerateDate":"Next generate event",
|
||||||
"ExcludeDaysOfWeek":"Exclude days of week",
|
"ExcludeDaysOfWeek":"Exclude days of week",
|
||||||
"ErrorGenBeforeTooSmall":"Must be smaller than Repeat interval",
|
"ErrorGenBeforeTooSmall":"Must be smaller than Repeat interval",
|
||||||
"ErrorRepeatIntervalTooSmall":"Minimum one hour"
|
"ErrorRepeatIntervalTooSmall":"Minimum one hour",
|
||||||
|
"QuantityRequired":"Quantity required"
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2300,5 +2300,6 @@
|
|||||||
"PMNextWoGenerateDate":"Siguiente evento de generación",
|
"PMNextWoGenerateDate":"Siguiente evento de generación",
|
||||||
"ExcludeDaysOfWeek":"Excluir días de la semana",
|
"ExcludeDaysOfWeek":"Excluir días de la semana",
|
||||||
"ErrorGenBeforeTooSmall":"Debe ser menor que el intervalo de repetición",
|
"ErrorGenBeforeTooSmall":"Debe ser menor que el intervalo de repetición",
|
||||||
"ErrorRepeatIntervalTooSmall":"Mínimo una hora"
|
"ErrorRepeatIntervalTooSmall":"Mínimo una hora",
|
||||||
|
"QuantityRequired":"Quantity required"
|
||||||
}
|
}
|
||||||
@@ -2300,5 +2300,6 @@
|
|||||||
"PMNextWoGenerateDate":"Prochain événement de génération",
|
"PMNextWoGenerateDate":"Prochain événement de génération",
|
||||||
"ExcludeDaysOfWeek":"Exclure les jours de la semaine",
|
"ExcludeDaysOfWeek":"Exclure les jours de la semaine",
|
||||||
"ErrorGenBeforeTooSmall":"Doit être inférieur à l'intervalle de répétition",
|
"ErrorGenBeforeTooSmall":"Doit être inférieur à l'intervalle de répétition",
|
||||||
"ErrorRepeatIntervalTooSmall":"Au moins une heure"
|
"ErrorRepeatIntervalTooSmall":"Au moins une heure",
|
||||||
|
"QuantityRequired":"Quantity required"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user