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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Quintiq file version 2.0
#parent: #root
StaticMethod CreateOrUpdate (
  Operation op
) as ManufactureLTProcessSection
{
  TextBody:
  [*
    // yypsybs Aug-25-2023 (created)
    orgCode := "";
    productId := "";
    processStep := "";
    sequence := "";
    line := "";
    // routingId = OrgCode_ProductID
    routingIdSplit := op.RoutingID().Tokenize( "_" );
    if( routingIdSplit.Size() = 2 ) {
        orgCode := routingIdSplit.Element( 0 );
        productId := routingIdSplit.Element( 1 );
    }
    // routingStepName = ProcessStep_Sequence
    routingStepNameSplit := op.RoutingStepName().Tokenize( "_" );
    if( routingStepNameSplit.Size() = 2 ) {
        processStep := routingStepNameSplit.Element( 0 );
        sequence := routingStepNameSplit.Element( 1 );
    }
    // operationName = OegCode_ProcessStep_Line
    operationNameSplit := op.Name().Tokenize( "_" );
    if( operationNameSplit.Size() = 3 ) {
        line := operationNameSplit.Element( 2 );
    }
    child := null( ManufactureLTProcessSection );
    if( orgCode <> "" and productId <> "" and processStep <> "" and sequence <> "" ) {
        parent := ManufactureLTImputation::CreateOrUpdate( op.RoutingStep().Routing().MacroPlan(), orgCode, productId, "" );
        info( "DaysAsReal : " + [String]op.UserLeadTime().DaysAsReal() );
        child := ManufactureLTProcessSection::CreateOrUpdate( parent, processStep, false, sequence, line, op.UserLeadTime().DaysAsReal(), 0.0, "" );
    }
    return child;
  *]
}