change RollcallServiceCreateTransaction

This commit is contained in:
SamSys
2025-07-20 11:27:41 +04:00
parent f1f3ff199a
commit fe20c63baf

View File

@@ -886,11 +886,38 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
var employeeCount = _context.RollCallEmployeesStatus.Where(x => employees.Contains(x.RollCallEmployeeId))
.Count(x => x.EndDate.Date == activeStatusDate.Date);
if (employeeCount > 0)
{
var workshop = _context.Workshops.FirstOrDefault(x => x.id == rollCallService.WorkshopId);
counter++;
Console.WriteLine(" number : " + counter + " - " + rollCallService.StartService.ToFarsi() + " WorkshopId : " + rollCallService.WorkshopId + " monthCount : " + monthCounter + " employeeCount : " + employeeCount);
var dailyWageYearlySalery = _context.YearlySalaries.Include(i => i.YearlySalaryItemsList).FirstOrDefault(x =>
x.StartDate.Date <= DateTime.Now.Date && x.EndDate >= DateTime.Now.Date);
var dailyWage = dailyWageYearlySalery.YearlySalaryItemsList.Where(x => x.ItemName == "مزد روزانه")
.Select(x => x.ItemValue).FirstOrDefault();
var planPercentage = _context.PlanPercentages.FirstOrDefault();
var countPersonnel = employeeCount;
var planByCountPerson = _context.InstitutionPlans
.FirstOrDefault(x => x.CountPerson == countPersonnel);
var amountForOneMonth =(((dailyWage * planPercentage.RollCallPercent) / 100) * planByCountPerson.CountPerson *
planByCountPerson.IncreasePercentage);
var amountWithoutTax = amountForOneMonth * monthCounter;
var tenPercent = amountWithoutTax * 10 / 100;
var totalAmonut = amountWithoutTax + tenPercent;
Console.WriteLine( counter + " - " + rollCallService.StartService.ToFarsi() + " - " + rollCallService.WorkshopId + " - " + monthCounter + " - " + employeeCount + $" - {amountWithoutTax}");
//Console.WriteLine(" number : " + counter + " - " + rollCallService.StartService.ToFarsi() + " - WorkshopId : " + rollCallService.WorkshopId + " - monthCount : " + monthCounter + " - employeeCount : " + employeeCount + $" - Amount : {amountWithoutTax.ToMoney()}" + $" - ten : {tenPercent.ToMoney()} total : {totalAmonut.ToMoney()}");
}
}