hongji.li
2023-11-03 aefafd2142478d4fb07d6b8b45c3047e247389e0
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
Quintiq file version 2.0
#parent: #root
Method Copy (
  FormInventoryCosts formInventoryCosts,
  InventoryValueAndCost inventoryCost
) id:Method_DialogCreateEditInventoryCost_Copy
{
  #keys: '[144528.2.67597210]'
  Body:
  [*
    // Copy inventory cost (only allow one)
    DataHolderForm.Data( formInventoryCosts ); // Form that opens the dialog, to select the newly created object in list
    
    // PISP for the cost we are copying
    pisp := inventoryCost.ProductInStockingPoint_MP();
    
    // Create new shadow based on the Inventory Cost we are copying
    shadowInventoryCost := shadow( inventoryCost )
    shadowInventoryCost.ResetWrapped();
    shadowInventoryCost.ID( MacroPlan.IDHolder().GetInventoryValueAndHoldingCostID() );
    
    DataHolderDialogData.Data( &shadowInventoryCost );
    
    // Populate owner DH
    pispsForInvCost := construct( ProductInStockingPoint_MPs );
    pispsForInvCost.Add( pisp );
    DataHolderPISPs.Data( &pispsForInvCost );
    
    this.Initialize();
  *]
}