diff --git a/CompanyManagment.App.Contracts/Checkout/CreateCheckout.cs b/CompanyManagment.App.Contracts/Checkout/CreateCheckout.cs index 423d087c..8baee048 100644 --- a/CompanyManagment.App.Contracts/Checkout/CreateCheckout.cs +++ b/CompanyManagment.App.Contracts/Checkout/CreateCheckout.cs @@ -135,6 +135,11 @@ public class CreateCheckout /// public string TotalDayOfBunosesCompute { get; set; } + /// + /// ساعت موظفی پرسنل برای این ماه + /// + public TimeSpan EmployeeMandatoryHours { get; set; } + public bool HolidayWorking { get; set; } public string ShiftWork { get; set; } diff --git a/CompanyManagment.App.Contracts/Contract/ComputingViewModel.cs b/CompanyManagment.App.Contracts/Contract/ComputingViewModel.cs index 0e8ce49c..4c9478c8 100644 --- a/CompanyManagment.App.Contracts/Contract/ComputingViewModel.cs +++ b/CompanyManagment.App.Contracts/Contract/ComputingViewModel.cs @@ -56,5 +56,10 @@ public class ComputingViewModel public TimeSpan TotalPaidLeave { get; set; } public TimeSpan TotalSickLeave { get; set; } + /// + /// ساعت موظفی پرسنل برای این ماه + /// + public TimeSpan EmployeeMandatoryHours { get; set; } + //public List holidays; } \ No newline at end of file diff --git a/CompanyManagment.EFCore/Repository/FinancialStatmentRepository.cs b/CompanyManagment.EFCore/Repository/FinancialStatmentRepository.cs index c4ed3cc8..18cdbbcc 100644 --- a/CompanyManagment.EFCore/Repository/FinancialStatmentRepository.cs +++ b/CompanyManagment.EFCore/Repository/FinancialStatmentRepository.cs @@ -171,7 +171,8 @@ public class FinancialStatmentRepository : RepositoryBase> GetDetailsByPublicId(string publicId) { var op = new OperationResult(); @@ -186,7 +187,8 @@ public class FinancialStatmentRepository : RepositoryBase x.Creditor), TotalDebt = financialStatement.FinancialTransactionList.Sum(x => x.Deptor), ContractingPartyName = financialStatement.ContractingPartyName, - Transactions = financialStatement.FinancialTransactionList.Select(t => new FinancialTransactionDetailViewModel() + Transactions = financialStatement.FinancialTransactionList.Select(t => { - DateTimeGr = t.TdateGr, - DateFa = t.TdateGr.ToFarsi(), - TimeFa = $"{t.TdateGr:HH:mm}", - Description = t.DescriptionOption + " " + t.Description, - Debtor = t.Deptor, - Creditor = t.Creditor, - Balance = t.Balance, - Type = t.TypeOfTransaction == "debt" ? FinancialTransactionType.Debt : FinancialTransactionType.Credit, - TypeStr = t.TypeOfTransaction == "debt" ? "ایجاد درآمد" : "دریافت درآمد" + if (t.TypeOfTransaction == "debt") + { + balance += t.Deptor; + } + else + { + balance -= t.Creditor; + } + return new FinancialTransactionDetailViewModel() + { + DateTimeGr = t.TdateGr, + DateFa = t.TdateGr.ToFarsi(), + TimeFa = $"{t.TdateGr:HH:mm}", + Description = t.DescriptionOption + " " + t.Description, + Debtor = t.Deptor, + Creditor = t.Creditor, + Balance = balance, + Type = t.TypeOfTransaction == "debt" + ? FinancialTransactionType.Debt + : FinancialTransactionType.Credit, + TypeStr = t.TypeOfTransaction == "debt" ? "ایجاد درآمد" : "دریافت درآمد" + }; }).OrderByDescending(t => t.DateTimeGr).ToList(), }; return op.Succcedded(res); diff --git a/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs b/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs index 8f939e98..c0d51153 100644 --- a/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs +++ b/CompanyManagment.EFCore/Repository/InstitutionContractRepository.cs @@ -910,24 +910,30 @@ public class InstitutionContractRepository : RepositoryBase x.id == rollCallService.WorkshopId); string description = ""; - if (rollCallService.StartService <= prevMonthStart) - { - var monthPrev = prevMonthEnd.ToFarsi().Substring(5, 2); - var yearPrev = prevMonthEnd.ToFarsi().Substring(0, 4); - var prevMonthName = monthPrev.ToFarsiMonthByNumber(); - description = - $"{prevMonthName} و {currentMonthName} {yearCurrent} - {workshop.WorkshopFullName}"; - monthCounter = 2; - } - else if (rollCallService.StartService <= currentMonthStart && - rollCallService.StartService > prevMonthStart) + //if (rollCallService.StartService <= prevMonthStart) + //{ + // var monthPrev = prevMonthEnd.ToFarsi().Substring(5, 2); + // var yearPrev = prevMonthEnd.ToFarsi().Substring(0, 4); + // var prevMonthName = monthPrev.ToFarsiMonthByNumber(); + // description = + // $"{prevMonthName} و {currentMonthName} {yearCurrent} - {workshop.WorkshopFullName}"; + // monthCounter = 2; + //} + //else if (rollCallService.StartService <= currentMonthStart && + // rollCallService.StartService > prevMonthStart) + //{ + // monthCounter = 1; + + // description = $"{currentMonthName} {yearCurrent} - {workshop.WorkshopFullName}"; + //} + + if (rollCallService.StartService <= currentMonthStart) { monthCounter = 1; description = $"{currentMonthName} {yearCurrent} - {workshop.WorkshopFullName}"; } - var employees = _context.RollCallEmployees.Where(x => x.WorkshopId == rollCallService.WorkshopId) .Select(x => x.id); @@ -966,9 +972,14 @@ public class InstitutionContractRepository : RepositoryBase @@ -989,7 +1000,7 @@ public class InstitutionContractRepository : RepositoryBase, IRoll //This Time Mandatory Hourse double mandatoryHours = Math.Round((mandatorDays * 7.33), 2); + //تبدیل عدد زیاضی موظفی به تایم اسپن + int hoursConverted = (int)mandatoryHours; + double minutesDecimalConverted = (mandatoryHours - hoursConverted) * 60; + int minutesConverted = (int)minutesDecimalConverted; + TimeSpan mandatoryHoursTimeSpan = new TimeSpan(hoursConverted, minutesConverted, 0); + + //گرفتن ساعت استراحت پرسنل از تنظیمات #region breakTime BaseCustomizeEntity settings = _context.CustomizeWorkshopEmployeeSettings.AsSplitQuery() @@ -443,7 +450,7 @@ public class RollCallMandatoryRepository : RepositoryBase, IRoll //TimeSpan mandatoryHoursTimeSpan = new TimeSpan(7, 20, 0).Multiply(mandatorDays); //TimeSpan Mandatory = sumSpansWhitOutleaves.Subtract(mandatoryHoursTimeSpan); - double mandatoryWorkWithOutleaves = (sumSpansWhitOutleaves.TotalMinutes) / 60; + double mandatoryWorkWithOutleaves = (sumSpans.TotalMinutes) / 60; double overTimeWork = 0; if (mandatoryWorkWithOutleaves > mandatoryHours) { @@ -881,6 +888,9 @@ public class RollCallMandatoryRepository : RepositoryBase, IRoll TotalPaidLeave = totalLeaveSpan, //مرخصی استعلاجی TotalSickLeave = new TimeSpan(sickLeaveTimeSpans.Sum(x => x.Ticks)), + + //ساعت موظفی پرسنل در این ماه + EmployeeMandatoryHours = mandatoryHoursTimeSpan, #endregion }; diff --git a/ServiceHost/Areas/Admin/Pages/Company/Checkouts/Index.cshtml.cs b/ServiceHost/Areas/Admin/Pages/Company/Checkouts/Index.cshtml.cs index 7f1e49a2..ff15a680 100644 --- a/ServiceHost/Areas/Admin/Pages/Company/Checkouts/Index.cshtml.cs +++ b/ServiceHost/Areas/Admin/Pages/Company/Checkouts/Index.cshtml.cs @@ -1041,6 +1041,9 @@ public class IndexModel : PageModel //لیست حضورغیاب جهت ذخیره سازی GroupedRollCalls = mandatoryCompute.GroupedRollCalls, + // ساعت موظفی پرسنل برای این ماه + EmployeeMandatoryHours = mandatoryCompute.EmployeeMandatoryHours, + HasInsuranceChekoutOverTime = workshop.InsuranceCheckoutOvertime }; diff --git a/ServiceHost/Areas/Client/Pages/Index.cshtml.cs b/ServiceHost/Areas/Client/Pages/Index.cshtml.cs index e61508cc..18436670 100644 --- a/ServiceHost/Areas/Client/Pages/Index.cshtml.cs +++ b/ServiceHost/Areas/Client/Pages/Index.cshtml.cs @@ -687,9 +687,16 @@ namespace ServiceHost.Areas.Client.Pages var allServices = _rollCallServiceApplication.GetAllServiceByWorkshopId(workshopId); var hasPreviousService = allServices.Any(); + + var activeService = _rollCallServiceApplication.GetActiveServiceByWorkshopId(workshopId); var hasRollCallService = activeService != null; + bool hasCustomizeCheckout = false; + + if (hasRollCallService) + hasCustomizeCheckout = activeService.HasCustomizeCheckoutService == "true" ? true : false; + bool hasCameraAccount; if (hasRollCallService) { @@ -707,7 +714,8 @@ namespace ServiceHost.Areas.Client.Pages { hasRollCallWorkshopSetting, hasCameraAccount, - hasRollCallService + hasRollCallService, + hasCustomizeCheckout }); } diff --git a/ServiceHost/Properties/launchSettings.json b/ServiceHost/Properties/launchSettings.json index 69be5550..788962e4 100644 --- a/ServiceHost/Properties/launchSettings.json +++ b/ServiceHost/Properties/launchSettings.json @@ -11,7 +11,7 @@ }, "ServiceHost": { "commandName": "Project", - "launchBrowser": false, + "launchBrowser": true, "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development", "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" diff --git a/ServiceHost/appsettings.Development.json b/ServiceHost/appsettings.Development.json index ef2d0a22..b99bd4af 100644 --- a/ServiceHost/appsettings.Development.json +++ b/ServiceHost/appsettings.Development.json @@ -12,7 +12,7 @@ //"MesbahDb": "Data Source=DESKTOP-NUE119G\\MSNEW;Initial Catalog=Mesbah_db;Integrated Security=True" //server - "MesbahDbServer": "Data Source=171.22.24.15;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]18[3019]#@ATt;TrustServerCertificate=true;", + //"MesbahDbServer": "Data Source=171.22.24.15;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]18[3019]#@ATt;TrustServerCertificate=true;", //local @@ -35,7 +35,7 @@ "ApiKey": "Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa", "SecretKey": "dadmehr" }, - "Domain": ".dadmehrg.ir" + "Domain": ".gozareshgir.ir" }