Merge branch 'refs/heads/master' into Feature/program-manager/move

This commit is contained in:
2025-12-13 11:36:44 +03:30
6 changed files with 151 additions and 143 deletions

View File

@@ -2860,7 +2860,7 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
var allContractsBetween = _context.Contracts.AsSplitQuery().Include(x => x.WorkingHoursList)
.Where(x => x.WorkshopIds == workshopId && x.EmployeeId == employeeId &&
x.ContractEnd >= startDate && x.ContarctStart <= endDate).ToList();
var isWorkshopStaticCheckout = _context.Workshops.FirstOrDefault(x => x.id == workshopId)!.IsStaticCheckout;
int mandatoryDays = 0;
double allCanToLeave = 0;
double canToLeave = 0;
@@ -2894,7 +2894,8 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
var rollCallTotalHoures = GetTotalWorkingHoursIfHasRollCall(employeeId, workshopId,
contract.ContarctStart.Date, contract.ContractEnd.Date);
if (rollCallTotalHoures.hasRollCall)
if (rollCallTotalHoures.hasRollCall && !isWorkshopStaticCheckout)
{
totalWorkingHours = rollCallTotalHoures.WorkingTotalHours;
}
@@ -3375,6 +3376,7 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
var allContractsBetween = _context.Contracts.AsSplitQuery().Include(x => x.WorkingHoursList)
.Where(x => x.WorkshopIds == workshopId && x.EmployeeId == employeeId &&
x.ContractEnd >= startDate && x.ContarctStart <= endDate).OrderBy(x => x.ContarctStart).ToList();
var isWorkshopStaticCheckout = _context.Workshops.FirstOrDefault(x => x.id == workshopId)!.IsStaticCheckout;
double canToLeave = 0;
int contractCounter = 0;
foreach (var contract in allContractsBetween)
@@ -3407,7 +3409,7 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
var rollCallTotalHoures = GetTotalWorkingHoursIfHasRollCall(employeeId, workshopId,
contract.ContarctStart.Date, contract.ContractEnd.Date);
if (rollCallTotalHoures.hasRollCall)
if (rollCallTotalHoures.hasRollCall && !isWorkshopStaticCheckout)
{
totalWorkingHours = rollCallTotalHoures.WorkingTotalHours;
}

View File

@@ -7,37 +7,8 @@
string adminVersion = _0_Framework.Application.Version.AdminVersion;
<link href="~/admintheme/css/workshop-create.css?ver=@adminVersion" rel="stylesheet" />
<style>
body{
background-color: #fefefe;
background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%232ebfbf' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
}
.hiddenTab{
display: none;
}
.errored {
animation: shake 300ms;
box-shadow: inset 0 0 2px #eb3434, 0 0 5px #eb3434 !important;
border: 1px solid #eb3434 !important;
}
.date-input {
text-align: center;
}
button.rounded-pill {
border-radius: 5px !important;
}
.instantSendSms {
background-color: #75aea7;
color: white !important;
}
</style>
<link href="~/admintheme/page/SmsSettings/css/SmsSettings.css?ver=@adminVersion" rel="stylesheet" />
}
<div class="container">
@@ -125,112 +96,9 @@
<script src="~/js/signalr/dist/browser/signalr.js"></script>
<script>
$(document).ready(function () {
$('.time-input').mask('00:00', {
translation: {
'0': {pattern: /[0-9]/},
// برای اولین رقم ساعت فقط 0-2
'H': {pattern: /[0-2]/},
// اگر اولین رقم 2 باشد دومین رقم فقط 0-3
'h': {pattern: /[0-3]/},
// برای دقیقه
'M': {pattern: /[0-5]/},
'm': {pattern: /[0-9]/},
}
});
// پیش‌فرض: لود تب اول با workshopId
loadPartial("/Admin/Company/SmsResult/SmsSettings?handler=InstitutionContractDebtReminderTab");
$("#institutionContractDebtReminderTab").addClass("active");
// کلیک روی تب‌ها
$("#institutionContractDebtReminderTab, #blockContractingPartyTab, #legalActionTab, #warningTab").click(function (e) {
e.preventDefault();
let url = $(this).data("url");
switch(this.id){
case "institutionContractDebtReminderTab" :
loadPartial(url);
$("#institutionContractDebtReminderTab, #blockContractingPartyTab, #legalActionTab, #warningTab").removeClass("active");
$(this).addClass("active");
break;
case "blockContractingPartyTab" :
loadPartial(url);
$("#institutionContractDebtReminderTab, #blockContractingPartyTab, #legalActionTab, #warningTab").removeClass("active");
$(this).addClass("active");
break;
case "legalActionTab" :
loadPartial(url);
$("#institutionContractDebtReminderTab, #blockContractingPartyTab, #legalActionTab, #warningTab").removeClass("active");
$(this).addClass("active");
break;
case "warningTab" :
loadPartial(url);
$("#institutionContractDebtReminderTab, #blockContractingPartyTab, #legalActionTab, #warningTab").removeClass("active");
$(this).addClass("active");
break;
}
});
function loadPartial(url) {
$.get(url, function (data) {
$("#partialContainer").html(data);
});
}
});
function remove(id){
var urlAjaxToRemove = '@Url.Page("/Company/SmsResult/SmsSettings", "RemoveSetting")';
$.ajax({
dataType: 'json',
type: 'GET',
url: urlAjaxToRemove,
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
data: { id: id },
success: function (response) {
if(response.isSuccess){
$.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', response.message);
setTimeout(function () {
$(".li-wizard.step.active").trigger("click");
}, 500);
}else{
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message);
}
},
failure: function (response) {
//console.log(5, response);
}
});
}
var urlAjaxToRemove = '@Url.Page("/Company/SmsResult/SmsSettings", "RemoveSetting")';
var antiforgeryToken = $('@Html.AntiForgeryToken()').val();
</script>
<script src="~/AssetsAdmin/page/SmsSettings/js/SmsSettings.js?ver=@adminVersion"></script>
}

