yypsybs
2023-09-09 3cb5a54def670d97301f07170fcaad213bfc54f2
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
StaticMethod Refresh (
  ManufactureLTProcessSection toRefresh
)
{
  TextBody:
  [*
    // yypsybs Aug-28-2023 (created)
    parent := toRefresh.ManufactureLTImputation();
    toUpdate := select( toRefresh, ManufactureLTImputation.MacroPlan.Routing.RoutingStep.Operation, op,
                        op.RoutingID() = parent.OrgCode() + "_" + parent.SkuID() 
                        and op.RoutingStepName() = toRefresh.ProcessSection() + "_" + toRefresh.Sequence()
                        and op.Name() = ifexpr( toRefresh.Line() <> "", 
                                                parent.OrgCode() + "_" + toRefresh.ProcessSection() + "_" + toRefresh.Line(),
                                                parent.OrgCode() + "_" + toRefresh.ProcessSection() ) );
    if( not isnull( toUpdate ) ) {
      toRefresh.SystemLT( toUpdate.UserLeadTime().DaysAsReal() );
    } else {
      info( "operation to refresh not found" );  
    }
  *]
}