Merge branch 'Feature/InstitutionContract/upgrade' into Main
This commit is contained in:
@@ -1,11 +1,27 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
||||
|
||||
public class InsitutionContractAmendmentPaymentResponse
|
||||
{
|
||||
public List<InsitutionContractAmendmentPaymentWorkshopResponse> workshops { get; set; }
|
||||
public InstitutionContractPaymentOneTimeViewModel OneTime { get; set; }
|
||||
public InstitutionContractPaymentMonthlyViewModel Monthly { get; set; }
|
||||
public string ContractStart { get; set; }
|
||||
public string ContractEnd { get; set; }
|
||||
public string OneMonthAmount { get; set; }
|
||||
public string TotalAmount { get; set; }
|
||||
}
|
||||
|
||||
public class InsitutionContractAmendmentPaymentWorkshopResponse
|
||||
{
|
||||
public WorkshopServicesViewModel OldServices { get; set; }
|
||||
public WorkshopServicesViewModel NewServices { get; set; }
|
||||
|
||||
public bool IsNewWorkshop { get; set; }
|
||||
|
||||
public int PrevPersonnelCount { get; set; }
|
||||
public int NewPersonnelCount { get; set; }
|
||||
|
||||
public double Price { get; set; }
|
||||
}
|
||||
@@ -2464,6 +2464,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
var tax = baseAmount*0.10;
|
||||
var totalPayment = tax+baseAmount;
|
||||
|
||||
|
||||
|
||||
var res = new InsitutionContractAmendmentPaymentResponse()
|
||||
{
|
||||
@@ -2471,6 +2472,40 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
ContractEnd = amendmentEnd.ToFarsi(),
|
||||
OneMonthAmount = sumOneMonth.ToMoney(),
|
||||
TotalAmount = baseAmount.ToMoney(),
|
||||
workshops = institutionContractAmendmentTemp.NewWorkshops
|
||||
.Select(x=>
|
||||
{
|
||||
var prevWorkshop = institutionContractAmendmentTemp.PrevWorkshops
|
||||
.FirstOrDefault(w=> w.Id == x.Id);
|
||||
var isNewWorkshop = prevWorkshop == null;
|
||||
return new InsitutionContractAmendmentPaymentWorkshopResponse()
|
||||
{
|
||||
IsNewWorkshop = isNewWorkshop,
|
||||
NewPersonnelCount = x.CountPerson,
|
||||
PrevPersonnelCount = prevWorkshop?.CountPerson??0,
|
||||
Price = x.PriceDifference,
|
||||
OldServices = prevWorkshop != null? new WorkshopServicesViewModel()
|
||||
{
|
||||
Contract = prevWorkshop.ContractAndCheckout,
|
||||
ContractInPerson = prevWorkshop.ContractAndCheckoutInPerson,
|
||||
CustomizeCheckout = prevWorkshop.CustomizeCheckout,
|
||||
Insurance = prevWorkshop.Insurance,
|
||||
InsuranceInPerson = prevWorkshop.InsuranceInPerson,
|
||||
RollCall = prevWorkshop.RollCall,
|
||||
RollCallInPerson = prevWorkshop.RollCallInPerson,
|
||||
}: new WorkshopServicesViewModel(),
|
||||
NewServices = new WorkshopServicesViewModel()
|
||||
{
|
||||
Contract = x.ContractAndCheckout,
|
||||
ContractInPerson = x.ContractAndCheckoutInPerson,
|
||||
CustomizeCheckout = x.CustomizeCheckout,
|
||||
Insurance = x.Insurance,
|
||||
InsuranceInPerson = x.InsuranceInPerson,
|
||||
RollCall = x.RollCall,
|
||||
RollCallInPerson = x.RollCallInPerson,
|
||||
},
|
||||
};
|
||||
}).ToList()
|
||||
};
|
||||
|
||||
res.OneTime = new InstitutionContractPaymentOneTimeViewModel()
|
||||
|
||||
Reference in New Issue
Block a user