This commit is contained in:
@@ -4149,7 +4149,7 @@ namespace AyaNova.Biz
|
||||
//
|
||||
private async Task TravelPopulateVizFields(PMItemTravel o, bool calculateTotalsOnly = false)
|
||||
{
|
||||
if (calculateTotalsOnly == false)
|
||||
if (calculateTotalsOnly == false)
|
||||
{
|
||||
if (o.UserId != null)
|
||||
{
|
||||
@@ -5048,10 +5048,10 @@ namespace AyaNova.Biz
|
||||
.Where(z => z.GenerateDate < DateTime.UtcNow && (z.StopGeneratingDate == null || z.StopGeneratingDate > DateTime.UtcNow) && z.Active == true)
|
||||
.Select(z => z.Id)
|
||||
.ToListAsync();
|
||||
#if (DEBUG)
|
||||
if (l.Count > 0)
|
||||
log.LogInformation($"Found {l.Count} ready to generate PM orders");
|
||||
#endif
|
||||
// #if (DEBUG)
|
||||
// if (l.Count > 0)
|
||||
// log.LogInformation($"Found {l.Count} ready to generate PM orders");
|
||||
// #endif
|
||||
|
||||
//process those pms
|
||||
foreach (long pmid in l)
|
||||
@@ -5063,9 +5063,9 @@ namespace AyaNova.Biz
|
||||
|
||||
|
||||
|
||||
#if (DEBUG)
|
||||
log.LogInformation($"processing pm id {pmid}");
|
||||
#endif
|
||||
// #if (DEBUG)
|
||||
// log.LogInformation($"processing pm id {pmid}");
|
||||
// #endif
|
||||
var p = await ct.PM.AsSplitQuery()
|
||||
.Include(w => w.Items.OrderBy(item => item.Sequence))
|
||||
.ThenInclude(wi => wi.Expenses)
|
||||
@@ -5184,9 +5184,9 @@ namespace AyaNova.Biz
|
||||
try
|
||||
{
|
||||
await ct.SaveChangesAsync();
|
||||
#if (DEBUG)
|
||||
log.LogInformation($"updated PM after successful generation {p.Serial}");
|
||||
#endif
|
||||
// #if (DEBUG)
|
||||
// log.LogInformation($"updated PM after successful generation {p.Serial}");
|
||||
// #endif
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -5564,21 +5564,13 @@ namespace AyaNova.Biz
|
||||
}
|
||||
}
|
||||
|
||||
//wo.Items.Add(woi);
|
||||
|
||||
}
|
||||
|
||||
// WorkOrderBiz biz = WorkOrderBiz.GetBiz(ct);
|
||||
// var NewObject = await biz.WorkOrderCreateAsync(wo, false);
|
||||
// if (NewObject == null)
|
||||
// {
|
||||
// var err = $"PMBiz::NewServiceWorkOrderFromPMAsync error creating from PM {p.Serial}\r\n{biz.GetErrorsAsString()}";
|
||||
// log.LogError(err);
|
||||
// await NotifyEventHelper.AddGeneralNotifyEvent(AyaType.PM, p.Id, NotifyEventType.PMGenerationFailed, $"Error generating Work order from PM {p.Serial}\r\n{biz.GetErrorsAsString()}", "Preventive Maintenance");
|
||||
// return false;
|
||||
// }
|
||||
#if (DEBUG)
|
||||
log.LogInformation($"PMBiz::NewServiceWorkOrderFromPMAsync created new workorder {NewWoHeader.Serial}");
|
||||
#endif
|
||||
|
||||
// #if (DEBUG)
|
||||
// log.LogInformation($"PMBiz::NewServiceWorkOrderFromPMAsync created new workorder {NewWoHeader.Serial}");
|
||||
// #endif
|
||||
return true;
|
||||
}
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user