Compare commits

...

11 Commits

Author SHA1 Message Date
b29b1335d3 finish saving rollcall to original 2025-06-11 19:00:17 +03:30
24d41ffc68 add rollcall to checkout 2025-06-10 19:10:33 +03:30
SamSys
c6d4d7d473 add checkoutSaveData in MandatoryCompute 2025-06-09 18:46:46 +03:30
c594cbf523 change checkout application 2025-06-09 17:47:23 +03:30
52976d8965 add calculation for create checkout 2025-06-09 16:07:22 +03:30
ec97274d5e add checkout rollcall domain to Checkout 2025-06-09 15:07:06 +03:30
SamSys
c4d21be4aa new inurancelist bug fixed - FiexedSalary changes added 2025-06-08 16:20:30 +03:30
SamSys
e9386708dc Merge branch 'master' of https://github.com/syntax24/OriginalGozareshgir 2025-06-08 16:17:16 +03:30
SamSys
d70abb60d7 guid for application download link 2025-06-08 16:17:08 +03:30
2098e843a5 fix conflict 2025-06-08 16:10:03 +03:30
f6b6dfa046 merge from team work 2025-06-08 16:04:54 +03:30
24 changed files with 12937 additions and 2210 deletions

View File

@@ -3,6 +3,7 @@ using System.Collections;
using System.Collections.Generic;
using _0_Framework.Application;
using _0_Framework.Domain;
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
using Company.Domain.CheckoutAgg.ValueObjects;
using Company.Domain.CustomizeCheckoutAgg.ValueObjects;
using Company.Domain.WorkshopAgg;
@@ -29,7 +30,7 @@ public class Checkout : EntityBase
string overNightWorkValue, string fridayWorkValue, string rotatingShifValue, string absenceValue,
string totalDayOfLeaveCompute, string totalDayOfYearsCompute, string totalDayOfBunosesCompute,
ICollection<CheckoutLoanInstallment> loanInstallments,
ICollection<CheckoutSalaryAid> salaryAids)
ICollection<CheckoutSalaryAid> salaryAids,CheckoutRollCall checkoutRollCall)
{
EmployeeFullName = employeeFullName;
FathersName = fathersName;
@@ -88,6 +89,7 @@ public class Checkout : EntityBase
TotalDayOfBunosesCompute = totalDayOfBunosesCompute;
LoanInstallments = loanInstallments;
SalaryAids = salaryAids;
CheckoutRollCall = checkoutRollCall;
}
public string EmployeeFullName { get; private set; }
@@ -196,7 +198,8 @@ public class Checkout : EntityBase
public ICollection<CheckoutLoanInstallment> LoanInstallments { get; set; } = [];
public ICollection<CheckoutSalaryAid> SalaryAids { get; set; } = [];
#endregion
public CheckoutRollCall CheckoutRollCall { get; private set; }
#endregion
public Workshop Workshop { get; set; }
@@ -308,4 +311,149 @@ public class Checkout : EntityBase
LoanInstallments = lonaInstallments;
InstallmentDeduction = installmentsAmount;
}
public void SetCheckoutRollCall(CheckoutRollCall checkoutRollCall)
{
CheckoutRollCall = checkoutRollCall;
}
}
public class CheckoutRollCall
{
private CheckoutRollCall(){}
public CheckoutRollCall(TimeSpan totalMandatoryTimeSpan, TimeSpan totalPresentTimeSpan, TimeSpan totalBreakTimeSpan,
TimeSpan totalWorkingTimeSpan, TimeSpan totalPaidLeaveTmeSpan, TimeSpan totalSickLeaveTimeSpan,
ICollection<CheckoutRollCallDay> rollCallDaysCollection)
{
TotalMandatoryTimeSpan = totalMandatoryTimeSpan;
TotalPresentTimeSpan = totalPresentTimeSpan;
TotalBreakTimeSpan = totalBreakTimeSpan;
TotalWorkingTimeSpan = totalWorkingTimeSpan;
TotalPaidLeaveTmeSpan = totalPaidLeaveTmeSpan;
TotalSickLeaveTimeSpan = totalSickLeaveTimeSpan;
RollCallDaysCollection = rollCallDaysCollection;
}
/// <summary>
/// مجموع ساعت موظفی
/// </summary>
public TimeSpan TotalMandatoryTimeSpan { get; private set; }
/// <summary>
/// مجموع ساعت حضور
/// </summary>
public TimeSpan TotalPresentTimeSpan { get; private set; }
/// <summary>
/// مجموع ساعت استراحت
/// </summary>
public TimeSpan TotalBreakTimeSpan { get; private set; }
/// <summary>
/// مجموع ساعت کارکرد
/// </summary>
public TimeSpan TotalWorkingTimeSpan { get; private set; }
/// <summary>
/// مجموع ساعت مرخصی استحقاقی
/// </summary>
public TimeSpan TotalPaidLeaveTmeSpan { get; private set; }
/// <summary>
/// مجموع ساعت مرخصی استعلاجی
/// </summary>
public TimeSpan TotalSickLeaveTimeSpan { get; private set; }
/// <summary>
/// روز های حضور غیاب
/// </summary>
public ICollection<CheckoutRollCallDay> RollCallDaysCollection { get; private set; }
}
public class CheckoutRollCallDay
{
private CheckoutRollCallDay(){}
public CheckoutRollCallDay(DateTime date, string firstStartDate, string firstEndDate,
string secondStartDate, string secondEndDate, TimeSpan breakTimeSpan,
bool isSliced, TimeSpan workingTimeSpan, bool isAbsent, bool isFriday,
bool isHoliday, string leaveType)
{
Date = date;
FirstStartDate = firstStartDate;
FirstEndDate = firstEndDate;
SecondStartDate = secondStartDate;
SecondEndDate = secondEndDate;
BreakTimeSpan = breakTimeSpan;
IsSliced = isSliced;
WorkingTimeSpan = workingTimeSpan;
IsAbsent = isAbsent;
IsFriday = isFriday;
IsHoliday = isHoliday;
LeaveType = leaveType;
}
public long Id { get; set; }
/// <summary>
/// تاریخ
/// </summary>
public DateTime Date { get; private set; }
/// <summary>
/// ورود اول
/// </summary>
public string FirstStartDate { get; private set; }
/// <summary>
/// خروج اول
/// </summary>
public string FirstEndDate { get; private set; }
/// <summary>
/// ورود دوم
/// </summary>
public string SecondStartDate { get; private set; }
/// <summary>
/// خروج دوم
/// </summary>
public string SecondEndDate { get; private set; }
/// <summary>
/// ساعت استراحت
/// </summary>
public TimeSpan BreakTimeSpan { get; private set; }
/// <summary>
/// مقدار زمان کارکرد
/// </summary>
public TimeSpan WorkingTimeSpan { get; private set; }
/// <summary>
/// آیا منقطع است؟
/// </summary>
public bool IsSliced { get; private set; }
/// <summary>
/// آیا غیبت است
/// </summary>
public bool IsAbsent { get; private set; }
/// <summary>
/// آیا جمعه است
/// </summary>
public bool IsFriday { get; private set; }
/// <summary>
/// آیا تعطیل رسمی است
/// </summary>
public bool IsHoliday { get; private set; }
/// <summary>
/// نوع مرخصی - درصورت نداشتن مرخصی مقدارش null میباشد
/// </summary>
public string LeaveType { get; private set; }
public long CheckoutId { get; set; }
}

View File

