PostCalculator: InterestColumn: update PostCheck

This commit is contained in:
Chika 2022-03-11 15:19:53 +03:00
parent bb5ae48f0f
commit 49e481a60f

View File

@ -13,7 +13,7 @@ public class InterestColumn : BaseColumn<decimal>
public InterestColumn(int count) : base(count)
{
}
public void ComputeValues(BaseColumn<decimal> nextNIColumn, BaseColumn<double> nextIRRGrColumn)
{
for (var i = 2; i < Values.Length; i++)
@ -30,7 +30,14 @@ public class InterestColumn : BaseColumn<decimal>
nextSumColumn.Values.Skip(3).SkipLast(1))
, GroupColumns.Create(cashflowMSFOForNIColumnDates.Skip(1), Values.Skip(1).Select(x => -x)));
new CheckTools().CheckColumnForLessThanZeroValue(GroupColumns.Split(profit).Values,
"Невозможно осуществить расчет графика, при заданных параметрах получается низкий лизинговый платеж");
var negativeValuesCount = 0;
GroupColumns.Split(profit).Values.ToList().ForEach(x =>
{
if (x < 0) negativeValuesCount++;
});
if (negativeValuesCount > 1)
throw new Exception(
"Невозможно осуществить расчет графика, при заданных параметрах получается низкий лизинговый платеж");
}
}