/// <summary> /// Return the interest rate calculation model /// </summary> /// <param name="cashflow">The base model</param> public FinanceActivityCalculateInterest GetInterestRates(ActivityFolder cashflow) { // Find the interest amount int row = Overheads.RowNames.FindIndex(s => s == "Int_rate"); // If the interest is 0, ignore the model if (Overheads.GetData <int>(row, 0) == 0) { return(null); } return(new FinanceActivityCalculateInterest(cashflow)); }
/// <summary> /// Gets the monthly living expenses from the IAT data /// </summary> /// <param name="cashflow">The model to attach the data to</param> public ActivityFolder GetMonthlyExpenses(ActivityFolder cashflow) { var monthly = new ActivityFolder(cashflow) { Name = "MonthlyExpenses" }; // Find the monthly living cost double amount = Overheads.GetData <double>(13, 0); // Only include if non-zero if (amount == 0) { return(null); } monthly.Add(new FinanceActivityPayExpense(monthly) { Name = "LivingCost", Amount = amount }); return(monthly); }
/// <summary> /// Sets the data for a FinanceType model using IAT data /// </summary> /// <param name="bank">The base model</param> public void SetBankData(FinanceType bank) { bank.Name = "Bank"; bank.OpeningBalance = Overheads.GetData <double>(12, 0); bank.InterestRateCharged = Overheads.GetData <double>(11, 0); }