@@ -64,9 +64,9 @@ public interface IInsuranceListRepository:IRepository<long, InsuranceList>
#region Mahan
Task<InsuranceListConfirmOperation> GetInsuranceOperationDetails(long id);
Task<InsuranceListTabsCountViewModel> GetTabCounts(long accountId,int month,int year);
Task<InsuranceListTabsCountViewModel> GetTabCounts(InsuranceListSearchModel searchModel);
#endregion
#endregion
}

View File

@@ -137,4 +137,110 @@ public class CheckoutViewModel
public List<CheckoutDailyRollCallViewModel> MonthlyRollCall { get; set; }
public List<LoanInstallmentViewModel> InstallmentViewModels { get; set; }
public List<SalaryAidViewModel> SalaryAidViewModels { get; set; }
public CheckoutRollCallViewModel CheckoutRollCall { get; set; }
}
public class CheckoutRollCallViewModel
{
/// <summary>
/// مجموع ساعت موظفی
/// </summary>
public TimeSpan TotalMandatoryTimeSpan { get; set; }
/// <summary>
/// مجموع ساعت حضور
/// </summary>
public TimeSpan TotalPresentTimeSpan { get; set; }
/// <summary>
/// مجموع ساعت استراحت
/// </summary>
public TimeSpan TotalBreakTimeSpan { get; set; }
/// <summary>
/// مجموع ساعت کارکرد
/// </summary>
public TimeSpan TotalWorkingTimeSpan { get; set; }
/// <summary>
/// مجموع ساعت مرخصی استحقاقی
/// </summary>
public TimeSpan TotalPaidLeaveTmeSpan { get; set; }
/// <summary>
/// مجموع ساعت مرخصی استعلاجی
/// </summary>
public TimeSpan TotalSickLeaveTimeSpan { get; set; }
/// <summary>
/// روز های حضور غیاب
/// </summary>
public ICollection<CheckoutRollCallDayViewModel> RollCallDaysCollection { get; set; }
}
public class CheckoutRollCallDayViewModel
{
public long Id { get; set; }
/// <summary>
/// تاریخ
/// </summary>
public DateTime Date { get; set; }
/// <summary>
/// ورود اول
/// </summary>
public string FirstStartDate { get; set; }
/// <summary>
/// خروج اول
/// </summary>
public string FirstEndDate { get; set; }
/// <summary>
/// ورود دوم
/// </summary>
public string SecondStartDate { get; set; }
/// <summary>
/// خروج دوم
/// </summary>
public string SecondEndDate { get; set; }
/// <summary>
/// ساعت استراحت
/// </summary>
public TimeSpan BreakTimeSpan { get; set; }
/// <summary>
/// مقدار زمان کارکرد
/// </summary>
public TimeSpan WorkingTimeSpan { get; set; }
/// <summary>
/// آیا منقطع است؟
/// </summary>
public bool IsSliced { get; set; }
/// <summary>
/// آیا غیبت است
/// </summary>
public bool IsAbsent { get; set; }
/// <summary>
/// آیا جمعه است
/// </summary>
public bool IsFriday { get; set; }
/// <summary>
/// آیا تعطیل رسمی است
/// </summary>
public bool IsHoliday { get; set; }
/// <summary>
/// نوع مرخصی - درصورت نداشتن مرخصی مقدارش null میباشد
/// </summary>
public string LeaveType { get; set; }
public long CheckoutId { get; set; }
}

View File

@@ -5,6 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using CompanyManagment.App.Contracts.Contract;
using CompanyManagment.App.Contracts.Employee;
using CompanyManagment.App.Contracts.RollCall;
using CompanyManagment.App.Contracts.YearlySalary;
using Microsoft.AspNetCore.Mvc.Rendering;
@@ -138,4 +139,15 @@ public class CreateCheckout
public string ShiftWork { get; set; }
public List<GroupedRollCalls> GroupedRollCalls { get; set; }
public TimeSpan TotalWorkingTimeSpan { get; set; }
public TimeSpan TotalBreakTimeSpan { get; set; }
public TimeSpan TotalPresentTimeSpan { get; set; }
public TimeSpan TotalPaidLeave { get; set; }
public TimeSpan TotalSickLeave { get; set; }
}

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using CompanyManagment.App.Contracts.Loan;
using CompanyManagment.App.Contracts.RollCall;
using CompanyManagment.App.Contracts.SalaryAid;
using CompanyManagment.App.Contracts.WorkingHoursTemp;
@@ -45,6 +46,15 @@ public class ComputingViewModel
public bool HasRotatingShift { get; set; }
public List<GroupedRollCalls> GroupedRollCalls { get; set; }
public TimeSpan TotalWorkingTimeSpan { get; set; }
public TimeSpan TotalBreakTimeSpan { get; set; }
public TimeSpan TotalPresentTimeSpan { get; set; }
public TimeSpan TotalPaidLeave { get; set; }
public TimeSpan TotalSickLeave { get; set; }
//public List<string> holidays;
}

View File

@@ -44,7 +44,7 @@ public interface IInsuranceListApplication
Task<OperationResult> ConfirmInsuranceOperation(InsuranceListConfirmOperation command);
Task<InsuranceListConfirmOperation> GetInsuranceOperationDetails(long id);
Task<InsuranceListTabsCountViewModel> GetTabCounts(long accountId, int month, int year);
Task<InsuranceListTabsCountViewModel> GetTabCounts(InsuranceListSearchModel searchModel);
#endregion
#endregion
}

View File

