diff --git a/.idea/.idea.EvoCalculator.Core/.idea/contentModel.xml b/.idea/.idea.EvoCalculator.Core/.idea/contentModel.xml
index c0b50c7..9c4c23a 100644
--- a/.idea/.idea.EvoCalculator.Core/.idea/contentModel.xml
+++ b/.idea/.idea.EvoCalculator.Core/.idea/contentModel.xml
@@ -40,6 +40,7 @@
+
@@ -108,6 +109,7 @@
+
diff --git a/.idea/.idea.EvoCalculator.Core/.idea/workspace.xml b/.idea/.idea.EvoCalculator.Core/.idea/workspace.xml
index 4bdecec..9a8a1c9 100644
--- a/.idea/.idea.EvoCalculator.Core/.idea/workspace.xml
+++ b/.idea/.idea.EvoCalculator.Core/.idea/workspace.xml
@@ -14,11 +14,12 @@
-
-
+
+
-
+
+
@@ -31,11 +32,16 @@
+
+
+
+
+
-
-
-
+
+
+
+
+
+
@@ -143,7 +152,7 @@
-
+
1602593830686
@@ -187,102 +196,102 @@
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
-
-
+
+
-
+
@@ -291,40 +300,49 @@
-
+
-
+
+
+
+
+
-
+
-
+
- file://$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Suite/Columns/PercentPaymentTests.cs
- 152
-
+ file://$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Suite/Columns/KaskoNmperGrTests.cs
+ 254
+
-
+
-
+
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/EvoCalculator.Core.Calculation/Columns/DateTempColumn.cs b/EvoCalculator.Core.Calculation/Columns/DateTempColumn.cs
index e67ef78..4c1a36a 100644
--- a/EvoCalculator.Core.Calculation/Columns/DateTempColumn.cs
+++ b/EvoCalculator.Core.Calculation/Columns/DateTempColumn.cs
@@ -8,6 +8,7 @@ namespace EvoCalculator.Core.Calculation.Columns
{
public DateTime[] Values { get; set; }
+ //TODO: extract 67
public DateTempColumn(int count = 67)
{
Values = new DateTime[count];
diff --git a/EvoCalculator.Core.Calculation/Columns/KaskoNmperGrColumn.cs b/EvoCalculator.Core.Calculation/Columns/KaskoNmperGrColumn.cs
new file mode 100644
index 0000000..83c98be
--- /dev/null
+++ b/EvoCalculator.Core.Calculation/Columns/KaskoNmperGrColumn.cs
@@ -0,0 +1,56 @@
+using System;
+using EvoCalculator.Core.Calculation.FinanceFormulas;
+using EvoCalculator.Core.Models.Calculation.Interfaces;
+using EvoCalculator.Core.Models.Calculation.Models;
+using EvoCalculator.Core.Models.Calculation.Models.Prepared;
+
+namespace EvoCalculator.Core.Calculation.Columns
+{
+ public class KaskoNmperGrColumn : IColumn
+ {
+ public double[] Values { get; set; }
+
+ public KaskoNmperGrColumn(int count)
+ {
+ Values = new double[count];
+ }
+
+ public void ComputeValues(PreparedValues preparedValues, IColumn dateTempColumn)
+ {
+ for (var i = 0; i < Values.Length; i++)
+ {
+ Values[i] = 0;
+ }
+
+ for (var i = 1; i < Values.Length; i += 12)
+ {
+ if (i <= preparedValues.NmperInsurance)
+ {
+ if (preparedValues.NmperInsurance - i < 16 - 1)
+ {
+ Values[i] = preparedValues.InsuranceKasko / 12 * (preparedValues.NmperInsurance - i + 1);
+ }
+ else
+ {
+ Values[i] = preparedValues.InsuranceKasko;
+ }
+ }
+ }
+
+
+ Flow[] flows = new Flow[Values.Length - 1];
+ for (var i = 1; i < Values.Length; i++)
+ {
+ flows[i - 1] = new Flow()
+ {
+ Date = dateTempColumn.Values[i].Date,
+ Value = Values[i]
+ };
+ }
+
+
+ var XNPV = new XNPV(flows, preparedValues.IrrExpected);
+ Values[0] = -XNPV.GetResult();
+ }
+ }
+}
\ No newline at end of file
diff --git a/EvoCalculator.Core.Models/Calculation/Interfaces/IColumn.cs b/EvoCalculator.Core.Models/Calculation/Interfaces/IColumn.cs
index 7247b8e..52b4c04 100644
--- a/EvoCalculator.Core.Models/Calculation/Interfaces/IColumn.cs
+++ b/EvoCalculator.Core.Models/Calculation/Interfaces/IColumn.cs
@@ -5,10 +5,8 @@ namespace EvoCalculator.Core.Models.Calculation.Interfaces
public interface IColumn
{
public T[] Values { get; set; }
-
-
- public void ComputeValues(PreparedValues preparedValues, PreparedPayments preparedPayments,
- Constants.Calculation constants,
- params IColumn[] columns);
+ // public void ComputeValues(PreparedValues preparedValues, PreparedPayments preparedPayments,
+ // Constants.Calculation constants,
+ // params IColumn