1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
| Quintiq file version 2.0
| #parent: #root
| StaticMethod GetDependentDemandLeadTimeStartMiddlePeriod (
| const Period_MP period,
| Duration leadtime
| ) const declarative remote as DateTime
| {
| Description: 'Returns the middle start date period of the dependent demand considering the lead time'
| TextBody:
| [*
| duration := period.Duration() / 2;
| start := period.Start() + duration - leadtime;
| start := ifexpr( start >= period.MacroPlan().Start(), start, DateTime::MinDateTime() );
|
| if( leadtime >= duration and start.IsFinite() )
| {
| periodbefore := select( period,
| MacroPlan.PlanningPeriod,
| p,
| true,
| p.IsInPeriod( start, period.Start() ) );
| start := guard( periodbefore.Start(), DateTime::MinDateTime() );
| }
|
| return start;
| *]
| }
|
|