feat: refine payment calculation logic in TemporaryClientRegistrationApplication
This commit is contained in:
@@ -535,14 +535,13 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
|
||||
var result = new ReviewAndPaymentViewModel();
|
||||
|
||||
int months = 0;
|
||||
months = (int)duration;
|
||||
var months = (int)duration;
|
||||
//رند کردن مبالغ کارگاه ها
|
||||
var roundAmount = (((Convert.ToInt64(totalPayment1MonthDouble))) / 1000000) * 1000000;
|
||||
double roundAmount2 = roundAmount;
|
||||
//بدست آوردن جمع کل مبالغ کارگاه بر اساس مدت قراداد
|
||||
var sumOfWorkshopsPaymentDouble = months * roundAmount2;
|
||||
result.SumOfWorkshopsPayment = sumOfWorkshopsPaymentDouble.ToMoney();
|
||||
result.SumOfWorkshopsPayment = roundAmount2.ToMoney();
|
||||
var installmentstart = (DateTime.Now).ToFarsi();
|
||||
|
||||
var originalDay = int.Parse(installmentstart.Substring(8, 2));
|
||||
@@ -660,9 +659,10 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(duration), duration, null)
|
||||
};
|
||||
|
||||
var discountAmount = (sumOfWorkshopsPaymentDouble * discount) / 100;
|
||||
var discountedPayment = sumOfWorkshopsPaymentDouble - discountAmount;
|
||||
result.Discount = discountAmount.ToMoney();
|
||||
var oneMonthDiscountAmount = (roundAmount * discount) / 100;
|
||||
var totalDiscount = oneMonthDiscountAmount * months;
|
||||
var discountedPayment = sumOfWorkshopsPaymentDouble - totalDiscount;
|
||||
result.Discount = ((double)oneMonthDiscountAmount).ToMoney();
|
||||
var taxDouble = (discountedPayment * 10)/100;
|
||||
result.ValueAddedTaxStr =taxDouble.ToMoney();
|
||||
result.OneTimeWithoutTaxPaymentStr = discountedPayment.ToMoney();
|
||||
|
||||
Reference in New Issue
Block a user