Compare commits
15 Commits
Feature/In
...
Fix/instit
| Author | SHA1 | Date | |
|---|---|---|---|
| f863fb065f | |||
| d0b29e7643 | |||
|
|
5b3c7e471e | ||
|
|
330a3ca839 | ||
| 7c4cf1e2ed | |||
| 1d2c4f26f1 | |||
| 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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
@@ -1301,6 +1301,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>()
|
||||
};
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace ServiceHost.Areas.Admin.Controllers
|
||||
var result = await _employerApplication.EditWorkflowRegistration(command);
|
||||
return result;
|
||||
}
|
||||
|
||||
[HttpGet("edit-employer/{employerId}/{institutionWorkshopDetailsId}")]
|
||||
/// <summary>
|
||||
/// حذف کارفرما از گردش کار ثبت نام
|
||||
/// </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