| Quintiq file version 2.0 | 
| #parent: #root | 
| Method ResetPeriodTaskManualQuantity ( | 
|   RunContextForCapacityPlanning runcontext, | 
|   LibOpt_Scope scope | 
| ) | 
| { | 
|   Description: 'Reset period task quantity, return period task has user quantity' | 
|   TextBody: | 
|   [* | 
|     isoverridemanualplanning := runcontext.HasOverwrittenManualPlanning();  | 
|      | 
|     if ( isoverridemanualplanning )  | 
|     { | 
|       regularoptimizerrun := not runcontext.IsSmartPlan() and not runcontext.IsMetaIteration();  | 
|       ismetafullrun := runcontext.IsMetaIteration() and not this.GetPeriodsFromPeriodTaskOperation();    | 
|       checkfor_pto_inscope := not regularoptimizerrun  | 
|                               and not ismetafullrun; | 
|      | 
|       traverse( scope.GetOperationInOptimizerRun(),  | 
|                 Elements.PeriodTaskOperationWithUserQty,  | 
|                 pt, | 
|                 ifexpr(  checkfor_pto_inscope, scope.Contains( pt.PeriodTaskOperationInOptimizerRun() ), true )  | 
|                 and not pt.UnitPeriod().IsPeriodFrozen()  | 
|                 and scope.Contains( pt.UnitPeriod().Period_MP().PeriodInOptimizerRun() )  ) | 
|       { | 
|         pt.ResetHasUserQuantity( true, runcontext, scope );  | 
|       } | 
|     } | 
|   *] | 
|   InterfaceProperties { Accessibility: 'Module' } | 
| } |