FORMAT==100
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', '6409 Mileage Exp', {'HONG KONG','SINGAPORE'}]=N:
  ['Reimbursable Miles']*
  DB('TravelAssumptions',!Version,!FiscalYear,!Region,'Mileage Reimburse Rate');

['Local', '6409 Mileage Exp']=N:
  ['Reimbursable Miles']*
  DB('TravelAssumptions',!Version,!FiscalYear,ELPAR('region', !Region, 1),'Mileage Reimburse Rate');


['Local','6410 Airfare', {'HONG KONG','SINGAPORE'}]=N:
  ['Number of People This Itinerary']*
  DB('TravelAssumptions',!Version,!FiscalYear, !Region,DB('TravelPlans',!Currency,!Version,!FiscalYear,!Department,!Region,!TripList,'Air Travel'));

['Local','6410 Airfare']=N:
  ['Number of People This Itinerary']*
  DB('TravelAssumptions',!Version,!FiscalYear,ELPAR('region', !Region, 1),DB('TravelPlans',!Currency,!Version,!FiscalYear,!Department,!Region,!TripList,'Air Travel'));


['Local','6405 Meals', {'HONG KONG','SINGAPORE'}]=N:
  ['Number of People This Itinerary']*['Number of Hotel Nights']*
  DB('TravelAssumptions',!Version,!FiscalYear,!Region,'Daily Meal Allowance');

['Local','6405 Meals']=N:
  ['Number of People This Itinerary']*['Number of Hotel Nights']*
  DB('TravelAssumptions',!Version,!FiscalYear,ELPAR('region', !Region, 1),'Daily Meal Allowance');


['Local','6407 Lodging', {'HONG KONG','SINGAPORE'}]=N:['Number of People This Itinerary']*['Number of Hotel Nights']*
		DB('TravelAssumptions',!Version,!FiscalYear,!Region,'Daily Hotel Allowance');

['Local','6407 Lodging']=N:['Number of People This Itinerary']*['Number of Hotel Nights']*
		DB('TravelAssumptions',!Version,!FiscalYear,ELPAR('region', !Region, 1),'Daily Hotel Allowance');


['Local','6402 Transportation', {'HONG KONG','SINGAPORE'}]=N:
  IF(DB('TravelPlans',!Currency,!Version,!FiscalYear,!Department,!Region,!TripList,'Rental Car <Y/N>') @='N',
    STET,
    DB('TravelAssumptions',!Version,!FiscalYear,!Region,'Rental Car Per Day')*
    ROUND(['Number of People This Itinerary']/4 + .5)* ['Number of Hotel Nights']
  );

['Local','6402 Transportation']=N:
  IF(DB('TravelPlans',!Currency,!Version,!FiscalYear,!Department,!Region,!TripList,'Rental Car <Y/N>') @='N',
    STET,
    DB('TravelAssumptions',!Version,!FiscalYear,ELPAR('region', !Region, 1),'Rental Car Per Day')*
    ROUND(['Number of People This Itinerary']/4 + .5)* ['Number of Hotel Nights']
  );

FEEDERS;

#*******************************************************
# INTERNAL FEEDERS - TravelSummary
#*******************************************************
['Local','Reimbursable Miles']=>
  ['6409 Mileage Exp'];

['Local','Number of People This Itinerary']=>
  ['6410 Airfare'];

['Local','Number of Hotel Nights']=>
  ['6405 Meals'];

['Local','Number of Hotel Nights']=>
  ['Local','6407 Lodging'];

['Local','Rental Car <Y/N>']=>
  ['6402 Transportation'];

#*******************************************************
# EXTERNAL FEEDERS - TravelSummary
#*******************************************************
['Local','Reimbursable Miles']=>
  DB('TravelSummary',!Currency,!Version,!FiscalYear,
  'Total Year', !Department,!Region,!TripList,'6409 Mileage Exp');

['Local','Number of People This Itinerary']=>
  DB('TravelSummary',!Currency,!Version,!FiscalYear,
  'Total Year',!Department,!Region,!TripList,'6410 Airfare');

['Local','Number of Hotel Nights']=>
  DB('TravelSummary',!Currency,!Version,!FiscalYear,
  'Total Year',!Department,!Region,!TripList,'6405 Meals');

['Local','Number of Hotel Nights']=>
  DB('TravelSummary',!Currency,!Version,!FiscalYear,
  'Total Year',!Department,!Region,!TripList,'6407 Lodging');

['Local','Rental Car <Y/N>']=>
  DB('TravelSummary',!Currency,!Version,!FiscalYear,
  'Total Year',!Department,!Region,!TripList,'6402 Transportation');

#*******************************************************
# EXTERNAL FEEDERS - GL
#*******************************************************
['Local','Reimbursable Miles']=>
  DB('GL',!Version,!FiscalYear,
  DB('TravelPlans',!Currency,!Version,!FiscalYear,!Department,!Region,!TripList,'Month of Trip'),
  !Department,!Region,'6409',!Currency);

['Local','Reimbursable Miles']=>
  DB('GL',!Version,!FiscalYear,
  DB('TravelPlans',!Currency,!Version,!FiscalYear,!Department,!Region,!TripList,'Month of Trip'),
  !Department,!Region,'6410',!Currency);

['Local','Reimbursable Miles']=>
  DB('GL',!Version,!FiscalYear,
  DB('TravelPlans',!Currency,!Version,!FiscalYear,!Department,!Region,!TripList,'Month of Trip'),
  !Department,!Region,'6405',!Currency);

['Local','Reimbursable Miles']=>
  DB('GL',!Version,!FiscalYear,
  DB('TravelPlans',!Currency,!Version,!FiscalYear,!Department,!Region,!TripList,'Month of Trip'),
  !Department,!Region,'6407',!Currency);

['Local','Reimbursable Miles']=>
  DB('GL',!Version,!FiscalYear,
  DB('TravelPlans',!Currency,!Version,!FiscalYear,!Department,!Region,!TripList,'Month of Trip'),
  !Department,!Region,'6402',!Currency);
