fixed lost code 3

This commit is contained in:
SamSys
2024-08-05 20:36:24 +03:30
parent ced5c8c576
commit aaffc0ddf2
14 changed files with 368 additions and 152 deletions

View File

@@ -10,8 +10,8 @@ public static class Version
{
static Version()
{
StyleVersion = "2.11.31";
AdminVersion = "2.5.16";
StyleVersion = "2.11.33";
AdminVersion = "2.5.18";
CameraVersion = "1.0.3";
}

View File

@@ -1396,20 +1396,40 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
.FirstOrDefault(x => x.ContractStart == separationStartDate);
if ((hasleft && leftWorkDate <= separationEndDate) || (separationEndDate == contractEnd && checkoutMonth == "12"))
{
//وضعیت تصفیه مزد مرخصی
result.LeaveCheckout = true;
////مدت طلب مرخصی
result.CreditLeaves = 0;
var end = EndOfYearCantoleaveList(startDate, separationEndDate, workshopId, employeeId,
hasleft, leftWorkDate, fridayStartToEnd, officialHoliday, totalHoursH, totalHorsM,
separationStartDate);
//وضعیت تصفیه مزد مرخصی
result.LeaveCheckout = true;
var canTolv = endOfYearRes.CanToLeave;
var absence = end.Sum(x => x.PeriodOfAbsence);
if (canTolv >= absence)
{
canTolv -= absence;
absence = 0;
//مزد مرخصی
result.LeavPay = endOfYearRes.CanToLeave * leavePayPerHours;
}
else
{
absence -= canTolv;
canTolv = 0;
//مدت غیبت
result.AbsencePeriod = endOfYearRes.PeriodOfAbsence;
//کسری غیبت
result.AbsenceDeduction = endOfYearRes.PeriodOfAbsence * absenceDeductionPerHourses;
}
//مزد مرخصی
//result.LeavPay = endOfYearRes.CanToLeave * leavePayPerHours;
result.LeavPay = canTolv * leavePayPerHours;
//مدت غیبت
result.AbsencePeriod = absence;
////مدت طلب مرخصی
result.CreditLeaves = canTolv;
//کسری غیبت
result.AbsenceDeduction = absence * absenceDeductionPerHourses;
//میانگین ساعت کار در یک روز
result.AverageHoursPerDay = endOfYearRes.WorkingPerDayHourses;
result.AverageHoursPerDay = end.FirstOrDefault()!.WorkingPerDayHourses;
}
else
@@ -1422,10 +1442,11 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
result.LeavPay = 0;
//مدت غیبت
result.AbsencePeriod = endOfYearRes.PeriodOfAbsence;
//کسری غیبت
result.AbsenceDeduction = endOfYearRes.PeriodOfAbsence * absenceDeductionPerHourses;
//میانگین ساعت کار در یک روز
result.AverageHoursPerDay = endOfYearRes.WorkingPerDayHourses;
//کسری غیبت
//result.AbsenceDeduction = endOfYearRes.PeriodOfAbsence * absenceDeductionPerHourses;
result.AbsenceDeduction = 0;
//میانگین ساعت کار در یک روز
result.AverageHoursPerDay = endOfYearRes.WorkingPerDayHourses;
}
}
@@ -2193,7 +2214,7 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
var contactCanToleaveList = new List<ContractsCanToLeave>();
var allContractsBetween = _context.Contracts.Include(x => x.WorkingHoursList)
.Where(x => x.WorkshopIds == workshopId && x.EmployeeId == employeeId &&
x.ContarctStart >= startDate && x.ContarctStart < endDate).ToList();
x.ContarctStart >= startDate && x.ContarctStart < endDate).OrderBy(x=>x.ContarctStart).ToList();
double canToLeave = 0;
int contractCounter = 0;
foreach (var contract in allContractsBetween)
@@ -2594,44 +2615,71 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
;
bool lastChekout = endMonthGr == contract.ContractEnd;
bool endOfyear = lastChekout && isEndOfYear;
if (canToLeave >= usedLeaves) //اگر طلب مرخصی داشت
{
creditLeaves = canToLeave - usedLeaves;
var has365 = contactCanToleaveList.Any(x => x.Is365);
//اگر از 365 روز تجاوز کرد و باقی مانده مرخصی بیشتر از 9 روز بود فقط 9 روز بماند
if (is365 && !has365 && creditLeaves > canToLeavAfter365 && !left && !endOfyear)
{
creditLeaves = canToLeavAfter365;
//if (canToLeave >= usedLeaves) //اگر طلب مرخصی داشت
//{
// creditLeaves = canToLeave - usedLeaves;
// var has365 = contactCanToleaveList.Any(x => x.Is365);
// //اگر از 365 روز تجاوز کرد و باقی مانده مرخصی بیشتر از 9 روز بود فقط 9 روز بماند
// if (is365 && !has365 && creditLeaves > canToLeavAfter365 && !left && !endOfyear)
// {
// creditLeaves = canToLeavAfter365;
}
// }
if(is365 && has365 && !left && !endOfyear)
{
var last365 = contactCanToleaveList
.Where(x => x.Is365)
.MaxBy(x => x.ContractStart);
canToLeavAfter365 += last365.CanToLeave;
if (creditLeaves > canToLeavAfter365)
{
creditLeaves = canToLeavAfter365;
}
// if(is365 && has365 && !left && !endOfyear)
// {
// var last365 = contactCanToleaveList
// .Where(x => x.Is365)
// .MaxBy(x => x.ContractStart);
// canToLeavAfter365 += last365.CanToLeave;
// if (creditLeaves > canToLeavAfter365)
// {
// creditLeaves = canToLeavAfter365;
// }
}
// }
periodOfAbsence = 0;
// periodOfAbsence = 0;
}
else
{
//}
//else
//{
periodOfAbsence = usedLeaves - canToLeave;
// periodOfAbsence = usedLeaves - canToLeave;
creditLeaves = 0;
}
// creditLeaves = 0;
//}
#region NewcChanges
contactCanToleaveList.Add(new ContractsCanToLeave()
var has365B = contactCanToleaveList.Any(x => x.Is365);
creditLeaves = canToLeave;
//اگر از 365 روز تجاوز کرد و باقی مانده مرخصی بیشتر از 9 روز بود فقط 9 روز بماند
if (is365 && !has365B && creditLeaves > canToLeavAfter365 && !left && !endOfyear)
{
creditLeaves = canToLeavAfter365;
}
if (is365 && has365B && !left && !endOfyear)
{
var last365 = contactCanToleaveList
.Where(x => x.Is365)
.MaxBy(x => x.ContractStart);
canToLeavAfter365 += last365.CanToLeave;
if (creditLeaves > canToLeavAfter365)
{
creditLeaves = canToLeavAfter365;
}
}
periodOfAbsence = usedLeaves;
#endregion
contactCanToleaveList.Add(new ContractsCanToLeave()
{
ContractCounter = contractCounter,
WorkingPerDayHourses = workingHoursePerDay,

View File

@@ -382,12 +382,6 @@ public class IndexModel : PageModel
var currntAcc = _authHelper.CurrentAccountId();
//IProgress<int> progress = new Progress<int>(value => {
// // report progress to client
// Response.Headers.Add($"X-Progress-{Guid.NewGuid()}", value.ToString());
//});
//var watch = System.Diagnostics.Stopwatch.StartNew();
if (ConvertYear == "0" && ConvertMonth == "0")
{
var today = DateTime.Now;

View File

@@ -1523,7 +1523,13 @@ body.fixed-left .side-menu.left {
/*background: #f3f3f3;*/
}
#sidebar-menu ul ul { display: none; }
#sidebar-menu ul ul {
display: none;
background: rgba(255, 255, 255, 0.15);
margin: -9px 24px 0 24px;
border-radius: 0 0 15px 15px;
padding: 3px 0;
}
#sidebar-menu ul ul li { border-top: 0; }
@@ -1547,7 +1553,7 @@ body.fixed-left .side-menu.left {
margin: 2px 7px;
border-radius: 35px;
color: #fff;
background: rgba(255, 255, 255, 0.15);
/*background: rgba(255, 255, 255, 0.15);*/
}
#sidebar-menu ul ul a:hover {

View File

@@ -9,8 +9,11 @@
.panel-default {
border-radius: 15px !important;
}
.panel-group .panel {
background: #d5e5e5;
}
.panel-heading {
background-color: #545353 !important
background-color: #1b9998 !important
}
h3 .panel-title {
padding-left: 3px;
@@ -30,15 +33,15 @@ collapsed {
.btn-search1 {
border-bottom-left-radius: 0px;
border-top-left-radius: 0px;
background-color: #950000;
border-color: #950000;
background-color: #1b9998;
border-color: #1b9998;
font-family: 'Web_Yekan' !important;
margin-left: -3px
}
.btn-search1:hover {
background-color: #950000;
border-color: #950000;
}
.btn-search1:hover {
background-color: #1b9998;
border-color: #1b9998;
}
.btn-observe {
border-bottom-right-radius: 0px;
border-top-right-radius: 0px;

View File

@@ -16,7 +16,7 @@
.panel-group .panel {
border-radius: 16px;
background: #c0dcfd;
background: #d5e5e5;
}
.panel-body table thead th,
@@ -24,13 +24,13 @@
text-align: center;
}
.panel-default > .panel-heading {
background-color: #004b95;
background-color: #1b9998;
}
#datatable td {
font-size: 13px;
}
#datatable thead {
background: #01518b !important;
background: #1b9998 !important;
}
#datatable thead > tr > th {
background: #a2d0ff;
@@ -45,16 +45,16 @@
.btn-search1 {
border-bottom-left-radius: 0px;
border-top-left-radius: 0px;
background-color: #2a7fd3;
border-color: #2a7fd3;
background-color: #1b9998;
border-color: #1b9998;
font-family: 'Web_Yekan' !important;
margin-left: -3px;
}
.btn-search1:hover,
.btn-search1:focus{
background-color: #2a7fd3;
border-color: #2a7fd3;
}
.btn-search1:hover,
.btn-search1:focus {
background-color: #1b9998;
border-color: #1b9998;
}
.btn-observe {
border-bottom-right-radius: 0px;
@@ -547,13 +547,13 @@
max-height: 38px;
}
#mainPanelSearch #datatable thead > tr > th {
background: #a2d0ff;
color: black;
padding: 17px 0;
font-size: 12px;
border: 1px solid #ffffff;
}
#mainPanelSearch #datatable thead > tr > th {
background: #d5e5e5;
color: black;
padding: 17px 0;
font-size: 12px;
border: 1px solid #ffffff;
}
.tooltip {
z-index: 9999;

View File

@@ -146,6 +146,10 @@ color: #606060;*/
#sidebar-menu ul ul {
display: none;
background: rgba(255, 255, 255, 0.15);
margin: -9px 24px 0 24px;
border-radius: 0 0 15px 15px;
padding: 3px 0;
}
#sidebar-menu ul ul li {
@@ -172,7 +176,7 @@ border-radius: 5px;*/
margin: 2px 7px;
border-radius: 35px;
color: #fff;
background: rgba(255, 255, 255, 0.15);
/*background: rgba(255, 255, 255, 0.15);*/
font-size: 13px;
}

