admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
Quintiq file version 2.0
#parent: #root
Method UpdateTypeIndex (
  String stockingpointid
)
{
  Description: 'Update stocking point TypeIndex and linked instances.'
  TextBody:
  [*
    // Update stocking point TypeIndex and linked instances only if the new ID is not the same as the old ID
    if( stockingpointid <> this.ID() )
    {
      // Update type index of all related StockingPointInPeriod
      traverse( this, StockingPointInPeriod, spip )
      {
        spip.UpdateTypeIndex( stockingpointid, spip.Start(), spip.End() );
      }
    
      // Update type index of all related ProductInStockingPoint_MP
      traverse( this, ProductInStockingPoint_MP, pisp )
      {
        pisp.UpdateTypeIndex( pisp.ProductID(), stockingpointid );
      }
    
      // Update foreign key of all related StockingPointCost
      traverse( this, StockingPointCost, spcost )
      {
        spcost.UpdateForeignKey( stockingpointid );
      }
    
      // Update type index of all related StockingPointInLane
      traverse( this, StockingPointInLane, spilane )
      {
        spilane.UpdateTypeIndex( stockingpointid, spilane.OriginLaneID(), spilane.DestinationLaneID(), true );
      }
    
      // Update type index of all related StockingPointCapacity
      traverse( this, StockingPointCapacity, spcapacity )
      {
        spcapacity.UpdateTypeIndex( stockingpointid, spcapacity.Start() );
      }
    
      // Update foreign key of all related StockingPointAccount
      traverse( this, StockingPointAccount, spaccount )
      {
        spaccount.UpdateForeignKey( stockingpointid );
      }
    
      // Update type index of all related StockingPointUnit
      traverse( this, StockingPointUnit, spunit )
      {
        spunit.UpdateTypeIndex( stockingpointid, spunit.UnitID(), spunit.IsInput() );
      }
      
      // Update foreign key of all related InventoryValueAndCost
      traverse( this, InventoryValueAndCost, ivc )
      {
        ivc.UpdateForeignKey( ivc.ProductID(), stockingpointid );
      }
      
      // Update type index of all related PISPSpecification
      traverse( this, PISPSpecification, pspec )
      {
        pspec.UpdateTypeIndex( pspec.ProductID(), stockingpointid );
      }
      
      // Update EntityID of subsets for StockingPoint_MP
      traverse( this, SubsetEntityInOptimizerPuzzleBase, subsets )
      {
        subsets.UpdateTypeIndex( subsets.OptimizerPuzzleName(), stockingpointid, subsets.EntityType() );
      } 
      
      // Update type index of this StockingPoint_MP
      this.IsManuallyConfigured( true );
      StockingPoint_MP::ChangeKeyStockingPointTypeIndex( this, stockingpointid );
    }
  *]
}