@@ -6,10 +6,12 @@ public class ShiftList
{
public DateTime Start { get; set; }
public DateTime End { get; set; }
/// <summary>
/// تاخیر در ورود (مدت زمانی که کارمند با تأخیر وارد شده است)
/// </summary>
public TimeSpan LateEntryDuration { get; set; }
public DateTime EndWithOutResTime { get; set; }
/// <summary>
/// تاخیر در ورود (مدت زمانی که کارمند با تأخیر وارد شده است)
/// </summary>
public TimeSpan LateEntryDuration { get; set; }
/// <summary>
/// تعجیل در ورود (مدت زمانی که کارمند زودتر از زمان مشخص وارد شده است)

View File

@@ -14,6 +14,15 @@ using CompanyManagment.App.Contracts.Checkout;
using CompanyManagment.App.Contracts.PersonalContractingParty;
using CompanyManagment.App.Contracts.Leave;
using CompanyManagment.App.Contracts.MandantoryHours;
using _0_Framework.Domain.CustomizeCheckoutShared.ValueObjects;
using Company.Domain.EmployeeAgg;
using CompanyManagment.App.Contracts.HolidayItem;
using CompanyManagment.App.Contracts.RollCall;
using CompanyManagment.EFCore.Migrations;
using CompanyManagment.EFCore.Repository;
using System.Globalization;
using Company.Domain.LeaveAgg;
using Company.Domain.WorkshopAgg;
namespace CompanyManagment.Application;
@@ -27,11 +36,13 @@ public class CheckoutApplication : ICheckoutApplication
private readonly ILeaveApplication _leaveApplication;
private readonly IMandatoryHoursApplication _mandatoryHoursApplication;
private readonly IRollCallMandatoryRepository _rollCallMandatoryRepository;
private readonly IRollCallRepository _rollCallRepository;
private readonly IHolidayItemApplication _holidayItemApplication;
public CheckoutApplication(ICheckoutRepository checkoutRepository, IYearlySalaryRepository yearlySalaryRepository,
ILeftWorkRepository leftWorkRepository,
IEmployerRepository employerRepository, IPersonalContractingPartyApp contractingPartyApp, ILeaveApplication leaveApplication, IMandatoryHoursApplication mandatoryHoursApplication, IRollCallMandatoryRepository rollCallMandatoryRepository)
IEmployerRepository employerRepository, IPersonalContractingPartyApp contractingPartyApp, ILeaveApplication leaveApplication, IMandatoryHoursApplication mandatoryHoursApplication, IRollCallMandatoryRepository rollCallMandatoryRepository, IRollCallRepository rollCallRepository, IHolidayItemApplication holidayItemApplication)
{
_checkoutRepository = checkoutRepository;
_yearlySalaryRepository = yearlySalaryRepository;
@@ -41,6 +52,8 @@ public class CheckoutApplication : ICheckoutApplication
_leaveApplication = leaveApplication;
_mandatoryHoursApplication = mandatoryHoursApplication;
_rollCallMandatoryRepository = rollCallMandatoryRepository;
_rollCallRepository = rollCallRepository;
_holidayItemApplication = holidayItemApplication;
}
[SuppressMessage("ReSharper.DPA", "DPA0007: Large number of DB records", MessageId = "count: 241")]
@@ -189,6 +202,125 @@ public class CheckoutApplication : ICheckoutApplication
command.InstallmentDeduction = loanInstallments.Sum(x => x.AmountForMonth.MoneyToDouble());
var firstDayOfMonth = $"{command.ContractStart.Substring(0, 8)}01".ToGeorgianDateTime();
var firstDayOfCurrentMonth = new DateTime(syear, smonth, 1, new PersianCalendar());
LeaveSearchModel sickLeaveSearch = new LeaveSearchModel()
{
EmployeeId = command.EmployeeId,
WorkshopId = command.WorkshopId,
StartLeaveGr = command.ContractStartGr,
EndLeaveGr = command.ContractEndGr,
IsAccepted = true,
};
var leaves = _leaveApplication.search(sickLeaveSearch);
firstDayOfMonth.AddMonthsFa(1, out var lastDayOfCurrentMonth);
lastDayOfCurrentMonth = lastDayOfCurrentMonth.AddDays(-1);
int dateRange = (int)(lastDayOfCurrentMonth - firstDayOfCurrentMonth).TotalDays + 1;
var holidays = _holidayItemApplication.Search(new HolidayItemSearchModel()
{
HolidayYear = command.ContractStartGr.ToFarsiYear()
});
//all the dates from start to end, to be compared with present days to get absent dates
var completeDaysList = Enumerable.Range(0, dateRange).Select(offset => firstDayOfCurrentMonth.AddDays(offset).Date).ToList();
var absentRecords = completeDaysList
.ExceptBy(command.GroupedRollCalls.Select(x => x.CreationDate.Date), y => y.Date)
.Select(x =>
{
var leave = leaves.FirstOrDefault(y =>
y.EmployeeId == command.EmployeeId && y.EndLeaveGr.Date >= x.Date && y.StartLeaveGr.Date <= x.Date);
var isHoliday = holidays.Any(y => y.HolidaydateGr == x.Date);
var isFriday = x.Date.DayOfWeek == DayOfWeek.Friday;
var isNormalWorkingDay = isHoliday == false && isFriday == false;
return new CheckoutDailyRollCallViewModel()
{
StartDate1 = null,
EndDate1 = null,
DateTimeGr = x.Date,
DayOfWeek = x.Date.DayOfWeek.ToString(),
RollCallDateFa = x.Date.ToFarsi(),
LeaveType = leave != null ? leave.LeaveType : "",
IsAbsent = leave == null && isNormalWorkingDay
};
});
var presentDays = command.GroupedRollCalls.Select(x =>
{
var orderedRollcalls = x.ShiftList.OrderBy(y => y.Start);
var rollCallTimeSpanPerDay = x.SumOneDaySpan;
TimeSpan breakTimePerDay = x.BreakTime;
return new CheckoutDailyRollCallViewModel()
{
StartDate1 = orderedRollcalls.FirstOrDefault().Start.ToString("HH:mm"),
EndDate1 = orderedRollcalls.FirstOrDefault().EndWithOutResTime.ToString("HH:mm"),
StartDate2 = orderedRollcalls.Skip(1).FirstOrDefault()?.Start.ToString("HH:mm") ?? "",
EndDate2 = orderedRollcalls.Skip(1).FirstOrDefault()?.EndWithOutResTime.ToString("HH:mm") ?? "",
TotalhourseSpan = rollCallTimeSpanPerDay,
BreakTimeTimeSpan = breakTimePerDay,
DayOfWeek = x.CreationDate.DayOfWeek.DayOfWeeKToPersian(),
RollCallDateFa = x.CreationDate.Date.ToFarsi(),
DateTimeGr = x.CreationDate.Date,
IsSliced = x.ShiftList.Count() > 2,
IsAbsent = false
};
});
presentDays = presentDays.Select(x => new CheckoutDailyRollCallViewModel
{
StartDate1 = x.StartDate1,
EndDate1 = x.EndDate1,
EndDate2 = x.EndDate2,
StartDate2 = x.StartDate2,
TotalWorkingHours = $"{(int)(x.TotalhourseSpan.TotalHours)}:{x.TotalhourseSpan.Minutes:00}",
BreakTimeString = $"{(int)(x.BreakTimeTimeSpan.TotalHours)}:{x.BreakTimeTimeSpan.Minutes:00}",
TotalhourseSpan = x.TotalhourseSpan,
BreakTimeTimeSpan = x.BreakTimeTimeSpan,
DayOfWeek = x.DayOfWeek,
RollCallDateFa = x.RollCallDateFa,
DateTimeGr = x.DateTimeGr,
IsSliced = x.IsSliced,
IsAbsent = false
});
var result = presentDays.Concat(absentRecords).OrderBy(x => x.DateTimeGr).ToList();
result.ForEach(x =>
{
x.IsHoliday = holidays.Any(y => x.DateTimeGr.Date == y.HolidaydateGr.Date);
x.IsFriday = x.DateTimeGr.DayOfWeek == DayOfWeek.Friday;
});
var checkoutRollCallDays = result.Select(x => new CheckoutRollCallDay(x.DateTimeGr,
x.StartDate1, x.EndDate1, x.StartDate2, x.EndDate2,
x.BreakTimeTimeSpan, x.IsSliced, x.TotalhourseSpan, x.IsAbsent, x.IsFriday, x.IsHoliday, x.LeaveType))
.ToList();
double mandatoryHours = _mandatoryHoursApplication.GetMandatoryHoursByYearAndMonth(syear, smonth);
int mandatoryWholeHours = (int)mandatoryHours;
int mandatoryMinutes = (int)((mandatoryHours - mandatoryWholeHours) * 60);
var totalMandatoryHours = TimeSpan.FromHours(mandatoryWholeHours).Add(TimeSpan.FromMinutes(mandatoryMinutes));
var checkoutRollCall = new CheckoutRollCall(totalMandatoryHours, command.TotalPresentTimeSpan, command.TotalBreakTimeSpan,
command.TotalWorkingTimeSpan, command.TotalPaidLeave, command.TotalSickLeave, checkoutRollCallDays);
var totalClaimsDouble = monthlyWage + bacicYears + consumableItem + housingAllowance + marriedAllowance + command.OvertimePay +
command.NightworkPay + familyAllowance + bunos + years + command.LeavePay + command.FridayPay + command.ShiftPay;
var totalClaims = totalClaimsDouble.ToMoney();
@@ -215,7 +347,9 @@ public class CheckoutApplication : ICheckoutApplication
command.ContractId, command.WorkingHoursId, monthlyWage, bacicYears, consumableItem, housingAllowance
, command.OvertimePay, command.NightworkPay, command.FridayPay, 0, command.ShiftPay, familyAllowance, bunos, years, command.LeavePay, insuranceDeduction, 0, command.InstallmentDeduction, command.SalaryAidDeduction, command.AbsenceDeduction, sumOfWorkingDays,
command.ArchiveCode, command.PersonnelCode, totalClaims, totalDeductions, totalPayment, command.Signature, marriedAllowance, command.LeaveCheckout, command.CreditLeaves, command.AbsencePeriod, command.AverageHoursPerDay, command.HasRollCall, command.OverTimeWorkValue, command.OverNightWorkValue
, command.FridayWorkValue, command.RotatingShiftValue, command.AbsenceValue, command.TotalDayOfLeaveCompute, command.TotalDayOfYearsCompute, command.TotalDayOfBunosesCompute, loanInstallments, salaryAids);
, command.FridayWorkValue, command.RotatingShiftValue, command.AbsenceValue, command.TotalDayOfLeaveCompute, command.TotalDayOfYearsCompute, command.TotalDayOfBunosesCompute,
loanInstallments, salaryAids,checkoutRollCall);
_checkoutRepository.CreateCkeckout(checkout).GetAwaiter().GetResult();
//_checkoutRepository.SaveChanges();
@@ -326,26 +460,32 @@ public class CheckoutApplication : ICheckoutApplication
var totalWorking = new TimeSpan(x.MonthlyRollCall.Sum(y => y.TotalhourseSpan.Ticks));
var totalBreakTime = new TimeSpan(x.MonthlyRollCall.Sum(y => y.BreakTimeTimeSpan.Ticks));
TimeSpan totalPresent = totalWorking + totalBreakTime;
if (x.HasRollCall)
if (x.CheckoutRollCall == null)
{
totalWorking = new TimeSpan(x.MonthlyRollCall.Sum(x => x.TotalhourseSpan.Ticks)) - x.TotalHourlyLeave;
totalBreakTime = new TimeSpan(x.MonthlyRollCall.Sum(x => x.BreakTimeTimeSpan.Ticks));
totalPresent = totalWorking + totalBreakTime ;
}
else
{
totalBreakTime = new TimeSpan(x.MonthlyRollCall.Sum(x => x.BreakTimeTimeSpan.Ticks));
totalPresent = new TimeSpan(x.MonthlyRollCall.Sum(x => x.TotalhourseSpan.Ticks));
totalWorking = totalPresent - totalBreakTime;
}
x.TotalWorkingTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalWorking.TotalHours, totalWorking.Minutes, "-");
x.TotalBreakTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalBreakTime.TotalHours, totalBreakTime.Minutes, "-");
x.TotalPresentTimeStr = Tools.ToFarsiHoursAndMinutes((int)totalPresent.TotalHours, totalPresent.Minutes, "-");
x.TotalMandatoryTimeStr = Tools.ToFarsiHoursAndMinutes(mandatoryWholeHours, mandatoryMinutes, "-");
if (x.HasRollCall)
{
totalWorking = new TimeSpan(x.MonthlyRollCall.Sum(x => x.TotalhourseSpan.Ticks)) -
x.TotalHourlyLeave;
totalBreakTime = new TimeSpan(x.MonthlyRollCall.Sum(x => x.BreakTimeTimeSpan.Ticks));
totalPresent = totalWorking + totalBreakTime;
}
else
{
totalBreakTime = new TimeSpan(x.MonthlyRollCall.Sum(x => x.BreakTimeTimeSpan.Ticks));
totalPresent = new TimeSpan(x.MonthlyRollCall.Sum(x => x.TotalhourseSpan.Ticks));
totalWorking = totalPresent - totalBreakTime;
}
x.TotalWorkingTimeStr =
Tools.ToFarsiHoursAndMinutes((int)totalWorking.TotalHours, totalWorking.Minutes, "-");
x.TotalBreakTimeStr =
Tools.ToFarsiHoursAndMinutes((int)totalBreakTime.TotalHours, totalBreakTime.Minutes, "-");
x.TotalPresentTimeStr =
Tools.ToFarsiHoursAndMinutes((int)totalPresent.TotalHours, totalPresent.Minutes, "-");
x.TotalMandatoryTimeStr = Tools.ToFarsiHoursAndMinutes(mandatoryWholeHours, mandatoryMinutes, "-");
}
});
return result;
}
@@ -375,7 +515,7 @@ public class CheckoutApplication : ICheckoutApplication
{
totalWorking = new TimeSpan(result.MonthlyRollCall.Sum(x => x.TotalhourseSpan.Ticks)) - result.TotalHourlyLeave;
totalBreakTime = new TimeSpan(result.MonthlyRollCall.Sum(x => x.BreakTimeTimeSpan.Ticks));
totalPresent = totalWorking + totalBreakTime ;
totalPresent = totalWorking + totalBreakTime;
}
else
{

View File

@@ -2342,9 +2342,9 @@ public class InsuranceListApplication : IInsuranceListApplication
return _insuranceListRepositpry.GetInsuranceOperationDetails(id);
}
public Task<InsuranceListTabsCountViewModel> GetTabCounts(long accountId, int month, int year)
public Task<InsuranceListTabsCountViewModel> GetTabCounts(InsuranceListSearchModel searchModel)
{
return _insuranceListRepositpry.GetTabCounts(accountId, month, year);
return _insuranceListRepositpry.GetTabCounts(searchModel);
}
#endregion

