PostCalculator: InterestColumn: update PostCheck
This commit is contained in:
parent
bb5ae48f0f
commit
49e481a60f
@ -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(
|
||||
"Невозможно осуществить расчет графика, при заданных параметрах получается низкий лизинговый платеж");
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user