FORMAT==100
FEEDSTRINGS;
SKIPCHECK;

#******************************************************
# Check if rules apply to this scenario
#******************************************************
[]=N:
  IF(ATTRS('Version', !Version, 'Link to Drivers') @= 'Y',
    CONTINUE,
    STET
  );

#********************************************
# Stets
#********************************************
['Actual']=STET;
['2006']=STET;
['2007']=STET;
['2008']=STET;

['Local','Std Annual Salary']=N:
  DB('LabourAssumptions',!Currency,!Version,!FiscalYear,
  DB('LabourExistingInputs',!Currency,!Version,!FiscalYear,!Region,!ExistingEmployees,'Position Grade'),
  ELPAR('Region', DB('LabourExistingInputs',!Currency,!Version,!FiscalYear,!Region,!ExistingEmployees,'Department'),1),
  'Std Annual Salary');

['Local','Annual Salary']=N:
  IF(['Override Salary'] <> 0,
    ['Override Salary'] * ['FTE'],
    ['Std Annual Salary'] * ['FTE']
  );

['Local','Monthly Salary']=N:
  ['Annual Salary']\12;

FEEDERS;

['Local','Override Salary']=>
  ['Local','Std Annual Salary'];

['Local','Override Salary']=>
  ['Local','Annual Salary'];

['Local','Override Salary']=>
  ['Local','Monthly Salary'];

#********************************************
# EXTERNAL FEEDERS
# LabourExistingCosts Cube
#********************************************
['Local','FTE']=>
  DB('LabourExistingCosts',!Currency,!Version,!FiscalYear,'Total Year',
  DB('LabourExistingInputs',!Currency,!Version,!FiscalYear,!Region,!ExistingEmployees,'Department'),
  !Region,
  !ExistingEmployees,'Monthly Salary');

['Local','FTE']=>
  DB('LabourExistingCosts',!Currency,!Version,!FiscalYear,'Total Year',
  DB('LabourExistingInputs',!Currency,!Version,!FiscalYear,!Region,!ExistingEmployees,'Department'),
  !Region,
  !ExistingEmployees,'Monthly Salary After Inc');

['Local','FTE']=>
  DB('LabourExistingCosts',!Currency,!Version,!FiscalYear,'Total Year',
  DB('LabourExistingInputs',!Currency,!Version,!FiscalYear,!Region,!ExistingEmployees,'Department'),
  !Region,
  !ExistingEmployees,'FTE');

['Local','FTE']=>
  DB('LabourExistingCosts',!Currency,!Version,!FiscalYear,'Total Year',
  DB('LabourExistingInputs',!Currency,!Version,!FiscalYear,!Region,!ExistingEmployees,'Department'),
  !Region,
  !ExistingEmployees,'Superannuation');

['Local','FTE']=>
  DB('LabourExistingCosts',!Currency,!Version,!FiscalYear,'Total Year',
  DB('LabourExistingInputs',!Currency,!Version,!FiscalYear,!Region,!ExistingEmployees,'Department'),
  !Region,
  !ExistingEmployees,'Workcover');

['Local','FTE']=>
  DB('LabourExistingCosts',!Currency,!Version,!FiscalYear,'Total Year',
  DB('LabourExistingInputs',!Currency,!Version,!FiscalYear,!Region,!ExistingEmployees,'Department'),
  !Region,
  !ExistingEmployees,'LSL');

['Local','FTE']=>
  DB('LabourExistingCosts',!Currency,!Version,!FiscalYear,'Total Year',
  DB('LabourExistingInputs',!Currency,!Version,!FiscalYear,!Region,!ExistingEmployees,'Department'),
  !Region,
  !ExistingEmployees,'Payroll Tax');

['Local','FTE']=>
  DB('LabourExistingCosts',!Currency,!Version,!FiscalYear,'Total Year',
  DB('LabourExistingInputs',!Currency,!Version,!FiscalYear,!Region,!ExistingEmployees,'Department'),
  !Region,
  !ExistingEmployees,'Other');