View File

@@ -1,5 +1,6 @@
using System;
using _0_Framework.Application;
using _0_Framework.InfraStructure;
using Company.Domain.CheckoutAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
@@ -73,5 +74,28 @@ class CheckoutMapping : IEntityTypeConfiguration<Checkout>
salaryAid.Property(x => x.Amount).HasMaxLength(25);
salaryAid.Property(x => x.CalculationDateTimeFa).HasMaxLength(15);
});
builder.OwnsOne(x => x.CheckoutRollCall, rollCall =>
{
rollCall.Property(x => x.TotalPresentTimeSpan).HasTimeSpanConversion();
rollCall.Property(x => x.TotalBreakTimeSpan).HasTimeSpanConversion();
rollCall.Property(x => x.TotalWorkingTimeSpan).HasTimeSpanConversion();
rollCall.Property(x => x.TotalPaidLeaveTmeSpan).HasTimeSpanConversion();
rollCall.Property(x => x.TotalSickLeaveTimeSpan).HasTimeSpanConversion();
rollCall.Property(x => x.TotalMandatoryTimeSpan).HasTimeSpanConversion();
rollCall.OwnsMany(x => x.RollCallDaysCollection, rollCallDay =>
{
rollCallDay.HasKey(x => x.Id);
rollCallDay.WithOwner().HasForeignKey(x => x.CheckoutId);
rollCallDay.Property(x => x.WorkingTimeSpan).HasTimeSpanConversion();
rollCallDay.Property(x => x.BreakTimeSpan).HasTimeSpanConversion();
rollCallDay.Property(x => x.FirstStartDate).HasMaxLength(18);
rollCallDay.Property(x => x.FirstEndDate).HasMaxLength(18);
rollCallDay.Property(x => x.SecondStartDate).HasMaxLength(18);
rollCallDay.Property(x => x.SecondEndDate).HasMaxLength(18);
rollCallDay.Property(x => x.LeaveType).HasMaxLength(18);
});
});
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,124 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class addrollcallincheckout : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "CheckoutRollCall_TotalBreakTimeSpan",
table: "Checkouts",
type: "nvarchar(30)",
maxLength: 30,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CheckoutRollCall_TotalMandatoryTimeSpan",
table: "Checkouts",
type: "nvarchar(30)",
maxLength: 30,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CheckoutRollCall_TotalPaidLeaveTmeSpan",
table: "Checkouts",
type: "nvarchar(30)",
maxLength: 30,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CheckoutRollCall_TotalPresentTimeSpan",
table: "Checkouts",
type: "nvarchar(30)",
maxLength: 30,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CheckoutRollCall_TotalSickLeaveTimeSpan",
table: "Checkouts",
type: "nvarchar(30)",
maxLength: 30,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "CheckoutRollCall_TotalWorkingTimeSpan",
table: "Checkouts",
type: "nvarchar(30)",
maxLength: 30,
nullable: true);
migrationBuilder.CreateTable(
name: "CheckoutRollCallDay",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Date = table.Column<DateTime>(type: "datetime2", nullable: false),
FirstStartDate = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
FirstEndDate = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
SecondStartDate = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
SecondEndDate = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
BreakTimeSpan = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false),
WorkingTimeSpan = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false),
IsSliced = table.Column<bool>(type: "bit", nullable: false),
IsAbsent = table.Column<bool>(type: "bit", nullable: false),
IsFriday = table.Column<bool>(type: "bit", nullable: false),
IsHoliday = table.Column<bool>(type: "bit", nullable: false),
LeaveType = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
CheckoutId = table.Column<long>(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CheckoutRollCallDay", x => x.Id);
table.ForeignKey(
name: "FK_CheckoutRollCallDay_Checkouts_CheckoutId",
column: x => x.CheckoutId,
principalTable: "Checkouts",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_CheckoutRollCallDay_CheckoutId",
table: "CheckoutRollCallDay",
column: "CheckoutId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CheckoutRollCallDay");
migrationBuilder.DropColumn(
name: "CheckoutRollCall_TotalBreakTimeSpan",
table: "Checkouts");
migrationBuilder.DropColumn(
name: "CheckoutRollCall_TotalMandatoryTimeSpan",
table: "Checkouts");
migrationBuilder.DropColumn(
name: "CheckoutRollCall_TotalPaidLeaveTmeSpan",
table: "Checkouts");
migrationBuilder.DropColumn(
name: "CheckoutRollCall_TotalPresentTimeSpan",
table: "Checkouts");
migrationBuilder.DropColumn(
name: "CheckoutRollCall_TotalSickLeaveTimeSpan",
table: "Checkouts");
migrationBuilder.DropColumn(
name: "CheckoutRollCall_TotalWorkingTimeSpan",
table: "Checkouts");
}
}
}

