merge release/dyn-2803_sale-post-pi
This commit is contained in:
parent
5ba21a49fc
commit
83c040a779
@ -1,9 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using EvoCalculator.Core.Constants;
|
|
||||||
using EvoCalculator.Core.Models.Calculation.Models.Request;
|
using EvoCalculator.Core.Models.Calculation.Models.Request;
|
||||||
using EvoCalculator.Core.Tools.Errors;
|
using EvoCalculator.Core.Tools.Errors;
|
||||||
|
|
||||||
namespace EvoCalculator.Core.Tools.Validation;
|
namespace EvoCalculator.Core.Calculation.Tools;
|
||||||
|
|
||||||
public class Validation
|
public class Validation
|
||||||
{
|
{
|
||||||
@ -31,7 +30,7 @@ public class Validation
|
|||||||
"Первый платеж по графику более 50% от стоимости ПЛ с учетом скидки. Необходимо уменьшить первый платеж");
|
"Первый платеж по графику более 50% от стоимости ПЛ с учетом скидки. Необходимо уменьшить первый платеж");
|
||||||
|
|
||||||
var AllAgencyPerc = Math.Round(
|
var AllAgencyPerc = Math.Round(
|
||||||
((preparedValues.AgentsSum + preparedValues.DoubleAgentsSum) / (decimal)new Calculation().ESN +
|
((preparedValues.AgentsSum + preparedValues.DoubleAgentsSum) / (decimal)new Constants.Calculation().ESN +
|
||||||
preparedValues.DeliverySum +
|
preparedValues.DeliverySum +
|
||||||
preparedValues.BrokerOfDeliverySum + preparedValues.BrokerSum +
|
preparedValues.BrokerOfDeliverySum + preparedValues.BrokerSum +
|
||||||
preparedValues.FinancialDeptOfDeliverySum) / preparedValues.AcceptSum * 100, 2);
|
preparedValues.FinancialDeptOfDeliverySum) / preparedValues.AcceptSum * 100, 2);
|
||||||
@ -5,16 +5,24 @@ namespace EvoCalculator.Core.Calculation.v1.Columns;
|
|||||||
|
|
||||||
public class CashflowMSFOFinal2Column : BaseColumnWithNominal
|
public class CashflowMSFOFinal2Column : BaseColumnWithNominal
|
||||||
{
|
{
|
||||||
public CashflowMSFOFinal2Column(int count, DateTempColumn dateTempColumn) : base(count, dateTempColumn)
|
private PreparedValues _preparedValues;
|
||||||
|
private BaseColumn<decimal> _directorBonusSumColumn;
|
||||||
|
private CashflowMSFOFinalColumn _cashflowMsfoFinalColumn;
|
||||||
|
|
||||||
|
public CashflowMSFOFinal2Column(int count, DateTempColumn dateTempColumn, PreparedValues preparedValues,
|
||||||
|
BaseColumn<decimal> directorBonusSumColumn, CashflowMSFOFinalColumn cashflowMsfoFinalColumn) : base(
|
||||||
|
count, dateTempColumn)
|
||||||
{
|
{
|
||||||
|
_preparedValues = preparedValues;
|
||||||
|
_directorBonusSumColumn = directorBonusSumColumn;
|
||||||
|
_cashflowMsfoFinalColumn = cashflowMsfoFinalColumn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ComputeValues(PreparedValues preparedValues, BaseColumn<decimal> directorBonusSumColumn,
|
public void ComputeValues()
|
||||||
CashflowMSFOFinalColumn cashflowMsfoFinalColumn)
|
|
||||||
{
|
{
|
||||||
Values[0] = -preparedValues.AcquisitionExpenses;
|
Values[0] = -_preparedValues.AcquisitionExpenses;
|
||||||
Values[1] = cashflowMsfoFinalColumn.Values[1];
|
Values[1] = _cashflowMsfoFinalColumn.Values[1];
|
||||||
for (var i = 2; i < Values.Length; i++)
|
for (var i = 2; i < Values.Length; i++)
|
||||||
Values[i] = cashflowMsfoFinalColumn.Values[i] + directorBonusSumColumn.Values[i];
|
Values[i] = _cashflowMsfoFinalColumn.Values[i] + _directorBonusSumColumn.Values[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,8 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using EvoCalculator.Core.Calculation.Tools;
|
||||||
using EvoCalculator.Core.Calculation.v1.Columns;
|
using EvoCalculator.Core.Calculation.v1.Columns;
|
||||||
using EvoCalculator.Core.Models.Calculation.Models.Manager;
|
using EvoCalculator.Core.Models.Calculation.Models.Manager;
|
||||||
using EvoCalculator.Core.Models.Calculation.Models.Request;
|
using EvoCalculator.Core.Models.Calculation.Models.Request;
|
||||||
using EvoCalculator.Core.Tools.Validation;
|
|
||||||
|
|
||||||
namespace EvoCalculator.Core.Calculation.v1.Managers;
|
namespace EvoCalculator.Core.Calculation.v1.Managers;
|
||||||
|
|
||||||
@ -223,8 +223,9 @@ public static partial class CalculateManager
|
|||||||
var directorBonusSumColumn = new DirectorBonusSumColumn(preparedValues.Nmper + 1);
|
var directorBonusSumColumn = new DirectorBonusSumColumn(preparedValues.Nmper + 1);
|
||||||
directorBonusSumColumn.ComputeValues(preparedValues, postValues);
|
directorBonusSumColumn.ComputeValues(preparedValues, postValues);
|
||||||
|
|
||||||
var cashflowMsfoFinal2Column = new CashflowMSFOFinal2Column(preparedValues.Nmper + 1, dateTempColumn);
|
var cashflowMsfoFinal2Column = new CashflowMSFOFinal2Column(preparedValues.Nmper + 1, dateTempColumn,
|
||||||
cashflowMsfoFinal2Column.ComputeValues(preparedValues, directorBonusSumColumn, cashflowMsfoFinalColumn);
|
preparedValues, directorBonusSumColumn, cashflowMsfoFinalColumn);
|
||||||
|
cashflowMsfoFinal2Column.ComputeValues();
|
||||||
|
|
||||||
var cashflowNpvFinal2Column = new CashflowNPVFinal2Column(maxColumnLength);
|
var cashflowNpvFinal2Column = new CashflowNPVFinal2Column(maxColumnLength);
|
||||||
cashflowNpvFinal2Column.ComputeValues(preparedValues, cashflowNpvFinalColumn, directorBonusSumColumn);
|
cashflowNpvFinal2Column.ComputeValues(preparedValues, cashflowNpvFinalColumn, directorBonusSumColumn);
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using EvoCalculator.Core.Calculation.Tools;
|
||||||
using EvoCalculator.Core.Calculation.v1.Columns;
|
using EvoCalculator.Core.Calculation.v1.Columns;
|
||||||
using EvoCalculator.Core.Models.Calculation.Models.Manager;
|
using EvoCalculator.Core.Models.Calculation.Models.Manager;
|
||||||
using EvoCalculator.Core.Models.Calculation.Models.Request;
|
using EvoCalculator.Core.Models.Calculation.Models.Request;
|
||||||
using EvoCalculator.Core.Tools.Validation;
|
|
||||||
|
|
||||||
namespace EvoCalculator.Core.Calculation.v1.Managers;
|
namespace EvoCalculator.Core.Calculation.v1.Managers;
|
||||||
|
|
||||||
@ -17,7 +17,6 @@ public static partial class CalculateManager
|
|||||||
new Validation().ValidateRequest(requestCalculation);
|
new Validation().ValidateRequest(requestCalculation);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var constants = new Constants.Calculation();
|
var constants = new Constants.Calculation();
|
||||||
|
|
||||||
var postValues = new PostValues(preparedValues);
|
var postValues = new PostValues(preparedValues);
|
||||||
@ -223,8 +222,9 @@ public static partial class CalculateManager
|
|||||||
var directorBonusSumColumn = new DirectorBonusSumColumn(preparedValues.Nmper + 1);
|
var directorBonusSumColumn = new DirectorBonusSumColumn(preparedValues.Nmper + 1);
|
||||||
directorBonusSumColumn.ComputeValues(preparedValues, postValues);
|
directorBonusSumColumn.ComputeValues(preparedValues, postValues);
|
||||||
|
|
||||||
var cashflowMsfoFinal2Column = new CashflowMSFOFinal2Column(preparedValues.Nmper + 1, dateTempColumn);
|
var cashflowMsfoFinal2Column = new CashflowMSFOFinal2Column(preparedValues.Nmper + 1, dateTempColumn,
|
||||||
cashflowMsfoFinal2Column.ComputeValues(preparedValues, directorBonusSumColumn, cashflowMsfoFinalColumn);
|
preparedValues, directorBonusSumColumn, cashflowMsfoFinalColumn);
|
||||||
|
cashflowMsfoFinal2Column.ComputeValues();
|
||||||
|
|
||||||
var cashflowNpvFinal2Column = new CashflowNPVFinal2Column(maxColumnLength);
|
var cashflowNpvFinal2Column = new CashflowNPVFinal2Column(maxColumnLength);
|
||||||
cashflowNpvFinal2Column.ComputeValues(preparedValues, cashflowNpvFinalColumn, directorBonusSumColumn);
|
cashflowNpvFinal2Column.ComputeValues(preparedValues, cashflowNpvFinalColumn, directorBonusSumColumn);
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using EvoCalculator.Core.Calculation.Tools;
|
||||||
using EvoCalculator.Core.Calculation.v1.Columns;
|
using EvoCalculator.Core.Calculation.v1.Columns;
|
||||||
using EvoCalculator.Core.Calculation.v2.Columns;
|
using EvoCalculator.Core.Calculation.v2.Columns;
|
||||||
using EvoCalculator.Core.Models.Calculation.Models.Manager;
|
using EvoCalculator.Core.Models.Calculation.Models.Manager;
|
||||||
using EvoCalculator.Core.Models.Calculation.Models.Request;
|
using EvoCalculator.Core.Models.Calculation.Models.Request;
|
||||||
using EvoCalculator.Core.Tools.Validation;
|
|
||||||
using CashflowColumn = EvoCalculator.Core.Calculation.v2.Columns.CashflowColumn;
|
using CashflowColumn = EvoCalculator.Core.Calculation.v2.Columns.CashflowColumn;
|
||||||
using CashflowLeasingColumn = EvoCalculator.Core.Calculation.v2.Columns.CashflowLeasingColumn;
|
using CashflowLeasingColumn = EvoCalculator.Core.Calculation.v2.Columns.CashflowLeasingColumn;
|
||||||
using CashflowMSFOColumnVT2 = EvoCalculator.Core.Calculation.v2.Columns.CashflowMSFOColumnVT2;
|
using CashflowMSFOColumnVT2 = EvoCalculator.Core.Calculation.v2.Columns.CashflowMSFOColumnVT2;
|
||||||
@ -238,8 +238,9 @@ public static partial class CalculateManager
|
|||||||
var directorBonusSumColumn = new DirectorBonusSumColumn(preparedValues.Nmper + 1);
|
var directorBonusSumColumn = new DirectorBonusSumColumn(preparedValues.Nmper + 1);
|
||||||
directorBonusSumColumn.ComputeValues(preparedValues, postValues);
|
directorBonusSumColumn.ComputeValues(preparedValues, postValues);
|
||||||
|
|
||||||
var cashflowMsfoFinal2Column = new CashflowMSFOFinal2Column(preparedValues.Nmper + 1, dateTempColumn);
|
var cashflowMsfoFinal2Column = new CashflowMSFOFinal2Column(preparedValues.Nmper + 1, dateTempColumn,
|
||||||
cashflowMsfoFinal2Column.ComputeValues(preparedValues, directorBonusSumColumn, cashflowMsfoFinalColumn);
|
preparedValues, directorBonusSumColumn, cashflowMsfoFinalColumn);
|
||||||
|
cashflowMsfoFinal2Column.ComputeValues();
|
||||||
|
|
||||||
var cashflowNpvFinal2Column = new CashflowNPVFinal2Column(maxColumnLength);
|
var cashflowNpvFinal2Column = new CashflowNPVFinal2Column(maxColumnLength);
|
||||||
cashflowNpvFinal2Column.ComputeValues(preparedValues, cashflowNpvFinalColumn, directorBonusSumColumn);
|
cashflowNpvFinal2Column.ComputeValues(preparedValues, cashflowNpvFinalColumn, directorBonusSumColumn);
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using EvoCalculator.Core.Calculation.Tools;
|
||||||
using EvoCalculator.Core.Calculation.v1.Columns;
|
using EvoCalculator.Core.Calculation.v1.Columns;
|
||||||
using EvoCalculator.Core.Calculation.v2.Columns;
|
using EvoCalculator.Core.Calculation.v2.Columns;
|
||||||
using EvoCalculator.Core.Models.Calculation.Models.Manager;
|
using EvoCalculator.Core.Models.Calculation.Models.Manager;
|
||||||
using EvoCalculator.Core.Models.Calculation.Models.Request;
|
using EvoCalculator.Core.Models.Calculation.Models.Request;
|
||||||
using EvoCalculator.Core.Tools.Validation;
|
|
||||||
using CashflowColumn = EvoCalculator.Core.Calculation.v2.Columns.CashflowColumn;
|
using CashflowColumn = EvoCalculator.Core.Calculation.v2.Columns.CashflowColumn;
|
||||||
using CashflowLeasingColumn = EvoCalculator.Core.Calculation.v2.Columns.CashflowLeasingColumn;
|
using CashflowLeasingColumn = EvoCalculator.Core.Calculation.v2.Columns.CashflowLeasingColumn;
|
||||||
using CashflowMSFOColumnVT1 = EvoCalculator.Core.Calculation.v2.Columns.CashflowMSFOColumnVT1;
|
using CashflowMSFOColumnVT1 = EvoCalculator.Core.Calculation.v2.Columns.CashflowMSFOColumnVT1;
|
||||||
@ -237,8 +237,9 @@ public static partial class CalculateManager
|
|||||||
var directorBonusSumColumn = new DirectorBonusSumColumn(preparedValues.Nmper + 1);
|
var directorBonusSumColumn = new DirectorBonusSumColumn(preparedValues.Nmper + 1);
|
||||||
directorBonusSumColumn.ComputeValues(preparedValues, postValues);
|
directorBonusSumColumn.ComputeValues(preparedValues, postValues);
|
||||||
|
|
||||||
var cashflowMsfoFinal2Column = new CashflowMSFOFinal2Column(preparedValues.Nmper + 1, dateTempColumn);
|
var cashflowMsfoFinal2Column = new CashflowMSFOFinal2Column(preparedValues.Nmper + 1, dateTempColumn,
|
||||||
cashflowMsfoFinal2Column.ComputeValues(preparedValues, directorBonusSumColumn, cashflowMsfoFinalColumn);
|
preparedValues, directorBonusSumColumn, cashflowMsfoFinalColumn);
|
||||||
|
cashflowMsfoFinal2Column.ComputeValues();
|
||||||
|
|
||||||
var cashflowNpvFinal2Column = new CashflowNPVFinal2Column(maxColumnLength);
|
var cashflowNpvFinal2Column = new CashflowNPVFinal2Column(maxColumnLength);
|
||||||
cashflowNpvFinal2Column.ComputeValues(preparedValues, cashflowNpvFinalColumn, directorBonusSumColumn);
|
cashflowNpvFinal2Column.ComputeValues(preparedValues, cashflowNpvFinalColumn, directorBonusSumColumn);
|
||||||
|
|||||||
@ -10,15 +10,15 @@ public class CashflowMSFOWithCFColumn : BaseColumnWithSum
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void ComputeValues(PreparedValues preparedValues, BaseColumn<decimal> sumCreditColumn,
|
public void ComputeValues(PreparedValues preparedValues, BaseColumn<decimal> sumCreditColumn,
|
||||||
BaseColumn<decimal> cashflowMsfoColumn, BaseColumn<decimal> creditPaymentColumn,
|
BaseColumn<decimal> cashflowMsfoFinal2Column, BaseColumn<decimal> creditPaymentColumn,
|
||||||
BaseColumn<decimal> vatRecoverableColumn)
|
BaseColumn<decimal> vatRecoverableColumn)
|
||||||
{
|
{
|
||||||
Values[1] = cashflowMsfoColumn.GetValue(1) - creditPaymentColumn.GetValue(1) -
|
Values[1] = cashflowMsfoFinal2Column.GetValue(1) - creditPaymentColumn.GetValue(1) -
|
||||||
preparedValues.AcquisitionExpensesWithVAT + sumCreditColumn.GetValue(1);
|
preparedValues.AcquisitionExpensesWithVAT + sumCreditColumn.GetValue(1);
|
||||||
|
|
||||||
for (var i = 2; i < Values.Length; i++)
|
for (var i = 2; i < Values.Length; i++)
|
||||||
{
|
{
|
||||||
Values[i] = cashflowMsfoColumn.GetValue(i) - creditPaymentColumn.GetValue(i) +
|
Values[i] = cashflowMsfoFinal2Column.GetValue(i) - creditPaymentColumn.GetValue(i) +
|
||||||
vatRecoverableColumn.GetValue(i);
|
vatRecoverableColumn.GetValue(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@ public class CreditPaymentColumn : BaseColumnWithSum
|
|||||||
BaseColumn<decimal> creditColumn)
|
BaseColumn<decimal> creditColumn)
|
||||||
{
|
{
|
||||||
Values[0] = 0;
|
Values[0] = 0;
|
||||||
if (!(Math.Abs(preparedValues.LoanRate - 0.135) < 0.0001))
|
if (preparedValues.FundingRate > 0)
|
||||||
{
|
{
|
||||||
Values[1] = -creditColumn.GetValue(1);
|
Values[1] = -creditColumn.GetValue(1);
|
||||||
for (var i = 2; i < Values.Length; i++)
|
for (var i = 2; i < Values.Length; i++)
|
||||||
|
|||||||
@ -14,14 +14,14 @@ public class BasePIColumn : BaseColumnWithNPV
|
|||||||
_preparedValues = preparedValues;
|
_preparedValues = preparedValues;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void FillValues(BaseColumn<decimal> cashflowMSFOColumn, BaseColumn<decimal> cashflowMSFOWithCFColumn)
|
protected void FillValues(BaseColumn<decimal> cashflowMsfoFinal2Column, BaseColumn<decimal> cashflowMSFOWithCFColumn)
|
||||||
{
|
{
|
||||||
for (var i = 1; i < Values.Length; i++)
|
for (var i = 1; i < Values.Length; i++)
|
||||||
{
|
{
|
||||||
Values[i] = NPV(cashflowMSFOWithCFColumn.Values.Skip(1).Take(i), _preparedValues.LoanRate);
|
Values[i] = NPV(cashflowMSFOWithCFColumn.Values.Skip(1).Take(i), _preparedValues.FundingRate);
|
||||||
}
|
}
|
||||||
|
|
||||||
Values[0] = -Values[^1] / (cashflowMSFOColumn.GetValue(0) +
|
Values[0] = -Values[^1] / (cashflowMsfoFinal2Column.GetValue(0) +
|
||||||
cashflowMSFOColumn.GetValue(1));
|
cashflowMsfoFinal2Column.GetValue(1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -10,8 +10,8 @@ public class PIColumnVT1 : BasePIColumn
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ComputeValues(BaseColumn<decimal> cashflowMSFOColumn, BaseColumn<decimal> cashflowMSFOWithCFColumn)
|
public void ComputeValues(BaseColumn<decimal> cashflowMsfoFinal2Column, BaseColumn<decimal> cashflowMSFOWithCFColumn)
|
||||||
{
|
{
|
||||||
FillValues(cashflowMSFOColumn, cashflowMSFOWithCFColumn);
|
FillValues(cashflowMsfoFinal2Column, cashflowMSFOWithCFColumn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -13,7 +13,7 @@ public class PIColumnVT2 : BasePIColumn, IColumnWithGoalSeek
|
|||||||
{
|
{
|
||||||
private readonly PercentPaymentColumn _percentPaymentColumn;
|
private readonly PercentPaymentColumn _percentPaymentColumn;
|
||||||
protected SumColumn _sumColumn;
|
protected SumColumn _sumColumn;
|
||||||
private CashflowMSFOColumnVT2 _cashflowMsfoColumn;
|
private CashflowMSFOFinal2Column _cashflowMsfoFinal2Column;
|
||||||
private readonly PostValues _postValues;
|
private readonly PostValues _postValues;
|
||||||
private SumCreditColumn _sumCreditColumn;
|
private SumCreditColumn _sumCreditColumn;
|
||||||
private CreditPaymentColumn _creditPaymentColumn;
|
private CreditPaymentColumn _creditPaymentColumn;
|
||||||
@ -25,7 +25,7 @@ public class PIColumnVT2 : BasePIColumn, IColumnWithGoalSeek
|
|||||||
|
|
||||||
|
|
||||||
public PIColumnVT2(int count, PreparedValues preparedValues, CashflowMSFOWithCFColumn cashflowMsfoWithCfColumn,
|
public PIColumnVT2(int count, PreparedValues preparedValues, CashflowMSFOWithCFColumn cashflowMsfoWithCfColumn,
|
||||||
CashflowMSFOColumnVT2 cashflowMsfoColumn, PercentPaymentColumn percentPaymentColumn, PostValues postValues,
|
CashflowMSFOFinal2Column cashflowMsfoFinal2Column, PercentPaymentColumn percentPaymentColumn, PostValues postValues,
|
||||||
SumColumn sumColumn, SumCreditColumn sumCreditColumn, CreditPaymentColumn creditPaymentColumn,
|
SumColumn sumColumn, SumCreditColumn sumCreditColumn, CreditPaymentColumn creditPaymentColumn,
|
||||||
VATRecoverableColumn vatRecoverableColumn, VATColumn vatColumn, SumWithVATColumnVT1 sumWithVatColumn,
|
VATRecoverableColumn vatRecoverableColumn, VATColumn vatColumn, SumWithVATColumnVT1 sumWithVatColumn,
|
||||||
CreditColumn creditColumn) : base(
|
CreditColumn creditColumn) : base(
|
||||||
@ -33,7 +33,7 @@ public class PIColumnVT2 : BasePIColumn, IColumnWithGoalSeek
|
|||||||
preparedValues)
|
preparedValues)
|
||||||
{
|
{
|
||||||
_cashflowMSFOWithCFColumn = cashflowMsfoWithCfColumn;
|
_cashflowMSFOWithCFColumn = cashflowMsfoWithCfColumn;
|
||||||
_cashflowMsfoColumn = cashflowMsfoColumn;
|
_cashflowMsfoFinal2Column = cashflowMsfoFinal2Column;
|
||||||
_percentPaymentColumn = percentPaymentColumn;
|
_percentPaymentColumn = percentPaymentColumn;
|
||||||
_postValues = postValues;
|
_postValues = postValues;
|
||||||
_sumColumn = sumColumn;
|
_sumColumn = sumColumn;
|
||||||
@ -48,7 +48,7 @@ public class PIColumnVT2 : BasePIColumn, IColumnWithGoalSeek
|
|||||||
public decimal Calculate(decimal inputVariable)
|
public decimal Calculate(decimal inputVariable)
|
||||||
{
|
{
|
||||||
_sumColumn.ComputeValues(inputVariable);
|
_sumColumn.ComputeValues(inputVariable);
|
||||||
_cashflowMsfoColumn.ComputeValues();
|
_cashflowMsfoFinal2Column.ComputeValues();
|
||||||
_vatColumn.ComputeValues(_sumColumn, _preparedValues);
|
_vatColumn.ComputeValues(_sumColumn, _preparedValues);
|
||||||
_sumWithVatColumn.ComputeValues();
|
_sumWithVatColumn.ComputeValues();
|
||||||
_sumCreditColumn.ComputeValues(_preparedValues, _sumWithVatColumn);
|
_sumCreditColumn.ComputeValues(_preparedValues, _sumWithVatColumn);
|
||||||
@ -56,10 +56,10 @@ public class PIColumnVT2 : BasePIColumn, IColumnWithGoalSeek
|
|||||||
_vatRecoverableColumn.ComputeValues(_vatColumn);
|
_vatRecoverableColumn.ComputeValues(_vatColumn);
|
||||||
_creditPaymentColumn.ComputeValues(_preparedValues, _sumCreditColumn, _creditColumn);
|
_creditPaymentColumn.ComputeValues(_preparedValues, _sumCreditColumn, _creditColumn);
|
||||||
|
|
||||||
_cashflowMSFOWithCFColumn.ComputeValues(_preparedValues, _sumCreditColumn, _cashflowMsfoColumn,
|
_cashflowMSFOWithCFColumn.ComputeValues(_preparedValues, _sumCreditColumn, _cashflowMsfoFinal2Column,
|
||||||
_creditPaymentColumn, _vatRecoverableColumn);
|
_creditPaymentColumn, _vatRecoverableColumn);
|
||||||
|
|
||||||
FillValues(_cashflowMsfoColumn, _cashflowMSFOWithCFColumn);
|
FillValues(_cashflowMsfoFinal2Column, _cashflowMSFOWithCFColumn);
|
||||||
|
|
||||||
return Convert.ToDecimal(Values.GetValue(0));
|
return Convert.ToDecimal(Values.GetValue(0));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,14 +12,13 @@ public class SumCreditColumn : BaseColumn<decimal>
|
|||||||
|
|
||||||
public void ComputeValues(PreparedValues preparedValues, BaseColumn<decimal> sumWithVATColumn)
|
public void ComputeValues(PreparedValues preparedValues, BaseColumn<decimal> sumWithVATColumn)
|
||||||
{
|
{
|
||||||
Values[1] = (!(Math.Abs(preparedValues.LoanRate - 0.135) < 0.0001))
|
Values[1] = preparedValues.FundingRate > 0
|
||||||
? preparedValues.PlPriceWithVAT - sumWithVATColumn.GetValue(1)
|
? preparedValues.PlPriceWithVAT - sumWithVATColumn.GetValue(1)
|
||||||
: 0;
|
: 0;
|
||||||
Values[2] = Values[1];
|
|
||||||
|
|
||||||
for (var i = 3; i < Values.Length; i++)
|
for (var i = 2; i < Values.Length; i++)
|
||||||
if (GetValue(i - 1) > 0)
|
if (GetValue(i - 1) > 0)
|
||||||
Values[i] = GetValue(i - 1) - GetValue(2) / preparedValues.LoanRatePeriod;
|
Values[i] = GetValue(i - 1) - GetValue(1) / preparedValues.LoanRatePeriod;
|
||||||
else
|
else
|
||||||
Values[i] = 0;
|
Values[i] = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using EvoCalculator.Core.Calculation.Tools;
|
||||||
using EvoCalculator.Core.Calculation.v1.Columns;
|
using EvoCalculator.Core.Calculation.v1.Columns;
|
||||||
using EvoCalculator.Core.Calculation.v2.Columns;
|
using EvoCalculator.Core.Calculation.v2.Columns;
|
||||||
using EvoCalculator.Core.Calculation.v3.Columns;
|
using EvoCalculator.Core.Calculation.v3.Columns;
|
||||||
using EvoCalculator.Core.Models.Calculation.Models.Manager;
|
using EvoCalculator.Core.Models.Calculation.Models.Manager;
|
||||||
using EvoCalculator.Core.Models.Calculation.Models.Request;
|
using EvoCalculator.Core.Models.Calculation.Models.Request;
|
||||||
using EvoCalculator.Core.Tools.Validation;
|
|
||||||
using CashflowColumn = EvoCalculator.Core.Calculation.v2.Columns.CashflowColumn;
|
using CashflowColumn = EvoCalculator.Core.Calculation.v2.Columns.CashflowColumn;
|
||||||
using CashflowLeasingColumn = EvoCalculator.Core.Calculation.v2.Columns.CashflowLeasingColumn;
|
using CashflowLeasingColumn = EvoCalculator.Core.Calculation.v2.Columns.CashflowLeasingColumn;
|
||||||
using CashflowMSFOColumnVT2 = EvoCalculator.Core.Calculation.v2.Columns.CashflowMSFOColumnVT2;
|
using CashflowMSFOColumnVT2 = EvoCalculator.Core.Calculation.v2.Columns.CashflowMSFOColumnVT2;
|
||||||
@ -127,12 +127,26 @@ public static partial class CalculateManager
|
|||||||
|
|
||||||
var creditPaymentColumn = new CreditPaymentColumn(preparedValues.LoanRatePeriod + 4);
|
var creditPaymentColumn = new CreditPaymentColumn(preparedValues.LoanRatePeriod + 4);
|
||||||
|
|
||||||
|
|
||||||
|
var directorBonusSumColumn = new DirectorBonusSumColumn(preparedValues.Nmper + 1);
|
||||||
|
directorBonusSumColumn.ComputeValues(preparedValues, postValues);
|
||||||
|
|
||||||
|
var extraBonusSumColumn = new ExtraBonusSumColumn(preparedValues.Nmper + 1);
|
||||||
|
extraBonusSumColumn.ComputeValues(preparedValues, cashflowMsfoColumn, postValues, constants);
|
||||||
|
|
||||||
|
var cashflowMsfoFinalColumn = new CashflowMSFOFinalColumn(preparedValues.Nmper + 1, dateTempColumn);
|
||||||
|
cashflowMsfoFinalColumn.ComputeValues(preparedValues, cashflowMsfoColumn, extraBonusSumColumn);
|
||||||
|
|
||||||
|
var cashflowMsfoFinal2Column =
|
||||||
|
new CashflowMSFOFinal2Column(preparedValues.Nmper + 1, dateTempColumn, preparedValues,
|
||||||
|
directorBonusSumColumn, cashflowMsfoFinalColumn);
|
||||||
|
cashflowMsfoFinal2Column.ComputeValues();
|
||||||
|
|
||||||
var cashflowMsfoWithCfColumn = new CashflowMSFOWithCFColumn(
|
var cashflowMsfoWithCfColumn = new CashflowMSFOWithCFColumn(
|
||||||
new[] { preparedValues.LoanRatePeriod + 4, preparedValues.Nmper + 1 }
|
new[] { preparedValues.LoanRatePeriod + 4, preparedValues.Nmper + 1 }
|
||||||
.Max());
|
.Max());
|
||||||
|
|
||||||
|
var piColumn = new PIColumnVT2(61, preparedValues, cashflowMsfoWithCfColumn, cashflowMsfoFinal2Column,
|
||||||
var piColumn = new PIColumnVT2(61, preparedValues, cashflowMsfoWithCfColumn, cashflowMsfoColumn,
|
|
||||||
percentPaymentColumn, postValues, sumColumn, sumCreditColumn, creditPaymentColumn,
|
percentPaymentColumn, postValues, sumColumn, sumCreditColumn, creditPaymentColumn,
|
||||||
vatRecoverableColumn, vatColumn, sumWithVatColumn, creditColumn);
|
vatRecoverableColumn, vatColumn, sumWithVatColumn, creditColumn);
|
||||||
piColumn.ComputeValues((decimal)preparedValues.NpvniExpected);
|
piColumn.ComputeValues((decimal)preparedValues.NpvniExpected);
|
||||||
@ -256,12 +270,6 @@ public static partial class CalculateManager
|
|||||||
|
|
||||||
postValues.ComputePlanIRRMSFO(cashflowMsfoColumn);
|
postValues.ComputePlanIRRMSFO(cashflowMsfoColumn);
|
||||||
|
|
||||||
var extraBonusSumColumn = new ExtraBonusSumColumn(preparedValues.Nmper + 1);
|
|
||||||
extraBonusSumColumn.ComputeValues(preparedValues, cashflowMsfoColumn, postValues, constants);
|
|
||||||
|
|
||||||
var cashflowMsfoFinalColumn = new CashflowMSFOFinalColumn(preparedValues.Nmper + 1, dateTempColumn);
|
|
||||||
cashflowMsfoFinalColumn.ComputeValues(preparedValues, cashflowMsfoColumn, extraBonusSumColumn);
|
|
||||||
|
|
||||||
var cashflowNpvFinalColumn = new CashflowNPVFinalColumn(maxColumnLength);
|
var cashflowNpvFinalColumn = new CashflowNPVFinalColumn(maxColumnLength);
|
||||||
cashflowNpvFinalColumn.ComputeValues(preparedValues, extraBonusSumColumn, cashflowNpvColumn);
|
cashflowNpvFinalColumn.ComputeValues(preparedValues, extraBonusSumColumn, cashflowNpvColumn);
|
||||||
|
|
||||||
@ -273,12 +281,6 @@ public static partial class CalculateManager
|
|||||||
postValues.ComputeRegionalDirectorBonus();
|
postValues.ComputeRegionalDirectorBonus();
|
||||||
postValues.ComputeRegionalDirectorExtraBonus(cashflowMsfoColumn);
|
postValues.ComputeRegionalDirectorExtraBonus(cashflowMsfoColumn);
|
||||||
|
|
||||||
var directorBonusSumColumn = new DirectorBonusSumColumn(preparedValues.Nmper + 1);
|
|
||||||
directorBonusSumColumn.ComputeValues(preparedValues, postValues);
|
|
||||||
|
|
||||||
var cashflowMsfoFinal2Column = new CashflowMSFOFinal2Column(preparedValues.Nmper + 1, dateTempColumn);
|
|
||||||
cashflowMsfoFinal2Column.ComputeValues(preparedValues, directorBonusSumColumn, cashflowMsfoFinalColumn);
|
|
||||||
|
|
||||||
var cashflowNpvFinal2Column = new CashflowNPVFinal2Column(maxColumnLength);
|
var cashflowNpvFinal2Column = new CashflowNPVFinal2Column(maxColumnLength);
|
||||||
cashflowNpvFinal2Column.ComputeValues(preparedValues, cashflowNpvFinalColumn, directorBonusSumColumn);
|
cashflowNpvFinal2Column.ComputeValues(preparedValues, cashflowNpvFinalColumn, directorBonusSumColumn);
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using EvoCalculator.Core.Calculation.Tools;
|
||||||
using EvoCalculator.Core.Calculation.v1.Columns;
|
using EvoCalculator.Core.Calculation.v1.Columns;
|
||||||
using EvoCalculator.Core.Calculation.v2.Columns;
|
using EvoCalculator.Core.Calculation.v2.Columns;
|
||||||
using EvoCalculator.Core.Calculation.v3.Columns;
|
using EvoCalculator.Core.Calculation.v3.Columns;
|
||||||
using EvoCalculator.Core.Models.Calculation.Models.Manager;
|
using EvoCalculator.Core.Models.Calculation.Models.Manager;
|
||||||
using EvoCalculator.Core.Models.Calculation.Models.Request;
|
using EvoCalculator.Core.Models.Calculation.Models.Request;
|
||||||
using EvoCalculator.Core.Tools.Validation;
|
|
||||||
using CashflowColumn = EvoCalculator.Core.Calculation.v2.Columns.CashflowColumn;
|
using CashflowColumn = EvoCalculator.Core.Calculation.v2.Columns.CashflowColumn;
|
||||||
using CashflowLeasingColumn = EvoCalculator.Core.Calculation.v2.Columns.CashflowLeasingColumn;
|
using CashflowLeasingColumn = EvoCalculator.Core.Calculation.v2.Columns.CashflowLeasingColumn;
|
||||||
using CashflowMSFOColumnVT2 = EvoCalculator.Core.Calculation.v2.Columns.CashflowMSFOColumnVT2;
|
using CashflowMSFOColumnVT2 = EvoCalculator.Core.Calculation.v2.Columns.CashflowMSFOColumnVT2;
|
||||||
@ -260,8 +260,9 @@ public static partial class CalculateManager
|
|||||||
var directorBonusSumColumn = new DirectorBonusSumColumn(preparedValues.Nmper + 1);
|
var directorBonusSumColumn = new DirectorBonusSumColumn(preparedValues.Nmper + 1);
|
||||||
directorBonusSumColumn.ComputeValues(preparedValues, postValues);
|
directorBonusSumColumn.ComputeValues(preparedValues, postValues);
|
||||||
|
|
||||||
var cashflowMsfoFinal2Column = new CashflowMSFOFinal2Column(preparedValues.Nmper + 1, dateTempColumn);
|
var cashflowMsfoFinal2Column = new CashflowMSFOFinal2Column(preparedValues.Nmper + 1, dateTempColumn,
|
||||||
cashflowMsfoFinal2Column.ComputeValues(preparedValues, directorBonusSumColumn, cashflowMsfoFinalColumn);
|
preparedValues, directorBonusSumColumn, cashflowMsfoFinalColumn);
|
||||||
|
cashflowMsfoFinal2Column.ComputeValues();
|
||||||
|
|
||||||
var cashflowNpvFinal2Column = new CashflowNPVFinal2Column(maxColumnLength);
|
var cashflowNpvFinal2Column = new CashflowNPVFinal2Column(maxColumnLength);
|
||||||
cashflowNpvFinal2Column.ComputeValues(preparedValues, cashflowNpvFinalColumn, directorBonusSumColumn);
|
cashflowNpvFinal2Column.ComputeValues(preparedValues, cashflowNpvFinalColumn, directorBonusSumColumn);
|
||||||
@ -291,11 +292,11 @@ public static partial class CalculateManager
|
|||||||
var cashflowMsfoWithCfColumn = new CashflowMSFOWithCFColumn(
|
var cashflowMsfoWithCfColumn = new CashflowMSFOWithCFColumn(
|
||||||
new[] { preparedValues.LoanRatePeriod + 4, preparedValues.Nmper + 1 }
|
new[] { preparedValues.LoanRatePeriod + 4, preparedValues.Nmper + 1 }
|
||||||
.Max());
|
.Max());
|
||||||
cashflowMsfoWithCfColumn.ComputeValues(preparedValues, sumCreditColumn, cashflowMsfoColumn,
|
cashflowMsfoWithCfColumn.ComputeValues(preparedValues, sumCreditColumn, cashflowMsfoFinal2Column,
|
||||||
creditPaymentColumn, vatRecoverableColumn);
|
creditPaymentColumn, vatRecoverableColumn);
|
||||||
|
|
||||||
var piColumn = new PIColumnVT1(61, preparedValues);
|
var piColumn = new PIColumnVT1(61, preparedValues);
|
||||||
piColumn.ComputeValues(cashflowMsfoColumn, cashflowMsfoWithCfColumn);
|
piColumn.ComputeValues(cashflowMsfoFinal2Column, cashflowMsfoWithCfColumn);
|
||||||
|
|
||||||
postValues.ComputePriceUP(sumColumn);
|
postValues.ComputePriceUP(sumColumn);
|
||||||
postValues.ComputePriceUP_PR();
|
postValues.ComputePriceUP_PR();
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using EvoCalculator.Core.Calculation.Tools;
|
||||||
using EvoCalculator.Core.Calculation.v1.Columns;
|
using EvoCalculator.Core.Calculation.v1.Columns;
|
||||||
using EvoCalculator.Core.Calculation.v2.Columns;
|
using EvoCalculator.Core.Calculation.v2.Columns;
|
||||||
using EvoCalculator.Core.Calculation.v3.Columns;
|
using EvoCalculator.Core.Calculation.v3.Columns;
|
||||||
using EvoCalculator.Core.Models.Calculation.Models.Manager;
|
using EvoCalculator.Core.Models.Calculation.Models.Manager;
|
||||||
using EvoCalculator.Core.Models.Calculation.Models.Request;
|
using EvoCalculator.Core.Models.Calculation.Models.Request;
|
||||||
using EvoCalculator.Core.Tools.Validation;
|
|
||||||
using CashflowColumn = EvoCalculator.Core.Calculation.v2.Columns.CashflowColumn;
|
using CashflowColumn = EvoCalculator.Core.Calculation.v2.Columns.CashflowColumn;
|
||||||
using CashflowLeasingColumn = EvoCalculator.Core.Calculation.v2.Columns.CashflowLeasingColumn;
|
using CashflowLeasingColumn = EvoCalculator.Core.Calculation.v2.Columns.CashflowLeasingColumn;
|
||||||
using CashflowMSFOColumnVT1 = EvoCalculator.Core.Calculation.v2.Columns.CashflowMSFOColumnVT1;
|
using CashflowMSFOColumnVT1 = EvoCalculator.Core.Calculation.v2.Columns.CashflowMSFOColumnVT1;
|
||||||
@ -259,8 +259,9 @@ public static partial class CalculateManager
|
|||||||
var directorBonusSumColumn = new DirectorBonusSumColumn(preparedValues.Nmper + 1);
|
var directorBonusSumColumn = new DirectorBonusSumColumn(preparedValues.Nmper + 1);
|
||||||
directorBonusSumColumn.ComputeValues(preparedValues, postValues);
|
directorBonusSumColumn.ComputeValues(preparedValues, postValues);
|
||||||
|
|
||||||
var cashflowMsfoFinal2Column = new CashflowMSFOFinal2Column(preparedValues.Nmper + 1, dateTempColumn);
|
var cashflowMsfoFinal2Column = new CashflowMSFOFinal2Column(preparedValues.Nmper + 1, dateTempColumn,
|
||||||
cashflowMsfoFinal2Column.ComputeValues(preparedValues, directorBonusSumColumn, cashflowMsfoFinalColumn);
|
preparedValues, directorBonusSumColumn, cashflowMsfoFinalColumn);
|
||||||
|
cashflowMsfoFinal2Column.ComputeValues();
|
||||||
|
|
||||||
var cashflowNpvFinal2Column = new CashflowNPVFinal2Column(maxColumnLength);
|
var cashflowNpvFinal2Column = new CashflowNPVFinal2Column(maxColumnLength);
|
||||||
cashflowNpvFinal2Column.ComputeValues(preparedValues, cashflowNpvFinalColumn, directorBonusSumColumn);
|
cashflowNpvFinal2Column.ComputeValues(preparedValues, cashflowNpvFinalColumn, directorBonusSumColumn);
|
||||||
@ -290,11 +291,11 @@ public static partial class CalculateManager
|
|||||||
var cashflowMsfoWithCfColumn = new CashflowMSFOWithCFColumn(
|
var cashflowMsfoWithCfColumn = new CashflowMSFOWithCFColumn(
|
||||||
new[] { preparedValues.LoanRatePeriod + 4, preparedValues.Nmper + 1 }
|
new[] { preparedValues.LoanRatePeriod + 4, preparedValues.Nmper + 1 }
|
||||||
.Max());
|
.Max());
|
||||||
cashflowMsfoWithCfColumn.ComputeValues(preparedValues, sumCreditColumn, cashflowMsfoColumn,
|
cashflowMsfoWithCfColumn.ComputeValues(preparedValues, sumCreditColumn, cashflowMsfoFinal2Column,
|
||||||
creditPaymentColumn, vatRecoverableColumn);
|
creditPaymentColumn, vatRecoverableColumn);
|
||||||
|
|
||||||
var piColumn = new PIColumnVT1(61, preparedValues);
|
var piColumn = new PIColumnVT1(61, preparedValues);
|
||||||
piColumn.ComputeValues(cashflowMsfoColumn, cashflowMsfoWithCfColumn);
|
piColumn.ComputeValues(cashflowMsfoFinal2Column, cashflowMsfoWithCfColumn);
|
||||||
|
|
||||||
postValues.ComputePriceUP(sumColumn);
|
postValues.ComputePriceUP(sumColumn);
|
||||||
postValues.ComputePriceUP_PR();
|
postValues.ComputePriceUP_PR();
|
||||||
|
|||||||
@ -14,6 +14,7 @@ public class PreparedValues
|
|||||||
public double TotalExpected { get; set; }
|
public double TotalExpected { get; set; }
|
||||||
public double Leasing0K { get; set; }
|
public double Leasing0K { get; set; }
|
||||||
public double LoanRate { get; set; }
|
public double LoanRate { get; set; }
|
||||||
|
public double FundingRate { get; set; } = 0;
|
||||||
public int BalanceHolder { get; set; }
|
public int BalanceHolder { get; set; }
|
||||||
|
|
||||||
public DateTime DogDate
|
public DateTime DogDate
|
||||||
|
|||||||
@ -28,6 +28,7 @@ public class PreparedValues
|
|||||||
|
|
||||||
public double Repayment { get; set; }
|
public double Repayment { get; set; }
|
||||||
public bool ChangeRepayment { get; set; }
|
public bool ChangeRepayment { get; set; }
|
||||||
|
public double FundingRate { get; set; } = 0;
|
||||||
public double LoanRate { get; set; }
|
public double LoanRate { get; set; }
|
||||||
public int LoanRatePeriod { get; set; }
|
public int LoanRatePeriod { get; set; }
|
||||||
public ChangingValue<int> BalanceHolder { get; set; }
|
public ChangingValue<int> BalanceHolder { get; set; }
|
||||||
|
|||||||
@ -10,4 +10,5 @@
|
|||||||
<ProjectReference Include="..\EvoCalculator.Core.Tools\EvoCalculator.Core.Tools.csproj" />
|
<ProjectReference Include="..\EvoCalculator.Core.Tools\EvoCalculator.Core.Tools.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
17
EvoCalculator.Core.PostCalculation/Tools/Validation.cs
Normal file
17
EvoCalculator.Core.PostCalculation/Tools/Validation.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
||||||
|
using EvoCalculator.Core.Tools.Errors;
|
||||||
|
|
||||||
|
namespace EvoCalculator.Core.PostCalculation.Tools;
|
||||||
|
|
||||||
|
public class Validation
|
||||||
|
{
|
||||||
|
public void ValidateRequest(RequestCalculation requestCalculation)
|
||||||
|
{
|
||||||
|
var preparedValues = requestCalculation.PreparedValues;
|
||||||
|
|
||||||
|
if (preparedValues.CalcType != 100000003 && preparedValues.CalcType != 100000008)
|
||||||
|
if (preparedValues.EditPaymentNumber >= preparedValues.Nmper.Next)
|
||||||
|
throw new AppException(
|
||||||
|
"Невозможно осуществить расчет графика: срок лизинга превышает количество платежей");
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,20 +1,58 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using EvoCalculator.Core.Base.Columns;
|
using EvoCalculator.Core.Base.Columns;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared.PreparedTables;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared.PreparedTables;
|
||||||
|
using EvoCalculator.Core.Tools.Array;
|
||||||
|
|
||||||
namespace EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
namespace EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
||||||
|
|
||||||
public class SumColumn : BaseColumnWithXIRR
|
public class SumColumn : BaseColumnWithXIRR
|
||||||
{
|
{
|
||||||
|
private BaseColumn<DateTime> _dateTempColumn;
|
||||||
|
|
||||||
public SumColumn(int count, BaseColumn<DateTime> dateTempColumn) : base(count, dateTempColumn)
|
public SumColumn(int count, BaseColumn<DateTime> dateTempColumn) : base(count, dateTempColumn)
|
||||||
{
|
{
|
||||||
|
_dateTempColumn = dateTempColumn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ComputeValues(PreparedValues preparedValues, TablePaymentsRow[] currentTablePayments)
|
public void ComputeValues(PreparedValues preparedValues, TablePaymentsRow[] currentTablePayments,
|
||||||
|
TableInsuranceRow[] currentTableInsurance)
|
||||||
{
|
{
|
||||||
Values[0] = -(preparedValues.BaseCost + preparedValues.FuelCardSum);
|
var costInsurances = Array.Empty<decimal>();
|
||||||
Values[1] = currentTablePayments[0].SumPayment + preparedValues.SubsidySum;
|
if (currentTableInsurance != null)
|
||||||
for (var i = 2; i < Values.Length; i++) Values[i] = currentTablePayments[i - 1].SumPayment;
|
costInsurances = currentTableInsurance
|
||||||
|
.Where(ins =>
|
||||||
|
ins.PeriodNumberInsurance > 1
|
||||||
|
&& ins.TypeRiskInsurance is "KASKO" or "OSAGO" or "GAP" or "EvoKASKO"
|
||||||
|
)
|
||||||
|
.OrderBy(x => x.TypeRiskInsurance)
|
||||||
|
.Select(x => -(x.CostInsurance + x.InsuranceBonusLoss))
|
||||||
|
.ToArray();
|
||||||
|
|
||||||
|
|
||||||
|
Values = Array<decimal>.Concat(
|
||||||
|
new[] { -preparedValues.BaseCost - preparedValues.FuelCardSum + costInsurances.Sum() }
|
||||||
|
, new[] { currentTablePayments[0].SumPayment + preparedValues.SubsidySum }
|
||||||
|
, currentTablePayments.Skip(1).Select(x => x.SumPayment)
|
||||||
|
, costInsurances
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
var dateStartPeriodInsurances = Array.Empty<DateTime>();
|
||||||
|
if (currentTableInsurance != null)
|
||||||
|
dateStartPeriodInsurances = currentTableInsurance
|
||||||
|
.Where(ins =>
|
||||||
|
ins.PeriodNumberInsurance > 1
|
||||||
|
&& ins.TypeRiskInsurance is "KASKO" or "OSAGO" or "GAP" or "EvoKASKO")
|
||||||
|
.OrderBy(x => x.TypeRiskInsurance)
|
||||||
|
.Select(x => x.DateStartPeriodInsurance)
|
||||||
|
.ToArray();
|
||||||
|
|
||||||
|
Dates = Array<DateTime>.Concat(
|
||||||
|
_dateTempColumn.Values
|
||||||
|
, dateStartPeriodInsurances
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -13,13 +13,13 @@ public class CashflowMSFOColumn : BaseColumnWithNominal
|
|||||||
public void ComputeValues(NextValues nextValues
|
public void ComputeValues(NextValues nextValues
|
||||||
, PreparedValues preparedValues
|
, PreparedValues preparedValues
|
||||||
, BaseColumn<decimal> nextSumColumn
|
, BaseColumn<decimal> nextSumColumn
|
||||||
, BaseColumn<decimal>? nextTLMCostColumn
|
, BaseColumn<decimal> nextTLMCostColumn
|
||||||
, BaseColumn<decimal> nextSubsidyExpensesColumn
|
, BaseColumn<decimal> nextSubsidyExpensesColumn
|
||||||
, BaseColumn<decimal> nextNSIBBruttoGrColumn
|
, BaseColumn<decimal> nextNSIBBruttoGrColumn
|
||||||
, TableInsuranceRow[]? nextTableInsurance
|
, TableInsuranceRow[] nextTableInsurance
|
||||||
, BaseColumn<DateTime> nextDateTempColumn
|
, BaseColumn<DateTime> nextDateTempColumn
|
||||||
, BaseColumn<DateTime>? nextTLMDateColumn
|
, BaseColumn<DateTime> nextTLMDateColumn
|
||||||
)
|
, BaseColumn<DateTime> currentDateTempColumn)
|
||||||
{
|
{
|
||||||
var costInsurances = Array.Empty<decimal>();
|
var costInsurances = Array.Empty<decimal>();
|
||||||
if (nextTableInsurance != null)
|
if (nextTableInsurance != null)
|
||||||
@ -36,7 +36,7 @@ public class CashflowMSFOColumn : BaseColumnWithNominal
|
|||||||
if (nextTLMCostColumn != null) tlmCosts = nextTLMCostColumn.Values.Skip(1).Select(x => -x).ToArray();
|
if (nextTLMCostColumn != null) tlmCosts = nextTLMCostColumn.Values.Skip(1).Select(x => -x).ToArray();
|
||||||
|
|
||||||
Values = Array<decimal>.Concat(
|
Values = Array<decimal>.Concat(
|
||||||
new[] {-nextValues.AcquisitionExpenses - preparedValues.FuelCardSum}
|
new[] { -nextValues.AcquisitionExpenses - preparedValues.FuelCardSum }
|
||||||
, nextSumColumn.Values.Skip(1).ToArray()
|
, nextSumColumn.Values.Skip(1).ToArray()
|
||||||
, costInsurances
|
, costInsurances
|
||||||
, nextNSIBBruttoGrColumn.Values.Skip(1).ToArray()
|
, nextNSIBBruttoGrColumn.Values.Skip(1).ToArray()
|
||||||
@ -64,7 +64,7 @@ public class CashflowMSFOColumn : BaseColumnWithNominal
|
|||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
Dates = Array<DateTime>.Concat(
|
Dates = Array<DateTime>.Concat(
|
||||||
new[] {nextDateTempColumn.GetValue(0)}
|
new[] { nextDateTempColumn.GetValue(0) }
|
||||||
, nextDateTempColumn.Values.Skip(1).ToArray()
|
, nextDateTempColumn.Values.Skip(1).ToArray()
|
||||||
, dateStartPeriodInsurances
|
, dateStartPeriodInsurances
|
||||||
, nextDateTempColumn.Values.Skip(1).ToArray()
|
, nextDateTempColumn.Values.Skip(1).ToArray()
|
||||||
@ -75,6 +75,22 @@ public class CashflowMSFOColumn : BaseColumnWithNominal
|
|||||||
, nextTLMDates
|
, nextTLMDates
|
||||||
, nextDateTempColumn.Values.Skip(1).ToArray()
|
, nextDateTempColumn.Values.Skip(1).ToArray()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
var lastDateTempValue = nextDateTempColumn.Values.Last();
|
||||||
|
var lastCurrentDateTempValue = currentDateTempColumn.Values.Last();
|
||||||
|
var evoKasko = nextTableInsurance.FirstOrDefault(x => x.TypeRiskInsurance == "EvoKASKO");
|
||||||
|
|
||||||
|
if (evoKasko != null &&
|
||||||
|
new DateTime(lastDateTempValue.Year, lastDateTempValue.Month, 1) >
|
||||||
|
new DateTime(lastCurrentDateTempValue.Year, lastCurrentDateTempValue.Month, 1))
|
||||||
|
{
|
||||||
|
var evoKaskoSum = -((evoKasko.CostInsurance + evoKasko.InsuranceBonusLoss) / 12) *
|
||||||
|
((lastDateTempValue.Year - lastCurrentDateTempValue.Year) * 12 +
|
||||||
|
lastDateTempValue.Month - lastCurrentDateTempValue.Month);
|
||||||
|
Values = Values.Append(evoKaskoSum).ToArray();
|
||||||
|
Dates = Dates.Append(currentDateTempColumn.Values.Last().AddDays(1)).ToArray();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PostCheck()
|
public void PostCheck()
|
||||||
|
|||||||
@ -13,7 +13,8 @@ public class SumCurrentNegativeColumn : BaseColumn<decimal>
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ComputeValues(BaseColumn<DateTime> nextDateTempColumn, TableInsuranceRow[] nextTableInsurance)
|
public void ComputeValues(BaseColumn<DateTime> nextDateTempColumn, TableInsuranceRow[] nextTableInsurance,
|
||||||
|
BaseColumn<DateTime> currentDateTempColumn)
|
||||||
{
|
{
|
||||||
if (nextTableInsurance == null)
|
if (nextTableInsurance == null)
|
||||||
return;
|
return;
|
||||||
@ -33,7 +34,22 @@ public class SumCurrentNegativeColumn : BaseColumn<decimal>
|
|||||||
);
|
);
|
||||||
|
|
||||||
Values = Array<decimal>.Concat(
|
Values = Array<decimal>.Concat(
|
||||||
new[] {0m}
|
new[] { 0m }
|
||||||
, GroupColumns.Split(groupSumCurrentNegativeColumn).Values);
|
, GroupColumns.Split(groupSumCurrentNegativeColumn).Values);
|
||||||
|
|
||||||
|
|
||||||
|
var lastDateTempValue = nextDateTempColumn.Values.Last();
|
||||||
|
var lastCurrentDateTempValue = currentDateTempColumn.Values.Last();
|
||||||
|
var evoKasko = nextTableInsurance.FirstOrDefault(x => x.TypeRiskInsurance == "EvoKASKO");
|
||||||
|
|
||||||
|
if (evoKasko != null &&
|
||||||
|
new DateTime(lastDateTempValue.Year, lastDateTempValue.Month, 1) >
|
||||||
|
new DateTime(lastCurrentDateTempValue.Year, lastCurrentDateTempValue.Month, 1))
|
||||||
|
{
|
||||||
|
var evoKaskoSum = -((evoKasko.CostInsurance + evoKasko.InsuranceBonusLoss) / 12) *
|
||||||
|
((lastDateTempValue.Year - lastCurrentDateTempValue.Year) * 12 +
|
||||||
|
lastDateTempValue.Month - lastCurrentDateTempValue.Month);
|
||||||
|
Values = Values.Append(evoKaskoSum).ToArray();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
||||||
|
using EvoCalculator.Core.PostCalculation.Tools;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
||||||
@ -12,6 +13,8 @@ public static partial class CalculateManager
|
|||||||
{
|
{
|
||||||
public static ManagerResult CalculateByIRRAndSum(RequestCalculation requestCalculation)
|
public static ManagerResult CalculateByIRRAndSum(RequestCalculation requestCalculation)
|
||||||
{
|
{
|
||||||
|
new Validation().ValidateRequest(requestCalculation);
|
||||||
|
|
||||||
var constants = new Constants.Calculation();
|
var constants = new Constants.Calculation();
|
||||||
var preparedValues = requestCalculation.PreparedValues;
|
var preparedValues = requestCalculation.PreparedValues;
|
||||||
|
|
||||||
@ -35,7 +38,7 @@ public static partial class CalculateManager
|
|||||||
currentDateTempColumn.ComputeValues(preparedValues, currentDateColumn);
|
currentDateTempColumn.ComputeValues(preparedValues, currentDateColumn);
|
||||||
|
|
||||||
var currentSumColumn = new SumColumn(preparedValues.Nmper.Current + 1, currentDateTempColumn);
|
var currentSumColumn = new SumColumn(preparedValues.Nmper.Current + 1, currentDateTempColumn);
|
||||||
currentSumColumn.ComputeValues(preparedValues, currentTablePayments);
|
currentSumColumn.ComputeValues(preparedValues, currentTablePayments, currentTableInsurance);
|
||||||
/*
|
/*
|
||||||
* CURRENT
|
* CURRENT
|
||||||
*/
|
*/
|
||||||
@ -86,8 +89,8 @@ public static partial class CalculateManager
|
|||||||
techNextSumColumn, currentTablePayments, techNextVATColumn, constants);
|
techNextSumColumn, currentTablePayments, techNextVATColumn, constants);
|
||||||
techNextSumWithVATColumn.ComputeValues();
|
techNextSumWithVATColumn.ComputeValues();
|
||||||
/*
|
/*
|
||||||
* TECH
|
* TECH
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NEXT
|
* NEXT
|
||||||
@ -151,7 +154,7 @@ public static partial class CalculateManager
|
|||||||
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
||||||
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
||||||
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
||||||
nextTlmDateColumn);
|
nextTlmDateColumn, currentDateTempColumn);
|
||||||
|
|
||||||
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
||||||
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
||||||
@ -172,7 +175,7 @@ public static partial class CalculateManager
|
|||||||
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
||||||
|
|
||||||
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
||||||
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance);
|
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance, currentDateTempColumn);
|
||||||
|
|
||||||
var nextSumCurrentInterestColumn =
|
var nextSumCurrentInterestColumn =
|
||||||
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
||||||
|
|||||||
@ -1,8 +1,11 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
||||||
|
using EvoCalculator.Core.PostCalculation.Tools;
|
||||||
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
||||||
|
using DateTempColumn = EvoCalculator.Core.PostCalculation.v1.Columns.Next.DateTempColumn;
|
||||||
|
|
||||||
namespace EvoCalculator.Core.PostCalculation.v1.Managers;
|
namespace EvoCalculator.Core.PostCalculation.v1.Managers;
|
||||||
|
|
||||||
@ -10,6 +13,8 @@ public static partial class CalculateManager
|
|||||||
{
|
{
|
||||||
public static ManagerResult CalculateByTotalExpected(RequestCalculation requestCalculation)
|
public static ManagerResult CalculateByTotalExpected(RequestCalculation requestCalculation)
|
||||||
{
|
{
|
||||||
|
new Validation().ValidateRequest(requestCalculation);
|
||||||
|
|
||||||
var constants = new Constants.Calculation();
|
var constants = new Constants.Calculation();
|
||||||
var preparedValues = requestCalculation.PreparedValues;
|
var preparedValues = requestCalculation.PreparedValues;
|
||||||
|
|
||||||
@ -21,9 +26,25 @@ public static partial class CalculateManager
|
|||||||
|
|
||||||
var currentTableTLMTracker = requestCalculation?.TableTLMTracker?.Current;
|
var currentTableTLMTracker = requestCalculation?.TableTLMTracker?.Current;
|
||||||
var nextTableTLMTracker = requestCalculation?.TableTLMTracker?.Next;
|
var nextTableTLMTracker = requestCalculation?.TableTLMTracker?.Next;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NEXT
|
* CURRENT
|
||||||
*/
|
*/
|
||||||
|
var currentDateColumn = new DateColumn(preparedValues.Nmper.Current + 1);
|
||||||
|
currentDateColumn.ComputeValues(currentTablePayments);
|
||||||
|
|
||||||
|
var currentDateTempColumn =
|
||||||
|
new DateTempColumn(preparedValues.Nmper.Current + 1);
|
||||||
|
currentDateTempColumn.ComputeValues(preparedValues, currentDateColumn);
|
||||||
|
/*
|
||||||
|
* CURRENT
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NEXT
|
||||||
|
*/
|
||||||
var nextDateColumn = new DateColumnVT1(preparedValues.Nmper.Next + 1);
|
var nextDateColumn = new DateColumnVT1(preparedValues.Nmper.Next + 1);
|
||||||
nextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
nextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
||||||
|
|
||||||
@ -84,7 +105,7 @@ public static partial class CalculateManager
|
|||||||
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
||||||
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
||||||
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
||||||
nextTlmDateColumn);
|
nextTlmDateColumn, currentDateTempColumn);
|
||||||
|
|
||||||
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
||||||
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
||||||
@ -105,7 +126,7 @@ public static partial class CalculateManager
|
|||||||
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
||||||
|
|
||||||
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
||||||
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance);
|
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance, currentDateTempColumn);
|
||||||
|
|
||||||
var nextSumCurrentInterestColumn =
|
var nextSumCurrentInterestColumn =
|
||||||
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
||||||
@ -149,8 +170,8 @@ public static partial class CalculateManager
|
|||||||
nextValues.ComputeNiAtInception(currentTablePayments);
|
nextValues.ComputeNiAtInception(currentTablePayments);
|
||||||
nextValues.ComputeNiAtInceptionMSFO();
|
nextValues.ComputeNiAtInceptionMSFO();
|
||||||
/*
|
/*
|
||||||
* NEXT
|
* NEXT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var postValues = new PostValues(preparedValues);
|
var postValues = new PostValues(preparedValues);
|
||||||
postValues.ComputeContractEconomy(nextCashflowMSFOColumn, nextCreditColumn);
|
postValues.ComputeContractEconomy(nextCashflowMSFOColumn, nextCreditColumn);
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
||||||
|
using EvoCalculator.Core.PostCalculation.Tools;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
||||||
@ -12,6 +13,8 @@ public static partial class CalculateManager
|
|||||||
{
|
{
|
||||||
public static ManagerResult CalculateDefault(RequestCalculation requestCalculation)
|
public static ManagerResult CalculateDefault(RequestCalculation requestCalculation)
|
||||||
{
|
{
|
||||||
|
new Validation().ValidateRequest(requestCalculation);
|
||||||
|
|
||||||
var constants = new Constants.Calculation();
|
var constants = new Constants.Calculation();
|
||||||
var preparedValues = requestCalculation.PreparedValues;
|
var preparedValues = requestCalculation.PreparedValues;
|
||||||
|
|
||||||
@ -26,8 +29,8 @@ public static partial class CalculateManager
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CURRENT
|
* CURRENT
|
||||||
*/
|
*/
|
||||||
var currentDateColumn = new DateColumn(preparedValues.Nmper.Current + 1);
|
var currentDateColumn = new DateColumn(preparedValues.Nmper.Current + 1);
|
||||||
currentDateColumn.ComputeValues(currentTablePayments);
|
currentDateColumn.ComputeValues(currentTablePayments);
|
||||||
|
|
||||||
@ -36,15 +39,15 @@ public static partial class CalculateManager
|
|||||||
currentDateTempColumn.ComputeValues(preparedValues, currentDateColumn);
|
currentDateTempColumn.ComputeValues(preparedValues, currentDateColumn);
|
||||||
|
|
||||||
var currentSumColumn = new SumColumn(preparedValues.Nmper.Current + 1, currentDateTempColumn);
|
var currentSumColumn = new SumColumn(preparedValues.Nmper.Current + 1, currentDateTempColumn);
|
||||||
currentSumColumn.ComputeValues(preparedValues, currentTablePayments);
|
currentSumColumn.ComputeValues(preparedValues, currentTablePayments, currentTableInsurance);
|
||||||
/*
|
/*
|
||||||
* CURRENT
|
* CURRENT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NEXT
|
* NEXT
|
||||||
*/
|
*/
|
||||||
var nextDateColumn = new DateColumnVT1(preparedValues.Nmper.Next + 1);
|
var nextDateColumn = new DateColumnVT1(preparedValues.Nmper.Next + 1);
|
||||||
nextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
nextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
||||||
|
|
||||||
@ -100,7 +103,7 @@ public static partial class CalculateManager
|
|||||||
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
||||||
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
||||||
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
||||||
nextTlmDateColumn);
|
nextTlmDateColumn, currentDateTempColumn);
|
||||||
|
|
||||||
var nextVATColumn = new VATColumnVT1(preparedValues.Nmper.Next + 1);
|
var nextVATColumn = new VATColumnVT1(preparedValues.Nmper.Next + 1);
|
||||||
nextVATColumn.ComputeValues(preparedValues, nextSumColumn, currentTablePayments, constants);
|
nextVATColumn.ComputeValues(preparedValues, nextSumColumn, currentTablePayments, constants);
|
||||||
@ -130,7 +133,7 @@ public static partial class CalculateManager
|
|||||||
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
||||||
|
|
||||||
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
||||||
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance);
|
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance, currentDateTempColumn);
|
||||||
|
|
||||||
var nextSumCurrentInterestColumn =
|
var nextSumCurrentInterestColumn =
|
||||||
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
||||||
@ -174,8 +177,8 @@ public static partial class CalculateManager
|
|||||||
nextValues.ComputeNiAtInception(currentTablePayments);
|
nextValues.ComputeNiAtInception(currentTablePayments);
|
||||||
nextValues.ComputeNiAtInceptionMSFO();
|
nextValues.ComputeNiAtInceptionMSFO();
|
||||||
/*
|
/*
|
||||||
* NEXT
|
* NEXT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var postValues = new PostValues(preparedValues);
|
var postValues = new PostValues(preparedValues);
|
||||||
postValues.ComputeContractEconomy(nextCashflowMSFOColumn, nextCreditColumn);
|
postValues.ComputeContractEconomy(nextCashflowMSFOColumn, nextCreditColumn);
|
||||||
@ -223,4 +226,3 @@ public static partial class CalculateManager
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,10 @@
|
|||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
||||||
|
using EvoCalculator.Core.PostCalculation.Tools;
|
||||||
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
||||||
|
using DateTempColumn = EvoCalculator.Core.PostCalculation.v1.Columns.Next.DateTempColumn;
|
||||||
|
|
||||||
namespace EvoCalculator.Core.PostCalculation.v1.Managers;
|
namespace EvoCalculator.Core.PostCalculation.v1.Managers;
|
||||||
|
|
||||||
@ -9,6 +12,8 @@ public static partial class CalculateManager
|
|||||||
{
|
{
|
||||||
public static ManagerResult ChangingLastPayment(RequestCalculation requestCalculation)
|
public static ManagerResult ChangingLastPayment(RequestCalculation requestCalculation)
|
||||||
{
|
{
|
||||||
|
new Validation().ValidateRequest(requestCalculation);
|
||||||
|
|
||||||
var constants = new Constants.Calculation();
|
var constants = new Constants.Calculation();
|
||||||
var preparedValues = requestCalculation.PreparedValues;
|
var preparedValues = requestCalculation.PreparedValues;
|
||||||
|
|
||||||
@ -20,9 +25,23 @@ public static partial class CalculateManager
|
|||||||
|
|
||||||
var currentTableTLMTracker = requestCalculation?.TableTLMTracker?.Current;
|
var currentTableTLMTracker = requestCalculation?.TableTLMTracker?.Current;
|
||||||
var nextTableTLMTracker = requestCalculation?.TableTLMTracker?.Next;
|
var nextTableTLMTracker = requestCalculation?.TableTLMTracker?.Next;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NEXT
|
* CURRENT
|
||||||
*/
|
*/
|
||||||
|
var currentDateColumn = new DateColumn(preparedValues.Nmper.Current + 1);
|
||||||
|
currentDateColumn.ComputeValues(currentTablePayments);
|
||||||
|
|
||||||
|
var currentDateTempColumn =
|
||||||
|
new DateTempColumn(preparedValues.Nmper.Current + 1);
|
||||||
|
currentDateTempColumn.ComputeValues(preparedValues, currentDateColumn);
|
||||||
|
/*
|
||||||
|
* CURRENT
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NEXT
|
||||||
|
*/
|
||||||
var nextDateColumn = new DateColumnVT1(preparedValues.Nmper.Next + 1);
|
var nextDateColumn = new DateColumnVT1(preparedValues.Nmper.Next + 1);
|
||||||
nextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
nextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
||||||
|
|
||||||
@ -81,7 +100,7 @@ public static partial class CalculateManager
|
|||||||
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
||||||
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
||||||
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
||||||
nextTlmDateColumn);
|
nextTlmDateColumn, currentDateTempColumn);
|
||||||
|
|
||||||
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
||||||
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
||||||
@ -102,7 +121,7 @@ public static partial class CalculateManager
|
|||||||
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
||||||
|
|
||||||
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
||||||
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance);
|
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance, currentDateTempColumn);
|
||||||
|
|
||||||
var nextSumCurrentInterestColumn =
|
var nextSumCurrentInterestColumn =
|
||||||
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
||||||
@ -144,8 +163,8 @@ public static partial class CalculateManager
|
|||||||
nextValues.ComputeNiAtInception(currentTablePayments);
|
nextValues.ComputeNiAtInception(currentTablePayments);
|
||||||
nextValues.ComputeNiAtInceptionMSFO();
|
nextValues.ComputeNiAtInceptionMSFO();
|
||||||
/*
|
/*
|
||||||
* NEXT
|
* NEXT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var postValues = new PostValues(preparedValues);
|
var postValues = new PostValues(preparedValues);
|
||||||
postValues.ComputeContractEconomy(nextCashflowMSFOColumn, nextCreditColumn);
|
postValues.ComputeContractEconomy(nextCashflowMSFOColumn, nextCreditColumn);
|
||||||
|
|||||||
@ -1,8 +1,11 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
||||||
|
using EvoCalculator.Core.PostCalculation.Tools;
|
||||||
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
||||||
|
using DateTempColumn = EvoCalculator.Core.PostCalculation.v1.Columns.Next.DateTempColumn;
|
||||||
|
|
||||||
namespace EvoCalculator.Core.PostCalculation.v1.Managers;
|
namespace EvoCalculator.Core.PostCalculation.v1.Managers;
|
||||||
|
|
||||||
@ -10,6 +13,8 @@ public static partial class CalculateManager
|
|||||||
{
|
{
|
||||||
public static ManagerResult EarlyRedemption(RequestCalculation requestCalculation)
|
public static ManagerResult EarlyRedemption(RequestCalculation requestCalculation)
|
||||||
{
|
{
|
||||||
|
new Validation().ValidateRequest(requestCalculation);
|
||||||
|
|
||||||
var constants = new Constants.Calculation();
|
var constants = new Constants.Calculation();
|
||||||
var preparedValues = requestCalculation.PreparedValues;
|
var preparedValues = requestCalculation.PreparedValues;
|
||||||
|
|
||||||
@ -24,6 +29,20 @@ public static partial class CalculateManager
|
|||||||
|
|
||||||
var nextValues = new NextValues(preparedValues);
|
var nextValues = new NextValues(preparedValues);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* CURRENT
|
||||||
|
*/
|
||||||
|
var currentDateColumn = new DateColumn(preparedValues.Nmper.Current + 1);
|
||||||
|
currentDateColumn.ComputeValues(currentTablePayments);
|
||||||
|
|
||||||
|
var currentDateTempColumn =
|
||||||
|
new DateTempColumn(preparedValues.Nmper.Current + 1);
|
||||||
|
currentDateTempColumn.ComputeValues(preparedValues, currentDateColumn);
|
||||||
|
/*
|
||||||
|
* CURRENT
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TECH
|
* TECH
|
||||||
*/
|
*/
|
||||||
@ -86,7 +105,7 @@ public static partial class CalculateManager
|
|||||||
techNextTlmCostColumn,
|
techNextTlmCostColumn,
|
||||||
techNextSubsidyExpensesColumn, techNextNSIBBruttoGrColumn, nextTableInsurance,
|
techNextSubsidyExpensesColumn, techNextNSIBBruttoGrColumn, nextTableInsurance,
|
||||||
techNextDateTempColumn,
|
techNextDateTempColumn,
|
||||||
techNextTlmDateColumn);
|
techNextTlmDateColumn, currentDateTempColumn);
|
||||||
|
|
||||||
var techNextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
var techNextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
||||||
techNextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, techNextDateTempColumn,
|
techNextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, techNextDateTempColumn,
|
||||||
@ -106,7 +125,8 @@ public static partial class CalculateManager
|
|||||||
techNextSumCurrentColumn.ComputeValues(techNextSumWithVATColumn);
|
techNextSumCurrentColumn.ComputeValues(techNextSumWithVATColumn);
|
||||||
|
|
||||||
var techNextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Current + 1);
|
var techNextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Current + 1);
|
||||||
techNextSumCurrentNegativeColumn.ComputeValues(techNextDateTempColumn, nextTableInsurance);
|
techNextSumCurrentNegativeColumn.ComputeValues(techNextDateTempColumn, nextTableInsurance,
|
||||||
|
currentDateTempColumn);
|
||||||
|
|
||||||
var techNextSumCurrentInterestColumn =
|
var techNextSumCurrentInterestColumn =
|
||||||
new SumCurrentInterestColumn(techNextCashflowMSFOForNIColumn.Values.Length);
|
new SumCurrentInterestColumn(techNextCashflowMSFOForNIColumn.Values.Length);
|
||||||
@ -190,7 +210,7 @@ public static partial class CalculateManager
|
|||||||
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
||||||
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
||||||
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
||||||
nextTlmDateColumn);
|
nextTlmDateColumn, currentDateTempColumn);
|
||||||
|
|
||||||
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
||||||
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
||||||
@ -211,7 +231,7 @@ public static partial class CalculateManager
|
|||||||
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
||||||
|
|
||||||
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
||||||
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance);
|
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance, currentDateTempColumn);
|
||||||
|
|
||||||
var nextSumCurrentInterestColumn =
|
var nextSumCurrentInterestColumn =
|
||||||
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
||||||
|
using EvoCalculator.Core.PostCalculation.Tools;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
||||||
@ -12,6 +13,8 @@ public static partial class CalculateManager
|
|||||||
{
|
{
|
||||||
public static ManagerResult PERWithChangingTheTerm(RequestCalculation requestCalculation)
|
public static ManagerResult PERWithChangingTheTerm(RequestCalculation requestCalculation)
|
||||||
{
|
{
|
||||||
|
new Validation().ValidateRequest(requestCalculation);
|
||||||
|
|
||||||
var constants = new Constants.Calculation();
|
var constants = new Constants.Calculation();
|
||||||
var preparedValues = requestCalculation.PreparedValues;
|
var preparedValues = requestCalculation.PreparedValues;
|
||||||
|
|
||||||
@ -26,8 +29,8 @@ public static partial class CalculateManager
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CURRENT
|
* CURRENT
|
||||||
*/
|
*/
|
||||||
var currentDateColumn = new DateColumn(preparedValues.Nmper.Current + 1);
|
var currentDateColumn = new DateColumn(preparedValues.Nmper.Current + 1);
|
||||||
currentDateColumn.ComputeValues(currentTablePayments);
|
currentDateColumn.ComputeValues(currentTablePayments);
|
||||||
|
|
||||||
@ -36,16 +39,16 @@ public static partial class CalculateManager
|
|||||||
currentDateTempColumn.ComputeValues(preparedValues, currentDateColumn);
|
currentDateTempColumn.ComputeValues(preparedValues, currentDateColumn);
|
||||||
|
|
||||||
var currentSumColumn = new SumColumn(preparedValues.Nmper.Current + 1, currentDateTempColumn);
|
var currentSumColumn = new SumColumn(preparedValues.Nmper.Current + 1, currentDateTempColumn);
|
||||||
currentSumColumn.ComputeValues(preparedValues, currentTablePayments);
|
currentSumColumn.ComputeValues(preparedValues, currentTablePayments, currentTableInsurance);
|
||||||
/*
|
/*
|
||||||
* CURRENT
|
* CURRENT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var nextValues = new NextValues(preparedValues);
|
var nextValues = new NextValues(preparedValues);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TECH
|
* TECH
|
||||||
*/
|
*/
|
||||||
var techNextDateColumn = new DateColumnVT1(preparedValues.Nmper.Next + 1);
|
var techNextDateColumn = new DateColumnVT1(preparedValues.Nmper.Next + 1);
|
||||||
techNextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
techNextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
||||||
|
|
||||||
@ -91,12 +94,12 @@ public static partial class CalculateManager
|
|||||||
nextValues.ComputeSumTotal(techNextSumWithVATColumn);
|
nextValues.ComputeSumTotal(techNextSumWithVATColumn);
|
||||||
nextValues.ComputeNmper(nextTablePayments, currentTablePayments);
|
nextValues.ComputeNmper(nextTablePayments, currentTablePayments);
|
||||||
/*
|
/*
|
||||||
* TECH
|
* TECH
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NEXT
|
* NEXT
|
||||||
*/
|
*/
|
||||||
var nextDateColumn = new DateColumnVT1(nextValues.Nmper + 1);
|
var nextDateColumn = new DateColumnVT1(nextValues.Nmper + 1);
|
||||||
nextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
nextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
||||||
|
|
||||||
@ -156,7 +159,7 @@ public static partial class CalculateManager
|
|||||||
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
||||||
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
||||||
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
||||||
nextTlmDateColumn);
|
nextTlmDateColumn, currentDateTempColumn);
|
||||||
|
|
||||||
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
||||||
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
||||||
@ -177,7 +180,7 @@ public static partial class CalculateManager
|
|||||||
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
||||||
|
|
||||||
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(nextValues.Nmper + 1);
|
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(nextValues.Nmper + 1);
|
||||||
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance);
|
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance, currentDateTempColumn);
|
||||||
|
|
||||||
var nextSumCurrentInterestColumn =
|
var nextSumCurrentInterestColumn =
|
||||||
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
||||||
|
using EvoCalculator.Core.PostCalculation.Tools;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
||||||
@ -12,6 +13,8 @@ public static partial class CalculateManager
|
|||||||
{
|
{
|
||||||
public static ManagerResult PERWithoutChangingTheTerm(RequestCalculation requestCalculation)
|
public static ManagerResult PERWithoutChangingTheTerm(RequestCalculation requestCalculation)
|
||||||
{
|
{
|
||||||
|
new Validation().ValidateRequest(requestCalculation);
|
||||||
|
|
||||||
var constants = new Constants.Calculation();
|
var constants = new Constants.Calculation();
|
||||||
var preparedValues = requestCalculation.PreparedValues;
|
var preparedValues = requestCalculation.PreparedValues;
|
||||||
|
|
||||||
@ -26,8 +29,8 @@ public static partial class CalculateManager
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CURRENT
|
* CURRENT
|
||||||
*/
|
*/
|
||||||
var currentDateColumn = new DateColumn(preparedValues.Nmper.Current + 1);
|
var currentDateColumn = new DateColumn(preparedValues.Nmper.Current + 1);
|
||||||
currentDateColumn.ComputeValues(currentTablePayments);
|
currentDateColumn.ComputeValues(currentTablePayments);
|
||||||
|
|
||||||
@ -36,15 +39,15 @@ public static partial class CalculateManager
|
|||||||
currentDateTempColumn.ComputeValues(preparedValues, currentDateColumn);
|
currentDateTempColumn.ComputeValues(preparedValues, currentDateColumn);
|
||||||
|
|
||||||
var currentSumColumn = new SumColumn(preparedValues.Nmper.Current + 1, currentDateTempColumn);
|
var currentSumColumn = new SumColumn(preparedValues.Nmper.Current + 1, currentDateTempColumn);
|
||||||
currentSumColumn.ComputeValues(preparedValues, currentTablePayments);
|
currentSumColumn.ComputeValues(preparedValues, currentTablePayments, currentTableInsurance);
|
||||||
/*
|
/*
|
||||||
* CURRENT
|
* CURRENT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NEXT
|
* NEXT
|
||||||
*/
|
*/
|
||||||
var nextDateColumn = new DateColumnVT1(preparedValues.Nmper.Next + 1);
|
var nextDateColumn = new DateColumnVT1(preparedValues.Nmper.Next + 1);
|
||||||
nextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
nextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
||||||
|
|
||||||
@ -118,7 +121,7 @@ public static partial class CalculateManager
|
|||||||
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
||||||
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
||||||
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
||||||
nextTlmDateColumn);
|
nextTlmDateColumn, currentDateTempColumn);
|
||||||
|
|
||||||
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
||||||
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
||||||
@ -139,7 +142,7 @@ public static partial class CalculateManager
|
|||||||
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
||||||
|
|
||||||
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
||||||
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance);
|
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance, currentDateTempColumn);
|
||||||
|
|
||||||
var nextSumCurrentInterestColumn =
|
var nextSumCurrentInterestColumn =
|
||||||
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
||||||
@ -184,8 +187,8 @@ public static partial class CalculateManager
|
|||||||
nextValues.ComputeNiAtInceptionMSFO();
|
nextValues.ComputeNiAtInceptionMSFO();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NEXT
|
* NEXT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var postValues = new PostValues(preparedValues);
|
var postValues = new PostValues(preparedValues);
|
||||||
postValues.ComputeContractEconomy(nextCashflowMSFOColumn, nextCreditColumn);
|
postValues.ComputeContractEconomy(nextCashflowMSFOColumn, nextCreditColumn);
|
||||||
|
|||||||
@ -1,8 +1,11 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
||||||
|
using EvoCalculator.Core.PostCalculation.Tools;
|
||||||
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
||||||
|
using DateTempColumn = EvoCalculator.Core.PostCalculation.v1.Columns.Next.DateTempColumn;
|
||||||
|
|
||||||
namespace EvoCalculator.Core.PostCalculation.v1.Managers;
|
namespace EvoCalculator.Core.PostCalculation.v1.Managers;
|
||||||
|
|
||||||
@ -10,6 +13,8 @@ public static partial class CalculateManager
|
|||||||
{
|
{
|
||||||
public static ManagerResult Suspension(RequestCalculation requestCalculation)
|
public static ManagerResult Suspension(RequestCalculation requestCalculation)
|
||||||
{
|
{
|
||||||
|
new Validation().ValidateRequest(requestCalculation);
|
||||||
|
|
||||||
var constants = new Constants.Calculation();
|
var constants = new Constants.Calculation();
|
||||||
var preparedValues = requestCalculation.PreparedValues;
|
var preparedValues = requestCalculation.PreparedValues;
|
||||||
|
|
||||||
@ -21,9 +26,23 @@ public static partial class CalculateManager
|
|||||||
|
|
||||||
var currentTableTLMTracker = requestCalculation?.TableTLMTracker?.Current;
|
var currentTableTLMTracker = requestCalculation?.TableTLMTracker?.Current;
|
||||||
var nextTableTLMTracker = requestCalculation?.TableTLMTracker?.Next;
|
var nextTableTLMTracker = requestCalculation?.TableTLMTracker?.Next;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NEXT
|
* CURRENT
|
||||||
*/
|
*/
|
||||||
|
var currentDateColumn = new DateColumn(preparedValues.Nmper.Current + 1);
|
||||||
|
currentDateColumn.ComputeValues(currentTablePayments);
|
||||||
|
|
||||||
|
var currentDateTempColumn =
|
||||||
|
new DateTempColumn(preparedValues.Nmper.Current + 1);
|
||||||
|
currentDateTempColumn.ComputeValues(preparedValues, currentDateColumn);
|
||||||
|
/*
|
||||||
|
* CURRENT
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NEXT
|
||||||
|
*/
|
||||||
var nextDateColumn = new DateColumnVT1(preparedValues.Nmper.Next + 1);
|
var nextDateColumn = new DateColumnVT1(preparedValues.Nmper.Next + 1);
|
||||||
nextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
nextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
||||||
|
|
||||||
@ -84,7 +103,7 @@ public static partial class CalculateManager
|
|||||||
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
||||||
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
||||||
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
||||||
nextTlmDateColumn);
|
nextTlmDateColumn, currentDateTempColumn);
|
||||||
|
|
||||||
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
||||||
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
||||||
@ -105,7 +124,7 @@ public static partial class CalculateManager
|
|||||||
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
||||||
|
|
||||||
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
||||||
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance);
|
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance, currentDateTempColumn);
|
||||||
|
|
||||||
var nextSumCurrentInterestColumn =
|
var nextSumCurrentInterestColumn =
|
||||||
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
||||||
@ -149,8 +168,8 @@ public static partial class CalculateManager
|
|||||||
nextValues.ComputeNiAtInception(currentTablePayments);
|
nextValues.ComputeNiAtInception(currentTablePayments);
|
||||||
nextValues.ComputeNiAtInceptionMSFO();
|
nextValues.ComputeNiAtInceptionMSFO();
|
||||||
/*
|
/*
|
||||||
* NEXT
|
* NEXT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var postValues = new PostValues(preparedValues);
|
var postValues = new PostValues(preparedValues);
|
||||||
postValues.ComputeContractEconomy(nextCashflowMSFOColumn, nextCreditColumn);
|
postValues.ComputeContractEconomy(nextCashflowMSFOColumn, nextCreditColumn);
|
||||||
|
|||||||
@ -9,6 +9,7 @@ namespace EvoCalculator.Core.PostCalculation.v1;
|
|||||||
public class NextValues
|
public class NextValues
|
||||||
{
|
{
|
||||||
public decimal AcquisitionExpenses { get; set; }
|
public decimal AcquisitionExpenses { get; set; }
|
||||||
|
public decimal AcquisitionExpensesWithVAT { get; set; }
|
||||||
public decimal BaseCost { get; set; }
|
public decimal BaseCost { get; set; }
|
||||||
public decimal NiAtInception { get; set; }
|
public decimal NiAtInception { get; set; }
|
||||||
public decimal NiAtInceptionMSFO { get; set; }
|
public decimal NiAtInceptionMSFO { get; set; }
|
||||||
@ -16,9 +17,12 @@ public class NextValues
|
|||||||
public decimal SumTotal { get; set; }
|
public decimal SumTotal { get; set; }
|
||||||
protected PreparedValues preparedValues;
|
protected PreparedValues preparedValues;
|
||||||
|
|
||||||
|
private Constants.Calculation _constants;
|
||||||
|
|
||||||
public NextValues(PreparedValues preparedValues)
|
public NextValues(PreparedValues preparedValues)
|
||||||
{
|
{
|
||||||
this.preparedValues = preparedValues;
|
this.preparedValues = preparedValues;
|
||||||
|
_constants = new Constants.Calculation();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ComputeAcquisitionExpenses(TableInsuranceRow[]? nextTableInsurance)
|
public void ComputeAcquisitionExpenses(TableInsuranceRow[]? nextTableInsurance)
|
||||||
@ -70,13 +74,68 @@ public class NextValues
|
|||||||
> 0 => preparedValues.TransportTaxGr.Next,
|
> 0 => preparedValues.TransportTaxGr.Next,
|
||||||
_ => preparedValues.TransportTaxGr.Current
|
_ => preparedValues.TransportTaxGr.Current
|
||||||
}
|
}
|
||||||
+ preparedValues.InceptDelta;
|
+ preparedValues.InceptDelta
|
||||||
|
+ preparedValues.FuelCardSum;
|
||||||
|
|
||||||
if (AcquisitionExpenses <= 0)
|
if (AcquisitionExpenses <= 0)
|
||||||
throw new AppException(
|
throw new AppException(
|
||||||
"Невозможно осуществить расчет графика, при заданных параметрах получаются отрицательные значения nextValues. Измените параметры для расчета.");
|
"Невозможно осуществить расчет графика, при заданных параметрах получаются отрицательные значения nextValues. Измените параметры для расчета.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void ComputeAcquisitionExpensesWithVAT(TableInsuranceRow[]? nextTableInsurance)
|
||||||
|
{
|
||||||
|
var tracker = 0m;
|
||||||
|
if (preparedValues.ChangeTracker == false)
|
||||||
|
tracker = preparedValues.TrackerCost.Current;
|
||||||
|
else if (preparedValues.TypeChangeTracker == 100000000)
|
||||||
|
tracker = preparedValues.TrackerCost.Current + preparedValues.TrackerCost.Next;
|
||||||
|
else
|
||||||
|
tracker = preparedValues.TrackerCostRemove + preparedValues.TrackerCost.Next;
|
||||||
|
|
||||||
|
var tlm = 0m;
|
||||||
|
if (preparedValues.ChangeTLM == false)
|
||||||
|
tlm = preparedValues.TLMCost.Current;
|
||||||
|
else if (preparedValues.TypeChangeTLM == 100000000)
|
||||||
|
tlm = preparedValues.TLMCost.Current + preparedValues.TLMCost.Next;
|
||||||
|
else
|
||||||
|
tlm = preparedValues.TLMCostRemove + preparedValues.TLMCost.Next;
|
||||||
|
|
||||||
|
|
||||||
|
var baseRegistration = 0m;
|
||||||
|
if (preparedValues.BaseRegistration.Next == 0)
|
||||||
|
baseRegistration = preparedValues.BaseRegistration.Current;
|
||||||
|
else if (preparedValues.TypeChangeRegistration == 100000000)
|
||||||
|
baseRegistration = preparedValues.BaseRegistration.Next;
|
||||||
|
else
|
||||||
|
baseRegistration = preparedValues.BaseRegistration.Current + preparedValues.BaseRegistration.Next;
|
||||||
|
|
||||||
|
|
||||||
|
var nextCostInsurance = 0m;
|
||||||
|
if (nextTableInsurance != null)
|
||||||
|
nextCostInsurance = nextTableInsurance
|
||||||
|
.Where(x => x.TypeRiskInsurance is "KASKO" or "OSAGO" or "GAP" or "EvoKASKO" &&
|
||||||
|
x.PeriodNumberInsurance == 1)
|
||||||
|
.Sum(x => x.CostInsurance + x.InsuranceBonusLoss);
|
||||||
|
|
||||||
|
|
||||||
|
AcquisitionExpensesWithVAT = preparedValues.PlPriceWithVAT
|
||||||
|
+ nextCostInsurance
|
||||||
|
- preparedValues.ComissionRub * (decimal)(1 + _constants.VatValue)
|
||||||
|
- preparedValues.Discount.Next * (decimal)(1 + _constants.VatValue)
|
||||||
|
+ tracker * (decimal)(1 + _constants.VatValue)
|
||||||
|
+ tlm * (decimal)(1 + _constants.VatValue)
|
||||||
|
+ preparedValues.TechnicalCardSum * (decimal)(1 + _constants.VatValue)
|
||||||
|
+ baseRegistration * (decimal)(1 + _constants.VatValue)
|
||||||
|
+ preparedValues.TransportTaxGr.Next switch
|
||||||
|
{
|
||||||
|
> 0 => preparedValues.TransportTaxGr.Next,
|
||||||
|
_ => preparedValues.TransportTaxGr.Current
|
||||||
|
}
|
||||||
|
+ preparedValues.InceptDelta * (decimal)(1 + _constants.VatValue)
|
||||||
|
+ preparedValues.FuelCardSum * (decimal)(1 + _constants.VatValue);
|
||||||
|
}
|
||||||
|
|
||||||
public void ComputeBaseCost(TableInsuranceRow[]? nextTableInsurance,
|
public void ComputeBaseCost(TableInsuranceRow[]? nextTableInsurance,
|
||||||
BaseColumn<decimal>? nextTLMGrColumn, TablePaymentsRow[] currentTablePayments)
|
BaseColumn<decimal>? nextTLMGrColumn, TablePaymentsRow[] currentTablePayments)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -0,0 +1,80 @@
|
|||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using EvoCalculator.Core.Base.Columns;
|
||||||
|
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared;
|
||||||
|
using EvoCalculator.Core.PostCalculation.v1;
|
||||||
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
||||||
|
using EvoCalculator.Core.Tools.Array;
|
||||||
|
using EvoCalculator.Core.Tools.GroupColumns;
|
||||||
|
using EvoCalculator.Core.Tools.GroupColumns.Models;
|
||||||
|
|
||||||
|
namespace EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
||||||
|
|
||||||
|
public class CashflowMSFOWithCFColumn : BaseColumnWithSum
|
||||||
|
{
|
||||||
|
public DateTime[] Dates;
|
||||||
|
|
||||||
|
private PreparedValues _preparedValues;
|
||||||
|
private NextValues _nextValues;
|
||||||
|
private CashflowMSFOFinal2Column _cashflowMsfoFinal2Column;
|
||||||
|
private BaseColumn<decimal> _creditPaymentColumn;
|
||||||
|
private BaseColumn<decimal> _sumCreditColumn;
|
||||||
|
private BaseColumn<decimal> _VATRecoverableColumn;
|
||||||
|
private BaseColumn<DateTime> _nextDateTempColumn;
|
||||||
|
|
||||||
|
public CashflowMSFOWithCFColumn(int count, PreparedValues preparedValues,
|
||||||
|
CashflowMSFOFinal2Column cashflowMsfoFinal2Column, BaseColumn<decimal> creditPaymentColumn,
|
||||||
|
NextValues nextValues, BaseColumn<decimal> sumCreditColumn,
|
||||||
|
BaseColumn<decimal> vatRecoverableColumn, BaseColumn<DateTime> nextDateTempColumn) : base(count)
|
||||||
|
{
|
||||||
|
_preparedValues = preparedValues;
|
||||||
|
_cashflowMsfoFinal2Column = cashflowMsfoFinal2Column;
|
||||||
|
_creditPaymentColumn = creditPaymentColumn;
|
||||||
|
_nextValues = nextValues;
|
||||||
|
_sumCreditColumn = sumCreditColumn;
|
||||||
|
_VATRecoverableColumn = vatRecoverableColumn;
|
||||||
|
_nextDateTempColumn = nextDateTempColumn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ComputeValues()
|
||||||
|
{
|
||||||
|
Values = new[] { 0m, 0, 0 };
|
||||||
|
var groupCashflowMsfoFinal2Column = GroupColumns.Sum(new SumRules
|
||||||
|
{
|
||||||
|
Day = (int)DayRule.MinInGroup,
|
||||||
|
Value = ValueRule.Sum
|
||||||
|
},
|
||||||
|
GroupColumns.Create(_cashflowMsfoFinal2Column.Dates.Skip(1), _cashflowMsfoFinal2Column.Values.Skip(1)));
|
||||||
|
|
||||||
|
|
||||||
|
var splitedCashflowMsfoFinal2Column = GroupColumns.Split(groupCashflowMsfoFinal2Column);
|
||||||
|
Values[1] = splitedCashflowMsfoFinal2Column.Values[0] - _creditPaymentColumn.GetValue(1) -
|
||||||
|
_nextValues.AcquisitionExpensesWithVAT + _sumCreditColumn.GetValue(1);
|
||||||
|
|
||||||
|
var groupedCashflowMsfoFinal2Column = GroupColumns.CreateMatchedLength(
|
||||||
|
splitedCashflowMsfoFinal2Column.Dates.Skip(1), splitedCashflowMsfoFinal2Column.Values.Skip(1));
|
||||||
|
var groupedCreditPaymentColumn = GroupColumns.CreateMatchedLength(
|
||||||
|
_nextDateTempColumn.Values.Skip(2),
|
||||||
|
_creditPaymentColumn.Values.Select(x => -x).Skip(2));
|
||||||
|
var groupedVATRecoverableColumn = GroupColumns.CreateMatchedLength(
|
||||||
|
_nextDateTempColumn.Values.Skip(2), _VATRecoverableColumn.Values.Skip(2));
|
||||||
|
|
||||||
|
|
||||||
|
var group = GroupColumns.Sum(new SumRules
|
||||||
|
{
|
||||||
|
Day = (int)DayRule.Max,
|
||||||
|
Value = ValueRule.Sum
|
||||||
|
},
|
||||||
|
groupedCashflowMsfoFinal2Column,
|
||||||
|
groupedCreditPaymentColumn,
|
||||||
|
groupedVATRecoverableColumn
|
||||||
|
);
|
||||||
|
|
||||||
|
Dates = Array<DateTime>.Concat(
|
||||||
|
new[] { splitedCashflowMsfoFinal2Column.Dates[0], splitedCashflowMsfoFinal2Column.Dates[0] },
|
||||||
|
GroupColumns.Split(group).Dates);
|
||||||
|
Values = Array<decimal>.Concat(new[] { 0, Values[1] }, GroupColumns.Split(group).Values);
|
||||||
|
|
||||||
|
Values[0] = Sum;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
using EvoCalculator.Core.Base.Columns;
|
||||||
|
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared;
|
||||||
|
|
||||||
|
namespace EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
||||||
|
|
||||||
|
public class CreditPaymentColumn : BaseColumnWithSum
|
||||||
|
{
|
||||||
|
public CreditPaymentColumn(int count) : base(count)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ComputeValues(PreparedValues preparedValues, BaseColumn<decimal> nextSumCreditColumn,
|
||||||
|
BaseColumn<decimal> nextCreditColumn)
|
||||||
|
{
|
||||||
|
Values[0] = 0;
|
||||||
|
if (preparedValues.FundingRate > 0)
|
||||||
|
{
|
||||||
|
Values[1] = -nextCreditColumn.GetValue(1);
|
||||||
|
for (var i = 2; i < Values.Length; i++)
|
||||||
|
{
|
||||||
|
Values[i] = -nextCreditColumn.GetValue(i) + nextSumCreditColumn.GetValue(i - 1) -
|
||||||
|
nextSumCreditColumn.GetValue(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Values[0] = Sum;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
using System.Linq;
|
||||||
|
using EvoCalculator.Core.Base.Columns;
|
||||||
|
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared;
|
||||||
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
||||||
|
using EvoCalculator.Core.Tools.GroupColumns;
|
||||||
|
using EvoCalculator.Core.Tools.GroupColumns.Models;
|
||||||
|
|
||||||
|
namespace EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
||||||
|
|
||||||
|
public class PIColumn : BaseColumnWithNPV
|
||||||
|
{
|
||||||
|
private PreparedValues _preparedValues;
|
||||||
|
private CashflowMSFOFinal2Column _cashflowMsfoFinal2Column;
|
||||||
|
private BaseColumn<decimal> _cashflowMsfoWithCfColumn;
|
||||||
|
|
||||||
|
public PIColumn(int count, CashflowMSFOFinal2Column cashflowMsfoFinal2Column,
|
||||||
|
BaseColumn<decimal> cashflowMsfoWithCfColumn, PreparedValues preparedValues) : base(count)
|
||||||
|
{
|
||||||
|
_cashflowMsfoFinal2Column = cashflowMsfoFinal2Column;
|
||||||
|
_cashflowMsfoWithCfColumn = cashflowMsfoWithCfColumn;
|
||||||
|
_preparedValues = preparedValues;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ComputeValues()
|
||||||
|
{
|
||||||
|
for (var i = 1; i < Values.Length; i++)
|
||||||
|
{
|
||||||
|
Values[i] = NPV(_cashflowMsfoWithCfColumn.Values.Skip(1).Take(i), _preparedValues.FundingRate);
|
||||||
|
}
|
||||||
|
|
||||||
|
Values[0] = -Values[^1] / (_cashflowMsfoFinal2Column.GetValue(0) +
|
||||||
|
_cashflowMsfoFinal2Column.GetValue(1));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
using EvoCalculator.Core.Base.Columns;
|
||||||
|
|
||||||
|
namespace EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
||||||
|
|
||||||
|
public class BaseSumCreditColumn: BaseColumn<decimal>
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
@ -3,19 +3,21 @@ using EvoCalculator.Core.Models.PostCalculation.Models.Prepared;
|
|||||||
|
|
||||||
namespace EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
namespace EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
||||||
|
|
||||||
public class SumCreditColumn : BaseColumn<decimal>
|
public class SumCreditColumnVT1 : BaseColumn<decimal>
|
||||||
{
|
{
|
||||||
public SumCreditColumn(int count) : base(count)
|
public SumCreditColumnVT1(int count) : base(count)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ComputeValues(PreparedValues preparedValues, BaseColumn<decimal> nextSumWithVATColumn)
|
public void ComputeValues(PreparedValues preparedValues, BaseColumn<decimal> nextSumWithVATColumn)
|
||||||
{
|
{
|
||||||
Values[1] = Values[2] = preparedValues.PlPriceWithVAT - nextSumWithVATColumn.GetValue(1);
|
Values[1] = Values[2] = preparedValues.FundingRate > 0
|
||||||
|
? preparedValues.PlPriceWithVAT - nextSumWithVATColumn.GetValue(1)
|
||||||
|
: 0;
|
||||||
|
|
||||||
for (var i = 3; i < Values.Length; i++)
|
for (var i = 2; i < Values.Length; i++)
|
||||||
if (GetValue(i - 1) > 0)
|
if (GetValue(i - 1) > 0)
|
||||||
Values[i] = GetValue(i - 1) - GetValue(2) / preparedValues.LoanRatePeriod;
|
Values[i] = GetValue(i - 1) - GetValue(1) / preparedValues.LoanRatePeriod;
|
||||||
else
|
else
|
||||||
Values[i] = 0;
|
Values[i] = 0;
|
||||||
}
|
}
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
using System.Linq;
|
||||||
|
using EvoCalculator.Core.Base.Columns;
|
||||||
|
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared;
|
||||||
|
|
||||||
|
namespace EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
||||||
|
|
||||||
|
public class SumCreditColumnVT2 : SumCreditColumnVT1
|
||||||
|
{
|
||||||
|
public SumCreditColumnVT2(int count) : base(count)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ComputeValues(PreparedValues preparedValues, BaseColumn<decimal> nextSumWithVATColumn)
|
||||||
|
{
|
||||||
|
base.ComputeValues(preparedValues, nextSumWithVATColumn);
|
||||||
|
|
||||||
|
if (preparedValues.LoanRatePeriod > preparedValues.Nmper.Next)
|
||||||
|
{
|
||||||
|
Values[preparedValues.Nmper.Next + 1] = Values.Skip(preparedValues.Nmper.Next + 1).Sum();
|
||||||
|
for (var i = preparedValues.Nmper.Next + 1 + 1; i < Values.Length; i++)
|
||||||
|
{
|
||||||
|
Values[i] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,119 @@
|
|||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using EvoCalculator.Core.Base.Columns;
|
||||||
|
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared;
|
||||||
|
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared.PreparedTables;
|
||||||
|
using EvoCalculator.Core.PostCalculation.v1;
|
||||||
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
||||||
|
using EvoCalculator.Core.Tools.Array;
|
||||||
|
using TridentGoalSeek;
|
||||||
|
|
||||||
|
namespace EvoCalculator.Core.PostCalculation.v2.Columns.Next
|
||||||
|
{
|
||||||
|
public class SumIRRColumn : BaseColumnWithXIRR, IGoalSeekAlgorithm
|
||||||
|
{
|
||||||
|
protected readonly NextValues _nextValues;
|
||||||
|
protected readonly PreparedValues _preparedValues;
|
||||||
|
protected readonly BaseSumColumn _sumColumn;
|
||||||
|
protected readonly TablePaymentsRow[] _currentTablePayments;
|
||||||
|
protected readonly BaseColumn<DateTime> _dateTempColumn;
|
||||||
|
protected readonly BaseColumn<DateTime> _currentDateTempColumn;
|
||||||
|
protected readonly TableInsuranceRow[] _nextTableInsurance;
|
||||||
|
|
||||||
|
public SumIRRColumn(int count, BaseColumn<DateTime> dateTempColumn, BaseColumn<DateTime> currentDateTempColumn,
|
||||||
|
PreparedValues preparedValues,
|
||||||
|
NextValues nextValues, TablePaymentsRow[] currentTablePayments,
|
||||||
|
TableInsuranceRow[] nextTableInsurance, BaseSumColumn sumColumn
|
||||||
|
) : base(count, dateTempColumn)
|
||||||
|
{
|
||||||
|
_dateTempColumn = dateTempColumn;
|
||||||
|
_preparedValues = preparedValues;
|
||||||
|
_nextValues = nextValues;
|
||||||
|
_currentTablePayments = currentTablePayments;
|
||||||
|
_nextTableInsurance = nextTableInsurance;
|
||||||
|
_sumColumn = sumColumn;
|
||||||
|
_currentDateTempColumn = currentDateTempColumn;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FillValues()
|
||||||
|
{
|
||||||
|
var costInsurances = Array.Empty<decimal>();
|
||||||
|
|
||||||
|
if (_nextTableInsurance != null)
|
||||||
|
{
|
||||||
|
costInsurances = _nextTableInsurance
|
||||||
|
.Where(ins =>
|
||||||
|
ins.PeriodNumberInsurance > 1
|
||||||
|
&& (ins.TypeRiskInsurance is "KASKO" or "OSAGO" or "GAP" or "EvoKASKO")
|
||||||
|
)
|
||||||
|
.OrderBy(x => x.TypeRiskInsurance)
|
||||||
|
.Select(x => -(x.CostInsurance + x.InsuranceBonusLoss))
|
||||||
|
.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
Values = Array<decimal>.Concat(
|
||||||
|
new[] { -_nextValues.BaseCost - _preparedValues.FuelCardSum + costInsurances.Sum() },
|
||||||
|
_sumColumn.Values.Skip(1),
|
||||||
|
costInsurances
|
||||||
|
);
|
||||||
|
|
||||||
|
var dateStartPeriodInsurances = Array.Empty<DateTime>();
|
||||||
|
|
||||||
|
if (_nextTableInsurance != null)
|
||||||
|
{
|
||||||
|
dateStartPeriodInsurances = _nextTableInsurance
|
||||||
|
.Where(ins =>
|
||||||
|
ins.PeriodNumberInsurance > 1
|
||||||
|
&& (ins.TypeRiskInsurance is "KASKO" or "OSAGO" or "GAP" or "EvoKASKO")
|
||||||
|
)
|
||||||
|
.OrderBy(x => x.TypeRiskInsurance)
|
||||||
|
.Select(x => x.DateStartPeriodInsurance)
|
||||||
|
.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
Dates = Array<DateTime>.Concat(
|
||||||
|
_dateTempColumn.Values,
|
||||||
|
dateStartPeriodInsurances
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
var lastDateTempValue = _dateTempColumn.Values.Last();
|
||||||
|
var lastCurrentDateTempValue = _currentDateTempColumn.Values.Last();
|
||||||
|
var evoKasko = _nextTableInsurance.FirstOrDefault(x => x.TypeRiskInsurance == "EvoKASKO");
|
||||||
|
|
||||||
|
if (evoKasko != null &&
|
||||||
|
new DateTime(lastDateTempValue.Year, lastDateTempValue.Month, 1) >
|
||||||
|
new DateTime(lastCurrentDateTempValue.Year, lastCurrentDateTempValue.Month, 1))
|
||||||
|
{
|
||||||
|
var evoKaskoSum = -((evoKasko.CostInsurance + evoKasko.InsuranceBonusLoss) / 12) *
|
||||||
|
((lastDateTempValue.Year - lastCurrentDateTempValue.Year) * 12 +
|
||||||
|
lastDateTempValue.Month - lastCurrentDateTempValue.Month);
|
||||||
|
Values = Values.Append(evoKaskoSum).ToArray();
|
||||||
|
Dates = Dates.Append(_currentDateTempColumn.Values.Last().AddDays(1)).ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public decimal Calculate(decimal inputVariable)
|
||||||
|
{
|
||||||
|
_sumColumn.ComputeValues(inputVariable);
|
||||||
|
FillValues();
|
||||||
|
return (decimal)IRR;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ComputeValues(decimal requiredValue)
|
||||||
|
{
|
||||||
|
var goalSeek = new GoalSeek(this);
|
||||||
|
|
||||||
|
// Чтобы IRR не получился меньше заданного
|
||||||
|
goalSeek.SeekResult(requiredValue + 0.00001m,
|
||||||
|
new GoalSeekOptions(
|
||||||
|
startingStabPoint:
|
||||||
|
(_nextValues.BaseCost - _currentTablePayments[0].SumPayment) /
|
||||||
|
(_preparedValues.Nmper.Next - 1),
|
||||||
|
maximumAttempts: 1000,
|
||||||
|
initialTineSpacing: 100
|
||||||
|
// , focusPercentage: 50
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
using System.Linq;
|
||||||
|
using EvoCalculator.Core.Base.Columns;
|
||||||
|
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared;
|
||||||
|
|
||||||
|
namespace EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
||||||
|
|
||||||
|
public class VATRecoverableColumn : BaseColumnWithSum
|
||||||
|
{
|
||||||
|
private Constants.Calculation constans;
|
||||||
|
private decimal _vatRecoverable = 0m;
|
||||||
|
private decimal _tracker = 0m;
|
||||||
|
private decimal _tlm = 0m;
|
||||||
|
|
||||||
|
|
||||||
|
public VATRecoverableColumn(int count, PreparedValues preparedValues) : base(count)
|
||||||
|
{
|
||||||
|
this.constans = new Constants.Calculation();
|
||||||
|
|
||||||
|
if (preparedValues.ChangeTracker == false)
|
||||||
|
_tracker = preparedValues.TrackerCost.Current;
|
||||||
|
else if (preparedValues.TypeChangeTracker == 100000000)
|
||||||
|
_tracker = preparedValues.TrackerCost.Current + preparedValues.TrackerCost.Next;
|
||||||
|
else
|
||||||
|
_tracker = preparedValues.TrackerCostRemove + preparedValues.TrackerCost.Next;
|
||||||
|
|
||||||
|
if (preparedValues.ChangeTLM == false)
|
||||||
|
_tlm = preparedValues.TLMCost.Current;
|
||||||
|
else if (preparedValues.TypeChangeTLM == 100000000)
|
||||||
|
_tlm = preparedValues.TLMCost.Current + preparedValues.TLMCost.Next;
|
||||||
|
else
|
||||||
|
_tlm = preparedValues.TLMCostRemove + preparedValues.TLMCost.Next;
|
||||||
|
|
||||||
|
|
||||||
|
_vatRecoverable = preparedValues.PlPriceVAT +
|
||||||
|
(_tlm + _tracker + preparedValues.TechnicalCardSum) *
|
||||||
|
(decimal)(1 + this.constans.VatValue) -
|
||||||
|
(_tlm + _tracker + preparedValues.TechnicalCardSum);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void ComputeValues(BaseColumn<decimal> nextVATColumn)
|
||||||
|
{
|
||||||
|
Values[0] = 0;
|
||||||
|
|
||||||
|
for (var i = 6; i < Values.Length; i += 3)
|
||||||
|
{
|
||||||
|
var vatSum = nextVATColumn.Values.Skip(1).Take(i).Sum();
|
||||||
|
var vatRecoverableSum = this.Values.Skip(1).Take(i - 1).Sum();
|
||||||
|
Values[i] = vatSum < this._vatRecoverable
|
||||||
|
? vatSum - vatRecoverableSum
|
||||||
|
: this._vatRecoverable - vatRecoverableSum;
|
||||||
|
}
|
||||||
|
|
||||||
|
Values[0] = Sum;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,13 +1,13 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
||||||
|
using EvoCalculator.Core.PostCalculation.Tools;
|
||||||
using EvoCalculator.Core.PostCalculation.v1;
|
using EvoCalculator.Core.PostCalculation.v1;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
||||||
using EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
using EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
||||||
using DateTempColumn = EvoCalculator.Core.PostCalculation.v1.Columns.Next.DateTempColumn;
|
using DateTempColumn = EvoCalculator.Core.PostCalculation.v1.Columns.Next.DateTempColumn;
|
||||||
using SumCreditColumn = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumCreditColumn;
|
|
||||||
using SumVATCreditColumn = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumVATCreditColumn;
|
using SumVATCreditColumn = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumVATCreditColumn;
|
||||||
using SumRepaymentColumnVT1 = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumRepaymentColumnVT1;
|
using SumRepaymentColumnVT1 = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumRepaymentColumnVT1;
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ namespace EvoCalculator.Core.PostCalculation.v2.Managers;
|
|||||||
public static partial class CalculateManager
|
public static partial class CalculateManager
|
||||||
{
|
{
|
||||||
public static ManagerResult CalculateByIRRAndSum(RequestCalculation requestCalculation)
|
public static ManagerResult CalculateByIRRAndSum(RequestCalculation requestCalculation)
|
||||||
{
|
{ new Validation().ValidateRequest(requestCalculation);
|
||||||
var constants = new Constants.Calculation();
|
var constants = new Constants.Calculation();
|
||||||
var preparedValues = requestCalculation.PreparedValues;
|
var preparedValues = requestCalculation.PreparedValues;
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ public static partial class CalculateManager
|
|||||||
currentDateTempColumn.ComputeValues(preparedValues, currentDateColumn);
|
currentDateTempColumn.ComputeValues(preparedValues, currentDateColumn);
|
||||||
|
|
||||||
var currentSumColumn = new SumColumn(preparedValues.Nmper.Current + 1, currentDateTempColumn);
|
var currentSumColumn = new SumColumn(preparedValues.Nmper.Current + 1, currentDateTempColumn);
|
||||||
currentSumColumn.ComputeValues(preparedValues, currentTablePayments);
|
currentSumColumn.ComputeValues(preparedValues, currentTablePayments, currentTableInsurance);
|
||||||
/*
|
/*
|
||||||
* CURRENT
|
* CURRENT
|
||||||
*/
|
*/
|
||||||
@ -80,9 +80,14 @@ public static partial class CalculateManager
|
|||||||
nextValues.ComputeBaseCost(nextTableInsurance, techNextTlmGrColumn, currentTablePayments);
|
nextValues.ComputeBaseCost(nextTableInsurance, techNextTlmGrColumn, currentTablePayments);
|
||||||
|
|
||||||
|
|
||||||
var techNextSumColumn = new SumColumnVT1(preparedValues.Nmper.Next + 1, techNextDateTempColumn,
|
var techNextSumColumn = new SumColumnVT2(preparedValues.Nmper.Next + 1, techNextDateTempColumn,
|
||||||
preparedValues, nextValues, currentTablePayments, nextTablePayments);
|
preparedValues, nextValues, currentTablePayments, nextTablePayments);
|
||||||
techNextSumColumn.ComputeValues((decimal)currentSumColumn.IRR);
|
|
||||||
|
var techSumIRRColumn = new SumIRRColumn(0, techNextDateTempColumn, currentDateTempColumn, preparedValues,
|
||||||
|
nextValues,
|
||||||
|
currentTablePayments,
|
||||||
|
nextTableInsurance, techNextSumColumn);
|
||||||
|
techSumIRRColumn.ComputeValues((decimal)currentSumColumn.IRR + preparedValues.IRRDelta);
|
||||||
|
|
||||||
var techNextVATColumn = new VATColumnVT1(preparedValues.Nmper.Next + 1);
|
var techNextVATColumn = new VATColumnVT1(preparedValues.Nmper.Next + 1);
|
||||||
techNextVATColumn.ComputeValues(preparedValues, techNextSumColumn, currentTablePayments, constants);
|
techNextVATColumn.ComputeValues(preparedValues, techNextSumColumn, currentTablePayments, constants);
|
||||||
@ -91,8 +96,8 @@ public static partial class CalculateManager
|
|||||||
techNextSumColumn, currentTablePayments, techNextVATColumn, constants);
|
techNextSumColumn, currentTablePayments, techNextVATColumn, constants);
|
||||||
techNextSumWithVATColumn.ComputeValues();
|
techNextSumWithVATColumn.ComputeValues();
|
||||||
/*
|
/*
|
||||||
* TECH
|
* TECH
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NEXT
|
* NEXT
|
||||||
@ -156,7 +161,7 @@ public static partial class CalculateManager
|
|||||||
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
||||||
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
||||||
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
||||||
nextTlmDateColumn);
|
nextTlmDateColumn, currentDateTempColumn);
|
||||||
|
|
||||||
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
||||||
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
||||||
@ -177,7 +182,7 @@ public static partial class CalculateManager
|
|||||||
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
||||||
|
|
||||||
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
||||||
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance);
|
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance, currentDateTempColumn);
|
||||||
|
|
||||||
var nextSumCurrentInterestColumn =
|
var nextSumCurrentInterestColumn =
|
||||||
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
||||||
@ -201,7 +206,7 @@ public static partial class CalculateManager
|
|||||||
nextCashflowMSFOFinal2Column.ComputeValues(nextCashflowMSFOFinalColumn, nextDateTempColumn,
|
nextCashflowMSFOFinal2Column.ComputeValues(nextCashflowMSFOFinalColumn, nextDateTempColumn,
|
||||||
preparedValues);
|
preparedValues);
|
||||||
|
|
||||||
var nextSumCreditColumn = new SumCreditColumn(preparedValues.LoanRatePeriod + 2);
|
var nextSumCreditColumn = new SumCreditColumnVT1(preparedValues.LoanRatePeriod + 2);
|
||||||
nextSumCreditColumn.ComputeValues(preparedValues, nextSumWithVATColumn);
|
nextSumCreditColumn.ComputeValues(preparedValues, nextSumWithVATColumn);
|
||||||
|
|
||||||
var nextCreditColumn = new CreditColumn(preparedValues.LoanRatePeriod + 4);
|
var nextCreditColumn = new CreditColumn(preparedValues.LoanRatePeriod + 4);
|
||||||
@ -222,6 +227,21 @@ public static partial class CalculateManager
|
|||||||
var nextCashflowNSIBColumn = new CashflowNSIBColumn(nextValues.Nmper + 1);
|
var nextCashflowNSIBColumn = new CashflowNSIBColumn(nextValues.Nmper + 1);
|
||||||
nextCashflowNSIBColumn.ComputeValues(nextNSIBBruttoGrColumn, nextRevenueColumn);
|
nextCashflowNSIBColumn.ComputeValues(nextNSIBBruttoGrColumn, nextRevenueColumn);
|
||||||
|
|
||||||
|
var nextCreditPaymentColumn = new CreditPaymentColumn(preparedValues.LoanRatePeriod + 4);
|
||||||
|
nextCreditPaymentColumn.ComputeValues(preparedValues, nextSumCreditColumn, nextCreditColumn);
|
||||||
|
|
||||||
|
var nextVATRecoverableColumn = new VATRecoverableColumn(64, preparedValues);
|
||||||
|
nextVATRecoverableColumn.ComputeValues(nextVATColumn);
|
||||||
|
|
||||||
|
nextValues.ComputeAcquisitionExpensesWithVAT(nextTableInsurance);
|
||||||
|
|
||||||
|
var nextCashflowMSFOWithCFColumn = new CashflowMSFOWithCFColumn(0, preparedValues, nextCashflowMSFOFinal2Column,
|
||||||
|
nextCreditPaymentColumn, nextValues, nextSumCreditColumn, nextVATRecoverableColumn, nextDateTempColumn);
|
||||||
|
nextCashflowMSFOWithCFColumn.ComputeValues();
|
||||||
|
|
||||||
|
var nextPiColumn = new PIColumn(61, nextCashflowMSFOFinal2Column, nextCashflowMSFOWithCFColumn, preparedValues);
|
||||||
|
nextPiColumn.ComputeValues();
|
||||||
|
|
||||||
|
|
||||||
nextValues.ComputeNiAtInception(currentTablePayments);
|
nextValues.ComputeNiAtInception(currentTablePayments);
|
||||||
nextValues.ComputeNiAtInceptionMSFO();
|
nextValues.ComputeNiAtInceptionMSFO();
|
||||||
@ -251,6 +271,7 @@ public static partial class CalculateManager
|
|||||||
techNextTlmCostColumn,
|
techNextTlmCostColumn,
|
||||||
techNextTlmGrColumn,
|
techNextTlmGrColumn,
|
||||||
techNextSumColumn,
|
techNextSumColumn,
|
||||||
|
techSumIRRColumn,
|
||||||
techNextVATColumn,
|
techNextVATColumn,
|
||||||
techNextSumWithVATColumn,
|
techNextSumWithVATColumn,
|
||||||
|
|
||||||
@ -282,7 +303,11 @@ public static partial class CalculateManager
|
|||||||
nextCreditVATColumn,
|
nextCreditVATColumn,
|
||||||
nextNSIBExpensesColumn,
|
nextNSIBExpensesColumn,
|
||||||
nextCashflowNSIBColumn,
|
nextCashflowNSIBColumn,
|
||||||
nextRevenueColumn
|
nextRevenueColumn,
|
||||||
|
nextCreditPaymentColumn,
|
||||||
|
nextVATRecoverableColumn,
|
||||||
|
nextCashflowMSFOWithCFColumn,
|
||||||
|
nextPiColumn,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
||||||
|
using EvoCalculator.Core.PostCalculation.Tools;
|
||||||
using EvoCalculator.Core.PostCalculation.v1;
|
using EvoCalculator.Core.PostCalculation.v1;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
||||||
using EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
using EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
||||||
using DateTempColumn = EvoCalculator.Core.PostCalculation.v1.Columns.Current.DateTempColumn;
|
using DateTempColumn = EvoCalculator.Core.PostCalculation.v1.Columns.Current.DateTempColumn;
|
||||||
using SumCreditColumn = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumCreditColumn;
|
|
||||||
using SumRepaymentColumnVT1 = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumRepaymentColumnVT1;
|
using SumRepaymentColumnVT1 = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumRepaymentColumnVT1;
|
||||||
|
|
||||||
namespace EvoCalculator.Core.PostCalculation.v2.Managers;
|
namespace EvoCalculator.Core.PostCalculation.v2.Managers;
|
||||||
@ -15,7 +15,7 @@ namespace EvoCalculator.Core.PostCalculation.v2.Managers;
|
|||||||
public static partial class CalculateManager
|
public static partial class CalculateManager
|
||||||
{
|
{
|
||||||
public static ManagerResult CalculateByIRRNoLimit(RequestCalculation requestCalculation)
|
public static ManagerResult CalculateByIRRNoLimit(RequestCalculation requestCalculation)
|
||||||
{
|
{ new Validation().ValidateRequest(requestCalculation);
|
||||||
var constants = new Constants.Calculation();
|
var constants = new Constants.Calculation();
|
||||||
var preparedValues = requestCalculation.PreparedValues;
|
var preparedValues = requestCalculation.PreparedValues;
|
||||||
|
|
||||||
@ -30,8 +30,8 @@ public static partial class CalculateManager
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CURRENT
|
* CURRENT
|
||||||
*/
|
*/
|
||||||
var currentDateColumn = new DateColumn(preparedValues.Nmper.Current + 1);
|
var currentDateColumn = new DateColumn(preparedValues.Nmper.Current + 1);
|
||||||
currentDateColumn.ComputeValues(currentTablePayments);
|
currentDateColumn.ComputeValues(currentTablePayments);
|
||||||
|
|
||||||
@ -40,15 +40,15 @@ public static partial class CalculateManager
|
|||||||
currentDateTempColumn.ComputeValues(preparedValues, currentDateColumn);
|
currentDateTempColumn.ComputeValues(preparedValues, currentDateColumn);
|
||||||
|
|
||||||
var currentSumColumn = new SumColumn(preparedValues.Nmper.Current + 1, currentDateTempColumn);
|
var currentSumColumn = new SumColumn(preparedValues.Nmper.Current + 1, currentDateTempColumn);
|
||||||
currentSumColumn.ComputeValues(preparedValues, currentTablePayments);
|
currentSumColumn.ComputeValues(preparedValues, currentTablePayments, currentTableInsurance);
|
||||||
/*
|
/*
|
||||||
* CURRENT
|
* CURRENT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NEXT
|
* NEXT
|
||||||
*/
|
*/
|
||||||
var nextDateColumn = new DateColumnVT1(preparedValues.Nmper.Next + 1);
|
var nextDateColumn = new DateColumnVT1(preparedValues.Nmper.Next + 1);
|
||||||
nextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
nextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
||||||
|
|
||||||
@ -82,9 +82,13 @@ public static partial class CalculateManager
|
|||||||
currentTablePayments);
|
currentTablePayments);
|
||||||
|
|
||||||
|
|
||||||
var nextSumColumn = new SumColumnVT1(preparedValues.Nmper.Next + 1, nextDateTempColumn,
|
var nextSumColumn = new SumColumnVT2(preparedValues.Nmper.Next + 1, nextDateTempColumn,
|
||||||
preparedValues, nextValues, currentTablePayments, nextTablePayments);
|
preparedValues, nextValues, currentTablePayments, nextTablePayments);
|
||||||
nextSumColumn.ComputeValues((decimal)currentSumColumn.IRR + preparedValues.IRRDelta);
|
|
||||||
|
var sumIRRColumn = new SumIRRColumn(0, nextDateTempColumn, currentDateColumn, preparedValues, nextValues,
|
||||||
|
currentTablePayments,
|
||||||
|
nextTableInsurance, nextSumColumn);
|
||||||
|
sumIRRColumn.ComputeValues((decimal)currentSumColumn.IRR + preparedValues.IRRDelta);
|
||||||
nextSumColumn.PostCheck();
|
nextSumColumn.PostCheck();
|
||||||
nextSumColumn.RoundValues();
|
nextSumColumn.RoundValues();
|
||||||
|
|
||||||
@ -104,7 +108,7 @@ public static partial class CalculateManager
|
|||||||
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
||||||
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
||||||
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
||||||
nextTlmDateColumn);
|
nextTlmDateColumn, currentDateTempColumn);
|
||||||
|
|
||||||
var nextVATColumn = new VATColumnVT1(preparedValues.Nmper.Next + 1);
|
var nextVATColumn = new VATColumnVT1(preparedValues.Nmper.Next + 1);
|
||||||
nextVATColumn.ComputeValues(preparedValues, nextSumColumn, currentTablePayments, constants);
|
nextVATColumn.ComputeValues(preparedValues, nextSumColumn, currentTablePayments, constants);
|
||||||
@ -133,7 +137,7 @@ public static partial class CalculateManager
|
|||||||
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
||||||
|
|
||||||
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
||||||
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance);
|
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance, currentDateTempColumn);
|
||||||
|
|
||||||
var nextSumCurrentInterestColumn =
|
var nextSumCurrentInterestColumn =
|
||||||
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
||||||
@ -157,7 +161,7 @@ public static partial class CalculateManager
|
|||||||
nextCashflowMSFOFinal2Column.ComputeValues(nextCashflowMSFOFinalColumn, nextDateTempColumn,
|
nextCashflowMSFOFinal2Column.ComputeValues(nextCashflowMSFOFinalColumn, nextDateTempColumn,
|
||||||
preparedValues);
|
preparedValues);
|
||||||
|
|
||||||
var nextSumCreditColumn = new SumCreditColumn(preparedValues.LoanRatePeriod + 2);
|
var nextSumCreditColumn = new SumCreditColumnVT1(preparedValues.LoanRatePeriod + 2);
|
||||||
nextSumCreditColumn.ComputeValues(preparedValues, nextSumWithVATColumn);
|
nextSumCreditColumn.ComputeValues(preparedValues, nextSumWithVATColumn);
|
||||||
|
|
||||||
var nextCreditColumn = new CreditColumn(preparedValues.LoanRatePeriod + 4);
|
var nextCreditColumn = new CreditColumn(preparedValues.LoanRatePeriod + 4);
|
||||||
@ -179,12 +183,26 @@ public static partial class CalculateManager
|
|||||||
var nextCashflowNSIBColumn = new CashflowNSIBColumn(nextValues.Nmper + 1);
|
var nextCashflowNSIBColumn = new CashflowNSIBColumn(nextValues.Nmper + 1);
|
||||||
nextCashflowNSIBColumn.ComputeValues(nextNSIBBruttoGrColumn, nextRevenueColumn);
|
nextCashflowNSIBColumn.ComputeValues(nextNSIBBruttoGrColumn, nextRevenueColumn);
|
||||||
|
|
||||||
|
var nextCreditPaymentColumn = new CreditPaymentColumn(preparedValues.LoanRatePeriod + 4);
|
||||||
|
nextCreditPaymentColumn.ComputeValues(preparedValues, nextSumCreditColumn, nextCreditColumn);
|
||||||
|
|
||||||
|
var nextVATRecoverableColumn = new VATRecoverableColumn(64, preparedValues);
|
||||||
|
nextVATRecoverableColumn.ComputeValues(nextVATColumn);
|
||||||
|
|
||||||
|
nextValues.ComputeAcquisitionExpensesWithVAT(nextTableInsurance);
|
||||||
|
|
||||||
|
var nextCashflowMSFOWithCFColumn = new CashflowMSFOWithCFColumn(0, preparedValues, nextCashflowMSFOFinal2Column,
|
||||||
|
nextCreditPaymentColumn, nextValues, nextSumCreditColumn, nextVATRecoverableColumn, nextDateTempColumn);
|
||||||
|
nextCashflowMSFOWithCFColumn.ComputeValues();
|
||||||
|
|
||||||
|
var nextPiColumn = new PIColumn(61, nextCashflowMSFOFinal2Column, nextCashflowMSFOWithCFColumn, preparedValues);
|
||||||
|
nextPiColumn.ComputeValues();
|
||||||
|
|
||||||
nextValues.ComputeNiAtInception(currentTablePayments);
|
nextValues.ComputeNiAtInception(currentTablePayments);
|
||||||
nextValues.ComputeNiAtInceptionMSFO();
|
nextValues.ComputeNiAtInceptionMSFO();
|
||||||
/*
|
/*
|
||||||
* NEXT
|
* NEXT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var postValues = new v2.PostValues(preparedValues);
|
var postValues = new v2.PostValues(preparedValues);
|
||||||
postValues.ComputeContractEconomy(nextCashflowMSFOColumn, nextCreditColumn);
|
postValues.ComputeContractEconomy(nextCashflowMSFOColumn, nextCreditColumn);
|
||||||
@ -208,6 +226,7 @@ public static partial class CalculateManager
|
|||||||
nextTlmCostColumn,
|
nextTlmCostColumn,
|
||||||
nextTlmGrColumn,
|
nextTlmGrColumn,
|
||||||
nextSumColumn,
|
nextSumColumn,
|
||||||
|
sumIRRColumn,
|
||||||
nextNSIBBruttoGrColumn,
|
nextNSIBBruttoGrColumn,
|
||||||
nextSubsidyExpensesColumn,
|
nextSubsidyExpensesColumn,
|
||||||
nextCashflowMSFOColumn,
|
nextCashflowMSFOColumn,
|
||||||
@ -230,7 +249,11 @@ public static partial class CalculateManager
|
|||||||
nextCreditVATColumn,
|
nextCreditVATColumn,
|
||||||
nextNSIBExpensesColumn,
|
nextNSIBExpensesColumn,
|
||||||
nextCashflowNSIBColumn,
|
nextCashflowNSIBColumn,
|
||||||
nextRevenueColumn
|
nextRevenueColumn,
|
||||||
|
nextCreditPaymentColumn,
|
||||||
|
nextVATRecoverableColumn,
|
||||||
|
nextCashflowMSFOWithCFColumn,
|
||||||
|
nextPiColumn,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
||||||
|
using EvoCalculator.Core.PostCalculation.Tools;
|
||||||
using EvoCalculator.Core.PostCalculation.v1;
|
using EvoCalculator.Core.PostCalculation.v1;
|
||||||
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
||||||
using EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
using EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
||||||
using SumCreditColumn = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumCreditColumn;
|
using DateTempColumn = EvoCalculator.Core.PostCalculation.v1.Columns.Next.DateTempColumn;
|
||||||
using SumRepaymentColumnVT1 = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumRepaymentColumnVT1;
|
using SumRepaymentColumnVT1 = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumRepaymentColumnVT1;
|
||||||
|
|
||||||
namespace EvoCalculator.Core.PostCalculation.v2.Managers;
|
namespace EvoCalculator.Core.PostCalculation.v2.Managers;
|
||||||
@ -13,7 +15,7 @@ namespace EvoCalculator.Core.PostCalculation.v2.Managers;
|
|||||||
public static partial class CalculateManager
|
public static partial class CalculateManager
|
||||||
{
|
{
|
||||||
public static ManagerResult CalculateByTotalExpected(RequestCalculation requestCalculation)
|
public static ManagerResult CalculateByTotalExpected(RequestCalculation requestCalculation)
|
||||||
{
|
{ new Validation().ValidateRequest(requestCalculation);
|
||||||
var constants = new Constants.Calculation();
|
var constants = new Constants.Calculation();
|
||||||
var preparedValues = requestCalculation.PreparedValues;
|
var preparedValues = requestCalculation.PreparedValues;
|
||||||
|
|
||||||
@ -25,9 +27,24 @@ public static partial class CalculateManager
|
|||||||
|
|
||||||
var currentTableTLMTracker = requestCalculation?.TableTLMTracker?.Current;
|
var currentTableTLMTracker = requestCalculation?.TableTLMTracker?.Current;
|
||||||
var nextTableTLMTracker = requestCalculation?.TableTLMTracker?.Next;
|
var nextTableTLMTracker = requestCalculation?.TableTLMTracker?.Next;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NEXT
|
* CURRENT
|
||||||
*/
|
*/
|
||||||
|
var currentDateColumn = new DateColumn(preparedValues.Nmper.Current + 1);
|
||||||
|
currentDateColumn.ComputeValues(currentTablePayments);
|
||||||
|
|
||||||
|
var currentDateTempColumn =
|
||||||
|
new DateTempColumn(preparedValues.Nmper.Current + 1);
|
||||||
|
currentDateTempColumn.ComputeValues(preparedValues, currentDateColumn);
|
||||||
|
/*
|
||||||
|
* CURRENT
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NEXT
|
||||||
|
*/
|
||||||
var nextDateColumn = new DateColumnVT1(preparedValues.Nmper.Next + 1);
|
var nextDateColumn = new DateColumnVT1(preparedValues.Nmper.Next + 1);
|
||||||
nextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
nextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
||||||
|
|
||||||
@ -88,7 +105,7 @@ public static partial class CalculateManager
|
|||||||
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
||||||
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
||||||
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
||||||
nextTlmDateColumn);
|
nextTlmDateColumn, currentDateTempColumn);
|
||||||
|
|
||||||
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
||||||
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
||||||
@ -109,7 +126,7 @@ public static partial class CalculateManager
|
|||||||
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
||||||
|
|
||||||
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
||||||
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance);
|
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance, currentDateTempColumn);
|
||||||
|
|
||||||
var nextSumCurrentInterestColumn =
|
var nextSumCurrentInterestColumn =
|
||||||
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
||||||
@ -133,7 +150,7 @@ public static partial class CalculateManager
|
|||||||
nextCashflowMSFOFinal2Column.ComputeValues(nextCashflowMSFOFinalColumn, nextDateTempColumn,
|
nextCashflowMSFOFinal2Column.ComputeValues(nextCashflowMSFOFinalColumn, nextDateTempColumn,
|
||||||
preparedValues);
|
preparedValues);
|
||||||
|
|
||||||
var nextSumCreditColumn = new SumCreditColumn(preparedValues.LoanRatePeriod + 2);
|
var nextSumCreditColumn = new SumCreditColumnVT1(preparedValues.LoanRatePeriod + 2);
|
||||||
nextSumCreditColumn.ComputeValues(preparedValues, nextSumWithVATColumn);
|
nextSumCreditColumn.ComputeValues(preparedValues, nextSumWithVATColumn);
|
||||||
|
|
||||||
var nextCreditColumn = new CreditColumn(preparedValues.LoanRatePeriod + 4);
|
var nextCreditColumn = new CreditColumn(preparedValues.LoanRatePeriod + 4);
|
||||||
@ -159,13 +176,27 @@ public static partial class CalculateManager
|
|||||||
nextValues.ComputeNiAtInception(currentTablePayments);
|
nextValues.ComputeNiAtInception(currentTablePayments);
|
||||||
nextValues.ComputeNiAtInceptionMSFO();
|
nextValues.ComputeNiAtInceptionMSFO();
|
||||||
/*
|
/*
|
||||||
* NEXT
|
* NEXT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var postValues = new v2.PostValues(preparedValues);
|
var postValues = new v2.PostValues(preparedValues);
|
||||||
postValues.ComputeContractEconomy(nextCashflowMSFOColumn, nextCreditColumn);
|
postValues.ComputeContractEconomy(nextCashflowMSFOColumn, nextCreditColumn);
|
||||||
postValues.ComputeContractEconomyWithVAT(nextCreditVATColumn);
|
postValues.ComputeContractEconomyWithVAT(nextCreditVATColumn);
|
||||||
|
|
||||||
|
var nextCreditPaymentColumn = new CreditPaymentColumn(preparedValues.LoanRatePeriod + 4);
|
||||||
|
nextCreditPaymentColumn.ComputeValues(preparedValues, nextSumCreditColumn, nextCreditColumn);
|
||||||
|
|
||||||
|
var nextVATRecoverableColumn = new VATRecoverableColumn(64, preparedValues);
|
||||||
|
nextVATRecoverableColumn.ComputeValues(nextVATColumn);
|
||||||
|
|
||||||
|
nextValues.ComputeAcquisitionExpensesWithVAT(nextTableInsurance);
|
||||||
|
|
||||||
|
var nextCashflowMSFOWithCFColumn = new CashflowMSFOWithCFColumn(0, preparedValues, nextCashflowMSFOFinal2Column,
|
||||||
|
nextCreditPaymentColumn, nextValues, nextSumCreditColumn, nextVATRecoverableColumn, nextDateTempColumn);
|
||||||
|
nextCashflowMSFOWithCFColumn.ComputeValues();
|
||||||
|
|
||||||
|
var nextPiColumn = new PIColumn(61, nextCashflowMSFOFinal2Column, nextCashflowMSFOWithCFColumn, preparedValues);
|
||||||
|
nextPiColumn.ComputeValues();
|
||||||
|
|
||||||
return new ManagerResult
|
return new ManagerResult
|
||||||
{
|
{
|
||||||
@ -202,7 +233,11 @@ public static partial class CalculateManager
|
|||||||
nextCreditVATColumn,
|
nextCreditVATColumn,
|
||||||
nextNSIBExpensesColumn,
|
nextNSIBExpensesColumn,
|
||||||
nextCashflowNSIBColumn,
|
nextCashflowNSIBColumn,
|
||||||
nextRevenueColumn
|
nextRevenueColumn,
|
||||||
|
nextCreditPaymentColumn,
|
||||||
|
nextVATRecoverableColumn,
|
||||||
|
nextCashflowMSFOWithCFColumn,
|
||||||
|
nextPiColumn,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
||||||
|
using EvoCalculator.Core.PostCalculation.Tools;
|
||||||
using EvoCalculator.Core.PostCalculation.v1;
|
using EvoCalculator.Core.PostCalculation.v1;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
||||||
using EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
using EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
||||||
using DateTempColumn = EvoCalculator.Core.PostCalculation.v1.Columns.Current.DateTempColumn;
|
using DateTempColumn = EvoCalculator.Core.PostCalculation.v1.Columns.Current.DateTempColumn;
|
||||||
using SumCreditColumn = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumCreditColumn;
|
|
||||||
using SumRepaymentColumnVT1 = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumRepaymentColumnVT1;
|
using SumRepaymentColumnVT1 = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumRepaymentColumnVT1;
|
||||||
|
|
||||||
namespace EvoCalculator.Core.PostCalculation.v2.Managers;
|
namespace EvoCalculator.Core.PostCalculation.v2.Managers;
|
||||||
@ -15,7 +15,7 @@ namespace EvoCalculator.Core.PostCalculation.v2.Managers;
|
|||||||
public static partial class CalculateManager
|
public static partial class CalculateManager
|
||||||
{
|
{
|
||||||
public static ManagerResult CalculateDefault(RequestCalculation requestCalculation)
|
public static ManagerResult CalculateDefault(RequestCalculation requestCalculation)
|
||||||
{
|
{ new Validation().ValidateRequest(requestCalculation);
|
||||||
var constants = new Constants.Calculation();
|
var constants = new Constants.Calculation();
|
||||||
var preparedValues = requestCalculation.PreparedValues;
|
var preparedValues = requestCalculation.PreparedValues;
|
||||||
|
|
||||||
@ -30,8 +30,8 @@ public static partial class CalculateManager
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CURRENT
|
* CURRENT
|
||||||
*/
|
*/
|
||||||
var currentDateColumn = new DateColumn(preparedValues.Nmper.Current + 1);
|
var currentDateColumn = new DateColumn(preparedValues.Nmper.Current + 1);
|
||||||
currentDateColumn.ComputeValues(currentTablePayments);
|
currentDateColumn.ComputeValues(currentTablePayments);
|
||||||
|
|
||||||
@ -40,15 +40,15 @@ public static partial class CalculateManager
|
|||||||
currentDateTempColumn.ComputeValues(preparedValues, currentDateColumn);
|
currentDateTempColumn.ComputeValues(preparedValues, currentDateColumn);
|
||||||
|
|
||||||
var currentSumColumn = new SumColumn(preparedValues.Nmper.Current + 1, currentDateTempColumn);
|
var currentSumColumn = new SumColumn(preparedValues.Nmper.Current + 1, currentDateTempColumn);
|
||||||
currentSumColumn.ComputeValues(preparedValues, currentTablePayments);
|
currentSumColumn.ComputeValues(preparedValues, currentTablePayments, currentTableInsurance);
|
||||||
/*
|
/*
|
||||||
* CURRENT
|
* CURRENT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NEXT
|
* NEXT
|
||||||
*/
|
*/
|
||||||
var nextDateColumn = new DateColumnVT1(preparedValues.Nmper.Next + 1);
|
var nextDateColumn = new DateColumnVT1(preparedValues.Nmper.Next + 1);
|
||||||
nextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
nextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
||||||
|
|
||||||
@ -82,9 +82,13 @@ public static partial class CalculateManager
|
|||||||
currentTablePayments);
|
currentTablePayments);
|
||||||
|
|
||||||
|
|
||||||
var nextSumColumn = new SumColumnVT1(preparedValues.Nmper.Next + 1, nextDateTempColumn,
|
var nextSumColumn = new SumColumnVT2(preparedValues.Nmper.Next + 1, nextDateTempColumn,
|
||||||
preparedValues, nextValues, currentTablePayments, nextTablePayments);
|
preparedValues, nextValues, currentTablePayments, nextTablePayments);
|
||||||
nextSumColumn.ComputeValues((decimal)currentSumColumn.IRR + preparedValues.IRRDelta);
|
|
||||||
|
var sumIRRColumn = new SumIRRColumn(0, nextDateTempColumn, currentDateColumn, preparedValues, nextValues,
|
||||||
|
currentTablePayments,
|
||||||
|
nextTableInsurance, nextSumColumn);
|
||||||
|
sumIRRColumn.ComputeValues((decimal)currentSumColumn.IRR + preparedValues.IRRDelta);
|
||||||
nextSumColumn.PostCheck();
|
nextSumColumn.PostCheck();
|
||||||
nextSumColumn.RoundValues();
|
nextSumColumn.RoundValues();
|
||||||
|
|
||||||
@ -104,7 +108,7 @@ public static partial class CalculateManager
|
|||||||
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
||||||
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
||||||
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
||||||
nextTlmDateColumn);
|
nextTlmDateColumn, currentDateTempColumn);
|
||||||
|
|
||||||
var nextVATColumn = new VATColumnVT1(preparedValues.Nmper.Next + 1);
|
var nextVATColumn = new VATColumnVT1(preparedValues.Nmper.Next + 1);
|
||||||
nextVATColumn.ComputeValues(preparedValues, nextSumColumn, currentTablePayments, constants);
|
nextVATColumn.ComputeValues(preparedValues, nextSumColumn, currentTablePayments, constants);
|
||||||
@ -134,7 +138,7 @@ public static partial class CalculateManager
|
|||||||
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
||||||
|
|
||||||
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
||||||
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance);
|
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance, currentDateTempColumn);
|
||||||
|
|
||||||
var nextSumCurrentInterestColumn =
|
var nextSumCurrentInterestColumn =
|
||||||
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
||||||
@ -158,7 +162,7 @@ public static partial class CalculateManager
|
|||||||
nextCashflowMSFOFinal2Column.ComputeValues(nextCashflowMSFOFinalColumn, nextDateTempColumn,
|
nextCashflowMSFOFinal2Column.ComputeValues(nextCashflowMSFOFinalColumn, nextDateTempColumn,
|
||||||
preparedValues);
|
preparedValues);
|
||||||
|
|
||||||
var nextSumCreditColumn = new SumCreditColumn(preparedValues.LoanRatePeriod + 2);
|
var nextSumCreditColumn = new SumCreditColumnVT1(preparedValues.LoanRatePeriod + 2);
|
||||||
nextSumCreditColumn.ComputeValues(preparedValues, nextSumWithVATColumn);
|
nextSumCreditColumn.ComputeValues(preparedValues, nextSumWithVATColumn);
|
||||||
|
|
||||||
var nextCreditColumn = new CreditColumn(preparedValues.LoanRatePeriod + 4);
|
var nextCreditColumn = new CreditColumn(preparedValues.LoanRatePeriod + 4);
|
||||||
@ -180,12 +184,27 @@ public static partial class CalculateManager
|
|||||||
var nextCashflowNSIBColumn = new CashflowNSIBColumn(nextValues.Nmper + 1);
|
var nextCashflowNSIBColumn = new CashflowNSIBColumn(nextValues.Nmper + 1);
|
||||||
nextCashflowNSIBColumn.ComputeValues(nextNSIBBruttoGrColumn, nextRevenueColumn);
|
nextCashflowNSIBColumn.ComputeValues(nextNSIBBruttoGrColumn, nextRevenueColumn);
|
||||||
|
|
||||||
|
var nextCreditPaymentColumn = new CreditPaymentColumn(preparedValues.LoanRatePeriod + 4);
|
||||||
|
nextCreditPaymentColumn.ComputeValues(preparedValues, nextSumCreditColumn, nextCreditColumn);
|
||||||
|
|
||||||
|
var nextVATRecoverableColumn = new VATRecoverableColumn(64, preparedValues);
|
||||||
|
nextVATRecoverableColumn.ComputeValues(nextVATColumn);
|
||||||
|
|
||||||
|
nextValues.ComputeAcquisitionExpensesWithVAT(nextTableInsurance);
|
||||||
|
|
||||||
|
var nextCashflowMSFOWithCFColumn = new CashflowMSFOWithCFColumn(0, preparedValues, nextCashflowMSFOFinal2Column,
|
||||||
|
nextCreditPaymentColumn, nextValues, nextSumCreditColumn, nextVATRecoverableColumn, nextDateTempColumn);
|
||||||
|
nextCashflowMSFOWithCFColumn.ComputeValues();
|
||||||
|
|
||||||
|
var nextPiColumn = new PIColumn(61, nextCashflowMSFOFinal2Column, nextCashflowMSFOWithCFColumn, preparedValues);
|
||||||
|
nextPiColumn.ComputeValues();
|
||||||
|
|
||||||
|
|
||||||
nextValues.ComputeNiAtInception(currentTablePayments);
|
nextValues.ComputeNiAtInception(currentTablePayments);
|
||||||
nextValues.ComputeNiAtInceptionMSFO();
|
nextValues.ComputeNiAtInceptionMSFO();
|
||||||
/*
|
/*
|
||||||
* NEXT
|
* NEXT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var postValues = new v2.PostValues(preparedValues);
|
var postValues = new v2.PostValues(preparedValues);
|
||||||
postValues.ComputeContractEconomy(nextCashflowMSFOColumn, nextCreditColumn);
|
postValues.ComputeContractEconomy(nextCashflowMSFOColumn, nextCreditColumn);
|
||||||
@ -209,6 +228,7 @@ public static partial class CalculateManager
|
|||||||
nextTlmCostColumn,
|
nextTlmCostColumn,
|
||||||
nextTlmGrColumn,
|
nextTlmGrColumn,
|
||||||
nextSumColumn,
|
nextSumColumn,
|
||||||
|
sumIRRColumn,
|
||||||
nextNSIBBruttoGrColumn,
|
nextNSIBBruttoGrColumn,
|
||||||
nextSubsidyExpensesColumn,
|
nextSubsidyExpensesColumn,
|
||||||
nextCashflowMSFOColumn,
|
nextCashflowMSFOColumn,
|
||||||
@ -231,7 +251,11 @@ public static partial class CalculateManager
|
|||||||
nextCreditVATColumn,
|
nextCreditVATColumn,
|
||||||
nextNSIBExpensesColumn,
|
nextNSIBExpensesColumn,
|
||||||
nextCashflowNSIBColumn,
|
nextCashflowNSIBColumn,
|
||||||
nextRevenueColumn
|
nextRevenueColumn,
|
||||||
|
nextCreditPaymentColumn,
|
||||||
|
nextVATRecoverableColumn,
|
||||||
|
nextCashflowMSFOWithCFColumn,
|
||||||
|
nextPiColumn,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,12 @@
|
|||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
||||||
|
using EvoCalculator.Core.PostCalculation.Tools;
|
||||||
using EvoCalculator.Core.PostCalculation.v1;
|
using EvoCalculator.Core.PostCalculation.v1;
|
||||||
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
||||||
using EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
using EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
||||||
using SumCreditColumn = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumCreditColumn;
|
using DateTempColumn = EvoCalculator.Core.PostCalculation.v1.Columns.Next.DateTempColumn;
|
||||||
using SumRepaymentColumnVT2 = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumRepaymentColumnVT2;
|
using SumRepaymentColumnVT2 = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumRepaymentColumnVT2;
|
||||||
|
|
||||||
namespace EvoCalculator.Core.PostCalculation.v2.Managers;
|
namespace EvoCalculator.Core.PostCalculation.v2.Managers;
|
||||||
@ -12,7 +14,7 @@ namespace EvoCalculator.Core.PostCalculation.v2.Managers;
|
|||||||
public static partial class CalculateManager
|
public static partial class CalculateManager
|
||||||
{
|
{
|
||||||
public static ManagerResult ChangingLastPayment(RequestCalculation requestCalculation)
|
public static ManagerResult ChangingLastPayment(RequestCalculation requestCalculation)
|
||||||
{
|
{ new Validation().ValidateRequest(requestCalculation);
|
||||||
var constants = new Constants.Calculation();
|
var constants = new Constants.Calculation();
|
||||||
var preparedValues = requestCalculation.PreparedValues;
|
var preparedValues = requestCalculation.PreparedValues;
|
||||||
|
|
||||||
@ -24,9 +26,24 @@ public static partial class CalculateManager
|
|||||||
|
|
||||||
var currentTableTLMTracker = requestCalculation?.TableTLMTracker?.Current;
|
var currentTableTLMTracker = requestCalculation?.TableTLMTracker?.Current;
|
||||||
var nextTableTLMTracker = requestCalculation?.TableTLMTracker?.Next;
|
var nextTableTLMTracker = requestCalculation?.TableTLMTracker?.Next;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NEXT
|
* CURRENT
|
||||||
*/
|
*/
|
||||||
|
var currentDateColumn = new DateColumn(preparedValues.Nmper.Current + 1);
|
||||||
|
currentDateColumn.ComputeValues(currentTablePayments);
|
||||||
|
|
||||||
|
var currentDateTempColumn =
|
||||||
|
new DateTempColumn(preparedValues.Nmper.Current + 1);
|
||||||
|
currentDateTempColumn.ComputeValues(preparedValues, currentDateColumn);
|
||||||
|
/*
|
||||||
|
* CURRENT
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NEXT
|
||||||
|
*/
|
||||||
var nextDateColumn = new DateColumnVT1(preparedValues.Nmper.Next + 1);
|
var nextDateColumn = new DateColumnVT1(preparedValues.Nmper.Next + 1);
|
||||||
nextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
nextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
||||||
|
|
||||||
@ -85,7 +102,7 @@ public static partial class CalculateManager
|
|||||||
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
||||||
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
||||||
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
||||||
nextTlmDateColumn);
|
nextTlmDateColumn, currentDateTempColumn);
|
||||||
|
|
||||||
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
||||||
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
||||||
@ -106,7 +123,7 @@ public static partial class CalculateManager
|
|||||||
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
||||||
|
|
||||||
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
||||||
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance);
|
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance, currentDateTempColumn);
|
||||||
|
|
||||||
var nextSumCurrentInterestColumn =
|
var nextSumCurrentInterestColumn =
|
||||||
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
||||||
@ -128,7 +145,7 @@ public static partial class CalculateManager
|
|||||||
nextCashflowMSFOFinal2Column.ComputeValues(nextCashflowMSFOFinalColumn, nextDateTempColumn,
|
nextCashflowMSFOFinal2Column.ComputeValues(nextCashflowMSFOFinalColumn, nextDateTempColumn,
|
||||||
preparedValues);
|
preparedValues);
|
||||||
|
|
||||||
var nextSumCreditColumn = new SumCreditColumn(preparedValues.LoanRatePeriod + 2);
|
var nextSumCreditColumn = new SumCreditColumnVT1(preparedValues.LoanRatePeriod + 2);
|
||||||
nextSumCreditColumn.ComputeValues(preparedValues, nextSumWithVATColumn);
|
nextSumCreditColumn.ComputeValues(preparedValues, nextSumWithVATColumn);
|
||||||
|
|
||||||
var nextCreditColumn = new CreditColumn(preparedValues.LoanRatePeriod + 4);
|
var nextCreditColumn = new CreditColumn(preparedValues.LoanRatePeriod + 4);
|
||||||
@ -154,13 +171,27 @@ public static partial class CalculateManager
|
|||||||
nextValues.ComputeNiAtInception(currentTablePayments);
|
nextValues.ComputeNiAtInception(currentTablePayments);
|
||||||
nextValues.ComputeNiAtInceptionMSFO();
|
nextValues.ComputeNiAtInceptionMSFO();
|
||||||
/*
|
/*
|
||||||
* NEXT
|
* NEXT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var postValues = new v2.PostValues(preparedValues);
|
var postValues = new v2.PostValues(preparedValues);
|
||||||
postValues.ComputeContractEconomy(nextCashflowMSFOColumn, nextCreditColumn);
|
postValues.ComputeContractEconomy(nextCashflowMSFOColumn, nextCreditColumn);
|
||||||
postValues.ComputeContractEconomyWithVAT(nextCreditVATColumn);
|
postValues.ComputeContractEconomyWithVAT(nextCreditVATColumn);
|
||||||
|
|
||||||
|
var nextCreditPaymentColumn = new CreditPaymentColumn(preparedValues.LoanRatePeriod + 4);
|
||||||
|
nextCreditPaymentColumn.ComputeValues(preparedValues, nextSumCreditColumn, nextCreditColumn);
|
||||||
|
|
||||||
|
var nextVATRecoverableColumn = new VATRecoverableColumn(64, preparedValues);
|
||||||
|
nextVATRecoverableColumn.ComputeValues(nextVATColumn);
|
||||||
|
|
||||||
|
nextValues.ComputeAcquisitionExpensesWithVAT(nextTableInsurance);
|
||||||
|
|
||||||
|
var nextCashflowMSFOWithCFColumn = new CashflowMSFOWithCFColumn(0, preparedValues, nextCashflowMSFOFinal2Column,
|
||||||
|
nextCreditPaymentColumn, nextValues, nextSumCreditColumn, nextVATRecoverableColumn, nextDateTempColumn);
|
||||||
|
nextCashflowMSFOWithCFColumn.ComputeValues();
|
||||||
|
|
||||||
|
var nextPiColumn = new PIColumn(61, nextCashflowMSFOFinal2Column, nextCashflowMSFOWithCFColumn, preparedValues);
|
||||||
|
nextPiColumn.ComputeValues();
|
||||||
|
|
||||||
return new ManagerResult
|
return new ManagerResult
|
||||||
{
|
{
|
||||||
@ -197,7 +228,11 @@ public static partial class CalculateManager
|
|||||||
nextCreditVATColumn,
|
nextCreditVATColumn,
|
||||||
nextNSIBExpensesColumn,
|
nextNSIBExpensesColumn,
|
||||||
nextCashflowNSIBColumn,
|
nextCashflowNSIBColumn,
|
||||||
nextRevenueColumn
|
nextRevenueColumn,
|
||||||
|
nextCreditPaymentColumn,
|
||||||
|
nextVATRecoverableColumn,
|
||||||
|
nextCashflowMSFOWithCFColumn,
|
||||||
|
nextPiColumn,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
||||||
|
using EvoCalculator.Core.PostCalculation.Tools;
|
||||||
using EvoCalculator.Core.PostCalculation.v1;
|
using EvoCalculator.Core.PostCalculation.v1;
|
||||||
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
||||||
using EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
using EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
||||||
using SumCreditColumn = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumCreditColumn;
|
using DateTempColumn = EvoCalculator.Core.PostCalculation.v1.Columns.Next.DateTempColumn;
|
||||||
using SumRepaymentColumnVT1 = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumRepaymentColumnVT1;
|
using SumRepaymentColumnVT1 = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumRepaymentColumnVT1;
|
||||||
|
|
||||||
namespace EvoCalculator.Core.PostCalculation.v2.Managers;
|
namespace EvoCalculator.Core.PostCalculation.v2.Managers;
|
||||||
@ -13,7 +15,7 @@ namespace EvoCalculator.Core.PostCalculation.v2.Managers;
|
|||||||
public static partial class CalculateManager
|
public static partial class CalculateManager
|
||||||
{
|
{
|
||||||
public static ManagerResult EarlyRedemption(RequestCalculation requestCalculation)
|
public static ManagerResult EarlyRedemption(RequestCalculation requestCalculation)
|
||||||
{
|
{ new Validation().ValidateRequest(requestCalculation);
|
||||||
var constants = new Constants.Calculation();
|
var constants = new Constants.Calculation();
|
||||||
var preparedValues = requestCalculation.PreparedValues;
|
var preparedValues = requestCalculation.PreparedValues;
|
||||||
|
|
||||||
@ -28,6 +30,19 @@ public static partial class CalculateManager
|
|||||||
|
|
||||||
var nextValues = new NextValues(preparedValues);
|
var nextValues = new NextValues(preparedValues);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* CURRENT
|
||||||
|
*/
|
||||||
|
var currentDateColumn = new DateColumn(preparedValues.Nmper.Current + 1);
|
||||||
|
currentDateColumn.ComputeValues(currentTablePayments);
|
||||||
|
|
||||||
|
var currentDateTempColumn =
|
||||||
|
new DateTempColumn(preparedValues.Nmper.Current + 1);
|
||||||
|
currentDateTempColumn.ComputeValues(preparedValues, currentDateColumn);
|
||||||
|
/*
|
||||||
|
* CURRENT
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TECH
|
* TECH
|
||||||
*/
|
*/
|
||||||
@ -90,7 +105,7 @@ public static partial class CalculateManager
|
|||||||
techNextTlmCostColumn,
|
techNextTlmCostColumn,
|
||||||
techNextSubsidyExpensesColumn, techNextNSIBBruttoGrColumn, nextTableInsurance,
|
techNextSubsidyExpensesColumn, techNextNSIBBruttoGrColumn, nextTableInsurance,
|
||||||
techNextDateTempColumn,
|
techNextDateTempColumn,
|
||||||
techNextTlmDateColumn);
|
techNextTlmDateColumn, currentDateTempColumn);
|
||||||
|
|
||||||
var techNextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
var techNextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
||||||
techNextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, techNextDateTempColumn,
|
techNextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, techNextDateTempColumn,
|
||||||
@ -110,7 +125,7 @@ public static partial class CalculateManager
|
|||||||
techNextSumCurrentColumn.ComputeValues(techNextSumWithVATColumn);
|
techNextSumCurrentColumn.ComputeValues(techNextSumWithVATColumn);
|
||||||
|
|
||||||
var techNextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Current + 1);
|
var techNextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Current + 1);
|
||||||
techNextSumCurrentNegativeColumn.ComputeValues(techNextDateTempColumn, nextTableInsurance);
|
techNextSumCurrentNegativeColumn.ComputeValues(techNextDateTempColumn, nextTableInsurance, currentDateTempColumn);
|
||||||
|
|
||||||
var techNextSumCurrentInterestColumn =
|
var techNextSumCurrentInterestColumn =
|
||||||
new SumCurrentInterestColumn(techNextCashflowMSFOForNIColumn.Values.Length);
|
new SumCurrentInterestColumn(techNextCashflowMSFOForNIColumn.Values.Length);
|
||||||
@ -194,7 +209,7 @@ public static partial class CalculateManager
|
|||||||
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
||||||
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
||||||
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
||||||
nextTlmDateColumn);
|
nextTlmDateColumn, currentDateTempColumn);
|
||||||
|
|
||||||
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
||||||
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
||||||
@ -215,7 +230,7 @@ public static partial class CalculateManager
|
|||||||
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
||||||
|
|
||||||
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
||||||
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance);
|
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance, currentDateTempColumn);
|
||||||
|
|
||||||
var nextSumCurrentInterestColumn =
|
var nextSumCurrentInterestColumn =
|
||||||
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
||||||
@ -239,7 +254,7 @@ public static partial class CalculateManager
|
|||||||
nextCashflowMSFOFinal2Column.ComputeValues(nextCashflowMSFOFinalColumn, nextDateTempColumn,
|
nextCashflowMSFOFinal2Column.ComputeValues(nextCashflowMSFOFinalColumn, nextDateTempColumn,
|
||||||
preparedValues);
|
preparedValues);
|
||||||
|
|
||||||
var nextSumCreditColumn = new SumCreditColumn(preparedValues.LoanRatePeriod + 2);
|
var nextSumCreditColumn = new SumCreditColumnVT2(preparedValues.LoanRatePeriod + 2);
|
||||||
nextSumCreditColumn.ComputeValues(preparedValues, nextSumWithVATColumn);
|
nextSumCreditColumn.ComputeValues(preparedValues, nextSumWithVATColumn);
|
||||||
|
|
||||||
var nextCreditColumn = new CreditColumn(preparedValues.LoanRatePeriod + 4);
|
var nextCreditColumn = new CreditColumn(preparedValues.LoanRatePeriod + 4);
|
||||||
@ -261,6 +276,20 @@ public static partial class CalculateManager
|
|||||||
var nextCashflowNSIBColumn = new CashflowNSIBColumn(nextValues.Nmper + 1);
|
var nextCashflowNSIBColumn = new CashflowNSIBColumn(nextValues.Nmper + 1);
|
||||||
nextCashflowNSIBColumn.ComputeValues(nextNSIBBruttoGrColumn, nextRevenueColumn);
|
nextCashflowNSIBColumn.ComputeValues(nextNSIBBruttoGrColumn, nextRevenueColumn);
|
||||||
|
|
||||||
|
var nextCreditPaymentColumn = new CreditPaymentColumn(preparedValues.LoanRatePeriod + 4);
|
||||||
|
nextCreditPaymentColumn.ComputeValues(preparedValues, nextSumCreditColumn, nextCreditColumn);
|
||||||
|
|
||||||
|
var nextVATRecoverableColumn = new VATRecoverableColumn(64, preparedValues);
|
||||||
|
nextVATRecoverableColumn.ComputeValues(nextVATColumn);
|
||||||
|
|
||||||
|
nextValues.ComputeAcquisitionExpensesWithVAT(nextTableInsurance);
|
||||||
|
|
||||||
|
var nextCashflowMSFOWithCFColumn = new CashflowMSFOWithCFColumn(0, preparedValues, nextCashflowMSFOFinal2Column,
|
||||||
|
nextCreditPaymentColumn, nextValues, nextSumCreditColumn, nextVATRecoverableColumn, nextDateTempColumn);
|
||||||
|
nextCashflowMSFOWithCFColumn.ComputeValues();
|
||||||
|
|
||||||
|
var nextPiColumn = new PIColumn(61, nextCashflowMSFOFinal2Column, nextCashflowMSFOWithCFColumn, preparedValues);
|
||||||
|
nextPiColumn.ComputeValues();
|
||||||
|
|
||||||
nextValues.ComputeNiAtInception(currentTablePayments);
|
nextValues.ComputeNiAtInception(currentTablePayments);
|
||||||
nextValues.ComputeNiAtInceptionMSFO();
|
nextValues.ComputeNiAtInceptionMSFO();
|
||||||
@ -328,7 +357,11 @@ public static partial class CalculateManager
|
|||||||
nextCreditVATColumn,
|
nextCreditVATColumn,
|
||||||
nextNSIBExpensesColumn,
|
nextNSIBExpensesColumn,
|
||||||
nextCashflowNSIBColumn,
|
nextCashflowNSIBColumn,
|
||||||
nextRevenueColumn
|
nextRevenueColumn,
|
||||||
|
nextCreditPaymentColumn,
|
||||||
|
nextVATRecoverableColumn,
|
||||||
|
nextCashflowMSFOWithCFColumn,
|
||||||
|
nextPiColumn,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
||||||
|
using EvoCalculator.Core.PostCalculation.Tools;
|
||||||
using EvoCalculator.Core.PostCalculation.v1;
|
using EvoCalculator.Core.PostCalculation.v1;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
||||||
using EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
using EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
||||||
using DateTempColumn = EvoCalculator.Core.PostCalculation.v1.Columns.Current.DateTempColumn;
|
using DateTempColumn = EvoCalculator.Core.PostCalculation.v1.Columns.Current.DateTempColumn;
|
||||||
using SumCreditColumn = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumCreditColumn;
|
|
||||||
using SumRepaymentColumnVT1 = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumRepaymentColumnVT1;
|
using SumRepaymentColumnVT1 = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumRepaymentColumnVT1;
|
||||||
|
|
||||||
namespace EvoCalculator.Core.PostCalculation.v2.Managers;
|
namespace EvoCalculator.Core.PostCalculation.v2.Managers;
|
||||||
@ -15,7 +15,7 @@ namespace EvoCalculator.Core.PostCalculation.v2.Managers;
|
|||||||
public static partial class CalculateManager
|
public static partial class CalculateManager
|
||||||
{
|
{
|
||||||
public static ManagerResult PERWithChangingTheTerm(RequestCalculation requestCalculation)
|
public static ManagerResult PERWithChangingTheTerm(RequestCalculation requestCalculation)
|
||||||
{
|
{ new Validation().ValidateRequest(requestCalculation);
|
||||||
var constants = new Constants.Calculation();
|
var constants = new Constants.Calculation();
|
||||||
var preparedValues = requestCalculation.PreparedValues;
|
var preparedValues = requestCalculation.PreparedValues;
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ public static partial class CalculateManager
|
|||||||
currentDateTempColumn.ComputeValues(preparedValues, currentDateColumn);
|
currentDateTempColumn.ComputeValues(preparedValues, currentDateColumn);
|
||||||
|
|
||||||
var currentSumColumn = new SumColumn(preparedValues.Nmper.Current + 1, currentDateTempColumn);
|
var currentSumColumn = new SumColumn(preparedValues.Nmper.Current + 1, currentDateTempColumn);
|
||||||
currentSumColumn.ComputeValues(preparedValues, currentTablePayments);
|
currentSumColumn.ComputeValues(preparedValues, currentTablePayments, currentTableInsurance);
|
||||||
/*
|
/*
|
||||||
* CURRENT
|
* CURRENT
|
||||||
*/
|
*/
|
||||||
@ -160,7 +160,7 @@ public static partial class CalculateManager
|
|||||||
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
||||||
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
||||||
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
||||||
nextTlmDateColumn);
|
nextTlmDateColumn, currentDateTempColumn);
|
||||||
|
|
||||||
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
||||||
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
||||||
@ -181,7 +181,7 @@ public static partial class CalculateManager
|
|||||||
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
||||||
|
|
||||||
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(nextValues.Nmper + 1);
|
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(nextValues.Nmper + 1);
|
||||||
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance);
|
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance, currentDateTempColumn);
|
||||||
|
|
||||||
var nextSumCurrentInterestColumn =
|
var nextSumCurrentInterestColumn =
|
||||||
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
||||||
@ -203,7 +203,7 @@ public static partial class CalculateManager
|
|||||||
nextCashflowMSFOFinal2Column.ComputeValues(nextCashflowMSFOFinalColumn, nextDateTempColumn,
|
nextCashflowMSFOFinal2Column.ComputeValues(nextCashflowMSFOFinalColumn, nextDateTempColumn,
|
||||||
preparedValues);
|
preparedValues);
|
||||||
|
|
||||||
var nextSumCreditColumn = new SumCreditColumn(preparedValues.LoanRatePeriod + 2);
|
var nextSumCreditColumn = new SumCreditColumnVT1(preparedValues.LoanRatePeriod + 2);
|
||||||
nextSumCreditColumn.ComputeValues(preparedValues, nextSumWithVATColumn);
|
nextSumCreditColumn.ComputeValues(preparedValues, nextSumWithVATColumn);
|
||||||
|
|
||||||
var nextCreditColumn = new CreditColumn(preparedValues.LoanRatePeriod + 4);
|
var nextCreditColumn = new CreditColumn(preparedValues.LoanRatePeriod + 4);
|
||||||
@ -224,6 +224,21 @@ public static partial class CalculateManager
|
|||||||
var nextCashflowNSIBColumn = new CashflowNSIBColumn(nextValues.Nmper + 1);
|
var nextCashflowNSIBColumn = new CashflowNSIBColumn(nextValues.Nmper + 1);
|
||||||
nextCashflowNSIBColumn.ComputeValues(nextNSIBBruttoGrColumn, nextRevenueColumn);
|
nextCashflowNSIBColumn.ComputeValues(nextNSIBBruttoGrColumn, nextRevenueColumn);
|
||||||
|
|
||||||
|
var nextCreditPaymentColumn = new CreditPaymentColumn(preparedValues.LoanRatePeriod + 4);
|
||||||
|
nextCreditPaymentColumn.ComputeValues(preparedValues, nextSumCreditColumn, nextCreditColumn);
|
||||||
|
|
||||||
|
var nextVATRecoverableColumn = new VATRecoverableColumn(64, preparedValues);
|
||||||
|
nextVATRecoverableColumn.ComputeValues(nextVATColumn);
|
||||||
|
|
||||||
|
nextValues.ComputeAcquisitionExpensesWithVAT(nextTableInsurance);
|
||||||
|
|
||||||
|
var nextCashflowMSFOWithCFColumn = new CashflowMSFOWithCFColumn(0, preparedValues, nextCashflowMSFOFinal2Column,
|
||||||
|
nextCreditPaymentColumn, nextValues, nextSumCreditColumn, nextVATRecoverableColumn, nextDateTempColumn);
|
||||||
|
nextCashflowMSFOWithCFColumn.ComputeValues();
|
||||||
|
|
||||||
|
var nextPiColumn = new PIColumn(61, nextCashflowMSFOFinal2Column, nextCashflowMSFOWithCFColumn, preparedValues);
|
||||||
|
nextPiColumn.ComputeValues();
|
||||||
|
|
||||||
|
|
||||||
nextValues.ComputeNiAtInception(currentTablePayments);
|
nextValues.ComputeNiAtInception(currentTablePayments);
|
||||||
nextValues.ComputeNiAtInceptionMSFO();
|
nextValues.ComputeNiAtInceptionMSFO();
|
||||||
@ -285,7 +300,11 @@ public static partial class CalculateManager
|
|||||||
nextCreditVATColumn,
|
nextCreditVATColumn,
|
||||||
nextNSIBExpensesColumn,
|
nextNSIBExpensesColumn,
|
||||||
nextCashflowNSIBColumn,
|
nextCashflowNSIBColumn,
|
||||||
nextRevenueColumn
|
nextRevenueColumn,
|
||||||
|
nextCreditPaymentColumn,
|
||||||
|
nextVATRecoverableColumn,
|
||||||
|
nextCashflowMSFOWithCFColumn,
|
||||||
|
nextPiColumn,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
||||||
|
using EvoCalculator.Core.PostCalculation.Tools;
|
||||||
using EvoCalculator.Core.PostCalculation.v1;
|
using EvoCalculator.Core.PostCalculation.v1;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
||||||
using EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
using EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
||||||
using DateTempColumn = EvoCalculator.Core.PostCalculation.v1.Columns.Current.DateTempColumn;
|
using DateTempColumn = EvoCalculator.Core.PostCalculation.v1.Columns.Current.DateTempColumn;
|
||||||
using SumCreditColumn = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumCreditColumn;
|
|
||||||
using SumRepaymentColumnVT1 = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumRepaymentColumnVT1;
|
using SumRepaymentColumnVT1 = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumRepaymentColumnVT1;
|
||||||
|
|
||||||
namespace EvoCalculator.Core.PostCalculation.v2.Managers;
|
namespace EvoCalculator.Core.PostCalculation.v2.Managers;
|
||||||
@ -15,7 +15,7 @@ namespace EvoCalculator.Core.PostCalculation.v2.Managers;
|
|||||||
public static partial class CalculateManager
|
public static partial class CalculateManager
|
||||||
{
|
{
|
||||||
public static ManagerResult PERWithoutChangingTheTerm(RequestCalculation requestCalculation)
|
public static ManagerResult PERWithoutChangingTheTerm(RequestCalculation requestCalculation)
|
||||||
{
|
{ new Validation().ValidateRequest(requestCalculation); new Validation().ValidateRequest(requestCalculation);
|
||||||
var constants = new Constants.Calculation();
|
var constants = new Constants.Calculation();
|
||||||
var preparedValues = requestCalculation.PreparedValues;
|
var preparedValues = requestCalculation.PreparedValues;
|
||||||
|
|
||||||
@ -30,8 +30,8 @@ public static partial class CalculateManager
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CURRENT
|
* CURRENT
|
||||||
*/
|
*/
|
||||||
var currentDateColumn = new DateColumn(preparedValues.Nmper.Current + 1);
|
var currentDateColumn = new DateColumn(preparedValues.Nmper.Current + 1);
|
||||||
currentDateColumn.ComputeValues(currentTablePayments);
|
currentDateColumn.ComputeValues(currentTablePayments);
|
||||||
|
|
||||||
@ -40,15 +40,15 @@ public static partial class CalculateManager
|
|||||||
currentDateTempColumn.ComputeValues(preparedValues, currentDateColumn);
|
currentDateTempColumn.ComputeValues(preparedValues, currentDateColumn);
|
||||||
|
|
||||||
var currentSumColumn = new SumColumn(preparedValues.Nmper.Current + 1, currentDateTempColumn);
|
var currentSumColumn = new SumColumn(preparedValues.Nmper.Current + 1, currentDateTempColumn);
|
||||||
currentSumColumn.ComputeValues(preparedValues, currentTablePayments);
|
currentSumColumn.ComputeValues(preparedValues, currentTablePayments, currentTableInsurance);
|
||||||
/*
|
/*
|
||||||
* CURRENT
|
* CURRENT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NEXT
|
* NEXT
|
||||||
*/
|
*/
|
||||||
var nextDateColumn = new DateColumnVT1(preparedValues.Nmper.Next + 1);
|
var nextDateColumn = new DateColumnVT1(preparedValues.Nmper.Next + 1);
|
||||||
nextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
nextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ public static partial class CalculateManager
|
|||||||
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
||||||
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
||||||
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
||||||
nextTlmDateColumn);
|
nextTlmDateColumn, currentDateTempColumn);
|
||||||
|
|
||||||
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
||||||
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
||||||
@ -143,7 +143,7 @@ public static partial class CalculateManager
|
|||||||
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
||||||
|
|
||||||
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
||||||
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance);
|
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance, currentDateTempColumn);
|
||||||
|
|
||||||
var nextSumCurrentInterestColumn =
|
var nextSumCurrentInterestColumn =
|
||||||
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
||||||
@ -168,7 +168,7 @@ public static partial class CalculateManager
|
|||||||
nextCashflowMSFOFinal2Column.ComputeValues(nextCashflowMSFOFinalColumn, nextDateTempColumn,
|
nextCashflowMSFOFinal2Column.ComputeValues(nextCashflowMSFOFinalColumn, nextDateTempColumn,
|
||||||
preparedValues);
|
preparedValues);
|
||||||
|
|
||||||
var nextSumCreditColumn = new SumCreditColumn(preparedValues.LoanRatePeriod + 2);
|
var nextSumCreditColumn = new SumCreditColumnVT1(preparedValues.LoanRatePeriod + 2);
|
||||||
nextSumCreditColumn.ComputeValues(preparedValues, nextSumWithVATColumn);
|
nextSumCreditColumn.ComputeValues(preparedValues, nextSumWithVATColumn);
|
||||||
|
|
||||||
var nextCreditColumn = new CreditColumn(preparedValues.LoanRatePeriod + 4);
|
var nextCreditColumn = new CreditColumn(preparedValues.LoanRatePeriod + 4);
|
||||||
@ -189,13 +189,28 @@ public static partial class CalculateManager
|
|||||||
var nextCashflowNSIBColumn = new CashflowNSIBColumn(nextValues.Nmper + 1);
|
var nextCashflowNSIBColumn = new CashflowNSIBColumn(nextValues.Nmper + 1);
|
||||||
nextCashflowNSIBColumn.ComputeValues(nextNSIBBruttoGrColumn, nextRevenueColumn);
|
nextCashflowNSIBColumn.ComputeValues(nextNSIBBruttoGrColumn, nextRevenueColumn);
|
||||||
|
|
||||||
|
var nextCreditPaymentColumn = new CreditPaymentColumn(preparedValues.LoanRatePeriod + 4);
|
||||||
|
nextCreditPaymentColumn.ComputeValues(preparedValues, nextSumCreditColumn, nextCreditColumn);
|
||||||
|
|
||||||
|
var nextVATRecoverableColumn = new VATRecoverableColumn(64, preparedValues);
|
||||||
|
nextVATRecoverableColumn.ComputeValues(nextVATColumn);
|
||||||
|
|
||||||
|
nextValues.ComputeAcquisitionExpensesWithVAT(nextTableInsurance);
|
||||||
|
|
||||||
|
var nextCashflowMSFOWithCFColumn = new CashflowMSFOWithCFColumn(0, preparedValues, nextCashflowMSFOFinal2Column,
|
||||||
|
nextCreditPaymentColumn, nextValues, nextSumCreditColumn, nextVATRecoverableColumn, nextDateTempColumn);
|
||||||
|
nextCashflowMSFOWithCFColumn.ComputeValues();
|
||||||
|
|
||||||
|
var nextPiColumn = new PIColumn(61, nextCashflowMSFOFinal2Column, nextCashflowMSFOWithCFColumn, preparedValues);
|
||||||
|
nextPiColumn.ComputeValues();
|
||||||
|
|
||||||
|
|
||||||
nextValues.ComputeNiAtInception(currentTablePayments);
|
nextValues.ComputeNiAtInception(currentTablePayments);
|
||||||
nextValues.ComputeNiAtInceptionMSFO();
|
nextValues.ComputeNiAtInceptionMSFO();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NEXT
|
* NEXT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var postValues = new v2.PostValues(preparedValues);
|
var postValues = new v2.PostValues(preparedValues);
|
||||||
postValues.ComputeContractEconomy(nextCashflowMSFOColumn, nextCreditColumn);
|
postValues.ComputeContractEconomy(nextCashflowMSFOColumn, nextCreditColumn);
|
||||||
@ -244,7 +259,11 @@ public static partial class CalculateManager
|
|||||||
nextCreditVATColumn,
|
nextCreditVATColumn,
|
||||||
nextNSIBExpensesColumn,
|
nextNSIBExpensesColumn,
|
||||||
nextCashflowNSIBColumn,
|
nextCashflowNSIBColumn,
|
||||||
nextRevenueColumn
|
nextRevenueColumn,
|
||||||
|
nextCreditPaymentColumn,
|
||||||
|
nextVATRecoverableColumn,
|
||||||
|
nextCashflowMSFOWithCFColumn,
|
||||||
|
nextPiColumn,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
||||||
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
||||||
|
using EvoCalculator.Core.PostCalculation.Tools;
|
||||||
using EvoCalculator.Core.PostCalculation.v1;
|
using EvoCalculator.Core.PostCalculation.v1;
|
||||||
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
||||||
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
||||||
using EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
using EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
||||||
using SumCreditColumn = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumCreditColumn;
|
using DateTempColumn = EvoCalculator.Core.PostCalculation.v1.Columns.Next.DateTempColumn;
|
||||||
using SumRepaymentColumnVT1 = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumRepaymentColumnVT1;
|
using SumRepaymentColumnVT1 = EvoCalculator.Core.PostCalculation.v2.Columns.Next.SumRepaymentColumnVT1;
|
||||||
|
|
||||||
namespace EvoCalculator.Core.PostCalculation.v2.Managers;
|
namespace EvoCalculator.Core.PostCalculation.v2.Managers;
|
||||||
@ -13,7 +15,7 @@ namespace EvoCalculator.Core.PostCalculation.v2.Managers;
|
|||||||
public static partial class CalculateManager
|
public static partial class CalculateManager
|
||||||
{
|
{
|
||||||
public static ManagerResult Suspension(RequestCalculation requestCalculation)
|
public static ManagerResult Suspension(RequestCalculation requestCalculation)
|
||||||
{
|
{ new Validation().ValidateRequest(requestCalculation);
|
||||||
var constants = new Constants.Calculation();
|
var constants = new Constants.Calculation();
|
||||||
var preparedValues = requestCalculation.PreparedValues;
|
var preparedValues = requestCalculation.PreparedValues;
|
||||||
|
|
||||||
@ -25,9 +27,23 @@ public static partial class CalculateManager
|
|||||||
|
|
||||||
var currentTableTLMTracker = requestCalculation?.TableTLMTracker?.Current;
|
var currentTableTLMTracker = requestCalculation?.TableTLMTracker?.Current;
|
||||||
var nextTableTLMTracker = requestCalculation?.TableTLMTracker?.Next;
|
var nextTableTLMTracker = requestCalculation?.TableTLMTracker?.Next;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NEXT
|
* CURRENT
|
||||||
*/
|
*/
|
||||||
|
var currentDateColumn = new DateColumn(preparedValues.Nmper.Current + 1);
|
||||||
|
currentDateColumn.ComputeValues(currentTablePayments);
|
||||||
|
|
||||||
|
var currentDateTempColumn =
|
||||||
|
new DateTempColumn(preparedValues.Nmper.Current + 1);
|
||||||
|
currentDateTempColumn.ComputeValues(preparedValues, currentDateColumn);
|
||||||
|
/*
|
||||||
|
* CURRENT
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NEXT
|
||||||
|
*/
|
||||||
var nextDateColumn = new DateColumnVT1(preparedValues.Nmper.Next + 1);
|
var nextDateColumn = new DateColumnVT1(preparedValues.Nmper.Next + 1);
|
||||||
nextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
nextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
||||||
|
|
||||||
@ -88,7 +104,7 @@ public static partial class CalculateManager
|
|||||||
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
var nextCashflowMSFOColumn = new CashflowMSFOColumn();
|
||||||
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
nextCashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
||||||
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
nextSubsidyExpensesColumn, nextNSIBBruttoGrColumn, nextTableInsurance, nextDateTempColumn,
|
||||||
nextTlmDateColumn);
|
nextTlmDateColumn, currentDateTempColumn);
|
||||||
|
|
||||||
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
var nextCashflowMSFOForNIColumn = new CashflowMSFOForNIColumn();
|
||||||
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
nextCashflowMSFOForNIColumn.ComputeValues(preparedValues, nextValues, nextDateTempColumn,
|
||||||
@ -109,7 +125,7 @@ public static partial class CalculateManager
|
|||||||
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
nextSumCurrentColumn.ComputeValues(nextSumWithVATColumn);
|
||||||
|
|
||||||
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
var nextSumCurrentNegativeColumn = new SumCurrentNegativeColumn(preparedValues.Nmper.Next + 1);
|
||||||
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance);
|
nextSumCurrentNegativeColumn.ComputeValues(nextDateTempColumn, nextTableInsurance, currentDateTempColumn);
|
||||||
|
|
||||||
var nextSumCurrentInterestColumn =
|
var nextSumCurrentInterestColumn =
|
||||||
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
new SumCurrentInterestColumn(nextCashflowMSFOForNIColumn.Values.Length);
|
||||||
@ -133,7 +149,7 @@ public static partial class CalculateManager
|
|||||||
nextCashflowMSFOFinal2Column.ComputeValues(nextCashflowMSFOFinalColumn, nextDateTempColumn,
|
nextCashflowMSFOFinal2Column.ComputeValues(nextCashflowMSFOFinalColumn, nextDateTempColumn,
|
||||||
preparedValues);
|
preparedValues);
|
||||||
|
|
||||||
var nextSumCreditColumn = new SumCreditColumn(preparedValues.LoanRatePeriod + 2);
|
var nextSumCreditColumn = new SumCreditColumnVT1(preparedValues.LoanRatePeriod + 2);
|
||||||
nextSumCreditColumn.ComputeValues(preparedValues, nextSumWithVATColumn);
|
nextSumCreditColumn.ComputeValues(preparedValues, nextSumWithVATColumn);
|
||||||
|
|
||||||
var nextCreditColumn = new CreditColumn(preparedValues.LoanRatePeriod + 4);
|
var nextCreditColumn = new CreditColumn(preparedValues.LoanRatePeriod + 4);
|
||||||
@ -154,12 +170,27 @@ public static partial class CalculateManager
|
|||||||
var nextCashflowNSIBColumn = new CashflowNSIBColumn(nextValues.Nmper + 1);
|
var nextCashflowNSIBColumn = new CashflowNSIBColumn(nextValues.Nmper + 1);
|
||||||
nextCashflowNSIBColumn.ComputeValues(nextNSIBBruttoGrColumn, nextRevenueColumn);
|
nextCashflowNSIBColumn.ComputeValues(nextNSIBBruttoGrColumn, nextRevenueColumn);
|
||||||
|
|
||||||
|
var nextCreditPaymentColumn = new CreditPaymentColumn(preparedValues.LoanRatePeriod + 4);
|
||||||
|
nextCreditPaymentColumn.ComputeValues(preparedValues, nextSumCreditColumn, nextCreditColumn);
|
||||||
|
|
||||||
|
var nextVATRecoverableColumn = new VATRecoverableColumn(64, preparedValues);
|
||||||
|
nextVATRecoverableColumn.ComputeValues(nextVATColumn);
|
||||||
|
|
||||||
|
nextValues.ComputeAcquisitionExpensesWithVAT(nextTableInsurance);
|
||||||
|
|
||||||
|
var nextCashflowMSFOWithCFColumn = new CashflowMSFOWithCFColumn(0, preparedValues, nextCashflowMSFOFinal2Column,
|
||||||
|
nextCreditPaymentColumn, nextValues, nextSumCreditColumn, nextVATRecoverableColumn, nextDateTempColumn);
|
||||||
|
nextCashflowMSFOWithCFColumn.ComputeValues();
|
||||||
|
|
||||||
|
var nextPiColumn = new PIColumn(61, nextCashflowMSFOFinal2Column, nextCashflowMSFOWithCFColumn, preparedValues);
|
||||||
|
nextPiColumn.ComputeValues();
|
||||||
|
|
||||||
|
|
||||||
nextValues.ComputeNiAtInception(currentTablePayments);
|
nextValues.ComputeNiAtInception(currentTablePayments);
|
||||||
nextValues.ComputeNiAtInceptionMSFO();
|
nextValues.ComputeNiAtInceptionMSFO();
|
||||||
/*
|
/*
|
||||||
* NEXT
|
* NEXT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var postValues = new v2.PostValues(preparedValues);
|
var postValues = new v2.PostValues(preparedValues);
|
||||||
postValues.ComputeContractEconomy(nextCashflowMSFOColumn, nextCreditColumn);
|
postValues.ComputeContractEconomy(nextCashflowMSFOColumn, nextCreditColumn);
|
||||||
@ -201,7 +232,11 @@ public static partial class CalculateManager
|
|||||||
nextCreditVATColumn,
|
nextCreditVATColumn,
|
||||||
nextNSIBExpensesColumn,
|
nextNSIBExpensesColumn,
|
||||||
nextCashflowNSIBColumn,
|
nextCashflowNSIBColumn,
|
||||||
nextRevenueColumn
|
nextRevenueColumn,
|
||||||
|
nextCreditPaymentColumn,
|
||||||
|
nextVATRecoverableColumn,
|
||||||
|
nextCashflowMSFOWithCFColumn,
|
||||||
|
nextPiColumn,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using EvoCalculator.Core.Calculation.Tools;
|
||||||
using EvoCalculator.Core.Models.Calculation.Models.Prepared;
|
using EvoCalculator.Core.Models.Calculation.Models.Prepared;
|
||||||
using EvoCalculator.Core.Models.Calculation.Models.Request;
|
using EvoCalculator.Core.Models.Calculation.Models.Request;
|
||||||
using EvoCalculator.Core.Tools.Validation;
|
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
namespace EvoCalculator.Core.Tests.Calculation;
|
namespace EvoCalculator.Core.Tests.Calculation;
|
||||||
|
|||||||
@ -215,7 +215,7 @@ public class CashflowMsfoColumnTests
|
|||||||
var cashflowMSFOColumn = new CashflowMSFOColumn();
|
var cashflowMSFOColumn = new CashflowMSFOColumn();
|
||||||
cashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
cashflowMSFOColumn.ComputeValues(nextValues, preparedValues, nextSumColumn, nextTlmCostColumn,
|
||||||
nextSubsidyExpensesColumn, nextNsibBruttoGrColumn, tableInsurance.Next, nextDateTempColumn,
|
nextSubsidyExpensesColumn, nextNsibBruttoGrColumn, tableInsurance.Next, nextDateTempColumn,
|
||||||
nextTlmDateColumn);
|
nextTlmDateColumn, currentDateTempColumn);
|
||||||
|
|
||||||
const double expectedIRR = -0.82516899;
|
const double expectedIRR = -0.82516899;
|
||||||
const double expectedNominal = -1.62313616;
|
const double expectedNominal = -1.62313616;
|
||||||
|
|||||||
@ -74,7 +74,7 @@ public class SumCurrentNegativeTests
|
|||||||
|
|
||||||
|
|
||||||
var sumCurrentNegativeColumn = new SumCurrentNegativeColumn(dateTempColumn.Values.Length);
|
var sumCurrentNegativeColumn = new SumCurrentNegativeColumn(dateTempColumn.Values.Length);
|
||||||
sumCurrentNegativeColumn.ComputeValues(dateTempColumn, tableInsurance.Next);
|
sumCurrentNegativeColumn.ComputeValues(dateTempColumn, tableInsurance.Next, currentDateTempColumn);
|
||||||
|
|
||||||
var expected = new[]
|
var expected = new[]
|
||||||
{
|
{
|
||||||
|
|||||||
@ -0,0 +1,55 @@
|
|||||||
|
using EvoCalculator.Core.Base.Columns;
|
||||||
|
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared;
|
||||||
|
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared.lib;
|
||||||
|
using EvoCalculator.Core.PostCalculation.v2.Columns.Next;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
namespace EvoCalculator.Core.Tests.PostCalculation.v2;
|
||||||
|
|
||||||
|
public class SumCreditColumnTests
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void ComputeValues_ShouldComputeValuesCorrectly()
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
var column = new SumCreditColumnVT2(14);
|
||||||
|
var preparedValues = new PreparedValues
|
||||||
|
{
|
||||||
|
LoanRatePeriod = 12,
|
||||||
|
Nmper = new ChangingValue<int> { Next = 7 },
|
||||||
|
PlPriceWithVAT = 1000000,
|
||||||
|
FundingRate = 15
|
||||||
|
};
|
||||||
|
var nextSumWithVATColumn = new BaseColumnWithSum(8)
|
||||||
|
{
|
||||||
|
Values = new[]
|
||||||
|
{
|
||||||
|
1326952.67m,
|
||||||
|
230000.00m,
|
||||||
|
32937.96m,
|
||||||
|
32937.96m,
|
||||||
|
32937.96m,
|
||||||
|
32937.96m,
|
||||||
|
32937.96m,
|
||||||
|
32937.96m,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Act
|
||||||
|
column.ComputeValues(preparedValues, nextSumWithVATColumn);
|
||||||
|
|
||||||
|
var expected = new[]
|
||||||
|
{
|
||||||
|
770000m,
|
||||||
|
770000m,
|
||||||
|
705833.3333m,
|
||||||
|
641666.6667m,
|
||||||
|
577500m,
|
||||||
|
513333.3333m,
|
||||||
|
1796666.667m,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.Equal(expected, column.Values);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -9,4 +9,8 @@
|
|||||||
<ProjectReference Include="..\EvoCalculator.Core.Models\EvoCalculator.Core.Models.csproj" />
|
<ProjectReference Include="..\EvoCalculator.Core.Models\EvoCalculator.Core.Models.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Validation\" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -13,4 +13,17 @@ public static partial class GroupColumns
|
|||||||
.Select((x, i) => new KeyValuePair<DateTime, decimal>(x, values.ElementAtOrDefault(i)))
|
.Select((x, i) => new KeyValuePair<DateTime, decimal>(x, values.ElementAtOrDefault(i)))
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<KeyValuePair<DateTime, decimal>> CreateMatchedLength(IEnumerable<DateTime> dates,
|
||||||
|
IEnumerable<decimal> values)
|
||||||
|
{
|
||||||
|
int minLength = Math.Min(dates.Count(), values.Count());
|
||||||
|
|
||||||
|
List<KeyValuePair<DateTime, decimal>> result = dates
|
||||||
|
.Zip(values, (date, value) => new KeyValuePair<DateTime, decimal>(date, value))
|
||||||
|
.Take(minLength)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user