Compare commits
29 Commits
Feature/In
...
Feature/ad
| Author | SHA1 | Date | |
|---|---|---|---|
| 230cde7c15 | |||
| 8acb25dd67 | |||
|
|
397280d0a2 | ||
| 5975a92aa1 | |||
| 0cec7c0cce | |||
| be6cb6430f | |||
| f863fb065f | |||
| 76aa1eae88 | |||
| d0b29e7643 | |||
| f1106deff9 | |||
| 94a5741906 | |||
| 221d06a0fc | |||
| 2b993fb746 | |||
|
|
5b3c7e471e | ||
|
|
330a3ca839 | ||
| 7c4cf1e2ed | |||
| 1d2c4f26f1 | |||
| 761ac352df | |||
| ecfb7af386 | |||
| 92fd8d6b0e | |||
| 4f68d141e8 | |||
| 75ea35596b | |||
| a0e2b969c0 | |||
| 8efffe8b75 | |||
| fdf7fa0d3c | |||
| 5cde26e7f3 | |||
| b448c43bb7 | |||
| 6045153865 | |||
| 5d16020c6a |
@@ -59,4 +59,5 @@ public interface IInstitutionContractRepository : IRepository<long, InstitutionC
|
||||
Task<InstitutionContractExtensionPlanResponse> GetExtensionInstitutionPlan(InstitutionContractExtensionPlanRequest request);
|
||||
Task<InstitutionContractExtensionPaymentResponse> GetExtensionPaymentMethod(InstitutionContractExtensionPaymentRequest request);
|
||||
Task<OperationResult> ExtensionComplete(InstitutionContractExtensionCompleteRequest request);
|
||||
Task<List<InstitutionContractSelectListViewModel>> GetInstitutionContractSelectList(string search, string selected);
|
||||
}
|
||||
@@ -17,7 +17,7 @@ public class InstitutionContract : EntityBase
|
||||
string contractEndFa, double contractAmount, double dailyCompenseation, double obligation,
|
||||
double totalAmount, int extensionNo, string workshopManualCount, string employeeManualCount, string description,
|
||||
string officialCompany, string typeOfcontract, string hasValueAddedTax, double valueAddedTax,
|
||||
List<InstitutionContractWorkshopInitial> workshopDetails)
|
||||
List<InstitutionContractWorkshopInitial> workshopDetails, long lawId)
|
||||
{
|
||||
ContractNo = contractNo;
|
||||
RepresentativeId = representativeId;
|
||||
@@ -54,8 +54,11 @@ public class InstitutionContract : EntityBase
|
||||
Installments = [];
|
||||
WorkshopGroup = new InstitutionContractWorkshopGroup(id, workshopDetails);
|
||||
PublicId = Guid.NewGuid();
|
||||
LawId = lawId;
|
||||
}
|
||||
|
||||
public long LawId { get; private set; }
|
||||
|
||||
public string ContractNo { get; private set; }
|
||||
|
||||
public long RepresentativeId { get; private set; }
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace Company.Domain.LawAgg
|
||||
public LawType Type { get; private set; }
|
||||
public string HeadTitle { get; private set; }
|
||||
public string NotificationsJson { get; private set; }
|
||||
public int Version { get; private set; }
|
||||
|
||||
[NotMapped]
|
||||
public List<string> Notifications
|
||||
@@ -26,14 +27,15 @@ namespace Company.Domain.LawAgg
|
||||
set => NotificationsJson = JsonSerializer.Serialize(value);
|
||||
}
|
||||
|
||||
public Law(string title, LawType lawType, List<string> notifications, string headTitle )
|
||||
public Law(string title, LawType lawType, List<string> notifications, string headTitle, int version = 1)
|
||||
{
|
||||
Title = title;
|
||||
IsActive = true;
|
||||
IsActive = true; // آخرین نسخه فعال است
|
||||
Items = new List<LawItem>();
|
||||
Type = lawType;
|
||||
Notifications = notifications ?? new List<string>();
|
||||
HeadTitle = headTitle;
|
||||
Version = version;
|
||||
}
|
||||
|
||||
public void Edit(string title)
|
||||
@@ -46,7 +48,6 @@ namespace Company.Domain.LawAgg
|
||||
Items.Add(new LawItem(header, details, orderNumber));
|
||||
}
|
||||
|
||||
|
||||
public void SetItem(List<LawItem> items)
|
||||
{
|
||||
Items = items ?? new List<LawItem>();
|
||||
@@ -67,6 +68,32 @@ namespace Company.Domain.LawAgg
|
||||
{
|
||||
IsActive = false;
|
||||
}
|
||||
|
||||
public void SetAsLatestVersion()
|
||||
{
|
||||
IsActive = true;
|
||||
}
|
||||
|
||||
public void SetAsOldVersion()
|
||||
{
|
||||
IsActive = false;
|
||||
}
|
||||
|
||||
public Law CreateNewVersion(string title, List<string> notifications, string headTitle, List<LawItem> items)
|
||||
{
|
||||
var newVersion = new Law(
|
||||
title,
|
||||
this.Type,
|
||||
notifications,
|
||||
headTitle,
|
||||
this.Version + 1
|
||||
);
|
||||
|
||||
newVersion.SetItem(items);
|
||||
newVersion.SetAsLatestVersion();
|
||||
|
||||
return newVersion;
|
||||
}
|
||||
}
|
||||
|
||||
public class LawItem
|
||||
|
||||
@@ -70,6 +70,7 @@ public interface IWorkshopRepository : IRepository<long, Workshop>
|
||||
Task<List<WorkshopWithLeftWorkTempEmployeesDto>> GetWorkshopsForLeftWorkTemp(long accountId);
|
||||
Task<int> GetWorkshopsForLeftWorkTempCount(long accountId);
|
||||
Task<List<WorkshopSelectListViewModel>> GetSelectList(string search, long id);
|
||||
int GetLastArchiveCode();
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.AccessControl;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
using Company.Domain.ContarctingPartyAgg;
|
||||
using Company.Domain.ContractAgg;
|
||||
@@ -66,6 +68,11 @@ public class Employer : EntityBase
|
||||
public string SanaPassword { get; private set; }
|
||||
|
||||
public string EmployerNo { get; set; }
|
||||
public bool IsAuth { get; set; }
|
||||
public string IdNumberSerial { get; set; }
|
||||
|
||||
public string IdNumberSeri { get; set; }
|
||||
|
||||
public PersonalContractingParty ContractingParty { get; set; }
|
||||
|
||||
//public List<Workshop> Workshops { get; private set; }
|
||||
@@ -227,4 +234,35 @@ public class Employer : EntityBase
|
||||
this.IsActive = false;
|
||||
this.Address = "false";
|
||||
}
|
||||
|
||||
public void Authentication(string fName, string lName, string fatherName,string idNumber,
|
||||
string idNumberSeri, string idNumberSerial, string dateOfBirth, Gender gender,string phone)
|
||||
{
|
||||
this.FName = fName;
|
||||
this.LName = lName;
|
||||
this.FatherName = fatherName;
|
||||
this.IdNumberSeri = idNumberSeri;
|
||||
this.IdNumberSerial = idNumberSerial;
|
||||
this.DateOfBirth = !string.IsNullOrWhiteSpace(dateOfBirth) ? dateOfBirth.ToGeorgianDateTime() : new();
|
||||
this.IdNumber = idNumber;
|
||||
this.Gender = gender == _0_Framework.Application.Gender.Male? "مرد" : "زن";
|
||||
this.IsAuth = true;
|
||||
Phone = phone;
|
||||
}
|
||||
|
||||
|
||||
public void LegalAuthentication(string fName, string lName, string fatherName,string idNumber, string idNumberSeri,
|
||||
string idNumberSerial, string dateOfBirth, Gender gender,string phone)
|
||||
{
|
||||
FName = fName;
|
||||
EmployerLName = lName;
|
||||
this.FatherName = fatherName;
|
||||
this.IdNumberSeri = idNumberSeri;
|
||||
this.IdNumberSerial = idNumberSerial;
|
||||
this.DateOfBirth = !string.IsNullOrWhiteSpace(dateOfBirth) ? dateOfBirth.ToGeorgianDateTime() : new();
|
||||
this.IdNumber = idNumber;
|
||||
this.Gender =gender == _0_Framework.Application.Gender.Male? "مرد" : "زن";
|
||||
this.IsAuth = true;
|
||||
Phone = phone;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Company.Domain.empolyerAgg;
|
||||
|
||||
@@ -34,7 +36,7 @@ public interface IEmployerRepository : IRepository<long, Employer>
|
||||
|
||||
List<EmployerViewModel> GetEmployersHasWorkshop();
|
||||
|
||||
Task<List<EmployerSelectListViewModel>> GetSelectList(string search,long id);
|
||||
Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id, LegalType? legalType);
|
||||
|
||||
|
||||
#endregion
|
||||
@@ -68,5 +70,5 @@ public interface IEmployerRepository : IRepository<long, Employer>
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
Task<ActionResult<EditEmployerWorkflowRegistration>> GetWorkflowRegistrationForEdit(long employerId, long institutionWorkshopDetailsId);
|
||||
}
|
||||
@@ -6,6 +6,7 @@ using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Employer;
|
||||
@@ -46,8 +47,9 @@ public interface IEmployerApplication
|
||||
/// </summary>
|
||||
/// <param name="search"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="legalType"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id);
|
||||
Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id, LegalType? legalType = null);
|
||||
|
||||
#endregion
|
||||
#region NewByHeydari
|
||||
@@ -145,6 +147,7 @@ public interface IEmployerApplication
|
||||
Task<OperationResult> DeleteWorkflowRegistration(long employerId, long institutionWorkshopDetailsId);
|
||||
|
||||
Task<OperationResult<AuthenticateUserViewModel>> AuthenticateEmployer(string nationalCode, string dateOfBirth, string mobile);
|
||||
Task<ActionResult<EditEmployerWorkflowRegistration>> GetWorkflowRegistrationForEdit(long employerId, long institutionWorkshopDetailsId);
|
||||
}
|
||||
|
||||
public class AuthenticateUserViewModel
|
||||
@@ -207,6 +210,11 @@ public class AuthenticateUserViewModel
|
||||
/// </summary>
|
||||
public class CreateEmployerWorkflowRegistration
|
||||
{
|
||||
/// <summary>
|
||||
/// درزمانی که یوزر کارفرمایی رو انتخاب کرد که از قبل ثبت شده است
|
||||
/// این فیلد باید مقدار داشته باشد
|
||||
/// </summary>
|
||||
public long EmployerId { get; set; }
|
||||
/// <summary>
|
||||
/// اطلاعات کارفرمای حقیقی
|
||||
/// </summary>
|
||||
@@ -323,7 +331,9 @@ public class CreateLegalEmployerWorkflowRegistration
|
||||
/// اطلاعات سیستم دولتی
|
||||
/// </summary>
|
||||
public GovernmentSystemInfo GovernmentSystemInfo { get; set; }
|
||||
|
||||
|
||||
public string IdNumberSeri { get; set; }
|
||||
public string IdNumberSerial { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -395,6 +405,9 @@ public class CreateRealEmployerWorkflowRegistration
|
||||
/// شماره تلفن
|
||||
/// </summary>
|
||||
public string Telephone { get; set; }
|
||||
|
||||
public string IdNumberSeri { get; set; }
|
||||
public string IdNumberSerial { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -8,6 +8,7 @@ namespace CompanyManagment.App.Contracts.InstitutionContract;
|
||||
|
||||
public class CreateInstitutionContract
|
||||
{
|
||||
public long LawId { get; set; }
|
||||
public string ContractNo { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "انتخاب معرف اجباری است")]
|
||||
|
||||
@@ -100,6 +100,8 @@ public class CreateInstitutionContractRequest
|
||||
public double TaxAmount { get; set; }
|
||||
|
||||
public double OneMonthAmount { get; set; }
|
||||
|
||||
public long LawId { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// مدت زمان قرارداد نهاد
|
||||
|
||||
@@ -219,8 +219,11 @@ public interface IInstitutionContractApplication
|
||||
InstitutionContractExtensionPaymentRequest request);
|
||||
|
||||
Task<OperationResult> ExtensionComplete(InstitutionContractExtensionCompleteRequest request);
|
||||
Task<List<InstitutionContractSelectListViewModel>> GetInstitutionContractSelectList(string search,string selected);
|
||||
}
|
||||
|
||||
public class InstitutionContractSelectListViewModel : SelectListViewModel;
|
||||
|
||||
public class InstitutionContractExtensionInquiryResponse
|
||||
{
|
||||
public long Id { get; set; }
|
||||
@@ -242,6 +245,7 @@ public class InstitutionContractExtensionCompleteRequest
|
||||
{
|
||||
public Guid TemporaryId { get; set; }
|
||||
public bool IsInstallment { get; set; }
|
||||
public long LawId { get; set; }
|
||||
}
|
||||
|
||||
public class InstitutionContractExtensionPaymentResponse
|
||||
|
||||
@@ -3,4 +3,6 @@ namespace CompanyManagment.App.Contracts.InstitutionContract;
|
||||
public class InstitutionContractWorkshopDetailViewModel
|
||||
{
|
||||
public WorkshopServicesViewModel ServicesViewModel { get; set; }
|
||||
public string WorkshopName { get; set; }
|
||||
public int ArchiveCode { get; set; }
|
||||
}
|
||||
@@ -14,6 +14,7 @@ namespace CompanyManagment.App.Contracts.Law
|
||||
public LawType Type { get; set; }
|
||||
public string HeadTitle { get; set; }
|
||||
public List<string> Notifications { get; set; }
|
||||
public int Version { get; set; }
|
||||
}
|
||||
|
||||
public class LawItemViewModel
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.AccessControl;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using _0_Framework.Application.UID;
|
||||
@@ -13,6 +14,7 @@ using Company.Domain.WorkshopAgg;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
using CompanyManagment.EFCore.Repository;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Identity.Client;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
@@ -42,7 +44,6 @@ public class EmployerApplication : IEmployerApplication
|
||||
}
|
||||
|
||||
|
||||
|
||||
public OperationResult Active(long id)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
@@ -1029,7 +1030,7 @@ public class EmployerApplication : IEmployerApplication
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Api
|
||||
|
||||
public async Task<List<GetEmployerListViewModel>> GetEmployerList(GetEmployerSearchModel searchModel)
|
||||
@@ -1285,9 +1286,10 @@ public class EmployerApplication : IEmployerApplication
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
public async Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id)
|
||||
public async Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id,
|
||||
LegalType? legalType = null)
|
||||
{
|
||||
return await _EmployerRepository.GetSelectList(search, id);
|
||||
return await _EmployerRepository.GetSelectList(search, id, legalType);
|
||||
}
|
||||
|
||||
async Task<OperationResult<string>> IEmployerApplication.Remove(long id)
|
||||
@@ -1312,19 +1314,32 @@ public class EmployerApplication : IEmployerApplication
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
var tranasction = await _EmployerRepository.BeginTransactionAsync();
|
||||
OperationResult<Employer> createEmployerResult = command.LegalType switch
|
||||
Employer employer;
|
||||
if (command.EmployerId != 0)
|
||||
{
|
||||
LegalType.Real => await CreateRealEmployerRegistration(command.RealEmployer, command.ContractingPartyId),
|
||||
LegalType.Legal => await CreateLegalEmployerRegistration(command.LegalEmployer, command.ContractingPartyId),
|
||||
_ => throw new ArgumentOutOfRangeException()
|
||||
};
|
||||
var employer = createEmployerResult.Data;
|
||||
employer = _EmployerRepository.Get(command.EmployerId);
|
||||
if (employer == null)
|
||||
throw new NotFoundException("کارفرمای مورد نظر یافت نشد");
|
||||
}
|
||||
else
|
||||
{
|
||||
OperationResult<Employer> createEmployerResult = command.LegalType switch
|
||||
{
|
||||
LegalType.Real =>
|
||||
await CreateRealEmployerRegistration(command.RealEmployer, command.ContractingPartyId),
|
||||
LegalType.Legal => await CreateLegalEmployerRegistration(command.LegalEmployer,
|
||||
command.ContractingPartyId),
|
||||
_ => throw new ArgumentOutOfRangeException()
|
||||
};
|
||||
employer = createEmployerResult.Data;
|
||||
|
||||
if (!createEmployerResult.IsSuccedded)
|
||||
return operation.Failed(createEmployerResult.Message);
|
||||
if (!createEmployerResult.IsSuccedded)
|
||||
return operation.Failed(createEmployerResult.Message);
|
||||
}
|
||||
|
||||
var workshopDetails =
|
||||
await _institutionContractRepository.GetInstitutionWorkshopInitialDetails(command.InstitutionWorkshopInitialId);
|
||||
await _institutionContractRepository.GetInstitutionWorkshopInitialDetails(command
|
||||
.InstitutionWorkshopInitialId);
|
||||
workshopDetails.AddEmployer(employer.id);
|
||||
|
||||
await _institutionContractRepository.SaveChangesAsync();
|
||||
@@ -1335,7 +1350,7 @@ public class EmployerApplication : IEmployerApplication
|
||||
public async Task<OperationResult> EditWorkflowRegistration(EditEmployerWorkflowRegistration command)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
|
||||
|
||||
// Get the existing employer
|
||||
var employer = _EmployerRepository.Get(command.EmployerId);
|
||||
if (employer == null)
|
||||
@@ -1364,55 +1379,56 @@ public class EmployerApplication : IEmployerApplication
|
||||
public async Task<OperationResult> DeleteWorkflowRegistration(long employerId, long institutionWorkshopDetailsId)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
|
||||
|
||||
// Check if employer exists
|
||||
var employer = _EmployerRepository.Get(employerId);
|
||||
if (employer == null)
|
||||
return operation.Failed("کارفرمای مورد نظر یافت نشد");
|
||||
|
||||
|
||||
// Get workshop details
|
||||
var workshopDetails = await _institutionContractRepository.GetInstitutionWorkshopInitialDetails(institutionWorkshopDetailsId);
|
||||
var workshopDetails =
|
||||
await _institutionContractRepository.GetInstitutionWorkshopInitialDetails(institutionWorkshopDetailsId);
|
||||
if (workshopDetails == null)
|
||||
return operation.Failed("جزئیات کارگاه موسسه یافت نشد");
|
||||
|
||||
|
||||
// Find and remove the employer from workshop details
|
||||
var employerDetail = workshopDetails.Employers.FirstOrDefault(e => e.EmployerId == employerId);
|
||||
if (employerDetail == null)
|
||||
return operation.Failed("کارفرما در لیست کارگاه یافت نشد");
|
||||
|
||||
|
||||
// Remove the employer from the list
|
||||
workshopDetails.Employers.Remove(employerDetail);
|
||||
|
||||
|
||||
await _institutionContractRepository.SaveChangesAsync();
|
||||
|
||||
|
||||
// Delete the employer
|
||||
_EmployerRepository.Remove(employerId);
|
||||
await _EmployerRepository.SaveChangesAsync();
|
||||
|
||||
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
|
||||
public async Task<OperationResult<AuthenticateUserViewModel>> AuthenticateEmployer(string nationalCode,
|
||||
string dateOfBirth,
|
||||
string mobile)
|
||||
{
|
||||
var op = new OperationResult<AuthenticateUserViewModel>();
|
||||
|
||||
|
||||
var dateOfBirthGr = dateOfBirth.ToGeorgianDateTime();
|
||||
|
||||
|
||||
var isMachMobilAndNationalCode = await _uidService.IsMachPhoneWithNationalCode(nationalCode, mobile);
|
||||
if (isMachMobilAndNationalCode == null)
|
||||
return op.Failed("خطا در سرویس احراز هویت");
|
||||
if (!isMachMobilAndNationalCode.IsMatched)
|
||||
return op.Failed("شماره همراه وارد شده با کد ملی مطابقت ندارد");
|
||||
var apiRespons = await _uidService.GetPersonalInfo(nationalCode, dateOfBirth);
|
||||
|
||||
|
||||
if (apiRespons == null)
|
||||
throw new InternalServerException("سیستم احراز هویت در دسترس نمی باشد");
|
||||
|
||||
if (apiRespons.ResponseContext.Status.Code ==14)
|
||||
|
||||
if (apiRespons.ResponseContext.Status.Code == 14)
|
||||
throw new InternalServerException("سیستم احراز هویت در دسترس نمی باشد");
|
||||
|
||||
|
||||
if (apiRespons.ResponseContext.Status.Code != 0)
|
||||
return op.Failed($"{apiRespons.ResponseContext.Status.Message}");
|
||||
|
||||
@@ -1420,6 +1436,7 @@ public class EmployerApplication : IEmployerApplication
|
||||
? apiRespons.IdentificationInformation.NationalId
|
||||
: apiRespons.IdentificationInformation.ShenasnamehNumber;
|
||||
|
||||
|
||||
var res = new AuthenticateUserViewModel()
|
||||
{
|
||||
DateOfBirth = dateOfBirth,
|
||||
@@ -1436,6 +1453,12 @@ public class EmployerApplication : IEmployerApplication
|
||||
return op.Succcedded(res);
|
||||
}
|
||||
|
||||
public Task<ActionResult<EditEmployerWorkflowRegistration>> GetWorkflowRegistrationForEdit(long employerId,
|
||||
long institutionWorkshopDetailsId)
|
||||
{
|
||||
return _EmployerRepository.GetWorkflowRegistrationForEdit(employerId, institutionWorkshopDetailsId);
|
||||
}
|
||||
|
||||
private async Task<OperationResult<Employer>> CreateLegalEmployerRegistration(
|
||||
CreateLegalEmployerWorkflowRegistration command, long contractingPartyId)
|
||||
{
|
||||
@@ -1502,6 +1525,11 @@ public class EmployerApplication : IEmployerApplication
|
||||
command.GovernmentSystemInfo.EServiceUsername, command.GovernmentSystemInfo.EServicePassword,
|
||||
command.GovernmentSystemInfo.TaxUsername, command.GovernmentSystemInfo.TaxPassword,
|
||||
command.GovernmentSystemInfo.SanaUsername, command.GovernmentSystemInfo.SanaPassword);
|
||||
if (command.IsAuth)
|
||||
{
|
||||
legalEmployerData.LegalAuthentication(command.CeoFName,command.CeoLName,command.CeoFatherName,
|
||||
command.CeoIdNumber,command.IdNumberSeri,command.IdNumberSerial,command.CeoDateOfBirth,command.Gender,command.PhoneNumber);
|
||||
}
|
||||
|
||||
await _EmployerRepository.CreateAsync(legalEmployerData);
|
||||
await _EmployerRepository.SaveChangesAsync();
|
||||
@@ -1555,6 +1583,12 @@ public class EmployerApplication : IEmployerApplication
|
||||
command.GovernmentSystemInfo.EServicePassword,
|
||||
command.GovernmentSystemInfo.TaxUsername, command.GovernmentSystemInfo.TaxPassword,
|
||||
command.GovernmentSystemInfo.SanaUsername, command.GovernmentSystemInfo.SanaPassword);
|
||||
if (command.IsAuth)
|
||||
{
|
||||
employerData.Authentication(command.FName, command.LName, command.FatherName, command.IdNumber,
|
||||
command.IdNumberSeri,
|
||||
command.IdNumberSerial, command.DateOfBirth, command.Gender, command.PhoneNumber);
|
||||
}
|
||||
|
||||
await _EmployerRepository.CreateAsync(employerData);
|
||||
await _EmployerRepository.SaveChangesAsync();
|
||||
@@ -1664,5 +1698,6 @@ public class EmployerApplication : IEmployerApplication
|
||||
await _EmployerRepository.SaveChangesAsync();
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -209,7 +209,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
command.ContractStartFa, contractEndGr, command.ContractEndFa, command.ContractAmount,
|
||||
command.DailyCompenseation, command.Obligation,
|
||||
command.TotalAmount, 0, command.WorkshopManualCount, command.EmployeeManualCount, command.Description,
|
||||
command.OfficialCompany, command.TypeOfContract, command.HasValueAddedTax, command.ValueAddedTax, []);
|
||||
command.OfficialCompany, command.TypeOfContract, command.HasValueAddedTax, command.ValueAddedTax, [],command.LawId);
|
||||
|
||||
_institutionContractRepository.Create(createContract);
|
||||
_institutionContractRepository.SaveChanges();
|
||||
@@ -318,7 +318,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
command.DailyCompenseation, command.Obligation,
|
||||
command.TotalAmount, command.ExtensionNo, command.WorkshopManualCount, command.EmployeeManualCount,
|
||||
command.Description, command.OfficialCompany, command.TypeOfContract, command.HasValueAddedTax,
|
||||
command.ValueAddedTax, []);
|
||||
command.ValueAddedTax, [],command.LawId);
|
||||
|
||||
_institutionContractRepository.Create(createContract);
|
||||
_institutionContractRepository.SaveChanges();
|
||||
@@ -1046,7 +1046,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
command.Workshops.Count.ToString(),
|
||||
command.Workshops.Sum(x => x.PersonnelCount).ToString(), command.Description,
|
||||
"NotOfficial", "JobRelation", hasValueAddedTax,
|
||||
command.TaxAmount, workshopDetails);
|
||||
command.TaxAmount, workshopDetails,command.LawId);
|
||||
|
||||
|
||||
FinancialStatment financialStatement;
|
||||
@@ -1259,6 +1259,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
{
|
||||
var details = await _institutionContractRepository.GetInstitutionWorkshopInitialDetails(workshopDetailsId);
|
||||
var services = details.Services;
|
||||
var newArchiveCode = _workshopRepository.GetLastArchiveCode() + 1;
|
||||
|
||||
var res = new InstitutionContractWorkshopDetailViewModel()
|
||||
{
|
||||
@@ -1271,7 +1272,9 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
InsuranceInPerson = services.InsuranceInPerson,
|
||||
RollCall = services.RollCall,
|
||||
RollCallInPerson = services.RollCallInPerson
|
||||
}
|
||||
},
|
||||
WorkshopName = details.WorkshopName,
|
||||
ArchiveCode =newArchiveCode
|
||||
};
|
||||
return res;
|
||||
}
|
||||
@@ -1301,6 +1304,11 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
{
|
||||
return await _institutionContractRepository.ExtensionComplete(request);
|
||||
}
|
||||
|
||||
public async Task<List<InstitutionContractSelectListViewModel>> GetInstitutionContractSelectList(string search, string selected)
|
||||
{
|
||||
return await _institutionContractRepository.GetInstitutionContractSelectList(search,selected);
|
||||
}
|
||||
|
||||
|
||||
private async Task<OperationResult<PersonalContractingParty>> CreateLegalContractingPartyEntity(
|
||||
|
||||
@@ -20,9 +20,16 @@ public class LawApplication : ILawApplication
|
||||
public OperationResult Create(CreateLaw command)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
if (_lawRepository.Exists(x => x.Type == command.Type))
|
||||
|
||||
// قبل از ایجاد قانون جدید، همه قوانین قدیمی از این نوع را غیرفعال میکنیم
|
||||
var existingLaws = _lawRepository.Get().Where(x => x.Type == command.Type).ToList();
|
||||
if (existingLaws.Any())
|
||||
{
|
||||
return operation.Failed("این قانون قبلا ثبت شده است");
|
||||
foreach (var existingLaw in existingLaws)
|
||||
{
|
||||
existingLaw.Deactivate();
|
||||
}
|
||||
_lawRepository.SaveChanges();
|
||||
}
|
||||
|
||||
var law = new Law(command.Title, command.Type, command.Notifications, command.HeadTitle);
|
||||
@@ -56,6 +63,8 @@ public class LawApplication : ILawApplication
|
||||
{
|
||||
return operation.Failed("باید حداقل یک بند برای قانون باید ثبت شود");
|
||||
}
|
||||
|
||||
// Create new items list for the new version
|
||||
var orderNumber = 1;
|
||||
var lawItems = command.Items.Select(x =>
|
||||
{
|
||||
@@ -63,12 +72,17 @@ public class LawApplication : ILawApplication
|
||||
orderNumber++;
|
||||
return res;
|
||||
}).ToList();
|
||||
|
||||
law.Edit(command.Title);
|
||||
|
||||
law.SetItem(lawItems);
|
||||
|
||||
|
||||
// Mark the current version as old version
|
||||
law.SetAsOldVersion();
|
||||
|
||||
// Create a new version based on the old one
|
||||
var newVersion = law.CreateNewVersion(command.Title, command.Notifications, command.HeadTitle, lawItems);
|
||||
|
||||
// Save the new version
|
||||
_lawRepository.Create(newVersion);
|
||||
_lawRepository.SaveChanges();
|
||||
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
@@ -82,13 +96,13 @@ public class LawApplication : ILawApplication
|
||||
return operation.Failed("باید حداقل یک بند برای قانون باید ثبت شود");
|
||||
}
|
||||
|
||||
// Check if law exists by type
|
||||
var existingLaw = _lawRepository.Get().FirstOrDefault(x => x.Type == command.Type);
|
||||
// Check if active law exists by type
|
||||
var existingLaw = _lawRepository.Get().FirstOrDefault(x => x.Type == command.Type && x.IsActive);
|
||||
|
||||
if (existingLaw == null)
|
||||
{
|
||||
// If law doesn't exist, create a new one
|
||||
var law = new Law(command.Title, command.Type,command.Notifications, command.HeadTitle);
|
||||
var law = new Law(command.Title, command.Type, command.Notifications, command.HeadTitle);
|
||||
|
||||
var orderNumber = 1;
|
||||
foreach (var item in command.Items)
|
||||
@@ -102,7 +116,10 @@ public class LawApplication : ILawApplication
|
||||
}
|
||||
else
|
||||
{
|
||||
// If law exists, update it
|
||||
// Mark the current version as old version
|
||||
existingLaw.SetAsOldVersion();
|
||||
|
||||
// Create new items list for the new version
|
||||
var orderNumber = 1;
|
||||
var lawItems = command.Items.Select(x =>
|
||||
{
|
||||
@@ -111,9 +128,11 @@ public class LawApplication : ILawApplication
|
||||
return res;
|
||||
}).ToList();
|
||||
|
||||
existingLaw.Edit(command.Title);
|
||||
existingLaw.SetItem(lawItems);
|
||||
// Create a new version based on the old one
|
||||
var newVersion = existingLaw.CreateNewVersion(command.Title, command.Notifications, command.HeadTitle, lawItems);
|
||||
|
||||
// Save the new version
|
||||
_lawRepository.Create(newVersion);
|
||||
_lawRepository.SaveChanges();
|
||||
}
|
||||
|
||||
@@ -128,8 +147,17 @@ public class LawApplication : ILawApplication
|
||||
if (law == null)
|
||||
return operation.Failed(ApplicationMessages.RecordNotFound);
|
||||
|
||||
// غیرفعال کردن همه نسخههای قبلی از این نوع قانون
|
||||
var otherLaws = _lawRepository.Get().Where(x => x.Type == law.Type && x.id != law.id).ToList();
|
||||
foreach (var otherLaw in otherLaws)
|
||||
{
|
||||
otherLaw.Deactivate();
|
||||
}
|
||||
|
||||
// فعال کردن این نسخه به عنوان آخرین نسخه
|
||||
law.Activate();
|
||||
_lawRepository.SaveChanges();
|
||||
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
@@ -149,9 +177,11 @@ public class LawApplication : ILawApplication
|
||||
public OperationResult ActivateByType(LawType type)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
var law = _lawRepository.Get().FirstOrDefault(x => x.Type == type);
|
||||
|
||||
if (law == null)
|
||||
|
||||
// غیرفعال کردن همه نسخههای قبلی از این نوع قانون
|
||||
var existingLaws = _lawRepository.Get().Where(x => x.Type == type).ToList();
|
||||
|
||||
if (!existingLaws.Any())
|
||||
{
|
||||
// If law doesn't exist, create a new active one with default values
|
||||
var newLaw = new Law(GetDefaultTitleForLawType(type), type, new List<string>(), "");
|
||||
@@ -160,21 +190,36 @@ public class LawApplication : ILawApplication
|
||||
_lawRepository.SaveChanges();
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
law.Activate();
|
||||
|
||||
// فعال کردن آخرین نسخه (با بالاترین شماره نسخه)
|
||||
var latestVersion = existingLaws.OrderByDescending(x => x.Version).First();
|
||||
|
||||
// غیرفعال کردن سایر نسخهها
|
||||
foreach (var law in existingLaws.Where(x => x.id != latestVersion.id))
|
||||
{
|
||||
law.Deactivate();
|
||||
}
|
||||
|
||||
// فعال کردن آخرین نسخه
|
||||
latestVersion.Activate();
|
||||
_lawRepository.SaveChanges();
|
||||
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
public OperationResult DeactivateByType(LawType type)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
var law = _lawRepository.Get().FirstOrDefault(x => x.Type == type);
|
||||
var laws = _lawRepository.Get().Where(x => x.Type == type).ToList();
|
||||
|
||||
if (law == null)
|
||||
if (!laws.Any())
|
||||
return operation.Failed("قانون مورد نظر یافت نشد");
|
||||
|
||||
law.Deactivate();
|
||||
foreach (var law in laws)
|
||||
{
|
||||
law.Deactivate();
|
||||
}
|
||||
|
||||
_lawRepository.SaveChanges();
|
||||
return operation.Succcedded();
|
||||
}
|
||||
@@ -187,6 +232,8 @@ public class LawApplication : ILawApplication
|
||||
Id = law.id,
|
||||
Title = law.Title,
|
||||
Type = law.Type,
|
||||
HeadTitle = law.HeadTitle,
|
||||
Notifications = law.Notifications,
|
||||
Items = law.Items.OrderBy(x => x.OrderNumber).Select(x => new LawItemViewModel
|
||||
{
|
||||
Header = x.Header,
|
||||
@@ -197,10 +244,8 @@ public class LawApplication : ILawApplication
|
||||
|
||||
public async Task<List<LawViewModel>> GetList(LawSearchModel searchModel)
|
||||
{
|
||||
// Get filtered laws from database
|
||||
// Get all laws from database, including version information
|
||||
return await _lawRepository.GetList(searchModel);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private string GetDefaultTitleForLawType(LawType lawType)
|
||||
@@ -225,6 +270,9 @@ public class LawApplication : ILawApplication
|
||||
IsActive = law.IsActive,
|
||||
CreatedAt = law.CreationDate,
|
||||
Type = law.Type,
|
||||
HeadTitle = law.HeadTitle,
|
||||
Notifications = law.Notifications,
|
||||
Version = law.Version,
|
||||
Items = law.Items.OrderBy(x=>x.OrderNumber).Select(x => new LawItemViewModel
|
||||
{
|
||||
Header = x.Header,
|
||||
@@ -235,6 +283,7 @@ public class LawApplication : ILawApplication
|
||||
|
||||
public async Task<LawViewModel> GetLawByType(LawType type)
|
||||
{
|
||||
// Only get the active (latest) version of the law
|
||||
var lawViewModel = await _lawRepository.GetByType(type);
|
||||
|
||||
// If no law exists for this type, return a default empty law
|
||||
@@ -247,6 +296,7 @@ public class LawApplication : ILawApplication
|
||||
IsActive = false,
|
||||
CreatedAt = DateTime.Now,
|
||||
Type = type,
|
||||
Version = 1,
|
||||
Items = new List<LawItemViewModel>()
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1048,7 +1048,7 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
|
||||
var institutionContract =
|
||||
await _institutionContractRepository.GetIncludeWorkshopDetailsAsync(contractWorkshopInitial
|
||||
.InstitutionContractId);
|
||||
.WorkshopGroup.InstitutionContractId);
|
||||
if (institutionContract == null)
|
||||
{
|
||||
return operation.Failed("قرارداد مالی موسسه یافت نشد");
|
||||
|
||||
10962
CompanyManagment.EFCore/Migrations/20251013055841_Add Law Id to institutionContract.Designer.cs
generated
Normal file
10962
CompanyManagment.EFCore/Migrations/20251013055841_Add Law Id to institutionContract.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,40 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddLawIdtoinstitutionContract : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "Version",
|
||||
table: "Law",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "LawId",
|
||||
table: "InstitutionContracts",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
defaultValue: 0L);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Version",
|
||||
table: "Law");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LawId",
|
||||
table: "InstitutionContracts");
|
||||
}
|
||||
}
|
||||
}
|
||||
10971
CompanyManagment.EFCore/Migrations/20251014082438_add authenticate columns to employer.Designer.cs
generated
Normal file
10971
CompanyManagment.EFCore/Migrations/20251014082438_add authenticate columns to employer.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,49 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addauthenticatecolumnstoemployer : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "IdNumberSeri",
|
||||
table: "Employers",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "IdNumberSerial",
|
||||
table: "Employers",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsAuth",
|
||||
table: "Employers",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IdNumberSeri",
|
||||
table: "Employers");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IdNumberSerial",
|
||||
table: "Employers");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsAuth",
|
||||
table: "Employers");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3130,6 +3130,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<bool>("IsInstallment")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<long>("LawId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<double>("Obligation")
|
||||
.HasColumnType("float");
|
||||
|
||||
@@ -4073,6 +4076,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<int>("Version")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("Law", (string)null);
|
||||
@@ -6773,9 +6779,18 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("IdNumberSeri")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("IdNumberSerial")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsAuth")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("IsLegal")
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -266,8 +266,6 @@ public class FinancialStatmentRepository : RepositoryBase<long, FinancialStatmen
|
||||
|
||||
public async Task<FinancialStatmentDetailsByContractingPartyViewModel> GetDetailsByContractingParty(long contractingPartyId,FinancialStatementSearchModel searchModel)
|
||||
{
|
||||
|
||||
|
||||
var financialStatement = await _context.FinancialStatments
|
||||
.Include(x=>x.FinancialTransactionList)
|
||||
.FirstOrDefaultAsync(x=>x.ContractingPartyId == contractingPartyId);
|
||||
@@ -323,6 +321,70 @@ public class FinancialStatmentRepository : RepositoryBase<long, FinancialStatmen
|
||||
}
|
||||
#endregion
|
||||
double balance = 0;
|
||||
// var list = financialStatement.FinancialTransactionList.Select(t =>
|
||||
// {
|
||||
// if (!searched)
|
||||
// {
|
||||
// if (t.TypeOfTransaction == "debt")
|
||||
// {
|
||||
// balance += t.Deptor;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// balance -= t.Creditor;
|
||||
// }
|
||||
// }
|
||||
// return new FinancialTransactionDetailViewModel()
|
||||
// {
|
||||
// Id = t.id,
|
||||
// DateTimeGr = t.TdateGr,
|
||||
// DateFa = t.TdateGr.ToFarsi(),
|
||||
// TimeFa = $"{t.TdateGr:HH:mm}",
|
||||
// Description = t.DescriptionOption + " " + t.Description,
|
||||
// Debtor = t.Deptor,
|
||||
// Creditor = t.Creditor,
|
||||
// Balance = balance,
|
||||
// Type = t.TypeOfTransaction == "debt"
|
||||
// ? FinancialTransactionType.Debt
|
||||
// : FinancialTransactionType.Credit,
|
||||
// TypeStr = t.TypeOfTransaction == "debt" ? "ایجاد درآمد" : "دریافت درآمد"
|
||||
// };
|
||||
// }).OrderByDescending(t => t.DateTimeGr).ToList();
|
||||
|
||||
|
||||
var list = new List<FinancialTransactionDetailViewModel>();
|
||||
foreach (var financialTransaction in financialStatement.FinancialTransactionList.OrderBy(t=>t.TdateGr))
|
||||
{
|
||||
if (!searched)
|
||||
{
|
||||
if (financialTransaction.TypeOfTransaction == "debt")
|
||||
{
|
||||
balance += financialTransaction.Deptor;
|
||||
}
|
||||
else
|
||||
{
|
||||
balance -= financialTransaction.Creditor;
|
||||
}
|
||||
}
|
||||
var item = new FinancialTransactionDetailViewModel()
|
||||
{
|
||||
Id = financialTransaction.id,
|
||||
DateTimeGr = financialTransaction.TdateGr,
|
||||
DateFa = financialTransaction.TdateGr.ToFarsi(),
|
||||
TimeFa = $"{financialTransaction.TdateGr:HH:mm}",
|
||||
Description = financialTransaction.DescriptionOption + " " + financialTransaction.Description,
|
||||
Debtor = financialTransaction.Deptor,
|
||||
Creditor = financialTransaction.Creditor,
|
||||
Balance = balance,
|
||||
Type = financialTransaction.TypeOfTransaction == "debt"
|
||||
? FinancialTransactionType.Debt
|
||||
: FinancialTransactionType.Credit,
|
||||
TypeStr = financialTransaction.TypeOfTransaction == "debt" ? "ایجاد درآمد" : "دریافت درآمد"
|
||||
};
|
||||
list.Add(item);
|
||||
}
|
||||
|
||||
|
||||
var res = new FinancialStatmentDetailsByContractingPartyViewModel()
|
||||
{
|
||||
Id = financialStatement.id,
|
||||
@@ -330,35 +392,7 @@ public class FinancialStatmentRepository : RepositoryBase<long, FinancialStatmen
|
||||
TotalCredit = financialStatement.FinancialTransactionList.Sum(x => x.Creditor),
|
||||
TotalDebt = financialStatement.FinancialTransactionList.Sum(x => x.Deptor),
|
||||
ContractingPartyName = financialStatement.ContractingPartyName,
|
||||
List = financialStatement.FinancialTransactionList.Select(t =>
|
||||
{
|
||||
if (!searched)
|
||||
{
|
||||
if (t.TypeOfTransaction == "debt")
|
||||
{
|
||||
balance += t.Deptor;
|
||||
}
|
||||
else
|
||||
{
|
||||
balance -= t.Creditor;
|
||||
}
|
||||
}
|
||||
return new FinancialTransactionDetailViewModel()
|
||||
{
|
||||
Id = t.id,
|
||||
DateTimeGr = t.TdateGr,
|
||||
DateFa = t.TdateGr.ToFarsi(),
|
||||
TimeFa = $"{t.TdateGr:HH:mm}",
|
||||
Description = t.DescriptionOption + " " + t.Description,
|
||||
Debtor = t.Deptor,
|
||||
Creditor = t.Creditor,
|
||||
Balance = balance,
|
||||
Type = t.TypeOfTransaction == "debt"
|
||||
? FinancialTransactionType.Debt
|
||||
: FinancialTransactionType.Credit,
|
||||
TypeStr = t.TypeOfTransaction == "debt" ? "ایجاد درآمد" : "دریافت درآمد"
|
||||
};
|
||||
}).OrderByDescending(t => t.DateTimeGr).ToList(),
|
||||
List = list.OrderByDescending(x=>x.DateTimeGr).ToList(),
|
||||
};
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -1083,6 +1083,11 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
joinedQuery = joinedQuery.Where(x =>
|
||||
x.contractingParty.RepresentativeFullName.Contains(keyword) ||
|
||||
(x.contractingParty.FName + " " + x.contractingParty.LName).Contains(keyword) ||
|
||||
(x.contractingParty.IsLegal == "حقیقی" ? x.contractingParty.SureName == null
|
||||
? x.contractingParty.FName + " " + x.contractingParty.LName
|
||||
: x.contractingParty.FName + " " + x.contractingParty.LName + " " + x.contractingParty.SureName
|
||||
: x.contractingParty.SureName == null ? x.contractingParty.LName
|
||||
: x.contractingParty.LName + " " + x.contractingParty.SureName).Contains(keyword)||
|
||||
x.contractingParty.Employers.Any(e =>
|
||||
e.FullName.Contains(keyword) ||
|
||||
e.WorkshopEmployers.Any(we =>
|
||||
@@ -2227,7 +2232,8 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
extensionNo, workshopsCount, employeeCount,
|
||||
previousInstitutionContract.Description,
|
||||
"NotOfficial", "JobRelation", hasValueAddedTax,
|
||||
payment.Tax.MoneyToDouble(),[]);
|
||||
payment.Tax.MoneyToDouble(),[],
|
||||
request.LawId);
|
||||
|
||||
await CreateAsync(entity);
|
||||
await SaveChangesAsync();
|
||||
@@ -2325,6 +2331,60 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
public async Task<List<InstitutionContractSelectListViewModel>> GetInstitutionContractSelectList(string search,
|
||||
string selected)
|
||||
{
|
||||
var contractingParties = _context.PersonalContractingParties.Select(x => new InstitutionContractSelectListViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
Text = x.IsLegal == "حقیقی" ? x.SureName == null
|
||||
? x.FName + " " + x.LName
|
||||
: x.FName + " " + x.LName + " " + x.SureName
|
||||
: x.SureName == null ? x.LName
|
||||
: x.LName + " " + x.SureName
|
||||
});
|
||||
|
||||
var workshops = _context.Workshops.Select(x => new InstitutionContractSelectListViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
Text = x.WorkshopFullName
|
||||
});
|
||||
var employers = _context.Employers.Select(x => new InstitutionContractSelectListViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
Text = x.FName + " " + x.LName
|
||||
});
|
||||
var representatives = _context.RepresentativeSet.Select(x => new InstitutionContractSelectListViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
Text = x.FName + " " + x.LName
|
||||
});
|
||||
|
||||
var res = contractingParties
|
||||
.Union(workshops)
|
||||
.Union(employers)
|
||||
.Union(representatives);
|
||||
|
||||
InstitutionContractSelectListViewModel idSelected = null;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(selected))
|
||||
{
|
||||
idSelected = await res.FirstOrDefaultAsync(x => x.Text == selected);
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(search))
|
||||
{
|
||||
res = res.Where(x => x.Text.Contains(search));
|
||||
}
|
||||
|
||||
var list = await res.Take(100).ToListAsync();
|
||||
|
||||
if (idSelected != null)
|
||||
list.Add(idSelected);
|
||||
|
||||
return list.DistinctBy(x => x.Id).ToList();
|
||||
|
||||
}
|
||||
|
||||
|
||||
private InstitutionContractExtensionPaymentResponse CalculateInPersonPayment(
|
||||
InstitutionContractExtensionPlanDetail selectedPlan, double baseAmount, double tenPercent,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -49,7 +49,8 @@ public class LawRepository:RepositoryBase<long,Law>,ILawRepository
|
||||
|
||||
public async Task<List<LawViewModel>> GetList(LawSearchModel searchModel)
|
||||
{
|
||||
var query = _context.Laws.Include(x => x.Items).AsQueryable();
|
||||
var query = _context.Laws.Include(x => x.Items)
|
||||
.Where(x=>x.IsActive).AsQueryable();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.Title))
|
||||
query = query.Where(x => x.Title.Contains(searchModel.Title));
|
||||
|
||||
@@ -1181,6 +1181,33 @@ public class WorkshopRepository : RepositoryBase<long, Company.Domain.WorkshopAg
|
||||
return list.DistinctBy(x => x.Id).ToList();
|
||||
}
|
||||
|
||||
public int GetLastArchiveCode()
|
||||
{
|
||||
var archiveCodes = _context.Workshops
|
||||
.Where(x => !string.IsNullOrEmpty(x.ArchiveCode))
|
||||
.Select(x => x.ArchiveCode)
|
||||
.ToList();
|
||||
|
||||
int maxArchiveCode = 0;
|
||||
|
||||
foreach (var code in archiveCodes)
|
||||
{
|
||||
// Remove "b-" prefix if exists
|
||||
string cleanCode = code.StartsWith("b-") ? code.Substring(2) : code;
|
||||
|
||||
// Try to parse the clean code to an integer
|
||||
if (int.TryParse(cleanCode, out int codeValue))
|
||||
{
|
||||
if (codeValue > maxArchiveCode)
|
||||
{
|
||||
maxArchiveCode = codeValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return maxArchiveCode;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region NewByHeydari
|
||||
//public List<WorkshopViewModel> GetWorkshopByWorkshopIds(List<long> workshopIds)
|
||||
|
||||
@@ -58,8 +58,9 @@ public class DashboardController : AdminBaseController
|
||||
var taskCount = await _taskApplication.RequestedAndOverdueTasksCount(UserId);
|
||||
var ticketCount = _ticketApplication.GetAdminTicketsCount();
|
||||
|
||||
|
||||
|
||||
return new AdminDashboardViewModel(calenderList, taskCount, ticketCount);
|
||||
return new AdminDashboardViewModel(calenderList, taskCount, ticketCount,todayPersian.Year,todayPersian.MonthOfYear,todayPersian.Day,todayPersian.DayOfWeek);
|
||||
}
|
||||
|
||||
[HttpGet("sms-remaining")]
|
||||
@@ -72,4 +73,4 @@ public class DashboardController : AdminBaseController
|
||||
|
||||
public record SmsRemainingResult(int Data);
|
||||
|
||||
public record AdminDashboardViewModel(List<CalenderViewModel> Calender, int TaskCount, int TicketCount);
|
||||
public record AdminDashboardViewModel(List<CalenderViewModel> Calender, int TaskCount, int TicketCount,int Year,string Month,int Day,string DayOfWeek);
|
||||
@@ -1,4 +1,5 @@
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ServiceHost.BaseControllers;
|
||||
@@ -115,9 +116,9 @@ public class EmployerController : AdminBaseController
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("select_list")]
|
||||
public async Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id)
|
||||
public async Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id,LegalType? legalType=null)
|
||||
{
|
||||
return await _employerApplication.GetSelectList(search, id);
|
||||
return await _employerApplication.GetSelectList(search, id,legalType);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -78,6 +78,13 @@ namespace ServiceHost.Areas.Admin.Controllers
|
||||
var result = await _employerApplication.EditWorkflowRegistration(command);
|
||||
return result;
|
||||
}
|
||||
[HttpGet("edit-employer/{employerId}/{institutionWorkshopDetailsId}")]
|
||||
|
||||
public async Task<ActionResult<EditEmployerWorkflowRegistration>> GetEmployerForEdit(long employerId, long institutionWorkshopDetailsId)
|
||||
{
|
||||
var result = await _employerApplication.GetWorkflowRegistrationForEdit(employerId, institutionWorkshopDetailsId);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// حذف کارفرما از گردش کار ثبت نام
|
||||
|
||||
@@ -67,6 +67,14 @@ public class institutionContractController : AdminBaseController
|
||||
{
|
||||
return await _institutionContractApplication.GetList(searchModel);
|
||||
}
|
||||
|
||||
[HttpGet("select-list")]
|
||||
public async Task<ActionResult<List<InstitutionContractSelectListViewModel>>> GetContractingPartySelectList(string search,string selected)
|
||||
{
|
||||
var result = await _institutionContractApplication
|
||||
.GetInstitutionContractSelectList(search,selected);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت تب ها
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a asp-page="/Index" class="waves-effect btnDashboard">
|
||||
<a href="https://admin@(AppSetting.Value.Domain)/dashboard" class="waves-effect btnDashboard">
|
||||
<div class="menuTitle">
|
||||
<i class="md md-home"></i>
|
||||
<span> پیشخان </span>
|
||||
@@ -473,6 +473,14 @@
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li permission="2">
|
||||
<a href="https://admin@(AppSetting.Value.Domain)/law" class="waves-effect btnWorkFlow">
|
||||
<div class="menuTitle">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="1.5"><path stroke-linejoin="round" d="M4 12.996v1.544c0 3.247 0 4.87.886 5.97q.27.334.603.603C6.59 22 8.211 22 11.456 22c.705 0 1.058 0 1.381-.114q.1-.036.197-.082c.31-.148.559-.397 1.058-.896l4.736-4.74c.579-.578.867-.867 1.02-1.235c.152-.367.152-.776.152-1.594V9.994c0-3.773 0-5.66-1.172-6.832c-.93-.932-2.314-1.123-4.736-1.162M13 21.5V21c0-2.83 0-4.245.879-5.124c.878-.88 2.293-.88 5.121-.88h.5"></path><path d="M8 9.773c1.767 0 3.2-1.466 3.2-3.273S9.767 3.227 8 3.227m0 6.546c-1.767 0-3.2-1.466-3.2-3.273S6.233 3.227 8 3.227m0 6.546V11m0-7.773V2M5.091 4.715l-1.09-.67M12 8.955l-1.09-.67m-.001-3.57l1.09-.67M4 8.955l1.09-.67"></path></g></svg>
|
||||
<span> ویرایش قوانین و مقررات </span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="has_sub" permission="307">
|
||||
|
||||
<a class="waves-effect MainMenuItem">
|
||||
|
||||
@@ -694,7 +694,8 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
await _context.SaveChangesAsync();
|
||||
//TODO: set data for institution price
|
||||
var workshops = item.contractingParty.Employers
|
||||
.SelectMany(e => e.WorkshopEmployers.Select(we => we.Workshop)).ToList();
|
||||
.SelectMany(e => e.WorkshopEmployers.Select(we => we.Workshop)).ToList()
|
||||
.DistinctBy(x=>x.id).ToList();
|
||||
|
||||
var initialWorkshop = workshops
|
||||
.Select(w =>
|
||||
@@ -760,7 +761,8 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
foreach (var item in inPersonContracts)
|
||||
{
|
||||
var workshops = item.contractingParty.Employers
|
||||
.SelectMany(e => e.WorkshopEmployers.Select(we => we.Workshop)).ToList();
|
||||
.SelectMany(e => e.WorkshopEmployers.Select(we => we.Workshop)).ToList()
|
||||
.DistinctBy(x=>x.id).ToList();
|
||||
|
||||
var initialWorkshop = workshops
|
||||
.Select(w =>
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
<div id="sidebar-menu">
|
||||
<ul>
|
||||
<li>
|
||||
<a asp-area="Admin" asp-page="/Index" class="waves-effect btnDashboard">
|
||||
<a href="https://admin@(AppSetting.Value.Domain)/dashboard" class="waves-effect btnDashboard">
|
||||
<div class="menuTitle">
|
||||
<i class="md md-home"></i>
|
||||
<span> پیشخان </span>
|
||||
@@ -621,6 +621,14 @@
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li permission="2">
|
||||
<a href="https://admin@(AppSetting.Value.Domain)/law" class="waves-effect btnWorkFlow">
|
||||
<div class="menuTitle">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="1.5"><path stroke-linejoin="round" d="M4 12.996v1.544c0 3.247 0 4.87.886 5.97q.27.334.603.603C6.59 22 8.211 22 11.456 22c.705 0 1.058 0 1.381-.114q.1-.036.197-.082c.31-.148.559-.397 1.058-.896l4.736-4.74c.579-.578.867-.867 1.02-1.235c.152-.367.152-.776.152-1.594V9.994c0-3.773 0-5.66-1.172-6.832c-.93-.932-2.314-1.123-4.736-1.162M13 21.5V21c0-2.83 0-4.245.879-5.124c.878-.88 2.293-.88 5.121-.88h.5"></path><path d="M8 9.773c1.767 0 3.2-1.466 3.2-3.273S9.767 3.227 8 3.227m0 6.546c-1.767 0-3.2-1.466-3.2-3.273S6.233 3.227 8 3.227m0 6.546V11m0-7.773V2M5.091 4.715l-1.09-.67M12 8.955l-1.09-.67m-.001-3.57l1.09-.67M4 8.955l1.09-.67"></path></g></svg>
|
||||
<span> ویرایش قوانین و مقررات </span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="has_sub" permission="307">
|
||||
|
||||
<a class="waves-effect MainMenuItem">
|
||||
@@ -633,7 +641,7 @@
|
||||
</span>
|
||||
</a>
|
||||
<ul class="list-unstyled sdf10">
|
||||
<li permission="307"><a class="clik10" asp-area="Admin" asp-page="/Company/InstitutionContracts/Index">
|
||||
<li permission="307"><a class="clik10" href="https://admin@(AppSetting.Value.Domain)/institution-contract">
|
||||
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
||||
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
|
||||
</svg>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
</handlers>
|
||||
|
||||
<aspNetCore processPath="dotnet" arguments=".\ServiceHost.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
|
||||
|
||||
<security>
|
||||
<requestFiltering>
|
||||
<requestLimits maxAllowedContentLength="200000000" />
|
||||
|
||||
@@ -823,7 +823,7 @@ function generateButtons(item, pathDSKKAR00, pathDSKWOR00) {
|
||||
}
|
||||
|
||||
//if (item.inspectionDone && item.debtDone && item.employerApproved && item.confirmSentlist) {
|
||||
if (item.inspectionDone || item.debtDone || item.employerApproved || item.confirmSentlist) {
|
||||
// if (item.inspectionDone || item.debtDone || item.employerApproved || item.confirmSentlist) {
|
||||
// Confirm List and Print Button
|
||||
if (hasPermission_80215) {
|
||||
html += `
|
||||
@@ -839,7 +839,7 @@ function generateButtons(item, pathDSKKAR00, pathDSKWOR00) {
|
||||
<span class="tw-flex md:tw-hidden tw-text-sm tw-text-white">پرینت</span>
|
||||
</a>`;
|
||||
}
|
||||
}
|
||||
// }
|
||||
|
||||
if (item.inspectionDone || item.debtDone || item.employerApproved || item.confirmSentlist) {
|
||||
// Summary List and Print Button
|
||||
|
||||
Reference in New Issue
Block a user