View File

@@ -6168,6 +6168,117 @@ namespace CompanyManagment.EFCore.Migrations
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.OwnsOne("Company.Domain.CheckoutAgg.CheckoutRollCall", "CheckoutRollCall", b1 =>
{
b1.Property<long>("Checkoutid")
.HasColumnType("bigint");
b1.Property<string>("TotalBreakTimeSpan")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b1.Property<string>("TotalMandatoryTimeSpan")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b1.Property<string>("TotalPaidLeaveTmeSpan")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b1.Property<string>("TotalPresentTimeSpan")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b1.Property<string>("TotalSickLeaveTimeSpan")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b1.Property<string>("TotalWorkingTimeSpan")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b1.HasKey("Checkoutid");
b1.ToTable("Checkouts");
b1.WithOwner()
.HasForeignKey("Checkoutid");
b1.OwnsMany("Company.Domain.CheckoutAgg.CheckoutRollCallDay", "RollCallDaysCollection", b2 =>
{
b2.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b2.Property<long>("Id"));
b2.Property<string>("BreakTimeSpan")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b2.Property<long>("CheckoutId")
.HasColumnType("bigint");
b2.Property<DateTime>("Date")
.HasColumnType("datetime2");
b2.Property<string>("FirstEndDate")
.HasMaxLength(18)
.HasColumnType("nvarchar(18)");
b2.Property<string>("FirstStartDate")
.HasMaxLength(18)
.HasColumnType("nvarchar(18)");
b2.Property<bool>("IsAbsent")
.HasColumnType("bit");
b2.Property<bool>("IsFriday")
.HasColumnType("bit");
b2.Property<bool>("IsHoliday")
.HasColumnType("bit");
b2.Property<bool>("IsSliced")
.HasColumnType("bit");
b2.Property<string>("LeaveType")
.HasMaxLength(18)
.HasColumnType("nvarchar(18)");
b2.Property<string>("SecondEndDate")
.HasMaxLength(18)
.HasColumnType("nvarchar(18)");
b2.Property<string>("SecondStartDate")
.HasMaxLength(18)
.HasColumnType("nvarchar(18)");
b2.Property<string>("WorkingTimeSpan")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b2.HasKey("Id");
b2.HasIndex("CheckoutId");
b2.ToTable("CheckoutRollCallDay");
b2.WithOwner()
.HasForeignKey("CheckoutId");
});
b1.Navigation("RollCallDaysCollection");
});
b.OwnsMany("Company.Domain.CheckoutAgg.ValueObjects.CheckoutLoanInstallment", "LoanInstallments", b1 =>
{
b1.Property<long>("Checkoutid")
@@ -6255,6 +6366,8 @@ namespace CompanyManagment.EFCore.Migrations
.HasForeignKey("Checkoutid");
});
b.Navigation("CheckoutRollCall");
b.Navigation("LoanInstallments");
b.Navigation("SalaryAids");

File diff suppressed because it is too large Load Diff

View File

