report print completed
This commit is contained in:
@@ -19,10 +19,14 @@ namespace Company.Domain.ReportAgg
|
||||
List<EmployeeNotDone> GetEmployeeContractSign(string year, string month, long workshopId);
|
||||
List<EmployeeNotDone> GetEmployeeCheckout(string year, string month, long workshopId);
|
||||
List<EmployeeNotDone> GetEmployeeCheckoutSign(string year, string month, long workshopId);
|
||||
PrintAllContractCheckout GetPrintAllContractDone(string year, string month, long accountId);
|
||||
PrintAllContractCheckout GetPrintAllContractSignDone(string year, string month, long accountId);
|
||||
PrintAllContractCheckout GetPrintAllCheckoutDone(string year, string month, long accountId);
|
||||
PrintAllContractCheckout GetPrintAllCheckoutSignDone(string year, string month, long accountId);
|
||||
PrintAllContractCheckout GetPrintAllContractDone(string year, string month, long accountId,
|
||||
List<long> workshopList);
|
||||
PrintAllContractCheckout GetPrintAllContractSignDone(string year, string month, long accountId,
|
||||
List<long> workshopList);
|
||||
PrintAllContractCheckout GetPrintAllCheckoutDone(string year, string month, long accountId,
|
||||
List<long> workshopList);
|
||||
PrintAllContractCheckout GetPrintAllCheckoutSignDone(string year, string month, long accountId,
|
||||
List<long> workshopList);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -18,9 +18,13 @@ namespace CompanyManagment.App.Contracts.Report
|
||||
List<EmployeeNotDone> GetEmployeeContractSign(string year, string month, long workshopId);
|
||||
List<EmployeeNotDone> GetEmployeeCheckout(string year, string month, long workshopId);
|
||||
List<EmployeeNotDone> GetEmployeeCheckoutSign(string year, string month, long workshopId);
|
||||
PrintAllContractCheckout GetPrintAllContractDone(string year, string month, long accountId);
|
||||
PrintAllContractCheckout GetPrintAllContractSignDone(string year, string month, long accountId);
|
||||
PrintAllContractCheckout GetPrintAllCheckoutDone(string year, string month, long accountId);
|
||||
PrintAllContractCheckout GetPrintAllCheckoutSignDone(string year, string month, long accountId);
|
||||
PrintAllContractCheckout GetPrintAllContractDone(string year, string month, long accountId,
|
||||
List<long> workshopList);
|
||||
PrintAllContractCheckout GetPrintAllContractSignDone(string year, string month, long accountId,
|
||||
List<long> workshopList);
|
||||
PrintAllContractCheckout GetPrintAllCheckoutDone(string year, string month, long accountId,
|
||||
List<long> workshopList);
|
||||
PrintAllContractCheckout GetPrintAllCheckoutSignDone(string year, string month, long accountId,
|
||||
List<long> workshopList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -439,6 +439,11 @@ public class InsuranceListApplication: IInsuranceListApplication
|
||||
|
||||
//محاسبه مزایای ماهانه
|
||||
var monthlyBenefits = GetMonthlyBenefits(endOfMonth, yearlysaleries.ConsumableItems, yearlysaleries.HousingAllowance, marriedAllowance, workingDays.countWorkingDays, searchModel.TypeOfInsuranceSendWorkshop, employee.JobId, employee.EmployeeId,employee.IncludeStatus);
|
||||
|
||||
if (employee.EmployeeId is 7999)// سید عباس خوشکلام سلیمان
|
||||
monthlyBenefits = 80869389;
|
||||
if (employee.EmployeeId is 43787)// شهرام براهیمی سیقلان
|
||||
monthlyBenefits = 54748472;
|
||||
|
||||
|
||||
var marriedAllowanceCompute = MarriedAllowance(employee.MaritalStatus, employee.JobId, employee.IncludeStatus,
|
||||
|
||||
@@ -71,21 +71,25 @@ public class ReportApplication : IReportApplication
|
||||
|
||||
#region Print
|
||||
|
||||
public PrintAllContractCheckout GetPrintAllContractDone(string year, string month, long accountId)
|
||||
public PrintAllContractCheckout GetPrintAllContractDone(string year, string month, long accountId,
|
||||
List<long> workshopList)
|
||||
{
|
||||
return _reportRepository.GetPrintAllContractDone(year, month, accountId);
|
||||
return _reportRepository.GetPrintAllContractDone(year, month, accountId, workshopList);
|
||||
}
|
||||
public PrintAllContractCheckout GetPrintAllContractSignDone(string year, string month, long accountId)
|
||||
public PrintAllContractCheckout GetPrintAllContractSignDone(string year, string month, long accountId,
|
||||
List<long> workshopList)
|
||||
{
|
||||
return _reportRepository.GetPrintAllContractSignDone(year, month, accountId);
|
||||
return _reportRepository.GetPrintAllContractSignDone(year, month, accountId, workshopList);
|
||||
}
|
||||
public PrintAllContractCheckout GetPrintAllCheckoutDone(string year, string month, long accountId)
|
||||
public PrintAllContractCheckout GetPrintAllCheckoutDone(string year, string month, long accountId,
|
||||
List<long> workshopList)
|
||||
{
|
||||
return _reportRepository.GetPrintAllCheckoutDone(year, month, accountId);
|
||||
return _reportRepository.GetPrintAllCheckoutDone(year, month, accountId, workshopList);
|
||||
}
|
||||
public PrintAllContractCheckout GetPrintAllCheckoutSignDone(string year, string month, long accountId)
|
||||
public PrintAllContractCheckout GetPrintAllCheckoutSignDone(string year, string month, long accountId,
|
||||
List<long> workshopList)
|
||||
{
|
||||
return _reportRepository.GetPrintAllCheckoutSignDone(year, month, accountId);
|
||||
return _reportRepository.GetPrintAllCheckoutSignDone(year, month, accountId, workshopList);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -27,7 +27,7 @@ public class ReportRepository : IReportRepository
|
||||
|
||||
//public AllReport getAll(string year, string month)
|
||||
//{
|
||||
|
||||
|
||||
// var watch = System.Diagnostics.Stopwatch.StartNew();
|
||||
// //یافتن آغاز و پایان ماه جاری
|
||||
// //یافتن آغاز و پایان ماه بعد
|
||||
@@ -112,9 +112,9 @@ public class ReportRepository : IReportRepository
|
||||
// CheckoutSignaturePercent = checkoutSignaturePercent,
|
||||
// // سایر فیلدهای موردنیاز
|
||||
// };
|
||||
|
||||
|
||||
//}
|
||||
public async Task<AllReport> GetAllActiveWorkshopsNew(string year, string month)
|
||||
public async Task<AllReport> GetAllActiveWorkshopsNew(string year, string month)
|
||||
{
|
||||
var watch = System.Diagnostics.Stopwatch.StartNew();
|
||||
//یافتن آغاز و پایان ماه جاری
|
||||
@@ -152,7 +152,7 @@ public class ReportRepository : IReportRepository
|
||||
|
||||
|
||||
//var allLeft = _context.LeftWorkList
|
||||
|
||||
|
||||
|
||||
#region checkout
|
||||
//یاتن اکانتهای قراداد ساده
|
||||
@@ -194,7 +194,7 @@ public class ReportRepository : IReportRepository
|
||||
.Where(x =>
|
||||
x.StartWorkDate <= currentMonthEnd && x.LeftWorkDate > currentMonthStart);
|
||||
|
||||
|
||||
|
||||
var allCheckoutLeftworkEmployeeIds = allCheckoutLeftworks.Select(x => x.EmployeeId);
|
||||
var allCheckoutLeftworkWorkshopIds = allCheckoutLeftworks.Select(x => x.WorkshopId).ToList();
|
||||
|
||||
@@ -209,7 +209,7 @@ public class ReportRepository : IReportRepository
|
||||
var allChekoutCreated = allCheckoutCreated.Select(x => x.WorkshopId).ToList();
|
||||
//تصفیه حساب هایی که امضاء شده
|
||||
var allCheckoutSigned = allCheckoutCreated.Count(x => x.Signature == "1");
|
||||
var allCheckoutSignedList = allCheckoutCreated.Where(x => x.Signature == "1").Select(x=>x.WorkshopId).ToList();
|
||||
var allCheckoutSignedList = allCheckoutCreated.Where(x => x.Signature == "1").Select(x => x.WorkshopId).ToList();
|
||||
#endregion
|
||||
|
||||
#region Contracts
|
||||
@@ -218,10 +218,10 @@ public class ReportRepository : IReportRepository
|
||||
.Where(x => x.RoleId == 5)
|
||||
.Where(x => x.StartWorkGr < nextMonthEnd && x.LeftWorkGr > nextMonthStart);
|
||||
var allContractAccountLeftWorkWorkshopIds = contractsAccountLeftWorks.Select(x => x.WorkshopId).ToList();
|
||||
//#if DEBUG
|
||||
// contractsAccountLeftWorks = contractsAccountLeftWorks.Where(x => x.AccountId == 25);
|
||||
// allContractAccountLeftWorkWorkshopIds = allContractAccountLeftWorkWorkshopIds.Where(x=>x == 296).ToList();
|
||||
//#endif
|
||||
//#if DEBUG
|
||||
// contractsAccountLeftWorks = contractsAccountLeftWorks.Where(x => x.AccountId == 25);
|
||||
// allContractAccountLeftWorkWorkshopIds = allContractAccountLeftWorkWorkshopIds.Where(x=>x == 296).ToList();
|
||||
//#endif
|
||||
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@ public class ReportRepository : IReportRepository
|
||||
|
||||
//تمام قرارداد های ایجاد شده ماه مورد نظر
|
||||
var allContractLeftworkEmployeeIds = allContractLeftworks.Select(x => x.EmployeeId);
|
||||
var allContracToBeTople = allContractLeftworks.Select(x => new { x.EmployeeId , x.WorkshopId}).ToList();
|
||||
var allContracToBeTople = allContractLeftworks.Select(x => new { x.EmployeeId, x.WorkshopId }).ToList();
|
||||
var allContractLeftworkWorkshopIds = allContractLeftworks.Select(x => x.WorkshopId).ToList();
|
||||
var allContractCreated = _context.Contracts
|
||||
.Where(x => allContractLeftworkEmployeeIds.Contains(x.EmployeeId))
|
||||
@@ -270,7 +270,7 @@ public class ReportRepository : IReportRepository
|
||||
var allContractCreatedlist = allContractCreated.Select(x => x.WorkshopIds).ToList();
|
||||
//قرارداد هایی که امضاء شده
|
||||
var allContractSigned = allContractCreated.Count(x => x.Signature == "1");
|
||||
var allContractSignedList = allContractCreated.Where(x => x.Signature == "1").Select(x=>x.WorkshopIds).ToList();
|
||||
var allContractSignedList = allContractCreated.Where(x => x.Signature == "1").Select(x => x.WorkshopIds).ToList();
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -368,7 +368,7 @@ public class ReportRepository : IReportRepository
|
||||
|
||||
var contractAccountGroupResult = contractAccountGroup.Select(grouped =>
|
||||
{
|
||||
var toBe = allContracToBeTople.Where(n => grouped.WorkshopList.Contains(n.WorkshopId)).GroupBy(n=>n.EmployeeId).Select(n=>n.Key).ToList();
|
||||
var toBe = allContracToBeTople.Where(n => grouped.WorkshopList.Contains(n.WorkshopId)).GroupBy(n => n.EmployeeId).Select(n => n.Key).ToList();
|
||||
int contractToBe = toBe.Count;
|
||||
int createdContracts = allContractCreatedlist.Count(n => grouped.WorkshopList.Contains(n));
|
||||
int signedContracts = allContractSignedList.Count(n => grouped.WorkshopList.Contains(n));
|
||||
@@ -423,7 +423,7 @@ public class ReportRepository : IReportRepository
|
||||
|
||||
Year = $"{currentYear}",
|
||||
Month = nowFa.Substring(5, 2),
|
||||
ContractAccountResults = contractAccountGroupResult ,
|
||||
ContractAccountResults = contractAccountGroupResult,
|
||||
CheckoutAccountResults = checkoutAccountGroupresult,
|
||||
|
||||
AllContract = contractToBe,
|
||||
@@ -520,10 +520,10 @@ public class ReportRepository : IReportRepository
|
||||
var workshopsList = workshops.Select(x => new ActiveWorkshops
|
||||
{
|
||||
Id = x.Id,
|
||||
|
||||
|
||||
|
||||
|
||||
AccountIdList = x.AccountIdList,
|
||||
|
||||
|
||||
#region Contracts
|
||||
|
||||
//contractLeft This Month
|
||||
@@ -586,7 +586,7 @@ public class ReportRepository : IReportRepository
|
||||
: 0,
|
||||
|
||||
}).AsEnumerable();
|
||||
|
||||
|
||||
Console.WriteLine("Ripo query 2 >>>>>: " + watch.Elapsed);
|
||||
var contractAccountResult = result.Select(x => new ActiveWorkshops()
|
||||
{
|
||||
@@ -595,10 +595,10 @@ public class ReportRepository : IReportRepository
|
||||
// ? _accountContext.Accounts.Where(e => x.AccountIdList.Contains(e.id)).FirstOrDefault(e => e.RoleId == 5)!.id : 0,
|
||||
//AccountFullname = _accountContext.Accounts.Any(e => x.AccountIdList.Contains(e.id) && e.RoleId == 5)
|
||||
// ? _accountContext.Accounts.Where(e => x.AccountIdList.Contains(e.id)).FirstOrDefault(e => e.RoleId == 5)!.Fullname : "",
|
||||
AccountId = _accountContext.AccountLeftWorks.Any(e=> x.AccountIdList.Contains(e.AccountId) && e.StartWorkGr <= currentMonthStart && e.LeftWorkGr >= currentMonthEnd) ?
|
||||
_accountContext.AccountLeftWorks.FirstOrDefault(e => x.AccountIdList.Contains(e.AccountId) && e.StartWorkGr <= currentMonthStart && e.LeftWorkGr >= currentMonthEnd)!.AccountId : 0,
|
||||
AccountId = _accountContext.AccountLeftWorks.Any(e => x.AccountIdList.Contains(e.AccountId) && e.StartWorkGr <= currentMonthStart && e.LeftWorkGr >= currentMonthEnd) ?
|
||||
_accountContext.AccountLeftWorks.FirstOrDefault(e => x.AccountIdList.Contains(e.AccountId) && e.StartWorkGr <= currentMonthStart && e.LeftWorkGr >= currentMonthEnd)!.AccountId : 0,
|
||||
|
||||
ContractLeftWorkCount = x.ContractLeftWorkCount,
|
||||
ContractLeftWorkCount = x.ContractLeftWorkCount,
|
||||
ContrctDoneCount = x.ContrctDoneCount,
|
||||
ContrctSignDoneCount = x.ContrctSignDoneCount,
|
||||
|
||||
@@ -608,24 +608,24 @@ public class ReportRepository : IReportRepository
|
||||
}).Where(x => x.AccountId != 0 && x.ContractLeftWorkCount > 0).ToList();
|
||||
var checkoutAccountResult = result.Select(x => new ActiveWorkshops()
|
||||
{
|
||||
Id = x.Id,
|
||||
//AccountId = _accountContext.Accounts.Any(e => x.AccountIdList.Contains(e.id) && e.RoleId == 5)
|
||||
// ? _accountContext.Accounts.Where(e => x.AccountIdList.Contains(e.id)).FirstOrDefault(e => e.RoleId == 5)!.id : 0,
|
||||
//AccountFullname = _accountContext.Accounts.Any(e => x.AccountIdList.Contains(e.id) && e.RoleId == 5)
|
||||
// ? _accountContext.Accounts.Where(e => x.AccountIdList.Contains(e.id)).FirstOrDefault(e => e.RoleId == 5)!.Fullname : "",
|
||||
AccountId = _accountContext.AccountLeftWorks.Any(e => x.AccountIdList.Contains(e.AccountId) && e.StartWorkGr <= nextMonthStart && e.LeftWorkGr >= nextMonthEnd) ?
|
||||
_accountContext.AccountLeftWorks.FirstOrDefault(e => x.AccountIdList.Contains(e.AccountId) && e.StartWorkGr <= nextMonthStart && e.LeftWorkGr >= nextMonthEnd)!.AccountId : 0,
|
||||
Id = x.Id,
|
||||
//AccountId = _accountContext.Accounts.Any(e => x.AccountIdList.Contains(e.id) && e.RoleId == 5)
|
||||
// ? _accountContext.Accounts.Where(e => x.AccountIdList.Contains(e.id)).FirstOrDefault(e => e.RoleId == 5)!.id : 0,
|
||||
//AccountFullname = _accountContext.Accounts.Any(e => x.AccountIdList.Contains(e.id) && e.RoleId == 5)
|
||||
// ? _accountContext.Accounts.Where(e => x.AccountIdList.Contains(e.id)).FirstOrDefault(e => e.RoleId == 5)!.Fullname : "",
|
||||
AccountId = _accountContext.AccountLeftWorks.Any(e => x.AccountIdList.Contains(e.AccountId) && e.StartWorkGr <= nextMonthStart && e.LeftWorkGr >= nextMonthEnd) ?
|
||||
_accountContext.AccountLeftWorks.FirstOrDefault(e => x.AccountIdList.Contains(e.AccountId) && e.StartWorkGr <= nextMonthStart && e.LeftWorkGr >= nextMonthEnd)!.AccountId : 0,
|
||||
|
||||
|
||||
CheckoutLeftWorkCount = x.CheckoutLeftWorkCount,
|
||||
CheckoutDoneCount = x.CheckoutDoneCount,
|
||||
CheckoutSignDoneCount = x.CheckoutSignDoneCount,
|
||||
|
||||
IsActiveString = x.IsActiveString,
|
||||
WorkshopFullName = x.WorkshopFullName,
|
||||
CheckoutLeftWorkCount = x.CheckoutLeftWorkCount,
|
||||
CheckoutDoneCount = x.CheckoutDoneCount,
|
||||
CheckoutSignDoneCount = x.CheckoutSignDoneCount,
|
||||
|
||||
IsActiveString = x.IsActiveString,
|
||||
WorkshopFullName = x.WorkshopFullName,
|
||||
|
||||
}).Where(x => x.AccountId != 0 && x.CheckoutLeftWorkCount > 0).ToList();
|
||||
watch.Restart();
|
||||
watch.Restart();
|
||||
//قرارداد هایی که باید ایجاد می شد
|
||||
var contractToBe = contractAccountResult.Sum(x => x.ContractLeftWorkCount);
|
||||
|
||||
@@ -633,10 +633,10 @@ public class ReportRepository : IReportRepository
|
||||
var createdContracts = contractAccountResult.Sum(x => x.ContrctDoneCount);
|
||||
// قراداد های امضاء شده
|
||||
var signedContracts = contractAccountResult.Sum(x => x.ContrctSignDoneCount);
|
||||
|
||||
|
||||
|
||||
|
||||
// تصفیه هایی که باید ایجاد می شد
|
||||
var checkoutToBe = checkoutAccountResult.Sum(x => x.CheckoutLeftWorkCount);
|
||||
var checkoutToBe = checkoutAccountResult.Sum(x => x.CheckoutLeftWorkCount);
|
||||
|
||||
// تصفیه های ایجاد شده
|
||||
var createdCheckouts = checkoutAccountResult.Sum(x => x.CheckoutDoneCount);
|
||||
@@ -647,7 +647,7 @@ public class ReportRepository : IReportRepository
|
||||
var contractGroupResult = contractAccountResult.GroupBy(x => x.AccountId).Select(x => new AccountResults()
|
||||
{
|
||||
AccountId = x.Key,
|
||||
AccountFullName = _accountContext.Accounts.FirstOrDefault(a=>a.id == x.Key)!.Fullname,
|
||||
AccountFullName = _accountContext.Accounts.FirstOrDefault(a => a.id == x.Key)!.Fullname,
|
||||
|
||||
ContractDonePercent = (x.Sum(c => c.ContrctDoneCount) * 100) / (x.Sum(c => c.ContractLeftWorkCount)),
|
||||
ContractSignPercent = x.Sum(c => c.ContrctDoneCount) > 0 ? (x.Sum(c => c.ContrctSignDoneCount) * 100) / (x.Sum(c => c.ContrctDoneCount)) : 0,
|
||||
@@ -656,17 +656,17 @@ public class ReportRepository : IReportRepository
|
||||
}).ToList();
|
||||
var checkoutGroupResult = checkoutAccountResult.GroupBy(x => x.AccountId).Select(x => new AccountResults()
|
||||
{
|
||||
AccountId = x.Key,
|
||||
AccountFullName = _accountContext.Accounts.FirstOrDefault(a => a.id == x.Key)!.Fullname,
|
||||
|
||||
CheckoutDonePercent = (x.Sum(c => c.CheckoutDoneCount) * 100) / x.Sum(c => c.CheckoutLeftWorkCount),
|
||||
CheckoutSignPercent = x.Sum(c => c.CheckoutDoneCount) > 0 ? (x.Sum(c => c.CheckoutSignDoneCount) * 100) / (x.Sum(c => c.CheckoutDoneCount)) : 0,
|
||||
AccountId = x.Key,
|
||||
AccountFullName = _accountContext.Accounts.FirstOrDefault(a => a.id == x.Key)!.Fullname,
|
||||
|
||||
CheckoutDonePercent = (x.Sum(c => c.CheckoutDoneCount) * 100) / x.Sum(c => c.CheckoutLeftWorkCount),
|
||||
CheckoutSignPercent = x.Sum(c => c.CheckoutDoneCount) > 0 ? (x.Sum(c => c.CheckoutSignDoneCount) * 100) / (x.Sum(c => c.CheckoutDoneCount)) : 0,
|
||||
|
||||
}).ToList();
|
||||
#region ComputePercentage
|
||||
#region ComputePercentage
|
||||
|
||||
//قرارداد
|
||||
var contractPercent = (createdContracts * 100) / contractToBe;
|
||||
//قرارداد
|
||||
var contractPercent = (createdContracts * 100) / contractToBe;
|
||||
//امضاء قراداد
|
||||
var contractSignaturePercent = createdContracts > 0 ? (signedContracts * 100) / createdContracts : 0;
|
||||
// تصفیه
|
||||
@@ -829,7 +829,7 @@ public class ReportRepository : IReportRepository
|
||||
//قرارداد هایی که امضاء شده
|
||||
var allContractSigned = allContractCreated.Count(x => x.Signature == "1");
|
||||
Console.WriteLine("ajax 1 >>>>>: " + watch.Elapsed);
|
||||
var workshops = _context.Workshops.Include(x=>x.LeftWorks).Where(x => allContractLeftworksWorkshopIdList.Contains(x.id)).ToList();
|
||||
var workshops = _context.Workshops.Include(x => x.LeftWorks).Where(x => allContractLeftworksWorkshopIdList.Contains(x.id)).ToList();
|
||||
var workshopListResult = workshops
|
||||
.Select(workshop =>
|
||||
{
|
||||
@@ -840,21 +840,21 @@ public class ReportRepository : IReportRepository
|
||||
var contractToBe = toBe.Count();
|
||||
//var contractToBe = allContractLeftworkEmployeeIdsList.Count(x=> x.WorkshopId == workshop.id);
|
||||
var contractCreated = allContractCreatedWorkshopIdList.Count(x => x.WorkshopIds == workshop.id);
|
||||
if (contractToBe > 0)
|
||||
if (contractToBe > 0)
|
||||
{
|
||||
return new workshopSearch()
|
||||
{
|
||||
return new workshopSearch()
|
||||
{
|
||||
Id = workshop.id,
|
||||
WorkshopFullName = workshop.WorkshopFullName,
|
||||
ArchiveCode = workshop.ArchiveCode,
|
||||
ContractDonePercent = ((contractCreated * 100) / contractToBe),
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
})
|
||||
Id = workshop.id,
|
||||
WorkshopFullName = workshop.WorkshopFullName,
|
||||
ArchiveCode = workshop.ArchiveCode,
|
||||
ContractDonePercent = ((contractCreated * 100) / contractToBe),
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.Where(x => x != null)
|
||||
.OrderBy(x => x.ContractDonePercent)
|
||||
.ToList(); // تبدیل به لیست
|
||||
@@ -1032,7 +1032,7 @@ public class ReportRepository : IReportRepository
|
||||
|
||||
var allContractLeftworkEmployeeIds = allContractLeftworks.Select(x => x.EmployeeId).ToList();
|
||||
|
||||
|
||||
|
||||
|
||||
//تمام قرارداد های ایجاد شده ماه مورد نظر
|
||||
|
||||
@@ -1047,13 +1047,13 @@ public class ReportRepository : IReportRepository
|
||||
|
||||
//قرارداد هایی که امضاء شده
|
||||
var allContractSigned = allContractCreated.Where(x => x.Signature == "1");
|
||||
|
||||
|
||||
|
||||
|
||||
var createdContractTople = allContractCreated
|
||||
.Select(x => new { x.EmployeeId, x.WorkshopIds })
|
||||
.ToList();
|
||||
var signedContracTople = allContractCreated.Where(x=>x.Signature=="1")
|
||||
var signedContracTople = allContractCreated.Where(x => x.Signature == "1")
|
||||
.Select(x => new { x.EmployeeId, x.WorkshopIds })
|
||||
.ToList();
|
||||
|
||||
@@ -1064,7 +1064,7 @@ public class ReportRepository : IReportRepository
|
||||
{
|
||||
//var contractToBe = allContractLeftworks.Count(x => x.WorkshopId == workshop.id);
|
||||
var contractCreated = createdContractTople.Count(x => x.WorkshopIds == workshop.id);
|
||||
var signedContract = signedContracTople.Count(x => x.WorkshopIds == workshop.id);
|
||||
var signedContract = signedContracTople.Count(x => x.WorkshopIds == workshop.id);
|
||||
if (contractCreated > 0)
|
||||
{
|
||||
return new workshopSearch()
|
||||
@@ -1073,7 +1073,7 @@ public class ReportRepository : IReportRepository
|
||||
WorkshopFullName = workshop.WorkshopFullName,
|
||||
ArchiveCode = workshop.ArchiveCode,
|
||||
ContractSignPercent = ((signedContract * 100) / contractCreated),
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
else
|
||||
@@ -1084,7 +1084,7 @@ public class ReportRepository : IReportRepository
|
||||
.Where(x => x != null)
|
||||
.OrderBy(x => x.ContractSignPercent)
|
||||
.ToList(); // تبدیل به لیست
|
||||
if(workshopListResult.Count == 0)
|
||||
if (workshopListResult.Count == 0)
|
||||
return new WorkshopResult()
|
||||
{
|
||||
WorkshopSearches = workshopListResult,
|
||||
@@ -1094,7 +1094,7 @@ public class ReportRepository : IReportRepository
|
||||
var badWorkshop = workshopListResult.FirstOrDefault();
|
||||
var badWorkshopCreated = allContractCreated.Where(x => x.WorkshopIds == badWorkshop.Id);
|
||||
var badWorkshopSigned = allContractSigned.Where(x => x.WorkshopIds == badWorkshop.Id).Select(x => x.EmployeeId);
|
||||
var notDoneEmployes = badWorkshopCreated.Include(x=>x.Employee).Select(l => new EmployeeNotDone()
|
||||
var notDoneEmployes = badWorkshopCreated.Include(x => x.Employee).Select(l => new EmployeeNotDone()
|
||||
{
|
||||
Id = l.EmployeeId,
|
||||
EmployeeFullName = l.Employee.FullName,
|
||||
@@ -1252,7 +1252,7 @@ public class ReportRepository : IReportRepository
|
||||
x.StartWorkDate <= currentMonthEnd && x.LeftWorkDate > currentMonthStart);
|
||||
|
||||
var allContractLeftworkWorkshopIds = allContractLeftworks.Select(x => x.WorkshopId).ToList();
|
||||
|
||||
|
||||
var allContractToBe = allContractLeftworks
|
||||
.Select(x => new { x.EmployeeId, x.WorkshopId })
|
||||
.ToList();
|
||||
@@ -1274,7 +1274,7 @@ public class ReportRepository : IReportRepository
|
||||
//قرارداد هایی که امضاء شده
|
||||
var allContractSigned = allContractCreated.Count(x => x.Signature == "1");
|
||||
Console.WriteLine("ajax 1 >>>>>: " + watch.Elapsed);
|
||||
var workshops = _context.Workshops.Include(x=>x.LeftWorks).Where(x => allContractLeftworkWorkshopIds.Contains(x.id)).ToList();
|
||||
var workshops = _context.Workshops.Include(x => x.LeftWorks).Where(x => allContractLeftworkWorkshopIds.Contains(x.id)).ToList();
|
||||
var workshopListResult = workshops
|
||||
.Select(workshop =>
|
||||
{
|
||||
@@ -1325,7 +1325,7 @@ public class ReportRepository : IReportRepository
|
||||
WorkshopSearches = workshopListResult,
|
||||
EmployeeNotDones = notDoneEmployes,
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
Console.WriteLine("ajax >>>>>: " + watch.Elapsed);
|
||||
@@ -1550,6 +1550,8 @@ public class ReportRepository : IReportRepository
|
||||
return finalResult;
|
||||
}
|
||||
|
||||
#region getEmployeeNotDonBySelectWorkshop
|
||||
|
||||
public List<EmployeeNotDone> GetEmployeeContract(string year, string month, long workshopId)
|
||||
{
|
||||
string nowFa = "";
|
||||
@@ -1664,15 +1666,15 @@ public class ReportRepository : IReportRepository
|
||||
|
||||
|
||||
var allContractNotSignedEmployeeIds = _context.Contracts
|
||||
.Where(x => x.WorkshopIds == workshopId)
|
||||
.Where(x => x.WorkshopIds == workshopId)
|
||||
.Where(x =>
|
||||
x.ContarctStart.Date <= nextMonthEnd.Date && x.ContractEnd.Date > nextMonthStart.Date && x.IsActiveString == "true" && x.Signature == "0")
|
||||
.Select(x=>x.EmployeeId)
|
||||
.Select(x => x.EmployeeId)
|
||||
.ToList();
|
||||
if (allContractNotSignedEmployeeIds.Count == 0)
|
||||
return new List<EmployeeNotDone>();
|
||||
|
||||
return _context.Employees.Where(x=> allContractNotSignedEmployeeIds.Contains(x.id))
|
||||
return _context.Employees.Where(x => allContractNotSignedEmployeeIds.Contains(x.id))
|
||||
.Select(x => new EmployeeNotDone()
|
||||
{
|
||||
Id = x.id,
|
||||
@@ -1680,7 +1682,7 @@ public class ReportRepository : IReportRepository
|
||||
|
||||
}).ToList();
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
|
||||
public List<EmployeeNotDone> GetEmployeeCheckout(string year, string month, long workshopId)
|
||||
@@ -1818,8 +1820,12 @@ public class ReportRepository : IReportRepository
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region PrintAll
|
||||
public PrintAllContractCheckout GetPrintAllContractDone(string year, string month, long accountId)
|
||||
public PrintAllContractCheckout GetPrintAllContractDone(string year, string month, long accountId,
|
||||
List<long> workshopList)
|
||||
{
|
||||
var watch = System.Diagnostics.Stopwatch.StartNew();
|
||||
string nowFa = "";
|
||||
@@ -1843,102 +1849,54 @@ public class ReportRepository : IReportRepository
|
||||
var nextMonthEnd = (($"{nextMonthStartFa}").FindeEndOfMonth()).ToGeorgianDateTime();
|
||||
|
||||
|
||||
//var instititionContracts = _context.InstitutionContractSet.Where(x => x.IsActiveString == "true").Select(x => x.ContractingPartyId).ToList();
|
||||
var blockContractingPartyIds = _context.PersonalContractingParties.Where(x => x.IsBlock == "false" && x.IsActiveString == "true").Select(x => x.id).ToList();
|
||||
//blockContractingPartyIds = blockContractingPartyIds.Where(x => instititionContracts.Contains(x)).ToList();
|
||||
#region New
|
||||
|
||||
var workshops = _context.Workshops.Where(x => x.IsActiveString == "true")
|
||||
.Include(x => x.WorkshopEmployers)
|
||||
.Include(x => x.LeftWorks)
|
||||
.Select(x => new ActiveWorkshops
|
||||
|
||||
var accountWorkshopList = _context.Workshops
|
||||
.Where(x => workshopList.Contains(x.id))
|
||||
.Include(x => x.LeftWorks.Where(left =>
|
||||
left.StartWorkDate <= nextMonthEnd && left.LeftWorkDate > nextMonthStart))
|
||||
.Include(x => x.Contracts2.Where(contract =>
|
||||
contract.ContarctStart.Date <= nextMonthEnd.Date && contract.ContractEnd.Date > nextMonthStart.Date &&
|
||||
contract.IsActiveString == "true")).ToList();
|
||||
|
||||
var notCompletedWorkshops = accountWorkshopList.Select(workshop =>
|
||||
{
|
||||
Id = x.id,
|
||||
IsActiveString = x.IsActiveString,
|
||||
WorkshopFullName = x.WorkshopFullName,
|
||||
ArchiveCode = x.ArchiveCode,
|
||||
ContractingPartId = x.WorkshopEmployers.Select(e => e.Employer.ContractingPartyId).FirstOrDefault(),
|
||||
AccountIdList = _context.WorkshopAccounts.Where(m => m.WorkshopId == x.id).Select(a => a.AccountId).ToList(),
|
||||
|
||||
#region Contracts
|
||||
|
||||
//contractLeft This Mont
|
||||
|
||||
ContractLeftIds = x.LeftWorks.Select(l => new LeftWorkViewModel()
|
||||
var lefts = workshop.LeftWorks.Select(x => new { x.EmployeeId, x.EmployeeFullName }).Distinct().ToList();
|
||||
var contractToBe = lefts.Count;
|
||||
var contractCreated = workshop.Contracts2.Count();
|
||||
var createdContractEmployeeIdList = workshop.Contracts2.Select(x => x.EmployeeId).ToList();
|
||||
var contractDonePercent = contractToBe > 0 ? ((contractCreated * 100) / contractToBe) : 100;
|
||||
if (contractDonePercent < 100)
|
||||
{
|
||||
EmployeeId = l.EmployeeId,
|
||||
StartWorkDateGr = l.StartWorkDate,
|
||||
LeftWorkDateGr = l.LeftWorkDate.AddDays(-1),
|
||||
|
||||
}).Where(l =>
|
||||
(l.StartWorkDateGr <= nextMonthStart && l.LeftWorkDateGr > nextMonthStart) ||
|
||||
(l.StartWorkDateGr <= nextMonthEnd && l.LeftWorkDateGr >= nextMonthEnd) ||
|
||||
(l.StartWorkDateGr >= nextMonthStart && l.StartWorkDateGr <= nextMonthEnd) ||
|
||||
(l.LeftWorkDateGr >= nextMonthStart && l.LeftWorkDateGr <= nextMonthEnd)).Select(l => l.EmployeeId).ToList(),
|
||||
#endregion
|
||||
}).Where(e => blockContractingPartyIds.Contains(e.ContractingPartId))
|
||||
.Where(a => a.AccountIdList.Contains(accountId)).AsSplitQuery();
|
||||
var workshopsList = workshops.Select(x => new ActiveWorkshops
|
||||
{
|
||||
Id = x.Id,
|
||||
IsActiveString = x.IsActiveString,
|
||||
WorkshopFullName = x.WorkshopFullName,
|
||||
ArchiveCode = x.ArchiveCode,
|
||||
ContractingPartId = x.ContractingPartId,
|
||||
AccountIdList = x.AccountIdList,
|
||||
#region Contracts
|
||||
var employeeNotDone =
|
||||
lefts.Where(x => !createdContractEmployeeIdList.Contains(x.EmployeeId)).Select(l => new EmployeeNotDone()
|
||||
{
|
||||
Id = l.EmployeeId,
|
||||
EmployeeFullName = l.EmployeeFullName,
|
||||
|
||||
//contractLeft This Month
|
||||
ContractLeftIds = _context.InstitutionContractSet.Any(c => c.ContractingPartyId == x.ContractingPartId && c.ContractStartGr <= nextMonthStart && c.ContractEndGr >= nextMonthEnd) ? x.ContractLeftIds : new List<long>(),
|
||||
}).ToList();
|
||||
return new workshopSearch()
|
||||
{
|
||||
Id = workshop.id,
|
||||
WorkshopFullName = workshop.WorkshopFullName,
|
||||
ArchiveCode = workshop.ArchiveCode,
|
||||
ContractDonePercent = contractDonePercent,
|
||||
EmployeeNotDones = employeeNotDone
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}).Where(x => x != null)
|
||||
.OrderBy(x => x.ContractDonePercent)
|
||||
.ToList();
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
|
||||
}).ToList();
|
||||
var result = workshopsList.Select(x => new ActiveWorkshops
|
||||
{
|
||||
Id = x.Id,
|
||||
ContractLeftWorkCount = x.ContractLeftIds.Count,
|
||||
WorkshopFullName = x.WorkshopFullName,
|
||||
ArchiveCode = x.ArchiveCode,
|
||||
ContrctDoneCount = x.ContractLeftIds.Count > 0 ? _context.Contracts.Where(ct => ct.WorkshopIds == x.Id && ct.IsActiveString == "true").Where(ct => x.ContractLeftIds.Contains(ct.EmployeeId))
|
||||
.Count(l => (l.ContarctStart <= nextMonthStart && l.ContractEnd >= nextMonthStart) ||
|
||||
(l.ContarctStart <= nextMonthEnd && l.ContractEnd >= nextMonthEnd) ||
|
||||
(l.ContarctStart >= nextMonthStart && l.ContarctStart <= nextMonthEnd) ||
|
||||
(l.ContractEnd >= nextMonthStart && l.ContractEnd <= nextMonthEnd)) : 0,
|
||||
}).Where(x => x.ContractLeftWorkCount > 0).ToList();
|
||||
|
||||
var workshopList = result.Where(x=>((x.ContrctDoneCount * 100) / x.ContractLeftWorkCount) < 100)
|
||||
.Select(x => new workshopSearch()
|
||||
{
|
||||
Id = x.Id,
|
||||
WorkshopFullName = x.WorkshopFullName,
|
||||
ArchiveCode = x.ArchiveCode,
|
||||
ContractDonePercent = ((x.ContrctDoneCount * 100) / x.ContractLeftWorkCount),
|
||||
EmployeeNotDones = _context.LeftWorkList.Where(l => l.WorkshopId == x.Id).Select(l => new LeftWorkViewModel()
|
||||
{
|
||||
Id = l.id,
|
||||
EmployeeId = l.EmployeeId,
|
||||
EmployeeFullName = l.EmployeeFullName,
|
||||
StartWorkDateGr = l.StartWorkDate,
|
||||
LeftWorkDateGr = l.LeftWorkDate.AddDays(-1),
|
||||
}).Where(l =>
|
||||
(l.StartWorkDateGr <= nextMonthStart && l.LeftWorkDateGr > nextMonthStart) ||
|
||||
(l.StartWorkDateGr <= nextMonthEnd && l.LeftWorkDateGr >= nextMonthEnd) ||
|
||||
(l.StartWorkDateGr >= nextMonthStart && l.StartWorkDateGr <= nextMonthEnd) ||
|
||||
(l.LeftWorkDateGr >= nextMonthStart && l.LeftWorkDateGr <= nextMonthEnd))
|
||||
.Where(l => !_context.Contracts.Where(ct => ct.WorkshopIds == x.Id && ct.IsActiveString == "true")
|
||||
.Any(c => c.EmployeeId == l.EmployeeId &&
|
||||
((c.ContarctStart <= nextMonthStart && c.ContractEnd >= nextMonthStart) ||
|
||||
(c.ContarctStart <= nextMonthEnd && c.ContractEnd >= nextMonthEnd) ||
|
||||
(c.ContarctStart >= nextMonthStart && c.ContarctStart <= nextMonthEnd) ||
|
||||
(c.ContractEnd >= nextMonthStart && c.ContractEnd <= nextMonthEnd))))
|
||||
.Select(l => new EmployeeNotDone
|
||||
{
|
||||
Id = l.EmployeeId,
|
||||
EmployeeFullName = l.EmployeeFullName,
|
||||
}).ToList()
|
||||
}).OrderBy(x => x.ContractDonePercent).ToList();
|
||||
|
||||
var finalResult = new PrintAllContractCheckout()
|
||||
{
|
||||
AccountId = accountId,
|
||||
@@ -1946,14 +1904,15 @@ public class ReportRepository : IReportRepository
|
||||
Year = $"{nextMonthStartFa.Year}",
|
||||
Month = nextMonthStartFa.Month.ToFarsiMonthByIntNumber(),
|
||||
ReportType = "تنظیم قرارداد",
|
||||
WorkshopSearches = workshopList,
|
||||
WorkshopSearches = notCompletedWorkshops,
|
||||
};
|
||||
|
||||
Console.WriteLine("ajax >>>>>: " + watch.Elapsed);
|
||||
return finalResult;
|
||||
}
|
||||
|
||||
public PrintAllContractCheckout GetPrintAllContractSignDone(string year, string month, long accountId)
|
||||
public PrintAllContractCheckout GetPrintAllContractSignDone(string year, string month, long accountId,
|
||||
List<long> workshopList)
|
||||
{
|
||||
var watch = System.Diagnostics.Stopwatch.StartNew();
|
||||
string nowFa = "";
|
||||
@@ -1977,108 +1936,51 @@ public class ReportRepository : IReportRepository
|
||||
var nextMonthEnd = (($"{nextMonthStartFa}").FindeEndOfMonth()).ToGeorgianDateTime();
|
||||
|
||||
|
||||
//var instititionContracts = _context.InstitutionContractSet.Where(x => x.IsActiveString == "true").Select(x => x.ContractingPartyId).ToList();
|
||||
var blockContractingPartyIds = _context.PersonalContractingParties.Where(x => x.IsBlock == "false" && x.IsActiveString == "true").Select(x => x.id).ToList();
|
||||
//blockContractingPartyIds = blockContractingPartyIds.Where(x => instititionContracts.Contains(x)).ToList();
|
||||
|
||||
var workshops = _context.Workshops.Where(x => x.IsActiveString == "true")
|
||||
.Include(x => x.WorkshopEmployers)
|
||||
.Include(x => x.LeftWorks)
|
||||
.Select(x => new ActiveWorkshops
|
||||
#region New
|
||||
|
||||
|
||||
var accountWorkshopList = _context.Workshops
|
||||
.Where(x => workshopList.Contains(x.id)).Include(x => x.LeftWorks.Where(left =>
|
||||
left.StartWorkDate <= nextMonthEnd && left.LeftWorkDate > nextMonthStart))
|
||||
.Include(x => x.Contracts2.Where(contract =>
|
||||
contract.ContarctStart.Date <= nextMonthEnd.Date && contract.ContractEnd.Date > nextMonthStart.Date &&
|
||||
contract.IsActiveString == "true")).ToList();
|
||||
|
||||
var notCompletedWorkshops = accountWorkshopList.Select(workshop =>
|
||||
{
|
||||
Id = x.id,
|
||||
IsActiveString = x.IsActiveString,
|
||||
WorkshopFullName = x.WorkshopFullName,
|
||||
ArchiveCode = x.ArchiveCode,
|
||||
ContractingPartId = x.WorkshopEmployers.Select(e => e.Employer.ContractingPartyId).FirstOrDefault(),
|
||||
AccountIdList = _context.WorkshopAccounts.Where(m => m.WorkshopId == x.id).Select(a => a.AccountId).ToList(),
|
||||
#region Contracts
|
||||
var contractSigned = workshop.Contracts2.Count(x => x.Signature == "1");
|
||||
var contractCreated = workshop.Contracts2.Count();
|
||||
|
||||
//contractLeft This Mont
|
||||
|
||||
ContractLeftIds = x.LeftWorks.Select(l => new LeftWorkViewModel()
|
||||
var checkoutSignedPercent = workshop.Contracts2.Any(x => x.Signature == "0") ? ((contractSigned * 100) / contractCreated) : 100;
|
||||
if (checkoutSignedPercent < 100 && contractCreated > 0)
|
||||
{
|
||||
EmployeeId = l.EmployeeId,
|
||||
StartWorkDateGr = l.StartWorkDate,
|
||||
LeftWorkDateGr = l.LeftWorkDate.AddDays(-1),
|
||||
|
||||
}).Where(l =>
|
||||
(l.StartWorkDateGr <= nextMonthStart && l.LeftWorkDateGr > nextMonthStart) ||
|
||||
(l.StartWorkDateGr <= nextMonthEnd && l.LeftWorkDateGr >= nextMonthEnd) ||
|
||||
(l.StartWorkDateGr >= nextMonthStart && l.StartWorkDateGr <= nextMonthEnd) ||
|
||||
(l.LeftWorkDateGr >= nextMonthStart && l.LeftWorkDateGr <= nextMonthEnd)).Select(l => l.EmployeeId).ToList(),
|
||||
#endregion
|
||||
var employeeNotDone =
|
||||
workshop.Contracts2.Where(x => x.Signature == "0").Select(l => new EmployeeNotDone()
|
||||
{
|
||||
Id = l.EmployeeId,
|
||||
EmployeeFullName = workshop.LeftWorks.FirstOrDefault(x=>x.EmployeeId == l.EmployeeId)!.EmployeeFullName,
|
||||
|
||||
}).Where(e => blockContractingPartyIds.Contains(e.ContractingPartId))
|
||||
.Where(a => a.AccountIdList.Contains(accountId)).AsSplitQuery();
|
||||
var workshopsList = workshops.Select(x => new ActiveWorkshops
|
||||
{
|
||||
Id = x.Id,
|
||||
IsActiveString = x.IsActiveString,
|
||||
WorkshopFullName = x.WorkshopFullName,
|
||||
ArchiveCode = x.ArchiveCode,
|
||||
ContractingPartId = x.ContractingPartId,
|
||||
AccountIdList = x.AccountIdList,
|
||||
#region Contracts
|
||||
|
||||
//contractLeft This Month
|
||||
ContractLeftIds = _context.InstitutionContractSet.Any(c => c.ContractingPartyId == x.ContractingPartId && c.ContractStartGr <= nextMonthStart && c.ContractEndGr >= nextMonthEnd) ? x.ContractLeftIds : new List<long>(),
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}).ToList();
|
||||
var result = workshopsList.Select(x => new ActiveWorkshops
|
||||
{
|
||||
Id = x.Id,
|
||||
ContractLeftWorkCount = x.ContractLeftIds.Count,
|
||||
WorkshopFullName = x.WorkshopFullName,
|
||||
ArchiveCode = x.ArchiveCode,
|
||||
ContrctDoneCount = x.ContractLeftIds.Count > 0 ? _context.Contracts.Where(ch => ch.WorkshopIds == x.Id && ch.IsActiveString == "true").Where(ch => x.ContractLeftIds.Contains(ch.EmployeeId))
|
||||
.Count(l => (l.ContarctStart <= nextMonthStart && l.ContractEnd >= nextMonthStart) ||
|
||||
(l.ContarctStart <= nextMonthEnd && l.ContractEnd >= nextMonthEnd) ||
|
||||
(l.ContarctStart >= nextMonthStart && l.ContarctStart <= nextMonthEnd) ||
|
||||
(l.ContractEnd >= nextMonthStart && l.ContractEnd <= nextMonthEnd)) : 0,
|
||||
ContrctSignDoneCount = x.ContractLeftIds.Count > 0 ? _context.Contracts.Where(ct => ct.WorkshopIds == x.Id && ct.IsActiveString == "true" && ct.Signature == "1").Where(ct => x.ContractLeftIds.Contains(ct.EmployeeId))
|
||||
.Count(l => (l.ContarctStart <= nextMonthStart && l.ContractEnd >= nextMonthStart) ||
|
||||
(l.ContarctStart <= nextMonthEnd && l.ContractEnd >= nextMonthEnd) ||
|
||||
(l.ContarctStart >= nextMonthStart && l.ContarctStart <= nextMonthEnd) ||
|
||||
(l.ContractEnd >= nextMonthStart && l.ContractEnd <= nextMonthEnd)) : 0,
|
||||
}).Where(x => x.ContrctDoneCount > 0).ToList();
|
||||
|
||||
var workshopList = result.Where(x => ((x.ContrctSignDoneCount * 100) / x.ContrctDoneCount) < 100)
|
||||
.Select(x => new workshopSearch()
|
||||
{
|
||||
Id = x.Id,
|
||||
WorkshopFullName = x.WorkshopFullName,
|
||||
ArchiveCode = x.ArchiveCode,
|
||||
ContractSignPercent = ((x.ContrctSignDoneCount * 100) / x.ContrctDoneCount),
|
||||
EmployeeNotDones = _context.LeftWorkList.Where(l => l.WorkshopId == x.Id).Select(l => new LeftWorkViewModel()
|
||||
}).ToList();
|
||||
return new workshopSearch()
|
||||
{
|
||||
Id = workshop.id,
|
||||
WorkshopFullName = workshop.WorkshopFullName,
|
||||
ArchiveCode = workshop.ArchiveCode,
|
||||
ContractSignPercent = checkoutSignedPercent,
|
||||
EmployeeNotDones = employeeNotDone
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
Id = l.id,
|
||||
EmployeeId = l.EmployeeId,
|
||||
EmployeeFullName = l.EmployeeFullName,
|
||||
StartWorkDateGr = l.StartWorkDate,
|
||||
LeftWorkDateGr = l.LeftWorkDate.AddDays(-1),
|
||||
}).Where(l =>
|
||||
(l.StartWorkDateGr <= nextMonthStart && l.LeftWorkDateGr > nextMonthStart) ||
|
||||
(l.StartWorkDateGr <= nextMonthEnd && l.LeftWorkDateGr >= nextMonthEnd) ||
|
||||
(l.StartWorkDateGr >= nextMonthStart && l.StartWorkDateGr <= nextMonthEnd) ||
|
||||
(l.LeftWorkDateGr >= nextMonthStart && l.LeftWorkDateGr <= nextMonthEnd))
|
||||
.Where(l => !_context.Contracts.Where(ct => ct.WorkshopIds == x.Id && ct.IsActiveString == "true" && ct.Signature == "1")
|
||||
.Any(c => c.EmployeeId == l.EmployeeId &&
|
||||
((c.ContarctStart <= nextMonthStart && c.ContractEnd >= nextMonthStart) ||
|
||||
(c.ContarctStart <= nextMonthEnd && c.ContractEnd >= nextMonthEnd) ||
|
||||
(c.ContarctStart >= nextMonthStart && c.ContarctStart <= nextMonthEnd) ||
|
||||
(c.ContractEnd >= nextMonthStart && c.ContractEnd <= nextMonthEnd))))
|
||||
.Select(l => new EmployeeNotDone()
|
||||
{
|
||||
Id = l.EmployeeId,
|
||||
EmployeeFullName = l.EmployeeFullName,
|
||||
}).ToList()
|
||||
}).OrderBy(x => x.ContractSignPercent).ToList();
|
||||
|
||||
return null;
|
||||
}
|
||||
}).Where(x => x != null)
|
||||
.OrderBy(x => x.ContractSignPercent)
|
||||
.ToList();
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
var finalResult = new PrintAllContractCheckout()
|
||||
@@ -2088,13 +1990,14 @@ public class ReportRepository : IReportRepository
|
||||
Year = $"{nextMonthStartFa.Year}",
|
||||
Month = nextMonthStartFa.Month.ToFarsiMonthByIntNumber(),
|
||||
ReportType = "امضاء قرارداد",
|
||||
WorkshopSearches = workshopList,
|
||||
WorkshopSearches = notCompletedWorkshops,
|
||||
};
|
||||
Console.WriteLine("ajax >>>>>: " + watch.Elapsed);
|
||||
return finalResult;
|
||||
}
|
||||
|
||||
public PrintAllContractCheckout GetPrintAllCheckoutDone(string year, string month, long accountId)
|
||||
public PrintAllContractCheckout GetPrintAllCheckoutDone(string year, string month, long accountId,
|
||||
List<long> workshopList)
|
||||
{
|
||||
var watch = System.Diagnostics.Stopwatch.StartNew();
|
||||
string nowFa = "";
|
||||
@@ -2118,98 +2021,52 @@ public class ReportRepository : IReportRepository
|
||||
var nextMonthEnd = (($"{nextMonthStartFa}").FindeEndOfMonth()).ToGeorgianDateTime();
|
||||
|
||||
|
||||
//var instititionContracts = _context.InstitutionContractSet.Where(x => x.IsActiveString == "true").Select(x => x.ContractingPartyId).ToList();
|
||||
var blockContractingPartyIds = _context.PersonalContractingParties.Where(x => x.IsBlock == "false" && x.IsActiveString == "true").Select(x => x.id).ToList();
|
||||
//blockContractingPartyIds = blockContractingPartyIds.Where(x => instititionContracts.Contains(x)).ToList();
|
||||
var workshops = _context.Workshops.Where(x => x.IsActiveString == "true")
|
||||
.Include(x => x.WorkshopEmployers)
|
||||
.Include(x => x.LeftWorks)
|
||||
.Select(x => new ActiveWorkshops
|
||||
{
|
||||
Id = x.id,
|
||||
IsActiveString = x.IsActiveString,
|
||||
WorkshopFullName = x.WorkshopFullName,
|
||||
ArchiveCode = x.ArchiveCode,
|
||||
ContractingPartId = x.WorkshopEmployers.Select(e => e.Employer.ContractingPartyId).FirstOrDefault(),
|
||||
AccountIdList = _context.WorkshopAccounts.Where(m => m.WorkshopId == x.id).Select(a => a.AccountId).ToList(),
|
||||
#region New
|
||||
|
||||
|
||||
#region Checkouts
|
||||
var accountWorkshopList = _context.Workshops
|
||||
.Where(x => workshopList.Contains(x.id))
|
||||
.Include(x => x.LeftWorks.Where(left =>
|
||||
left.StartWorkDate <= currentMonthEnd && left.LeftWorkDate > currentMonthStart))
|
||||
.Include(x => x.Checkouts.Where(contract =>
|
||||
contract.ContractStart.Date <= currentMonthEnd.Date && contract.ContractEnd.Date > currentMonthStart.Date &&
|
||||
contract.IsActiveString == "true")).ToList();
|
||||
|
||||
//CheckoutLeft befor This Month
|
||||
CheckoutLeftIds = x.LeftWorks.Select(l => new LeftWorkViewModel()
|
||||
{
|
||||
EmployeeId = l.EmployeeId,
|
||||
StartWorkDateGr = l.StartWorkDate,
|
||||
LeftWorkDateGr = l.LeftWorkDate.AddDays(-1),
|
||||
|
||||
}).Where(l =>
|
||||
(l.StartWorkDateGr <= currentMonthStart && l.LeftWorkDateGr > currentMonthStart) ||
|
||||
(l.StartWorkDateGr <= currentMonthEnd && l.LeftWorkDateGr >= currentMonthEnd) ||
|
||||
(l.StartWorkDateGr >= currentMonthStart && l.StartWorkDateGr <= currentMonthEnd) ||
|
||||
(l.LeftWorkDateGr >= currentMonthStart && l.LeftWorkDateGr <= currentMonthEnd)).Select(l => l.EmployeeId).ToList(),
|
||||
|
||||
#endregion
|
||||
|
||||
}).Where(e => blockContractingPartyIds.Contains(e.ContractingPartId))
|
||||
.Where(a => a.AccountIdList.Contains(accountId)).AsSplitQuery();
|
||||
var workshopsList = workshops.Select(x => new ActiveWorkshops
|
||||
var notCompletedWorkshops = accountWorkshopList.Select(workshop =>
|
||||
{
|
||||
Id = x.Id,
|
||||
IsActiveString = x.IsActiveString,
|
||||
WorkshopFullName = x.WorkshopFullName,
|
||||
ArchiveCode = x.ArchiveCode,
|
||||
ContractingPartId = x.ContractingPartId,
|
||||
AccountIdList = x.AccountIdList,
|
||||
|
||||
|
||||
#region Checkouts
|
||||
|
||||
////CheckoutLeft befor This Month
|
||||
CheckoutLeftIds = _context.InstitutionContractSet.Any(c => c.ContractingPartyId == x.ContractingPartId && c.ContractStartGr <= currentMonthStart && c.ContractEndGr >= currentMonthEnd) ? x.CheckoutLeftIds : new List<long>(),
|
||||
|
||||
|
||||
#endregion
|
||||
}).ToList();
|
||||
var result = workshopsList.Select(x => new ActiveWorkshops
|
||||
{
|
||||
Id = x.Id,
|
||||
CheckoutLeftWorkCount = x.CheckoutLeftIds.Count,
|
||||
WorkshopFullName = x.WorkshopFullName,
|
||||
ArchiveCode = x.ArchiveCode,
|
||||
CheckoutDoneCount = x.CheckoutLeftIds.Count > 0 ? _context.CheckoutSet.Where(ch => ch.WorkshopId == x.Id).Where(ct => x.CheckoutLeftIds.Contains(ct.EmployeeId))
|
||||
.Count(ch =>
|
||||
ch.ContractStart >= currentMonthStart && ch.ContractStart < currentMonthEnd &&
|
||||
ch.IsActiveString == "true") : 0,
|
||||
}).Where(x => x.CheckoutLeftWorkCount > 0).ToList();
|
||||
|
||||
var workshopList = result.Where(x => ((x.CheckoutDoneCount * 100) / x.CheckoutLeftWorkCount) < 100)
|
||||
.Select(x => new workshopSearch()
|
||||
var lefts = workshop.LeftWorks.Select(x => new { x.EmployeeId, x.EmployeeFullName }).Distinct().ToList();
|
||||
var contractToBe = lefts.Count;
|
||||
var contractCreated = workshop.Checkouts.Count();
|
||||
var createdContractEmployeeIdList = workshop.Checkouts.Select(x => x.EmployeeId).ToList();
|
||||
var contractDonePercent = contractToBe > 0 ? ((contractCreated * 100) / contractToBe) : 100;
|
||||
if (contractDonePercent < 100)
|
||||
{
|
||||
Id = x.Id,
|
||||
WorkshopFullName = x.WorkshopFullName,
|
||||
ArchiveCode = x.ArchiveCode,
|
||||
CheckoutDonePercent = ((x.CheckoutDoneCount * 100) / x.CheckoutLeftWorkCount),
|
||||
EmployeeNotDones = _context.LeftWorkList.Where(l => l.WorkshopId == x.Id).Select(l => new LeftWorkViewModel()
|
||||
{
|
||||
Id = l.id,
|
||||
EmployeeId = l.EmployeeId,
|
||||
EmployeeFullName = l.EmployeeFullName,
|
||||
StartWorkDateGr = l.StartWorkDate,
|
||||
LeftWorkDateGr = l.LeftWorkDate.AddDays(-1),
|
||||
}).Where(l => (l.StartWorkDateGr <= currentMonthStart && l.LeftWorkDateGr > currentMonthStart) ||
|
||||
(l.StartWorkDateGr <= currentMonthEnd && l.LeftWorkDateGr >= currentMonthEnd) ||
|
||||
(l.StartWorkDateGr >= currentMonthStart && l.StartWorkDateGr <= currentMonthEnd) ||
|
||||
(l.LeftWorkDateGr >= currentMonthStart && l.LeftWorkDateGr <= currentMonthEnd))
|
||||
.Where(l => !_context.CheckoutSet
|
||||
.Where(ch => ch.WorkshopId == x.Id && ch.ContractStart >= currentMonthStart && ch.ContractStart < currentMonthEnd && ch.IsActiveString == "true")
|
||||
.Any(ch => ch.EmployeeId == l.EmployeeId))
|
||||
.Select(l => new EmployeeNotDone
|
||||
|
||||
var employeeNotDone =
|
||||
lefts.Where(x => !createdContractEmployeeIdList.Contains(x.EmployeeId)).Select(l => new EmployeeNotDone()
|
||||
{
|
||||
Id = l.EmployeeId,
|
||||
EmployeeFullName = l.EmployeeFullName,
|
||||
}).ToList()
|
||||
}).OrderBy(x => x.CheckoutDonePercent).ToList();
|
||||
|
||||
}).ToList();
|
||||
return new workshopSearch()
|
||||
{
|
||||
Id = workshop.id,
|
||||
WorkshopFullName = workshop.WorkshopFullName,
|
||||
ArchiveCode = workshop.ArchiveCode,
|
||||
CheckoutDonePercent = contractDonePercent,
|
||||
EmployeeNotDones = employeeNotDone
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}).Where(x => x != null)
|
||||
.OrderBy(x => x.ContractDonePercent)
|
||||
.ToList();
|
||||
|
||||
#endregion
|
||||
|
||||
var finalResult = new PrintAllContractCheckout()
|
||||
{
|
||||
@@ -2218,13 +2075,14 @@ public class ReportRepository : IReportRepository
|
||||
Year = year,
|
||||
Month = month.ToFarsiMonthByNumber(),
|
||||
ReportType = "تنظیم تصفیه حساب",
|
||||
WorkshopSearches = workshopList,
|
||||
WorkshopSearches = notCompletedWorkshops,
|
||||
};
|
||||
Console.WriteLine("ajax >>>>>: " + watch.Elapsed);
|
||||
return finalResult;
|
||||
}
|
||||
|
||||
public PrintAllContractCheckout GetPrintAllCheckoutSignDone(string year, string month, long accountId)
|
||||
public PrintAllContractCheckout GetPrintAllCheckoutSignDone(string year, string month, long accountId,
|
||||
List<long> workshopList)
|
||||
{
|
||||
var watch = System.Diagnostics.Stopwatch.StartNew();
|
||||
string nowFa = "";
|
||||
@@ -2248,106 +2106,49 @@ public class ReportRepository : IReportRepository
|
||||
var nextMonthEnd = (($"{nextMonthStartFa}").FindeEndOfMonth()).ToGeorgianDateTime();
|
||||
|
||||
|
||||
//var instititionContracts = _context.InstitutionContractSet.Where(x => x.IsActiveString == "true").Select(x => x.ContractingPartyId).ToList();
|
||||
var blockContractingPartyIds = _context.PersonalContractingParties.Where(x => x.IsBlock == "false" && x.IsActiveString == "true").Select(x => x.id).ToList();
|
||||
//blockContractingPartyIds = blockContractingPartyIds.Where(x => instititionContracts.Contains(x)).ToList();
|
||||
#region New
|
||||
|
||||
var workshops = _context.Workshops.Where(x => x.IsActiveString == "true")
|
||||
.Include(x => x.WorkshopEmployers)
|
||||
.Include(x => x.LeftWorks)
|
||||
.Select(x => new ActiveWorkshops
|
||||
|
||||
var accountWorkshopList = _context.Workshops
|
||||
.Where(x => workshopList.Contains(x.id))
|
||||
.Include(x => x.Checkouts.Where(contract =>
|
||||
contract.ContractStart.Date <= currentMonthEnd.Date && contract.ContractEnd.Date > currentMonthStart.Date &&
|
||||
contract.IsActiveString == "true")).ToList();
|
||||
|
||||
var notCompletedWorkshops = accountWorkshopList.Select(workshop =>
|
||||
{
|
||||
Id = x.id,
|
||||
IsActiveString = x.IsActiveString,
|
||||
WorkshopFullName = x.WorkshopFullName,
|
||||
ArchiveCode = x.ArchiveCode,
|
||||
ContractingPartId = x.WorkshopEmployers.Select(e => e.Employer.ContractingPartyId).FirstOrDefault(),
|
||||
AccountIdList = _context.WorkshopAccounts.Where(m => m.WorkshopId == x.id).Select(a => a.AccountId).ToList(),
|
||||
var checkoutSigned = workshop.Checkouts.Count(x => x.Signature == "1");
|
||||
var checkoutCreated = workshop.Checkouts.Count();
|
||||
|
||||
#region Checkouts
|
||||
|
||||
//CheckoutLeft befor This Month
|
||||
CheckoutLeftIds = x.LeftWorks.Select(l => new LeftWorkViewModel()
|
||||
var contractSignedPercent = workshop.Checkouts.Any(x => x.Signature == "0") ? ((checkoutSigned * 100) / checkoutCreated) : 100;
|
||||
if (contractSignedPercent < 100 && checkoutCreated > 0)
|
||||
{
|
||||
EmployeeId = l.EmployeeId,
|
||||
StartWorkDateGr = l.StartWorkDate,
|
||||
LeftWorkDateGr = l.LeftWorkDate.AddDays(-1),
|
||||
|
||||
}).Where(l =>
|
||||
(l.StartWorkDateGr <= currentMonthStart && l.LeftWorkDateGr > currentMonthStart) ||
|
||||
(l.StartWorkDateGr <= currentMonthEnd && l.LeftWorkDateGr >= currentMonthEnd) ||
|
||||
(l.StartWorkDateGr >= currentMonthStart && l.StartWorkDateGr <= currentMonthEnd) ||
|
||||
(l.LeftWorkDateGr >= currentMonthStart && l.LeftWorkDateGr <= currentMonthEnd)).Select(l => l.EmployeeId).ToList(),
|
||||
var employeeNotDone =
|
||||
workshop.Checkouts.Where(x => x.Signature == "0").Select(l => new EmployeeNotDone()
|
||||
{
|
||||
Id = l.EmployeeId,
|
||||
EmployeeFullName = l.EmployeeFullName,
|
||||
|
||||
#endregion
|
||||
|
||||
}).Where(e => blockContractingPartyIds.Contains(e.ContractingPartId))
|
||||
.Where(a => a.AccountIdList.Contains(accountId)).AsSplitQuery();
|
||||
var workshopsList = workshops.Select(x => new ActiveWorkshops
|
||||
{
|
||||
Id = x.Id,
|
||||
IsActiveString = x.IsActiveString,
|
||||
WorkshopFullName = x.WorkshopFullName,
|
||||
ArchiveCode = x.ArchiveCode,
|
||||
ContractingPartId = x.ContractingPartId,
|
||||
AccountIdList = x.AccountIdList,
|
||||
|
||||
|
||||
#region Checkouts
|
||||
|
||||
////CheckoutLeft befor This Month
|
||||
CheckoutLeftIds = _context.InstitutionContractSet.Any(c => c.ContractingPartyId == x.ContractingPartId && c.ContractStartGr <= currentMonthStart && c.ContractEndGr >= currentMonthEnd) ? x.CheckoutLeftIds : new List<long>(),
|
||||
|
||||
|
||||
#endregion
|
||||
}).ToList();
|
||||
var result = workshopsList.Select(x => new ActiveWorkshops
|
||||
{
|
||||
Id = x.Id,
|
||||
CheckoutLeftWorkCount = x.CheckoutLeftIds.Count,
|
||||
|
||||
WorkshopFullName = x.WorkshopFullName,
|
||||
ArchiveCode = x.ArchiveCode,
|
||||
CheckoutDoneCount = x.CheckoutLeftIds.Count > 0 ? _context.CheckoutSet.Where(ch => ch.WorkshopId == x.Id).Where(ct => x.CheckoutLeftIds.Contains(ct.EmployeeId))
|
||||
.Count(ch =>
|
||||
ch.ContractStart >= currentMonthStart && ch.ContractStart < currentMonthEnd &&
|
||||
ch.IsActiveString == "true") : 0,
|
||||
CheckoutSignDoneCount = x.CheckoutLeftIds.Count > 0 ? _context.CheckoutSet.Where(ch => ch.WorkshopId == x.Id && ch.Signature == "1").Where(ct => x.CheckoutLeftIds.Contains(ct.EmployeeId))
|
||||
.Count(ch =>
|
||||
ch.ContractStart >= currentMonthStart && ch.ContractStart < currentMonthEnd &&
|
||||
ch.IsActiveString == "true") : 0,
|
||||
|
||||
}).Where(x => x.CheckoutDoneCount > 0).ToList();
|
||||
|
||||
var workshopList = result.Where(x => ((x.CheckoutSignDoneCount * 100) / x.CheckoutDoneCount) < 100)
|
||||
.Select(x => new workshopSearch()
|
||||
{
|
||||
Id = x.Id,
|
||||
WorkshopFullName = x.WorkshopFullName,
|
||||
ArchiveCode = x.ArchiveCode,
|
||||
CheckoutSignPercent = ((x.CheckoutSignDoneCount * 100) / x.CheckoutDoneCount),
|
||||
EmployeeNotDones = _context.LeftWorkList.Where(l => l.WorkshopId == x.Id).Select(l => new LeftWorkViewModel()
|
||||
}).ToList();
|
||||
return new workshopSearch()
|
||||
{
|
||||
Id = workshop.id,
|
||||
WorkshopFullName = workshop.WorkshopFullName,
|
||||
ArchiveCode = workshop.ArchiveCode,
|
||||
CheckoutSignPercent = contractSignedPercent,
|
||||
EmployeeNotDones = employeeNotDone
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
Id = l.id,
|
||||
EmployeeId = l.EmployeeId,
|
||||
EmployeeFullName = l.EmployeeFullName,
|
||||
StartWorkDateGr = l.StartWorkDate,
|
||||
LeftWorkDateGr = l.LeftWorkDate.AddDays(-1),
|
||||
}).Where(l => (l.StartWorkDateGr <= currentMonthStart && l.LeftWorkDateGr > currentMonthStart) ||
|
||||
(l.StartWorkDateGr <= currentMonthEnd && l.LeftWorkDateGr >= currentMonthEnd) ||
|
||||
(l.StartWorkDateGr >= currentMonthStart && l.StartWorkDateGr <= currentMonthEnd) ||
|
||||
(l.LeftWorkDateGr >= currentMonthStart && l.LeftWorkDateGr <= currentMonthEnd))
|
||||
.Where(l => !_context.CheckoutSet.Where(ch => ch.WorkshopId == x.Id &&
|
||||
ch.ContractStart >= currentMonthStart && ch.ContractStart < currentMonthEnd && ch.Signature == "1" &&
|
||||
ch.IsActiveString == "true")
|
||||
.Any(ch => ch.EmployeeId == l.EmployeeId))
|
||||
.Select(l => new EmployeeNotDone
|
||||
{
|
||||
Id = l.EmployeeId,
|
||||
EmployeeFullName = l.EmployeeFullName,
|
||||
}).ToList()
|
||||
}).OrderBy(x => x.CheckoutSignPercent).ToList();
|
||||
return null;
|
||||
}
|
||||
}).Where(x => x != null)
|
||||
.OrderBy(x => x.CheckoutSignPercent)
|
||||
.ToList();
|
||||
|
||||
#endregion
|
||||
var finalResult = new PrintAllContractCheckout()
|
||||
{
|
||||
AccountId = accountId,
|
||||
@@ -2355,7 +2156,7 @@ public class ReportRepository : IReportRepository
|
||||
Year = year,
|
||||
Month = month.ToFarsiMonthByNumber(),
|
||||
ReportType = "امضاء تصفیه حساب",
|
||||
WorkshopSearches = workshopList,
|
||||
WorkshopSearches = notCompletedWorkshops,
|
||||
};
|
||||
Console.WriteLine("ajax >>>>>: " + watch.Elapsed);
|
||||
return finalResult;
|
||||
|
||||
@@ -412,7 +412,7 @@
|
||||
<span class="title">@personnel.ContractDonePercent%</span>
|
||||
</div>
|
||||
<div class="col-xs-2 text-left">
|
||||
<button class="btn-print @(personnel.ContractDonePercent >= 100 ? "disable" : "")" onclick="printAllContractDone(@personnel.AccountId)">
|
||||
<button class="btn-print @(personnel.ContractDonePercent >= 100 ? "disable" : "")" onclick="printAllContractDone(@personnel.AccountId, @Html.Raw(Json.Serialize(personnel.WorkshopList)))">
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M18 13.5H18.5C19.4428 13.5 19.9142 13.5 20.2071 13.2071C20.5 12.9142 20.5 12.4428 20.5 11.5V10.5C20.5 8.61438 20.5 7.67157 19.9142 7.08579C19.3284 6.5 18.3856 6.5 16.5 6.5H7.5C5.61438 6.5 4.67157 6.5 4.08579 7.08579C3.5 7.67157 3.5 8.61438 3.5 10.5V12.5C3.5 12.9714 3.5 13.2071 3.64645 13.3536C3.79289 13.5 4.0286 13.5 4.5 13.5H6" stroke="#FFFFFF"/>
|
||||
<path d="M6.5 19.8063L6.5 11.5C6.5 10.5572 6.5 10.0858 6.79289 9.79289C7.08579 9.5 7.55719 9.5 8.5 9.5L15.5 9.5C16.4428 9.5 16.9142 9.5 17.2071 9.79289C17.5 10.0858 17.5 10.5572 17.5 11.5L17.5 19.8063C17.5 20.1228 17.5 20.2811 17.3962 20.356C17.2924 20.4308 17.1422 20.3807 16.8419 20.2806L14.6738 19.5579C14.5878 19.5293 14.5448 19.5149 14.5005 19.5162C14.4561 19.5175 14.4141 19.5344 14.3299 19.568L12.1857 20.4257C12.094 20.4624 12.0481 20.4807 12 20.4807C11.9519 20.4807 11.906 20.4624 11.8143 20.4257L9.67005 19.568C9.58592 19.5344 9.54385 19.5175 9.49952 19.5162C9.45519 19.5149 9.41221 19.5293 9.32625 19.5579L7.15811 20.2806C6.8578 20.3807 6.70764 20.4308 6.60382 20.356C6.5 20.2811 6.5 20.1228 6.5 19.8063Z" stroke="#FFFFFF"/>
|
||||
@@ -447,7 +447,7 @@
|
||||
<span class="title">@personnel.ContractSignPercent%</span>
|
||||
</div>
|
||||
<div class="col-xs-2 text-left">
|
||||
<button class="btn-print @(personnel.ContractSignPercent >= 100 ? "disable" : "")" onclick="PrintAllContractSignDone(@personnel.AccountId)">
|
||||
<button class="btn-print @(personnel.ContractSignPercent >= 100 ? "disable" : "")" onclick="PrintAllContractSignDone(@personnel.AccountId, @Html.Raw(Json.Serialize(personnel.WorkshopList)))">
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M18 13.5H18.5C19.4428 13.5 19.9142 13.5 20.2071 13.2071C20.5 12.9142 20.5 12.4428 20.5 11.5V10.5C20.5 8.61438 20.5 7.67157 19.9142 7.08579C19.3284 6.5 18.3856 6.5 16.5 6.5H7.5C5.61438 6.5 4.67157 6.5 4.08579 7.08579C3.5 7.67157 3.5 8.61438 3.5 10.5V12.5C3.5 12.9714 3.5 13.2071 3.64645 13.3536C3.79289 13.5 4.0286 13.5 4.5 13.5H6" stroke="#FFFFFF"/>
|
||||
<path d="M6.5 19.8063L6.5 11.5C6.5 10.5572 6.5 10.0858 6.79289 9.79289C7.08579 9.5 7.55719 9.5 8.5 9.5L15.5 9.5C16.4428 9.5 16.9142 9.5 17.2071 9.79289C17.5 10.0858 17.5 10.5572 17.5 11.5L17.5 19.8063C17.5 20.1228 17.5 20.2811 17.3962 20.356C17.2924 20.4308 17.1422 20.3807 16.8419 20.2806L14.6738 19.5579C14.5878 19.5293 14.5448 19.5149 14.5005 19.5162C14.4561 19.5175 14.4141 19.5344 14.3299 19.568L12.1857 20.4257C12.094 20.4624 12.0481 20.4807 12 20.4807C11.9519 20.4807 11.906 20.4624 11.8143 20.4257L9.67005 19.568C9.58592 19.5344 9.54385 19.5175 9.49952 19.5162C9.45519 19.5149 9.41221 19.5293 9.32625 19.5579L7.15811 20.2806C6.8578 20.3807 6.70764 20.4308 6.60382 20.356C6.5 20.2811 6.5 20.1228 6.5 19.8063Z" stroke="#FFFFFF"/>
|
||||
@@ -482,7 +482,7 @@
|
||||
<span class="title">@personnel.CheckoutDonePercent%</span>
|
||||
</div>
|
||||
<div class="col-xs-2 text-left">
|
||||
<button class="btn-print @(personnel.CheckoutDonePercent >= 100 ? "disable" : "")" onclick="printAllCheckoutDone(@personnel.AccountId)">
|
||||
<button class="btn-print @(personnel.CheckoutDonePercent >= 100 ? "disable" : "")" onclick="printAllCheckoutDone(@personnel.AccountId, @Html.Raw(Json.Serialize(personnel.WorkshopList)))">
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M18 13.5H18.5C19.4428 13.5 19.9142 13.5 20.2071 13.2071C20.5 12.9142 20.5 12.4428 20.5 11.5V10.5C20.5 8.61438 20.5 7.67157 19.9142 7.08579C19.3284 6.5 18.3856 6.5 16.5 6.5H7.5C5.61438 6.5 4.67157 6.5 4.08579 7.08579C3.5 7.67157 3.5 8.61438 3.5 10.5V12.5C3.5 12.9714 3.5 13.2071 3.64645 13.3536C3.79289 13.5 4.0286 13.5 4.5 13.5H6" stroke="#FFFFFF"/>
|
||||
<path d="M6.5 19.8063L6.5 11.5C6.5 10.5572 6.5 10.0858 6.79289 9.79289C7.08579 9.5 7.55719 9.5 8.5 9.5L15.5 9.5C16.4428 9.5 16.9142 9.5 17.2071 9.79289C17.5 10.0858 17.5 10.5572 17.5 11.5L17.5 19.8063C17.5 20.1228 17.5 20.2811 17.3962 20.356C17.2924 20.4308 17.1422 20.3807 16.8419 20.2806L14.6738 19.5579C14.5878 19.5293 14.5448 19.5149 14.5005 19.5162C14.4561 19.5175 14.4141 19.5344 14.3299 19.568L12.1857 20.4257C12.094 20.4624 12.0481 20.4807 12 20.4807C11.9519 20.4807 11.906 20.4624 11.8143 20.4257L9.67005 19.568C9.58592 19.5344 9.54385 19.5175 9.49952 19.5162C9.45519 19.5149 9.41221 19.5293 9.32625 19.5579L7.15811 20.2806C6.8578 20.3807 6.70764 20.4308 6.60382 20.356C6.5 20.2811 6.5 20.1228 6.5 19.8063Z" stroke="#FFFFFF"/>
|
||||
@@ -517,7 +517,7 @@
|
||||
<span class="title">@personnel.CheckoutSignPercent%</span>
|
||||
</div>
|
||||
<div class="col-xs-2 text-left">
|
||||
<button class="btn-print @(personnel.CheckoutSignPercent >= 100 ? "disable" : "")" onclick="printAllCheckoutSignDone(@personnel.AccountId)">
|
||||
<button class="btn-print @(personnel.CheckoutSignPercent >= 100 ? "disable" : "")" onclick="printAllCheckoutSignDone(@personnel.AccountId, @Html.Raw(Json.Serialize(personnel.WorkshopList)))">
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M18 13.5H18.5C19.4428 13.5 19.9142 13.5 20.2071 13.2071C20.5 12.9142 20.5 12.4428 20.5 11.5V10.5C20.5 8.61438 20.5 7.67157 19.9142 7.08579C19.3284 6.5 18.3856 6.5 16.5 6.5H7.5C5.61438 6.5 4.67157 6.5 4.08579 7.08579C3.5 7.67157 3.5 8.61438 3.5 10.5V12.5C3.5 12.9714 3.5 13.2071 3.64645 13.3536C3.79289 13.5 4.0286 13.5 4.5 13.5H6" stroke="#FFFFFF"/>
|
||||
<path d="M6.5 19.8063L6.5 11.5C6.5 10.5572 6.5 10.0858 6.79289 9.79289C7.08579 9.5 7.55719 9.5 8.5 9.5L15.5 9.5C16.4428 9.5 16.9142 9.5 17.2071 9.79289C17.5 10.0858 17.5 10.5572 17.5 11.5L17.5 19.8063C17.5 20.1228 17.5 20.2811 17.3962 20.356C17.2924 20.4308 17.1422 20.3807 16.8419 20.2806L14.6738 19.5579C14.5878 19.5293 14.5448 19.5149 14.5005 19.5162C14.4561 19.5175 14.4141 19.5344 14.3299 19.568L12.1857 20.4257C12.094 20.4624 12.0481 20.4807 12 20.4807C11.9519 20.4807 11.906 20.4624 11.8143 20.4257L9.67005 19.568C9.58592 19.5344 9.54385 19.5175 9.49952 19.5162C9.45519 19.5149 9.41221 19.5293 9.32625 19.5579L7.15811 20.2806C6.8578 20.3807 6.70764 20.4308 6.60382 20.356C6.5 20.2811 6.5 20.1228 6.5 19.8063Z" stroke="#FFFFFF"/>
|
||||
@@ -1887,29 +1887,38 @@
|
||||
}
|
||||
}
|
||||
|
||||
function printAllAction(id, handler) {
|
||||
|
||||
|
||||
|
||||
//===============PrintAll by account and workshoplist==============
|
||||
|
||||
function printAllAction(id, workshopList, handler) {
|
||||
const year = $('#selectYear').val();
|
||||
const month = $('#selectMonth').val();
|
||||
const accoundId = Number(id);
|
||||
const url = `#showmodal=/Admin/Company/Reports/Index?year=${year}&month=${month}&accountId=${accoundId}&handler=${handler}`;
|
||||
const url = `#showmodal=/Admin/Company/Reports/Index?year=${year}&month=${month}&accountId=${accoundId}&workshopList=${workshopList}&handler=${handler}`;
|
||||
window.location.href = url;
|
||||
}
|
||||
|
||||
function printAllContractDone(id) {
|
||||
printAllAction(id, 'PrintAllContractDone');
|
||||
|
||||
|
||||
function printAllContractDone(id, workshopList) {
|
||||
|
||||
printAllAction(id, JSON.stringify(workshopList), 'PrintAllContractDone');
|
||||
}
|
||||
|
||||
function PrintAllContractSignDone(id) {
|
||||
printAllAction(id, 'PrintAllContractSignDone');
|
||||
function PrintAllContractSignDone(id, workshopList) {
|
||||
printAllAction(id, JSON.stringify(workshopList), 'PrintAllContractSignDone');
|
||||
}
|
||||
|
||||
function printAllCheckoutDone(id) {
|
||||
printAllAction(id, 'PrintAllCheckoutDone');
|
||||
function printAllCheckoutDone(id, workshopList) {
|
||||
printAllAction(id, JSON.stringify(workshopList), 'PrintAllCheckoutDone');
|
||||
}
|
||||
|
||||
function printAllCheckoutSignDone(id) {
|
||||
printAllAction(id, 'PrintAllCheckoutSignDone');
|
||||
function printAllCheckoutSignDone(id, workshopList) {
|
||||
printAllAction(id, JSON.stringify(workshopList), 'PrintAllCheckoutSignDone');
|
||||
}
|
||||
//================================================================
|
||||
|
||||
|
||||
function printAllEmployeeAction(id, accountFullName, handler) {
|
||||
const year = $('#selectYear').val();
|
||||
|
||||
@@ -171,32 +171,38 @@ public class IndexModel : PageModel
|
||||
});
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Print
|
||||
#region Print
|
||||
|
||||
//================Done
|
||||
public IActionResult OnGetPrintAllContractDone(string year, string month, long accountId)
|
||||
{
|
||||
var res = _reportApplication.GetPrintAllContractDone(year, month, accountId);
|
||||
//================PrintAll by account and workshoplist
|
||||
public IActionResult OnGetPrintAllContractDone(string year, string month, long accountId,string workshopList)
|
||||
{
|
||||
|
||||
var workshopIds = Tools.ExtractNumbers(workshopList);
|
||||
var res = _reportApplication.GetPrintAllContractDone(year, month, accountId, workshopIds);
|
||||
return Partial("PrintAll", res);
|
||||
}
|
||||
|
||||
public IActionResult OnGetPrintAllContractSignDone(string year, string month, long accountId)
|
||||
public IActionResult OnGetPrintAllContractSignDone(string year, string month, long accountId, string workshopList)
|
||||
{
|
||||
var res = _reportApplication.GetPrintAllContractSignDone(year, month, accountId);
|
||||
var workshopIds = Tools.ExtractNumbers(workshopList);
|
||||
var res = _reportApplication.GetPrintAllContractSignDone(year, month, accountId, workshopIds);
|
||||
return Partial("PrintAll", res);
|
||||
}
|
||||
|
||||
public IActionResult OnGetPrintAllCheckoutDone(string year, string month, long accountId)
|
||||
public IActionResult OnGetPrintAllCheckoutDone(string year, string month, long accountId, string workshopList)
|
||||
{
|
||||
var res = _reportApplication.GetPrintAllCheckoutDone(year, month, accountId);
|
||||
var workshopIds = Tools.ExtractNumbers(workshopList);
|
||||
|
||||
var res = _reportApplication.GetPrintAllCheckoutDone(year, month, accountId, workshopIds);
|
||||
return Partial("PrintAll", res);
|
||||
}
|
||||
|
||||
public IActionResult OnGetPrintAllCheckoutSignDone(string year, string month, long accountId)
|
||||
public IActionResult OnGetPrintAllCheckoutSignDone(string year, string month, long accountId, string workshopList)
|
||||
{
|
||||
var res = _reportApplication.GetPrintAllCheckoutSignDone(year, month, accountId);
|
||||
var workshopIds = Tools.ExtractNumbers(workshopList);
|
||||
var res = _reportApplication.GetPrintAllCheckoutSignDone(year, month, accountId, workshopIds);
|
||||
return Partial("PrintAll", res);
|
||||
}
|
||||
//================Employee
|
||||
|
||||
BIN
ServiceHost/InsuranceList/209/1403_11/DSKKAR00.dbf
Normal file
BIN
ServiceHost/InsuranceList/209/1403_11/DSKKAR00.dbf
Normal file
Binary file not shown.
BIN
ServiceHost/InsuranceList/209/1403_11/DSKWOR00.dbf
Normal file
BIN
ServiceHost/InsuranceList/209/1403_11/DSKWOR00.dbf
Normal file
Binary file not shown.
Reference in New Issue
Block a user