diff --git a/CompanyManagment.App.Contracts/TemporaryClientRegistration/ReviewAndPaymentViewModel.cs b/CompanyManagment.App.Contracts/TemporaryClientRegistration/ReviewAndPaymentViewModel.cs index 10872ead..a723ec66 100644 --- a/CompanyManagment.App.Contracts/TemporaryClientRegistration/ReviewAndPaymentViewModel.cs +++ b/CompanyManagment.App.Contracts/TemporaryClientRegistration/ReviewAndPaymentViewModel.cs @@ -79,5 +79,5 @@ public class ReviewAndPaymentViewModel public string DailyCompensation { get; set; } public string Obligation { get; set; } - + public string DiscountedAmountForOneMonth { get; set; } } \ No newline at end of file diff --git a/CompanyManagment.Application/TemporaryClientRegistrationApplication.cs b/CompanyManagment.Application/TemporaryClientRegistrationApplication.cs index 66399e98..eebf27b2 100644 --- a/CompanyManagment.Application/TemporaryClientRegistrationApplication.cs +++ b/CompanyManagment.Application/TemporaryClientRegistrationApplication.cs @@ -659,10 +659,11 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati _ => throw new ArgumentOutOfRangeException(nameof(duration), duration, null) }; - var oneMonthDiscountAmount = (roundAmount * discount) / 100; + var oneMonthDiscountAmount = (roundAmount2 * discount) / 100; var totalDiscount = oneMonthDiscountAmount * months; var discountedPayment = sumOfWorkshopsPaymentDouble - totalDiscount; - result.Discount = ((double)oneMonthDiscountAmount).ToMoney(); + result.Discount = oneMonthDiscountAmount.ToMoney(); + result.DiscountedAmountForOneMonth = (roundAmount2 - oneMonthDiscountAmount).ToMoney(); var taxDouble = (discountedPayment * 10)/100; result.ValueAddedTaxStr =taxDouble.ToMoney(); result.OneTimeWithoutTaxPaymentStr = discountedPayment.ToMoney(); diff --git a/ServiceHost/Areas/Admin/Controllers/institutionContractController.cs b/ServiceHost/Areas/Admin/Controllers/institutionContractController.cs index 07e5a2e7..5c3ee668 100644 --- a/ServiceHost/Areas/Admin/Controllers/institutionContractController.cs +++ b/ServiceHost/Areas/Admin/Controllers/institutionContractController.cs @@ -13,6 +13,7 @@ using CompanyManagment.App.Contracts.TemporaryClientRegistration; using CompanyManagment.App.Contracts.Workshop; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.EntityFrameworkCore.Metadata.Conventions; using ServiceHost.Areas.Client.Pages.Company.PaymentToEmployee; using ServiceHost.BaseControllers; @@ -625,7 +626,8 @@ public class institutionContractController : AdminBaseController ValueAddedTax = res.ValueAddedTaxStr, DailyCompensation = "0", Obligation = res.OneTimeTotalPaymentStr, - PaymentForOneMonth = res.SumOfWorkshopsPayment + PaymentForOneMonth = res.SumOfWorkshopsPayment, + DiscountedAmountForOneMonth = res.DiscountedAmountForOneMonth }; return res; @@ -676,18 +678,20 @@ public class InstitutionPlanCalculatorResponse { public string TotalAmountWithTax { get; set; } public string OneTimeTotalAmountWithoutTax { get; set; } - public string TotalTax { get; set; } - public List Installments { get; set; } public string OneTimeTotalAmount { get; set; } + public string TotalTax { get; set; } public string MonthlyTotalAmount { get; set; } public string MonthlyTotalAmountWithoutTax { get; set; } public string ContractStart { get; set; } public string ContractEnd { get; set; } - public string Discount { get; set; } public string ValueAddedTax { get; set; } public string DailyCompensation { get; set; } public string Obligation { get; set; } public string PaymentForOneMonth { get; set; } + + public string DiscountedAmountForOneMonth { get; set; } + public string Discount { get; set; } + public List Installments { get; set; } } public class WorkshopServiceCalculatorResponse