@@ -1492,33 +1492,108 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
return res.ToList();
}
public async Task<InsuranceListTabsCountViewModel> GetTabCounts(long accountId, int month, int year)
{
var workshopIds = _context.WorkshopAccounts
.Where(a => a.AccountId == accountId)
.Select(a => a.WorkshopId);
var res = await _context.InsuranceListSet
.Where(x =>
x.Year == year.ToString("0000") &&
x.Month == month.ToString("00") &&
workshopIds.Contains(x.WorkshopId)
)
.GroupBy(x => 1)
.Select(g => new InsuranceListTabsCountViewModel
{
NotStarted = g.Count(x =>
!x.Debt.IsDone && !x.EmployerApproval.IsDone && !x.Inspection.IsDone && !x.ConfirmSentlist),
InProgress = g.Count(x =>
(x.Debt.IsDone || x.EmployerApproval.IsDone || x.Inspection.IsDone)&& !(x.Debt.IsDone && x.EmployerApproval.IsDone && x.Inspection.IsDone) && !x.ConfirmSentlist),
ReadyToSendList = g.Count(x =>
x.Debt.IsDone && x.EmployerApproval.IsDone && x.Inspection.IsDone && !x.ConfirmSentlist),
Done = g.Count(x => x.ConfirmSentlist)
})
.FirstOrDefaultAsync() ?? new InsuranceListTabsCountViewModel();
public async Task<InsuranceListTabsCountViewModel> GetTabCounts(InsuranceListSearchModel searchModel)
{
var acountId = _authHelper.CurrentAccountId();
return res;
var workshopIds = _context.WorkshopAccounts
.Where(a => a.AccountId == acountId)
.Select(a => a.WorkshopId);
var query = _context.InsuranceListSet
.Where(x => workshopIds.Contains(x.WorkshopId))
.Join(_context.Workshops.Include(x => x.InsuranceWorkshopInfo),
insurance => insurance.WorkshopId,
workshop => workshop.id,
(insurance, workshop) => new { insurance, workshop })
.GroupJoin(_context.WorkshopEmployers,
result => result.workshop.id,
employer => employer.WorkshopId,
(result, employer) => new { result.insurance, result.workshop, employer })
.Select(result => new InsuranceListViewModel
{
Id = result.insurance.id,
Year = result.insurance.Year,
Month = result.insurance.Month,
WorkShopId = result.insurance.WorkshopId,
WorkShopCode = result.workshop.InsuranceWorkshopInfo != null ? result.workshop.InsuranceWorkshopInfo.InsuranceCode : result.workshop.InsuranceCode,
WorkShopName = result.workshop.InsuranceWorkshopInfo != null ? result.workshop.InsuranceWorkshopInfo.WorkshopName : result.workshop.WorkshopFullName,
TypeOfInsuranceSend = result.workshop.TypeOfInsuranceSend == "NormalList" ? "عادی" :
result.workshop.TypeOfInsuranceSend == "Govermentlist" ? "کمک دولت" :
result.workshop.TypeOfInsuranceSend == "Familylist" ? "خانوادگی" : "",
FixedSalary = result.workshop.FixedSalary,
EmployerName = result.workshop.InsuranceWorkshopInfo != null ? result.workshop.InsuranceWorkshopInfo.EmployerName : result.workshop.WorkshopFullName,
ConfirmSentlist = result.insurance.ConfirmSentlist,
EmployerId = result.employer.First().EmployerId,
DebtDone = result.insurance.Debt.IsDone,
EmployerApproved = result.insurance.EmployerApproval.IsDone,
InspectionDone = result.insurance.Inspection.IsDone
});
}
if (!string.IsNullOrEmpty(searchModel.Year) && searchModel.Year != "0" && !string.IsNullOrEmpty(searchModel.Month) && searchModel.Month != "0")
query = query.Where(x => x.Year == searchModel.Year && x.Month == searchModel.Month);
else
{
if (!string.IsNullOrEmpty(searchModel.Month) && searchModel.Month != "0")
query = query.Where(x => x.Month == searchModel.Month);
if (!string.IsNullOrEmpty(searchModel.Year) && searchModel.Year != "0")
query = query.Where(x => x.Year == searchModel.Year);
}
if (!string.IsNullOrEmpty(searchModel.WorkShopCode))
query = query.Where(x => x.WorkShopCode == searchModel.WorkShopCode);
if (!string.IsNullOrEmpty(searchModel.WorkShopName))
query = query.Where(x => x.WorkShopName.Contains(searchModel.WorkShopName));
if (searchModel.WorkshopId > 0)
{
var workshopName = query.FirstOrDefault(u => u.WorkShopId == searchModel.WorkshopId)?.WorkShopName;
query = query.Where(x => x.WorkShopName.Contains(workshopName));
}
if (searchModel.EmployerId > 0)
{
var employerName = query.FirstOrDefault(u => u.EmployerId == searchModel.EmployerId)?.EmployerName;
query = query.Where(x => x.EmployerName.Contains(employerName));
}
if (!string.IsNullOrEmpty(searchModel.EmployerName))
query = query.Where(x => x.EmployerName.Contains(searchModel.EmployerName));
if (searchModel.FixedSalary != null)
query = query.Where(x => x.FixedSalary == searchModel.FixedSalary);
if (!string.IsNullOrEmpty(searchModel.TypeOfInsuranceSend) && searchModel.TypeOfInsuranceSend != "0")
query = query.Where(x => x.TypeOfInsuranceSend == searchModel.TypeOfInsuranceSend);
if (!string.IsNullOrEmpty(searchModel.City) && searchModel.City != "0")
query = query.Where(x => x.City == searchModel.City);
if (!string.IsNullOrEmpty(searchModel.Branch))
query = query.Where(x => x.Branch.Contains(searchModel.Branch));
var res = await query.GroupBy(x => 1)
.Select(g => new InsuranceListTabsCountViewModel
{
NotStarted = g.Count(x =>
!x.DebtDone && !x.EmployerApproved && !x.InspectionDone && !x.ConfirmSentlist),
InProgress = g.Count(x =>
(x.DebtDone || x.EmployerApproved || x.InspectionDone) && !(x.DebtDone && x.EmployerApproved && x.InspectionDone) && !x.ConfirmSentlist),
ReadyToSendList = g.Count(x =>
x.DebtDone && x.EmployerApproved && x.InspectionDone && !x.ConfirmSentlist),
Done = g.Count(x => x.ConfirmSentlist)
})
.FirstOrDefaultAsync() ?? new InsuranceListTabsCountViewModel();
return res;
}
/// <summary>
///

View File

@@ -125,10 +125,11 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
groupedRollCall = rollCallResult.GroupBy(x => x.ShiftDate.Date).Select(x => new GroupedRollCalls()
{
CreationDate = x.Key,
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value }).ToList(),
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value,EndWithOutResTime = s.ShiftEndWithoutRest.Value}).ToList(),
HasFriday = x.Any(s => s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday || s.EndDate.Value!.DayOfWeek == DayOfWeek.Friday)),
SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))
SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)),
BreakTime = x.First().BreakTimeSpan
}).OrderBy(x => x.CreationDate).ToList();
}
@@ -161,7 +162,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
return new GroupedRollCalls()
{
CreationDate = x.Key,
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value })
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value, EndWithOutResTime = s.EndDate.Value })
.ToList(),
HasFriday = x.Any(s =>
s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday ||
@@ -243,9 +244,9 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
double minutesDecimal = (starndardHoursesPerTotalDays - hours) * 60;
int minutes = (int)minutesDecimal;
TimeSpan totalLeaveSpan = TimeSpan.Zero;
TimeSpan starndardHoursesPerTotalDaysSapn = new TimeSpan(hours, minutes, 0);
if (leaveSearchResult.Count > 0)
if (leaveSearchResult.Count > 0 || hoursesleave.Count > 0)
{
if (leaveSearchResult.Any(x => x.HasShiftDuration))
{
@@ -276,8 +277,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
}
}
totalLeaveSpan = totalLeave;
}
else
{
int leavingDayCout = 0;
@@ -326,7 +327,9 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
{
sumSpans = sumSpans.Add(sumLeave);
}
}
totalLeaveSpan = sumLeave;
}
}
@@ -358,9 +361,9 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
//***********************************//
var dailyFix = TimeSpan.Parse("07:20");
TimeSpan mandatoryHoursTimeSpan = new TimeSpan(7, 20, 0).Multiply(mandatorDays);
TimeSpan Mandatory = sumSpansWhitOutleaves.Subtract(mandatoryHoursTimeSpan);
//var dailyFix = TimeSpan.Parse("07:20");
//TimeSpan mandatoryHoursTimeSpan = new TimeSpan(7, 20, 0).Multiply(mandatorDays);
//TimeSpan Mandatory = sumSpansWhitOutleaves.Subtract(mandatoryHoursTimeSpan);
double mandatoryWorkWithOutleaves = (sumSpansWhitOutleaves.TotalMinutes) / 60;
double overTimeWork = 0;
@@ -703,11 +706,30 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
}
}
#endregion
#endregion
#region Result
#region Result
LeaveSearchModel sickLeaveSearch = new LeaveSearchModel()
{
EmployeeId = employeeId,
WorkshopId = workshopId,
LeaveType = "استعلاجی",
PaidLeaveType = "روزانه",
StartLeaveGr = contractStart,
EndLeaveGr = contractEnd,
IsAccepted = true,
};
var sickLeaveSearchResult = _leaveRepository.search(sickLeaveSearch);
var res = new ComputingViewModel()
var sickLeaveTimeSpans = sickLeaveSearchResult.Select(x =>
{
var startLeave = contractStart > x.StartLeaveGr ? contractStart : x.StartLeaveGr;
var endLeave = contractEnd < x.EndLeaveGr ? contractEnd : x.EndLeaveGr;
return (endLeave - startLeave).Add(TimeSpan.FromDays(1));
});
var totalBreakTime = new TimeSpan(groupedRollCall.Sum(x => x.BreakTime.Ticks));
var res = new ComputingViewModel()
{
NumberOfWorkingDays = $"{groupedRollCall.Count}",
@@ -735,8 +757,18 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
TotalHolidayAndNotM = totalHolidaysAndNotM.ToString(),
DayliFeeComplete = dayliFeeComplete,
MarriedAllowance = MarriedAllowanceStr,
RotatingShiftValue = shiftPayValue
};
RotatingShiftValue = shiftPayValue,
#region SaveRollCall
GroupedRollCalls = groupedRollCall,
TotalWorkingTimeSpan = sumSpansWhitOutleaves,
TotalBreakTimeSpan = totalBreakTime,
TotalPresentTimeSpan = sumSpansWhitOutleaves + totalBreakTime,
TotalPaidLeave = totalLeaveSpan,
TotalSickLeave = new TimeSpan(sickLeaveTimeSpans.Sum(x=>x.Ticks)),
#endregion
};
#endregion
return res;

