new manualdailywage metod to create contract
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.ContractAgg;
|
||||
@@ -13,6 +14,7 @@ using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
using CompanyManagment.App.Contracts.LeftWork;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using PersianTools.Core;
|
||||
using DateTime = System.DateTime;
|
||||
|
||||
@@ -40,6 +42,20 @@ public class ContractRepository : RepositoryBase<long, Contract>, IContractRepos
|
||||
_leftWorkRepository = leftWorkRepository;
|
||||
}
|
||||
|
||||
|
||||
public async Task<double> GetManualDailWage(long workshopId, long employeeId)
|
||||
{
|
||||
|
||||
var lastContract = await _context.Contracts
|
||||
.Where(x => x.WorkshopIds == workshopId && x.EmployeeId == employeeId && x.IsActiveString == "true")
|
||||
.OrderByDescending(x => x.ContarctStart)
|
||||
.FirstOrDefaultAsync();
|
||||
if (lastContract == null)
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public EditContract GetDetails(long id)
|
||||
{
|
||||
return _context.Contracts.Select(x => new EditContract
|
||||
|
||||
@@ -574,6 +574,8 @@ public class AutoExtensionModel : PageModel
|
||||
|
||||
var normaldailyWage = _yearlySalaryApplication.GetDailyWageByStartEnd(start, endOfMonthFromStart).GetAwaiter().GetResult();
|
||||
|
||||
//var contract = _contractApplication.SearchForCheckout()
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
|
||||
Reference in New Issue
Block a user