Clean code pt.1
This commit is contained in:
parent
f5290339c5
commit
a7beb1212e
@ -20,14 +20,16 @@ namespace EvoCalculator.Core.Base.Columns
|
||||
{
|
||||
if (i < Values.Length) return Values[i];
|
||||
|
||||
return (T)Convert.ChangeType(0.0, typeof(T));
|
||||
return (T) Convert.ChangeType(0.0, typeof(T));
|
||||
}
|
||||
|
||||
public T[] GetValues(int from = 0) =>
|
||||
from switch
|
||||
public T[] GetValues(int from = 0)
|
||||
{
|
||||
return from switch
|
||||
{
|
||||
0 => Values,
|
||||
_ => Values.Skip(from).ToArray()
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -14,7 +14,6 @@ namespace EvoCalculator.Core.Base.Columns
|
||||
|
||||
protected BaseColumnWithNominal()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public double Nominal => (Math.Pow(IRR + 1, (double) 1 / 12) - 1) * 12;
|
||||
|
||||
@ -7,11 +7,6 @@ namespace EvoCalculator.Core.Base.Columns
|
||||
{
|
||||
public class BaseColumnWithXIRR : BaseColumn<decimal>
|
||||
{
|
||||
public void RoundValues(int precision = 2)
|
||||
{
|
||||
this.Values = this.Values.Select(x => Math.Round(x, precision)).ToArray();
|
||||
}
|
||||
|
||||
protected BaseColumnWithXIRR(int count, BaseColumn<DateTime> dateTempColumn) : base(count)
|
||||
{
|
||||
Dates = dateTempColumn.Values;
|
||||
@ -51,5 +46,10 @@ namespace EvoCalculator.Core.Base.Columns
|
||||
return XIRR.GetResult();
|
||||
}
|
||||
}
|
||||
|
||||
public void RoundValues(int precision = 2)
|
||||
{
|
||||
Values = Values.Select(x => Math.Round(x, precision)).ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -6,8 +6,8 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EvoCalculator.Core.FinanceFormulas\EvoCalculator.Core.FinanceFormulas.csproj" />
|
||||
<ProjectReference Include="..\EvoCalculator.Core.Models\EvoCalculator.Core.Models.csproj" />
|
||||
<ProjectReference Include="..\EvoCalculator.Core.FinanceFormulas\EvoCalculator.Core.FinanceFormulas.csproj"/>
|
||||
<ProjectReference Include="..\EvoCalculator.Core.Models\EvoCalculator.Core.Models.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@ -6,14 +6,14 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EvoCalculator.Core.Base\EvoCalculator.Core.Base.csproj" />
|
||||
<ProjectReference Include="..\EvoCalculator.Core.FinanceFormulas\EvoCalculator.Core.FinanceFormulas.csproj" />
|
||||
<ProjectReference Include="..\EvoCalculator.Core.Models\EvoCalculator.Core.Models.csproj" />
|
||||
<ProjectReference Include="..\EvoCalculator.Core.Tools\EvoCalculator.Core.Tools.csproj" />
|
||||
<ProjectReference Include="..\EvoCalculator.Core.Base\EvoCalculator.Core.Base.csproj"/>
|
||||
<ProjectReference Include="..\EvoCalculator.Core.FinanceFormulas\EvoCalculator.Core.FinanceFormulas.csproj"/>
|
||||
<ProjectReference Include="..\EvoCalculator.Core.Models\EvoCalculator.Core.Models.csproj"/>
|
||||
<ProjectReference Include="..\EvoCalculator.Core.Tools\EvoCalculator.Core.Tools.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@ -15,7 +15,7 @@ namespace EvoCalculator.Core.Calculation.v1.Columns
|
||||
Values[1] = 0;
|
||||
for (var i = 2; i < Values.Length - 1; i++)
|
||||
Values[i] = preparedValues.BalanceHolder == 100000001
|
||||
? (decimal)preparedValues.DeprecationTime *
|
||||
? (decimal) preparedValues.DeprecationTime *
|
||||
(preparedValues.AcceptSum - Values.Skip(2).Take(i - 1).Sum(x => x)) / 100
|
||||
: 0;
|
||||
|
||||
|
||||
@ -11,9 +11,9 @@ namespace EvoCalculator.Core.Calculation.v1.Columns
|
||||
|
||||
public void ComputeValues(PreparedValues preparedValues, PostValues.PostValues postValues)
|
||||
{
|
||||
Values[2] = -postValues.BonusBase.Value * (decimal)preparedValues.DirectorBonus *
|
||||
(decimal)(1 + preparedValues.SalaryRate) *
|
||||
(decimal)preparedValues.MarketRate * (decimal)preparedValues.DistrictRate;
|
||||
Values[2] = -postValues.BonusBase.Value * (decimal) preparedValues.DirectorBonus *
|
||||
(decimal) (1 + preparedValues.SalaryRate) *
|
||||
(decimal) preparedValues.MarketRate * (decimal) preparedValues.DistrictRate;
|
||||
Values[0] = Sum;
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,9 +14,9 @@ namespace EvoCalculator.Core.Calculation.v1.Columns
|
||||
{
|
||||
Values[2] = cashflowMsfoColumn.Nominal >= preparedValues.IRR_MSFO_Plan
|
||||
? -1 * postValues.BonusBase.Value *
|
||||
(decimal)(cashflowMsfoColumn.Nominal / preparedValues.IRR_MSFO_Plan - 1) *
|
||||
(decimal)preparedValues.ExtraBonus * (decimal)(1 + preparedValues.SalaryRate) *
|
||||
(decimal)preparedValues.MarketRate * (decimal)preparedValues.DistrictRate
|
||||
(decimal) (cashflowMsfoColumn.Nominal / preparedValues.IRR_MSFO_Plan - 1) *
|
||||
(decimal) preparedValues.ExtraBonus * (decimal) (1 + preparedValues.SalaryRate) *
|
||||
(decimal) preparedValues.MarketRate * (decimal) preparedValues.DistrictRate
|
||||
: 0;
|
||||
Values[0] = Sum;
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ namespace EvoCalculator.Core.Calculation.v1.Columns
|
||||
{
|
||||
for (var i = 1; i < Values.Length; i++)
|
||||
Values[i] = Math.Pow(1 + cashflowMSFOColumn.IRR,
|
||||
(double)(dateTempColumn.Values[i] - dateTempColumn.Values[i - 1]).Days / 365) - 1;
|
||||
(double) (dateTempColumn.Values[i] - dateTempColumn.Values[i - 1]).Days / 365) - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -22,7 +22,7 @@ namespace EvoCalculator.Core.Calculation.v1.Columns
|
||||
public void ComputeValues(IRRGrColumn irrGrColumn, NIColumn niColumn)
|
||||
{
|
||||
for (var i = 2; i < Values.Length; i++)
|
||||
Values[i] = niColumn.Values[i - 1] * (decimal)irrGrColumn.Values[i];
|
||||
Values[i] = niColumn.Values[i - 1] * (decimal) irrGrColumn.Values[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -15,9 +15,9 @@ namespace EvoCalculator.Core.Calculation.v1.Columns
|
||||
if (i < 13)
|
||||
Values[i] = kaskoNmperGrColumn.Values[i] * 1;
|
||||
else if (i <= 24)
|
||||
Values[i] = kaskoNmperGrColumn.Values[i] * (decimal)0.7;
|
||||
Values[i] = kaskoNmperGrColumn.Values[i] * (decimal) 0.7;
|
||||
else
|
||||
Values[i] = kaskoNmperGrColumn.Values[i] * (decimal)0.5;
|
||||
Values[i] = kaskoNmperGrColumn.Values[i] * (decimal) 0.5;
|
||||
|
||||
Values[0] = Sum;
|
||||
}
|
||||
|
||||
@ -19,7 +19,9 @@ namespace EvoCalculator.Core.Calculation.v1.Columns
|
||||
public void ComputeValues(PreparedValues preparedValues, Constants.Calculation constants)
|
||||
{
|
||||
if (preparedValues.NmperInsurance < constants.MaxOnePolicePeriod)
|
||||
{
|
||||
Values[1] = preparedValues.InsuranceKasko;
|
||||
}
|
||||
else
|
||||
{
|
||||
var InsuranceKaskoMonth = preparedValues.NmperInsurance >= constants.MaxOnePolicePeriod
|
||||
@ -27,11 +29,9 @@ namespace EvoCalculator.Core.Calculation.v1.Columns
|
||||
: preparedValues.InsuranceKasko / preparedValues.NmperInsurance;
|
||||
for (var i = 1; i < preparedValues.NmperInsurance; i += 12)
|
||||
if (i <= preparedValues.NmperInsurance)
|
||||
{
|
||||
Values[i] = preparedValues.NmperInsurance - i + 1 >= constants.MaxOnePolicePeriod
|
||||
? InsuranceKaskoMonth * 12
|
||||
: InsuranceKaskoMonth * (preparedValues.NmperInsurance - i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
Values[0] = -XNPV;
|
||||
|
||||
@ -13,14 +13,14 @@ namespace EvoCalculator.Core.Calculation.v1.Columns
|
||||
public void ComputeValues(PreparedValues preparedValues, PostValues.PostValues postValues)
|
||||
{
|
||||
Values[1] = -1 * (preparedValues.RatBonus + preparedValues.NsBonus + preparedValues.NsibBonus) *
|
||||
(decimal)(1 + preparedValues.SalaryRate) *
|
||||
(decimal)preparedValues.MarketRate * (decimal)preparedValues.DistrictRate;
|
||||
(decimal) (1 + preparedValues.SalaryRate) *
|
||||
(decimal) preparedValues.MarketRate * (decimal) preparedValues.DistrictRate;
|
||||
|
||||
Values[2] = preparedValues.BonusFix > 0
|
||||
? -preparedValues.BonusFix
|
||||
: -1 * postValues.BonusBase.Value * Convert.ToDecimal(preparedValues.Bonus) *
|
||||
(decimal)(1 + preparedValues.SalaryRate) *
|
||||
(decimal)preparedValues.MarketRate * (decimal)preparedValues.DistrictRate;
|
||||
(decimal) (1 + preparedValues.SalaryRate) *
|
||||
(decimal) preparedValues.MarketRate * (decimal) preparedValues.DistrictRate;
|
||||
|
||||
|
||||
for (var i = 3; i < Values.Length; i++) Values[i] = 0;
|
||||
|
||||
@ -11,7 +11,7 @@ namespace EvoCalculator.Core.Calculation.v1.Columns
|
||||
public void ComputeValues(BaseColumn<decimal> cashflowNpvColumn, NPVWeightColumn npvWeightColumn)
|
||||
{
|
||||
for (var i = 0; i < Values.Length; i++)
|
||||
Values[i] = cashflowNpvColumn.GetValue(i) * (decimal)npvWeightColumn.GetValue(i);
|
||||
Values[i] = cashflowNpvColumn.GetValue(i) * (decimal) npvWeightColumn.GetValue(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -11,7 +11,7 @@ namespace EvoCalculator.Core.Calculation.v1.Columns
|
||||
public void ComputeValues(CashflowNPVFinal2Column cashflowNpvFinal2Column, NPVWeightColumn npvWeightColumn)
|
||||
{
|
||||
for (var i = 0; i < Values.Length; i++)
|
||||
Values[i] = cashflowNpvFinal2Column.GetValue(i) * (decimal)npvWeightColumn.GetValue(i);
|
||||
Values[i] = cashflowNpvFinal2Column.GetValue(i) * (decimal) npvWeightColumn.GetValue(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -11,7 +11,7 @@ namespace EvoCalculator.Core.Calculation.v1.Columns
|
||||
public void ComputeValues(CashflowNPVFinalColumn cashflowNpvFinalColumn, NPVWeightColumn npvWeightColumn)
|
||||
{
|
||||
for (var i = 0; i < Values.Length; i++)
|
||||
Values[i] = cashflowNpvFinalColumn.GetValue(i) * (decimal)npvWeightColumn.GetValue(i);
|
||||
Values[i] = cashflowNpvFinalColumn.GetValue(i) * (decimal) npvWeightColumn.GetValue(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -8,10 +8,10 @@ namespace EvoCalculator.Core.Calculation.v1.Columns
|
||||
{
|
||||
public class SumColumn : BaseColumnWithXIRR
|
||||
{
|
||||
protected readonly BaseColumn<decimal> _nsibBruttoGrColumn;
|
||||
protected readonly PercentPaymentColumn _percentPaymentColumn;
|
||||
protected readonly PostValues.PostValues _postValues;
|
||||
protected readonly PreparedValues _preparedValues;
|
||||
protected readonly BaseColumn<decimal> _nsibBruttoGrColumn;
|
||||
|
||||
public SumColumn(int count, BaseColumn<DateTime> dateTempColumn, PreparedValues preparedValues,
|
||||
PercentPaymentColumn percentPaymentColumn,
|
||||
@ -41,14 +41,10 @@ namespace EvoCalculator.Core.Calculation.v1.Columns
|
||||
throw new Exception(
|
||||
"Первый платеж по графику более 50% от суммы лизинговых платежей. Необходимо уменьшить первый платеж");
|
||||
|
||||
for (int i = 2; i < Values.Length - 1; i++)
|
||||
{
|
||||
for (var i = 2; i < Values.Length - 1; i++)
|
||||
if (GetValue(i) < _nsibBruttoGrColumn.GetValue(i))
|
||||
{
|
||||
throw new Exception(
|
||||
"Невозможно осуществить расчет графика. При заданных параметрах лизинговый платеж не покрывает расходы по НСИБ. Исключите НСИБ или увеличьте лизинговые платежи");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -21,9 +21,9 @@ namespace EvoCalculator.Core.Calculation.v1.Columns
|
||||
{
|
||||
for (var i = 7; i < Values.Length; i++)
|
||||
Values[i] = sumCurrentColumn.Values[i] + sumCurrentNegativeColumn.Values[i] -
|
||||
sumCurrentTlmColumn.Values[i] * (1 + (decimal)calculation.VatValue) -
|
||||
sumCurrentInterestColumn.Values[i] * (1 + (decimal)calculation.VatValue) *
|
||||
(decimal)preparedValues.Repayment;
|
||||
sumCurrentTlmColumn.Values[i] * (1 + (decimal) calculation.VatValue) -
|
||||
sumCurrentInterestColumn.Values[i] * (1 + (decimal) calculation.VatValue) *
|
||||
(decimal) preparedValues.Repayment;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -23,9 +23,9 @@ namespace EvoCalculator.Core.Calculation.v1.Columns
|
||||
Values[0] = 0;
|
||||
Values[1] = _preparedValues.FirstPaymentWithNdsAbs > 0
|
||||
? _preparedValues.FirstPaymentWithNdsAbs
|
||||
: (decimal)(1 + _constants.VatValue) * _sumColumn.Values[1];
|
||||
: (decimal) (1 + _constants.VatValue) * _sumColumn.Values[1];
|
||||
for (var i = 2; i < Values.Length; i++)
|
||||
Values[i] = (decimal)(1 + _constants.VatValue) * _sumColumn.Values[i];
|
||||
Values[i] = (decimal) (1 + _constants.VatValue) * _sumColumn.Values[i];
|
||||
|
||||
Values[0] = Sum;
|
||||
}
|
||||
|
||||
@ -17,18 +17,18 @@ namespace EvoCalculator.Core.Calculation.v1.Columns
|
||||
GPSExpensesColumn gpsExpensesColumn)
|
||||
{
|
||||
for (var i = 1; i < Values.Length; i++)
|
||||
Values[i] = (decimal)constants.IncomeTaxValue * (sumColumn.GetValue(i)
|
||||
- acceptInsuranceColumn.GetValue(i)
|
||||
- deprecationColumn.GetValue(i)
|
||||
+ ratExpensesColumn.GetValue(i)
|
||||
+ registrExpensesColumn.GetValue(i)
|
||||
+ comissionBonusExpensesColumn.GetValue(i)
|
||||
+ transExpensesColumn.GetValue(i)
|
||||
+ npvBonusExpensesColumn.GetValue(i)
|
||||
+ agentComissionExpensesColumn.GetValue(i)
|
||||
+ insuranceBonusExpensesColumn.GetValue(i)
|
||||
+ tlmExpensesColumn.GetValue(i)
|
||||
+ gpsExpensesColumn.GetValue(i)
|
||||
Values[i] = (decimal) constants.IncomeTaxValue * (sumColumn.GetValue(i)
|
||||
- acceptInsuranceColumn.GetValue(i)
|
||||
- deprecationColumn.GetValue(i)
|
||||
+ ratExpensesColumn.GetValue(i)
|
||||
+ registrExpensesColumn.GetValue(i)
|
||||
+ comissionBonusExpensesColumn.GetValue(i)
|
||||
+ transExpensesColumn.GetValue(i)
|
||||
+ npvBonusExpensesColumn.GetValue(i)
|
||||
+ agentComissionExpensesColumn.GetValue(i)
|
||||
+ insuranceBonusExpensesColumn.GetValue(i)
|
||||
+ tlmExpensesColumn.GetValue(i)
|
||||
+ gpsExpensesColumn.GetValue(i)
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -20,8 +20,8 @@ namespace EvoCalculator.Core.Calculation.v1.Columns
|
||||
Values[0] = 0;
|
||||
Values[1] = preparedValues.FirstPaymentNdsAbs > 0
|
||||
? preparedValues.FirstPaymentNdsAbs
|
||||
: (decimal)constants.VatValue * sumColumn.Values[1];
|
||||
for (var i = 2; i < Values.Length; i++) Values[i] = (decimal)constants.VatValue * sumColumn.Values[i];
|
||||
: (decimal) constants.VatValue * sumColumn.Values[1];
|
||||
for (var i = 2; i < Values.Length; i++) Values[i] = (decimal) constants.VatValue * sumColumn.Values[i];
|
||||
|
||||
Values[0] = Sum;
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ namespace EvoCalculator.Core.Calculation.v1.PostValues
|
||||
Value = preparedValues.PlPrice + preparedValues.InsuranceOsago + Math.Abs(kaskoNmperGrColumn.Values[0])
|
||||
+ Math.Abs(tlmGrColumn.Values[0]) + Math.Abs(gpsGrColumn.Values[0]) + preparedValues.Rats +
|
||||
preparedValues.Registration + preparedValues.TrackerCost +
|
||||
preparedValues.TLMCost + preparedValues.TransportTaxGr * (decimal)preparedValues.Leasing0K +
|
||||
preparedValues.TLMCost + preparedValues.TransportTaxGr * (decimal) preparedValues.Leasing0K +
|
||||
preparedValues.NsibBrutto;
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,8 +10,8 @@ namespace EvoCalculator.Core.Calculation.v1.PostValues
|
||||
public void ComputeValue(PreparedValues preparedValues, BaseColumnWithSum npvBonusExpensesColumn)
|
||||
{
|
||||
Value = Math.Abs(npvBonusExpensesColumn.Values[0]) -
|
||||
Math.Abs(npvBonusExpensesColumn.Values[0]) * (decimal)preparedValues.SalaryRate /
|
||||
(decimal)(1 + preparedValues.SalaryRate);
|
||||
Math.Abs(npvBonusExpensesColumn.Values[0]) * (decimal) preparedValues.SalaryRate /
|
||||
(decimal) (1 + preparedValues.SalaryRate);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -9,7 +9,7 @@ namespace EvoCalculator.Core.Calculation.v1.PostValues
|
||||
{
|
||||
public void ComputeValue(PreparedValues preparedValues, NPVColumn npvColumn)
|
||||
{
|
||||
Value = npvColumn.Values.Sum(x => (double)x) / (double)preparedValues.NpvBase;
|
||||
Value = npvColumn.Values.Sum(x => (double) x) / (double) preparedValues.NpvBase;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -7,7 +7,7 @@ namespace EvoCalculator.Core.Calculation.v1.PostValues
|
||||
{
|
||||
public void ComputeValue(PreparedValues preparedValues, PostValues postValues)
|
||||
{
|
||||
Value = (double)postValues.PriceUP.Value / (double)preparedValues.PriceUpTotal;
|
||||
Value = (double) postValues.PriceUP.Value / (double) preparedValues.PriceUpTotal;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -7,7 +7,7 @@ namespace EvoCalculator.Core.Calculation.v1.PostValues
|
||||
{
|
||||
public void ComputeValue(PreparedValues preparedValues, PostValues postValues)
|
||||
{
|
||||
Value = (double)postValues.PriceUP_Year.Value / (double)preparedValues.PriceUpTotal;
|
||||
Value = (double) postValues.PriceUP_Year.Value / (double) preparedValues.PriceUpTotal;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4,10 +4,23 @@ using EvoCalculator.Core.Models.Calculation.Models.Prepared;
|
||||
|
||||
namespace EvoCalculator.Core.Calculation.v2.Columns
|
||||
{
|
||||
public class BaseCashflowMSFOColumn : EvoCalculator.Core.Calculation.v1.Columns.BaseCashflowMSFOColumn
|
||||
public class BaseCashflowMSFOColumn : v1.Columns.BaseCashflowMSFOColumn
|
||||
{
|
||||
protected readonly SubsidyExpensesColumn _subsidyExpensesColumn;
|
||||
|
||||
public BaseCashflowMSFOColumn(int count, DateTempColumn dateTempColumn, PostValues.PostValues postValues,
|
||||
PreparedValues preparedValues, PercentPaymentColumn percentPaymentColumn, SumColumn sumColumn,
|
||||
NegativeCashflowColumn negativeCashflowColumn, NSIBBruttoGrColumn nsibBruttoGrColumn,
|
||||
BaseColumn<decimal> tlmGrColumn, BaseColumn<decimal> gpsGrColumn, BaseColumnWithSum npvBonusExpensesColumn,
|
||||
AgentComissionExpensesColumn agentComissionExpensesColumn, SubsidyExpensesColumn subsidyExpensesColumn) :
|
||||
base(count, dateTempColumn, postValues,
|
||||
preparedValues, percentPaymentColumn, sumColumn, negativeCashflowColumn, nsibBruttoGrColumn,
|
||||
tlmGrColumn,
|
||||
gpsGrColumn, npvBonusExpensesColumn, agentComissionExpensesColumn)
|
||||
{
|
||||
_subsidyExpensesColumn = subsidyExpensesColumn;
|
||||
}
|
||||
|
||||
protected override void FillValues()
|
||||
{
|
||||
Values[0] = -_preparedValues.AcquisitionExpenses - _preparedValues.FuelCardSum;
|
||||
@ -23,18 +36,5 @@ namespace EvoCalculator.Core.Calculation.v2.Columns
|
||||
+ _agentComissionExpensesColumn.Values[i]
|
||||
+ _subsidyExpensesColumn.Values[i];
|
||||
}
|
||||
|
||||
public BaseCashflowMSFOColumn(int count, DateTempColumn dateTempColumn, PostValues.PostValues postValues,
|
||||
PreparedValues preparedValues, PercentPaymentColumn percentPaymentColumn, SumColumn sumColumn,
|
||||
NegativeCashflowColumn negativeCashflowColumn, NSIBBruttoGrColumn nsibBruttoGrColumn,
|
||||
BaseColumn<decimal> tlmGrColumn, BaseColumn<decimal> gpsGrColumn, BaseColumnWithSum npvBonusExpensesColumn,
|
||||
AgentComissionExpensesColumn agentComissionExpensesColumn, SubsidyExpensesColumn subsidyExpensesColumn) :
|
||||
base(count, dateTempColumn, postValues,
|
||||
preparedValues, percentPaymentColumn, sumColumn, negativeCashflowColumn, nsibBruttoGrColumn,
|
||||
tlmGrColumn,
|
||||
gpsGrColumn, npvBonusExpensesColumn, agentComissionExpensesColumn)
|
||||
{
|
||||
_subsidyExpensesColumn = subsidyExpensesColumn;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -11,18 +11,12 @@ namespace EvoCalculator.Core.Calculation.v2.Columns
|
||||
|
||||
public void ComputeValues(PreparedValues preparedValues, SumCreditColumn sumCreditColumn)
|
||||
{
|
||||
Values[1] = -sumCreditColumn.GetValue(1) * (decimal)preparedValues.LoanRate / 12;
|
||||
Values[1] = -sumCreditColumn.GetValue(1) * (decimal) preparedValues.LoanRate / 12;
|
||||
for (var i = 2; i < Values.Length; i++)
|
||||
{
|
||||
if (GetValue(i - 1) < 0)
|
||||
{
|
||||
Values[i] = -sumCreditColumn.GetValue(i - 1) * (decimal)preparedValues.LoanRate / 12;
|
||||
}
|
||||
Values[i] = -sumCreditColumn.GetValue(i - 1) * (decimal) preparedValues.LoanRate / 12;
|
||||
else
|
||||
{
|
||||
Values[i] = 0;
|
||||
}
|
||||
}
|
||||
Values[0] = Sum;
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,11 +11,11 @@ namespace EvoCalculator.Core.Calculation.v2.Columns
|
||||
|
||||
public void ComputeValues(PreparedValues preparedValues, PostValues.PostValues postValues)
|
||||
{
|
||||
Values[2] = -1 * (postValues.BonusBase.Value * (decimal)preparedValues.DirectorBonus *
|
||||
(decimal)(1 + preparedValues.SalaryRate) *
|
||||
(decimal)preparedValues.MarketRate * (decimal)preparedValues.DistrictRate
|
||||
+ preparedValues.DirectorBonusNsib * (decimal)(1 + preparedValues.SalaryRate) +
|
||||
preparedValues.RegionalDirectorBonusNsib * (decimal)(1 + preparedValues.SalaryRate));
|
||||
Values[2] = -1 * (postValues.BonusBase.Value * (decimal) preparedValues.DirectorBonus *
|
||||
(decimal) (1 + preparedValues.SalaryRate) *
|
||||
(decimal) preparedValues.MarketRate * (decimal) preparedValues.DistrictRate
|
||||
+ preparedValues.DirectorBonusNsib * (decimal) (1 + preparedValues.SalaryRate) +
|
||||
preparedValues.RegionalDirectorBonusNsib * (decimal) (1 + preparedValues.SalaryRate));
|
||||
Values[0] = Sum;
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,7 +18,9 @@ namespace EvoCalculator.Core.Calculation.v2.Columns
|
||||
public void ComputeValues(PreparedValues preparedValues, Constants.Calculation constants)
|
||||
{
|
||||
if (preparedValues.NmperInsurance < constants.MaxOnePolicePeriod)
|
||||
{
|
||||
Values[1] = preparedValues.InsuranceKasko;
|
||||
}
|
||||
else
|
||||
{
|
||||
var InsuranceKaskoMonth = preparedValues.NmperInsurance >= constants.MaxOnePolicePeriod
|
||||
@ -26,11 +28,9 @@ namespace EvoCalculator.Core.Calculation.v2.Columns
|
||||
: preparedValues.InsuranceKasko / preparedValues.NmperInsurance;
|
||||
for (var i = 1; i < preparedValues.NmperInsurance; i += 12)
|
||||
if (i <= preparedValues.NmperInsurance)
|
||||
{
|
||||
Values[i] = preparedValues.NmperInsurance - i + 1 >= constants.MaxOnePolicePeriod
|
||||
? InsuranceKaskoMonth * 12
|
||||
: InsuranceKaskoMonth * (preparedValues.NmperInsurance - i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
Values[0] = -Sum;
|
||||
|
||||
@ -13,13 +13,13 @@ namespace EvoCalculator.Core.Calculation.v2.Columns
|
||||
public void ComputeValues(PreparedValues preparedValues, PostValues.PostValues postValues)
|
||||
{
|
||||
Values[1] = -1 * (preparedValues.RatBonus + preparedValues.NsBonus + preparedValues.NsibBonus) *
|
||||
(decimal)(1 + preparedValues.SalaryRate);
|
||||
(decimal) (1 + preparedValues.SalaryRate);
|
||||
|
||||
Values[2] = preparedValues.BonusFix > 0
|
||||
? -preparedValues.BonusFix
|
||||
: -1 * postValues.BonusBase.Value * Convert.ToDecimal(preparedValues.Bonus) *
|
||||
(decimal)(1 + preparedValues.SalaryRate) *
|
||||
(decimal)preparedValues.MarketRate * (decimal)preparedValues.DistrictRate;
|
||||
(decimal) (1 + preparedValues.SalaryRate) *
|
||||
(decimal) preparedValues.MarketRate * (decimal) preparedValues.DistrictRate;
|
||||
|
||||
|
||||
for (var i = 3; i < Values.Length; i++) Values[i] = 0;
|
||||
|
||||
@ -5,7 +5,7 @@ using EvoCalculator.Core.Models.Calculation.Models.Prepared;
|
||||
|
||||
namespace EvoCalculator.Core.Calculation.v2.Columns
|
||||
{
|
||||
public class SumColumn : EvoCalculator.Core.Calculation.v1.Columns.SumColumn
|
||||
public class SumColumn : v1.Columns.SumColumn
|
||||
{
|
||||
public SumColumn(int count, BaseColumn<DateTime> dateTempColumn, PreparedValues preparedValues,
|
||||
PercentPaymentColumn percentPaymentColumn, v1.PostValues.PostValues postValues,
|
||||
|
||||
@ -12,20 +12,14 @@ namespace EvoCalculator.Core.Calculation.v2.Columns
|
||||
public void ComputeValues(PreparedValues preparedValues, PostValues.PostValues postValues
|
||||
, Constants.Calculation constants, SumColumn sumColumn)
|
||||
{
|
||||
Values[1] = (postValues.BaseCost.Value - sumColumn.GetValue(1)) * (1 + (decimal)constants.VatValue);
|
||||
Values[1] = (postValues.BaseCost.Value - sumColumn.GetValue(1)) * (1 + (decimal) constants.VatValue);
|
||||
Values[2] = Values[1];
|
||||
|
||||
for (var i = 3; i < Values.Length; i++)
|
||||
{
|
||||
if (GetValue(i - 1) > 0)
|
||||
{
|
||||
Values[i] = GetValue(i - 1) - GetValue(2) / preparedValues.LoanRatePeriod;
|
||||
}
|
||||
else
|
||||
{
|
||||
Values[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -20,22 +20,22 @@ namespace EvoCalculator.Core.Calculation.v2.Columns
|
||||
GPSExpensesColumn gpsExpensesColumn, SubsidyExpensesColumn subsidyExpensesColumn)
|
||||
{
|
||||
for (var i = 1; i < Values.Length; i++)
|
||||
Values[i] = (decimal)constants.IncomeTaxValue * (sumColumn.GetValue(i)
|
||||
- acceptInsuranceColumn.GetValue(i)
|
||||
- deprecationColumn.GetValue(i)
|
||||
+ ratExpensesColumn.GetValue(i)
|
||||
+ registrExpensesColumn.GetValue(i)
|
||||
+ comissionBonusExpensesColumn.GetValue(i)
|
||||
+ transExpensesColumn.GetValue(i)
|
||||
+ npvBonusExpensesColumn.GetValue(i)
|
||||
+ agentComissionExpensesColumn.GetValue(i)
|
||||
+ insuranceBonusExpensesColumn.GetValue(i)
|
||||
+ tlmExpensesColumn.GetValue(i)
|
||||
+ gpsExpensesColumn.GetValue(i)
|
||||
+ subsidyExpensesColumn.GetValue(i)
|
||||
- (i == 1
|
||||
? preparedValues.SubsidySum
|
||||
: 0)
|
||||
Values[i] = (decimal) constants.IncomeTaxValue * (sumColumn.GetValue(i)
|
||||
- acceptInsuranceColumn.GetValue(i)
|
||||
- deprecationColumn.GetValue(i)
|
||||
+ ratExpensesColumn.GetValue(i)
|
||||
+ registrExpensesColumn.GetValue(i)
|
||||
+ comissionBonusExpensesColumn.GetValue(i)
|
||||
+ transExpensesColumn.GetValue(i)
|
||||
+ npvBonusExpensesColumn.GetValue(i)
|
||||
+ agentComissionExpensesColumn.GetValue(i)
|
||||
+ insuranceBonusExpensesColumn.GetValue(i)
|
||||
+ tlmExpensesColumn.GetValue(i)
|
||||
+ gpsExpensesColumn.GetValue(i)
|
||||
+ subsidyExpensesColumn.GetValue(i)
|
||||
- (i == 1
|
||||
? preparedValues.SubsidySum
|
||||
: 0)
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -1,9 +1,14 @@
|
||||
namespace EvoCalculator.Core.Calculation.v2.PostValues
|
||||
{
|
||||
public class PostValues : EvoCalculator.Core.Calculation.v1.PostValues.PostValues
|
||||
public class PostValues : v1.PostValues.PostValues
|
||||
{
|
||||
public ContractEconomy ContractEconomy;
|
||||
|
||||
public PostValues()
|
||||
{
|
||||
ContractEconomy = new ContractEconomy();
|
||||
}
|
||||
|
||||
public override object GetValues()
|
||||
{
|
||||
return new
|
||||
@ -19,10 +24,5 @@
|
||||
ContractEconomy = ContractEconomy.Value
|
||||
};
|
||||
}
|
||||
|
||||
public PostValues()
|
||||
{
|
||||
ContractEconomy = new ContractEconomy();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -7,7 +7,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@ -7,12 +7,12 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EvoCalculator.Core.Models\EvoCalculator.Core.Models.csproj" />
|
||||
<ProjectReference Include="..\EvoCalculator.Core.Models\EvoCalculator.Core.Models.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="TridentGoalSeek" Version="1.0.5" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1"/>
|
||||
<PackageReference Include="TridentGoalSeek" Version="1.0.5"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@ -25,7 +25,7 @@ namespace EvoCalculator.Core.FinanceFormulas
|
||||
return
|
||||
(from item in _flows
|
||||
let days = -(item.Date - startDate).Days
|
||||
select (double)item.Value * Math.Pow(1 + _rate, (double)days / 365)).Sum();
|
||||
select (double) item.Value * Math.Pow(1 + _rate, (double) days / 365)).Sum();
|
||||
}
|
||||
|
||||
public double GetResultPrime()
|
||||
@ -33,7 +33,7 @@ namespace EvoCalculator.Core.FinanceFormulas
|
||||
var startDate = _flows.OrderBy(i => i.Date).First().Date;
|
||||
return (from item in _flows
|
||||
let daysRatio = -(item.Date - startDate).Days / 365
|
||||
select (double)item.Value * daysRatio * Math.Pow(1.0 + _rate, daysRatio - 1)).Sum();
|
||||
select (double) item.Value * daysRatio * Math.Pow(1.0 + _rate, daysRatio - 1)).Sum();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -101,7 +101,7 @@ namespace EvoCalculator.Core.Models.Calculation.Models.Prepared
|
||||
|
||||
public decimal CalculationCost => PlPrice +
|
||||
(Insurance + Rats + Registration + TrackerCost +
|
||||
TLMCost + TransportTaxGr) * (decimal)Leasing0K;
|
||||
TLMCost + TransportTaxGr) * (decimal) Leasing0K;
|
||||
|
||||
public decimal TlmCostPaymentSum { get; set; }
|
||||
public decimal GpsCostPaymentSum { get; set; }
|
||||
@ -138,7 +138,7 @@ namespace EvoCalculator.Core.Models.Calculation.Models.Prepared
|
||||
|
||||
public decimal DogCredit => PlPrice +
|
||||
(Insurance + Rats + Registration + TrackerCost + TLMCost + TransportTaxGr) *
|
||||
(decimal)Leasing0K -
|
||||
(decimal) Leasing0K -
|
||||
FirstPaymentSum +
|
||||
NsibNetto * 12 / Nmper -
|
||||
(Leasing0K != 1 ? 0 : Discount);
|
||||
|
||||
@ -6,12 +6,12 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EvoCalculator.Core.Constants\EvoCalculator.Core.Constants.csproj" />
|
||||
<ProjectReference Include="..\EvoCalculator.Core.Constants\EvoCalculator.Core.Constants.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="TridentGoalSeek" Version="1.0.5" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1"/>
|
||||
<PackageReference Include="TridentGoalSeek" Version="1.0.5"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@ -4,8 +4,8 @@ namespace EvoCalculator.Core.Models.PostCalculation.Models.Prepared.Validation
|
||||
{
|
||||
public class Required : ValidationAttribute
|
||||
{
|
||||
private bool _current;
|
||||
private bool _next;
|
||||
private readonly bool _current;
|
||||
private readonly bool _next;
|
||||
|
||||
public Required(bool current, bool next, string errorMessage)
|
||||
{
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared;
|
||||
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared.lib;
|
||||
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared.PreparedTables;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
|
||||
namespace EvoCalculator.Core.Models.PostCalculation.Models.Request
|
||||
{
|
||||
@ -23,19 +22,15 @@ namespace EvoCalculator.Core.Models.PostCalculation.Models.Request
|
||||
{
|
||||
var errors = new List<ValidationResult>();
|
||||
|
||||
if (this.TablePayments.Current[0].SumPayment /
|
||||
(this.PreparedValues.PlPrice.Next - PreparedValues.Discount.Next) >= 0.500001m)
|
||||
{
|
||||
if (TablePayments.Current[0].SumPayment /
|
||||
(PreparedValues.PlPrice.Next - PreparedValues.Discount.Next) >= 0.500001m)
|
||||
errors.Add(new ValidationResult(
|
||||
"Первый платеж по графику более 50% от стоимости ПЛ с учетом скидки. Необходимо уменьшить первый платеж"));
|
||||
}
|
||||
|
||||
if (PreparedValues.CalcType == 100000003 &&
|
||||
PreparedValues.Nmper.Next - PreparedValues.EditPaymentNumber > 1)
|
||||
{
|
||||
errors.Add(
|
||||
new ValidationResult("При досрочном выкупе недопустимый срок сворачивания графика"));
|
||||
}
|
||||
|
||||
|
||||
return errors;
|
||||
|
||||
@ -5,9 +5,9 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EvoCalculator.Core.Base\EvoCalculator.Core.Base.csproj" />
|
||||
<ProjectReference Include="..\EvoCalculator.Core.Calculation\EvoCalculator.Core.Calculation.csproj" />
|
||||
<ProjectReference Include="..\EvoCalculator.Core.Tools\EvoCalculator.Core.Tools.csproj" />
|
||||
<ProjectReference Include="..\EvoCalculator.Core.Base\EvoCalculator.Core.Base.csproj"/>
|
||||
<ProjectReference Include="..\EvoCalculator.Core.Calculation\EvoCalculator.Core.Calculation.csproj"/>
|
||||
<ProjectReference Include="..\EvoCalculator.Core.Tools\EvoCalculator.Core.Tools.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using EvoCalculator.Core.Base.Columns;
|
||||
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared.PreparedTables;
|
||||
|
||||
@ -13,10 +12,7 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Current
|
||||
|
||||
public void ComputeValues(TablePaymentsRow[] currentTablePayments)
|
||||
{
|
||||
for (var i = 1; i < Values.Length; i++)
|
||||
{
|
||||
Values[i] = currentTablePayments[i - 1].DatePayment;
|
||||
}
|
||||
for (var i = 1; i < Values.Length; i++) Values[i] = currentTablePayments[i - 1].DatePayment;
|
||||
|
||||
Values[0] = Values[1];
|
||||
}
|
||||
|
||||
@ -15,10 +15,7 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Current
|
||||
{
|
||||
Values[0] = -(preparedValues.BaseCost + preparedValues.FuelCardSum);
|
||||
Values[1] = currentTablePayments[0].SumPayment + preparedValues.SubsidySum;
|
||||
for (var i = 2; i < Values.Length; i++)
|
||||
{
|
||||
Values[i] = currentTablePayments[i - 1].SumPayment;
|
||||
}
|
||||
for (var i = 2; i < Values.Length; i++) Values[i] = currentTablePayments[i - 1].SumPayment;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -9,10 +9,6 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
{
|
||||
public class CashflowMSFOColumn : BaseColumnWithNominal
|
||||
{
|
||||
public CashflowMSFOColumn()
|
||||
{
|
||||
}
|
||||
|
||||
public void ComputeValues(NextValues.NextValues nextValues
|
||||
, PreparedValues preparedValues
|
||||
, BaseColumn<decimal> nextSumColumn
|
||||
@ -26,7 +22,6 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
{
|
||||
var costInsurances = Array.Empty<decimal>();
|
||||
if (nextTableInsurance != null)
|
||||
{
|
||||
costInsurances = nextTableInsurance
|
||||
.Where(ins =>
|
||||
ins.PeriodNumberInsurance > 1
|
||||
@ -35,13 +30,9 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
.OrderBy(x => x.TypeRiskInsurance)
|
||||
.Select(x => -x.CostInsurance)
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
var tlmCosts = Array.Empty<decimal>();
|
||||
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(
|
||||
new[] {-nextValues.AcquisitionExpenses.Value - preparedValues.FuelCardSum}
|
||||
@ -58,14 +49,10 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
);
|
||||
|
||||
var nextTLMDates = Array.Empty<DateTime>();
|
||||
if (nextTLMDateColumn != null)
|
||||
{
|
||||
nextTLMDates = nextTLMDateColumn.Values.Skip(1).ToArray();
|
||||
}
|
||||
if (nextTLMDateColumn != null) nextTLMDates = nextTLMDateColumn.Values.Skip(1).ToArray();
|
||||
|
||||
var dateStartPeriodInsurances = Array.Empty<DateTime>();
|
||||
if (nextTableInsurance != null)
|
||||
{
|
||||
dateStartPeriodInsurances = nextTableInsurance
|
||||
.Where(ins =>
|
||||
ins.PeriodNumberInsurance > 1
|
||||
@ -74,7 +61,6 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
.OrderBy(x => x.TypeRiskInsurance)
|
||||
.Select(x => x.DateStartPeriodInsurance)
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
Dates = Array<DateTime>.Concat(
|
||||
new[] {nextDateTempColumn.GetValue(0)}
|
||||
@ -94,7 +80,7 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
{
|
||||
if (Values.Length != Dates.Length)
|
||||
throw new Exception(
|
||||
$"Ошибка во время расчета столбца {this.GetType().Name}: не совпадает длина массива значений");
|
||||
$"Ошибка во время расчета столбца {GetType().Name}: не совпадает длина массива значений");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -7,17 +7,13 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
{
|
||||
public class CashflowMSFOFinal2Column : BaseColumnWithNominal
|
||||
{
|
||||
public CashflowMSFOFinal2Column()
|
||||
{
|
||||
}
|
||||
|
||||
public void ComputeValues(CashflowMSFOFinalColumn nextCashflowMSFOFinalColumn,
|
||||
BaseColumn<DateTime> nextDateTempColumn,
|
||||
PreparedValues preparedValues)
|
||||
{
|
||||
Dates = Array<DateTime>.Concat(nextCashflowMSFOFinalColumn.Dates, new[] { nextDateTempColumn.GetValue(2) });
|
||||
Dates = Array<DateTime>.Concat(nextCashflowMSFOFinalColumn.Dates, new[] {nextDateTempColumn.GetValue(2)});
|
||||
Values = Array<decimal>.Concat(nextCashflowMSFOFinalColumn.Values,
|
||||
new[] { -preparedValues.BonusDirector });
|
||||
new[] {-preparedValues.BonusDirector});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -7,16 +7,12 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
{
|
||||
public class CashflowMSFOFinalColumn : BaseColumnWithNominal
|
||||
{
|
||||
public CashflowMSFOFinalColumn()
|
||||
{
|
||||
}
|
||||
|
||||
public void ComputeValues(CashflowMSFOColumn nextCashflowMSFOColumn, BaseColumn<DateTime> nextDateTempColumn,
|
||||
PreparedValues preparedValues)
|
||||
{
|
||||
Dates = Array<DateTime>.Concat(nextCashflowMSFOColumn.Dates, new[] { nextDateTempColumn.GetValue(2) });
|
||||
Dates = Array<DateTime>.Concat(nextCashflowMSFOColumn.Dates, new[] {nextDateTempColumn.GetValue(2)});
|
||||
Values = Array<decimal>.Concat(nextCashflowMSFOColumn.Values,
|
||||
new[] { -preparedValues.BonusManagerLeasingExtra });
|
||||
new[] {-preparedValues.BonusManagerLeasingExtra});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -12,10 +12,6 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
{
|
||||
public DateTime[] Dates;
|
||||
|
||||
public CashflowMSFOForNIColumn()
|
||||
{
|
||||
}
|
||||
|
||||
public void ComputeValues(PreparedValues preparedValues
|
||||
, NextValues.NextValues nextValues
|
||||
, BaseColumn<DateTime> nextDateTempColumn
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using EvoCalculator.Core.Base.Columns;
|
||||
using EvoCalculator.Core.Base.Interfaces.Columns;
|
||||
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared;
|
||||
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared.PreparedTables;
|
||||
using TridentGoalSeek;
|
||||
using EvoCalculator.Core.Base.Columns;
|
||||
|
||||
namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
{
|
||||
|
||||
@ -11,18 +11,12 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
|
||||
public void ComputeValues(PreparedValues preparedValues, BaseColumn<decimal> nextSumCreditColumn)
|
||||
{
|
||||
Values[1] = -nextSumCreditColumn.GetValue(1) * (decimal)preparedValues.LoanRate / 12;
|
||||
Values[1] = -nextSumCreditColumn.GetValue(1) * (decimal) preparedValues.LoanRate / 12;
|
||||
for (var i = 2; i < Values.Length; i++)
|
||||
{
|
||||
if (GetValue(i - 1) < 0)
|
||||
{
|
||||
Values[i] = -nextSumCreditColumn.GetValue(i - 1) * (decimal)preparedValues.LoanRate / 12;
|
||||
}
|
||||
Values[i] = -nextSumCreditColumn.GetValue(i - 1) * (decimal) preparedValues.LoanRate / 12;
|
||||
else
|
||||
{
|
||||
Values[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Values[0] = Sum;
|
||||
}
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
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;
|
||||
@ -15,14 +14,12 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
public void ComputeValues(PreparedValues preparedValues, TablePaymentsRow[] currentTablePayments)
|
||||
{
|
||||
for (var i = 1; i < Values.Length; i++)
|
||||
{
|
||||
if (i < preparedValues.EditPaymentNumber)
|
||||
Values[i] = currentTablePayments[i - 1].DatePayment;
|
||||
else if (i == preparedValues.EditPaymentNumber)
|
||||
Values[i] = preparedValues.EditPaymentDate.Next.AddMonths(preparedValues.MonthOffset);
|
||||
else
|
||||
Values[i] = Values[i - 1].AddMonths(1);
|
||||
}
|
||||
Values[0] = Values[1];
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,12 +14,10 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
public void ComputeValues(PreparedValues preparedValues, TablePaymentsRow[] currentTablePayments)
|
||||
{
|
||||
for (var i = 1; i < Values.Length; i++)
|
||||
{
|
||||
if (i <= preparedValues.EditPaymentNumber)
|
||||
Values[i] = currentTablePayments[i - 1].DatePayment;
|
||||
else
|
||||
Values[i] = Values[i - 1].AddMonths(1);
|
||||
}
|
||||
|
||||
Values[0] = Values[1];
|
||||
}
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using EvoCalculator.Core.Base.Columns;
|
||||
using EvoCalculator.Core.Tools.Check;
|
||||
using EvoCalculator.Core.Tools.GroupColumns;
|
||||
@ -18,7 +17,7 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
public void ComputeValues(BaseColumn<decimal> nextNIColumn, BaseColumn<double> nextIRRGrColumn)
|
||||
{
|
||||
for (var i = 2; i < Values.Length; i++)
|
||||
Values[i] = nextNIColumn.Values[i - 1] * (decimal)nextIRRGrColumn.Values[i];
|
||||
Values[i] = nextNIColumn.Values[i - 1] * (decimal) nextIRRGrColumn.Values[i];
|
||||
}
|
||||
|
||||
public void PostCheck(BaseColumn<decimal> nextSumColumn
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using EvoCalculator.Core.Base.Columns;
|
||||
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared;
|
||||
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared.PreparedTables;
|
||||
@ -9,22 +8,11 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
{
|
||||
public class NSIBBruttoGrColumn : BaseColumnWithSum, IGoalSeekAlgorithm
|
||||
{
|
||||
private readonly PreparedValues _preparedValues;
|
||||
private readonly TablePaymentsRow[] _currentTablePayments;
|
||||
private readonly BaseColumn<decimal> _nextSumColumn;
|
||||
private readonly PreparedValues _preparedValues;
|
||||
|
||||
private double[] _ratios;
|
||||
|
||||
private void ComputeRatios()
|
||||
{
|
||||
var targetMaxNextSumPayment =
|
||||
_nextSumColumn.Values
|
||||
.Where((x, i) => i >= _preparedValues.EditPaymentNumber)
|
||||
.Max(x => x);
|
||||
|
||||
for (var i = _preparedValues.EditPaymentNumber; i < Values.Length; i++)
|
||||
_ratios[i] = (double) (_nextSumColumn.GetValue(i) / targetMaxNextSumPayment);
|
||||
}
|
||||
private readonly double[] _ratios;
|
||||
|
||||
|
||||
public NSIBBruttoGrColumn(int count, PreparedValues preparedValues, TablePaymentsRow[] currentTablePayments,
|
||||
@ -43,16 +31,25 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
return Values.Skip(_preparedValues.EditPaymentNumber).Sum(v => v);
|
||||
}
|
||||
|
||||
private void ComputeRatios()
|
||||
{
|
||||
var targetMaxNextSumPayment =
|
||||
_nextSumColumn.Values
|
||||
.Where((x, i) => i >= _preparedValues.EditPaymentNumber)
|
||||
.Max(x => x);
|
||||
|
||||
for (var i = _preparedValues.EditPaymentNumber; i < Values.Length; i++)
|
||||
_ratios[i] = (double) (_nextSumColumn.GetValue(i) / targetMaxNextSumPayment);
|
||||
}
|
||||
|
||||
|
||||
private void FillValues(decimal x)
|
||||
{
|
||||
for (var i = 1; i < Values.Length - (_preparedValues.LastPaymentFix ? 1 : 0); i++)
|
||||
{
|
||||
if (i < _preparedValues.EditPaymentNumber)
|
||||
Values[i] = _currentTablePayments[i - 1].NSIBBruttoPayment;
|
||||
else
|
||||
Values[i] = x * (decimal) _ratios[i];
|
||||
}
|
||||
|
||||
Values[0] = Sum;
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
var futureNSIBExpensesPayments = currentTablePayments
|
||||
.Where((x, i) => i >= nextValues.Nmper.Value - 1)
|
||||
.Sum(x => x.NSIBExpensesPayment);
|
||||
if (preparedValues.LastPaymentFix == true)
|
||||
if (preparedValues.LastPaymentFix)
|
||||
{
|
||||
Values[^2] = futureNSIBExpensesPayments;
|
||||
Values[^1] = 0;
|
||||
|
||||
@ -21,7 +21,7 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
var futureRevenuePayments = currentTablePayments
|
||||
.Where((x, i) => i >= nextValues.Nmper.Value - 1)
|
||||
.Sum(x => x.NSIBRevenuePayment);
|
||||
if (preparedValues.LastPaymentFix == true)
|
||||
if (preparedValues.LastPaymentFix)
|
||||
{
|
||||
Values[^2] = futureRevenuePayments;
|
||||
Values[^1] = 0;
|
||||
|
||||
@ -9,13 +9,27 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
{
|
||||
public class BaseSumColumn : BaseColumnWithNominal
|
||||
{
|
||||
protected readonly PreparedValues _preparedValues;
|
||||
protected readonly NextValues.NextValues _nextValues;
|
||||
protected readonly TablePaymentsRow[] _currentTablePayments;
|
||||
protected readonly TablePaymentsRow[] _nextTablePayments;
|
||||
protected readonly NextValues.NextValues _nextValues;
|
||||
protected readonly PreparedValues _preparedValues;
|
||||
|
||||
protected double[] _ratios;
|
||||
|
||||
public BaseSumColumn(int count, BaseColumn<DateTime> dateTempColumn, PreparedValues preparedValues,
|
||||
NextValues.NextValues nextValues, TablePaymentsRow[] currentTablePayments
|
||||
, TablePaymentsRow[] nextTablePayments)
|
||||
: base(count, dateTempColumn)
|
||||
{
|
||||
_preparedValues = preparedValues;
|
||||
_nextValues = nextValues;
|
||||
_currentTablePayments = currentTablePayments;
|
||||
_nextTablePayments = nextTablePayments;
|
||||
|
||||
_ratios = new double[count];
|
||||
ComputeRatios();
|
||||
}
|
||||
|
||||
public virtual void ComputeValues(decimal x)
|
||||
{
|
||||
}
|
||||
@ -35,23 +49,9 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
|
||||
for (var i = targetCurrentPayments[0].NumberPayment; i < _ratios.Length; i++)
|
||||
if (i < _currentTablePayments.Length)
|
||||
_ratios[i] = (double)(_currentTablePayments[i - 1].SumPayment / targetMaxSumPayment);
|
||||
_ratios[i] = (double) (_currentTablePayments[i - 1].SumPayment / targetMaxSumPayment);
|
||||
else
|
||||
_ratios[i] = (double)(_currentTablePayments[^2].SumPayment / targetMaxSumPayment);
|
||||
}
|
||||
|
||||
public BaseSumColumn(int count, BaseColumn<DateTime> dateTempColumn, PreparedValues preparedValues,
|
||||
NextValues.NextValues nextValues, TablePaymentsRow[] currentTablePayments
|
||||
, TablePaymentsRow[] nextTablePayments)
|
||||
: base(count, dateTempColumn)
|
||||
{
|
||||
_preparedValues = preparedValues;
|
||||
_nextValues = nextValues;
|
||||
_currentTablePayments = currentTablePayments;
|
||||
_nextTablePayments = nextTablePayments;
|
||||
|
||||
_ratios = new double[count];
|
||||
ComputeRatios();
|
||||
_ratios[i] = (double) (_currentTablePayments[^2].SumPayment / targetMaxSumPayment);
|
||||
}
|
||||
|
||||
|
||||
@ -60,14 +60,15 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
Values[0] = -(_nextValues.BaseCost.Value + _preparedValues.FuelCardSum);
|
||||
Values[1] = _currentTablePayments[0].SumPayment + _preparedValues.SubsidySum;
|
||||
for (var i = 2; i < Values.Length - 1; i++)
|
||||
{
|
||||
if (i < _preparedValues.EditPaymentNumber)
|
||||
{
|
||||
Values[i] = _currentTablePayments[i - 1].SumPayment;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_nextTablePayments != null && _nextTablePayments
|
||||
.Select(tablePaymentsRow => tablePaymentsRow.NumberPayment)
|
||||
.Contains(i))
|
||||
.Select(tablePaymentsRow => tablePaymentsRow.NumberPayment)
|
||||
.Contains(i))
|
||||
{
|
||||
var numberPayment = _nextTablePayments
|
||||
.FirstOrDefault(tablePaymentsRow => tablePaymentsRow.NumberPayment == i)
|
||||
@ -76,15 +77,14 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
}
|
||||
else
|
||||
{
|
||||
Values[i] = x * (decimal)_ratios[i];
|
||||
Values[i] = x * (decimal) _ratios[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Values[^1] = _preparedValues.LastPaymentFix switch
|
||||
{
|
||||
true => _currentTablePayments[^1].SumPayment,
|
||||
_ => x * (decimal)_ratios[^2]
|
||||
_ => x * (decimal) _ratios[^2]
|
||||
};
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
checkTools.CheckColumnForLessThanZeroValue(Values);
|
||||
checkTools.CheckColumnForZeroValue(Values.Skip(2));
|
||||
|
||||
if (Values[1] / Values.Skip(1).Sum() >= (decimal)0.5)
|
||||
if (Values[1] / Values.Skip(1).Sum() >= (decimal) 0.5)
|
||||
throw new Exception(
|
||||
"Первый платеж по графику более 50% от суммы лизинговых платежей. Необходимо уменьшить первый платеж. Измените параметры для расчета.");
|
||||
}
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using EvoCalculator.Core.Base.Columns;
|
||||
using EvoCalculator.Core.Base.Interfaces.Columns;
|
||||
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared;
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
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;
|
||||
@ -8,8 +7,8 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
{
|
||||
public class SumColumnVT3 : BaseSumColumn
|
||||
{
|
||||
private Constants.Calculation _constants;
|
||||
private BaseColumn<decimal> techNextSumRepaymentColumn;
|
||||
private readonly Constants.Calculation _constants;
|
||||
private readonly BaseColumn<decimal> techNextSumRepaymentColumn;
|
||||
|
||||
public SumColumnVT3(int count, BaseColumn<DateTime> dateTempColumn, PreparedValues preparedValues,
|
||||
NextValues.NextValues nextValues, TablePaymentsRow[] currentTablePayments,
|
||||
@ -29,9 +28,10 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
Values[0] = -(_nextValues.BaseCost.Value + _preparedValues.FuelCardSum);
|
||||
Values[1] = _currentTablePayments[0].SumPayment + _preparedValues.SubsidySum;
|
||||
for (var i = 2; i < Values.Length; i++)
|
||||
{
|
||||
if (i < _preparedValues.EditPaymentNumber)
|
||||
{
|
||||
Values[i] = _currentTablePayments[i - 1].SumPayment;
|
||||
}
|
||||
else if (i == _preparedValues.EditPaymentNumber)
|
||||
{
|
||||
if (_preparedValues.ChangeRepayment == false)
|
||||
@ -40,14 +40,17 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
else
|
||||
Values[i] = techNextSumRepaymentColumn.GetValue(i) / (decimal) (1 + _constants.VatValue);
|
||||
|
||||
if (_preparedValues.LastPaymentFix == true)
|
||||
if (_preparedValues.LastPaymentFix)
|
||||
Values[i] -= _currentTablePayments[^1].SumPayment;
|
||||
}
|
||||
else if (_preparedValues.LastPaymentFix == true)
|
||||
else if (_preparedValues.LastPaymentFix)
|
||||
{
|
||||
Values[i] = _currentTablePayments[^1].SumPayment;
|
||||
}
|
||||
else
|
||||
{
|
||||
Values[i] = Values[_preparedValues.EditPaymentNumber];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ComputeValues()
|
||||
|
||||
@ -15,20 +15,14 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
, BaseColumn<decimal> nextSumColumn)
|
||||
{
|
||||
Values[1] = Values[2] = (nextValues.BaseCost.Value - nextSumColumn.GetValue(1)) *
|
||||
(1 + (decimal)constants.VatValue);
|
||||
(1 + (decimal) constants.VatValue);
|
||||
|
||||
|
||||
for (var i = 3; i < Values.Length; i++)
|
||||
{
|
||||
if (GetValue(i - 1) > 0)
|
||||
{
|
||||
Values[i] = GetValue(i - 1) - GetValue(2) / preparedValues.LoanRatePeriod;
|
||||
}
|
||||
else
|
||||
{
|
||||
Values[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4,7 +4,6 @@ using EvoCalculator.Core.Base.Columns;
|
||||
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared.PreparedTables;
|
||||
using EvoCalculator.Core.Tools.Array;
|
||||
using EvoCalculator.Core.Tools.GroupColumns;
|
||||
using EvoCalculator.Core.Tools.GroupColumns.Models;
|
||||
|
||||
namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
{
|
||||
|
||||
@ -12,10 +12,6 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
{
|
||||
public class SumRepaymentColumn : BaseColumn<decimal>
|
||||
{
|
||||
public SumRepaymentColumn()
|
||||
{
|
||||
}
|
||||
|
||||
public void ComputeValues(PreparedValues preparedValues
|
||||
, TablePaymentsRow[] currentTablePayments
|
||||
, BaseColumn<decimal> nextSumCurrentNegativeColumn
|
||||
@ -43,18 +39,18 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
nextSumCurrentNegativeColumn.GetValues(1).Select(x => -x).ToArray())
|
||||
, GroupColumns.Create(nextDateTempColumn.GetValues(1),
|
||||
nextSumCurrentTlmColumn.GetValues(1)
|
||||
.Select(x => -x * (1 + (decimal)constants.VatValue)))
|
||||
.Select(x => -x * (1 + (decimal) constants.VatValue)))
|
||||
, GroupColumns.Create(nextCashflowMsfoForNiColumn.Dates.Skip(1), nextSumCurrentInterestColumn
|
||||
.GetValues(1)
|
||||
.Select(x => -x * (1 + (decimal)constants.VatValue) * (decimal)preparedValues.Repayment))
|
||||
.Select(x => -x * (1 + (decimal) constants.VatValue) * (decimal) preparedValues.Repayment))
|
||||
);
|
||||
|
||||
|
||||
Values = Array<decimal>.Concat(
|
||||
new[] { 0m, 0 },
|
||||
new[] {0m, 0},
|
||||
firstPart,
|
||||
GroupColumns.Split(secondPart.Skip(preparedValues.EditPaymentNumber - 1).SkipLast(1)).Values,
|
||||
new[] { nextSumWithVatColumn.Values[^1] }
|
||||
new[] {nextSumWithVatColumn.Values[^1]}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using EvoCalculator.Core.Base.Columns;
|
||||
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared;
|
||||
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared.PreparedTables;
|
||||
@ -9,11 +8,11 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
{
|
||||
public class BaseSumWithVATColumn : BaseColumnWithSum
|
||||
{
|
||||
protected PreparedValues _preparedValues;
|
||||
protected BaseSumColumn _nextSumColumn;
|
||||
protected TablePaymentsRow[] _currentTablePayments;
|
||||
protected VATColumn _nextVATColumn;
|
||||
protected Constants.Calculation _constants;
|
||||
protected TablePaymentsRow[] _currentTablePayments;
|
||||
protected BaseSumColumn _nextSumColumn;
|
||||
protected VATColumn _nextVATColumn;
|
||||
protected PreparedValues _preparedValues;
|
||||
|
||||
public BaseSumWithVATColumn(int count, PreparedValues preparedValues, BaseSumColumn nextSumColumn,
|
||||
TablePaymentsRow[] currentTablePayments, VATColumn nextVatColumn,
|
||||
@ -29,15 +28,13 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
protected void FillValues()
|
||||
{
|
||||
Values[1] = _currentTablePayments[0].SumWithVATPayment +
|
||||
_preparedValues.SubsidySum * (decimal)(1 + _constants.VatValue);
|
||||
_preparedValues.SubsidySum * (decimal) (1 + _constants.VatValue);
|
||||
|
||||
for (var i = 2; i < Values.Length; i++)
|
||||
{
|
||||
if (i < _preparedValues.EditPaymentNumber)
|
||||
Values[i] = _currentTablePayments[i - 1].SumWithVATPayment;
|
||||
else
|
||||
Values[i] = _nextSumColumn.GetValue(i) + _nextVATColumn.GetValue(i);
|
||||
}
|
||||
|
||||
Values[0] = Sum;
|
||||
}
|
||||
|
||||
@ -7,6 +7,8 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
{
|
||||
public class SumWithVATColumnVT2 : BaseSumWithVATColumn, IGoalSeekAlgorithm
|
||||
{
|
||||
private readonly NextValues.NextValues _nextValues;
|
||||
|
||||
public SumWithVATColumnVT2(int count, PreparedValues preparedValues, BaseSumColumn nextSumColumn,
|
||||
TablePaymentsRow[] currentTablePayments, VATColumn nextVatColumn, Constants.Calculation constants,
|
||||
NextValues.NextValues nextValues) : base(count, preparedValues, nextSumColumn, currentTablePayments,
|
||||
@ -15,8 +17,6 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
_nextValues = nextValues;
|
||||
}
|
||||
|
||||
private readonly NextValues.NextValues _nextValues;
|
||||
|
||||
public decimal Calculate(decimal inputVariable)
|
||||
{
|
||||
_nextSumColumn.ComputeValues(inputVariable);
|
||||
|
||||
@ -10,13 +10,13 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
{
|
||||
public class TLMCostColumn : BaseColumnWithSum
|
||||
{
|
||||
public DateTime[] Dates { get; set; }
|
||||
|
||||
public TLMCostColumn(int count, DateTime[] dates) : base(count)
|
||||
{
|
||||
Dates = dates;
|
||||
}
|
||||
|
||||
public DateTime[] Dates { get; set; }
|
||||
|
||||
public void ComputeValues(
|
||||
PreparedValues preparedValues
|
||||
, ChangingValue<TableTLMTrackerRow[]> tableTLMTracker)
|
||||
@ -63,7 +63,7 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
{
|
||||
if (Values.Length != Dates.Length)
|
||||
throw new Exception(
|
||||
$"Ошибка во время расчета столбца {this.GetType().Name}: не совпадает длина массива значений");
|
||||
$"Ошибка во время расчета столбца {GetType().Name}: не совпадает длина массива значений");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -19,9 +19,9 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
var year = currentDate.Year;
|
||||
var month = currentDate.Month;
|
||||
var day = DateTime.DaysInMonth(year, month);
|
||||
|
||||
|
||||
Values[i] = new DateTime(year, month, day);
|
||||
|
||||
|
||||
currentDate = currentDate.AddMonths(1);
|
||||
i++;
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
, GroupColumns.Split(groupTLMGrColumn).Values);
|
||||
Values[0] = Sum;
|
||||
}
|
||||
|
||||
|
||||
public void PostCheck()
|
||||
{
|
||||
new CheckTools().CheckColumnForLessThanZeroValue(Values);
|
||||
|
||||
@ -19,14 +19,12 @@ namespace EvoCalculator.Core.PostCalculation.v1.Columns.Next
|
||||
, TablePaymentsRow[] currentTablePayments
|
||||
, Constants.Calculation constants)
|
||||
{
|
||||
Values[1] = currentTablePayments[0].VATPayment + preparedValues.SubsidySum * (decimal)constants.VatValue;
|
||||
Values[1] = currentTablePayments[0].VATPayment + preparedValues.SubsidySum * (decimal) constants.VatValue;
|
||||
for (var i = 2; i < Values.Length; i++)
|
||||
{
|
||||
if (i < preparedValues.EditPaymentNumber)
|
||||
Values[i] = currentTablePayments[i - 1].VATPayment;
|
||||
else
|
||||
Values[i] = Math.Round(nextSumColumn.GetValue(i) * (decimal)constants.VatValue, 2);
|
||||
}
|
||||
Values[i] = Math.Round(nextSumColumn.GetValue(i) * (decimal) constants.VatValue, 2);
|
||||
}
|
||||
|
||||
public void PostCheck()
|
||||
|
||||
@ -52,7 +52,7 @@ namespace EvoCalculator.Core.PostCalculation.v1.Managers
|
||||
var techNextDateColumn = new DateColumnVT2(preparedValues.Nmper.Next + 1);
|
||||
techNextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
||||
|
||||
var techNextDateTempColumn = new Columns.Next.DateTempColumn(preparedValues.Nmper.Next + 1);
|
||||
var techNextDateTempColumn = new DateTempColumn(preparedValues.Nmper.Next + 1);
|
||||
techNextDateTempColumn.ComputeValues(preparedValues, techNextDateColumn);
|
||||
|
||||
|
||||
@ -82,7 +82,7 @@ namespace EvoCalculator.Core.PostCalculation.v1.Managers
|
||||
|
||||
var techNextSumColumn = new SumColumnVT1(preparedValues.Nmper.Next + 1, techNextDateTempColumn,
|
||||
preparedValues, nextValues, currentTablePayments, nextTablePayments);
|
||||
techNextSumColumn.ComputeValues((decimal)currentSumColumn.IRR);
|
||||
techNextSumColumn.ComputeValues((decimal) currentSumColumn.IRR);
|
||||
|
||||
var techNextVATColumn = new VATColumn(preparedValues.Nmper.Next + 1);
|
||||
techNextVATColumn.ComputeValues(preparedValues, techNextSumColumn, currentTablePayments, constants);
|
||||
@ -100,7 +100,7 @@ namespace EvoCalculator.Core.PostCalculation.v1.Managers
|
||||
var nextDateColumn = new DateColumnVT1(preparedValues.Nmper.Next + 1);
|
||||
nextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
||||
|
||||
var nextDateTempColumn = new Columns.Next.DateTempColumn(preparedValues.Nmper.Next + 1);
|
||||
var nextDateTempColumn = new DateTempColumn(preparedValues.Nmper.Next + 1);
|
||||
nextDateTempColumn.ComputeValues(preparedValues, nextDateColumn);
|
||||
|
||||
|
||||
@ -224,7 +224,7 @@ namespace EvoCalculator.Core.PostCalculation.v1.Managers
|
||||
*/
|
||||
|
||||
|
||||
return new ManagerResult()
|
||||
return new ManagerResult
|
||||
{
|
||||
NextValues = nextValues.GetValues(),
|
||||
PreparedValues = preparedValues,
|
||||
|
||||
@ -6,6 +6,7 @@ using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
||||
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
||||
using DateTempColumn = EvoCalculator.Core.PostCalculation.v1.Columns.Current.DateTempColumn;
|
||||
|
||||
namespace EvoCalculator.Core.PostCalculation.v1.Managers
|
||||
{
|
||||
@ -35,7 +36,7 @@ namespace EvoCalculator.Core.PostCalculation.v1.Managers
|
||||
currentDateColumn.ComputeValues(currentTablePayments);
|
||||
|
||||
var currentDateTempColumn =
|
||||
new Columns.Current.DateTempColumn(preparedValues.Nmper.Current + 1);
|
||||
new DateTempColumn(preparedValues.Nmper.Current + 1);
|
||||
currentDateTempColumn.ComputeValues(currentDateColumn);
|
||||
|
||||
var currentSumColumn = new SumColumn(preparedValues.Nmper.Current + 1, currentDateTempColumn);
|
||||
@ -83,7 +84,7 @@ namespace EvoCalculator.Core.PostCalculation.v1.Managers
|
||||
|
||||
var nextSumColumn = new SumColumnVT1(preparedValues.Nmper.Next + 1, nextDateTempColumn,
|
||||
preparedValues, nextValues, currentTablePayments, nextTablePayments);
|
||||
nextSumColumn.ComputeValues((decimal)currentSumColumn.IRR);
|
||||
nextSumColumn.ComputeValues((decimal) currentSumColumn.IRR);
|
||||
nextSumColumn.PostCheck();
|
||||
nextSumColumn.RoundValues();
|
||||
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using EvoCalculator.Core.Base.Columns;
|
||||
using EvoCalculator.Core.Models.PostCalculation.Models.Manager;
|
||||
using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
||||
@ -35,7 +34,7 @@ namespace EvoCalculator.Core.PostCalculation.v1.Managers
|
||||
var techNextDateColumn = new DateColumnVT2(preparedValues.Nmper.Current + 1);
|
||||
techNextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
||||
|
||||
var techNextDateTempColumn = new Columns.Next.DateTempColumn(preparedValues.Nmper.Current + 1);
|
||||
var techNextDateTempColumn = new DateTempColumn(preparedValues.Nmper.Current + 1);
|
||||
techNextDateTempColumn.ComputeValues(preparedValues, techNextDateColumn);
|
||||
|
||||
|
||||
@ -137,7 +136,7 @@ namespace EvoCalculator.Core.PostCalculation.v1.Managers
|
||||
var nextDateColumn = new DateColumnVT1(preparedValues.Nmper.Next + 1);
|
||||
nextDateColumn.ComputeValues(preparedValues, currentTablePayments);
|
||||
|
||||
var nextDateTempColumn = new Columns.Next.DateTempColumn(preparedValues.Nmper.Next + 1);
|
||||
var nextDateTempColumn = new DateTempColumn(preparedValues.Nmper.Next + 1);
|
||||
nextDateTempColumn.ComputeValues(preparedValues, nextDateColumn);
|
||||
|
||||
|
||||
@ -264,7 +263,7 @@ namespace EvoCalculator.Core.PostCalculation.v1.Managers
|
||||
*/
|
||||
|
||||
|
||||
return new ManagerResult()
|
||||
return new ManagerResult
|
||||
{
|
||||
NextValues = nextValues.GetValues(),
|
||||
PreparedValues = preparedValues,
|
||||
|
||||
@ -83,7 +83,7 @@ namespace EvoCalculator.Core.PostCalculation.v1.Managers
|
||||
|
||||
var techNextSumColumn = new SumColumnVT1(preparedValues.Nmper.Next + 1, techNextDateTempColumn,
|
||||
preparedValues, nextValues, currentTablePayments, nextTablePayments);
|
||||
techNextSumColumn.ComputeValues((decimal)currentSumColumn.IRR);
|
||||
techNextSumColumn.ComputeValues((decimal) currentSumColumn.IRR);
|
||||
|
||||
var techNextVATColumn = new VATColumn(preparedValues.Nmper.Next + 1);
|
||||
techNextVATColumn.ComputeValues(preparedValues, techNextSumColumn, currentTablePayments, constants);
|
||||
@ -227,7 +227,7 @@ namespace EvoCalculator.Core.PostCalculation.v1.Managers
|
||||
*/
|
||||
|
||||
|
||||
return new ManagerResult()
|
||||
return new ManagerResult
|
||||
{
|
||||
NextValues = nextValues.GetValues(),
|
||||
PreparedValues = preparedValues,
|
||||
|
||||
@ -6,6 +6,7 @@ using EvoCalculator.Core.Models.PostCalculation.Models.Request;
|
||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Current;
|
||||
using EvoCalculator.Core.PostCalculation.v1.Columns.Next;
|
||||
using EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper;
|
||||
using DateTempColumn = EvoCalculator.Core.PostCalculation.v1.Columns.Current.DateTempColumn;
|
||||
|
||||
namespace EvoCalculator.Core.PostCalculation.v1.Managers
|
||||
{
|
||||
@ -35,7 +36,7 @@ namespace EvoCalculator.Core.PostCalculation.v1.Managers
|
||||
currentDateColumn.ComputeValues(currentTablePayments);
|
||||
|
||||
var currentDateTempColumn =
|
||||
new Columns.Current.DateTempColumn(preparedValues.Nmper.Current + 1);
|
||||
new DateTempColumn(preparedValues.Nmper.Current + 1);
|
||||
currentDateTempColumn.ComputeValues(currentDateColumn);
|
||||
|
||||
var currentSumColumn = new SumColumn(preparedValues.Nmper.Current + 1, currentDateTempColumn);
|
||||
@ -83,7 +84,7 @@ namespace EvoCalculator.Core.PostCalculation.v1.Managers
|
||||
|
||||
var techNextSumColumn = new SumColumnVT1(preparedValues.Nmper.Next + 1, nextDateTempColumn,
|
||||
preparedValues, nextValues, currentTablePayments, nextTablePayments);
|
||||
techNextSumColumn.ComputeValues((decimal)currentSumColumn.IRR);
|
||||
techNextSumColumn.ComputeValues((decimal) currentSumColumn.IRR);
|
||||
|
||||
var techNextVATColumn = new VATColumn(preparedValues.Nmper.Next + 1);
|
||||
techNextVATColumn.ComputeValues(preparedValues, techNextSumColumn, currentTablePayments, constants);
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using EvoCalculator.Core.Base.Columns;
|
||||
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared;
|
||||
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared.lib;
|
||||
using EvoCalculator.Core.Models.PostCalculation.Models.Prepared.PreparedTables;
|
||||
using EvoCalculator.Core.Tools;
|
||||
|
||||
namespace EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper
|
||||
{
|
||||
@ -13,7 +13,7 @@ namespace EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper
|
||||
public DateTime EndDate { get; set; }
|
||||
}
|
||||
|
||||
public partial class Helper
|
||||
public class Helper
|
||||
{
|
||||
public TLMData GetTLMData(PreparedValues preparedValues
|
||||
, TableTLMTrackerRow[] currentTableTLMTracker
|
||||
@ -26,7 +26,7 @@ namespace EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper
|
||||
|
||||
DateTime startDate;
|
||||
DateTime endDate;
|
||||
if (preparedValues.ChangeTrackerTLM == true)
|
||||
if (preparedValues.ChangeTrackerTLM)
|
||||
{
|
||||
startDate = currentTableTLMTracker?[0]?.DateTLM ?? preparedValues.EditPaymentDate.Next;
|
||||
endDate = nextTableTLMTracker != null
|
||||
@ -39,7 +39,7 @@ namespace EvoCalculator.Core.PostCalculation.v1.Managers.lib.Helper
|
||||
endDate = nextDateColumn.Values[^1];
|
||||
}
|
||||
|
||||
var monthsNumber = Tools.Dates.GetMonthDifference(startDate, endDate);
|
||||
var monthsNumber = Dates.GetMonthDifference(startDate, endDate);
|
||||
|
||||
return new TLMData
|
||||
{
|
||||
|
||||
@ -38,11 +38,9 @@ namespace EvoCalculator.Core.PostCalculation.v1.NextValues
|
||||
|
||||
var nextCostInsurance = 0m;
|
||||
if (nextTableInsurance != null)
|
||||
{
|
||||
nextCostInsurance = nextTableInsurance
|
||||
.Where(x => x.TypeRiskInsurance is "KASKO" or "OSAGO" && x.PeriodNumberInsurance == 1)
|
||||
.Sum(x => x.CostInsurance);
|
||||
}
|
||||
|
||||
|
||||
Value = preparedValues.PlPrice.Next
|
||||
|
||||
@ -45,11 +45,9 @@ namespace EvoCalculator.Core.PostCalculation.v1.NextValues
|
||||
|
||||
var nextCostInsurance = 0m;
|
||||
if (nextTableInsurance != null)
|
||||
{
|
||||
nextCostInsurance = nextTableInsurance
|
||||
.Where(x => x.TypeRiskInsurance is "KASKO" or "OSAGO")
|
||||
.Sum(x => x.CostInsurance);
|
||||
}
|
||||
|
||||
Value = (preparedValues.PlPrice.Next
|
||||
+ nextCostInsurance
|
||||
|
||||
@ -2,12 +2,12 @@
|
||||
{
|
||||
public class NextValues
|
||||
{
|
||||
public BaseCost BaseCost;
|
||||
public AcquisitionExpenses AcquisitionExpenses;
|
||||
public BaseCost BaseCost;
|
||||
public NiAtInception NiAtInception;
|
||||
public SumTotal SumTotal;
|
||||
public Nmper Nmper;
|
||||
public NiAtInceptionMSFO NiAtInceptionMSFO;
|
||||
public Nmper Nmper;
|
||||
public SumTotal SumTotal;
|
||||
|
||||
public NextValues()
|
||||
{
|
||||
|
||||
@ -5,7 +5,7 @@ namespace EvoCalculator.Core.PostCalculation.v1.NextValues
|
||||
{
|
||||
public class NiAtInception : BasePostValue<decimal>
|
||||
{
|
||||
public void ComputeValue(decimal acquisitionExpenses,TablePaymentsRow[] currentTablePayments)
|
||||
public void ComputeValue(decimal acquisitionExpenses, TablePaymentsRow[] currentTablePayments)
|
||||
{
|
||||
Value = acquisitionExpenses - currentTablePayments[0].SumPayment;
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ namespace EvoCalculator.Core.Tests
|
||||
|
||||
public bool Equals(decimal x, decimal y)
|
||||
{
|
||||
return Math.Abs(x - y) < (decimal)_tolerance;
|
||||
return Math.Abs(x - y) < (decimal) _tolerance;
|
||||
}
|
||||
|
||||
public int GetHashCode(decimal obj)
|
||||
|
||||
@ -190,7 +190,7 @@ namespace EvoCalculator.Core.Tests.Calculation.v1.Columns
|
||||
|
||||
var cashflowNsibColumn = new CashflowNSIBColumn(preparedValues.Nmper + 1, dateTempColumn,
|
||||
nsibBruttoGrColumn, nsibExpensesColumn);
|
||||
cashflowNsibColumn.ComputeValues((decimal)cashflowLeasingColumn.IRR);
|
||||
cashflowNsibColumn.ComputeValues((decimal) cashflowLeasingColumn.IRR);
|
||||
|
||||
|
||||
var expected = new[]
|
||||
|
||||
@ -466,4 +466,5 @@
|
||||
// Assert.Equal(expected, values, new DecimalArrayComparer(100));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
@ -454,4 +454,5 @@
|
||||
// Assert.Equal(expected, incomeTaxColumn.Values, new DecimalArrayComparer());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
@ -99,4 +99,5 @@
|
||||
// Assert.Equal(expected, res, new DecimalArrayComparer());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
@ -331,4 +331,5 @@
|
||||
// Assert.Equal(expected, cashflowLeasingColumn.Values, new DecimalArrayComparer(0.01));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
@ -616,4 +616,5 @@
|
||||
// Assert.Equal(expected, cashflowMsfoColumn.Values, new DecimalArrayComparer());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
@ -489,4 +489,5 @@
|
||||
// Assert.Equal(expected, cashflowNpvColumn.Values, new DecimalArrayComparer(0.01));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
@ -230,4 +230,5 @@
|
||||
// Assert.Equal(expected, cashflowColumn.Values, new DecimalArrayComparer(0.01));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@ namespace EvoCalculator.Core.Tests.Calculation.v2.Columns
|
||||
816666.666666663m,
|
||||
612499.999999997m,
|
||||
408333.33333333m,
|
||||
204166.666666663m,
|
||||
204166.666666663m
|
||||
}
|
||||
};
|
||||
|
||||
@ -106,7 +106,7 @@ namespace EvoCalculator.Core.Tests.Calculation.v2.Columns
|
||||
-3572.91666666665m,
|
||||
-2381.94444444443m,
|
||||
-1190.9722222222m,
|
||||
1.93540472537279E-11m,
|
||||
1.93540472537279E-11m
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -18,14 +18,13 @@ namespace EvoCalculator.Core.Tests.Calculation.v2.Columns
|
||||
SalaryRate = 0.3,
|
||||
MarketRate = 1.00,
|
||||
DistrictRate = 1.07,
|
||||
DirectorBonusNsib = 6000,
|
||||
RegionalDirectorBonusNsib = 10000
|
||||
|
||||
DirectorBonusNsib = 6000,
|
||||
RegionalDirectorBonusNsib = 10000
|
||||
};
|
||||
|
||||
var postValues = new PostValues()
|
||||
var postValues = new PostValues
|
||||
{
|
||||
BonusBase = new BonusBase()
|
||||
BonusBase = new BonusBase
|
||||
{
|
||||
Value = 5940000m
|
||||
}
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using EvoCalculator.Core.Calculation.v1.Columns;
|
||||
using EvoCalculator.Core.Calculation.v1.Columns;
|
||||
using EvoCalculator.Core.Calculation.v2.Columns;
|
||||
using EvoCalculator.Core.Models.Calculation.Models.Prepared;
|
||||
using Xunit;
|
||||
@ -180,7 +179,7 @@ namespace EvoCalculator.Core.Tests.Calculation.v2.Columns
|
||||
|
||||
var gpsExpensesColumn = new GPSExpensesColumn(preparedValues.Nmper + 1)
|
||||
{
|
||||
Values = new Decimal[]
|
||||
Values = new decimal[]
|
||||
{
|
||||
0,
|
||||
0,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
using EvoCalculator.Core.Calculation.v2.Columns;
|
||||
using EvoCalculator.Core.Calculation.v1.PostValues;
|
||||
using EvoCalculator.Core.Calculation.v1.PostValues;
|
||||
using EvoCalculator.Core.Calculation.v2.Columns;
|
||||
using EvoCalculator.Core.Models.Calculation.Models.Prepared;
|
||||
using Xunit;
|
||||
using PostValues = EvoCalculator.Core.Calculation.v2.PostValues.PostValues;
|
||||
@ -25,9 +25,9 @@ namespace EvoCalculator.Core.Tests.Calculation.v2.Columns
|
||||
};
|
||||
|
||||
|
||||
var postValues = new PostValues()
|
||||
var postValues = new PostValues
|
||||
{
|
||||
BonusBase = new BonusBase()
|
||||
BonusBase = new BonusBase
|
||||
{
|
||||
Value = 5840000.00m
|
||||
}
|
||||
@ -68,6 +68,5 @@ namespace EvoCalculator.Core.Tests.Calculation.v2.Columns
|
||||
|
||||
Assert.Equal(expected, npvBonusExpensesColumn.Values, new DecimalArrayComparer());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -46,7 +46,7 @@ namespace EvoCalculator.Core.Tests.Calculation.v2.Columns
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -107,4 +107,5 @@
|
||||
// Assert.Equal(expected, sumCreditColumn.Values, new DecimalArrayComparer());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
@ -465,4 +465,5 @@
|
||||
// Assert.Equal(expected, values, new DecimalArrayComparer(100));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
@ -477,4 +477,5 @@
|
||||
// Assert.Equal(expected, incomeTaxColumn.Values, new DecimalArrayComparer());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
@ -9,28 +9,28 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0"/>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1"/>
|
||||
<PackageReference Include="xunit" Version="2.4.1"/>
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\EvoCalculator.Core.Calculation\EvoCalculator.Core.Calculation.csproj" />
|
||||
<ProjectReference Include="..\EvoCalculator.Core.PostCalculation\EvoCalculator.Core.PostCalculation.csproj" />
|
||||
<ProjectReference Include="..\EvoCalculator.Core.Tools\EvoCalculator.Core.Tools.csproj" />
|
||||
<ProjectReference Include="..\EvoCalculator.Core\EvoCalculator.Core.csproj" />
|
||||
<ProjectReference Include="..\EvoCalculator.Core.Calculation\EvoCalculator.Core.Calculation.csproj"/>
|
||||
<ProjectReference Include="..\EvoCalculator.Core.PostCalculation\EvoCalculator.Core.PostCalculation.csproj"/>
|
||||
<ProjectReference Include="..\EvoCalculator.Core.Tools\EvoCalculator.Core.Tools.csproj"/>
|
||||
<ProjectReference Include="..\EvoCalculator.Core\EvoCalculator.Core.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Calculation\v1" />
|
||||
<Folder Include="Calculation\v1"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@ -25,7 +25,7 @@ namespace EvoCalculator.Core.Tests.PostCalculation.v1.Columns
|
||||
|
||||
var nextValues = new NextValues
|
||||
{
|
||||
AcquisitionExpenses = new AcquisitionExpenses()
|
||||
AcquisitionExpenses = new AcquisitionExpenses
|
||||
{
|
||||
Value = 400000
|
||||
}
|
||||
@ -83,7 +83,7 @@ namespace EvoCalculator.Core.Tests.PostCalculation.v1.Columns
|
||||
PeriodNumberInsurance = 2,
|
||||
DateStartPeriodInsurance = new DateTime(2022, 01, 30),
|
||||
CostInsurance = 9999
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ namespace EvoCalculator.Core.Tests.PostCalculation.v1.Columns
|
||||
|
||||
var nextCashflowMsfoFinalColumn = new CashflowMSFOFinalColumn
|
||||
{
|
||||
Values = new decimal[]
|
||||
Values = new[]
|
||||
{
|
||||
-408000,
|
||||
300000,
|
||||
|
||||
@ -31,7 +31,7 @@ namespace EvoCalculator.Core.Tests.PostCalculation.v1.Columns
|
||||
|
||||
var nextCashflowMsfoColumn = new CashflowMSFOColumn
|
||||
{
|
||||
Values = new decimal[]
|
||||
Values = new[]
|
||||
{
|
||||
-408000,
|
||||
300000,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user