lazhen
2024-08-30 63de54ec601c2b1c6c62b011442458d963ef9036
_Main/BL/Type_LocalCell_ScheduleSummary/StaticMethod_Create.qbl
@@ -15,7 +15,8 @@
    table := owner.MP_Table( relnew,Name := MP_Cell_ScheduleSummary::GetTableName());
    
    startDate := owner.StartOfPlanning().Date();
    endDate := startDate + 7;
    endDate := maxselect( owner,Unit.UnitPeriod.astype( UnitPeriodTime ).Period_MP,period,period.TimeUnit() = Translations::MP_GlobalParameters_Day(),period.EndDate()).EndDate();
    
    columns := construct( MP_Columns );
    columnIndexTree := NamedValueTree::Create();
@@ -54,7 +55,14 @@
            capacity := workDay * throughput * workHours.Capacity().HoursAsReal()
          }
          
          isFirstWeekData := true;
          if( column.CustomDate() > startDate + 7 ){
            isFirstWeekData := false;
          }
          row.MP_Cell( relnew,MP_Cell_ScheduleSummary,MP_Column := column,
                       IsFristWeekData := isFirstWeekData,
                       ShiftPattern := unitPeriodTime.ShiftPatternName(),
                       WorkingDay := workDay,
                       Capacity := capacity,
@@ -62,7 +70,9 @@
        }
      }
    }
    traverse( table,MP_Column,column,column.MP_Cell( relsize ) = 0 ){
      column.Delete();
    }
    return table;
  *]
}