View File

@@ -56,7 +56,7 @@ public class IndexModel : PageModel
private readonly IWorkshopApplication _workshopApplication;
private readonly IYearlySalaryApplication _yearlySalaryApplication;
private readonly IYearlySalaryRepository _yearlySalaryRepository;
public List<CheckoutViewModel> chekoutlist;
public List<ComputingViewModel> ComputingView;
@@ -485,7 +485,10 @@ public class IndexModel : PageModel
TotalHolidaysAndNotH = mandatoryCompute.TotalHolidayAndNotH,
TotalHolidaysAndNotM = mandatoryCompute.TotalHolidayAndNotM,
DailFeeComplete = mandatoryCompute.DayliFeeComplete,
Signature = checkout.Signature
Signature = checkout.Signature,
};
_checkoutApplication.Create(command);
//if (checkout.Signature == "1")
@@ -963,7 +966,19 @@ public class IndexModel : PageModel
TotalDayOfBunosesCompute = bunosesPay.Bunoses > 0 ? $"{bunosesPay.TotalDayCompute}" : "0",
HolidayWorking = workshop.WorkshopHolidayWorking,
ShiftWork = workingHours.ShiftWork,
};
TotalWorkingTimeSpan=mandatoryCompute.TotalWorkingTimeSpan,
TotalBreakTimeSpan=mandatoryCompute.TotalBreakTimeSpan,
TotalPresentTimeSpan=mandatoryCompute.TotalPresentTimeSpan,
TotalPaidLeave=mandatoryCompute.TotalPaidLeave,
TotalSickLeave=mandatoryCompute.TotalSickLeave,
GroupedRollCalls = mandatoryCompute.GroupedRollCalls,
};
_checkoutApplication.Create(command);
//var workshopId = $"{contract.WorkshopIds}";

View File

