| Quintiq file version 2.0 | 
| #parent: #root | 
| Method GetAllowedPostponementPeriods () declarative remote as constcontent owning Period_MPs | 
| { | 
|   Description: 'Retrieve planning periods that the SDiP are allowed to be postponed to' | 
|   TextBody: | 
|   [* | 
|     result := null( Period_MPs, owning, constcontent ) | 
|      | 
|     if( not isnull( this.AsSalesDemandInPeriodBase() ) ) | 
|     { | 
|       pispipend := guard( this.AsSalesDemandInPeriodBase().End(), DateTime::MaxDateTime() ); | 
|       nrofdays := this.LastAllowedPostponementPeriodEnd() - pispipend; | 
|        | 
|       // Get BasePISPIPs within range and retrieve Period_MP | 
|       pispips := this.AsSalesDemandInPeriodBase().GetNextPlanningPISPIPs( nrofdays.DaysAsReal() ); | 
|       result := selectset( pispips, Elements.Period_MP, period,  | 
|                            period.End() <= this.LastAllowedPostponementPeriodEnd() ); | 
|     } | 
|      | 
|     return &result; | 
|   *] | 
| } |