From b77538218fbc59f30c22b1a7fa0c6bafadf06fdd Mon Sep 17 00:00:00 2001 From: MahanCh Date: Tue, 12 Aug 2025 11:17:02 +0330 Subject: [PATCH] add conflict indicator for employee customize checkout records --- .../CustomizeCheckoutAgg/CustomizeCheckout.cs | 9 +++- .../CustomizeCheckoutTemp.cs | 12 +++++ .../CustomizeCheckoutViewModel.cs | 2 + .../SalaryAidApplication.cs | 26 ++++++----- .../Migrations/CompanyContextModelSnapshot.cs | 6 +++ .../Repository/CustomizeCheckoutRepository.cs | 1 + .../CustomizeCheckoutTempRepository.cs | 1 + .../CheckoutTemporary.cshtml | 44 +++++++++++++++++-- .../CheckoutUnofficial.cshtml | 34 +++++++++++++- 9 files changed, 118 insertions(+), 17 deletions(-) diff --git a/Company.Domain/CustomizeCheckoutAgg/CustomizeCheckout.cs b/Company.Domain/CustomizeCheckoutAgg/CustomizeCheckout.cs index a5a5b953..637290cc 100644 --- a/Company.Domain/CustomizeCheckoutAgg/CustomizeCheckout.cs +++ b/Company.Domain/CustomizeCheckoutAgg/CustomizeCheckout.cs @@ -374,6 +374,13 @@ public class CustomizeCheckout : EntityBase TotalPayment = TotalPayment - previousAmount + newAmount; } + /// + /// آیا مغایرت مبلغ دارد + /// + public bool HasAmountConflict { get; private set; } - + public void SetHasAmountConflict(bool hasConflict) + { + HasAmountConflict = hasConflict; + } } \ No newline at end of file diff --git a/Company.Domain/CustomizeCheckoutTempAgg/CustomizeCheckoutTemp.cs b/Company.Domain/CustomizeCheckoutTempAgg/CustomizeCheckoutTemp.cs index 8a3cb9f2..d6330491 100644 --- a/Company.Domain/CustomizeCheckoutTempAgg/CustomizeCheckoutTemp.cs +++ b/Company.Domain/CustomizeCheckoutTempAgg/CustomizeCheckoutTemp.cs @@ -377,4 +377,16 @@ public class CustomizeCheckoutTemp : EntityBase { TotalPayment = TotalPayment - previousAmount + newAmount; } + + /// + /// آیا مغایرت مبلغ دارد + /// + public bool HasAmountConflict { get; private set; } + + + + public void SetHasAmountConflict(bool hasConflict) + { + HasAmountConflict = hasConflict; + } } \ No newline at end of file diff --git a/CompanyManagment.App.Contracts/CustomizeCheckout/CustomizeCheckoutViewModel.cs b/CompanyManagment.App.Contracts/CustomizeCheckout/CustomizeCheckoutViewModel.cs index 1dcb87dc..da3e98de 100644 --- a/CompanyManagment.App.Contracts/CustomizeCheckout/CustomizeCheckoutViewModel.cs +++ b/CompanyManagment.App.Contracts/CustomizeCheckout/CustomizeCheckoutViewModel.cs @@ -109,6 +109,8 @@ namespace CompanyManagment.App.Contracts.CustomizeCheckout public List CustomizeRotatingShifts { get; set; } public List RegularShift { get; set; } + public bool HasAmountConflict { get; set; } + //public bool HasLeft { get; set; } //public string IsBlockCantracingParty { get; set; } //public string IsActiveString { get; set; } diff --git a/CompanyManagment.Application/SalaryAidApplication.cs b/CompanyManagment.Application/SalaryAidApplication.cs index ca8b2ce6..1e5d59f6 100644 --- a/CompanyManagment.Application/SalaryAidApplication.cs +++ b/CompanyManagment.Application/SalaryAidApplication.cs @@ -122,12 +122,13 @@ public class SalaryAidApplication : ISalaryAidApplication if (customizeCheckouts != null) { - var salaryAids = customizeCheckouts.CustomizeCheckoutSalaryAids.ToList(); - - salaryAids.Add(new(entity.Amount.ToMoney(), entity.SalaryAidDateTime, - entity.SalaryAidDateTime.ToFarsi(), entity.CalculationDate, entity.CalculationDate.ToFarsi(), - entity.id)); - customizeCheckouts.SetSalaryAids(salaryAids); + customizeCheckouts.SetHasAmountConflict(true); + // var salaryAids = customizeCheckouts.CustomizeCheckoutSalaryAids.ToList(); + // + // salaryAids.Add(new(entity.Amount.ToMoney(), entity.SalaryAidDateTime, + // entity.SalaryAidDateTime.ToFarsi(), entity.CalculationDate, entity.CalculationDate.ToFarsi(), + // entity.id)); + //customizeCheckouts.SetSalaryAids(salaryAids); } } @@ -138,12 +139,13 @@ public class SalaryAidApplication : ISalaryAidApplication if (customizeCheckoutTemp != null) { - var salaryAids = customizeCheckoutTemp.CustomizeCheckoutSalaryAids.ToList(); - - salaryAids.Add(new(entity.Amount.ToMoney(), entity.SalaryAidDateTime, - entity.SalaryAidDateTime.ToFarsi(), entity.CalculationDate, entity.CalculationDate.ToFarsi(), - entity.id)); - customizeCheckoutTemp.SetSalaryAids(salaryAids); + customizeCheckoutTemp.SetHasAmountConflict(true); + // var salaryAids = customizeCheckoutTemp.CustomizeCheckoutSalaryAids.ToList(); + // + // salaryAids.Add(new(entity.Amount.ToMoney(), entity.SalaryAidDateTime, + // entity.SalaryAidDateTime.ToFarsi(), entity.CalculationDate, entity.CalculationDate.ToFarsi(), + // entity.id)); + //customizeCheckoutTemp.SetSalaryAids(salaryAids); } } diff --git a/CompanyManagment.EFCore/Migrations/CompanyContextModelSnapshot.cs b/CompanyManagment.EFCore/Migrations/CompanyContextModelSnapshot.cs index aaba91e1..c70fcc04 100644 --- a/CompanyManagment.EFCore/Migrations/CompanyContextModelSnapshot.cs +++ b/CompanyManagment.EFCore/Migrations/CompanyContextModelSnapshot.cs @@ -1065,6 +1065,9 @@ namespace CompanyManagment.EFCore.Migrations b.Property("FridayPay") .HasColumnType("float"); + b.Property("HasAmountConflict") + .HasColumnType("bit"); + b.Property("InstallmentDeduction") .HasColumnType("float"); @@ -1214,6 +1217,9 @@ namespace CompanyManagment.EFCore.Migrations b.Property("FridayPay") .HasColumnType("float"); + b.Property("HasAmountConflict") + .HasColumnType("bit"); + b.Property("InstallmentDeduction") .HasColumnType("float"); diff --git a/CompanyManagment.EFCore/Repository/CustomizeCheckoutRepository.cs b/CompanyManagment.EFCore/Repository/CustomizeCheckoutRepository.cs index 0e068ac1..1f0cdd3d 100644 --- a/CompanyManagment.EFCore/Repository/CustomizeCheckoutRepository.cs +++ b/CompanyManagment.EFCore/Repository/CustomizeCheckoutRepository.cs @@ -488,6 +488,7 @@ namespace CompanyManagment.EFCore.Repository TotalPayment = x.TotalPayment.ToMoney(), TotalPaymentD = x.TotalPayment, TotalLateToWorkDeduction = x.LateToWorkDeduction.ToMoney(), + HasAmountConflict = x.HasAmountConflict }).ToList(); diff --git a/CompanyManagment.EFCore/Repository/CustomizeCheckoutTempRepository.cs b/CompanyManagment.EFCore/Repository/CustomizeCheckoutTempRepository.cs index 1ab9ba57..3e99bbcc 100644 --- a/CompanyManagment.EFCore/Repository/CustomizeCheckoutTempRepository.cs +++ b/CompanyManagment.EFCore/Repository/CustomizeCheckoutTempRepository.cs @@ -216,6 +216,7 @@ namespace CompanyManagment.EFCore.Repository TotalPayment = x.TotalPayment.ToMoney(), TotalPaymentD = x.TotalPayment, TotalLateToWorkDeduction = x.LateToWorkDeduction.ToMoney(), + HasAmountConflict = x.HasAmountConflict }).ToList(); diff --git a/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/CheckoutTemporary.cshtml b/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/CheckoutTemporary.cshtml index f8394fc6..f417ab1f 100644 --- a/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/CheckoutTemporary.cshtml +++ b/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/CheckoutTemporary.cshtml @@ -68,6 +68,11 @@ background-color: #a8ebc1; } + .conflict-icon { + color: #dc3545; + margin-right: 5px; + } + @@media (max-width: 767px) { .table-contracts .Rtable .Rtable-row .Rtable-contract .Rtable-cell--heading button.btn-print { width: 30px; @@ -410,7 +415,23 @@ *@
نام پرسنل
-
@item.EmployeeFullName
+
+ @item.EmployeeFullName + @if (item.HasAmountConflict) + { + + + + + } +
آغاز قرارداد
@@ -490,6 +511,21 @@
@item.EmployeeFullName + @if (item.HasAmountConflict) + { + + + + + + }
@@ -761,7 +797,9 @@ var deleteOneAjax = `@Url.Page("/Company/CustomizeCheckout/CheckoutTemporary", "DeleteOne")`; var deleteAllAjax = `@Url.Page("/Company/CustomizeCheckout/CheckoutTemporary", "DeleteAll")`; - + document.querySelectorAll('[data-bs-toggle="tooltip"]').forEach(el => { + bootstrap.Tooltip.getOrCreateInstance(el); + }); -} \ No newline at end of file +} diff --git a/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/CheckoutUnofficial.cshtml b/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/CheckoutUnofficial.cshtml index fcc7bdbf..744dc919 100644 --- a/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/CheckoutUnofficial.cshtml +++ b/ServiceHost/Areas/Client/Pages/Company/CustomizeCheckout/CheckoutUnofficial.cshtml @@ -410,7 +410,22 @@ *@
نام پرسنل
-
@item.EmployeeFullName
+
@item.EmployeeFullName + @if (item.HasAmountConflict) + { + + + + + } +
آغاز قرارداد
@@ -490,6 +505,20 @@
@item.EmployeeFullName + @if (item.HasAmountConflict) + { + + + + + }
@@ -763,6 +792,9 @@ var deleteOneAjax = `@Url.Page("/Company/CustomizeCheckout/CheckoutUnofficial", "DeleteOne")`; var deleteAllAjax = `@Url.Page("/Company/CustomizeCheckout/CheckoutUnofficial", "DeleteAll")`; + document.querySelectorAll('[data-bs-toggle="tooltip"]').forEach(el => { + bootstrap.Tooltip.getOrCreateInstance(el); + }); } \ No newline at end of file