new manualdailywage metod to create contract

This commit is contained in:
SamSys
2025-08-21 15:55:53 +03:30
parent 856ed38f08
commit df1e6f62b8
2 changed files with 18 additions and 0 deletions

View File

@@ -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

View File

@@ -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,