public GoalsValueCalculationInfo(Goals goal, Planner planner, RiskProfileInfo riskProfileInfo, int riskprorfileId) { _goal = goal; _planner = planner; _planStartYear = _planner.StartDate.Year; _riskProfileInfo = riskProfileInfo; _riskProfileId = riskprorfileId; growthPercentage = _riskProfileInfo.GetRiskProfileReturnRatio(_riskProfileId, getRemainingYearsFromPlanStartYear()); _futureValueOfGoal = getGoalFutureValue(); _currentValueOfGoal = getGoalCurrentValue(); _futureValueOfMappedInstruments = getTotalMappedInstrumentValue(); _futureValueOfMappedNonFinancialAssets = getFutureValueOfMappedNonFinancialAsset(); setLIFOPlanning(); }
private void addRowsInGoalCalculation() { int goalYear = int.Parse(_goal.StartYear); decimal returnRatio = getRiskProfileReturnRatio(goalYear - _planner.StartDate.Year); GoalsValueCalculationInfo goalsValueCal = GoalCalManager.GetGoalValueCalculation(_goal); goalsValueCal.SetPortfolioValue(GetProfileValue()); for (int currentYear = _planner.StartDate.Year; currentYear <= goalYear; currentYear++) { GoalPlanning goalPlanning = goalsValueCal.GetGoalPlanning(currentYear); if (goalPlanning == null) { goalPlanning = new GoalPlanning(_goal); goalPlanning.Year = currentYear; goalPlanning.GrowthPercentage = _riskProfileInfo.GetRiskProfileReturnRatio(_riskprofileId, goalPlanning.YearLeft); goalPlanning.ActualFreshInvestment = 0; } DataRow dr = _dtGoalCalculation.NewRow(); returnRatio = goalPlanning.GrowthPercentage; dr["Year Left"] = goalPlanning.YearLeft; dr["Loan Instrument"] = 0; double freshInvestment = goalPlanning.ActualFreshInvestment; dr["Fresh Investment"] = Math.Round(freshInvestment); if (currentYear == goalYear) { dr["Assets Mapping"] = goalsValueCal.FutureValueOfMappedNonFinancialAssets; dr["Instrument Mapped"] = goalsValueCal.FutureValueOfMappedInstruments; } dr["Portfolio Value"] = calculatePortfoliioValue(freshInvestment, returnRatio); dr["Cash outflow Goal Year"] = (currentYear == goalYear) ? goalsValueCal.FutureValueOfGoal : 0; dr["Portfolio Return"] = returnRatio; _dtGoalCalculation.Rows.Add(dr); } }
public decimal GetGrowthPercentage(int calculationYear) { return(_riskProfileInfo.GetRiskProfileReturnRatio(_riskProfileId, getRemainingYearBy(calculationYear))); }