FORMAT==100
SKIPCHECK;

#********************************************
# Currency Conversion
#********************************************
[{'Actual', 'Budget Approved'}, {'CNY','PHP','THB','INR','HKD','SGD','AUD','JPY','MYR','NZD'}, {'Amount','Adjustment'}]=N:
  ['Local', 'Amount']*DB('ExchangeRates',!Version,!FiscalYear,'Jun',ATTRS('Region', !Region, 'Currency'),!Currency,'Reporting');

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

#********************************************
# Stets
#********************************************
['Budget Entry', '2006']=STET;
['Budget Entry', '2007']=STET;
['Budget Entry', '2008']=STET;
['Budget Entry', '2009']=STET;

#*******************************************************
# Revenue
#*******************************************************
['Local','Budget Entry', '0100','Amount']=N:
  DB('Revenue',!Currency,!Version,!FiscalYear,!Period,!Region,!Department,'All Channels','All Products','Revenue');

['Local','Budget Entry','0200','Amount']=N:
  DB('Revenue',!Currency,!Version,!FiscalYear,!Period,!Region,!Department,'All Channels','All Products','COS');

#*******************************************************
# Headcount
#*******************************************************
['Budget Entry','Headcount']=N:
  DB('LabourTotalCosts',!Currency,!Version,!FiscalYear,!Period,!Department,!Region,'Total FTEs');

#*******************************************************
# Allocations
#*******************************************************
['Local','9901','Amount']=N:
  DB('AllocationCalcs',!Version,!FiscalYear,!Period,!Department,!Region,'All Allocations','Allocated Amount');

['Local','9909','Amount']=N:
  DB('AllocationCalcs',!Version,!FiscalYear,!Period,!Department,!Region,'All Allocations','Credit Amount');

#*******************************************************
# Personnel
#*******************************************************
['Local','Budget Entry','0500','Amount']=N:
  DB('LabourTotalCosts',!Currency,!Version,!FiscalYear,!Period,!Department,!Region,'Planned Salaries');

['Local','Budget Entry','0510','Amount']=N:
  DB('LabourTotalCosts',!Currency,!Version,!FiscalYear,!Period,!Department,!Region,'Award Rate');

['Local','Budget Entry','0550','Amount']=N:
  DB('LabourTotalCosts',!Currency,!Version,!FiscalYear,!Period,!Department,!Region,'Bonuses');

['Local','Budget Entry','0551','Amount']=N:
  DB('LabourTotalCosts',!Currency,!Version,!FiscalYear,!Period,!Department,!Region,'Payroll Tax');

['Local','Budget Entry','0560','Amount']=N:
  DB('LabourTotalCosts',!Currency,!Version,!FiscalYear,!Period,!Department,!Region,'Superannuation');

['Local','Budget Entry','0578','Amount']=N:
  DB('LabourTotalCosts',!Currency,!Version,!FiscalYear,!Period,!Department,!Region,'Workcover');

['Local','Budget Entry','0579','Amount']=N:
  DB('LabourTotalCosts',!Currency,!Version,!FiscalYear,!Period,!Department,!Region,'LSL');

['Local','Budget Entry','0580','Amount']=N:
  DB('LabourTotalCosts',!Currency,!Version,!FiscalYear,!Period,!Department,!Region,'Motor Vehicle Costs');

['Local','Budget Entry','0590','Amount']=N:
  DB('LabourTotalCosts',!Currency,!Version,!FiscalYear,!Period,!Department,!Region,'Communication Costs');

['Local','Budget Entry','0591','Amount']=N:
  DB('LabourTotalCosts',!Currency,!Version,!FiscalYear,!Period,!Department,!Region,'Staff Expenses');

['Local','Budget Entry','0592 Personnel Other','Amount']=N:
  DB('LabourTotalCosts',!Currency,!Version,!FiscalYear,!Period,!Department,!Region,'Other');

#*******************************************************
# Travel Account
#*******************************************************
['Local','Budget Entry','6407','Amount']=N:
  DB('TravelSummary',!Currency,!Version,!FiscalYear,!Period,!Department,!Region,'All Trips','6407 Lodging');

['Local','Budget Entry','6402','Amount']=N:
  DB('TravelSummary',!Currency,!Version,!FiscalYear,!Period,!Department,!Region,'All Trips','6402 Transportation');

['Local','Budget Entry','6405','Amount']=N:
  DB('TravelSummary',!Currency,!Version,!FiscalYear,!Period,!Department,!Region,'All Trips','6405 Meals');

