Add discounted amount calculations to institution contract responses
This commit is contained in:
@@ -79,5 +79,5 @@ public class ReviewAndPaymentViewModel
|
||||
|
||||
public string DailyCompensation { get; set; }
|
||||
public string Obligation { get; set; }
|
||||
|
||||
public string DiscountedAmountForOneMonth { get; set; }
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
@@ -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<MonthlyInstallment> 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<MonthlyInstallment> Installments { get; set; }
|
||||
}
|
||||
|
||||
public class WorkshopServiceCalculatorResponse
|
||||
|
||||
Reference in New Issue
Block a user