yypsybs
2023-10-10 550ebcf02217f8a0c6fe9001fcfa8e42e9cd6b83
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
Quintiq file version 2.0
#parent: #root
Method Copy (
  FormStockingCosts formStockingCosts,
  structured[AccountCost] accountCosts
) id:Method_DialogCreateEditStockingCost_Copy
{
  #keys: '[144528.2.67597210]'
  Body:
  [*
    // Copy stocking cost (only allow one)
    DataHolderForm.Data( formStockingCosts ); // Form that opens the dialog, to select the newly created object in list
    
    // Stocking point cost we are copying
    stockingCost := accountCosts.First().astype( StockingPointCost );
    
    // Stocking point for the cost we are copying
    stockingPoint := stockingCost.StockingPoint_MP();
    
    // Create new shadow based on the Stocking point Cost we are copying
    shadowStockingCost := shadow( stockingCost )
    shadowStockingCost.ResetWrapped();
    shadowStockingCost.ID( MacroPlan.IDHolder().GetStockingPointCostID() );
    
    DataHolderDialogData.Data( &shadowStockingCost );
    
    // Populate owner DH
    SPsforSPCost := construct( StockingPoint_MPs );
    SPsforSPCost.Add( stockingPoint );
    DataHolderStockingPoint.Data( &SPsforSPCost );
    
    this.Initialize();
  *]
}