Kevin Kok Khah Whey
2023-11-07 5ae534ab606e6f2ba5ea60914224d665b0447d5a
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
Quintiq file version 2.0
#parent: #root
Function CalcBaseCost
{
  TextBody:
  [*
    // Calculate BaseCost and BaseCostWithinKPIHorizon
    cost := 0.0;
    costwithinhorizon := 0.0;
    
    // Calculate costs depending on what the cost driver is, i.e.fixed
    if( this.CostDriver() = Translations::MP_AccountAssignmentCostDriverFixed() )
    {
      accountcost := this.GetAccountCost();
      this.GetBaseFixedCost( cost, costwithinhorizon, accountcost );
    }
    
    // or Staffing
    else if( this.CostDriver() = Translations::MP_AccountAssignmentCostDriverStaffing() )
    {
      accountcost := this.GetAccountCost();
      this.GetBaseCostForStaffing( cost, costwithinhorizon, accountcost );
    }
    // or NrOfUnits
    else if( this.CostDriver() = Translations::MP_AccountAssignmentCostDriverNrOfUnits() )
    {
      accountcost := this.GetAccountCost();
      this.GetBaseCostForNumberOfUnits( cost, costwithinhorizon, accountcost );
    }
    // or Volume
    else if( this.CostDriver() = Translations::MP_AccountAssignmentCostDriverVolume() )
    {
      this.GetBaseCostForVolume( cost, costwithinhorizon );
    }
    // or Time
    else if( this.CostDriver() = Translations::MP_AccountAssignmentCostDriverTime() )
    {
      this.GetBaseCostForTime( cost, costwithinhorizon );
    }
    // or Lot
    else if( this.CostDriver() = Translations::MP_AccountAssignmentCostDriverLot() )
    {              
      this.GetBaseCostForLot( cost, costwithinhorizon );
    }
    // or Changeover
    else if( this.CostDriver() = Translations::MP_AccountAssignmentCostDriverChangeover() )
    {
      this.GetBaseCostForChangeover( cost, costwithinhorizon ); 
    }
    // or One-time cost
    else if( this.CostDriver() = Translations::MP_AccountAssignmentCostDriverOneTime() )
    {
      this.GetBaseCostForOneTimeCost( cost, costwithinhorizon ); 
    }
    
    this.BaseCost( cost );    
    this.BaseCostWithinKPIHorizon( costwithinhorizon );
  *]
}