diff --git a/PARR.EsppScheduleSync/ScheduleSyncher.cs b/PARR.EsppScheduleSync/ScheduleSyncher.cs index 9c3513c0..c3024861 100644 --- a/PARR.EsppScheduleSync/ScheduleSyncher.cs +++ b/PARR.EsppScheduleSync/ScheduleSyncher.cs @@ -139,7 +139,15 @@ namespace PARR.EsppScheduleSync esppObject.Dayofweek = esppSchedule.Values.First(t => t.Order == 0).Value.EsppExportValue; break; case EsppSchTypeScheduleEnum.Monthly: - esppObject.Dayofmonth = esppSchedule.Values.First(t => t.Order == 0).Value.EsppExportValue; + //если включено автораспределение, подставляем дату месяца из NextRun + if (template.ApplicationsInWork?.IsAutoDistributionEnabled == true) + { + esppObject.Dayofmonth = template.NextRun.Day.ToString(); + } + else + { + esppObject.Dayofmonth = esppSchedule.Values.First(t => t.Order == 0).Value.EsppExportValue; + } break; case EsppSchTypeScheduleEnum.Monthly2: esppObject.Md1 = esppSchedule.Values.First(t => t.Order == 0).Value.EsppExportValue;