['Local','Budget Entry','6406','Amount']=N:
  DB('TravelSummary',!Currency,!Version,!FiscalYear,!Period,!Department,!Region,'All Trips','6406 Entertainment');

['Local','Budget Entry','6409','Amount']=N:
  DB('TravelSummary',!Currency,!Version,!FiscalYear,!Period,!Department,!Region,'All Trips','6409 Mileage Exp');

['Local','Budget Entry','6410','Amount']=N:
  DB('TravelSummary',!Currency,!Version,!FiscalYear,!Period,!Department,!Region,'All Trips','6410 Airfare');

#*******************************************************
# Depreciation
#*******************************************************
['Local','Budget Entry','7920','Amount']=N:
  DB('AssetSummary',!Currency,!Version,!FiscalYear,!Period,!Region,!Department,'All Asset Types','Total Deprec & Disp');

#*******************************************************
# Manual Phasing
#*******************************************************
['Local','Budget Entry','Amount']=N:
  IF(DB('SpreadSettings',!Version,!FiscalYear,!Department,!Region,!Account,'Method') @<> '',
    DB('SpreadSettings',!Version,!FiscalYear,!Department,!Region,!Account,'Full Year Entry')
    * (DB('SpreadAmounts',!Version,!FiscalYear,!Period,DB('SpreadSettings',!Version,!FiscalYear,!Department,!Region,!Account,'Method'),'Amount')
    \ DB('SpreadAmounts',!Version,!FiscalYear,'Total Year',DB('SpreadSettings',!Version,!FiscalYear,!Department,!Region,!Account,'Method'),'Amount')),
    CONTINUE
  );

#*******************************************************
# Forecasts
#*******************************************************
['Local','Forecast Mixed','2009', 'Amount']=N:
    IF(ATTRN('Period', !Period, 'Index') <= ATTRN('Period', DB('Calendar','Current Month','String'), 'Index'),
      ['Actual'],
     ['Budget Approved']
    );

['Local','Forecast YTD Trend','2009', 'Amount']=N:
    IF(ATTRN('Period', !Period, 'Index') <= ATTRN('Period', DB('Calendar','Current Month','String'), 'Index'),
      ['Actual'],
      DB('GLPerformance',!Currency,!Department,!Region,!Account,'Trend')
      * ['Budget Approved']
    );

['Local','Forecast Hold Annual Plan', '2009', 'Amount']=N:
    IF(ATTRN('Period', !Period, 'Index') <= ATTRN('Period', DB('Calendar','Current Month','String'), 'Index'),
      ['Actual'],
      DB('GLPerformance',!Currency,!Department,!Region,!Account,'Goal')
      * ['Budget Approved']
    );

FEEDERS;

#********************************************
# Currency Conversion
#********************************************
['Local','Actual', {'Amount','Adjustment'}]=>
  ['CNY'],['PHP'],['THB'],['INR'],['HKD'],['SGD'],['AUD'],['JPY'],['MYR'],['NZD'];

['Local','Budget Approved', {'Amount','Adjustment'}]=>
  ['CNY'],['PHP'],['THB'],['INR'],['HKD'],['SGD'],['AUD'],['JPY'],['MYR'],['NZD'];


#*******************************************************
# Forecasts
#*******************************************************
['Local','Actual', '2009', 'Amount'] =>
  ['Forecast Mixed','Amount'];
['Local','Budget Approved', '2009', 'Amount'] =>
  ['Forecast Mixed','Amount'];

['Local','Actual', '2009', 'Amount'] =>
  ['Forecast YTD Trend','Amount'];
['Local','Budget Approved', '2009', 'Amount'] =>
  ['Forecast YTD Trend','Amount'];

['Local','Actual', '2009', 'Amount'] =>
  ['Forecast Hold Annual Plan','Amount'];
['Local','Budget Approved', '2009', 'Amount'] =>
  ['Forecast Hold Annual Plan','Amount'];

#*******************************************************
# Cashflow
#*******************************************************
['Local','0200','Total Amount']=>
  DB('Cashflow',!Currency,!Version,!FiscalYear,!Period,!Department,!Region,'Cost of Sales','Amount');

['Local','0100','Total Amount']=>
  DB('Cashflow',!Currency,!Version,!FiscalYear,!Period,!Department,!Region,'Cash from Operations','Amount');

['Local','Subtotal Expenses','Total Amount']=>
  DB('Cashflow',!Currency,!Version,!FiscalYear,!Period,!Department,!Region,'Operational Expenses','Amount');

['Local','Total Personnel','Total Amount']=>
  DB('Cashflow',!Currency,!Version,!FiscalYear,!Period,!Department,!Region,'Payments for Salaries & Wages','Amount');

