diff --git a/CompanyManagment.App.Contracts/CustomizeCheckout/CustomizeCheckoutViewModel.cs b/CompanyManagment.App.Contracts/CustomizeCheckout/CustomizeCheckoutViewModel.cs index da3e98de..0da3d689 100644 --- a/CompanyManagment.App.Contracts/CustomizeCheckout/CustomizeCheckoutViewModel.cs +++ b/CompanyManagment.App.Contracts/CustomizeCheckout/CustomizeCheckoutViewModel.cs @@ -111,6 +111,9 @@ namespace CompanyManagment.App.Contracts.CustomizeCheckout public bool HasAmountConflict { get; set; } + // New: up to three dynamic deduction items (title -> amount string) + public IDictionary DynamicDeductions { get; set; } = new Dictionary(); + //public bool HasLeft { get; set; } //public string IsBlockCantracingParty { get; set; } //public string IsActiveString { get; set; } diff --git a/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs b/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs index d462bf8b..e4f32f41 100644 --- a/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs +++ b/CompanyManagment.EFCore/Repository/RollCallMandatoryRepository.cs @@ -2641,8 +2641,12 @@ public class RollCallMandatoryRepository : RepositoryBase, IRoll { var checkoutEnd = contractEnd; var checkoutStart = contractStart; + if (workshopId == 170) return CustomizeCheckoutMandatoryComputeForKebabMahdi(employeeId, workshopId, contractStart, contractEnd); + + if (workshopId is 367 or 368) + return CustomizeCheckoutMandatoryComputeForPizzaAmir(employeeId, workshopId, contractStart, contractEnd); var firstDayOfMonth = $"{(contractStart.ToFarsi())[..8]}/01".ToGeorgianDateTime(); @@ -4721,11 +4725,13 @@ public class RollCallMandatoryRepository : RepositoryBase, IRoll { leavePermittedDays -= absenceDays; leavePayAmount = leavePermittedDays * dailyWage; + absentsDeductionAmount = 0; } else { absenceDays -= leavePermittedDays; absentsDeductionAmount = absenceDays * dailyWage; + leavePayAmount = 0; } #endregion diff --git a/CompanyManagment.EFCore/Repository/RollCallRepository.cs b/CompanyManagment.EFCore/Repository/RollCallRepository.cs index 27b00e72..b76e01b8 100644 --- a/CompanyManagment.EFCore/Repository/RollCallRepository.cs +++ b/CompanyManagment.EFCore/Repository/RollCallRepository.cs @@ -412,17 +412,23 @@ public class RollCallRepository : RepositoryBase, IRollCallRepos DateTimeGr = x.Key.Date, IsSliced = x.Count() > 2, IsAbsent = false, - EnterDifferencesMinutes1 = firstRollCall != null && firstRollCall.LateEntryDuration > TimeSpan.Zero && workshopId == 170 + EnterDifferencesMinutes1 = firstRollCall != null && firstRollCall.LateEntryDuration > TimeSpan.Zero ? CalculateEntryMinuteDifference(firstRollCall.EarlyEntryDuration, firstRollCall.LateEntryDuration) : "", - ExitDifferencesMinutes1 = "", + ExitDifferencesMinutes1 = firstRollCall != null && firstRollCall.EarlyExitDuration > TimeSpan.Zero + ? CalculateExitMinuteDifference(firstRollCall.EarlyExitDuration, + firstRollCall.LateExitDuration) + : "", - EnterDifferencesMinutes2 = secondRollCall != null && secondRollCall.LateEntryDuration > TimeSpan.Zero && workshopId == 170 && hasSecondTimeDiff + EnterDifferencesMinutes2 = secondRollCall != null && secondRollCall.LateEntryDuration > TimeSpan.Zero && hasSecondTimeDiff ? CalculateEntryMinuteDifference(secondRollCall.EarlyEntryDuration, secondRollCall.LateEntryDuration) : "", - ExitDifferencesMinutes2 = "" + ExitDifferencesMinutes2 = secondRollCall != null && secondRollCall.EarlyExitDuration > TimeSpan.Zero && hasSecondTimeDiff + ? CalculateExitMinuteDifference(secondRollCall.EarlyExitDuration, + secondRollCall.LateExitDuration) + : "" }; }); presentDays = presentDays.Select(x => new CheckoutDailyRollCallViewModel @@ -1736,17 +1742,23 @@ public class RollCallRepository : RepositoryBase, IRollCallRepos IsSliced = x.Count() > 2, IsAbsent = false, - EnterDifferencesMinutes1 = firstRollCall != null && firstRollCall.LateEntryDuration > TimeSpan.Zero && workshopId == 170 + EnterDifferencesMinutes1 = firstRollCall != null && firstRollCall.LateEntryDuration > TimeSpan.Zero ? CalculateEntryMinuteDifference(firstRollCall.EarlyEntryDuration, firstRollCall.LateEntryDuration) : "", - ExitDifferencesMinutes1 = "", + ExitDifferencesMinutes1 = firstRollCall != null && firstRollCall.EarlyExitDuration > TimeSpan.Zero + ? CalculateExitMinuteDifference(firstRollCall.EarlyExitDuration, + firstRollCall.LateExitDuration) + : "", - EnterDifferencesMinutes2 = secondRollCall != null && secondRollCall.LateEntryDuration > TimeSpan.Zero && workshopId == 170&& hasSecondTimeDiff + EnterDifferencesMinutes2 = secondRollCall != null && secondRollCall.LateEntryDuration > TimeSpan.Zero && hasSecondTimeDiff ? CalculateEntryMinuteDifference(secondRollCall.EarlyEntryDuration, secondRollCall.LateEntryDuration) : "", - ExitDifferencesMinutes2 = "" + ExitDifferencesMinutes2 = secondRollCall != null && secondRollCall.EarlyExitDuration > TimeSpan.Zero && hasSecondTimeDiff + ? CalculateExitMinuteDifference(secondRollCall.EarlyExitDuration, + secondRollCall.LateExitDuration) + : "" }; }); presentDays = presentDays.Select(x => new CheckoutDailyRollCallViewModel @@ -1801,9 +1813,6 @@ public class RollCallRepository : RepositoryBase, IRollCallRepos //حضور غیاب گروهی از پرسنل برای پرینت گروهی فیش حقوقی غیر رسمی نهایی public List GetEmployeeRollCallsForMonthForKababMahdi(IEnumerable employeeIds, long workshopId, DateTime start, DateTime end) { - - - var rollCalls = _context.RollCalls.Where(x => employeeIds.Contains(x.EmployeeId) && workshopId == x.WorkshopId && x.StartDate != null && x.EndDate != null && x.RollCallModifyType != RollCallModifyType.Undefined && diff --git a/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/_Partials/PrintDetailsCheckoutTemporaryRaw.cshtml b/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/_Partials/PrintDetailsCheckoutTemporaryRaw.cshtml index 0d969e5b..0f544828 100644 --- a/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/_Partials/PrintDetailsCheckoutTemporaryRaw.cshtml +++ b/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/_Partials/PrintDetailsCheckoutTemporaryRaw.cshtml @@ -254,7 +254,7 @@ عیدی - @(Model.BonusesPay == "0" ? "-" : Model.BonusesPay) - + تتتتتتت