chenqinghong
2024-05-07 3ec06a830367465068963156dcc1d8e522571c13
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Quintiq file version 2.0
#parent: #root
Method UpdateUnitPeriodsShiftPattern (
  MacroPlan macroplan,
  Unit unit,
  Dates dates,
  ShiftPattern shiftpattern
)
{
  TextBody:
  [*
    if( this.Run().AssertNotIsNull( unit, 'Not able update shift pattern for unit period(s) as unit not found.' ) )
    {
      unitPeriods := selectset( unit, UnitPeriod.astype( UnitPeriodTime ), upt, upt.IsPlanning() 
                                and exists( dates, Elements, d, d = upt.StartDate() )  );
      
      UnitAvailability::CreateOrUpdateForUnitPeriodTimes( unitPeriods, false, '', Duration::Zero(), false, 1.0, false, 1.0,
                                                          true, /* batch edit shift pattern */ shiftpattern,
                                                          false, 100.0, false, 1, false, false, 100.0 );
    }
  *]
  InterfaceProperties { Accessibility: 'Module' }
}