Post/v2/SumIRRColumn: fix FillValues
This commit is contained in:
parent
ff6ae4fe36
commit
ab6a724424
@ -39,7 +39,7 @@ namespace EvoCalculator.Core.PostCalculation.v2.Columns.Next
|
||||
_currentDateTempColumn = currentDateTempColumn;
|
||||
_currentSumColumn = currentSumColumn;
|
||||
}
|
||||
|
||||
|
||||
private void FillValues()
|
||||
{
|
||||
var costInsurances = Array.Empty<decimal>();
|
||||
@ -92,17 +92,21 @@ namespace EvoCalculator.Core.PostCalculation.v2.Columns.Next
|
||||
|
||||
var xnpvValues = Array<decimal>.Concat(
|
||||
new[] { 0m, },
|
||||
_sumColumn.GetValues(_preparedValues.EditPaymentNumber),
|
||||
costInsurances,
|
||||
new[] { evoKaskoSum }
|
||||
_currentSumColumn.GetValues(_preparedValues.EditPaymentNumber)
|
||||
);
|
||||
|
||||
var xnpvDates = Array<DateTime>.Concat(
|
||||
new[] { _dateTempColumn.GetValue(_preparedValues.EditPaymentNumber - 1) },
|
||||
_dateTempColumn.GetValues(_preparedValues.EditPaymentNumber),
|
||||
dateStartPeriodInsurances,
|
||||
new[] { evoKaskoDate }
|
||||
_currentDateTempColumn.GetValues(_preparedValues.EditPaymentNumber),
|
||||
dateStartPeriodInsurances
|
||||
);
|
||||
|
||||
if (evoKasko != null)
|
||||
{
|
||||
xnpvValues = xnpvValues.Append(evoKaskoSum).ToArray();
|
||||
xnpvDates = xnpvDates.Append(evoKaskoDate).ToArray();
|
||||
}
|
||||
|
||||
var xnpvColumn =
|
||||
new BaseColumnWithXNPV(0, new DateTempColumn(0) { Values = xnpvDates }, _currentSumColumn.IRR)
|
||||
{
|
||||
@ -112,10 +116,14 @@ namespace EvoCalculator.Core.PostCalculation.v2.Columns.Next
|
||||
Values = Array<decimal>.Concat(
|
||||
new[] { -xnpvColumn.XNPV },
|
||||
_sumColumn.Values.Skip(_preparedValues.EditPaymentNumber),
|
||||
costInsurances,
|
||||
new[] { evoKaskoSum }
|
||||
costInsurances
|
||||
);
|
||||
|
||||
if (evoKasko != null)
|
||||
{
|
||||
Values = Values.Append(evoKaskoSum).ToArray();
|
||||
}
|
||||
|
||||
Dates = xnpvDates;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user