View File

@@ -154,14 +154,14 @@ namespace ServiceHost.Areas.AdminNew.Pages
issuer: _configuration["JwtSettings:Issuer"] ?? "GozareshgirApp",
audience: _configuration["JwtSettings:Audience"] ?? "GozareshgirUsers",
claims: claims,
expires: DateTime.UtcNow.AddMinutes(int.Parse(_configuration["JwtSettings:ExpirationMinutes"] ?? "30")),
expires: DateTime.Now.AddMinutes(int.Parse(_configuration["JwtSettings:ExpirationMinutes"] ?? "30")),
signingCredentials: credentials
);
var tokenString = new JwtSecurityTokenHandler().WriteToken(token);
var domain = _configuration["Domain"] ?? "http://localhost:5000";
// Redirect به SSO-Login با Token
var ssoUrl = $"https://pm{domain}/ssologin?token={Uri.EscapeDataString(tokenString)}";
var ssoUrl = $"https://pm{domain}/ssoLogin?token={Uri.EscapeDataString(tokenString)}";
// var ssoUrl = $"https://localhost:7032/api/Auth/sso-login?token={Uri.EscapeDataString(tokenString)}";
return Redirect(ssoUrl);
}

View File

@@ -60,6 +60,7 @@
</ItemGroup>
<ItemGroup>
<Content Remove="wwwroot\AssetsAdmin\page\SmsSettings\js\SmsSettings.js" />
<Content Remove="wwwroot\AssetsAdmin\page\Workshop\js\EditWorkshopAdmin.js" />
</ItemGroup>
@@ -514,6 +515,7 @@
<None Include="wwwroot\AssetsAdmin\js\jquery-3.7.1.min.js" />
<None Include="wwwroot\AssetsAdmin\page\Checkouts\js\PrintDetailsRollCall.js" />
<None Include="wwwroot\AssetsAdmin\page\Index\js\Index.js" />
<None Include="wwwroot\AssetsAdmin\page\SmsSettings\js\SmsSettings.js" />
<None Include="wwwroot\AssetsAdmin\page\Workshop\js\EditWorkshopAdmin.js" />
<None Include="wwwroot\AssetsAdmin\vendors\bootstrap\css\bootstrap-grid.css.map" />
<None Include="wwwroot\AssetsAdmin\vendors\bootstrap\css\bootstrap-grid.min.css.map" />

View File

@@ -0,0 +1,30 @@
body {
background-color: #fefefe;
background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%232ebfbf' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
}
.hiddenTab {
display: none;
}
.errored {
animation: shake 300ms;
box-shadow: inset 0 0 2px #eb3434, 0 0 5px #eb3434 !important;
border: 1px solid #eb3434 !important;
}
.date-input {
text-align: center;
}
button.rounded-pill {
border-radius: 5px !important;
}
.instantSendSms {
background-color: #75aea7;
color: white !important;
}

View File

@@ -0,0 +1,106 @@
$(document).ready(function () {
$('.time-input').mask('00:00', {
translation: {
'0': { pattern: /[0-9]/ },
// برای اولین رقم ساعت فقط 0-2
'H': { pattern: /[0-2]/ },
// اگر اولین رقم 2 باشد دومین رقم فقط 0-3
'h': { pattern: /[0-3]/ },
// برای دقیقه
'M': { pattern: /[0-5]/ },
'm': { pattern: /[0-9]/ },
}
});
// پیش‌فرض: لود تب اول با workshopId
loadPartial("/Admin/Company/SmsResult/SmsSettings?handler=InstitutionContractDebtReminderTab");
$("#institutionContractDebtReminderTab").addClass("active");
// کلیک روی تب‌ها
$("#institutionContractDebtReminderTab, #blockContractingPartyTab, #legalActionTab, #warningTab").click(function (e) {
e.preventDefault();
let url = $(this).data("url");
switch (this.id) {
case "institutionContractDebtReminderTab":
loadPartial(url);
$("#institutionContractDebtReminderTab, #blockContractingPartyTab, #legalActionTab, #warningTab").removeClass("active");
$(this).addClass("active");
break;
case "blockContractingPartyTab":
loadPartial(url);
$("#institutionContractDebtReminderTab, #blockContractingPartyTab, #legalActionTab, #warningTab").removeClass("active");
$(this).addClass("active");
break;
case "legalActionTab":
loadPartial(url);
$("#institutionContractDebtReminderTab, #blockContractingPartyTab, #legalActionTab, #warningTab").removeClass("active");
$(this).addClass("active");
break;
case "warningTab":
loadPartial(url);
$("#institutionContractDebtReminderTab, #blockContractingPartyTab, #legalActionTab, #warningTab").removeClass("active");
$(this).addClass("active");
break;
}
});
function loadPartial(url) {
$.get(url, function (data) {
$("#partialContainer").html(data);
});
}
});
function remove(id) {
$.ajax({
dataType: 'json',
type: 'GET',
url: urlAjaxToRemove,
headers: { "RequestVerificationToken": antiforgeryToken },
data: { id: id },
success: function (response) {
if (response.isSuccess) {
$.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', response.message);
setTimeout(function () {
$(".li-wizard.step.active").trigger("click");
}, 500);
} else {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message);
}
},
failure: function (response) {
//console.log(5, response);
}
});
}