['Local','FTE']=>
  DB('LabourExistingCosts',!Currency,!Version,!FiscalYear,'Total Year',
  DB('LabourExistingInputs',!Currency,!Version,!FiscalYear,!Region,!ExistingEmployees,'Department'),
  !Region,
  !ExistingEmployees,'Communication Costs');

['Local','FTE']=>
  DB('LabourExistingCosts',!Currency,!Version,!FiscalYear,'Total Year',
  DB('LabourExistingInputs',!Currency,!Version,!FiscalYear,!Region,!ExistingEmployees,'Department'),
  !Region,
  !ExistingEmployees,'Motor Vehicle Costs');

['Local','FTE']=>
  DB('LabourExistingCosts',!Currency,!Version,!FiscalYear,'Total Year',
  DB('LabourExistingInputs',!Currency,!Version,!FiscalYear,!Region,!ExistingEmployees,'Department'),
  !Region,
  !ExistingEmployees,'Staff Expenses');

#********************************************
# EXTERNAL FEEDERS
# LabourTotalCosts Cube
#********************************************
['Local','FTE']=>
  DB('LabourTotalCosts',!Currency,!Version,!FiscalYear,'Total Year',
  DB('LabourExistingInputs',!Currency,!Version,!FiscalYear,!Region,!ExistingEmployees,'Department'),
  !Region,
  'Existing FTEs');

['Local','FTE']=>
  DB('LabourTotalCosts',!Currency,!Version,!FiscalYear,'Total Year',
  DB('LabourExistingInputs',!Currency,!Version,!FiscalYear,!Region,!ExistingEmployees,'Department'),
  !Region,
  'Planned Salaries');

['Local','FTE']=>
  DB('LabourTotalCosts',!Currency,!Version,!FiscalYear,'Total Year',
  DB('LabourExistingInputs',!Currency,!Version,!FiscalYear,!Region,!ExistingEmployees,'Department'),
  !Region,
  'Superannuation');

['Local','FTE']=>
  DB('LabourTotalCosts',!Currency,!Version,!FiscalYear,'Total Year',
  DB('LabourExistingInputs',!Currency,!Version,!FiscalYear,!Region,!ExistingEmployees,'Department'),
  !Region,
  DB('LabourExistingInputs',!Currency,!Version,!FiscalYear,!Region,!ExistingEmployees,'Region'),
  'Workcover');

['Local','FTE']=>
  DB('LabourTotalCosts',!Currency,!Version,!FiscalYear,'Total Year',
  DB('LabourExistingInputs',!Currency,!Version,!FiscalYear,!Region,!ExistingEmployees,'Department'),
  !Region,
  'LSL');

['Local','FTE']=>
  DB('LabourTotalCosts',!Currency,!Version,!FiscalYear,'Total Year',
  DB('LabourExistingInputs',!Currency,!Version,!FiscalYear,!Region,!ExistingEmployees,'Department'),
  !Region,
  'Payroll Tax');

['Local','FTE']=>
  DB('LabourTotalCosts',!Currency,!Version,!FiscalYear,'Total Year',
  DB('LabourExistingInputs',!Currency,!Version,!FiscalYear,!Region,!ExistingEmployees,'Department'),
  !Region,
  'Other');

['Local','FTE']=>
  DB('LabourTotalCosts',!Currency,!Version,!FiscalYear,'Total Year',
  DB('LabourExistingInputs',!Currency,!Version,!FiscalYear,!Region,!ExistingEmployees,'Department'),
  !Region,
  'Communication Costs');

['Local','FTE']=>
  DB('LabourTotalCosts',!Currency,!Version,!FiscalYear,'Total Year',
  DB('LabourExistingInputs',!Currency,!Version,!FiscalYear,!Region,!ExistingEmployees,'Department'),
  !Region,
  'Motor Vehicle Costs');

['Local','FTE']=>
  DB('LabourTotalCosts',!Currency,!Version,!FiscalYear,'Total Year',
  DB('LabourExistingInputs',!Currency,!Version,!FiscalYear,!Region,!ExistingEmployees,'Department'),
  !Region,
  'SuperannuaStaff Expensestion');

