haorenhui
2023-10-30 6d6cc10d9e8e242661da7fd655dec155a09d676c
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
Quintiq file version 2.0
#parent: #root
Method SwitchLane (
  Lane selection,
  StockingPoint_MP origin,
  StockingPoint_MP destination
) id:Method_DialogCreateEditTransportationCost_SwitchLane
{
  #keys: '[145730.1.920081759]'
  Body:
  [*
    // Repopulate shadow laneleg origin & destination
    // Use default location if no origin or destination found
    useDefault := isnull( origin ) or isnull( destination );
    laneLeg := select( selection, LaneLeg, lg,
                       useDefault
                       or ( lg.AsOriginStockingPointLeg().StockingPoint_MP() = origin
                            and lg.AsDestinationStockingPointLeg().StockingPoint_MP() = destination ) );
    
    // Re-create shadow with different owner
    shadowCost := Form.GetShadowCost( laneLeg,
                                      DropDownListAccount.Data(),
                                      DropDownStringListCostDriver.Text(),
                                      DateSelectorCostStart.Date(),
                                      ApplicationMacroPlanner.FormatStringToReal( EditFieldCost.Text() ) );
    
    DataHolderDialogData.Data( &shadowCost );
    
    
    // Populate owner info during single create/edit/copy
    DataHolderFormLaneLeg.Data( Form.SetLaneLeg( laneLeg ) );
    
    // Set cost label
    Form.SetCostLabel( EditFieldLengthOfTime.Text(),
                       DropDownStringListTimeUnit.Text(),
                       DropDownStringListCostDriver.Text() );
  *]
}