fix & refactor dates
This commit is contained in:
parent
1be80f1c20
commit
92f0aa29b5
@ -16,12 +16,8 @@ namespace EvoCalculator.Core.Calculation.v1.Columns
|
||||
|
||||
Values[2] = preparedValues.DeliveryTime switch
|
||||
{
|
||||
100000000 => preparedValues.PaymentDateNew == null
|
||||
? Values[1].AddMonths(1)
|
||||
: preparedValues.PaymentDateNew ?? DateTime.MinValue,
|
||||
100000001 => preparedValues.PaymentDateNew == null
|
||||
? Values[1].AddDays(constants.DeliveryDays)
|
||||
: preparedValues.PaymentDateNew ?? DateTime.MinValue,
|
||||
100000000 => preparedValues.PaymentDateNew ?? Values[1].AddMonths(1),
|
||||
100000001 => preparedValues.PaymentDateNew ?? Values[1].AddDays(constants.DeliveryDays),
|
||||
_ => Values[2]
|
||||
};
|
||||
|
||||
|
||||
@ -8,10 +8,12 @@ namespace EvoCalculator.Core.Calculation.v1.Columns
|
||||
public DateTempColumn(int count) : base(count)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public void ComputeValues(PreparedValues preparedValues)
|
||||
{
|
||||
Values[0] = preparedValues.DogDate;
|
||||
Values[0] = preparedValues.PaymentDateNew != null && preparedValues.DeliveryTime == 100000001
|
||||
? preparedValues.PaymentDateNew.Value.AddMonths(-1)
|
||||
: preparedValues.DogDate;
|
||||
Values[1] = Values[0];
|
||||
Values[2] = preparedValues.PaymentDateNew ?? Values[1].AddMonths(1);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user