checkout main list bug fixed - insurance employee id 45280 exception
This commit is contained in:
@@ -512,13 +512,13 @@ public class InsuranceListApplication : IInsuranceListApplication
|
||||
monthlyBenefits = GetRoundValue(monthlyBenefits += overTimePay);
|
||||
}
|
||||
|
||||
//سرای ملک
|
||||
// نوشین خالی
|
||||
// 39692467
|
||||
//if (employee.EmployeeId == 45280)
|
||||
// monthlyBenefits += 39692467;
|
||||
//سرای ملک
|
||||
// نرجس خالی
|
||||
// 39692467
|
||||
if (employee.EmployeeId == 45280)
|
||||
monthlyBenefits += 39692467;
|
||||
|
||||
var marriedAllowanceCompute = MarriedAllowance(employee.MaritalStatus, employee.JobId, employee.IncludeStatus,
|
||||
var marriedAllowanceCompute = MarriedAllowance(employee.MaritalStatus, employee.JobId, employee.IncludeStatus,
|
||||
workingDays.countWorkingDays, yearlysaleries.MarriedAllowance, endOfMonth);
|
||||
//محاسبه جمع مزایای مشمول و دستمزد ماهانه
|
||||
var benefitsIncludedContinuous = monthlyBenefits + monthlySalary;
|
||||
|
||||
@@ -1940,8 +1940,46 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
var workshopAcounts = _context.WorkshopAccounts.Where(x => x.AccountId == acountID)
|
||||
.Select(x => x.WorkshopId);
|
||||
|
||||
//var checkouts =
|
||||
// _context.CheckoutSet.Where(x => workshopAcounts.Contains(x.WorkshopId))
|
||||
// .Join(_context.Workshops.AsSplitQuery(),
|
||||
// ch => ch.WorkshopId,
|
||||
// workshop => workshop.id,
|
||||
// (ch, workshop) => new { ch, workshop })
|
||||
// .GroupJoin(_context.EmployeeComputeOptionsSet.AsSplitQuery(),
|
||||
// x => x.workshop.id,
|
||||
// option => option.WorkshopId,
|
||||
// (x, options) => new { x.ch, x.workshop, options })
|
||||
// .SelectMany(
|
||||
// x => x.options.DefaultIfEmpty(),
|
||||
// (x, option) => new { x.ch, x.workshop, option })
|
||||
// .GroupJoin(_context.WorkshopEmployers.AsSplitQuery().Include(we => we.Employer),
|
||||
// result => result.workshop.id,
|
||||
// workshopEmployer => workshopEmployer.WorkshopId,
|
||||
// (result, workshopEmployer) => new { result.ch, result.workshop, result.option, workshopEmployer })
|
||||
// .SelectMany(
|
||||
// y => y.workshopEmployer.DefaultIfEmpty(),
|
||||
// (y, workshopEmployer) => new { y.option, y.ch, y.workshop, workshopEmployer })
|
||||
// .GroupJoin(
|
||||
// _context.PersonalContractingParties.Include(p => p.Employers),
|
||||
// secondResult => secondResult.workshopEmployer.Employer.id,
|
||||
// contractingParty => contractingParty.Employers.FirstOrDefault().id, // یا راه بهتر پایین
|
||||
// (secondResult, contractingParties) => new { secondResult, contractingParties }
|
||||
// )
|
||||
// .SelectMany(
|
||||
// x => x.contractingParties.DefaultIfEmpty(),
|
||||
// (x, contractingParty) => new
|
||||
// {
|
||||
// x.secondResult.workshopEmployer,
|
||||
// x.secondResult.workshop,
|
||||
// x.secondResult.option,
|
||||
// x.secondResult.ch,
|
||||
// contractingParty
|
||||
// }
|
||||
// );
|
||||
|
||||
var checkouts =
|
||||
_context.CheckoutSet.Where(x => workshopAcounts.Contains(x.WorkshopId) && x.IsActiveString == "true")
|
||||
_context.CheckoutSet.Where(x => workshopAcounts.Contains(x.WorkshopId))
|
||||
.Join(_context.Workshops.AsSplitQuery(),
|
||||
ch => ch.WorkshopId,
|
||||
workshop => workshop.id,
|
||||
@@ -1960,20 +1998,16 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
.SelectMany(
|
||||
y => y.workshopEmployer.DefaultIfEmpty(),
|
||||
(y, workshopEmployer) => new { y.option, y.ch, y.workshop, workshopEmployer })
|
||||
.Join(_context.PersonalContractingParties.AsSplitQuery().Include(p => p.Employers),
|
||||
|
||||
secondResult => secondResult.workshopEmployer.Employer.id,
|
||||
contractingParty => contractingParty.Employers.First().id,
|
||||
(secondResult, contractingParty) => new
|
||||
{
|
||||
secondResult.workshopEmployer,
|
||||
secondResult.workshop,
|
||||
secondResult.option,
|
||||
secondResult.ch,
|
||||
contractingParty,
|
||||
|
||||
});
|
||||
|
||||
.Select(x => new
|
||||
{
|
||||
x.ch,
|
||||
x.workshop,
|
||||
x.option,
|
||||
x.workshopEmployer,
|
||||
contractingParty = _context.PersonalContractingParties
|
||||
.Include(p => p.Employers)
|
||||
.FirstOrDefault(p => p.Employers.Any(e => e.id == x.workshopEmployer.Employer.id))
|
||||
});
|
||||
|
||||
#region SercheModel
|
||||
|
||||
|
||||
Reference in New Issue
Block a user