TimeUnit standardRateFormat = getFormat(MPPUtility.getShort(data, i + 8));
Rate overtimeRate = new Rate(MPPUtility.getDouble(data, i + 16), TimeUnit.HOURS);
TimeUnit overtimeRateFormat = getFormat(MPPUtility.getShort(data, i + 24));
Double costPerUse = NumberUtility.getDouble(MPPUtility.getDouble(data, i + 32) / 100.0);
Date endDate = MPPUtility.getTimestampFromTenths(data, i + 40);
CostRateTableEntry entry = new CostRateTableEntry(standardRate, standardRateFormat, overtimeRate, overtimeRateFormat, costPerUse, endDate);
result.add(entry);
}
Collections.sort(result);
}
else
{
//
// MS Project economises by not actually storing the first cost rate
// table if it doesn't need to, so we take this into account here.
//
if (index == 0)
{
Rate standardRate = resource.getStandardRate();
Rate overtimeRate = resource.getOvertimeRate();
Number costPerUse = resource.getCostPerUse();
CostRateTableEntry entry = new CostRateTableEntry(standardRate, standardRate.getUnits(), overtimeRate, overtimeRate.getUnits(), costPerUse, CostRateTableEntry.DEFAULT_ENTRY.getEndDate());
result.add(entry);
}
else
{
result.add(CostRateTableEntry.DEFAULT_ENTRY);