@@ -156,7 +156,7 @@
<div class="">
<select class="form-control" asp-for="searchModel.Year">
<option value="0" disabled="disabled">سال</option>
<option value="0">سال</option>
@foreach (string year in @Model.YearlyList)
{
if (Model.CurrentYear_ == year)
@@ -173,7 +173,7 @@
<div class="">
<select class="form-control form-select" asp-for="searchModel.Month">
<option value="0" disabled="disabled">ماه</option>
<option value="0">ماه</option>
<option value="01">فروردین</option>
<option value="02">اردیبهشت</option>
<option value="03">خرداد</option>
@@ -224,17 +224,17 @@
</select>
</div>
<div class="tw-col-span-2">
@* <div class="tw-col-span-2">
<input class="form-control form-control-custom" asp-for="searchModel.Branch" placeholder="شعبه تامین اجتماعی" style="width: 100%">
</div>
</div> *@
<div class="">
@* <div class="">
<div class="belowRow tw-mt-0">
<select class="form-control form-control-custom" style="width: 100%" asp-for="searchModel.City">
<option value="0" selected>شهرستان</option>
</select>
</div>
</div>
</div> *@
<div class="">
<div class="belowRow tw-mt-0">
@@ -247,7 +247,7 @@
</div>
<div class="tw-col-span-2 tw-flex tw-items-center tw-gap-4">
<button class="btn-search-click tw-flex tw-w-[50%] tw-items-center tw-justify-center tw-gap-2 tw-rounded-[5px] tw-bg-[#84CC16] tw-p-[4px] tw-text-white" id="searchBtn" type="submit">
<button class="btn-search-click tw-flex tw-w-[50%] tw-items-center tw-justify-center tw-gap-2 tw-rounded-[5px] tw-bg-[#84CC16] tw-p-[4px] tw-text-white tw-transition tw-ease-in-out hover:tw-bg-[#7DC215]" id="searchBtn" type="submit">
<span>جستجو</span>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none">
<circle cx="11" cy="11" r="6" stroke="white" stroke-width="2"/>
@@ -274,7 +274,7 @@
<div class="tw-mb-2 tw-mb-4 tw-flex tw-items-center tw-justify-between tw-gap-2">
<div class="tw-w-full">
<select class="form-control" asp-for="searchModel.Year">
<option value="0" disabled="disabled">سال</option>
<option value="0">سال</option>
@foreach (var year in Model.YearlyList)
{
<option value=@year>@year</option>
@@ -283,7 +283,7 @@
</div>
<div class="tw-w-full">
<select class="form-control" asp-for="searchModel.Month">
<option value="0" disabled="disabled">ماه</option>
<option value="0">ماه</option>
<option value="01">فروردین</option>
<option value="02">اردیبهشت</option>
<option value="03">خرداد</option>
@@ -320,19 +320,19 @@
<div class="mb-2 tw-flex tw-flex-col">
<div class="custom-scrollbar-x tw-w-full tw-overflow-x-auto">
<div class="tab-bar tw-flex tw-w-max tw-gap-3 tw-whitespace-nowrap">
<button permission="80217" type="button" class="tab-bar__tab u-tactile tab-bar__tab--active js-document-click" value="0">
<button permission="80217" data-permission="80217" type="button" class="tab-bar__tab u-tactile tab-bar__tab--active js-document-click" value="0">
<span class="tab-bar__tab-label"> انجام نشده</span>
<span class="tab-bar__tab-badge" id="notStarted"></span>
</button>
<button permission="80218" type="button" class="tab-bar__tab u-tactile js-document-click" value="1">
<button permission="80218" data-permission="80218" type="button" class="tab-bar__tab u-tactile js-document-click" value="1">
<span class="tab-bar__tab-label">در حال انجام امور</span>
<span class="tab-bar__tab-badge" id="inProgress"></span>
</button>
<button permission="80219" type="button" class="tab-bar__tab u-tactile js-document-click" value="2">
<button permission="80219" data-permission="80219" type="button" class="tab-bar__tab u-tactile js-document-click" value="2">
<span class="tab-bar__tab-label">آماده ارسال لیست</span>
<span class="tab-bar__tab-badge" id="readyToSendList"></span>
</button>
<button permission="80220" type="button" class="tab-bar__tab u-tactile js-document-click" value="3">
<button permission="80220" data-permission="80220" type="button" class="tab-bar__tab u-tactile js-document-click" value="3">
<span class="tab-bar__tab-label">انجام بیمه</span>
<span class="tab-bar__tab-badge" id="done"></span>
</button>
@@ -399,6 +399,7 @@
<div class="tw-flex tw-h-[35px] tw-items-center tw-justify-center tw-text-[16px]">
</div>
<div>
</div>
</div>
@@ -478,19 +479,19 @@
</div>
</div>
<div class="tw-col-span-2 md:tw-col-span-2">
@* <div class="tw-col-span-2 md:tw-col-span-2">
<div class="form-group">
<input class="form-control form-control-custom" asp-for="searchModel.Branch" placeholder="شعبه تامین اجتماعی" style="width: 100%">
</div>
</div>
</div> *@
<div class="tw-col-span-2 md:tw-col-span-2">
@* <div class="tw-col-span-2 md:tw-col-span-2">
<div class="form-group">
<select class="form-control form-control-custom" style="width: 100%" asp-for="searchModel.City">
<option value="0" selected>شهرستان</option>
</select>
</div>
</div>
</div> *@
<div class="tw-col-span-2 md:tw-col-span-2">
<div class="form-group">
@@ -555,9 +556,14 @@
var hasPermission_80214 = @(permissionList.Contains(80214) ? "true" : "false");
var hasPermission_80215 = @(permissionList.Contains(80215) ? "true" : "false");
var hasPermission_80216 = @(permissionList.Contains(80216) ? "true" : "false");
//new Permission
// var hasPermission_80217 = true;
var permissions = {
80217: @permissionList.Contains(80217).ToString().ToLower(),
80218: @permissionList.Contains(80218).ToString().ToLower(),
80219: @permissionList.Contains(80219).ToString().ToLower(),
80220: @permissionList.Contains(80220).ToString().ToLower()
};
</script>
<script src="~/assetsadmin/page/insurancelist/js/index.js?ver=@adminVersion"></script>
}

View File

@@ -1109,8 +1109,12 @@ public class IndexModel : PageModel
public async Task<IActionResult> OnGetTabCounts(int month, int year)
{
var accountId = _authHelper.CurrentAccountId();
var resultData = await _insuranceListApplication.GetTabCounts(accountId, month, year);
var searchModel = new InsuranceListSearchModel()
{
Year = year.ToString("0000"),
Month = month.ToString("00")
};
var resultData = await _insuranceListApplication.GetTabCounts(searchModel);
return new JsonResult(new
{

View File

@@ -100,7 +100,7 @@
<div class="card p-0">
<div class="card-section-btn bg-white">
<div class="content btn-group">
<a href="/apk/android" type="button" class="btn-download-android d-flex align-items-center justify-content-center">
<a href="/apk/android?@Guid.NewGuid()" type="button" class="btn-download-android d-flex align-items-center justify-content-center">
<svg width="30" height="30" fill="#ffffff" viewBox="-1 0 24 24" xmlns="http://www.w3.org/2000/svg">
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>

View File

@@ -197,7 +197,7 @@
@if (Model.HasApkToDownload)
{
<div class="d-md-none d-block" style="position: static; margin-top:100px;" id="downloadAppLogin">
<a href="/apk/android" type="button" class="btn-login d-block mx-auto w-100 text-white px-3 py-2 d-flex align-items-center">
<a href="/apk/android?@Guid.NewGuid()" type="button" class="btn-login d-block mx-auto w-100 text-white px-3 py-2 d-flex align-items-center">
<svg width="18" height="18" fill="#ffffff" viewBox="-1 0 24 24" xmlns="http://www.w3.org/2000/svg">
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>

View File

@@ -6,8 +6,11 @@
<!--<StartupObject>ServiceHost.Program</StartupObject>-->
</PropertyGroup>
<PropertyGroup>
<RazorCompileOnBuild>true</RazorCompileOnBuild>
</PropertyGroup>
<!--<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<!--<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<Optimize>True</Optimize>
</PropertyGroup>

View File

@@ -42,8 +42,8 @@ $(document).ready(function () {
"workshop-id",
"workshop-name",
"type-of-insurance",
"branch",
"city",
//"branch",
//"city",
"fixed-salary"
]);
@@ -55,8 +55,8 @@ $(document).ready(function () {
$("#searchModel_WorkshopId").val(paramsUrl['workshop-id']);
paramsUrl['workshop-id'] !== "" && $("#empSearchWorkshop").val(paramsUrl['workshop-name']).addClass('selectedOption');
paramsUrl['type-of-insurance'] === "" ? $("#searchModel_TypeOfInsuranceSend").val("0").trigger("change") : $("#searchModel_TypeOfInsuranceSend").val(paramsUrl['type-of-insurance']).trigger("change");
$("#searchModel_Branch").val(paramsUrl['branch']);
paramsUrl['city'] === "" ? $("#searchModel_City").val(0).trigger("change") : $("#searchModel_City").val(paramsUrl['city']).trigger("change");
//$("#searchModel_Branch").val(paramsUrl['branch']);
//paramsUrl['city'] === "" ? $("#searchModel_City").val(0).trigger("change") : $("#searchModel_City").val(paramsUrl['city']).trigger("change");
paramsUrl['fixed-salary'] === "" ? $("#searchModel_FixedSalary").val(0).trigger("change") : $("#searchModel_FixedSalary").val(paramsUrl['fixed-salary']).trigger("change");
var isAnyNotEmpty = false;
@@ -131,8 +131,8 @@ $(document).ready(function () {
.addParam("workshop-id", $("#searchModel_WorkshopId").val() === "0" ? "" : $("#searchModel_WorkshopId").val())
.addParam("workshop-name", $("#empSearchWorkshop").val())
.addParam("type-of-insurance", $("#searchModel_TypeOfInsuranceSend").val())
.addParam("branch", $("#searchModel_Branch").val())
.addParam("city", $("#searchModel_City").val())
//.addParam("branch", $("#searchModel_Branch").val())
//.addParam("city", $("#searchModel_City").val())
.addParam("fixed-salary", $("#searchModel_FixedSalary").val())
.pushState();
@@ -149,8 +149,27 @@ $(document).ready(function () {
$('.btn-clear-filter').removeClass('disable');
});
$('#closeModal').click(function () {
$('#MainModal').modal('hide');
});
loadGetTabCounts();
loadSearchNew();
//loadSearchNew();
// Active Tabs by Permission and Load Search New Function
let found = false;
$(".tab-bar__tab").removeClass("tab-bar__tab--active");
$(".tab-bar__tab").each(function () {
var permission = $(this).data("permission");
if (!found && permissions[permission] === true || permissions[permission] === "true") {
$(this).addClass("tab-bar__tab--active");
var status = parseInt($(this).val());
loadSearchNew(status);
found = true;
}
});
});
function removeSearch() {
@@ -216,8 +235,8 @@ function loadSearchNew(status = 0) {
"employee-id",
"workshop-id",
"type-of-insurance",
"branch",
"city",
//"branch",
//"city",
"fixed-salary"
]);
@@ -228,8 +247,8 @@ function loadSearchNew(status = 0) {
EmployerId: paramsUrl['employee-id'],
WorkshopId: paramsUrl['workshop-id'],
TypeOfInsuranceSend: paramsUrl['type-of-insurance'],
Branch: paramsUrl['branch'],
City: paramsUrl['city'],
//Branch: paramsUrl['branch'],
//City: paramsUrl['city'],
FixedSalary: paramsUrl['fixed-salary'],
Status: status,
PageIndex: pageIndex
@@ -505,7 +524,8 @@ function generateButtons(item, pathDSKKAR00, pathDSKWOR00) {
}
}
if (item.inspectionDone && item.debtDone && item.employerApproved && item.confirmSentlist) {
//if (item.inspectionDone && item.debtDone && item.employerApproved && item.confirmSentlist) {
if (item.inspectionDone || item.debtDone || item.employerApproved) {
// Confirm List and Print Button
if (hasPermission_80215) {
html += `

File diff suppressed because one or more lines are too long