View File

@@ -9,7 +9,7 @@
.select2.select2-container .select2-selection {
display: flex !important;
height: 0 !important;
/*height: 0 !important;*/
padding: 0px;
}

View File

@@ -110,6 +110,11 @@
background-color: #65a30d;
}
.section-btns-task {
overflow-x: auto;
white-space: nowrap;
}
.btnTaskListSelfTask {
padding: 10px 30px;
border-radius: 8px;

View File

@@ -355,7 +355,7 @@
font-weight: 500;
}
.upload-box img, .upload-box-voice audio {
.upload-box .min-img, .upload-box-voice audio {
max-width: 100%;
width: 33px;
height: 33px;

View File

@@ -699,7 +699,7 @@
}
.table-task-manager .Rtable .Rtable-row * {
font-size: 12px;
font-size: 11px;
}
.table-task-manager .Rtable .Rtable-row .width1 {
@@ -708,7 +708,7 @@
.table-task-manager .Rtable .Rtable-row .width2 {
/* width: 60% / 5 */
width: 30%;
width: 40%;
}
.table-task-manager .Rtable .Rtable-row .width3 {
@@ -733,6 +733,10 @@
text-align: left !important;
}
.Rtable--collapse .Rtable-row .Rtable-cell .Rtable-cell--content {
font-size: 11px;
}
.table-task-manager .Rtable .Rtable-row .width7 {
width: 18%;
}
@@ -786,11 +790,7 @@
.sub-buttons {
justify-content: space-between;
}
.Rtable--collapse .Rtable-row .Rtable-cell .Rtable-cell--content {
font-size: 10px;
}
.Rtable--collapse .Rtable-row .Rtable-cell.width8 .Rtable-cell--content {
text-align: start;
}

View File

@@ -66,7 +66,7 @@
cursor: pointer;
}
.active {
.btnPosition.active {
outline: 1px solid #138989;
}

View File

@@ -5,7 +5,7 @@ document.getElementById("MainModal").style.visibility = "visible";
$(document).on('keydown', '#EndTaskDate', function () {
$("input:radio").prop('checked', false);
$("input[name='btnradio']").prop('checked', false);
});
$(document).ready(function () {
@@ -476,9 +476,10 @@ function uploadFile(file, id, boxClass) {
var formData = new FormData();
formData.append('media', file);
console.log(file);
var loading = $(boxClass).find('.spinner-loading');
loading.show();
$('#save').prop('disabled', true);
$('#save').addClass('disable');
$.ajax({
dataType: 'json',
@@ -494,7 +495,7 @@ function uploadFile(file, id, boxClass) {
if (file) {
let reader = new FileReader();
reader.onload = function (e) {
let img = $(`<img class="b${id}">`).attr('src', e.target.result);
let img = $(`<img class="min-img b${id}">`).attr('src', e.target.result);
let box = $(boxClass);
if (box.length) {
box.removeClass('empty');
@@ -516,6 +517,10 @@ function uploadFile(file, id, boxClass) {
var inputItems = `<input type="hidden" value="${response.id}" name="EditTask.UploadedMedia[${indexCount}]"/>`;
$('#fileItems').append(inputItems);
indexCount++;
$('#save').prop('disabled', false);
$('#save').removeClass('disable');
} else {
showAlertMessage('.alert-msg', response.message, 3500);
$('#EditTask_Document' + id).val('');
@@ -571,6 +576,7 @@ function removeVoice(id) {
// نمایش اسامی کارگاه
var container = $('#partyName');
var searchBox = $('#partyNameSearch');
@@ -580,7 +586,7 @@ var mixContainerAndSerchResult = $('#partyName , .searchResult');
container.hide();
var liList;
var liPointer;
var count = 0;
let count = 0;
//close search Employee when click on body
$(document).on('click', function (event) {
@@ -593,63 +599,177 @@ function selectItem(employeeFullName) {
searchBox.val(employeeFullName);
container.hide();
};
//search by Ajax
searchBox.on('keyup keypress',
function (e) {
searchResul.html('');
//stop submit form with enter
var keyCode = e.keyCode || e.which;
if (keyCode === 13) {
e.preventDefault();
if (count > 0 && count <= liList.length) {
liPointer.click();
$(document).on('click', '#partyNameSearch', function () {
searchResul.html('');
let searchText = $(this).val();
$.ajax({
contentType: 'charset=utf-8',
dataType: 'json',
type: 'GET',
url: searchContractingPartiesAjax,
data: { "searchName": searchText },
headers: { "RequestVerificationToken": antiForgeryToken },
success: function (response) {
$(".opt").remove();
if (response.list.length > 0) {
$(".noResult").remove();
container.show();
$.each(response.list,
function (i, item) {
let li = `<li data-employeeId="0" onclick="selectItem('${item}');" >${item}</li>`;
searchResul.append(li);
});
} else {
$(".noResult").remove();
container.show();
let noResult = `<li class="noResult">نتیجه ای یافت نشد!</li>`;
searchResul.append(noResult);
}
return false;
}
let searchText = $(this).val();
if (searchText.length > 1) {
$.ajax({
async: false,
contentType: 'charset=utf-8',
dataType: 'json',
type: 'GET',
url: SearchContractingParties,
data: { "searchName": searchText },
headers: { "RequestVerificationToken": AntiForgeryToken },
success: function (response) {
$(".opt").remove();
if (response.list.length > 0) {
$(".noResult").remove();
container.show();
$.each(response.list,
function (i, item) {
let li = `<li data-employeeId="${item.id}" onclick="selectItem('${item.fullName}');" >${item.fullName}</li>`;
searchResul.append(li);
});
} else {
$(".noResult").remove();
container.show();
let noResult = `<li class="noResult">نتیجه ای یافت نشد!</li>`;
searchResul.append(noResult);
}
}// endOfSuccess
}); //endOfAjax
} else {
container.hide();
count = 0;
}
});
});
function searchPartyNameTask() {
var input, filter, tbody, tr, i, td, containerResult;
input = document.getElementById("partyNameSearch");
filter = input.value.toUpperCase();
tbody = document.getElementById("searchResult");
tr = tbody.getElementsByTagName("li");
var hasVisibleResults = false;
for (i = 0; i < tr.length; i++) {
td = tr[i];
if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
hasVisibleResults = true;
} else {
tr[i].style.display = "none";
}
}
containerResult = document.getElementById("partyName");
if (hasVisibleResults) {
containerResult.style.display = "block";
} else {
containerResult.style.display = "none";
}
}
// نمایش اسامی کارگاه
// نمایش عنوان دلبخواه
var containerTitle = $('#TaskTitle');
var searchBoxTitle = $('.TaskTitleSearch');
var searchResulTitle = $('.searchTitleResult');
var mixContainerAndSerchResultTitle = $('#TaskTitle , .searchTitleResult');
containerTitle.hide();
var liListTitle;
var liPointerTitle;
let countTitle = 0;
//close search Employee when click on body
$(document).on('click', function (event) {
if (!$(event.target).closest(container).length) {
containerTitle.hide();
}
});
$(document).on('keydown', function (event) {
if (event.keyCode === 9) {
$('#partyName').hide();
$('#TaskTitle').hide();
}
});
//select option by mouse
function selectItemTitle(subject) {
searchBoxTitle.val(subject);
containerTitle.hide();
};
$(document).on('click', '.TaskTitleSearch', function () {
searchResulTitle.html('');
//stop submit form with enter
//var keyCode = e.keyCode || e.which;
//if (keyCode === 13) {
// e.preventDefault();
// if (countTitle > 0 && countTitle <= liListTitle.length) {
// liPointerTitle.click();
// }
// return false;
//}
let searchTextTitle = $(this).val();
$.ajax({
contentType: 'charset=utf-8',
dataType: 'json',
type: 'GET',
url: searchTaskSubject,
data: { "searchSubject": searchTextTitle },
headers: { "RequestVerificationToken": antiForgeryToken },
success: function (response) {
if (response.list.length > 0) {
containerTitle.show();
$.each(response.list,
function (i, item) {
let li = `<li class="li-subject" onclick="selectItemTitle('${item.subject}');">${item.subject}</li>`;
searchResulTitle.append(li);
});
} else {
containerTitle.hide();
}
}
});
});
function searchSubjectTask() {
console.log(123);
var input, filter, tbody, tr, i, td, containerResult;
input = document.getElementById("EditTask_Title");
filter = input.value.toUpperCase();
tbody = document.getElementById("searchTitleResult");
tr = tbody.getElementsByClassName("li-subject");
var hasVisibleResults = false;
for (i = 0; i < tr.length; i++) {
td = tr[i];
if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
hasVisibleResults = true;
} else {
tr[i].style.display = "none";
}
}
containerResult = document.getElementById("TaskTitle");
if (hasVisibleResults) {
containerResult.style.display = "block";
} else {
containerResult.style.display = "none";
}
}
// نمایش عنوان دلبخواه
// صدا
var msg_box = document.getElementById('msg_box'),

View File

@@ -2,7 +2,7 @@
$(document).on('keydown', '#EndTaskDate', function () {
$("input:radio").prop('checked', false);
$("input[name='btnradio']").prop('checked', false);
});
function updateDateInput(daysToAdd) {
@@ -197,7 +197,7 @@ $(document).ready(function () {
}, 1500);
} else {
console.log(response.message);
if (response.message == 'لطفا عنوان وظیفه خود را وارد کنید') {
$('#Command_Title').addClass('errored');
$('.alert-msg p').text('لطفا انتخاب گروهی را مشخص نمائید.');
@@ -559,10 +559,12 @@ var indexCount = 0;
function uploadFile(file, id, boxClass) {
var formData = new FormData();
formData.append('media', file);
var loading = $(boxClass).find('.spinner-loading');
loading.show();
$('#save').prop('disabled', true);
$('#save').addClass('disable');
$.ajax({
dataType: 'json',
type: 'POST',
@@ -576,7 +578,7 @@ function uploadFile(file, id, boxClass) {
if (file) {
var reader = new FileReader();
reader.onload = function (e) {
var img = $('<img class="b' + id + '">').attr('src', e.target.result);
var img = $('<img class="min-img b' + id + '">').attr('src', e.target.result);
var box = $(boxClass);
if (box.length) {
box.removeClass('empty');
@@ -599,6 +601,8 @@ function uploadFile(file, id, boxClass) {
$('#Command_Document' + id).val('');
}
loading.hide();
$('#save').prop('disabled', false);
$('#save').removeClass('disable');
},
error: function (err) {
console.log(err);
@@ -619,6 +623,8 @@ function remove(id, resId) {
$(`#fileItems input[value='${resId}']`).remove();
indexCount--;
$('#save').prop('disabled', true);
$('#save').addClass('disable');
var formData = new FormData();
formData.append('mediaId', resId);
@@ -638,6 +644,8 @@ function remove(id, resId) {
showAlertMessage('.alert-msg', response.message, 3500);
}
loading.hide();
$('#save').prop('disabled', false);
$('#save').removeClass('disable');
},
error: function (err) {
console.log(err);
@@ -970,23 +978,34 @@ $(document).on('click', '#partyNameSearch', function () {
function searchPartyNameTask() {
var input, filter, tbody, tr, a, i;
var input, filter, tbody, tr, i, td, containerResult;
input = document.getElementById("partyNameSearch");
filter = input.value.toUpperCase();
tbody = document.getElementById("searchResult");
tr = tbody.getElementsByTagName("li");
var hasVisibleResults = false;
for (i = 0; i < tr.length; i++) {
td = tr[i];
if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
hasVisibleResults = true;
} else {
tr[i].style.display = "none";
}
}
containerResult = document.getElementById("partyName");
if (hasVisibleResults) {
containerResult.style.display = "block";
} else {
containerResult.style.display = "none";
}
}
//search by Ajax
//searchBox.on('keyup keypress',
// function (e) {
@@ -1064,6 +1083,14 @@ $(document).on('click', function (event) {
containerTitle.hide();
}
});
$(document).on('keydown', function (event) {
if (event.keyCode === 9) {
$('#partyName').hide();
$('#TaskTitle').hide();
}
});
//select option by mouse
function selectItemTitle(subject) {
searchBoxTitle.val(subject);
@@ -1111,27 +1138,36 @@ $(document).on('click', '.TaskTitleSearch', function () {
});
function searchSubjectTask() {
var input, filter, tbody, tr, a, i;
var input, filter, tbody, tr, i, td, containerResult;
input = document.getElementById("Command_Title");
filter = input.value.toUpperCase();
tbody = document.getElementById("searchTitleResult");
tr = tbody.getElementsByClassName("li-subject");
var hasVisibleResults = false;
for (i = 0; i < tr.length; i++) {
td = tr[i];
if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
hasVisibleResults = true;
} else {
tr[i].style.display = "none";
}
}
containerResult = document.getElementById("TaskTitle");
if (hasVisibleResults) {
containerResult.style.display = "block";
} else {
containerResult.style.display = "none";
}
}
//search by Ajax
//searchBoxTitle.on('keyup keypress',
// function (e) {