public double[] CalculateChartForFundingLine(FundingLine pFundingLine, DateTime pStartDate, int pDayNum, bool pAssumeLateLoansRepaidToday) { bool creditInterestsInFundingLine = ApplicationSettings.GetInstance(_user.Md5).InterestsCreditedInFL; List <KeyValuePair <DateTime, decimal> > result = _contractManagement.CalculateCashToRepayByDayByFundingLine(pFundingLine.Id, pAssumeLateLoansRepaidToday, creditInterestsInFundingLine); double[] y = pFundingLine.CalculateCashProvisionChart(pStartDate, pDayNum, pAssumeLateLoansRepaidToday); if (y == null) { return(y); } for (int i = 0; i < pDayNum; i++) { decimal amount = result.Where(x => x.Key <= pStartDate.AddDays(i)).Sum(x => x.Value); y[i] += Convert.ToDouble(amount); } return(y); }