Post: fix SumIRRColumnVT2
This commit is contained in:
parent
7ebdc14a5e
commit
a2022c3535
@ -43,6 +43,37 @@ namespace EvoCalculator.Core.PostCalculation.v2.Columns.Next
|
||||
|
||||
private void FillValues()
|
||||
{
|
||||
var costInsurances = Array.Empty<decimal>();
|
||||
|
||||
if (_nextTableInsurance != null)
|
||||
{
|
||||
costInsurances = _nextTableInsurance
|
||||
.Where(ins =>
|
||||
ins.PeriodNumberInsurance > 1
|
||||
&& ins.DateStartPeriodInsurance >= _preparedValues.EditPaymentDate.Current
|
||||
&& (ins.TypeRiskInsurance is "KASKO" or "OSAGO" or "GAP" or "EvoKASKO")
|
||||
)
|
||||
.OrderBy(x => x.TypeRiskInsurance)
|
||||
.Select(x => -(x.CostInsurance + x.InsuranceBonusLoss))
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
|
||||
var dateStartPeriodInsurances = Array.Empty<DateTime>();
|
||||
|
||||
if (_nextTableInsurance != null)
|
||||
{
|
||||
dateStartPeriodInsurances = _nextTableInsurance
|
||||
.Where(ins =>
|
||||
ins.PeriodNumberInsurance > 1
|
||||
&& ins.DateStartPeriodInsurance >= _preparedValues.EditPaymentDate.Current
|
||||
&& (ins.TypeRiskInsurance is "KASKO" or "OSAGO" or "GAP" or "EvoKASKO")
|
||||
)
|
||||
.OrderBy(x => x.TypeRiskInsurance)
|
||||
.Select(x => x.DateStartPeriodInsurance)
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
var lastDateTempValue = _dateTempColumn.Values.Last();
|
||||
var lastCurrentDateTempValue = _currentDateTempColumn.Values.Last();
|
||||
var evoKasko = _nextTableInsurance.FirstOrDefault(x => x.TypeRiskInsurance == "EvoKASKO");
|
||||
@ -94,7 +125,8 @@ namespace EvoCalculator.Core.PostCalculation.v2.Columns.Next
|
||||
|
||||
Values = Array<decimal>.Concat(
|
||||
new[] { -xnpvColumn.XNPV },
|
||||
_sumColumn.Values.Skip(_preparedValues.EditPaymentNumber)
|
||||
_sumColumn.Values.Skip(_preparedValues.EditPaymentNumber),
|
||||
costInsurances
|
||||
);
|
||||
|
||||
if (evoKasko != null)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user