Compare commits
6 Commits
Feature/ad
...
Feature/Bg
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f15c2d54b | ||
|
|
9d9f0e14d3 | ||
|
|
4d45ee36b6 | ||
|
|
7ae08fe023 | ||
|
|
117b5df447 | ||
|
|
fee14c65ec |
48
.github/workflows/dotnet-developPublish.yml
vendored
48
.github/workflows/dotnet-developPublish.yml
vendored
@@ -1,48 +0,0 @@
|
|||||||
name: Deploy Development ASP.NET Core App to IIS
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- Main
|
|
||||||
|
|
||||||
env:
|
|
||||||
DOTNET_ENVIRONMENT: Development
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-deploy:
|
|
||||||
runs-on: windows-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup .NET SDK
|
|
||||||
uses: actions/setup-dotnet@v4
|
|
||||||
with:
|
|
||||||
dotnet-version: '8.0.x' # یا نسخه پروژهت
|
|
||||||
|
|
||||||
- name: Restore dependencies
|
|
||||||
run: dotnet restore
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: dotnet build --configuration Release
|
|
||||||
|
|
||||||
- name: Publish
|
|
||||||
run: dotnet publish --configuration Release --output ./publish /p:EnvironmentName=Development --no-build
|
|
||||||
|
|
||||||
- name: Deploy to IIS via Web Deploy
|
|
||||||
shell: powershell
|
|
||||||
run: |
|
|
||||||
$publishFolder = Resolve-Path ./publish
|
|
||||||
& "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" `
|
|
||||||
-verb:sync `
|
|
||||||
-source:contentPath="$publishFolder" `
|
|
||||||
-dest:contentPath="dadmehrg",computerName="https://171.22.24.15:8172/msdeploy.axd?site=dadmehrg",userName=".\deployuser",password="R2rNpdnetP3j>q5b18",authType="Basic" `
|
|
||||||
-allowUntrusted `
|
|
||||||
-enableRule:AppOffline
|
|
||||||
|
|
||||||
|
|
||||||
env:
|
|
||||||
SERVER_HOST: your-server-ip-or-domain
|
|
||||||
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
|
|
||||||
DEPLOY_PASSWORD: ${{ secrets.DEPLOY_PASSWORD }}
|
|
||||||
@@ -42,7 +42,6 @@ public class AuthHelper : IAuthHelper
|
|||||||
result.WorkshopName = claims.FirstOrDefault(x => x is { Type: "WorkshopName" })?.Value;
|
result.WorkshopName = claims.FirstOrDefault(x => x is { Type: "WorkshopName" })?.Value;
|
||||||
result.Permissions = Tools.DeserializeFromBsonList<int>(claims.FirstOrDefault(x => x is { Type: "permissions" })?.Value);
|
result.Permissions = Tools.DeserializeFromBsonList<int>(claims.FirstOrDefault(x => x is { Type: "permissions" })?.Value);
|
||||||
result.RoleName = claims.FirstOrDefault(x => x is { Type: "RoleName" })?.Value;
|
result.RoleName = claims.FirstOrDefault(x => x is { Type: "RoleName" })?.Value;
|
||||||
result.WorkshopId = long.Parse(claims.FirstOrDefault(x => x.Type == "WorkshopId")?.Value??"0");
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,7 +76,7 @@ public class AuthHelper : IAuthHelper
|
|||||||
|
|
||||||
#region Vafa
|
#region Vafa
|
||||||
|
|
||||||
public void UpdateWorkshopSlugClaim(string newWorkshopSlug, string newWorkshopName,long newWorkshopId)
|
public void UpdateWorkshopSlugClaim(string newWorkshopSlug, string newWorkshopName)
|
||||||
{
|
{
|
||||||
var user = _contextAccessor.HttpContext.User;
|
var user = _contextAccessor.HttpContext.User;
|
||||||
|
|
||||||
@@ -86,7 +85,6 @@ public class AuthHelper : IAuthHelper
|
|||||||
var claimsIdentity = (ClaimsIdentity)user.Identity;
|
var claimsIdentity = (ClaimsIdentity)user.Identity;
|
||||||
var existingClaimSlug = claimsIdentity.FindFirst("WorkshopSlug");
|
var existingClaimSlug = claimsIdentity.FindFirst("WorkshopSlug");
|
||||||
var existingClaimName = claimsIdentity.FindFirst("WorkshopName");
|
var existingClaimName = claimsIdentity.FindFirst("WorkshopName");
|
||||||
var existingWorkshopId = claimsIdentity.FindFirst("WorkshopId");
|
|
||||||
|
|
||||||
if (existingClaimSlug != null)
|
if (existingClaimSlug != null)
|
||||||
{
|
{
|
||||||
@@ -98,14 +96,9 @@ public class AuthHelper : IAuthHelper
|
|||||||
claimsIdentity.RemoveClaim(existingClaimName);
|
claimsIdentity.RemoveClaim(existingClaimName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (existingWorkshopId != null)
|
|
||||||
{
|
|
||||||
claimsIdentity.RemoveClaim(existingWorkshopId);
|
|
||||||
}
|
|
||||||
|
|
||||||
claimsIdentity.AddClaim(new Claim("WorkshopSlug", newWorkshopSlug));
|
claimsIdentity.AddClaim(new Claim("WorkshopSlug", newWorkshopSlug));
|
||||||
claimsIdentity.AddClaim(new Claim("WorkshopName", newWorkshopName));
|
claimsIdentity.AddClaim(new Claim("WorkshopName", newWorkshopName));
|
||||||
claimsIdentity.AddClaim(new Claim("WorkshopId",newWorkshopId.ToString()));
|
|
||||||
|
|
||||||
|
|
||||||
var authProperties = new AuthenticationProperties
|
var authProperties = new AuthenticationProperties
|
||||||
@@ -135,16 +128,8 @@ public class AuthHelper : IAuthHelper
|
|||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public long GetWorkshopId()
|
|
||||||
{
|
|
||||||
return long.Parse(_contextAccessor.HttpContext?.User.Claims.FirstOrDefault(x => x.Type == "WorkshopId")?.Value ?? "0");
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public string CurrentAccountRole()
|
public string CurrentAccountRole()
|
||||||
{
|
{
|
||||||
@@ -197,7 +182,6 @@ public class AuthHelper : IAuthHelper
|
|||||||
//mahanChanges
|
//mahanChanges
|
||||||
new("workshopList",workshopBson),
|
new("workshopList",workshopBson),
|
||||||
new("WorkshopSlug",slug),
|
new("WorkshopSlug",slug),
|
||||||
new("WorkshopId", account.WorkshopId.ToString()),
|
|
||||||
new("WorkshopName",account.WorkshopName??"")
|
new("WorkshopName",account.WorkshopName??"")
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ public class AuthViewModel
|
|||||||
|
|
||||||
public int? PositionValue { get; set; }
|
public int? PositionValue { get; set; }
|
||||||
public string WorkshopSlug { get; set; }
|
public string WorkshopSlug { get; set; }
|
||||||
public long WorkshopId { get; set; }
|
|
||||||
public string WorkshopName { get; set; }
|
public string WorkshopName { get; set; }
|
||||||
public List<WorkshopClaim> WorkshopList { get; set; }
|
public List<WorkshopClaim> WorkshopList { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -17,12 +17,11 @@ public interface IAuthHelper
|
|||||||
|
|
||||||
#region Vafa
|
#region Vafa
|
||||||
|
|
||||||
void UpdateWorkshopSlugClaim(string workshopSlug, string workshopName, long workshopId);
|
void UpdateWorkshopSlugClaim(string workshopSlug, string workshopName);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
long CurrentSubAccountId();
|
long CurrentSubAccountId();
|
||||||
string GetWorkshopSlug();
|
string GetWorkshopSlug();
|
||||||
string GetWorkshopName();
|
string GetWorkshopName();
|
||||||
long GetWorkshopId();
|
|
||||||
(long Id, UserType userType, long roleId) GetUserTypeWithId();
|
(long Id, UserType userType, long roleId) GetUserTypeWithId();
|
||||||
}
|
}
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
|
||||||
|
|
||||||
namespace _0_Framework.Application;
|
|
||||||
|
|
||||||
|
|
||||||
public class PagedResult<T> where T : class
|
|
||||||
{
|
|
||||||
public int TotalCount { get; set; }
|
|
||||||
public List<T> List { get; set; }
|
|
||||||
}
|
|
||||||
public class PagedResult<T,TMeta>:PagedResult<T> where T : class
|
|
||||||
{
|
|
||||||
public TMeta? Meta { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
namespace _0_Framework.Application;
|
|
||||||
|
|
||||||
public class PaginationRequest
|
|
||||||
{
|
|
||||||
public int PageIndex { get; set; } = 1;
|
|
||||||
public int PageSize { get; set; } = 30;
|
|
||||||
}
|
|
||||||
@@ -24,7 +24,7 @@ public class AqayePardakhtPaymentGateway:IPaymentGateway
|
|||||||
{
|
{
|
||||||
_httpClient = httpClientFactory.CreateClient();
|
_httpClient = httpClientFactory.CreateClient();
|
||||||
|
|
||||||
if (appSetting.Value.Domain == ".dadmehrg.ir")
|
if (appSetting.Value.Domain == ".dad-mehr.ir")
|
||||||
{
|
{
|
||||||
_pin = "7349F84E81AB584862D9";
|
_pin = "7349F84E81AB584862D9";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ public interface ISmsService
|
|||||||
#region Mahan
|
#region Mahan
|
||||||
|
|
||||||
Task<double> GetCreditAmount();
|
Task<double> GetCreditAmount();
|
||||||
|
SmsResult TaskReminderSms(string number, string taskCount);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|||||||
32
0_Framework/Application/Sms/SmsResult.cs
Normal file
32
0_Framework/Application/Sms/SmsResult.cs
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
namespace _0_Framework.Application.Sms;
|
||||||
|
|
||||||
|
public class SmsResult
|
||||||
|
{
|
||||||
|
public SmsResult()
|
||||||
|
{
|
||||||
|
IsSuccedded = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsSuccedded { get; set; }
|
||||||
|
public string Message { get; set; }
|
||||||
|
public byte StatusCode { get; set; }
|
||||||
|
public int MessageId { get; set; }
|
||||||
|
|
||||||
|
public SmsResult Succedded(byte statusCode, string message, int messageId)
|
||||||
|
{
|
||||||
|
IsSuccedded = true;
|
||||||
|
Message = message;
|
||||||
|
StatusCode = statusCode;
|
||||||
|
MessageId = messageId;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SmsResult Failed(byte statusCode, string message, int messageId)
|
||||||
|
{
|
||||||
|
IsSuccedded = false;
|
||||||
|
Message = message;
|
||||||
|
StatusCode = statusCode;
|
||||||
|
MessageId = messageId;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -332,6 +332,34 @@ public class SmsService : ISmsService
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SmsResult TaskReminderSms(string number, string taskCount)
|
||||||
|
{
|
||||||
|
var tamplateId = 909433;
|
||||||
|
var result = new SmsResult();
|
||||||
|
var smsIr = new SmsIr("Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa");
|
||||||
|
var sendResult = smsIr.VerifySendAsync(number, tamplateId,
|
||||||
|
new VerifySendParameter[]
|
||||||
|
{
|
||||||
|
new("TASKCOUNT", taskCount),
|
||||||
|
});
|
||||||
|
Thread.Sleep(500);
|
||||||
|
|
||||||
|
|
||||||
|
if (sendResult.IsCompletedSuccessfully)
|
||||||
|
{
|
||||||
|
var status = sendResult.Result.Status;
|
||||||
|
var message = sendResult.Result.Message;
|
||||||
|
var messaeId = sendResult.Result.Data.MessageId;
|
||||||
|
return result.Succedded(status, message, messaeId);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var status = sendResult.Result.Status;
|
||||||
|
var message = sendResult.Result.Message;
|
||||||
|
var messaeId = sendResult.Result.Data.MessageId;
|
||||||
|
return result.Failed(status, message, messaeId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,9 +30,8 @@ public static class StaticWorkshopAccounts
|
|||||||
/// 380 - افروز نظری
|
/// 380 - افروز نظری
|
||||||
/// 381 - مهدی قربانی
|
/// 381 - مهدی قربانی
|
||||||
/// 392 - عمار حسن دوست
|
/// 392 - عمار حسن دوست
|
||||||
/// 20 - سمیرا الهی نیا
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static List<long> StaticAccountIds = [2, 3, 380, 381, 392, 20];
|
public static List<long> StaticAccountIds = [2, 3, 380, 381, 392];
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// این تاریخ در جدول اکانت لفت ورک به این معنیست
|
/// این تاریخ در جدول اکانت لفت ورک به این معنیست
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public class UidBasicInformation
|
|||||||
{
|
{
|
||||||
"GENDER_MALE" => Application.Gender.Male,
|
"GENDER_MALE" => Application.Gender.Male,
|
||||||
"GENDER_FEMALE" => Application.Gender.Female,
|
"GENDER_FEMALE" => Application.Gender.Female,
|
||||||
_ => Application.Gender.None
|
_ => throw new ArgumentOutOfRangeException()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
public record IdentificationInformation(string NationalId, string BirthDate, string ShenasnameSeri, string ShenasnameSerial, string ShenasnamehNumber);
|
public record IdentificationInformation(string NationalId, string BirthDate, string ShenasnameSeri, string ShenasnameSerial, string ShenasnamehNumber);
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ public class BaseCustomizeEntity : EntityBase
|
|||||||
|
|
||||||
public BreakTime BreakTime { get; protected set; }
|
public BreakTime BreakTime { get; protected set; }
|
||||||
|
|
||||||
public List<WeeklyOffDay> WeeklyOffDays { get; set; } = [];
|
public List<WeeklyOffDay> WeeklyOffDays { get; set; }
|
||||||
|
|
||||||
public void FridayWorkToWeeklyDayOfWeek()
|
public void FridayWorkToWeeklyDayOfWeek()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ using System.Linq;
|
|||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.EntityFrameworkCore.Storage;
|
|
||||||
|
|
||||||
namespace _0_Framework.Domain;
|
namespace _0_Framework.Domain;
|
||||||
|
|
||||||
@@ -18,6 +17,4 @@ public interface IRepository<TKey, T> where T:class
|
|||||||
bool Exists(Expression<Func<T, bool>> expression);
|
bool Exists(Expression<Func<T, bool>> expression);
|
||||||
void SaveChanges();
|
void SaveChanges();
|
||||||
Task SaveChangesAsync();
|
Task SaveChangesAsync();
|
||||||
Task<IDbContextTransaction> BeginTransactionAsync();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,6 @@ using System.Text;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using _0_Framework.Domain;
|
using _0_Framework.Domain;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.Storage;
|
|
||||||
|
|
||||||
namespace _0_Framework.InfraStructure
|
namespace _0_Framework.InfraStructure
|
||||||
{
|
{
|
||||||
@@ -71,10 +70,5 @@ namespace _0_Framework.InfraStructure
|
|||||||
{
|
{
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<IDbContextTransaction> BeginTransactionAsync()
|
|
||||||
{
|
|
||||||
return await _context.Database.BeginTransactionAsync();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -259,7 +259,6 @@ public class AccountApplication : IAccountApplication
|
|||||||
var workshop = workshopList.First();
|
var workshop = workshopList.First();
|
||||||
authViewModel.WorkshopName = workshop.Name;
|
authViewModel.WorkshopName = workshop.Name;
|
||||||
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.Id);
|
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.Id);
|
||||||
authViewModel.WorkshopId = workshop.Id;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -318,7 +317,6 @@ public class AccountApplication : IAccountApplication
|
|||||||
var workshop = workshopList.First();
|
var workshop = workshopList.First();
|
||||||
authViewModel.WorkshopName = workshop.WorkshopName;
|
authViewModel.WorkshopName = workshop.WorkshopName;
|
||||||
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.WorkshopId);
|
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.WorkshopId);
|
||||||
authViewModel.WorkshopId = workshop.WorkshopId;
|
|
||||||
}
|
}
|
||||||
_authHelper.Signin(authViewModel);
|
_authHelper.Signin(authViewModel);
|
||||||
idAutoriz = 2;
|
idAutoriz = 2;
|
||||||
@@ -370,7 +368,6 @@ public class AccountApplication : IAccountApplication
|
|||||||
var workshop = workshopList.First();
|
var workshop = workshopList.First();
|
||||||
authViewModel.WorkshopName = workshop.Name;
|
authViewModel.WorkshopName = workshop.Name;
|
||||||
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.Id);
|
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.Id);
|
||||||
authViewModel.WorkshopId = workshop.Id;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -518,7 +515,6 @@ public class AccountApplication : IAccountApplication
|
|||||||
var workshop = authViewModel.WorkshopList.First();
|
var workshop = authViewModel.WorkshopList.First();
|
||||||
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.Id);
|
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.Id);
|
||||||
authViewModel.WorkshopName = workshop.Name;
|
authViewModel.WorkshopName = workshop.Name;
|
||||||
authViewModel.WorkshopId = workshop.Id;
|
|
||||||
}
|
}
|
||||||
_authHelper.Signin(authViewModel);
|
_authHelper.Signin(authViewModel);
|
||||||
return operation.Succcedded(2);
|
return operation.Succcedded(2);
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\0_Framework\0_Framework.csproj" />
|
||||||
|
<ProjectReference Include="..\..\AccountManagement.Configuration\AccountManagement.Configuration.csproj" />
|
||||||
|
<ProjectReference Include="..\..\PersonalContractingParty.Config\PersonalContractingParty.Config.csproj" />
|
||||||
|
<ProjectReference Include="..\..\Query.Bootstrapper\Query.Bootstrapper.csproj" />
|
||||||
|
<ProjectReference Include="..\..\WorkFlow\Infrastructure\WorkFlow.Infrastructure.Config\WorkFlow.Infrastructure.Config.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
32
BackgroundJobs/BackgroundJobs.Task/FileUploader.cs
Normal file
32
BackgroundJobs/BackgroundJobs.Task/FileUploader.cs
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
using _0_Framework.Application;
|
||||||
|
|
||||||
|
namespace BackgroundJobs.Task
|
||||||
|
{
|
||||||
|
public class FileUploader : IFileUploader
|
||||||
|
{
|
||||||
|
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||||
|
|
||||||
|
public FileUploader(IWebHostEnvironment webHostEnvironment)
|
||||||
|
{
|
||||||
|
_webHostEnvironment = webHostEnvironment;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Upload(IFormFile file, string path)
|
||||||
|
{
|
||||||
|
if (file == null) return "";
|
||||||
|
|
||||||
|
var directoryPath = $"{_webHostEnvironment.WebRootPath}\\ProductPictures\\{path}";
|
||||||
|
|
||||||
|
if (!Directory.Exists(directoryPath))
|
||||||
|
Directory.CreateDirectory(directoryPath);
|
||||||
|
|
||||||
|
var fileName = $"{DateTime.Now.ToFileName()}-{file.FileName}";
|
||||||
|
var filePath = $"{directoryPath}\\{fileName}";
|
||||||
|
var output = System.IO.File.Create(filePath);
|
||||||
|
file.CopyTo(output);
|
||||||
|
return $"{path}/{fileName}";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
using Hangfire;
|
||||||
|
|
||||||
|
namespace BackgroundJobs.Task.Jobs;
|
||||||
|
|
||||||
|
public class JobSchedulerRegistrator
|
||||||
|
{
|
||||||
|
private readonly IBackgroundJobClient _backgroundJobClient;
|
||||||
|
private readonly SmsReminder _smsReminder;
|
||||||
|
private static DateTime? _lastRunDateMorning;
|
||||||
|
private static DateTime? _lastRunDateEvening;
|
||||||
|
|
||||||
|
public JobSchedulerRegistrator(SmsReminder smsReminder, IBackgroundJobClient backgroundJobClient)
|
||||||
|
{
|
||||||
|
_smsReminder = smsReminder;
|
||||||
|
_backgroundJobClient = backgroundJobClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Register()
|
||||||
|
{
|
||||||
|
RecurringJob.AddOrUpdate(
|
||||||
|
"Task.SmsReminderChecker",
|
||||||
|
() => SmsReminderCheckAndSchedule(),
|
||||||
|
"*/5 * * * *" // هر 5 دقیقه یکبار چک کن
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SmsReminderCheckAndSchedule()
|
||||||
|
{
|
||||||
|
var now = DateTime.Now;
|
||||||
|
|
||||||
|
var startMorning = new TimeSpan(9, 0, 0);
|
||||||
|
var endMorning = new TimeSpan(9, 40, 0);
|
||||||
|
|
||||||
|
var startEvening = new TimeSpan(15, 30, 0);
|
||||||
|
var endEvening = new TimeSpan(15, 40, 0);
|
||||||
|
|
||||||
|
// صبح
|
||||||
|
if (now.DayOfWeek != DayOfWeek.Friday &&
|
||||||
|
now.TimeOfDay >= startMorning &&
|
||||||
|
now.TimeOfDay < endMorning)
|
||||||
|
{
|
||||||
|
if (_lastRunDateMorning?.Date != now.Date)
|
||||||
|
{
|
||||||
|
_backgroundJobClient.Enqueue(() => _smsReminder.Execute());
|
||||||
|
_lastRunDateMorning = now;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// عصر - پنجشنبه و جمعه تعطیل است
|
||||||
|
if (now.DayOfWeek != DayOfWeek.Friday &&
|
||||||
|
now.DayOfWeek != DayOfWeek.Thursday &&
|
||||||
|
now.TimeOfDay >= startEvening &&
|
||||||
|
now.TimeOfDay < endEvening)
|
||||||
|
{
|
||||||
|
if (_lastRunDateEvening?.Date != now.Date)
|
||||||
|
{
|
||||||
|
_backgroundJobClient.Enqueue(() => _smsReminder.Execute());
|
||||||
|
_lastRunDateEvening = now;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
116
BackgroundJobs/BackgroundJobs.Task/Jobs/SmsReminder.cs
Normal file
116
BackgroundJobs/BackgroundJobs.Task/Jobs/SmsReminder.cs
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
using _0_Framework.Application.Sms;
|
||||||
|
using AccountManagement.Application.Contracts.Account;
|
||||||
|
using AccountMangement.Infrastructure.EFCore;
|
||||||
|
using Company.Domain.SmsResultAgg;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using SmsResult = Company.Domain.SmsResultAgg.SmsResult;
|
||||||
|
|
||||||
|
namespace BackgroundJobs.Task.Jobs;
|
||||||
|
public class SmsReminder
|
||||||
|
{
|
||||||
|
private readonly AccountContext _accountContext;
|
||||||
|
private readonly ISmsService _smsService;
|
||||||
|
private readonly ISmsResultRepository _smsResultRepository;
|
||||||
|
|
||||||
|
public SmsReminder(ISmsService smsService, AccountContext accountContext, ISmsResultRepository smsResultRepository)
|
||||||
|
{
|
||||||
|
_smsService = smsService;
|
||||||
|
_accountContext = accountContext;
|
||||||
|
_smsResultRepository = smsResultRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Execute()
|
||||||
|
{
|
||||||
|
//var accounts = _accountContext.Accounts.Where(x => x.PositionId > 0 && x.IsActiveString == "true").Select(x => new AccountViewModel() { Id = x.id, Mobile = x.Mobile, Fullname = x.Fullname }).ToList();
|
||||||
|
//Thread.Sleep(300);
|
||||||
|
//var accounts = new List<AccountViewModel>() { new AccountViewModel() { Mobile = "09114221321", Id = 2 } };
|
||||||
|
var accounts= _accountContext.Accounts.Where(x => x.Username.ToLower()=="mahan").Select(x => new AccountViewModel() { Id = x.id, Mobile = x.Mobile, Fullname = x.Fullname }).ToList();
|
||||||
|
var smsVM = accounts.Select(x => new AccountSmsTaskViewModel()
|
||||||
|
{
|
||||||
|
Mobile = x.Mobile,
|
||||||
|
AccountId = x.Id,
|
||||||
|
FullName = x.Fullname,
|
||||||
|
TaskCount = GetLateTasksCount(x.Id)
|
||||||
|
}).Where(x => x.TaskCount > 0 && !string.IsNullOrEmpty(x.Mobile) && x.Mobile.Length == 11).ToList();
|
||||||
|
Thread.Sleep(300);
|
||||||
|
|
||||||
|
|
||||||
|
foreach (var viewmodel in smsVM)
|
||||||
|
{
|
||||||
|
var smsResult = _smsService.TaskReminderSms(viewmodel.Mobile, $"{viewmodel.TaskCount}");
|
||||||
|
Thread.Sleep(1000);
|
||||||
|
var createSmsResult = new SmsResult(smsResult.MessageId, smsResult.Message, "یادآور وظایف",
|
||||||
|
viewmodel.FullName, viewmodel.Mobile, viewmodel.AccountId, viewmodel.AccountId);
|
||||||
|
_smsResultRepository.Create(createSmsResult);
|
||||||
|
_smsResultRepository.SaveChanges();
|
||||||
|
Thread.Sleep(1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private int GetLateTasksCount(long accountId)
|
||||||
|
{
|
||||||
|
var positionValue = _accountContext.Accounts
|
||||||
|
.Where(x => x.id == accountId)
|
||||||
|
.Include(p => p.Position)
|
||||||
|
.Select(x => x.Position.PositionValue)
|
||||||
|
.FirstOrDefault();
|
||||||
|
|
||||||
|
if (positionValue == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
|
||||||
|
DateTime now = DateTime.Now;
|
||||||
|
int overdueTasksCount;
|
||||||
|
|
||||||
|
if (positionValue == 1)
|
||||||
|
{
|
||||||
|
overdueTasksCount = _accountContext.Assigns.Include(x => x.Task).Where(x => x.AssignedId == accountId &&
|
||||||
|
x.AssignerId == accountId && x.Task.Assigns.Count == 1 &&
|
||||||
|
!x.IsCancel && !x.IsCanceledRequest &&
|
||||||
|
!x.IsDone && !x.TimeRequest && !x.IsDoneRequest && x.EndTaskDate.Date <= DateTime.Now.Date && x.Task.IsActiveString == "true")
|
||||||
|
.GroupBy(x => x.TaskId).Select(x => x.First()).Count();
|
||||||
|
|
||||||
|
//overdueTasksCount = _accountContext.Tasks.Include(x =>
|
||||||
|
// x.Assigns).Count(x => !x.Assigns.Any(a => a.IsCancel) && !x.Assigns.Any(a => a.IsCanceledRequest) &&
|
||||||
|
// !x.Assigns.Any(a => a.IsDone) && !x.Assigns.Any(a => a.IsDoneRequest) &&
|
||||||
|
// !x.Assigns.Any(a => a.TimeRequest)
|
||||||
|
// && x.Assigns.Any(a => a.AssignedId == accountId && a.AssignerId == accountId) &&
|
||||||
|
// (x.Assigns.First(a => a.AssignedId == accountId && a.AssignerId == accountId)
|
||||||
|
// .EndTaskDate.Date <= DateTime.Now.Date) && x.Assigns.Count == 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
overdueTasksCount = _accountContext.Assigns
|
||||||
|
.Include(x => x.Task)
|
||||||
|
.Where(x => x.AssignedId == accountId &&
|
||||||
|
!x.IsCancel && !x.IsCanceledRequest &&
|
||||||
|
!x.IsDone && !x.TimeRequest && !x.IsDoneRequest && x.EndTaskDate.Date <= DateTime.Now.Date && x.Task.IsActiveString == "true")
|
||||||
|
.GroupBy(x => x.TaskId).Select(x => x.First()).Count();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//overdueTasksCount = _accountContext.Tasks.Include(x =>
|
||||||
|
// x.Assigns).Count(x => !x.Assigns.Any(a => a.IsCancel) && !x.Assigns.Any(a => a.IsCanceledRequest) &&
|
||||||
|
// !x.Assigns.Any(a => a.IsDone) && !x.Assigns.Any(a => a.IsDoneRequest) &&
|
||||||
|
// !x.Assigns.Any(a => a.TimeRequest)
|
||||||
|
// && x.Assigns.Any(a => a.AssignedId == accountId) &&
|
||||||
|
// (x.Assigns.First(a => a.AssignedId == accountId).EndTaskDate.Date <= DateTime.Now.Date));
|
||||||
|
|
||||||
|
|
||||||
|
var overdueRequestsCount = _accountContext.Assigns.Include(x => x.Task)
|
||||||
|
.Where(x => (x.IsCanceledRequest
|
||||||
|
|| x.IsDoneRequest || x.TimeRequest) && !x.IsCancel && !x.IsDone &&
|
||||||
|
x.Task.IsActiveString == "true" &&
|
||||||
|
x.Task.SenderId == accountId).GroupBy(x => x.TaskId).Select(x => x.First()).Count();
|
||||||
|
|
||||||
|
return overdueTasksCount + overdueRequestsCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public class AccountSmsTaskViewModel
|
||||||
|
{
|
||||||
|
public int TaskCount { get; set; }
|
||||||
|
public long AccountId { get; set; }
|
||||||
|
public string Mobile { get; set; }
|
||||||
|
public string FullName { get; set; }
|
||||||
|
}
|
||||||
24
BackgroundJobs/BackgroundJobs.Task/JobsBootstrapper.cs
Normal file
24
BackgroundJobs/BackgroundJobs.Task/JobsBootstrapper.cs
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
using BackgroundJobs.Task.Jobs;
|
||||||
|
|
||||||
|
namespace BackgroundJobs.Task;
|
||||||
|
|
||||||
|
public class JobsBootstrapper
|
||||||
|
{
|
||||||
|
public static void Configure(IServiceCollection services)
|
||||||
|
{
|
||||||
|
var currentNamespace = typeof(JobSchedulerRegistrator).Namespace; // همون namespace کلاس
|
||||||
|
|
||||||
|
var assembly = typeof(JobSchedulerRegistrator).Assembly;
|
||||||
|
|
||||||
|
var jobTypes = assembly.GetTypes()
|
||||||
|
.Where(t =>
|
||||||
|
t is { IsClass: true, IsAbstract: false, Namespace: not null } &&
|
||||||
|
t.Namespace.StartsWith(currentNamespace, StringComparison.Ordinal))
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
foreach (var jobType in jobTypes)
|
||||||
|
{
|
||||||
|
services.AddTransient(jobType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
45
BackgroundJobs/BackgroundJobs.Task/Program.cs
Normal file
45
BackgroundJobs/BackgroundJobs.Task/Program.cs
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
using _0_Framework.Application;
|
||||||
|
using _0_Framework.Application.Sms;
|
||||||
|
using _0_Framework.Application.UID;
|
||||||
|
using AccountManagement.Configuration;
|
||||||
|
using BackgroundJobs.Task;
|
||||||
|
using BackgroundJobs.Task.Jobs;
|
||||||
|
using Hangfire;
|
||||||
|
using Microsoft.AspNetCore.Identity;
|
||||||
|
using PersonalContractingParty.Config;
|
||||||
|
using Query.Bootstrapper;
|
||||||
|
using WorkFlow.Infrastructure.Config;
|
||||||
|
|
||||||
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
var hangfireConnectionString = builder.Configuration.GetConnectionString("HangfireDb");
|
||||||
|
builder.Services.AddHangfire(x => x.UseSqlServerStorage(hangfireConnectionString));
|
||||||
|
builder.Services.AddHangfireServer();
|
||||||
|
var connectionString = builder.Configuration.GetConnectionString("MesbahDb");
|
||||||
|
var connectionStringTestDb = builder.Configuration.GetConnectionString("TestDb");
|
||||||
|
builder.Services.AddSingleton<IPasswordHasher, PasswordHasher>();
|
||||||
|
builder.Services.AddTransient<IAuthHelper, AuthHelper>();
|
||||||
|
builder.Services.AddTransient<ISmsService, SmsService>();
|
||||||
|
builder.Services.AddTransient<IUidService, UidService>();
|
||||||
|
builder.Services.AddTransient<IFileUploader, FileUploader>();
|
||||||
|
builder.Services.Configure<AppSettingConfiguration>(builder.Configuration);
|
||||||
|
|
||||||
|
PersonalBootstrapper.Configure(builder.Services, connectionString);
|
||||||
|
TestDbBootStrapper.Configure(builder.Services, connectionStringTestDb);
|
||||||
|
AccountManagementBootstrapper.Configure(builder.Services, connectionString);
|
||||||
|
WorkFlowBootstrapper.Configure(builder.Services, connectionString);
|
||||||
|
QueryBootstrapper.Configure(builder.Services);
|
||||||
|
JobsBootstrapper.Configure(builder.Services);
|
||||||
|
builder.Services.AddHttpClient();
|
||||||
|
builder.Services.AddHttpContextAccessor();
|
||||||
|
var app = builder.Build();
|
||||||
|
|
||||||
|
app.MapHangfireDashboard();
|
||||||
|
app.MapGet("/", () => "Hello World!");
|
||||||
|
|
||||||
|
using (var scope = app.Services.CreateScope())
|
||||||
|
{
|
||||||
|
var jobScheduler = scope.ServiceProvider.GetRequiredService<JobSchedulerRegistrator>();
|
||||||
|
jobScheduler.Register();
|
||||||
|
}
|
||||||
|
|
||||||
|
app.Run();
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
{
|
||||||
|
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||||
|
"iisSettings": {
|
||||||
|
"windowsAuthentication": false,
|
||||||
|
"anonymousAuthentication": true,
|
||||||
|
"iisExpress": {
|
||||||
|
"applicationUrl": "http://localhost:56492",
|
||||||
|
"sslPort": 44378
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"profiles": {
|
||||||
|
"http": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"launchBrowser": true,
|
||||||
|
"applicationUrl": "http://localhost:5216",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"https": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"launchBrowser": true,
|
||||||
|
"applicationUrl": "https://localhost:7222;http://localhost:5216",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"IIS Express": {
|
||||||
|
"commandName": "IISExpress",
|
||||||
|
"launchBrowser": true,
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"DetailedErrors": true,
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft": "Warning",
|
||||||
|
"Microsoft.Hosting.Lifetime": "Information"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ConnectionStrings": {
|
||||||
|
//تست
|
||||||
|
//"MesbahDb": "Data Source=DESKTOP-NUE119G\\MSNEW;Initial Catalog=Mesbah_db;Integrated Security=True"
|
||||||
|
|
||||||
|
//server
|
||||||
|
//"MesbahDb": "Data Source=171.22.24.15;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]18[3019]#@ATt;TrustServerCertificate=true;",
|
||||||
|
|
||||||
|
|
||||||
|
//local
|
||||||
|
"MesbahDb": "Data Source=.;Initial Catalog=mesbah_db;Integrated Security=True;TrustServerCertificate=true;",
|
||||||
|
|
||||||
|
//dad-mehr
|
||||||
|
//"MesbahDb": "Data Source=.;Initial Catalog=teamWork;Integrated Security=True;TrustServerCertificate=true;",
|
||||||
|
|
||||||
|
"TestDb": "Data Source=.;Initial Catalog=TestDb;Integrated Security=True;TrustServerCertificate=true;",
|
||||||
|
|
||||||
|
//mahan Docker
|
||||||
|
//"MesbahDb": "Data Source=localhost,5069;Initial Catalog=mesbah_db;User ID=sa;Password=YourPassword123;TrustServerCertificate=True;",
|
||||||
|
"HangfireDb": "Data Source=.;Initial Catalog=hangfire_db;Integrated Security=True;TrustServerCertificate=true;"
|
||||||
|
},
|
||||||
|
|
||||||
|
"GoogleRecaptchaV3": {
|
||||||
|
"SiteKey": "6Lfhp_AnAAAAAB79WkrMoHd1k8ir4m8VvfjE7FTH",
|
||||||
|
"SecretKey": "6Lfhp_AnAAAAANjDDY6DPrbbUQS7k6ZCRmrVP5Lb"
|
||||||
|
},
|
||||||
|
"SmsSecrets": {
|
||||||
|
"ApiKey": "Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa",
|
||||||
|
"SecretKey": "dadmehr"
|
||||||
|
},
|
||||||
|
"Domain": ".gozareshgir.ir",
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
9
BackgroundJobs/BackgroundJobs.Task/appsettings.json
Normal file
9
BackgroundJobs/BackgroundJobs.Task/appsettings.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AllowedHosts": "*"
|
||||||
|
}
|
||||||
@@ -30,7 +30,7 @@ public class Checkout : EntityBase
|
|||||||
string overNightWorkValue, string fridayWorkValue, string rotatingShifValue, string absenceValue,
|
string overNightWorkValue, string fridayWorkValue, string rotatingShifValue, string absenceValue,
|
||||||
string totalDayOfLeaveCompute, string totalDayOfYearsCompute, string totalDayOfBunosesCompute,
|
string totalDayOfLeaveCompute, string totalDayOfYearsCompute, string totalDayOfBunosesCompute,
|
||||||
ICollection<CheckoutLoanInstallment> loanInstallments,
|
ICollection<CheckoutLoanInstallment> loanInstallments,
|
||||||
ICollection<CheckoutSalaryAid> salaryAids,CheckoutRollCall checkoutRollCall,TimeSpan employeeMandatoryHours)
|
ICollection<CheckoutSalaryAid> salaryAids,CheckoutRollCall checkoutRollCall)
|
||||||
{
|
{
|
||||||
EmployeeFullName = employeeFullName;
|
EmployeeFullName = employeeFullName;
|
||||||
FathersName = fathersName;
|
FathersName = fathersName;
|
||||||
@@ -90,10 +90,8 @@ public class Checkout : EntityBase
|
|||||||
LoanInstallments = loanInstallments;
|
LoanInstallments = loanInstallments;
|
||||||
SalaryAids = salaryAids;
|
SalaryAids = salaryAids;
|
||||||
CheckoutRollCall = checkoutRollCall;
|
CheckoutRollCall = checkoutRollCall;
|
||||||
EmployeeMandatoryHours = employeeMandatoryHours;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public string EmployeeFullName { get; private set; }
|
public string EmployeeFullName { get; private set; }
|
||||||
public string IsActiveString { get; private set; }
|
public string IsActiveString { get; private set; }
|
||||||
public string Signature { get; private set; }
|
public string Signature { get; private set; }
|
||||||
@@ -195,15 +193,6 @@ public class Checkout : EntityBase
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string TotalDayOfBunosesCompute { get; private set; }
|
public string TotalDayOfBunosesCompute { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// دارای تداخل مبلغ است. این در زمانی اتفاق می افتد که فیش مبلغ آن تغییر کرده ولی به دلیل مسائل قانونی امکان صدور دوباره آن وجود ندارد
|
|
||||||
/// </summary>
|
|
||||||
public bool HasAmountConflict { get; private set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ساعت موظفی پرسنل در ماه
|
|
||||||
/// </summary>
|
|
||||||
public TimeSpan EmployeeMandatoryHours { get; set; }
|
|
||||||
|
|
||||||
#region valueObjects
|
#region valueObjects
|
||||||
|
|
||||||
@@ -327,16 +316,6 @@ public class Checkout : EntityBase
|
|||||||
{
|
{
|
||||||
CheckoutRollCall = checkoutRollCall;
|
CheckoutRollCall = checkoutRollCall;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetAmountConflict(bool hasAmountConflict)
|
|
||||||
{
|
|
||||||
HasAmountConflict = hasAmountConflict;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetEmployeeMandatoryHours(TimeSpan employeeMandatoryHours)
|
|
||||||
{
|
|
||||||
EmployeeMandatoryHours = employeeMandatoryHours;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CheckoutRollCall
|
public class CheckoutRollCall
|
||||||
|
|||||||
@@ -78,6 +78,4 @@ public interface ICheckoutRepository : IRepository<long, Checkout>
|
|||||||
long workshopId, DateTime start, DateTime end);
|
long workshopId, DateTime start, DateTime end);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Task<Checkout> GetByWorkshopIdEmployeeIdInDate(long workshopId, long employeeId, DateTime inDate);
|
|
||||||
}
|
}
|
||||||
@@ -10,7 +10,6 @@ namespace Company.Domain.ClassifiedSalaryAgg
|
|||||||
{
|
{
|
||||||
public class ClassifiedSalary : EntityBase
|
public class ClassifiedSalary : EntityBase
|
||||||
{
|
{
|
||||||
//test
|
|
||||||
public ClassifiedSalary(double group1, double group2, double group3, double group4, double group5, double group6, double group7, double group8, double group9, double group10, double group11, double group12, double group13, double group14, double group15, double group16, double group17, double group18, double group19, double group20, DateTime startDate, DateTime endDate, int year)
|
public ClassifiedSalary(double group1, double group2, double group3, double group4, double group5, double group6, double group7, double group8, double group9, double group10, double group11, double group12, double group13, double group14, double group15, double group16, double group17, double group18, double group19, double group20, DateTime startDate, DateTime endDate, int year)
|
||||||
{
|
{
|
||||||
Group1 = group1;
|
Group1 = group1;
|
||||||
|
|||||||
@@ -8,12 +8,10 @@ namespace Company.Domain.ContractingPartyBankAccountsAgg;
|
|||||||
|
|
||||||
public interface IContractingPartyBankAccountsRepository:IRepository<long,ContractingPartyBankAccount>
|
public interface IContractingPartyBankAccountsRepository:IRepository<long,ContractingPartyBankAccount>
|
||||||
{
|
{
|
||||||
Task<GetContractingPartyBankAccountViewModel> GetList(ContractingPartyBankAccountSearchModel searchModel);
|
Task<OperationResult<List<GetContractingPartyBankAccountViewModel>>> GetList(ContractingPartyBankAccountSearchModel searchModel);
|
||||||
Task<List<string>> ContractingPartyOrAccountHolderNameSelectList(string search, string selected);
|
Task<OperationResult<List<string>>> ContractingPartyOrAccountHolderNameSelectList(string search, string selected);
|
||||||
Task<List<string>> IBanSelectList(string search, string selected);
|
Task<OperationResult<List<string>>> IBanSelectList(string search, string selected);
|
||||||
|
|
||||||
Task<List<string>> CardNumberSelectList(string search, string selected);
|
Task<OperationResult<List<string>>> CardNumberSelectList(string search, string selected);
|
||||||
Task<List<string>> AccountNumberSelectList(string search, string selected);
|
Task<OperationResult<List<string>>> AccountNumberSelectList(string search, string selected);
|
||||||
Task<List<string>> GetAccountHolderNameSelectList(string search, string selected);
|
|
||||||
Task<List<string>> ContractingPartyNamesSelectList(string search, string selected);
|
|
||||||
}
|
}
|
||||||
@@ -374,13 +374,6 @@ public class CustomizeCheckout : EntityBase
|
|||||||
TotalPayment = TotalPayment - previousAmount + newAmount;
|
TotalPayment = TotalPayment - previousAmount + newAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// آیا مغایرت مبلغ دارد
|
|
||||||
/// </summary>
|
|
||||||
public bool HasAmountConflict { get; private set; }
|
|
||||||
|
|
||||||
public void SetHasAmountConflict(bool hasConflict)
|
|
||||||
{
|
|
||||||
HasAmountConflict = hasConflict;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -377,16 +377,4 @@ public class CustomizeCheckoutTemp : EntityBase
|
|||||||
{
|
{
|
||||||
TotalPayment = TotalPayment - previousAmount + newAmount;
|
TotalPayment = TotalPayment - previousAmount + newAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// آیا مغایرت مبلغ دارد
|
|
||||||
/// </summary>
|
|
||||||
public bool HasAmountConflict { get; private set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void SetHasAmountConflict(bool hasConflict)
|
|
||||||
{
|
|
||||||
HasAmountConflict = hasConflict;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -13,14 +13,12 @@ namespace Company.Domain.FinancialStatmentAgg;
|
|||||||
public interface IFinancialStatmentRepository : IRepository<long, FinancialStatment>
|
public interface IFinancialStatmentRepository : IRepository<long, FinancialStatment>
|
||||||
{
|
{
|
||||||
|
|
||||||
[Obsolete("این متد منسوخ شده است. لطفاً از متد GetDetailsByContractingParty استفاده کنید.")]
|
|
||||||
FinancialStatmentViewModel GetDetailsByContractingPartyId(long contractingPartyId);
|
FinancialStatmentViewModel GetDetailsByContractingPartyId(long contractingPartyId);
|
||||||
List<FinancialStatmentViewModel> Search(FinancialStatmentSearchModel searchModel);
|
List<FinancialStatmentViewModel> Search(FinancialStatmentSearchModel searchModel);
|
||||||
Task<ClientFinancialStatementViewModel> GetClientFinancialStatement(long accountId,
|
Task<ClientFinancialStatementViewModel> GetClientFinancialStatement(long accountId,
|
||||||
FinancialStatementSearchModel searchModel);
|
ClientFinancialStatementSearchModel searchModel);
|
||||||
|
|
||||||
Task<OperationResult<ClientFinancialStatementViewModel>> GetDetailsByPublicId(string publicId);
|
Task<OperationResult<ClientFinancialStatementViewModel>> GetDetailsByPublicId(string publicId);
|
||||||
Task<GetFinancialStatementBalanceAmount> GetBalanceAmount(long id);
|
Task<GetFinancialStatementBalanceAmount> GetBalanceAmount(long id);
|
||||||
Task<double> GetClientDebtAmount(long accountId);
|
Task<double> GetClientDebtAmount(long accountId);
|
||||||
Task<FinancialStatmentDetailsByContractingPartyViewModel> GetDetailsByContractingParty(long contractingPartyId,FinancialStatementSearchModel searchModel);
|
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using _0_Framework.Application;
|
|
||||||
using _0_Framework.Domain;
|
using _0_Framework.Domain;
|
||||||
using CompanyManagment.App.Contracts.InstitutionContract;
|
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||||
using CompanyManagment.App.Contracts.Workshop;
|
using CompanyManagment.App.Contracts.Workshop;
|
||||||
@@ -44,7 +43,4 @@ public interface IInstitutionContractRepository : IRepository<long, InstitutionC
|
|||||||
/// <param name="endOfMonth"></param>
|
/// <param name="endOfMonth"></param>
|
||||||
/// <param name="description"></param>
|
/// <param name="description"></param>
|
||||||
void RollcallServiceCreateTransaction();
|
void RollcallServiceCreateTransaction();
|
||||||
|
|
||||||
Task<PagedResult<GetInstitutionContractListItemsViewModel>> GetList(InstitutionContractListSearchModel searchModel);
|
|
||||||
Task<GetInstitutionContractListStatsViewModel> GetListStats(InstitutionContractListSearchModel searchModel);
|
|
||||||
}
|
}
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using _0_Framework.Domain;
|
|
||||||
using CompanyManagment.App.Contracts.PaymentInstrument;
|
|
||||||
|
|
||||||
namespace Company.Domain.PaymentInstrumentAgg;
|
|
||||||
|
|
||||||
public interface IPaymentInstrumentGroupRepository:IRepository<long,PaymentInstrumentGroup>
|
|
||||||
{
|
|
||||||
void Remove(PaymentInstrumentGroup paymentInstrumentGroup);
|
|
||||||
Task<List<PaymentInstrumentGroupsViewModel>> GetList();
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using _0_Framework.Application;
|
|
||||||
using _0_Framework.Domain;
|
|
||||||
using CompanyManagment.App.Contracts.PaymentInstrument;
|
|
||||||
|
|
||||||
namespace Company.Domain.PaymentInstrumentAgg;
|
|
||||||
|
|
||||||
public interface IPaymentInstrumentRepository:IRepository<long,PaymentInstrument>
|
|
||||||
{
|
|
||||||
Task<GetPaymentInstrumentListViewModel> GetList(PaymentInstrumentSearchModel searchModel);
|
|
||||||
Task<List<PosTerminalSelectListViewModel>> GetPosTerminalSelectList(string search);
|
|
||||||
Task<List<string>> PosTerminalIdSelectList(string search, string selected);
|
|
||||||
Task<List<string>> IbanSelectList(string search, string selected);
|
|
||||||
Task<List<string>> AccountNumberSelectList(string search, string selected);
|
|
||||||
Task<List<string>> CardNumberSelectList(string search, string selected);
|
|
||||||
Task<List<string>> AccountHolderNameSelectList(string search, string selected);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
using _0_Framework.Domain;
|
|
||||||
using CompanyManagment.App.Contracts.PaymentInstrument;
|
|
||||||
|
|
||||||
namespace Company.Domain.PaymentInstrumentAgg;
|
|
||||||
|
|
||||||
public class PaymentInstrument:EntityBase
|
|
||||||
{
|
|
||||||
private PaymentInstrument(string cardNumber, string accountHolderName, string accountNumber,string iBan,bool isAuth,long paymentInstrumentGroupId)
|
|
||||||
{
|
|
||||||
CardNumber = cardNumber;
|
|
||||||
AccountHolderName = accountHolderName;
|
|
||||||
AccountNumber = accountNumber;
|
|
||||||
IBan = iBan;
|
|
||||||
IsAuth = isAuth;
|
|
||||||
PaymentInstrumentGroupId = paymentInstrumentGroupId;
|
|
||||||
Type = PaymentInstrumentType.BankAccount;
|
|
||||||
}
|
|
||||||
|
|
||||||
private PaymentInstrument(string posTerminalId , string description,long paymentInstrumentGroupId)
|
|
||||||
{
|
|
||||||
PosTerminalId = posTerminalId;
|
|
||||||
Description = description;
|
|
||||||
PaymentInstrumentGroupId = paymentInstrumentGroupId;
|
|
||||||
Type = PaymentInstrumentType.Pos;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static PaymentInstrument CreatePosType(string posTerminalId, string description, long paymentInstrumentGroupId)
|
|
||||||
{
|
|
||||||
return new PaymentInstrument(posTerminalId, description, paymentInstrumentGroupId);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static PaymentInstrument CreateBankAccount(string cardNumber, string accountHolderName, string accountNumber,
|
|
||||||
string iBan, bool isAuth, long paymentInstrumentGroupId)
|
|
||||||
{
|
|
||||||
return new PaymentInstrument(cardNumber, accountHolderName, accountNumber, iBan, isAuth, paymentInstrumentGroupId);
|
|
||||||
}
|
|
||||||
|
|
||||||
public string CardNumber { get; private set; }
|
|
||||||
public string AccountHolderName { get; private set; }
|
|
||||||
public string AccountNumber { get; private set; }
|
|
||||||
public string IBan { get; private set; }
|
|
||||||
|
|
||||||
public string PosTerminalId { get; private set; }
|
|
||||||
public string Description { get; set; }
|
|
||||||
|
|
||||||
public PaymentInstrumentType Type { get; private set; }
|
|
||||||
|
|
||||||
public bool IsAuth { get; private set; }
|
|
||||||
|
|
||||||
public long PaymentInstrumentGroupId { get; private set; }
|
|
||||||
public PaymentInstrumentGroup PaymentInstrumentGroup { get; private set; }
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using _0_Framework.Application;
|
|
||||||
using _0_Framework.Domain;
|
|
||||||
|
|
||||||
namespace Company.Domain.PaymentInstrumentAgg;
|
|
||||||
|
|
||||||
public class PaymentInstrumentGroup:EntityBase
|
|
||||||
{
|
|
||||||
public PaymentInstrumentGroup(string name)
|
|
||||||
{
|
|
||||||
Name = name;
|
|
||||||
IsActive = IsActive.True;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Name { get; private set; }
|
|
||||||
public IsActive IsActive { get; private set; }
|
|
||||||
public List<PaymentInstrument> PaymentInstruments { get; set; }
|
|
||||||
|
|
||||||
public void Edit(string name)
|
|
||||||
{
|
|
||||||
Name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void DeActive()
|
|
||||||
{
|
|
||||||
IsActive = IsActive.False;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -15,7 +15,7 @@ namespace Company.Domain.RollCallAgg;
|
|||||||
|
|
||||||
public interface IRollCallMandatoryRepository : IRepository<long, RollCall>
|
public interface IRollCallMandatoryRepository : IRepository<long, RollCall>
|
||||||
{
|
{
|
||||||
ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout, bool rotatingShiftCompute, bool totalLeaveCompute);
|
ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout, bool rotatingShiftCompute);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// محاسبه ساعات کارکرد پرسنل در صورت داشتن حضور غیاب
|
/// محاسبه ساعات کارکرد پرسنل در صورت داشتن حضور غیاب
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using _0_Framework.Domain;
|
using _0_Framework.Domain;
|
||||||
using CompanyManagment.App.Contracts.Reward;
|
using CompanyManagment.App.Contracts.Reward;
|
||||||
using CompanyManagment.App.Contracts.SalaryAid;
|
using CompanyManagment.App.Contracts.SalaryAid;
|
||||||
@@ -22,5 +21,4 @@ public interface ISalaryAidRepository:IRepository<long,SalaryAid>
|
|||||||
|
|
||||||
SalaryAidsGroupedViewModel GetSearchListAsGrouped(SalaryAidSearchViewModel searchModel);
|
SalaryAidsGroupedViewModel GetSearchListAsGrouped(SalaryAidSearchViewModel searchModel);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -21,18 +21,6 @@ public interface IYearlySalaryRepository : IRepository<long, YearlySalary>
|
|||||||
double GetLeavePay(DateTime contractStart, DateTime contractEnd, double daylyWage, double consumableItem, double housingAllowance, double familyAllowance , string weeklyWorkingTime, int officialholiday, int friday, string totalHoursH, string totalHorsM);
|
double GetLeavePay(DateTime contractStart, DateTime contractEnd, double daylyWage, double consumableItem, double housingAllowance, double familyAllowance , string weeklyWorkingTime, int officialholiday, int friday, string totalHoursH, string totalHorsM);
|
||||||
double GetOverTimeWorking(double dayliWage, string overTimeWorkH, string overTimeWorkM);
|
double GetOverTimeWorking(double dayliWage, string overTimeWorkH, string overTimeWorkM);
|
||||||
double GetOverNightWorking(double dayliWage, string overNightWorkH, string overNightWorkM, string weeklyWorkingTime, int officialholiday, int friday, DateTime contractStart, DateTime contractEnd, string totalHoursH, string totalHorsM);
|
double GetOverNightWorking(double dayliWage, string overNightWorkH, string overNightWorkM, string weeklyWorkingTime, int officialholiday, int friday, DateTime contractStart, DateTime contractEnd, string totalHoursH, string totalHorsM);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// متد محاسبه پایه سنوات و لیست پایه سنوات های پرسنل
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="contractStart"></param>
|
|
||||||
/// <param name="contractEnd"></param>
|
|
||||||
/// <param name="employeeId"></param>
|
|
||||||
/// <param name="workshopId"></param>
|
|
||||||
/// <param name="leftWorkList"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<BaseYearDataViewModel> BaseYearCompute(DateTime contractStart, DateTime contractEnd, long employeeId,
|
|
||||||
long workshopId, List<LeftWorkViewModel> leftWorkList);
|
|
||||||
DayliFeeViewModel DayliFeeComputing(DateTime startDateW,DateTime contractStart, DateTime endDateW, long employeeId, long workshopId,List<LeftWorkViewModel> leftWorkList);
|
DayliFeeViewModel DayliFeeComputing(DateTime startDateW,DateTime contractStart, DateTime endDateW, long employeeId, long workshopId,List<LeftWorkViewModel> leftWorkList);
|
||||||
Task<DayliFeeViewModel> DayliFeeComputingAsync(DateTime startDateW, DateTime contractStart, DateTime endDateW, long employeeId, long workshopId, List<LeftWorkViewModel> leftWorkList);
|
Task<DayliFeeViewModel> DayliFeeComputingAsync(DateTime startDateW, DateTime contractStart, DateTime endDateW, long employeeId, long workshopId, List<LeftWorkViewModel> leftWorkList);
|
||||||
string ConsumableItems(DateTime endDateW);
|
string ConsumableItems(DateTime endDateW);
|
||||||
|
|||||||
@@ -141,9 +141,7 @@ public class CheckoutViewModel
|
|||||||
public List<LoanInstallmentViewModel> InstallmentViewModels { get; set; }
|
public List<LoanInstallmentViewModel> InstallmentViewModels { get; set; }
|
||||||
public List<SalaryAidViewModel> SalaryAidViewModels { get; set; }
|
public List<SalaryAidViewModel> SalaryAidViewModels { get; set; }
|
||||||
public CheckoutRollCallViewModel CheckoutRollCall { get; set; }
|
public CheckoutRollCallViewModel CheckoutRollCall { get; set; }
|
||||||
public bool HasAmountConflict { get; set; }
|
|
||||||
public string EmployeeMandatoryHoursStr { get; set; }
|
|
||||||
public TimeSpan EmployeeMandatoryHoursTimeSpan { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CheckoutRollCallViewModel
|
public class CheckoutRollCallViewModel
|
||||||
|
|||||||
@@ -135,11 +135,6 @@ public class CreateCheckout
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string TotalDayOfBunosesCompute { get; set; }
|
public string TotalDayOfBunosesCompute { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ساعت موظفی پرسنل برای این ماه
|
|
||||||
/// </summary>
|
|
||||||
public TimeSpan EmployeeMandatoryHours { get; set; }
|
|
||||||
|
|
||||||
public bool HolidayWorking { get; set; }
|
public bool HolidayWorking { get; set; }
|
||||||
|
|
||||||
public string ShiftWork { get; set; }
|
public string ShiftWork { get; set; }
|
||||||
|
|||||||
@@ -56,14 +56,5 @@ public class ComputingViewModel
|
|||||||
public TimeSpan TotalPaidLeave { get; set; }
|
public TimeSpan TotalPaidLeave { get; set; }
|
||||||
public TimeSpan TotalSickLeave { get; set; }
|
public TimeSpan TotalSickLeave { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ساعت موظفی پرسنل برای این ماه
|
|
||||||
/// </summary>
|
|
||||||
public TimeSpan EmployeeMandatoryHours { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// مجموع مرخصی های پرسنل در این فیش حقوقی
|
|
||||||
/// </summary>
|
|
||||||
//public TimeSpan TotalLeaveOnThisCheckout { get; set; }
|
|
||||||
//public List<string> holidays;
|
//public List<string> holidays;
|
||||||
}
|
}
|
||||||
@@ -6,16 +6,6 @@ namespace CompanyManagment.App.Contracts.ContractingPartyBankAccounts;
|
|||||||
/// لیست اطلاعات بانکی طرف حساب
|
/// لیست اطلاعات بانکی طرف حساب
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class GetContractingPartyBankAccountViewModel
|
public class GetContractingPartyBankAccountViewModel
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// تعداد
|
|
||||||
/// </summary>
|
|
||||||
public int Count { get; set; }
|
|
||||||
public List<ContractingPartyBankAccountsGroupedViewModel> List { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ContractingPartyBankAccountsGroupedViewModel
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// لیست حساب های بانکی
|
/// لیست حساب های بانکی
|
||||||
@@ -37,7 +27,6 @@ public class ContractingPartyBankAccountsGroupedViewModel
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string WorkshopName { get; set; }
|
public string WorkshopName { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// حساب بانکی طرف حساب
|
/// حساب بانکی طرف حساب
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -18,14 +18,14 @@ public interface IContractingPartyBankAccountsApplication
|
|||||||
/// <param name="command"></param>
|
/// <param name="command"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<OperationResult> Create(CreateContractingPartyBankAccounts command);
|
Task<OperationResult> Create(CreateContractingPartyBankAccounts command);
|
||||||
Task<OperationResult> Create(List<CreateContractingPartyBankAccounts> commands);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// لیست اطلاعات طرف حساب بانکی
|
/// لیست اطلاعات طرف حساب بانکی
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="searchModel"></param>
|
/// <param name="searchModel"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<GetContractingPartyBankAccountViewModel> GetList(ContractingPartyBankAccountSearchModel searchModel);
|
Task<OperationResult<List<GetContractingPartyBankAccountViewModel>>> GetList(
|
||||||
|
ContractingPartyBankAccountSearchModel searchModel);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// سلکت لیست جستجو برای نام طرف حساب / صاحب حساب
|
/// سلکت لیست جستجو برای نام طرف حساب / صاحب حساب
|
||||||
@@ -33,7 +33,7 @@ public interface IContractingPartyBankAccountsApplication
|
|||||||
/// <param name="search">نام جستجو</param>
|
/// <param name="search">نام جستجو</param>
|
||||||
/// <param name="selected">نام سلکت شده</param>
|
/// <param name="selected">نام سلکت شده</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<List<string>> ContractingPartyOrAccountHolderNameSelectList(string search, string selected);
|
Task<OperationResult<List<string>>> ContractingPartyOrAccountHolderNameSelectList(string search, string selected);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// سلکت لیست شماره کارت
|
/// سلکت لیست شماره کارت
|
||||||
@@ -41,7 +41,7 @@ public interface IContractingPartyBankAccountsApplication
|
|||||||
/// <param name="search">نام جستجو</param>
|
/// <param name="search">نام جستجو</param>
|
||||||
/// <param name="selected">نام سلکت شده</param>
|
/// <param name="selected">نام سلکت شده</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<List<string>> CardNumberSelectList(string search, string selected);
|
Task<OperationResult<List<string>>> CardNumberSelectList(string search, string selected);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// سلکت لیست شماره شبا
|
/// سلکت لیست شماره شبا
|
||||||
@@ -49,7 +49,7 @@ public interface IContractingPartyBankAccountsApplication
|
|||||||
/// <param name="search">نام جستجو</param>
|
/// <param name="search">نام جستجو</param>
|
||||||
/// <param name="selected">نام سلکت شده</param>
|
/// <param name="selected">نام سلکت شده</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<List<string>> IBanSelectList(string search, string selected);
|
Task<OperationResult<List<string>>> IBanSelectList(string search, string selected);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// سلکت لیست شماره حساب
|
/// سلکت لیست شماره حساب
|
||||||
@@ -57,22 +57,6 @@ public interface IContractingPartyBankAccountsApplication
|
|||||||
/// <param name="search">نام جستجو</param>
|
/// <param name="search">نام جستجو</param>
|
||||||
/// <param name="selected">نام سلکت شده</param>
|
/// <param name="selected">نام سلکت شده</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<List<string>> AccountNumberSelectList(string search, string selected);
|
Task<OperationResult<List<string>>> AccountNumberSelectList(string search, string selected);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// سلکت لیست نام صاحبان حساب
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="search">نام جستجو</param>
|
|
||||||
/// <param name="selected">نام سلکت شده</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<string>> GetAccountHolderNameSelectList(string search, string selected);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// سلکت لیست نام طرف حسابها
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="search">نام جستجو</param>
|
|
||||||
/// <param name="selected">نام سلکت شده</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<string>> ContractingPartyNamesSelectList(string search, string selected);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -109,8 +109,6 @@ namespace CompanyManagment.App.Contracts.CustomizeCheckout
|
|||||||
public List<CustomizeRotatingShift> CustomizeRotatingShifts { get; set; }
|
public List<CustomizeRotatingShift> CustomizeRotatingShifts { get; set; }
|
||||||
public List<CustomizeSifts> RegularShift { get; set; }
|
public List<CustomizeSifts> RegularShift { get; set; }
|
||||||
|
|
||||||
public bool HasAmountConflict { get; set; }
|
|
||||||
|
|
||||||
//public bool HasLeft { get; set; }
|
//public bool HasLeft { get; set; }
|
||||||
//public string IsBlockCantracingParty { get; set; }
|
//public string IsBlockCantracingParty { get; set; }
|
||||||
//public string IsActiveString { get; set; }
|
//public string IsActiveString { get; set; }
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace CompanyManagment.App.Contracts.FinancialStatment;
|
namespace CompanyManagment.App.Contracts.FinancialStatment;
|
||||||
|
|
||||||
public class FinancialStatementSearchModel
|
public class ClientFinancialStatementSearchModel
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// از تاریخ
|
/// از تاریخ
|
||||||
@@ -30,5 +30,5 @@ public class ClientFinancialStatementViewModel
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// تراکنش ها
|
/// تراکنش ها
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public List<FinancialTransactionDetailViewModel> Transactions { get; set; }
|
public List<ClientFinancialTransactionViewModel> Transactions { get; set; }
|
||||||
}
|
}
|
||||||
@@ -2,9 +2,8 @@
|
|||||||
|
|
||||||
namespace CompanyManagment.App.Contracts.FinancialStatment;
|
namespace CompanyManagment.App.Contracts.FinancialStatment;
|
||||||
|
|
||||||
public class FinancialTransactionDetailViewModel
|
public class ClientFinancialTransactionViewModel
|
||||||
{
|
{
|
||||||
public long Id { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// زمان و تاریخ میلادی
|
/// زمان و تاریخ میلادی
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using _0_Framework.Application;
|
||||||
using _0_Framework.Application;
|
|
||||||
using CompanyManagment.App.Contracts.FinancilTransaction;
|
using CompanyManagment.App.Contracts.FinancilTransaction;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -20,7 +19,6 @@ public interface IFinancialStatmentApplication
|
|||||||
OperationResult Create(CreateFinancialStatment command);
|
OperationResult Create(CreateFinancialStatment command);
|
||||||
|
|
||||||
List<FinancialStatmentViewModel> Search(FinancialStatmentSearchModel searchModel);
|
List<FinancialStatmentViewModel> Search(FinancialStatmentSearchModel searchModel);
|
||||||
[Obsolete("این متد منسوخ شده است. لطفاً از متد GetDetailsByContractingParty استفاده کنید.")]
|
|
||||||
FinancialStatmentViewModel GetDetailsByContractingPartyId(long contractingPartyId);
|
FinancialStatmentViewModel GetDetailsByContractingPartyId(long contractingPartyId);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -29,10 +27,9 @@ public interface IFinancialStatmentApplication
|
|||||||
/// <param name="searchModel"></param>
|
/// <param name="searchModel"></param>
|
||||||
/// <param name="accountId"></param>
|
/// <param name="accountId"></param>
|
||||||
/// <returns>مدل صورت حساب مالی کلاینت</returns>
|
/// <returns>مدل صورت حساب مالی کلاینت</returns>
|
||||||
Task<ClientFinancialStatementViewModel> GetClientFinancialStatement(FinancialStatementSearchModel searchModel,
|
Task<ClientFinancialStatementViewModel> GetClientFinancialStatement(ClientFinancialStatementSearchModel searchModel,
|
||||||
long accountId);
|
long accountId);
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// نمایش اطلاعات صورت حساب مالی کلاینت بر اساس کد هش
|
/// نمایش اطلاعات صورت حساب مالی کلاینت بر اساس کد هش
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -53,46 +50,6 @@ public interface IFinancialStatmentApplication
|
|||||||
/// <param name="accountId"></param>
|
/// <param name="accountId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<double> GetClientDebtAmount(long accountId);
|
Task<double> GetClientDebtAmount(long accountId);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// جزئیات بر اساس
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="contractingPartyId"></param>
|
|
||||||
/// <param name="searchModel"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<FinancialStatmentDetailsByContractingPartyViewModel> GetDetailsByContractingParty(long contractingPartyId,
|
|
||||||
FinancialStatementSearchModel searchModel);
|
|
||||||
}
|
|
||||||
|
|
||||||
public class FinancialStatmentDetailsByContractingPartyViewModel
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// آیدی FinancialStatement
|
|
||||||
/// </summary>
|
|
||||||
public long Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// نام طرف حساب
|
|
||||||
/// </summary>
|
|
||||||
public string ContractingPartyName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// جمع بدهکاری
|
|
||||||
/// </summary>
|
|
||||||
public double TotalDebt { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// جمع بستانکاری
|
|
||||||
/// </summary>
|
|
||||||
public double TotalCredit { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// مبلغ قابل پرداخت
|
|
||||||
/// </summary>
|
|
||||||
public double TotalAmountPayable { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// تراکنش ها
|
|
||||||
/// </summary>
|
|
||||||
public List<FinancialTransactionDetailViewModel> List { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GetFinancialStatementBalanceAmount
|
public class GetFinancialStatementBalanceAmount
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using CompanyManagment.App.Contracts.InstitutionContractContactinfo;
|
|
||||||
|
|
||||||
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
|
||||||
|
|
||||||
public class CreateInstitutionContractRequest
|
|
||||||
{
|
|
||||||
public List<CreateContactInfo> ContactInfos { get; set; }
|
|
||||||
public long ContractingPartyId { get; set; }
|
|
||||||
public long RepresentativeId { get; set; }
|
|
||||||
public string TypeOfContract { get; set; }
|
|
||||||
public string ContractDateFa { get; set; }
|
|
||||||
public string ContractStartFa { get; set; }
|
|
||||||
public string ContractEndFa { get; set; }
|
|
||||||
public string Address { get; set; }
|
|
||||||
public string State { get; set; }
|
|
||||||
public string City { get; set; }
|
|
||||||
public string OfficialCompany { get; set; }
|
|
||||||
public string HasValueAddedTax { get; set; }
|
|
||||||
public string ContractAmountString { get; set; }
|
|
||||||
public string DailyCompenseationString { get; set; }
|
|
||||||
public string ObligationString { get; set; }
|
|
||||||
public string TotalAmountString { get; set; }
|
|
||||||
public string ValueAddedTaxStr { get; set; }
|
|
||||||
public string WorkshopManualCount { get; set; }
|
|
||||||
public string EmployeeManualCount { get; set; }
|
|
||||||
public string Description { get; set; }
|
|
||||||
public int ExtensionNo { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
|
||||||
|
|
||||||
public class EditInstitutionContractRequest:CreateInstitutionContractRequest
|
|
||||||
{
|
|
||||||
public long Id { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
|
||||||
|
|
||||||
public class GetInstitutionContractListItemsViewModel
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// آیدی
|
|
||||||
/// </summary>
|
|
||||||
public long Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// دارای امضا
|
|
||||||
/// </summary>
|
|
||||||
public bool HasSigniture { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// شماره قرارداد
|
|
||||||
/// </summary>
|
|
||||||
public string ContractNo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// نام معرف
|
|
||||||
/// </summary>
|
|
||||||
public string RepresentativeName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// نام طرف حساب
|
|
||||||
/// </summary>
|
|
||||||
public string ContractingPartyName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// شماره کارفرما
|
|
||||||
/// </summary>
|
|
||||||
public string ArchiveNo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// نام کارفرماها
|
|
||||||
/// </summary>
|
|
||||||
public List<string> EmployerNames { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// تعداد کارگاه
|
|
||||||
/// </summary>
|
|
||||||
public int WorkshopsCount { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// نام کارگاه ها
|
|
||||||
/// </summary>
|
|
||||||
public List<string> WorkshopNames { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// تعداد پرسنل
|
|
||||||
/// </summary>
|
|
||||||
public int EmployeesCount { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// شروع قرارداد
|
|
||||||
/// </summary>
|
|
||||||
public string ContractStartFa { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// پایان قرارداد
|
|
||||||
/// </summary>
|
|
||||||
public string ContractEndFa { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// مبلغ قرارداد
|
|
||||||
/// </summary>
|
|
||||||
public double ContractAmount { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// وضعیت مالی
|
|
||||||
/// </summary>
|
|
||||||
public double Balance { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// وضعیت قرارداد
|
|
||||||
/// </summary>
|
|
||||||
public InstitutionContractStatus Status { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// آیا منقضی شده است
|
|
||||||
/// </summary>
|
|
||||||
public bool IsExpired { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// لیست قرارداد های موسسه
|
|
||||||
/// </summary>
|
|
||||||
public class GetInstitutionContractListViewModel
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// بدهی کل
|
|
||||||
/// </summary>
|
|
||||||
public double TotalDebt { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// مبلغ قرارداد ها
|
|
||||||
/// </summary>
|
|
||||||
public double TotalAmount { get; set; }
|
|
||||||
|
|
||||||
public List<GetInstitutionContractListItemsViewModel> Items { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,12 +1,8 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using _0_Framework.Application;
|
using _0_Framework.Application;
|
||||||
using CompanyManagment.App.Contracts.Checkout;
|
using CompanyManagment.App.Contracts.Checkout;
|
||||||
using CompanyManagment.App.Contracts.Workshop;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
||||||
|
|
||||||
@@ -27,107 +23,19 @@ public interface IInstitutionContractApplication
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
List<InstitutionContractViewModel> GetInstitutionContractToSetServicesExcelImport();
|
List<InstitutionContractViewModel> GetInstitutionContractToSetServicesExcelImport();
|
||||||
|
|
||||||
List<InstitutionContractViewModel> PrintAll(List<long> id);
|
List<InstitutionContractViewModel> PrintAll(List<long> id);
|
||||||
InstitutionContractViewModel PrintOne(long id);
|
InstitutionContractViewModel PrintOne(long id);
|
||||||
|
|
||||||
OperationResult Active(long id);
|
OperationResult Active(long id);
|
||||||
|
|
||||||
|
|
||||||
OperationResult DeActive(long id);
|
OperationResult DeActive(long id);
|
||||||
|
|
||||||
|
|
||||||
OperationResult DeActiveBlue(long id);
|
OperationResult DeActiveBlue(long id);
|
||||||
|
|
||||||
|
|
||||||
OperationResult DeActiveAllConnections(long id);
|
OperationResult DeActiveAllConnections(long id);
|
||||||
|
|
||||||
|
|
||||||
OperationResult ReActiveAllConnections(long id);
|
OperationResult ReActiveAllConnections(long id);
|
||||||
|
|
||||||
void ReActiveAllAfterCreateNew(long contractingPartyId);
|
void ReActiveAllAfterCreateNew(long contractingPartyId);
|
||||||
|
|
||||||
|
|
||||||
void RemoveContract(long id);
|
void RemoveContract(long id);
|
||||||
|
|
||||||
|
|
||||||
OperationResult Sign(long id);
|
OperationResult Sign(long id);
|
||||||
|
|
||||||
|
|
||||||
OperationResult UnSign(long id);
|
OperationResult UnSign(long id);
|
||||||
void CreateContractingPartyAccount(long contractingPartyid, long accountId);
|
void CreateContractingPartyAccount(long contractingPartyid, long accountId);
|
||||||
|
|
||||||
double GetcontractAmount(int countPerson);
|
double GetcontractAmount(int countPerson);
|
||||||
|
|
||||||
#region Api
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// لیست قرارداد های مالی
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="searchModel"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<PagedResult<GetInstitutionContractListItemsViewModel>> GetList
|
|
||||||
(InstitutionContractListSearchModel searchModel);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// وضعیت لیست کلی
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="searchModel"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<GetInstitutionContractListStatsViewModel> GetListStats(InstitutionContractListSearchModel searchModel);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ایجاد
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="command"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<OperationResult> CreateAsync(CreateInstitutionContractRequest command);
|
|
||||||
/// <summary>
|
|
||||||
/// ویرایش
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="command"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<OperationResult> EditAsync(EditInstitutionContractRequest command);
|
|
||||||
/// <summary>
|
|
||||||
/// تمدید قرارداد
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="command"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<OperationResult> ExtensionَAsync(CreateInstitutionContractRequest command);
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
|
|
||||||
public class GetInstitutionContractListStatsViewModel
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Represents the total outstanding debt of institution contracts.
|
|
||||||
/// This property aggregates the liabilities of the respective contracts and provides
|
|
||||||
/// a single metric to measure financial obligations.
|
|
||||||
/// </summary>
|
|
||||||
public double TotalDebt { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Represents the total monetary value associated with institution contracts.
|
|
||||||
/// This property consolidates the aggregate amount from relevant contracts
|
|
||||||
/// for financial reporting and analysis.
|
|
||||||
/// </summary>
|
|
||||||
public double TotalAmount { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Represents a collection of counts for institution contracts categorized by their status.
|
|
||||||
/// This property provides the count of contracts for each status defined in the
|
|
||||||
/// InstitutionContractStatus enumeration, enabling analysis and monitoring of contract distribution.
|
|
||||||
/// </summary>
|
|
||||||
public List<InstitutionContractStatusCount> Counts { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class InstitutionContractStatusCount
|
|
||||||
{
|
|
||||||
public InstitutionContractStatus Status { get; set; }
|
|
||||||
public int Count { get; set; }
|
|
||||||
}
|
|
||||||
public class ExtenstionInstitutionContractRequest:EditInstitutionContractRequest
|
|
||||||
{
|
|
||||||
public long PreviousContractId { get; set; }
|
|
||||||
}
|
}
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
using _0_Framework.Application;
|
|
||||||
|
|
||||||
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
|
||||||
|
|
||||||
public class InstitutionContractListSearchModel :PaginationRequest
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// کارفرما / کارگاه / طرف حساب / معرف
|
|
||||||
/// </summary>
|
|
||||||
public string EmployerOrWorkshopOrContractingPartyOrRepresentativeName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// استان
|
|
||||||
/// </summary>
|
|
||||||
public string Province { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// شهر
|
|
||||||
/// </summary>
|
|
||||||
public string City { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// مبلغ قرارداد از
|
|
||||||
/// </summary>
|
|
||||||
public double AmountFrom { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// مبلغ قرارداد تا
|
|
||||||
/// </summary>
|
|
||||||
public double AmountTo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// تاریخ قرارداد از
|
|
||||||
/// </summary>
|
|
||||||
public string ContractDateFrom { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// تاریخ قرارداد تا
|
|
||||||
/// </summary>
|
|
||||||
public string ContractDateTo { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// تب
|
|
||||||
/// </summary>
|
|
||||||
public InstitutionContractStatus? Status { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// فعال / غیرفعال
|
|
||||||
/// </summary>
|
|
||||||
public bool? IsActive { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// موجود / ناموجود
|
|
||||||
/// </summary>
|
|
||||||
public bool? HasSignature { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// نوع = روابط کار / مالیات و حسابداری
|
|
||||||
/// </summary>
|
|
||||||
public InstitutionContractType? Type { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// رسمی / غیررسمی
|
|
||||||
/// </summary>
|
|
||||||
public bool? IsOfficial { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
|
||||||
|
|
||||||
public enum InstitutionContractStatus
|
|
||||||
{
|
|
||||||
Active,
|
|
||||||
Deactive,
|
|
||||||
DeactiveWithDebt,
|
|
||||||
Block,
|
|
||||||
Free,
|
|
||||||
PendingForRenewal,
|
|
||||||
WithoutWorkshop,
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
|
||||||
|
|
||||||
public enum InstitutionContractType
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// روابط کار
|
|
||||||
/// </summary>
|
|
||||||
JobRelation,
|
|
||||||
/// <summary>
|
|
||||||
/// حسابداری و مالیات
|
|
||||||
/// </summary>
|
|
||||||
TaxAndFinancial
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
using _0_Framework.Application;
|
|
||||||
|
|
||||||
namespace CompanyManagment.App.Contracts.PaymentInstrument;
|
|
||||||
|
|
||||||
public class AccountNumberSelectListViewModel : SelectListViewModel;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
using _0_Framework.Application;
|
|
||||||
|
|
||||||
namespace CompanyManagment.App.Contracts.PaymentInstrument;
|
|
||||||
|
|
||||||
public class CardNumberSelectListViewModel:SelectListViewModel;
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
namespace CompanyManagment.App.Contracts.PaymentInstrument;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ایجاد اطلاعات بانکی
|
|
||||||
/// </summary>
|
|
||||||
public class CreateBankPaymentInstrument
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// آیدی عنوان
|
|
||||||
/// </summary>
|
|
||||||
public long PaymentInstrumentGroupId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// نام صاحب حساب
|
|
||||||
/// </summary>
|
|
||||||
public string AccountHolderName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// شماره کارت
|
|
||||||
/// </summary>
|
|
||||||
public string CardNumber { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// شماره حساب
|
|
||||||
/// </summary>
|
|
||||||
public string AccountNumber { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// شماره حساب
|
|
||||||
/// </summary>
|
|
||||||
public string IBan { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// آیا احزار هویت شده است
|
|
||||||
/// </summary>
|
|
||||||
public bool IsAuth { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
namespace CompanyManagment.App.Contracts.PaymentInstrument;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ایجاد عنوان
|
|
||||||
/// </summary>
|
|
||||||
public class CreateBankPaymentInstrumentGroup
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// نام
|
|
||||||
/// </summary>
|
|
||||||
public string Name { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
namespace CompanyManagment.App.Contracts.PaymentInstrument;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class CreatePosPaymentInstrument
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// آیدی عنوان
|
|
||||||
/// </summary>
|
|
||||||
public long PaymentInstrumentGroupId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// شناسه دستگاه پوز
|
|
||||||
/// </summary>
|
|
||||||
public string PosTerminalId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// توضیحات
|
|
||||||
/// </summary>
|
|
||||||
public string Description { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
namespace CompanyManagment.App.Contracts.PaymentInstrument;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ویرایش عنوان
|
|
||||||
/// </summary>
|
|
||||||
public class EditBankPaymentInstrumentGroup : CreateBankPaymentInstrumentGroup
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// آیدی
|
|
||||||
/// </summary>
|
|
||||||
public long Id { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace CompanyManagment.App.Contracts.PaymentInstrument;
|
|
||||||
|
|
||||||
public class GetPaymentInstrumentListViewModel
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// تعداد آیتم
|
|
||||||
/// </summary>
|
|
||||||
public int Count { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// لیست گروهی
|
|
||||||
/// </summary>
|
|
||||||
public List<PaymentInstrumentGroupedViewModel> GropedViewModels { get; set; }
|
|
||||||
}
|
|
||||||
public class PaymentInstrumentGroupedViewModel
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// نام
|
|
||||||
/// </summary>
|
|
||||||
public string Name { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// آیتم های گروه
|
|
||||||
/// </summary>
|
|
||||||
public List<PaymentInstrumentItemsViewModel> Items { get; set; }
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public class PaymentInstrumentItemsViewModel
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// آیدی
|
|
||||||
/// </summary>
|
|
||||||
public long Id { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// شماره کارت
|
|
||||||
/// </summary>
|
|
||||||
public string CardNumber { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// شماره حساب
|
|
||||||
/// </summary>
|
|
||||||
public string AccountNumber { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// شماره شبا
|
|
||||||
/// </summary>
|
|
||||||
public string IBan { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// شناسه دستگاه
|
|
||||||
/// </summary>
|
|
||||||
public string PosTerminalId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// توضیحات
|
|
||||||
/// </summary>
|
|
||||||
public string Description { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// نام صاحب حساب
|
|
||||||
/// </summary>
|
|
||||||
public string AccountHolderName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// نوع
|
|
||||||
/// </summary>
|
|
||||||
public PaymentInstrumentType Type { get; set; }
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using _0_Framework.Application;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace CompanyManagment.App.Contracts.PaymentInstrument;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// اپلیکیشن جاری شرکا
|
|
||||||
/// </summary>
|
|
||||||
public interface IPaymentInstrumentApplication
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// ایجاد حساب اطلاعات بانکی
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="command"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<OperationResult> CreateBankAccount(CreateBankPaymentInstrument command);
|
|
||||||
Task<OperationResult> CreateBankAccount(List<CreateBankPaymentInstrument> commands);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ایجاد اطلاعات دستگاه پوز
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="command"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<OperationResult> CreatePos(CreatePosPaymentInstrument command);
|
|
||||||
Task<OperationResult> CreatePos(List<CreatePosPaymentInstrument> commands);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// گرفتن لیست
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="searchModel"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<GetPaymentInstrumentListViewModel> GetList(PaymentInstrumentSearchModel searchModel);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ایجاد عنوان
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="command"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<OperationResult> CreateGroup(CreateBankPaymentInstrumentGroup command);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ویرایش عنوان
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<OperationResult> EditGroup(EditBankPaymentInstrumentGroup command);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// حذف عنوان
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="id"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<OperationResult> DeleteGroup(long id);
|
|
||||||
|
|
||||||
Task<List<PaymentInstrumentGroupsViewModel>> GetGroup();
|
|
||||||
|
|
||||||
Task<List<string>> PosTerminalIdSelectList(string search, string selected);
|
|
||||||
Task<List<string>> IbanSelectList(string search, string selected);
|
|
||||||
Task<List<string>> AccountNumberSelectList(string search, string selected);
|
|
||||||
Task<List<string>> CardNumberSelectList(string search, string selected);
|
|
||||||
Task<List<string>> AccountHolderNameSelectList(string search, string selected);
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
using _0_Framework.Application;
|
|
||||||
|
|
||||||
namespace CompanyManagment.App.Contracts.PaymentInstrument;
|
|
||||||
|
|
||||||
public class IbanSelectListViewModel:SelectListViewModel;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
namespace CompanyManagment.App.Contracts.PaymentInstrument;
|
|
||||||
|
|
||||||
public class PaymentInstrumentGroupsViewModel:EditBankPaymentInstrumentGroup
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
namespace CompanyManagment.App.Contracts.PaymentInstrument;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// سرچ مدل
|
|
||||||
/// </summary>
|
|
||||||
public class PaymentInstrumentSearchModel
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// نام صاحب حساب
|
|
||||||
/// </summary>
|
|
||||||
public string AccountHolderName { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// شناسه دستگاه
|
|
||||||
/// </summary>
|
|
||||||
public string PosTerminalId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// شماره کارت
|
|
||||||
/// </summary>
|
|
||||||
public string CardNumber { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// شماره حساب
|
|
||||||
/// </summary>
|
|
||||||
public string AccountNumber { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// شماره شبا
|
|
||||||
/// </summary>
|
|
||||||
public string IBan { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// ایندکس صفحه
|
|
||||||
/// </summary>
|
|
||||||
public int PageIndex { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
namespace CompanyManagment.App.Contracts.PaymentInstrument;
|
|
||||||
/// <summary>
|
|
||||||
/// نوع حساب های جاری شرکا
|
|
||||||
/// </summary>
|
|
||||||
public enum PaymentInstrumentType
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// حساب بانکی
|
|
||||||
/// </summary>
|
|
||||||
BankAccount,
|
|
||||||
/// <summary>
|
|
||||||
/// دستگاه پوز
|
|
||||||
/// </summary>
|
|
||||||
Pos
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
using _0_Framework.Application;
|
|
||||||
|
|
||||||
namespace CompanyManagment.App.Contracts.PaymentInstrument;
|
|
||||||
|
|
||||||
public class PosTerminalSelectListViewModel:SelectListViewModel
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -1,8 +1,17 @@
|
|||||||
using _0_Framework.Application;
|
namespace CompanyManagment.App.Contracts.Representative;
|
||||||
|
|
||||||
namespace CompanyManagment.App.Contracts.Representative;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ویو مدل سلکت لیست برای معرف
|
/// ویو مدل سلکت لیست برای معرف
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class GetSelectListRepresentativeViewModel:SelectListViewModel;
|
public class GetSelectListRepresentativeViewModel
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// آیدی
|
||||||
|
/// </summary>
|
||||||
|
public long Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// نام معرف
|
||||||
|
/// </summary>
|
||||||
|
public string Name { get; set; }
|
||||||
|
}
|
||||||
@@ -8,7 +8,7 @@ namespace CompanyManagment.App.Contracts.RollCall;
|
|||||||
public interface IRollCallMandatoryApplication
|
public interface IRollCallMandatoryApplication
|
||||||
{
|
{
|
||||||
bool HasRollCallRecord(long employeeId, long workshopId, DateTime contractStart);
|
bool HasRollCallRecord(long employeeId, long workshopId, DateTime contractStart);
|
||||||
ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout, bool rotatingShiftCompute, bool totalLeaveCompute);
|
ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout, bool rotatingShiftCompute);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// گزارش نوبت کاری حضور غیاب
|
/// گزارش نوبت کاری حضور غیاب
|
||||||
|
|||||||
@@ -22,5 +22,5 @@ public interface ISalaryAidApplication
|
|||||||
SalaryAidsGroupedViewModel GetSearchListAsGrouped(SalaryAidSearchViewModel searchModel);
|
SalaryAidsGroupedViewModel GetSearchListAsGrouped(SalaryAidSearchViewModel searchModel);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
Task<OperationResult> CreateRangeAsync(List<CreateSalaryAidViewModel> commands);
|
OperationResult CreateRange(List<CreateSalaryAidViewModel> commands);
|
||||||
}
|
}
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace CompanyManagment.App.Contracts.YearlySalary;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// دیتای پایه سنوات از اولین شروع بکار پرسنل
|
|
||||||
/// </summary>
|
|
||||||
public class BaseYearDataViewModel
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// آی دی پرسنل
|
|
||||||
/// </summary>
|
|
||||||
public long EmployeeId { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// آی دی کارگاه
|
|
||||||
/// </summary>
|
|
||||||
public long WorkshopId { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// پایه سنوات محاسبه شده نهایی
|
|
||||||
/// </summary>
|
|
||||||
public double BaseYearResult { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// لیست تمام پایه سنوات های محاسبه شده
|
|
||||||
/// </summary>
|
|
||||||
public List<BaseYearDataList> BaseYearDataList { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// لیست تمام پایه سنوات های محاسبه شده
|
|
||||||
/// </summary>
|
|
||||||
public class BaseYearDataList
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// پایه سنوات
|
|
||||||
/// </summary>
|
|
||||||
public double BaseYear { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// تاریخ میلادی شروع محاسبه پایه سنوات
|
|
||||||
/// </summary>
|
|
||||||
public DateTime StartDateGr { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// تاریخ میلادی پایان محاسبه پایه سنوات
|
|
||||||
/// </summary>
|
|
||||||
public DateTime EndDateGr { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// تاریخ شمسی شروع محاسبه پایه سنوات
|
|
||||||
/// </summary>
|
|
||||||
public string StartDateFa { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// تاریخ شمسی پایان محاسبه پایه سنوات
|
|
||||||
/// </summary>
|
|
||||||
public string EndDateFa { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// سالی که در آن پایه سنوات تعلق گرفته
|
|
||||||
/// </summary>
|
|
||||||
public string Year { get; set; }
|
|
||||||
}
|
|
||||||
@@ -184,7 +184,6 @@ public class CheckoutApplication : ICheckoutApplication
|
|||||||
{
|
{
|
||||||
command.AbsenceDeduction = command.AbsenceDeduction - command.OvertimePay;
|
command.AbsenceDeduction = command.AbsenceDeduction - command.OvertimePay;
|
||||||
command.OvertimePay = 0;
|
command.OvertimePay = 0;
|
||||||
command.OverTimeWorkValue = "00:00";
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -348,13 +347,14 @@ public class CheckoutApplication : ICheckoutApplication
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var checkout = new Checkout(command.EmployeeFullName, command.FathersName, command.NationalCode
|
var checkout = new Checkout(command.EmployeeFullName, command.FathersName, command.NationalCode
|
||||||
, command.DateOfBirth, command.EmployeeId, command.WorkshopName, command.WorkshopId, command.ContractNo, command.ContractStartGr, command.ContractEndGr, month, year,
|
, command.DateOfBirth, command.EmployeeId, command.WorkshopName, command.WorkshopId, command.ContractNo, command.ContractStartGr, command.ContractEndGr, month, year,
|
||||||
command.ContractId, command.WorkingHoursId, monthlyWage, bacicYears, consumableItem, housingAllowance
|
command.ContractId, command.WorkingHoursId, monthlyWage, bacicYears, consumableItem, housingAllowance
|
||||||
, command.OvertimePay, command.NightworkPay, command.FridayPay, 0, command.ShiftPay, familyAllowance, bunos, years, command.LeavePay, insuranceDeduction, 0, command.InstallmentDeduction, command.SalaryAidDeduction, command.AbsenceDeduction, sumOfWorkingDays,
|
, command.OvertimePay, command.NightworkPay, command.FridayPay, 0, command.ShiftPay, familyAllowance, bunos, years, command.LeavePay, insuranceDeduction, 0, command.InstallmentDeduction, command.SalaryAidDeduction, command.AbsenceDeduction, sumOfWorkingDays,
|
||||||
command.ArchiveCode, command.PersonnelCode, totalClaims, totalDeductions, totalPayment, command.Signature, marriedAllowance, command.LeaveCheckout, command.CreditLeaves, command.AbsencePeriod, command.AverageHoursPerDay, command.HasRollCall, command.OverTimeWorkValue, command.OverNightWorkValue
|
command.ArchiveCode, command.PersonnelCode, totalClaims, totalDeductions, totalPayment, command.Signature, marriedAllowance, command.LeaveCheckout, command.CreditLeaves, command.AbsencePeriod, command.AverageHoursPerDay, command.HasRollCall, command.OverTimeWorkValue, command.OverNightWorkValue
|
||||||
, command.FridayWorkValue, command.RotatingShiftValue, command.AbsenceValue, command.TotalDayOfLeaveCompute, command.TotalDayOfYearsCompute, command.TotalDayOfBunosesCompute,
|
, command.FridayWorkValue, command.RotatingShiftValue, command.AbsenceValue, command.TotalDayOfLeaveCompute, command.TotalDayOfYearsCompute, command.TotalDayOfBunosesCompute,
|
||||||
loanInstallments, salaryAids,checkoutRollCall,command.EmployeeMandatoryHours);
|
loanInstallments, salaryAids,checkoutRollCall);
|
||||||
|
|
||||||
_checkoutRepository.CreateCkeckout(checkout).GetAwaiter().GetResult();
|
_checkoutRepository.CreateCkeckout(checkout).GetAwaiter().GetResult();
|
||||||
//_checkoutRepository.SaveChanges();
|
//_checkoutRepository.SaveChanges();
|
||||||
@@ -497,7 +497,6 @@ public class CheckoutApplication : ICheckoutApplication
|
|||||||
x.TotalPresentTimeStr =
|
x.TotalPresentTimeStr =
|
||||||
Tools.ToFarsiHoursAndMinutes((int)totalPresent.TotalHours, totalPresent.Minutes, "-");
|
Tools.ToFarsiHoursAndMinutes((int)totalPresent.TotalHours, totalPresent.Minutes, "-");
|
||||||
x.TotalMandatoryTimeStr = Tools.ToFarsiHoursAndMinutes(mandatoryWholeHours, mandatoryMinutes, "-");
|
x.TotalMandatoryTimeStr = Tools.ToFarsiHoursAndMinutes(mandatoryWholeHours, mandatoryMinutes, "-");
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,7 @@ public class ContractingPartyBankAccountsApplication : IContractingPartyBankAcco
|
|||||||
private readonly IContractingPartyBankAccountsRepository _contractingPartyBankAccountsRepository;
|
private readonly IContractingPartyBankAccountsRepository _contractingPartyBankAccountsRepository;
|
||||||
private readonly IPersonalContractingPartyRepository _personalContractingPartyRepository;
|
private readonly IPersonalContractingPartyRepository _personalContractingPartyRepository;
|
||||||
|
|
||||||
public ContractingPartyBankAccountsApplication(
|
public ContractingPartyBankAccountsApplication(IContractingPartyBankAccountsRepository contractingPartyBankAccountsRepository,
|
||||||
IContractingPartyBankAccountsRepository contractingPartyBankAccountsRepository,
|
|
||||||
IPersonalContractingPartyRepository personalContractingPartyRepository)
|
IPersonalContractingPartyRepository personalContractingPartyRepository)
|
||||||
{
|
{
|
||||||
_contractingPartyBankAccountsRepository = contractingPartyBankAccountsRepository;
|
_contractingPartyBankAccountsRepository = contractingPartyBankAccountsRepository;
|
||||||
@@ -48,86 +47,33 @@ public class ContractingPartyBankAccountsApplication : IContractingPartyBankAcco
|
|||||||
await _contractingPartyBankAccountsRepository.SaveChangesAsync();
|
await _contractingPartyBankAccountsRepository.SaveChangesAsync();
|
||||||
|
|
||||||
return operationResult.Succcedded();
|
return operationResult.Succcedded();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<OperationResult> Create(List<CreateContractingPartyBankAccounts> commands)
|
public async Task<OperationResult<List<GetContractingPartyBankAccountViewModel>>> GetList(
|
||||||
{
|
|
||||||
var operationResult = new OperationResult();
|
|
||||||
foreach (var command in commands)
|
|
||||||
{
|
|
||||||
if (!_personalContractingPartyRepository.Exists(x => x.id == command.ContractingPartyId))
|
|
||||||
return operationResult.Failed("طرف حساب مورد نظر یافت نشد");
|
|
||||||
|
|
||||||
if (command.IsAuth)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrWhiteSpace(command.CardNumber))
|
|
||||||
return operationResult.Failed("شماره کارت خود را وارد کنید");
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.AccountNumber))
|
|
||||||
return operationResult.Failed("شماره حساب خود را وارد کنید");
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.IBan))
|
|
||||||
return operationResult.Failed("شماره شبا خود را وارد کنید");
|
|
||||||
}
|
|
||||||
else if(string.IsNullOrWhiteSpace(command.CardNumber) &&
|
|
||||||
string.IsNullOrWhiteSpace(command.AccountNumber) &&
|
|
||||||
string.IsNullOrWhiteSpace(command.IBan))
|
|
||||||
{
|
|
||||||
return operationResult.Failed(" حداقل یکی از اطلاعات بانکی را وارد کنید: شماره کارت، شماره حساب یا شماره شبا");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.AccountHolderName))
|
|
||||||
{
|
|
||||||
return operationResult.Failed("نام صاحب حساب را وارد کنید");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var entity = new ContractingPartyBankAccount(command.ContractingPartyId, command.CardNumber,
|
|
||||||
command.AccountHolderName, command.AccountNumber, command.IBan, command.IsAuth);
|
|
||||||
|
|
||||||
await _contractingPartyBankAccountsRepository.CreateAsync(entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
await _contractingPartyBankAccountsRepository.SaveChangesAsync();
|
|
||||||
|
|
||||||
return operationResult.Succcedded();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<GetContractingPartyBankAccountViewModel> GetList(
|
|
||||||
ContractingPartyBankAccountSearchModel searchModel)
|
ContractingPartyBankAccountSearchModel searchModel)
|
||||||
{
|
{
|
||||||
return await _contractingPartyBankAccountsRepository.GetList(searchModel);
|
return await _contractingPartyBankAccountsRepository.GetList(searchModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<string>> ContractingPartyOrAccountHolderNameSelectList(string search,
|
public async Task<OperationResult<List<string>>> ContractingPartyOrAccountHolderNameSelectList(string search,
|
||||||
string selected)
|
string selected)
|
||||||
{
|
{
|
||||||
return await _contractingPartyBankAccountsRepository.ContractingPartyOrAccountHolderNameSelectList(search,
|
return await _contractingPartyBankAccountsRepository.ContractingPartyOrAccountHolderNameSelectList(search, selected);
|
||||||
selected);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<string>> CardNumberSelectList(string search, string selected)
|
public async Task<OperationResult<List<string>>> CardNumberSelectList(string search, string selected)
|
||||||
{
|
{
|
||||||
return await _contractingPartyBankAccountsRepository.CardNumberSelectList(search, selected);
|
return await _contractingPartyBankAccountsRepository.CardNumberSelectList(search, selected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<string>> IBanSelectList(string search, string selected)
|
public async Task<OperationResult<List<string>>> IBanSelectList(string search, string selected)
|
||||||
{
|
{
|
||||||
return await _contractingPartyBankAccountsRepository.IBanSelectList(search, selected);
|
return await _contractingPartyBankAccountsRepository.IBanSelectList(search, selected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<string>> AccountNumberSelectList(string search, string selected)
|
public async Task<OperationResult<List<string>>> AccountNumberSelectList(string search, string selected)
|
||||||
{
|
{
|
||||||
return await _contractingPartyBankAccountsRepository.AccountNumberSelectList(search, selected);
|
return await _contractingPartyBankAccountsRepository.AccountNumberSelectList(search, selected);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<string>> GetAccountHolderNameSelectList(string search, string selected)
|
|
||||||
{
|
|
||||||
return await _contractingPartyBankAccountsRepository.GetAccountHolderNameSelectList(search, selected);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<List<string>> ContractingPartyNamesSelectList(string search, string selected)
|
|
||||||
{
|
|
||||||
return await _contractingPartyBankAccountsRepository.ContractingPartyNamesSelectList(search, selected);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1735,7 +1735,7 @@ namespace CompanyManagment.Application
|
|||||||
if (file.Length > (50 * 1024 * 1024))
|
if (file.Length > (50 * 1024 * 1024))
|
||||||
return op.Failed("حجم فایل نمی تواند بیشتر از 50 مگابایت باشد");
|
return op.Failed("حجم فایل نمی تواند بیشتر از 50 مگابایت باشد");
|
||||||
|
|
||||||
if (!allowedExtensions.Contains(fileExtension.ToLower()))
|
if (!allowedExtensions.Contains(fileExtension))
|
||||||
{
|
{
|
||||||
var operationMessage = ":فرمت فایل باید یکی از موارد زیر باشد";
|
var operationMessage = ":فرمت فایل باید یکی از موارد زیر باشد";
|
||||||
operationMessage += "\n";
|
operationMessage += "\n";
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ public class FinancialStatmentApplication : IFinancialStatmentApplication
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async Task<ClientFinancialStatementViewModel> GetClientFinancialStatement(
|
public async Task<ClientFinancialStatementViewModel> GetClientFinancialStatement(
|
||||||
FinancialStatementSearchModel searchModel, long accountId)
|
ClientFinancialStatementSearchModel searchModel, long accountId)
|
||||||
{
|
{
|
||||||
return await _financialStatmentRepository.GetClientFinancialStatement(accountId, searchModel);
|
return await _financialStatmentRepository.GetClientFinancialStatement(accountId, searchModel);
|
||||||
}
|
}
|
||||||
@@ -196,10 +196,4 @@ public class FinancialStatmentApplication : IFinancialStatmentApplication
|
|||||||
{
|
{
|
||||||
return _financialStatmentRepository.GetClientDebtAmount(accountId);
|
return _financialStatmentRepository.GetClientDebtAmount(accountId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<FinancialStatmentDetailsByContractingPartyViewModel> GetDetailsByContractingParty(
|
|
||||||
long contractingPartyId, FinancialStatementSearchModel searchModel)
|
|
||||||
{
|
|
||||||
return await _financialStatmentRepository.GetDetailsByContractingParty(contractingPartyId,searchModel);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -32,11 +32,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
private readonly IWorkshopApplication _workshopApplication;
|
private readonly IWorkshopApplication _workshopApplication;
|
||||||
|
|
||||||
|
|
||||||
public InstitutionContractApplication(IInstitutionContractRepository institutionContractRepository,
|
public InstitutionContractApplication(IInstitutionContractRepository institutionContractRepository, IPersonalContractingPartyRepository contractingPartyRepository, IRepresentativeRepository representativeRepository, IEmployerRepository employerRepository, IWorkshopRepository workshopRepository, ILeftWorkRepository leftWorkRepository, IFinancialStatmentApplication financialStatmentApplication, IWorkshopApplication workshopApplication)
|
||||||
IPersonalContractingPartyRepository contractingPartyRepository,
|
|
||||||
IRepresentativeRepository representativeRepository, IEmployerRepository employerRepository,
|
|
||||||
IWorkshopRepository workshopRepository, ILeftWorkRepository leftWorkRepository,
|
|
||||||
IFinancialStatmentApplication financialStatmentApplication, IWorkshopApplication workshopApplication)
|
|
||||||
{
|
{
|
||||||
_institutionContractRepository = institutionContractRepository;
|
_institutionContractRepository = institutionContractRepository;
|
||||||
_contractingPartyRepository = contractingPartyRepository;
|
_contractingPartyRepository = contractingPartyRepository;
|
||||||
@@ -50,28 +46,25 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
|
|
||||||
public OperationResult Create(CreateInstitutionContract command)
|
public OperationResult Create(CreateInstitutionContract command)
|
||||||
{
|
{
|
||||||
|
|
||||||
string contractingPartyName = String.Empty;
|
string contractingPartyName = String.Empty;
|
||||||
bool dateMessages = false;
|
bool dateMessages = false;
|
||||||
string dateMaessageResult = String.Empty;
|
string dateMaessageResult = String.Empty;
|
||||||
var opration = new OperationResult();
|
var opration = new OperationResult();
|
||||||
if (_institutionContractRepository.Exists(x =>
|
if (_institutionContractRepository.Exists(x =>
|
||||||
x.ContractingPartyId == command.ContractingPartyId && x.RepresentativeId == command.RepresentativeId &&
|
x.ContractingPartyId == command.ContractingPartyId && x.RepresentativeId == command.RepresentativeId && x.TypeOfContract == command.TypeOfContract))
|
||||||
x.TypeOfContract == command.TypeOfContract))
|
return opration.Failed("برای این معرف و طرف حساب قبلا قرارداد ایجاد شده است، شما میتوانید از تمدید استفاده کنید");
|
||||||
return opration.Failed(
|
|
||||||
"برای این معرف و طرف حساب قبلا قرارداد ایجاد شده است، شما میتوانید از تمدید استفاده کنید");
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.ContractDateFa))
|
if (string.IsNullOrWhiteSpace(command.ContractDateFa))
|
||||||
{
|
{
|
||||||
dateMaessageResult = "تاریخ قراراداد اجباری است. ";
|
dateMaessageResult = "تاریخ قراراداد اجباری است. ";
|
||||||
dateMessages = true;
|
dateMessages = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.ContractStartFa))
|
if (string.IsNullOrWhiteSpace(command.ContractStartFa))
|
||||||
{
|
{
|
||||||
dateMaessageResult += "تاریخ شروع قراراداد اجباری است. ";
|
dateMaessageResult += "تاریخ شروع قراراداد اجباری است. ";
|
||||||
dateMessages = true;
|
dateMessages = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.ContractEndFa))
|
if (string.IsNullOrWhiteSpace(command.ContractEndFa))
|
||||||
{
|
{
|
||||||
dateMaessageResult += "تاریخ پایان قراراداد اجباری است. ";
|
dateMaessageResult += "تاریخ پایان قراراداد اجباری است. ";
|
||||||
@@ -88,6 +81,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
else if (command.ContractingPartyId < 1 && command.RepresentativeId > 1)
|
else if (command.ContractingPartyId < 1 && command.RepresentativeId > 1)
|
||||||
{
|
{
|
||||||
return opration.Failed("طرف حساب را انتخاب کنید");
|
return opration.Failed("طرف حساب را انتخاب کنید");
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (command.ContractingPartyId < 1 && command.RepresentativeId < 1)
|
else if (command.ContractingPartyId < 1 && command.RepresentativeId < 1)
|
||||||
{
|
{
|
||||||
@@ -105,12 +99,10 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
if (command.ContactInformationList.Count == 0)
|
if (command.ContactInformationList.Count == 0)
|
||||||
return opration.Failed("ورود شماره تماس برای ارسال پیامک الزامیست");
|
return opration.Failed("ورود شماره تماس برای ارسال پیامک الزامیست");
|
||||||
var accountContact = command.ContactInformationList.Where(x =>
|
var accountContact = command.ContactInformationList.Where(x =>
|
||||||
x.SendSmsString == "true" && x.Position == "طرف قرارداد" && x.PhoneType == "شماره همراه" &&
|
x.SendSmsString == "true" && x.Position == "طرف قرارداد" && x.PhoneType == "شماره همراه" && !string.IsNullOrWhiteSpace(x.PhoneNumber)).ToList();
|
||||||
!string.IsNullOrWhiteSpace(x.PhoneNumber)).ToList();
|
|
||||||
if(accountContact.Count == 0)
|
if(accountContact.Count == 0)
|
||||||
return opration.Failed("ورود شماره همراه با سمت طرف قرارداد برای ساخت حساب کاربری الزامیست");
|
return opration.Failed("ورود شماره همراه با سمت طرف قرارداد برای ساخت حساب کاربری الزامیست");
|
||||||
var accountContactCount = command.ContactInformationList
|
var accountContactCount = command.ContactInformationList.Where(x => x.PhoneType == "شماره همراه" && x.Position == "طرف قرارداد").ToList();
|
||||||
.Where(x => x.PhoneType == "شماره همراه" && x.Position == "طرف قرارداد").ToList();
|
|
||||||
if (accountContactCount.Count > 1)
|
if (accountContactCount.Count > 1)
|
||||||
return opration.Failed("فقط یکی از شماره تلفن ها میتواند سمت طرف قرارداد داشته باشد");
|
return opration.Failed("فقط یکی از شماره تلفن ها میتواند سمت طرف قرارداد داشته باشد");
|
||||||
|
|
||||||
@@ -125,16 +117,19 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
|
|
||||||
if (command.Address != null && command.State == null)
|
if (command.Address != null && command.State == null)
|
||||||
{
|
{
|
||||||
|
|
||||||
return opration.Failed("لطفا استان و شهر را انتخاب کنید");
|
return opration.Failed("لطفا استان و شهر را انتخاب کنید");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((command.Address != null && command.State != null) && command.City == "شهرستان")
|
if ((command.Address != null && command.State != null) && command.City == "شهرستان")
|
||||||
{
|
{
|
||||||
|
|
||||||
return opration.Failed("لطفا شهر را انتخاب کنید");
|
return opration.Failed("لطفا شهر را انتخاب کنید");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (command.Address == null && command.State != null)
|
if (command.Address == null && command.State != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
return opration.Failed("لطفا آدرس را وارد کنید");
|
return opration.Failed("لطفا آدرس را وارد کنید");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -153,9 +148,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
command.ObligationString = "0";
|
command.ObligationString = "0";
|
||||||
if (string.IsNullOrWhiteSpace(command.TotalAmountString))
|
if (string.IsNullOrWhiteSpace(command.TotalAmountString))
|
||||||
command.TotalAmountString = "0";
|
command.TotalAmountString = "0";
|
||||||
command.ValueAddedTax = string.IsNullOrWhiteSpace(command.ValueAddedTaxStr)
|
command.ValueAddedTax = string.IsNullOrWhiteSpace(command.ValueAddedTaxStr) ? 0 : command.ValueAddedTaxStr.MoneyToDouble();
|
||||||
? 0
|
|
||||||
: command.ValueAddedTaxStr.MoneyToDouble();
|
|
||||||
var contractAmount = command.ContractAmountString.ToDoubleMoney();
|
var contractAmount = command.ContractAmountString.ToDoubleMoney();
|
||||||
command.ContractAmount = Convert.ToDouble(contractAmount);
|
command.ContractAmount = Convert.ToDouble(contractAmount);
|
||||||
var DailyCompenseation = command.DailyCompenseationString.ToDoubleMoney();
|
var DailyCompenseation = command.DailyCompenseationString.ToDoubleMoney();
|
||||||
@@ -179,8 +172,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
command.Address, contractStartGr,
|
command.Address, contractStartGr,
|
||||||
command.ContractStartFa, contractEndGr, command.ContractEndFa, command.ContractAmount,
|
command.ContractStartFa, contractEndGr, command.ContractEndFa, command.ContractAmount,
|
||||||
command.DailyCompenseation, command.Obligation,
|
command.DailyCompenseation, command.Obligation,
|
||||||
command.TotalAmount, 0, command.WorkshopManualCount, command.EmployeeManualCount, command.Description,
|
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);
|
|
||||||
|
|
||||||
_institutionContractRepository.Create(createContract);
|
_institutionContractRepository.Create(createContract);
|
||||||
_institutionContractRepository.SaveChanges();
|
_institutionContractRepository.SaveChanges();
|
||||||
@@ -189,14 +181,14 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
|
|
||||||
public OperationResult Extension(CreateInstitutionContract command)
|
public OperationResult Extension(CreateInstitutionContract command)
|
||||||
{
|
{
|
||||||
|
|
||||||
bool dateMessages = false;
|
bool dateMessages = false;
|
||||||
string dateMaessageResult = String.Empty;
|
string dateMaessageResult = String.Empty;
|
||||||
var opration = new OperationResult();
|
var opration = new OperationResult();
|
||||||
|
|
||||||
command.ExtensionNo += 1;
|
command.ExtensionNo += 1;
|
||||||
if (_institutionContractRepository.Exists(x =>
|
if (_institutionContractRepository.Exists(x =>
|
||||||
x.ExtensionNo == command.ExtensionNo && x.ContractingPartyId == command.ContractingPartyId &&
|
x.ExtensionNo == command.ExtensionNo && x.ContractingPartyId == command.ContractingPartyId && x.TypeOfContract == command.TypeOfContract))
|
||||||
x.TypeOfContract == command.TypeOfContract))
|
|
||||||
return opration.Failed("برای این قرارداد قبلا تمدید ایجاد شده است");
|
return opration.Failed("برای این قرارداد قبلا تمدید ایجاد شده است");
|
||||||
|
|
||||||
|
|
||||||
@@ -205,13 +197,11 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
dateMaessageResult = "تاریخ قراراداد اجباری است. ";
|
dateMaessageResult = "تاریخ قراراداد اجباری است. ";
|
||||||
dateMessages = true;
|
dateMessages = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.ContractStartFa))
|
if (string.IsNullOrWhiteSpace(command.ContractStartFa))
|
||||||
{
|
{
|
||||||
dateMaessageResult += "تاریخ شروع قراراداد اجباری است. ";
|
dateMaessageResult += "تاریخ شروع قراراداد اجباری است. ";
|
||||||
dateMessages = true;
|
dateMessages = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.ContractEndFa))
|
if (string.IsNullOrWhiteSpace(command.ContractEndFa))
|
||||||
{
|
{
|
||||||
dateMaessageResult += "تاریخ پایان قراراداد اجباری است. ";
|
dateMaessageResult += "تاریخ پایان قراراداد اجباری است. ";
|
||||||
@@ -221,8 +211,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
if (dateMessages)
|
if (dateMessages)
|
||||||
return opration.Failed(dateMaessageResult);
|
return opration.Failed(dateMaessageResult);
|
||||||
|
|
||||||
var firstContract =
|
var firstContract = _institutionContractRepository.GetFirstContract(command.ContractingPartyId, command.TypeOfContract);
|
||||||
_institutionContractRepository.GetFirstContract(command.ContractingPartyId, command.TypeOfContract);
|
|
||||||
|
|
||||||
var syear = firstContract.ContractStartFa.Substring(0, 4);
|
var syear = firstContract.ContractStartFa.Substring(0, 4);
|
||||||
var smonth = firstContract.ContractStartFa.Substring(5, 2);
|
var smonth = firstContract.ContractStartFa.Substring(5, 2);
|
||||||
@@ -237,25 +226,25 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
|
|
||||||
var contractDateGr = command.ContractDateFa.ToGeorgianDateTime();
|
var contractDateGr = command.ContractDateFa.ToGeorgianDateTime();
|
||||||
if (_institutionContractRepository.Exists(x =>
|
if (_institutionContractRepository.Exists(x =>
|
||||||
((contractStartGr >= x.ContractStartGr && contractStartGr <= x.ContractEndGr) ||
|
((contractStartGr >= x.ContractStartGr && contractStartGr <= x.ContractEndGr)||(contractEndGr >= x.ContractStartGr && contractEndGr <= x.ContractEndGr)) && x.TypeOfContract == command.TypeOfContract && x.ContractingPartyId == command.ContractingPartyId))
|
||||||
(contractEndGr >= x.ContractStartGr && contractEndGr <= x.ContractEndGr)) &&
|
|
||||||
x.TypeOfContract == command.TypeOfContract && x.ContractingPartyId == command.ContractingPartyId))
|
|
||||||
return opration.Failed("تاریخ شروع و پایان وارد شده با قرارداد دیگری تداخل دارد");
|
return opration.Failed("تاریخ شروع و پایان وارد شده با قرارداد دیگری تداخل دارد");
|
||||||
if (command.Address != null && command.State == null)
|
if (command.Address != null && command.State == null)
|
||||||
{
|
{
|
||||||
|
|
||||||
return opration.Failed("لطفا استان و شهر را انتخاب کنید");
|
return opration.Failed("لطفا استان و شهر را انتخاب کنید");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((command.Address != null && command.State != null) && command.City == "شهرستان")
|
if ((command.Address != null && command.State != null) && command.City == "شهرستان")
|
||||||
{
|
{
|
||||||
|
|
||||||
return opration.Failed("لطفا شهر را انتخاب کنید");
|
return opration.Failed("لطفا شهر را انتخاب کنید");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (command.Address == null && command.State != null)
|
if (command.Address == null && command.State != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
return opration.Failed("لطفا آدرس را وارد کنید");
|
return opration.Failed("لطفا آدرس را وارد کنید");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.OfficialCompany))
|
if (string.IsNullOrWhiteSpace(command.OfficialCompany))
|
||||||
return opration.Failed("رسمی یا غیر رسمی بودن پرداخت را مشخص کنید");
|
return opration.Failed("رسمی یا غیر رسمی بودن پرداخت را مشخص کنید");
|
||||||
if (command.OfficialCompany == "Official" && string.IsNullOrWhiteSpace(command.HasValueAddedTax))
|
if (command.OfficialCompany == "Official" && string.IsNullOrWhiteSpace(command.HasValueAddedTax))
|
||||||
@@ -270,9 +259,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
command.ObligationString = "0";
|
command.ObligationString = "0";
|
||||||
if (string.IsNullOrWhiteSpace(command.TotalAmountString))
|
if (string.IsNullOrWhiteSpace(command.TotalAmountString))
|
||||||
command.TotalAmountString = "0";
|
command.TotalAmountString = "0";
|
||||||
command.ValueAddedTax = string.IsNullOrWhiteSpace(command.ValueAddedTaxStr)
|
command.ValueAddedTax = string.IsNullOrWhiteSpace(command.ValueAddedTaxStr) ? 0 : command.ValueAddedTaxStr.MoneyToDouble();
|
||||||
? 0
|
|
||||||
: command.ValueAddedTaxStr.MoneyToDouble();
|
|
||||||
var contractAmount = command.ContractAmountString.ToDoubleMoney();
|
var contractAmount = command.ContractAmountString.ToDoubleMoney();
|
||||||
command.ContractAmount = Convert.ToDouble(contractAmount);
|
command.ContractAmount = Convert.ToDouble(contractAmount);
|
||||||
var DailyCompenseation = command.DailyCompenseationString.ToDoubleMoney();
|
var DailyCompenseation = command.DailyCompenseationString.ToDoubleMoney();
|
||||||
@@ -287,9 +274,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
command.Address, contractStartGr,
|
command.Address, contractStartGr,
|
||||||
command.ContractStartFa, contractEndGr, command.ContractEndFa, command.ContractAmount,
|
command.ContractStartFa, contractEndGr, command.ContractEndFa, command.ContractAmount,
|
||||||
command.DailyCompenseation, command.Obligation,
|
command.DailyCompenseation, command.Obligation,
|
||||||
command.TotalAmount, command.ExtensionNo, command.WorkshopManualCount, command.EmployeeManualCount,
|
command.TotalAmount, command.ExtensionNo, command.WorkshopManualCount, command.EmployeeManualCount, command.Description,command.OfficialCompany, command.TypeOfContract, command.HasValueAddedTax, command.ValueAddedTax);
|
||||||
command.Description, command.OfficialCompany, command.TypeOfContract, command.HasValueAddedTax,
|
|
||||||
command.ValueAddedTax);
|
|
||||||
|
|
||||||
_institutionContractRepository.Create(createContract);
|
_institutionContractRepository.Create(createContract);
|
||||||
_institutionContractRepository.SaveChanges();
|
_institutionContractRepository.SaveChanges();
|
||||||
@@ -313,10 +298,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
var contractDateGr = command.ContractDateFa.ToGeorgianDateTime();
|
var contractDateGr = command.ContractDateFa.ToGeorgianDateTime();
|
||||||
|
|
||||||
if (_institutionContractRepository.Exists(x =>
|
if (_institutionContractRepository.Exists(x =>
|
||||||
x.ContractingPartyId == ContractEdit.ContractingPartyId &&
|
x.ContractingPartyId == ContractEdit.ContractingPartyId && ((contractStartGr >= x.ContractStartGr && contractStartGr <= x.ContractEndGr) || (contractEndGr >= x.ContractStartGr && contractEndGr <= x.ContractEndGr)) && x.id != command.Id && x.TypeOfContract == command.TypeOfContract))
|
||||||
((contractStartGr >= x.ContractStartGr && contractStartGr <= x.ContractEndGr) ||
|
|
||||||
(contractEndGr >= x.ContractStartGr && contractEndGr <= x.ContractEndGr)) && x.id != command.Id &&
|
|
||||||
x.TypeOfContract == command.TypeOfContract))
|
|
||||||
return opration.Failed("در بازه تاریخ وارد شده قرارداد دیگری وجود دارد");
|
return opration.Failed("در بازه تاریخ وارد شده قرارداد دیگری وجود دارد");
|
||||||
//if (_institutionContractRepository.Exists(x =>
|
//if (_institutionContractRepository.Exists(x =>
|
||||||
// x.ContractingPartyId == ContractEdit.ContractingPartyId && (x.ContractStartGr <= contractDateGr || x.ContractDateGr <= contractDateGr) && x.id != command.Id))
|
// x.ContractingPartyId == ContractEdit.ContractingPartyId && (x.ContractStartGr <= contractDateGr || x.ContractDateGr <= contractDateGr) && x.id != command.Id))
|
||||||
@@ -326,13 +308,11 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
dateMaessageResult = "تاریخ قراراداد اجباری است. ";
|
dateMaessageResult = "تاریخ قراراداد اجباری است. ";
|
||||||
dateMessages = true;
|
dateMessages = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.ContractStartFa))
|
if (string.IsNullOrWhiteSpace(command.ContractStartFa))
|
||||||
{
|
{
|
||||||
dateMaessageResult += "تاریخ شروع قراراداد اجباری است. ";
|
dateMaessageResult += "تاریخ شروع قراراداد اجباری است. ";
|
||||||
dateMessages = true;
|
dateMessages = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.ContractEndFa))
|
if (string.IsNullOrWhiteSpace(command.ContractEndFa))
|
||||||
{
|
{
|
||||||
dateMaessageResult += "تاریخ پایان قراراداد اجباری است. ";
|
dateMaessageResult += "تاریخ پایان قراراداد اجباری است. ";
|
||||||
@@ -343,16 +323,19 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
return opration.Failed(dateMaessageResult);
|
return opration.Failed(dateMaessageResult);
|
||||||
if (command.Address != null && command.State == null)
|
if (command.Address != null && command.State == null)
|
||||||
{
|
{
|
||||||
|
|
||||||
return opration.Failed("لطفا استان و شهر را انتخاب کنید");
|
return opration.Failed("لطفا استان و شهر را انتخاب کنید");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((command.Address != null && command.State != null) && command.City == "شهرستان")
|
if ((command.Address != null && command.State != null) && command.City == "شهرستان")
|
||||||
{
|
{
|
||||||
|
|
||||||
return opration.Failed("لطفا شهر را انتخاب کنید");
|
return opration.Failed("لطفا شهر را انتخاب کنید");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (command.Address == null && command.State != null)
|
if (command.Address == null && command.State != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
return opration.Failed("لطفا آدرس را وارد کنید");
|
return opration.Failed("لطفا آدرس را وارد کنید");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -382,15 +365,12 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
var TotalAmount = command.TotalAmountString.ToDoubleMoney();
|
var TotalAmount = command.TotalAmountString.ToDoubleMoney();
|
||||||
command.TotalAmount = Convert.ToDouble(TotalAmount);
|
command.TotalAmount = Convert.ToDouble(TotalAmount);
|
||||||
|
|
||||||
ContractEdit.Edit(contractDateGr, command.ContractDateFa, command.State, command.City, command.Address,
|
ContractEdit.Edit(contractDateGr, command.ContractDateFa,command.State,command.City,command.Address,contractStartGr,
|
||||||
contractStartGr,
|
command.ContractStartFa,contractEndGr,command.ContractEndFa,command.ContractAmount,command.DailyCompenseation,
|
||||||
command.ContractStartFa, contractEndGr, command.ContractEndFa, command.ContractAmount,
|
command.Obligation,command.TotalAmount,command.WorkshopManualCount, command.EmployeeManualCount,command.Description,command.OfficialCompany, command.TypeOfContract, command.ValueAddedTax, command.HasValueAddedTax);
|
||||||
command.DailyCompenseation,
|
|
||||||
command.Obligation, command.TotalAmount, command.WorkshopManualCount, command.EmployeeManualCount,
|
|
||||||
command.Description, command.OfficialCompany, command.TypeOfContract, command.ValueAddedTax,
|
|
||||||
command.HasValueAddedTax);
|
|
||||||
_institutionContractRepository.SaveChanges();
|
_institutionContractRepository.SaveChanges();
|
||||||
return opration.Succcedded(command.Id);
|
return opration.Succcedded(command.Id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public EditInstitutionContract GetDetails(long id)
|
public EditInstitutionContract GetDetails(long id)
|
||||||
@@ -400,6 +380,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
|
|
||||||
public List<InstitutionContractViewModel> Search(InstitutionContractSearchModel searchModel)
|
public List<InstitutionContractViewModel> Search(InstitutionContractSearchModel searchModel)
|
||||||
{
|
{
|
||||||
|
|
||||||
var query = _institutionContractRepository.Search(searchModel);
|
var query = _institutionContractRepository.Search(searchModel);
|
||||||
var join = new List<InstitutionContractViewModel>();
|
var join = new List<InstitutionContractViewModel>();
|
||||||
|
|
||||||
@@ -426,10 +407,8 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
//BlockTimes = _contractingPartyRepository.GetDetails(x.ContractingPartyId).BlockTimes,
|
//BlockTimes = _contractingPartyRepository.GetDetails(x.ContractingPartyId).BlockTimes,
|
||||||
ContractingPartyId = x.ContractingPartyId,
|
ContractingPartyId = x.ContractingPartyId,
|
||||||
EmployerViewModels = _employerRepository.GetEmployerByContracrtingPartyID(x.ContractingPartyId),
|
EmployerViewModels = _employerRepository.GetEmployerByContracrtingPartyID(x.ContractingPartyId),
|
||||||
EmployerNo = _employerRepository.GetEmployerByContracrtingPartyID(x.ContractingPartyId)
|
EmployerNo = _employerRepository.GetEmployerByContracrtingPartyID(x.ContractingPartyId).FirstOrDefault(xn => xn.ContractingPartyID == x.ContractingPartyId)?.EmployerNo,
|
||||||
.FirstOrDefault(xn => xn.ContractingPartyID == x.ContractingPartyId)?.EmployerNo,
|
EmployerName = _employerRepository.GetEmployerByContracrtingPartyID(x.ContractingPartyId).FirstOrDefault(xn => xn.ContractingPartyID == x.ContractingPartyId)?.FullName,
|
||||||
EmployerName = _employerRepository.GetEmployerByContracrtingPartyID(x.ContractingPartyId)
|
|
||||||
.FirstOrDefault(xn => xn.ContractingPartyID == x.ContractingPartyId)?.FullName,
|
|
||||||
//EmployerId = _employerRepository.GetEmployerByContracrtingPartyID(x.ContractingPartyId).FirstOrDefault(xn => xn.ContractingPartyID == x.ContractingPartyId)?.Id == null ? 0 :
|
//EmployerId = _employerRepository.GetEmployerByContracrtingPartyID(x.ContractingPartyId).FirstOrDefault(xn => xn.ContractingPartyID == x.ContractingPartyId)?.Id == null ? 0 :
|
||||||
// _employerRepository.GetEmployerByContracrtingPartyID(x.ContractingPartyId).FirstOrDefault(xn => xn.ContractingPartyID == x.ContractingPartyId)!.Id,
|
// _employerRepository.GetEmployerByContracrtingPartyID(x.ContractingPartyId).FirstOrDefault(xn => xn.ContractingPartyID == x.ContractingPartyId)!.Id,
|
||||||
ContractAmount = x.ContractAmount,
|
ContractAmount = x.ContractAmount,
|
||||||
@@ -446,6 +425,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
//EmployeeCount = WorkShopDetailsAndEmployeeCount(x.ContractingPartyId).EmployeeCount,
|
//EmployeeCount = WorkShopDetailsAndEmployeeCount(x.ContractingPartyId).EmployeeCount,
|
||||||
//ArchiveCode = WorkShopDetailsAndEmployeeCount(x.ContractingPartyId).ArchiveCode,
|
//ArchiveCode = WorkShopDetailsAndEmployeeCount(x.ContractingPartyId).ArchiveCode,
|
||||||
TypeOfContract = x.TypeOfContract
|
TypeOfContract = x.TypeOfContract
|
||||||
|
|
||||||
}).ToList();
|
}).ToList();
|
||||||
//Console.WriteLine("efTime : " + watch.Elapsed);
|
//Console.WriteLine("efTime : " + watch.Elapsed);
|
||||||
|
|
||||||
@@ -495,6 +475,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
//joinPersonelList.AddRange(noBlock);
|
//joinPersonelList.AddRange(noBlock);
|
||||||
var p = _workshopApplication.PersonnelCount(workshopId);
|
var p = _workshopApplication.PersonnelCount(workshopId);
|
||||||
pCount += p;
|
pCount += p;
|
||||||
|
|
||||||
}
|
}
|
||||||
//var joinlistWithoutDuplicat = joinPersonelList.GroupBy(x => x.PersonName).Select(x => x.First()).ToList();
|
//var joinlistWithoutDuplicat = joinPersonelList.GroupBy(x => x.PersonName).Select(x => x.First()).ToList();
|
||||||
//left = joinlistWithoutDuplicat.Count();
|
//left = joinlistWithoutDuplicat.Count();
|
||||||
@@ -556,6 +537,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
var findeByFilter = new List<InstitutionContractViewModel>();
|
var findeByFilter = new List<InstitutionContractViewModel>();
|
||||||
if (searchModel.WorkshopId != 0)
|
if (searchModel.WorkshopId != 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
foreach (var item in join)
|
foreach (var item in join)
|
||||||
{
|
{
|
||||||
var check = item.WorkshopViewModels.Where(x => x.Id == searchModel.WorkshopId).ToList();
|
var check = item.WorkshopViewModels.Where(x => x.Id == searchModel.WorkshopId).ToList();
|
||||||
@@ -569,11 +551,14 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
var findeByFilter2 = new List<InstitutionContractViewModel>();
|
var findeByFilter2 = new List<InstitutionContractViewModel>();
|
||||||
if (searchModel.EmployerId != 0)
|
if (searchModel.EmployerId != 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
foreach (var item in join)
|
foreach (var item in join)
|
||||||
{
|
{
|
||||||
var check = item.EmployerViewModels.Where(x => x.Id == searchModel.EmployerId).ToList();
|
var check = item.EmployerViewModels.Where(x => x.Id == searchModel.EmployerId).ToList();
|
||||||
if (check.Count > 0)
|
if (check.Count > 0)
|
||||||
findeByFilter2.Add(item);
|
findeByFilter2.Add(item);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
join = findeByFilter2;
|
join = findeByFilter2;
|
||||||
@@ -599,13 +584,10 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
{
|
{
|
||||||
var result = _institutionContractRepository.NewSearch(new InstitutionContractSearchModel());
|
var result = _institutionContractRepository.NewSearch(new InstitutionContractSearchModel());
|
||||||
|
|
||||||
return result.Where(x =>
|
return result.Where(x => x.IsActiveString == "true" && x.IsContractingPartyBlock !="true" && x.WorkshopCount != "0" && x.ContractStartGr <= DateTime.Now && x.ContractEndGr >= DateTime.Now).ToList();
|
||||||
x.IsActiveString == "true" && x.IsContractingPartyBlock != "true" && x.WorkshopCount != "0" &&
|
|
||||||
x.ContractStartGr <= DateTime.Now && x.ContractEndGr >= DateTime.Now).ToList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ExpCheckColor(DateTime now, DateTime ContractEndGr, DateTime endThisMontGr, string ContractAmount,
|
public string ExpCheckColor(DateTime now, DateTime ContractEndGr, DateTime endThisMontGr, string ContractAmount, string isActiveString)
|
||||||
string isActiveString)
|
|
||||||
{
|
{
|
||||||
string result = "";
|
string result = "";
|
||||||
|
|
||||||
@@ -634,7 +616,6 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
result.TotalBalanceDbl = debt - credit;
|
result.TotalBalanceDbl = debt - credit;
|
||||||
result.TotalBalanceStr = result.TotalBalanceDbl.ToMoney();
|
result.TotalBalanceStr = result.TotalBalanceDbl.ToMoney();
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -642,9 +623,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
{
|
{
|
||||||
var result = new WorkshopsAndEmployeeViewModel();
|
var result = new WorkshopsAndEmployeeViewModel();
|
||||||
|
|
||||||
var emplId = _employerRepository.GetEmployerByContracrtingPartyID(contractingPartyId).Select(x => x.Id)
|
var emplId = _employerRepository.GetEmployerByContracrtingPartyID(contractingPartyId).Select(x => x.Id).ToList(); ;
|
||||||
.ToList();
|
|
||||||
;
|
|
||||||
result.WorkshopViewModels = _workshopRepository.GetWorkshopsByEmployerId(emplId);
|
result.WorkshopViewModels = _workshopRepository.GetWorkshopsByEmployerId(emplId);
|
||||||
var workshopIds = result.WorkshopViewModels.Select(x => x.Id).ToList();
|
var workshopIds = result.WorkshopViewModels.Select(x => x.Id).ToList();
|
||||||
var left = 0;
|
var left = 0;
|
||||||
@@ -657,6 +636,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
//joinPersonelList.AddRange(noBlock);
|
//joinPersonelList.AddRange(noBlock);
|
||||||
var pCount = _workshopApplication.PersonnelCount(workshopId);
|
var pCount = _workshopApplication.PersonnelCount(workshopId);
|
||||||
result.EmployeeCount = Convert.ToString(pCount);
|
result.EmployeeCount = Convert.ToString(pCount);
|
||||||
|
|
||||||
}
|
}
|
||||||
//var joinlistWithoutDuplicat = joinPersonelList.GroupBy(x => x.PersonName).Select(x => x.First()).ToList();
|
//var joinlistWithoutDuplicat = joinPersonelList.GroupBy(x => x.PersonName).Select(x => x.First()).ToList();
|
||||||
//left = joinlistWithoutDuplicat.Count();
|
//left = joinlistWithoutDuplicat.Count();
|
||||||
@@ -715,6 +695,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
Obligation = get.ObligationString,
|
Obligation = get.ObligationString,
|
||||||
TotalAmount = get.TotalAmountString,
|
TotalAmount = get.TotalAmountString,
|
||||||
WorkshopViewModels = workshops
|
WorkshopViewModels = workshops
|
||||||
|
|
||||||
};
|
};
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -722,6 +703,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
|
|
||||||
public OperationResult Active(long id)
|
public OperationResult Active(long id)
|
||||||
{
|
{
|
||||||
|
|
||||||
var opration = new OperationResult();
|
var opration = new OperationResult();
|
||||||
var contract = _institutionContractRepository.Get(id);
|
var contract = _institutionContractRepository.Get(id);
|
||||||
if (contract == null)
|
if (contract == null)
|
||||||
@@ -786,7 +768,6 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
var res = _employerRepository.DeActiveAll(employer.Id);
|
var res = _employerRepository.DeActiveAll(employer.Id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return opration.Succcedded();
|
return opration.Succcedded();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -816,7 +797,6 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
var res = _employerRepository.ActiveAll(employer.Id);
|
var res = _employerRepository.ActiveAll(employer.Id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return opration.Succcedded();
|
return opration.Succcedded();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -845,6 +825,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
public void RemoveContract(long id)
|
public void RemoveContract(long id)
|
||||||
{
|
{
|
||||||
_institutionContractRepository.RemoveContract(id);
|
_institutionContractRepository.RemoveContract(id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -887,368 +868,8 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
{
|
{
|
||||||
return _institutionContractRepository.GetcontractAmount(countPerson);
|
return _institutionContractRepository.GetcontractAmount(countPerson);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<PagedResult<GetInstitutionContractListItemsViewModel>> GetList(
|
|
||||||
InstitutionContractListSearchModel searchModel)
|
|
||||||
{
|
|
||||||
return await _institutionContractRepository.GetList(searchModel);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task<GetInstitutionContractListStatsViewModel> GetListStats(InstitutionContractListSearchModel searchModel)
|
|
||||||
{
|
|
||||||
return _institutionContractRepository.GetListStats(searchModel);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<OperationResult> CreateAsync(CreateInstitutionContractRequest command)
|
|
||||||
{
|
|
||||||
string contractingPartyName = String.Empty;
|
|
||||||
bool dateMessages = false;
|
|
||||||
string dateMaessageResult = String.Empty;
|
|
||||||
var opration = new OperationResult();
|
|
||||||
if (_institutionContractRepository.Exists(x =>
|
|
||||||
x.ContractingPartyId == command.ContractingPartyId && x.RepresentativeId == command.RepresentativeId &&
|
|
||||||
x.TypeOfContract == command.TypeOfContract))
|
|
||||||
return opration.Failed(
|
|
||||||
"برای این معرف و طرف حساب قبلا قرارداد ایجاد شده است، شما میتوانید از تمدید استفاده کنید");
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.ContractDateFa))
|
|
||||||
{
|
|
||||||
dateMaessageResult = "تاریخ قراراداد اجباری است. ";
|
|
||||||
dateMessages = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.ContractStartFa))
|
|
||||||
{
|
|
||||||
dateMaessageResult += "تاریخ شروع قراراداد اجباری است. ";
|
|
||||||
dateMessages = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.ContractEndFa))
|
|
||||||
{
|
|
||||||
dateMaessageResult += "تاریخ پایان قراراداد اجباری است. ";
|
|
||||||
dateMessages = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dateMessages)
|
|
||||||
return opration.Failed(dateMaessageResult);
|
|
||||||
|
|
||||||
if (command.RepresentativeId < 1 && command.ContractingPartyId > 1)
|
|
||||||
{
|
|
||||||
return opration.Failed("معرف را انتخاب کنید");
|
|
||||||
}
|
|
||||||
else if (command.ContractingPartyId < 1 && command.RepresentativeId > 1)
|
|
||||||
{
|
|
||||||
return opration.Failed("طرف حساب را انتخاب کنید");
|
|
||||||
}
|
|
||||||
else if (command.ContractingPartyId < 1 && command.RepresentativeId < 1)
|
|
||||||
{
|
|
||||||
return opration.Failed("معرف و طرف حساب را انتخاب کنید");
|
|
||||||
}
|
|
||||||
|
|
||||||
var syear = command.ContractStartFa.Substring(0, 4);
|
|
||||||
var smonth = command.ContractStartFa.Substring(5, 2);
|
|
||||||
var sday = command.ContractStartFa.Substring(8, 2);
|
|
||||||
var contractingParty = _contractingPartyRepository.GetDetails(command.ContractingPartyId);
|
|
||||||
//شماره قرارداد
|
|
||||||
var contractNo = $"{syear}{smonth}{sday}/{contractingParty.ArchiveCode}/0";
|
|
||||||
|
|
||||||
///////////////////////
|
|
||||||
if (command.ContactInfos.Count == 0)
|
|
||||||
return opration.Failed("ورود شماره تماس برای ارسال پیامک الزامیست");
|
|
||||||
var accountContact = command.ContactInfos.Where(x =>
|
|
||||||
x.SendSmsString == "true" && x.Position == "طرف قرارداد" && x.PhoneType == "شماره همراه" &&
|
|
||||||
!string.IsNullOrWhiteSpace(x.PhoneNumber)).ToList();
|
|
||||||
if (accountContact.Count == 0)
|
|
||||||
return opration.Failed("ورود شماره همراه با سمت طرف قرارداد برای ساخت حساب کاربری الزامیست");
|
|
||||||
var accountContactCount = command.ContactInfos
|
|
||||||
.Where(x => x.PhoneType == "شماره همراه" && x.Position == "طرف قرارداد").ToList();
|
|
||||||
if (accountContactCount.Count > 1)
|
|
||||||
return opration.Failed("فقط یکی از شماره تلفن ها میتواند سمت طرف قرارداد داشته باشد");
|
|
||||||
|
|
||||||
contractingPartyName = contractingParty.LName;
|
|
||||||
//نام معرف
|
|
||||||
var representative = _representativeRepository.GetDetails(command.RepresentativeId).FullName;
|
|
||||||
|
|
||||||
var contractStartGr = command.ContractStartFa.ToGeorgianDateTime();
|
|
||||||
var contractEndGr = command.ContractEndFa.ToGeorgianDateTime();
|
|
||||||
|
|
||||||
var contractDateGr = command.ContractDateFa.ToGeorgianDateTime();
|
|
||||||
|
|
||||||
if (command.Address != null && command.State == null)
|
|
||||||
{
|
|
||||||
return opration.Failed("لطفا استان و شهر را انتخاب کنید");
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((command.Address != null && command.State != null) && command.City == "شهرستان")
|
|
||||||
{
|
|
||||||
return opration.Failed("لطفا شهر را انتخاب کنید");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (command.Address == null && command.State != null)
|
|
||||||
{
|
|
||||||
return opration.Failed("لطفا آدرس را وارد کنید");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.OfficialCompany))
|
|
||||||
return opration.Failed("رسمی یا غیر رسمی بودن پرداخت را مشخص کنید");
|
|
||||||
if (command.OfficialCompany == "Official" && string.IsNullOrWhiteSpace(command.HasValueAddedTax))
|
|
||||||
return opration.Failed("وضعیت ارزش افزوده را مشخص کنید");
|
|
||||||
if (string.IsNullOrWhiteSpace(command.TypeOfContract))
|
|
||||||
return opration.Failed("عنوان قرارداد را انتخاب کنید");
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.ContractAmountString))
|
|
||||||
command.ContractAmountString = "0";
|
|
||||||
if (string.IsNullOrWhiteSpace(command.DailyCompenseationString))
|
|
||||||
command.DailyCompenseationString = "0";
|
|
||||||
if (string.IsNullOrWhiteSpace(command.ObligationString))
|
|
||||||
command.ObligationString = "0";
|
|
||||||
if (string.IsNullOrWhiteSpace(command.TotalAmountString))
|
|
||||||
command.TotalAmountString = "0";
|
|
||||||
|
|
||||||
var valueAddedTax = string.IsNullOrWhiteSpace(command.ValueAddedTaxStr)
|
|
||||||
? 0
|
|
||||||
: command.ValueAddedTaxStr.MoneyToDouble();
|
|
||||||
var contractAmountStr = command.ContractAmountString.ToDoubleMoney();
|
|
||||||
var contractAmount = Convert.ToDouble(contractAmountStr);
|
|
||||||
var DailyCompenseationStr = command.DailyCompenseationString.ToDoubleMoney();
|
|
||||||
var dailyCompenseation = Convert.ToDouble(DailyCompenseationStr);
|
|
||||||
var ObligationStr = command.ObligationString.ToDoubleMoney();
|
|
||||||
var obligation = Convert.ToDouble(ObligationStr);
|
|
||||||
var TotalAmountStr = command.TotalAmountString.ToDoubleMoney();
|
|
||||||
var totalAmount = Convert.ToDouble(TotalAmountStr);
|
|
||||||
//var hasValueAddedTax = "false";
|
|
||||||
//double valueAddedTax = 0;
|
|
||||||
//if (command.HasValueAddedTax == "true")
|
|
||||||
//{
|
|
||||||
// hasValueAddedTax = "true";
|
|
||||||
// valueAddedTax = command.ContractAmount * 0.1;
|
|
||||||
// command.ContractAmount += valueAddedTax;
|
|
||||||
//}
|
|
||||||
|
|
||||||
var createContract = new InstitutionContract(contractNo, command.RepresentativeId, representative,
|
|
||||||
command.ContractingPartyId,
|
|
||||||
contractingPartyName, contractDateGr, command.ContractDateFa, command.State, command.City,
|
|
||||||
command.Address, contractStartGr,
|
|
||||||
command.ContractStartFa, contractEndGr, command.ContractEndFa, contractAmount,
|
|
||||||
dailyCompenseation, obligation,
|
|
||||||
totalAmount, 0, command.WorkshopManualCount, command.EmployeeManualCount, command.Description,
|
|
||||||
command.OfficialCompany, command.TypeOfContract, command.HasValueAddedTax, valueAddedTax);
|
|
||||||
|
|
||||||
_institutionContractRepository.Create(createContract);
|
|
||||||
_institutionContractRepository.SaveChanges();
|
|
||||||
return opration.Succcedded(createContract.id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<OperationResult> EditAsync(EditInstitutionContractRequest command)
|
|
||||||
{
|
|
||||||
bool dateMessages = false;
|
|
||||||
string dateMaessageResult = String.Empty;
|
|
||||||
var opration = new OperationResult();
|
|
||||||
var ContractEdit = _institutionContractRepository.Get(command.Id);
|
|
||||||
if (ContractEdit == null)
|
|
||||||
opration.Failed("رکورد مورد نظر وجود ندارد");
|
|
||||||
|
|
||||||
var contractStartGr = command.ContractStartFa.ToGeorgianDateTime();
|
|
||||||
var contractEndGr = command.ContractEndFa.ToGeorgianDateTime();
|
|
||||||
|
|
||||||
var contractDateGr = command.ContractDateFa.ToGeorgianDateTime();
|
|
||||||
|
|
||||||
if (_institutionContractRepository.Exists(x =>
|
|
||||||
x.ContractingPartyId == ContractEdit.ContractingPartyId &&
|
|
||||||
((contractStartGr >= x.ContractStartGr && contractStartGr <= x.ContractEndGr) ||
|
|
||||||
(contractEndGr >= x.ContractStartGr && contractEndGr <= x.ContractEndGr)) && x.id != command.Id &&
|
|
||||||
x.TypeOfContract == command.TypeOfContract))
|
|
||||||
return opration.Failed("در بازه تاریخ وارد شده قرارداد دیگری وجود دارد");
|
|
||||||
//if (_institutionContractRepository.Exists(x =>
|
|
||||||
// x.ContractingPartyId == ContractEdit.ContractingPartyId && (x.ContractStartGr <= contractDateGr || x.ContractDateGr <= contractDateGr) && x.id != command.Id))
|
|
||||||
// return opration.Failed("تاریخ عقد قرارداد با قرارداد دیگری تداخل دارد");
|
|
||||||
if (string.IsNullOrWhiteSpace(command.ContractDateFa))
|
|
||||||
{
|
|
||||||
dateMaessageResult = "تاریخ قراراداد اجباری است. ";
|
|
||||||
dateMessages = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.ContractStartFa))
|
|
||||||
{
|
|
||||||
dateMaessageResult += "تاریخ شروع قراراداد اجباری است. ";
|
|
||||||
dateMessages = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.ContractEndFa))
|
|
||||||
{
|
|
||||||
dateMaessageResult += "تاریخ پایان قراراداد اجباری است. ";
|
|
||||||
dateMessages = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dateMessages)
|
|
||||||
return opration.Failed(dateMaessageResult);
|
|
||||||
if (command.Address != null && command.State == null)
|
|
||||||
{
|
|
||||||
return opration.Failed("لطفا استان و شهر را انتخاب کنید");
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((command.Address != null && command.State != null) && command.City == "شهرستان")
|
|
||||||
{
|
|
||||||
return opration.Failed("لطفا شهر را انتخاب کنید");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (command.Address == null && command.State != null)
|
|
||||||
{
|
|
||||||
return opration.Failed("لطفا آدرس را وارد کنید");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.OfficialCompany))
|
|
||||||
return opration.Failed("رسمی یا غیر رسمی بودن پرداخت را مشخص کنید");
|
|
||||||
if (command.OfficialCompany == "Official" && string.IsNullOrWhiteSpace(command.HasValueAddedTax))
|
|
||||||
return opration.Failed("وضعیت ارزش افزوده را مشخص کنید");
|
|
||||||
if (string.IsNullOrWhiteSpace(command.TypeOfContract))
|
|
||||||
return opration.Failed("عنوان قرارداد را انتخاب کنید");
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.ContractAmountString))
|
|
||||||
command.ContractAmountString = "0";
|
|
||||||
if (string.IsNullOrWhiteSpace(command.DailyCompenseationString))
|
|
||||||
command.DailyCompenseationString = "0";
|
|
||||||
if (string.IsNullOrWhiteSpace(command.ObligationString))
|
|
||||||
command.ObligationString = "0";
|
|
||||||
if (string.IsNullOrWhiteSpace(command.TotalAmountString))
|
|
||||||
command.TotalAmountString = "0";
|
|
||||||
|
|
||||||
var valueAddedTax = command.ValueAddedTaxStr.MoneyToDouble();
|
|
||||||
var contractAmountStr = command.ContractAmountString.ToDoubleMoney();
|
|
||||||
var contractAmount = Convert.ToDouble(contractAmountStr);
|
|
||||||
var DailyCompenseationStr = command.DailyCompenseationString.ToDoubleMoney();
|
|
||||||
var dailyCompenseation = Convert.ToDouble(DailyCompenseationStr);
|
|
||||||
var ObligationStr = command.ObligationString.ToDoubleMoney();
|
|
||||||
var obligation = Convert.ToDouble(ObligationStr);
|
|
||||||
var TotalAmountStr = command.TotalAmountString.ToDoubleMoney();
|
|
||||||
var totalAmount = Convert.ToDouble(TotalAmountStr);
|
|
||||||
|
|
||||||
ContractEdit.Edit(contractDateGr, command.ContractDateFa, command.State, command.City, command.Address,
|
|
||||||
contractStartGr,
|
|
||||||
command.ContractStartFa, contractEndGr, command.ContractEndFa, contractAmount,
|
|
||||||
dailyCompenseation,
|
|
||||||
obligation, totalAmount, command.WorkshopManualCount, command.EmployeeManualCount,
|
|
||||||
command.Description, command.OfficialCompany, command.TypeOfContract, valueAddedTax,
|
|
||||||
command.HasValueAddedTax);
|
|
||||||
await _institutionContractRepository.SaveChangesAsync();
|
|
||||||
return opration.Succcedded(command.Id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<OperationResult> ExtensionَAsync(CreateInstitutionContractRequest command)
|
|
||||||
{
|
|
||||||
bool dateMessages = false;
|
|
||||||
string dateMaessageResult = String.Empty;
|
|
||||||
var opration = new OperationResult();
|
|
||||||
|
|
||||||
command.ExtensionNo += 1;
|
|
||||||
if (_institutionContractRepository.Exists(x =>
|
|
||||||
x.ExtensionNo == command.ExtensionNo && x.ContractingPartyId == command.ContractingPartyId &&
|
|
||||||
x.TypeOfContract == command.TypeOfContract))
|
|
||||||
return opration.Failed("برای این قرارداد قبلا تمدید ایجاد شده است");
|
|
||||||
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.ContractDateFa))
|
|
||||||
{
|
|
||||||
dateMaessageResult = "تاریخ قراراداد اجباری است. ";
|
|
||||||
dateMessages = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.ContractStartFa))
|
|
||||||
{
|
|
||||||
dateMaessageResult += "تاریخ شروع قراراداد اجباری است. ";
|
|
||||||
dateMessages = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.ContractEndFa))
|
|
||||||
{
|
|
||||||
dateMaessageResult += "تاریخ پایان قراراداد اجباری است. ";
|
|
||||||
dateMessages = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dateMessages)
|
|
||||||
return opration.Failed(dateMaessageResult);
|
|
||||||
|
|
||||||
var firstContract =
|
|
||||||
_institutionContractRepository.GetFirstContract(command.ContractingPartyId, command.TypeOfContract);
|
|
||||||
|
|
||||||
var syear = firstContract.ContractStartFa.Substring(0, 4);
|
|
||||||
var smonth = firstContract.ContractStartFa.Substring(5, 2);
|
|
||||||
var sday = firstContract.ContractStartFa.Substring(8, 2);
|
|
||||||
var contractingParty = _contractingPartyRepository.GetDetails(command.ContractingPartyId);
|
|
||||||
//شماره قرارداد
|
|
||||||
var contractNo = $"{syear}{smonth}{sday}/{contractingParty.ArchiveCode}/{command.ExtensionNo}";
|
|
||||||
|
|
||||||
|
|
||||||
var contractStartGr = command.ContractStartFa.ToGeorgianDateTime();
|
|
||||||
var contractEndGr = command.ContractEndFa.ToGeorgianDateTime();
|
|
||||||
|
|
||||||
var contractDateGr = command.ContractDateFa.ToGeorgianDateTime();
|
|
||||||
if (_institutionContractRepository.Exists(x =>
|
|
||||||
((contractStartGr >= x.ContractStartGr && contractStartGr <= x.ContractEndGr) ||
|
|
||||||
(contractEndGr >= x.ContractStartGr && contractEndGr <= x.ContractEndGr)) &&
|
|
||||||
x.TypeOfContract == command.TypeOfContract && x.ContractingPartyId == command.ContractingPartyId))
|
|
||||||
return opration.Failed("تاریخ شروع و پایان وارد شده با قرارداد دیگری تداخل دارد");
|
|
||||||
if (command.Address != null && command.State == null)
|
|
||||||
{
|
|
||||||
return opration.Failed("لطفا استان و شهر را انتخاب کنید");
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((command.Address != null && command.State != null) && command.City == "شهرستان")
|
|
||||||
{
|
|
||||||
return opration.Failed("لطفا شهر را انتخاب کنید");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (command.Address == null && command.State != null)
|
|
||||||
{
|
|
||||||
return opration.Failed("لطفا آدرس را وارد کنید");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.OfficialCompany))
|
|
||||||
return opration.Failed("رسمی یا غیر رسمی بودن پرداخت را مشخص کنید");
|
|
||||||
if (command.OfficialCompany == "Official" && string.IsNullOrWhiteSpace(command.HasValueAddedTax))
|
|
||||||
return opration.Failed("وضعیت ارزش افزوده را مشخص کنید");
|
|
||||||
if (string.IsNullOrWhiteSpace(command.TypeOfContract))
|
|
||||||
return opration.Failed("عنوان قرارداد را انتخاب کنید");
|
|
||||||
if (string.IsNullOrWhiteSpace(command.ContractAmountString))
|
|
||||||
command.ContractAmountString = "0";
|
|
||||||
if (string.IsNullOrWhiteSpace(command.DailyCompenseationString))
|
|
||||||
command.DailyCompenseationString = "0";
|
|
||||||
if (string.IsNullOrWhiteSpace(command.ObligationString))
|
|
||||||
command.ObligationString = "0";
|
|
||||||
if (string.IsNullOrWhiteSpace(command.TotalAmountString))
|
|
||||||
command.TotalAmountString = "0";
|
|
||||||
var valueAddedTax = string.IsNullOrWhiteSpace(command.ValueAddedTaxStr)
|
|
||||||
? 0
|
|
||||||
: command.ValueAddedTaxStr.MoneyToDouble();
|
|
||||||
var contractAmountStr = command.ContractAmountString.ToDoubleMoney();
|
|
||||||
var contractAmount = Convert.ToDouble(contractAmountStr);
|
|
||||||
var DailyCompenseationStr = command.DailyCompenseationString.ToDoubleMoney();
|
|
||||||
var dailyCompenseation = Convert.ToDouble(DailyCompenseationStr);
|
|
||||||
var ObligationStr = command.ObligationString.ToDoubleMoney();
|
|
||||||
var obligation = Convert.ToDouble(ObligationStr);
|
|
||||||
var TotalAmountStr = command.TotalAmountString.ToDoubleMoney();
|
|
||||||
var totalAmount = Convert.ToDouble(TotalAmountStr);
|
|
||||||
var contractingPartyName = contractingParty.LName;
|
|
||||||
var representative = _representativeRepository.GetDetails(command.RepresentativeId).FullName;
|
|
||||||
|
|
||||||
var createContract = new InstitutionContract(contractNo, command.RepresentativeId, representative,
|
|
||||||
command.ContractingPartyId,
|
|
||||||
contractingPartyName, contractDateGr, command.ContractDateFa, command.State, command.City,
|
|
||||||
command.Address, contractStartGr,
|
|
||||||
command.ContractStartFa, contractEndGr, command.ContractEndFa, contractAmount,
|
|
||||||
dailyCompenseation, obligation,
|
|
||||||
totalAmount, command.ExtensionNo, command.WorkshopManualCount, command.EmployeeManualCount,
|
|
||||||
command.Description, command.OfficialCompany, command.TypeOfContract, command.HasValueAddedTax,
|
|
||||||
valueAddedTax);
|
|
||||||
|
|
||||||
_institutionContractRepository.Create(createContract);
|
|
||||||
_institutionContractRepository.SaveChanges();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return opration.Succcedded(createContract.id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#region CustomViewModels
|
#region CustomViewModels
|
||||||
|
|
||||||
|
|||||||
@@ -1,208 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using _0_Framework.Application;
|
|
||||||
using Company.Domain.PaymentInstrumentAgg;
|
|
||||||
using CompanyManagment.App.Contracts.PaymentInstrument;
|
|
||||||
|
|
||||||
namespace CompanyManagment.Application;
|
|
||||||
|
|
||||||
public class PaymentInstrumentApplication:IPaymentInstrumentApplication
|
|
||||||
{
|
|
||||||
private readonly IPaymentInstrumentRepository _paymentInstrumentRepository;
|
|
||||||
private readonly IPaymentInstrumentGroupRepository _paymentInstrumentGroupRepository;
|
|
||||||
|
|
||||||
public PaymentInstrumentApplication(IPaymentInstrumentRepository paymentInstrumentRepository,
|
|
||||||
IPaymentInstrumentGroupRepository paymentInstrumentGroupRepository)
|
|
||||||
{
|
|
||||||
_paymentInstrumentRepository = paymentInstrumentRepository;
|
|
||||||
_paymentInstrumentGroupRepository = paymentInstrumentGroupRepository;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<OperationResult> CreateBankAccount(CreateBankPaymentInstrument command)
|
|
||||||
{
|
|
||||||
var op = new OperationResult();
|
|
||||||
if (command.IsAuth)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrWhiteSpace(command.AccountNumber))
|
|
||||||
{
|
|
||||||
return op.Failed("شماره حساب نمیتواند خالی باشد");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.IBan))
|
|
||||||
{
|
|
||||||
return op.Failed("شماره شبا نمیتواند خالی باشد");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.CardNumber))
|
|
||||||
{
|
|
||||||
return op.Failed("شماره کارت نمیتواند خالی باشد");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.AccountHolderName))
|
|
||||||
{
|
|
||||||
return op.Failed("نام صاحب حساب نمیتواند خالی باشد");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var entity = PaymentInstrument.CreateBankAccount(command.CardNumber, command.AccountHolderName, command.AccountNumber,
|
|
||||||
command.IBan, command.IsAuth,command.PaymentInstrumentGroupId);
|
|
||||||
await _paymentInstrumentRepository.CreateAsync(entity);
|
|
||||||
await _paymentInstrumentRepository.SaveChangesAsync();
|
|
||||||
return op.Succcedded();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<OperationResult> CreateBankAccount(List<CreateBankPaymentInstrument> commands)
|
|
||||||
{
|
|
||||||
var op = new OperationResult();
|
|
||||||
foreach (var command in commands)
|
|
||||||
{
|
|
||||||
if (command.IsAuth)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrWhiteSpace(command.AccountNumber))
|
|
||||||
{
|
|
||||||
return op.Failed("شماره حساب نمیتواند خالی باشد");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.IBan))
|
|
||||||
{
|
|
||||||
return op.Failed("شماره شبا نمیتواند خالی باشد");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.CardNumber))
|
|
||||||
{
|
|
||||||
return op.Failed("شماره کارت نمیتواند خالی باشد");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(command.AccountHolderName))
|
|
||||||
{
|
|
||||||
return op.Failed("نام صاحب حساب نمیتواند خالی باشد");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var entity = PaymentInstrument.CreateBankAccount(command.CardNumber, command.AccountHolderName, command.AccountNumber,
|
|
||||||
command.IBan, command.IsAuth,command.PaymentInstrumentGroupId);
|
|
||||||
await _paymentInstrumentRepository.CreateAsync(entity);
|
|
||||||
}
|
|
||||||
await _paymentInstrumentRepository.SaveChangesAsync();
|
|
||||||
return op.Succcedded();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<OperationResult> CreatePos(CreatePosPaymentInstrument command)
|
|
||||||
{
|
|
||||||
var op = new OperationResult();
|
|
||||||
if (string.IsNullOrWhiteSpace(command.PosTerminalId))
|
|
||||||
{
|
|
||||||
return op.Failed("شناسه دستگاه یوزر نمیتواند خالی باشد");
|
|
||||||
}
|
|
||||||
|
|
||||||
var entity = PaymentInstrument.CreatePosType(command.PosTerminalId, command.Description,command.PaymentInstrumentGroupId);
|
|
||||||
await _paymentInstrumentRepository.CreateAsync(entity);
|
|
||||||
await _paymentInstrumentRepository.SaveChangesAsync();
|
|
||||||
return op.Succcedded();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<OperationResult> CreatePos(List<CreatePosPaymentInstrument> commands)
|
|
||||||
{
|
|
||||||
var op = new OperationResult();
|
|
||||||
foreach (var command in commands)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrWhiteSpace(command.PosTerminalId))
|
|
||||||
{
|
|
||||||
return op.Failed("شناسه دستگاه یوزر نمیتواند خالی باشد");
|
|
||||||
}
|
|
||||||
|
|
||||||
var entity = PaymentInstrument.CreatePosType(command.PosTerminalId, command.Description,command.PaymentInstrumentGroupId);
|
|
||||||
await _paymentInstrumentRepository.CreateAsync(entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
await _paymentInstrumentRepository.SaveChangesAsync();
|
|
||||||
return op.Succcedded();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<GetPaymentInstrumentListViewModel> GetList(PaymentInstrumentSearchModel searchModel)
|
|
||||||
{
|
|
||||||
return await _paymentInstrumentRepository.GetList(searchModel);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<OperationResult> CreateGroup(CreateBankPaymentInstrumentGroup command)
|
|
||||||
{
|
|
||||||
var op = new OperationResult();
|
|
||||||
if (string.IsNullOrWhiteSpace(command.Name))
|
|
||||||
{
|
|
||||||
return op.Failed("لطفا عنوان خودرا وارد کنید");
|
|
||||||
}
|
|
||||||
|
|
||||||
var instrumentGroup = new PaymentInstrumentGroup(command.Name);
|
|
||||||
await _paymentInstrumentGroupRepository.CreateAsync(instrumentGroup);
|
|
||||||
await _paymentInstrumentGroupRepository.SaveChangesAsync();
|
|
||||||
return op.Succcedded();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<OperationResult> EditGroup(EditBankPaymentInstrumentGroup command)
|
|
||||||
{
|
|
||||||
var op = new OperationResult();
|
|
||||||
if (string.IsNullOrWhiteSpace(command.Name))
|
|
||||||
{
|
|
||||||
return op.Failed("لطفا عنوان خودرا وارد کنید");
|
|
||||||
}
|
|
||||||
|
|
||||||
var paymentInstrumentGroup = _paymentInstrumentGroupRepository.Get(command.Id);
|
|
||||||
if (paymentInstrumentGroup == null)
|
|
||||||
{
|
|
||||||
return op.Failed("عنوان مورد نظر یافت نشد");
|
|
||||||
}
|
|
||||||
paymentInstrumentGroup.Edit(command.Name);
|
|
||||||
await _paymentInstrumentGroupRepository.SaveChangesAsync();
|
|
||||||
return op.Succcedded();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<OperationResult> DeleteGroup(long id)
|
|
||||||
{
|
|
||||||
var op = new OperationResult();
|
|
||||||
|
|
||||||
var paymentInstrumentGroup = _paymentInstrumentGroupRepository.Get(id);
|
|
||||||
if (paymentInstrumentGroup == null)
|
|
||||||
{
|
|
||||||
return op.Failed("عنوان مورد نظر یافت نشد");
|
|
||||||
}
|
|
||||||
|
|
||||||
paymentInstrumentGroup.DeActive();
|
|
||||||
await _paymentInstrumentGroupRepository.SaveChangesAsync();
|
|
||||||
return op.Succcedded();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<List<PaymentInstrumentGroupsViewModel>> GetGroup()
|
|
||||||
{
|
|
||||||
return await _paymentInstrumentGroupRepository.GetList();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<List<PosTerminalSelectListViewModel>> GetPosTerminalSelectList(string search)
|
|
||||||
{
|
|
||||||
return await _paymentInstrumentRepository.GetPosTerminalSelectList(search);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<List<string>> PosTerminalIdSelectList(string search, string selected)
|
|
||||||
{
|
|
||||||
return await _paymentInstrumentRepository.PosTerminalIdSelectList(search, selected);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<List<string>> IbanSelectList(string search, string selected)
|
|
||||||
{
|
|
||||||
return await _paymentInstrumentRepository.IbanSelectList(search, selected);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<List<string>> AccountNumberSelectList(string search, string selected)
|
|
||||||
{
|
|
||||||
return await _paymentInstrumentRepository.AccountNumberSelectList(search, selected);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<List<string>> CardNumberSelectList(string search, string selected)
|
|
||||||
{
|
|
||||||
return await _paymentInstrumentRepository.CardNumberSelectList(search, selected);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<List<string>> AccountHolderNameSelectList(string search, string selected)
|
|
||||||
{
|
|
||||||
return await _paymentInstrumentRepository.AccountHolderNameSelectList(search, selected);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -21,9 +21,9 @@ public class RollCallMandatoryApplication : IRollCallMandatoryApplication
|
|||||||
return _rollCallMandatoryRepository.Exists(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate.Value.Date >= contractStart.Date);
|
return _rollCallMandatoryRepository.Exists(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate.Value.Date >= contractStart.Date);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout, bool rotatingShiftCompute,bool totalLeaveCompute)
|
public ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout, bool rotatingShiftCompute)
|
||||||
{
|
{
|
||||||
return _rollCallMandatoryRepository.MandatoryCompute(employeeId,workshopId, contractStart, contractEnd, command, holidayWorking, isStaticCheckout, rotatingShiftCompute, totalLeaveCompute);
|
return _rollCallMandatoryRepository.MandatoryCompute(employeeId,workshopId, contractStart, contractEnd, command, holidayWorking, isStaticCheckout, rotatingShiftCompute);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart, DateTime contractEnd,
|
public async Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart, DateTime contractEnd,
|
||||||
|
|||||||
@@ -30,11 +30,8 @@ public class SalaryAidApplication : ISalaryAidApplication
|
|||||||
private readonly ICheckoutRepository _checkoutRepository;
|
private readonly ICheckoutRepository _checkoutRepository;
|
||||||
|
|
||||||
|
|
||||||
public SalaryAidApplication(ISalaryAidRepository salaryAidRepository,
|
public SalaryAidApplication(ISalaryAidRepository salaryAidRepository, ICustomizeCheckoutRepository customizeCheckoutRepository,
|
||||||
ICustomizeCheckoutRepository customizeCheckoutRepository,
|
IEmployeeRepository employeeRepository, ICustomizeCheckoutTempRepository customizeCheckoutTempRepository, IAuthHelper authHelper, ICustomizeCheckoutApplication customizeCheckoutApplication, ICustomizeCheckoutTempApplication customizeCheckoutTempApplication, ICheckoutRepository checkoutRepository)
|
||||||
IEmployeeRepository employeeRepository, ICustomizeCheckoutTempRepository customizeCheckoutTempRepository,
|
|
||||||
IAuthHelper authHelper, ICustomizeCheckoutApplication customizeCheckoutApplication,
|
|
||||||
ICustomizeCheckoutTempApplication customizeCheckoutTempApplication, ICheckoutRepository checkoutRepository)
|
|
||||||
{
|
{
|
||||||
_salaryAidRepository = salaryAidRepository;
|
_salaryAidRepository = salaryAidRepository;
|
||||||
_customizeCheckoutRepository = customizeCheckoutRepository;
|
_customizeCheckoutRepository = customizeCheckoutRepository;
|
||||||
@@ -65,7 +62,6 @@ public class SalaryAidApplication : ISalaryAidApplication
|
|||||||
{
|
{
|
||||||
return op.Failed("تاریخ وارد شده نامعتبر است");
|
return op.Failed("تاریخ وارد شده نامعتبر است");
|
||||||
}
|
}
|
||||||
|
|
||||||
var calculationDate = $"{command.CalculationYear:0000}/{command.CalculationMonth:00}/01";
|
var calculationDate = $"{command.CalculationYear:0000}/{command.CalculationMonth:00}/01";
|
||||||
if (!calculationDate.TryToGeorgianDateTime(out var calculationDateGr))
|
if (!calculationDate.TryToGeorgianDateTime(out var calculationDateGr))
|
||||||
{
|
{
|
||||||
@@ -75,6 +71,7 @@ public class SalaryAidApplication : ISalaryAidApplication
|
|||||||
if (startDate > DateTime.Now)
|
if (startDate > DateTime.Now)
|
||||||
{
|
{
|
||||||
return op.Failed("تاریخ پرداخت مساعده می بایست تاریخ امروز یا قبل تر باشد");
|
return op.Failed("تاریخ پرداخت مساعده می بایست تاریخ امروز یا قبل تر باشد");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (command.Amount.Length > 15)
|
if (command.Amount.Length > 15)
|
||||||
@@ -88,16 +85,16 @@ public class SalaryAidApplication : ISalaryAidApplication
|
|||||||
|
|
||||||
_ = DateTime.Now.Date.AddMonthsFa(-1, out var oneMonthAgoGr);
|
_ = DateTime.Now.Date.AddMonthsFa(-1, out var oneMonthAgoGr);
|
||||||
|
|
||||||
// if (oneMonthAgoGr > calculationDateGr)
|
if (oneMonthAgoGr > calculationDateGr)
|
||||||
// {
|
{
|
||||||
// var prevCheckouts = _customizeCheckoutRepository.ValidateExistsCheckouts(calculationDateGr,
|
var prevCheckouts = _customizeCheckoutRepository.ValidateExistsCheckouts(calculationDateGr,
|
||||||
// oneMonthAgoGr, command.WorkshopId, command.EmployeeIds);
|
oneMonthAgoGr, command.WorkshopId, command.EmployeeIds);
|
||||||
//
|
|
||||||
// if (prevCheckouts.CustomizeCheckout || prevCheckouts.CustomizeCheckoutTemp)
|
if (prevCheckouts.CustomizeCheckout || prevCheckouts.CustomizeCheckoutTemp)
|
||||||
// {
|
{
|
||||||
// return op.Failed("شما نمیتوانید در تاریخ قبل از یک ماه گذشته که فیش صادر شده باشد مساعده دهید");
|
return op.Failed("شما نمیتوانید در تاریخ قبل از یک ماه گذشته که فیش صادر شده باشد مساعده دهید");
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
var existsCheckouts = _customizeCheckoutRepository.ValidateExistsCheckouts(calculationDateGr,
|
var existsCheckouts = _customizeCheckoutRepository.ValidateExistsCheckouts(calculationDateGr,
|
||||||
calculationDateGr, command.WorkshopId, command.EmployeeIds);
|
calculationDateGr, command.WorkshopId, command.EmployeeIds);
|
||||||
@@ -110,8 +107,8 @@ public class SalaryAidApplication : ISalaryAidApplication
|
|||||||
using var transaction = new TransactionScope();
|
using var transaction = new TransactionScope();
|
||||||
foreach (var employeeId in command.EmployeeIds)
|
foreach (var employeeId in command.EmployeeIds)
|
||||||
{
|
{
|
||||||
var entity = new SalaryAid(employeeId, command.WorkshopId, command.Amount.MoneyToDouble(), startDate,
|
|
||||||
userId, userType, command.CalculationMonth, command.CalculationYear);
|
var entity = new SalaryAid(employeeId, command.WorkshopId, command.Amount.MoneyToDouble(), startDate, userId, userType, command.CalculationMonth, command.CalculationYear);
|
||||||
_salaryAidRepository.Create(entity);
|
_salaryAidRepository.Create(entity);
|
||||||
_salaryAidRepository.SaveChanges();
|
_salaryAidRepository.SaveChanges();
|
||||||
if (existsCheckouts.CustomizeCheckout)
|
if (existsCheckouts.CustomizeCheckout)
|
||||||
@@ -122,14 +119,13 @@ public class SalaryAidApplication : ISalaryAidApplication
|
|||||||
|
|
||||||
if (customizeCheckouts != null)
|
if (customizeCheckouts != null)
|
||||||
{
|
{
|
||||||
// customizeCheckouts.SetHasAmountConflict(true);
|
|
||||||
var salaryAids = customizeCheckouts.CustomizeCheckoutSalaryAids.ToList();
|
var salaryAids = customizeCheckouts.CustomizeCheckoutSalaryAids.ToList();
|
||||||
|
|
||||||
salaryAids.Add(new(entity.Amount.ToMoney(), entity.SalaryAidDateTime,
|
salaryAids.Add(new(entity.Amount.ToMoney(), entity.SalaryAidDateTime, entity.SalaryAidDateTime.ToFarsi(), entity.CalculationDate, entity.CalculationDate.ToFarsi(), entity.id));
|
||||||
entity.SalaryAidDateTime.ToFarsi(), entity.CalculationDate, entity.CalculationDate.ToFarsi(),
|
|
||||||
entity.id));
|
|
||||||
customizeCheckouts.SetSalaryAids(salaryAids);
|
customizeCheckouts.SetSalaryAids(salaryAids);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (existsCheckouts.CustomizeCheckoutTemp)
|
if (existsCheckouts.CustomizeCheckoutTemp)
|
||||||
@@ -139,24 +135,13 @@ public class SalaryAidApplication : ISalaryAidApplication
|
|||||||
|
|
||||||
if (customizeCheckoutTemp != null)
|
if (customizeCheckoutTemp != null)
|
||||||
{
|
{
|
||||||
// customizeCheckoutTemp.SetHasAmountConflict(true);
|
|
||||||
var salaryAids = customizeCheckoutTemp.CustomizeCheckoutSalaryAids.ToList();
|
var salaryAids = customizeCheckoutTemp.CustomizeCheckoutSalaryAids.ToList();
|
||||||
|
|
||||||
salaryAids.Add(new(entity.Amount.ToMoney(), entity.SalaryAidDateTime,
|
salaryAids.Add(new(entity.Amount.ToMoney(), entity.SalaryAidDateTime, entity.SalaryAidDateTime.ToFarsi(), entity.CalculationDate, entity.CalculationDate.ToFarsi(), entity.id));
|
||||||
entity.SalaryAidDateTime.ToFarsi(), entity.CalculationDate, entity.CalculationDate.ToFarsi(),
|
|
||||||
entity.id));
|
|
||||||
customizeCheckoutTemp.SetSalaryAids(salaryAids);
|
customizeCheckoutTemp.SetSalaryAids(salaryAids);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (existsCheckouts.Checkout)
|
|
||||||
{
|
|
||||||
var checkouts = _checkoutRepository.GetByWorkshopIdEmployeeIdInDate(
|
|
||||||
command.WorkshopId, employeeId, calculationDateGr).GetAwaiter().GetResult();
|
|
||||||
|
|
||||||
checkouts?.SetAmountConflict(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_customizeCheckoutRepository.SaveChanges();
|
_customizeCheckoutRepository.SaveChanges();
|
||||||
@@ -182,13 +167,12 @@ public class SalaryAidApplication : ISalaryAidApplication
|
|||||||
if (startDate > DateTime.Now)
|
if (startDate > DateTime.Now)
|
||||||
{
|
{
|
||||||
return op.Failed("تاریخ پرداخت مساعده می بایست تاریخ امروز یا قبل تر باشد");
|
return op.Failed("تاریخ پرداخت مساعده می بایست تاریخ امروز یا قبل تر باشد");
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
if (command.Amount.Length > 15)
|
if (command.Amount.Length > 15)
|
||||||
{
|
{
|
||||||
return op.Failed("مبلغ وارد شده معتبر نیست");
|
return op.Failed("مبلغ وارد شده معتبر نیست");
|
||||||
}
|
}
|
||||||
|
|
||||||
var entity = _salaryAidRepository.Get(command.Id);
|
var entity = _salaryAidRepository.Get(command.Id);
|
||||||
if (entity == null)
|
if (entity == null)
|
||||||
return op.Failed("چنین مساعده ای وجود ندارد");
|
return op.Failed("چنین مساعده ای وجود ندارد");
|
||||||
@@ -199,16 +183,16 @@ public class SalaryAidApplication : ISalaryAidApplication
|
|||||||
|
|
||||||
_ = DateTime.Now.Date.AddMonthsFa(-1, out var oneMonthAgoGr);
|
_ = DateTime.Now.Date.AddMonthsFa(-1, out var oneMonthAgoGr);
|
||||||
|
|
||||||
// if (oneMonthAgoGr > calculationDateGr)
|
if (oneMonthAgoGr > calculationDateGr)
|
||||||
// {
|
{
|
||||||
// var prevCheckouts = _customizeCheckoutRepository.ValidateExistsCheckouts(calculationDateGr,
|
var prevCheckouts = _customizeCheckoutRepository.ValidateExistsCheckouts(calculationDateGr,
|
||||||
// oneMonthAgoGr, entity.WorkshopId, [entity.EmployeeId]);
|
oneMonthAgoGr, entity.WorkshopId, [entity.EmployeeId]);
|
||||||
//
|
|
||||||
// if (prevCheckouts.CustomizeCheckout || prevCheckouts.CustomizeCheckoutTemp)
|
if (prevCheckouts.CustomizeCheckout || prevCheckouts.CustomizeCheckoutTemp)
|
||||||
// {
|
{
|
||||||
// return op.Failed("شما نمیتوانید در تاریخ قبل از یک ماه گذشته که فیش صادر شده باشد مساعده ای دهید");
|
return op.Failed("شما نمیتوانید در تاریخ قبل از یک ماه گذشته که فیش صادر شده باشد مساعده ای دهید");
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
|
||||||
var existsCheckouts = _customizeCheckoutRepository.ValidateExistsCheckouts(calculationDateGr,
|
var existsCheckouts = _customizeCheckoutRepository.ValidateExistsCheckouts(calculationDateGr,
|
||||||
@@ -221,8 +205,7 @@ public class SalaryAidApplication : ISalaryAidApplication
|
|||||||
using var transaction = new TransactionScope();
|
using var transaction = new TransactionScope();
|
||||||
var (userId, userType, _) = _authHelper.GetUserTypeWithId();
|
var (userId, userType, _) = _authHelper.GetUserTypeWithId();
|
||||||
|
|
||||||
entity.Edit(Tools.MoneyToDouble(command.Amount), startDate, userId, userType, command.CalculationMonth,
|
entity.Edit(Tools.MoneyToDouble(command.Amount), startDate, userId, userType, command.CalculationMonth, command.CalculationYear);
|
||||||
command.CalculationYear);
|
|
||||||
_salaryAidRepository.SaveChanges();
|
_salaryAidRepository.SaveChanges();
|
||||||
|
|
||||||
if (existsCheckouts.CustomizeCheckout)
|
if (existsCheckouts.CustomizeCheckout)
|
||||||
@@ -230,7 +213,6 @@ public class SalaryAidApplication : ISalaryAidApplication
|
|||||||
var customizeCheckouts = _customizeCheckoutRepository.GetByWorkshopIdEmployeeIdMonthYear(
|
var customizeCheckouts = _customizeCheckoutRepository.GetByWorkshopIdEmployeeIdMonthYear(
|
||||||
entity.WorkshopId, entity.EmployeeId,
|
entity.WorkshopId, entity.EmployeeId,
|
||||||
year, month).GetAwaiter().GetResult();
|
year, month).GetAwaiter().GetResult();
|
||||||
// customizeCheckouts?.SetHasAmountConflict(true);
|
|
||||||
|
|
||||||
var salaryAids = customizeCheckouts.CustomizeCheckoutSalaryAids.ToList();
|
var salaryAids = customizeCheckouts.CustomizeCheckoutSalaryAids.ToList();
|
||||||
|
|
||||||
@@ -244,15 +226,13 @@ public class SalaryAidApplication : ISalaryAidApplication
|
|||||||
entity.CalculationDate, entity.CalculationDate.ToFarsi(), entity.id));
|
entity.CalculationDate, entity.CalculationDate.ToFarsi(), entity.id));
|
||||||
|
|
||||||
customizeCheckouts.SetSalaryAids(salaryAids);
|
customizeCheckouts.SetSalaryAids(salaryAids);
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
if (existsCheckouts.CustomizeCheckoutTemp)
|
if (existsCheckouts.CustomizeCheckoutTemp)
|
||||||
{
|
{
|
||||||
var customizeCheckoutTemp = _customizeCheckoutTempRepository.GetByWorkshopIdEmployeeIdInDate(
|
var customizeCheckoutTemp = _customizeCheckoutTempRepository.GetByWorkshopIdEmployeeIdInDate(
|
||||||
entity.WorkshopId, entity.EmployeeId, calculationDateGr).GetAwaiter().GetResult();
|
entity.WorkshopId, entity.EmployeeId, calculationDateGr).GetAwaiter().GetResult();
|
||||||
|
|
||||||
// customizeCheckoutTemp?.SetHasAmountConflict(true);
|
|
||||||
|
|
||||||
var salaryAids = customizeCheckoutTemp.CustomizeCheckoutSalaryAids.ToList();
|
var salaryAids = customizeCheckoutTemp.CustomizeCheckoutSalaryAids.ToList();
|
||||||
|
|
||||||
var existsSalaryAid = salaryAids.FirstOrDefault(x => x.EntityId == entity.id);
|
var existsSalaryAid = salaryAids.FirstOrDefault(x => x.EntityId == entity.id);
|
||||||
@@ -265,15 +245,8 @@ public class SalaryAidApplication : ISalaryAidApplication
|
|||||||
entity.CalculationDate, entity.CalculationDate.ToFarsi(), entity.id));
|
entity.CalculationDate, entity.CalculationDate.ToFarsi(), entity.id));
|
||||||
|
|
||||||
customizeCheckoutTemp.SetSalaryAids(salaryAids);
|
customizeCheckoutTemp.SetSalaryAids(salaryAids);
|
||||||
}
|
|
||||||
if (existsCheckouts.Checkout)
|
|
||||||
{
|
|
||||||
var checkouts = _checkoutRepository.GetByWorkshopIdEmployeeIdInDate(
|
|
||||||
command.WorkshopId, entity.EmployeeId, calculationDateGr).GetAwaiter().GetResult();
|
|
||||||
|
|
||||||
checkouts?.SetAmountConflict(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_customizeCheckoutRepository.SaveChanges();
|
_customizeCheckoutRepository.SaveChanges();
|
||||||
transaction.Complete();
|
transaction.Complete();
|
||||||
return op.Succcedded();
|
return op.Succcedded();
|
||||||
@@ -289,23 +262,18 @@ public class SalaryAidApplication : ISalaryAidApplication
|
|||||||
var month = Convert.ToInt32(entity.CalculationDate.ToFarsi().Substring(5, 2));
|
var month = Convert.ToInt32(entity.CalculationDate.ToFarsi().Substring(5, 2));
|
||||||
var year = Convert.ToInt32(entity.CalculationDate.ToFarsi().Substring(0, 4));
|
var year = Convert.ToInt32(entity.CalculationDate.ToFarsi().Substring(0, 4));
|
||||||
|
|
||||||
if (_customizeCheckoutRepository.Exists(x =>
|
if (_customizeCheckoutRepository.Exists(x => x.WorkshopId == entity.WorkshopId && entity.EmployeeId == x.EmployeeId && x.YearInt == year && x.MonthInt == month))
|
||||||
x.WorkshopId == entity.WorkshopId && entity.EmployeeId == x.EmployeeId && x.YearInt == year &&
|
|
||||||
x.MonthInt == month))
|
|
||||||
return op.Failed("این پرسنل در این تاریخ دارای فیش حقوقی است");
|
return op.Failed("این پرسنل در این تاریخ دارای فیش حقوقی است");
|
||||||
|
|
||||||
|
|
||||||
if (_customizeCheckoutTempRepository.Exists(x =>
|
if (_customizeCheckoutTempRepository.Exists(x => x.WorkshopId == entity.WorkshopId && entity.EmployeeId == x.EmployeeId &&
|
||||||
x.WorkshopId == entity.WorkshopId && entity.EmployeeId == x.EmployeeId &&
|
x.YearInt == year && x.MonthInt == month && x.ContractStart <= entity.CalculationDate && x.ContractEnd >= entity.CalculationDate))
|
||||||
x.YearInt == year && x.MonthInt == month && x.ContractStart <= entity.CalculationDate &&
|
|
||||||
x.ContractEnd >= entity.CalculationDate))
|
|
||||||
{
|
{
|
||||||
return op.Failed("این پرسنل در این تاریخ دارای فیش حقوقی موقت است");
|
return op.Failed("این پرسنل در این تاریخ دارای فیش حقوقی موقت است");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_checkoutRepository.Exists(x => x.WorkshopId == entity.WorkshopId && entity.EmployeeId == x.EmployeeId &&
|
if (_checkoutRepository.Exists(x => x.WorkshopId == entity.WorkshopId && entity.EmployeeId == x.EmployeeId &&
|
||||||
x.ContractStart <= entity.CalculationDate &&
|
x.ContractStart <= entity.CalculationDate && x.ContractEnd >= entity.CalculationDate))
|
||||||
x.ContractEnd >= entity.CalculationDate))
|
|
||||||
{
|
{
|
||||||
return op.Failed("این پرسنل در این تاریخ دارای فیش حقوقی رسمی است");
|
return op.Failed("این پرسنل در این تاریخ دارای فیش حقوقی رسمی است");
|
||||||
}
|
}
|
||||||
@@ -325,18 +293,17 @@ public class SalaryAidApplication : ISalaryAidApplication
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task<OperationResult> CreateRangeAsync(List<CreateSalaryAidViewModel> commands)
|
public OperationResult CreateRange(List<CreateSalaryAidViewModel> commands)
|
||||||
{
|
{
|
||||||
var op = new OperationResult();
|
var op = new OperationResult();
|
||||||
await using var transaction = await _salaryAidRepository.BeginTransactionAsync();
|
using var transaction = new TransactionScope();
|
||||||
|
|
||||||
foreach (var command in commands)
|
foreach (var command in commands)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!command.SalaryDateTime.TryToGeorgianDateTime(out var startDate))
|
if (!command.SalaryDateTime.TryToGeorgianDateTime(out var startDate))
|
||||||
{
|
{
|
||||||
return op.Failed("تاریخ وارد شده نامعتبر است");
|
return op.Failed("تاریخ وارد شده نامعتبر است");
|
||||||
}
|
}
|
||||||
|
|
||||||
var calculationDate = $"{command.CalculationYear:0000}/{command.CalculationMonth:00}/01";
|
var calculationDate = $"{command.CalculationYear:0000}/{command.CalculationMonth:00}/01";
|
||||||
if (!calculationDate.TryToGeorgianDateTime(out var calculationDateGr))
|
if (!calculationDate.TryToGeorgianDateTime(out var calculationDateGr))
|
||||||
{
|
{
|
||||||
@@ -346,25 +313,24 @@ public class SalaryAidApplication : ISalaryAidApplication
|
|||||||
if (startDate > DateTime.Now)
|
if (startDate > DateTime.Now)
|
||||||
{
|
{
|
||||||
return op.Failed("تاریخ پرداخت مساعده می بایست تاریخ امروز یا قبل تر باشد");
|
return op.Failed("تاریخ پرداخت مساعده می بایست تاریخ امروز یا قبل تر باشد");
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
if (command.Amount.Length > 15)
|
if (command.Amount.Length > 15)
|
||||||
{
|
{
|
||||||
return op.Failed("مبلغ وارد شده معتبر نیست");
|
return op.Failed("مبلغ وارد شده معتبر نیست");
|
||||||
}
|
}
|
||||||
|
|
||||||
_ = DateTime.Now.Date.AddMonthsFa(-1, out var oneMonthAgoGr);
|
_ = DateTime.Now.Date.AddMonthsFa(-1, out var oneMonthAgoGr);
|
||||||
//
|
|
||||||
// if (oneMonthAgoGr > calculationDateGr)
|
if (oneMonthAgoGr > calculationDateGr)
|
||||||
// {
|
{
|
||||||
// var prevCheckouts = _customizeCheckoutRepository.ValidateExistsCheckouts(calculationDateGr,
|
var prevCheckouts = _customizeCheckoutRepository.ValidateExistsCheckouts(calculationDateGr,
|
||||||
// oneMonthAgoGr, command.WorkshopId, command.EmployeeIds);
|
oneMonthAgoGr, command.WorkshopId, command.EmployeeIds);
|
||||||
//
|
|
||||||
// if (prevCheckouts.CustomizeCheckout || prevCheckouts.Checkout || prevCheckouts.CustomizeCheckoutTemp)
|
if (prevCheckouts.CustomizeCheckout || prevCheckouts.Checkout || prevCheckouts.CustomizeCheckoutTemp)
|
||||||
// {
|
{
|
||||||
// return op.Failed("شما نمیتوانید در تاریخ قبل از یک ماه گذشته که فیش صادر شده باشد مساعده دهید");
|
return op.Failed("شما نمیتوانید در تاریخ قبل از یک ماه گذشته که فیش صادر شده باشد مساعده دهید");
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
var existsCheckouts = _customizeCheckoutRepository.ValidateExistsCheckouts(calculationDateGr,
|
var existsCheckouts = _customizeCheckoutRepository.ValidateExistsCheckouts(calculationDateGr,
|
||||||
calculationDateGr, command.WorkshopId, command.EmployeeIds);
|
calculationDateGr, command.WorkshopId, command.EmployeeIds);
|
||||||
@@ -377,6 +343,7 @@ public class SalaryAidApplication : ISalaryAidApplication
|
|||||||
var year = Convert.ToInt32(command.CalculationYear);
|
var year = Convert.ToInt32(command.CalculationYear);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var (userId, userType, _) = _authHelper.GetUserTypeWithId();
|
var (userId, userType, _) = _authHelper.GetUserTypeWithId();
|
||||||
|
|
||||||
foreach (var employeeId in command.EmployeeIds)
|
foreach (var employeeId in command.EmployeeIds)
|
||||||
@@ -388,10 +355,9 @@ public class SalaryAidApplication : ISalaryAidApplication
|
|||||||
id = employee.id;
|
id = employee.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
var entity = new SalaryAid(id, command.WorkshopId, command.Amount.MoneyToDouble(), startDate, userId,
|
var entity = new SalaryAid(id, command.WorkshopId, command.Amount.MoneyToDouble(), startDate, userId, userType, command.CalculationMonth, command.CalculationYear);
|
||||||
userType, command.CalculationMonth, command.CalculationYear);
|
_salaryAidRepository.Create(entity);
|
||||||
await _salaryAidRepository.CreateAsync(entity);
|
_salaryAidRepository.SaveChanges();
|
||||||
await _salaryAidRepository.SaveChangesAsync();
|
|
||||||
|
|
||||||
if (existsCheckouts.CustomizeCheckout)
|
if (existsCheckouts.CustomizeCheckout)
|
||||||
{
|
{
|
||||||
@@ -399,17 +365,15 @@ public class SalaryAidApplication : ISalaryAidApplication
|
|||||||
command.WorkshopId, employeeId,
|
command.WorkshopId, employeeId,
|
||||||
year, month).GetAwaiter().GetResult();
|
year, month).GetAwaiter().GetResult();
|
||||||
|
|
||||||
// customizeCheckouts?.SetHasAmountConflict(true);
|
|
||||||
|
|
||||||
if (customizeCheckouts != null)
|
if (customizeCheckouts != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
var salaryAids = customizeCheckouts.CustomizeCheckoutSalaryAids.ToList();
|
var salaryAids = customizeCheckouts.CustomizeCheckoutSalaryAids.ToList();
|
||||||
|
|
||||||
salaryAids.Add(new(entity.Amount.ToMoney(), entity.SalaryAidDateTime,
|
salaryAids.Add(new(entity.Amount.ToMoney(), entity.SalaryAidDateTime, entity.SalaryAidDateTime.ToFarsi(), entity.CalculationDate, entity.CalculationDate.ToFarsi(), entity.id));
|
||||||
entity.SalaryAidDateTime.ToFarsi(), entity.CalculationDate,
|
|
||||||
entity.CalculationDate.ToFarsi(), entity.id));
|
|
||||||
customizeCheckouts.SetSalaryAids(salaryAids);
|
customizeCheckouts.SetSalaryAids(salaryAids);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (existsCheckouts.CustomizeCheckoutTemp)
|
if (existsCheckouts.CustomizeCheckoutTemp)
|
||||||
@@ -417,35 +381,21 @@ public class SalaryAidApplication : ISalaryAidApplication
|
|||||||
var customizeCheckoutTemp = _customizeCheckoutTempRepository.GetByWorkshopIdEmployeeIdInDate(
|
var customizeCheckoutTemp = _customizeCheckoutTempRepository.GetByWorkshopIdEmployeeIdInDate(
|
||||||
command.WorkshopId, employeeId, calculationDateGr).GetAwaiter().GetResult();
|
command.WorkshopId, employeeId, calculationDateGr).GetAwaiter().GetResult();
|
||||||
|
|
||||||
// customizeCheckoutTemp?.SetHasAmountConflict(true);
|
|
||||||
if (customizeCheckoutTemp != null)
|
if (customizeCheckoutTemp != null)
|
||||||
{
|
{
|
||||||
var salaryAids = customizeCheckoutTemp.CustomizeCheckoutSalaryAids.ToList();
|
var salaryAids = customizeCheckoutTemp.CustomizeCheckoutSalaryAids.ToList();
|
||||||
|
|
||||||
salaryAids.Add(new(entity.Amount.ToMoney(), entity.SalaryAidDateTime,
|
salaryAids.Add(new(entity.Amount.ToMoney(), entity.SalaryAidDateTime, entity.SalaryAidDateTime.ToFarsi(), entity.CalculationDate, entity.CalculationDate.ToFarsi(), entity.id));
|
||||||
entity.SalaryAidDateTime.ToFarsi(), entity.CalculationDate,
|
|
||||||
entity.CalculationDate.ToFarsi(), entity.id));
|
|
||||||
customizeCheckoutTemp.SetSalaryAids(salaryAids);
|
customizeCheckoutTemp.SetSalaryAids(salaryAids);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (existsCheckouts.Checkout)
|
|
||||||
{
|
|
||||||
var checkouts = _checkoutRepository.GetByWorkshopIdEmployeeIdInDate(
|
|
||||||
command.WorkshopId, employeeId, calculationDateGr).GetAwaiter().GetResult();
|
|
||||||
|
|
||||||
checkouts?.SetAmountConflict(true);
|
|
||||||
}
|
}
|
||||||
|
_customizeCheckoutRepository.SaveChanges();
|
||||||
}
|
}
|
||||||
|
transaction.Complete();
|
||||||
await _customizeCheckoutRepository.SaveChangesAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
await transaction.CommitAsync();
|
|
||||||
return op.Succcedded();
|
return op.Succcedded();
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Pooya
|
#region Pooya
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// گروهبندی بر اساس ماه هنگام جستجو با انتخاب کارمند
|
/// گروهبندی بر اساس ماه هنگام جستجو با انتخاب کارمند
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -454,6 +404,6 @@ public class SalaryAidApplication : ISalaryAidApplication
|
|||||||
return _salaryAidRepository.GetSearchListAsGrouped(searchModel);
|
return _salaryAidRepository.GetSearchListAsGrouped(searchModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ using Company.Domain.MasterWorkHistory;
|
|||||||
using Company.Domain.ModuleAgg;
|
using Company.Domain.ModuleAgg;
|
||||||
using Company.Domain.ModuleTextManagerAgg;
|
using Company.Domain.ModuleTextManagerAgg;
|
||||||
using Company.Domain.OriginalTitleAgg;
|
using Company.Domain.OriginalTitleAgg;
|
||||||
using Company.Domain.PaymentInstrumentAgg;
|
|
||||||
using Company.Domain.PaymentToEmployeeAgg;
|
using Company.Domain.PaymentToEmployeeAgg;
|
||||||
using Company.Domain.PaymentToEmployeeItemAgg;
|
using Company.Domain.PaymentToEmployeeItemAgg;
|
||||||
using Company.Domain.PaymentTransactionAgg;
|
using Company.Domain.PaymentTransactionAgg;
|
||||||
@@ -133,9 +132,7 @@ public class CompanyContext : DbContext
|
|||||||
public DbSet<EntityModule> EntityModules { get; set; }
|
public DbSet<EntityModule> EntityModules { get; set; }
|
||||||
public DbSet<EntityModuleTextManager> EntityModuleTextManagers { get; set; }
|
public DbSet<EntityModuleTextManager> EntityModuleTextManagers { get; set; }
|
||||||
public DbSet<EntityBill> EntityBills { get; set; }
|
public DbSet<EntityBill> EntityBills { get; set; }
|
||||||
|
|
||||||
public DbSet<EntityContact> EntityContacts { get; set; }
|
public DbSet<EntityContact> EntityContacts { get; set; }
|
||||||
|
|
||||||
//---------Files------------------------------
|
//---------Files------------------------------
|
||||||
public DbSet<Board> Boards { get; set; }
|
public DbSet<Board> Boards { get; set; }
|
||||||
public DbSet<BoardType> BoardTypes { get; set; }
|
public DbSet<BoardType> BoardTypes { get; set; }
|
||||||
@@ -152,7 +149,6 @@ public class CompanyContext : DbContext
|
|||||||
public DbSet<FileTitle> FileTitles { get; set; }
|
public DbSet<FileTitle> FileTitles { get; set; }
|
||||||
public DbSet<FileTiming> FileTimings { get; set; }
|
public DbSet<FileTiming> FileTimings { get; set; }
|
||||||
public DbSet<FileState> FileStates { get; set; }
|
public DbSet<FileState> FileStates { get; set; }
|
||||||
|
|
||||||
public DbSet<FileAlert> FileAlerts { get; set; }
|
public DbSet<FileAlert> FileAlerts { get; set; }
|
||||||
//-------Task Manager----------------------------
|
//-------Task Manager----------------------------
|
||||||
//public DbSet<Task> Tasks { get; set; }
|
//public DbSet<Task> Tasks { get; set; }
|
||||||
@@ -191,10 +187,6 @@ public class CompanyContext : DbContext
|
|||||||
public DbSet<PaymentTransaction> PaymentTransactions{ get; set; }
|
public DbSet<PaymentTransaction> PaymentTransactions{ get; set; }
|
||||||
|
|
||||||
public DbSet<ContractingPartyBankAccount> ContractingPartyBankAccounts { get; set; }
|
public DbSet<ContractingPartyBankAccount> ContractingPartyBankAccounts { get; set; }
|
||||||
|
|
||||||
public DbSet<PaymentInstrument> PaymentInstruments { get; set; }
|
|
||||||
public DbSet<PaymentInstrumentGroup> PaymentInstrumentGroups { get; set; }
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Pooya
|
#region Pooya
|
||||||
@@ -217,9 +209,7 @@ public class CompanyContext : DbContext
|
|||||||
public DbSet<WorkshopTemp> WorkshopTemps { get; set; }
|
public DbSet<WorkshopTemp> WorkshopTemps { get; set; }
|
||||||
public DbSet<WorkshopServicesTemp> WorkshopServicesTemps { get; set; }
|
public DbSet<WorkshopServicesTemp> WorkshopServicesTemps { get; set; }
|
||||||
public DbSet<InstitutionContractTemp> InstitutionContractTemps { get; set; }
|
public DbSet<InstitutionContractTemp> InstitutionContractTemps { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public DbSet<CustomizeCheckout> CustomizeCheckouts { get; set; }
|
public DbSet<CustomizeCheckout> CustomizeCheckouts { get; set; }
|
||||||
public DbSet<CustomizeCheckoutTemp> CustomizeCheckoutTemps { get; set; }
|
public DbSet<CustomizeCheckoutTemp> CustomizeCheckoutTemps { get; set; }
|
||||||
public DbSet<TaxLeftWorkItem> TaxLeftWorkItems { get; set; }
|
public DbSet<TaxLeftWorkItem> TaxLeftWorkItems { get; set; }
|
||||||
@@ -303,11 +293,13 @@ public class CompanyContext : DbContext
|
|||||||
|
|
||||||
public CompanyContext(DbContextOptions<CompanyContext> options) :base(options)
|
public CompanyContext(DbContextOptions<CompanyContext> options) :base(options)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public CompanyContext()
|
public CompanyContext()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -317,5 +309,6 @@ public class CompanyContext : DbContext
|
|||||||
modelBuilder.ApplyConfigurationsFromAssembly(assembly);
|
modelBuilder.ApplyConfigurationsFromAssembly(assembly);
|
||||||
modelBuilder.Entity<RollCall>().HasQueryFilter(x => x.RollCallModifyType != RollCallModifyType.Undefined);
|
modelBuilder.Entity<RollCall>().HasQueryFilter(x => x.RollCallModifyType != RollCallModifyType.Undefined);
|
||||||
base.OnModelCreating(modelBuilder);
|
base.OnModelCreating(modelBuilder);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -51,7 +51,6 @@ class CheckoutMapping : IEntityTypeConfiguration<Checkout>
|
|||||||
builder.Property(x => x.TotalDayOfYearsCompute).HasMaxLength(10);
|
builder.Property(x => x.TotalDayOfYearsCompute).HasMaxLength(10);
|
||||||
builder.Property(x => x.TotalDayOfBunosesCompute).HasMaxLength(10);
|
builder.Property(x => x.TotalDayOfBunosesCompute).HasMaxLength(10);
|
||||||
|
|
||||||
builder.Property(x => x.EmployeeMandatoryHours).HasTimeSpanConversion();
|
|
||||||
builder.HasOne(x => x.Workshop)
|
builder.HasOne(x => x.Workshop)
|
||||||
.WithMany(x => x.Checkouts)
|
.WithMany(x => x.Checkouts)
|
||||||
.HasForeignKey(x => x.WorkshopId);
|
.HasForeignKey(x => x.WorkshopId);
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
using Company.Domain.PaymentInstrumentAgg;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
||||||
using OfficeOpenXml.Drawing.Chart;
|
|
||||||
|
|
||||||
namespace CompanyManagment.EFCore.Mapping;
|
|
||||||
|
|
||||||
public class PaymentInstrumentGroupMapping:IEntityTypeConfiguration<PaymentInstrumentGroup>
|
|
||||||
{
|
|
||||||
public void Configure(EntityTypeBuilder<PaymentInstrumentGroup> builder)
|
|
||||||
{
|
|
||||||
builder.HasKey(x => x.id);
|
|
||||||
builder.Property(x => x.Name).IsRequired().HasMaxLength(120);
|
|
||||||
builder.HasMany(x => x.PaymentInstruments)
|
|
||||||
.WithOne(x=>x.PaymentInstrumentGroup)
|
|
||||||
.HasForeignKey(x=>x.PaymentInstrumentGroupId);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
using Company.Domain.PaymentInstrumentAgg;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
||||||
|
|
||||||
namespace CompanyManagment.EFCore.Mapping;
|
|
||||||
|
|
||||||
public class PaymentInstrumentMapping : IEntityTypeConfiguration<PaymentInstrument>
|
|
||||||
{
|
|
||||||
public void Configure(EntityTypeBuilder<PaymentInstrument> builder)
|
|
||||||
{
|
|
||||||
builder.HasKey(x => x.id);
|
|
||||||
|
|
||||||
builder.Property(x => x.AccountHolderName).HasMaxLength(50);
|
|
||||||
builder.Property(x => x.AccountNumber).HasMaxLength(25);
|
|
||||||
builder.Property(x => x.PosTerminalId).HasMaxLength(25);
|
|
||||||
builder.Property(x => x.Description).HasMaxLength(200);
|
|
||||||
builder.Property(x => x.Type).HasConversion<string>().HasMaxLength(50);
|
|
||||||
builder.Property(x => x.CardNumber).HasMaxLength(50);
|
|
||||||
builder.Property(x => x.IBan).HasMaxLength(50);
|
|
||||||
builder.HasOne(x => x.PaymentInstrumentGroup)
|
|
||||||
.WithMany(x => x.PaymentInstruments)
|
|
||||||
.HasForeignKey(x => x.PaymentInstrumentGroupId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,72 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace CompanyManagment.EFCore.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class createpaymentinstrumentsanditsgroups : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "PaymentInstrumentGroups",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<long>(type: "bigint", nullable: false)
|
|
||||||
.Annotation("SqlServer:Identity", "1, 1"),
|
|
||||||
Name = table.Column<string>(type: "nvarchar(120)", maxLength: 120, nullable: false),
|
|
||||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_PaymentInstrumentGroups", x => x.id);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "PaymentInstruments",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<long>(type: "bigint", nullable: false)
|
|
||||||
.Annotation("SqlServer:Identity", "1, 1"),
|
|
||||||
CardNumber = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
|
||||||
AccountHolderName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
|
||||||
AccountNumber = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: true),
|
|
||||||
IBan = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
|
||||||
PosTerminalId = table.Column<string>(type: "nvarchar(25)", maxLength: 25, nullable: true),
|
|
||||||
Description = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
|
||||||
Type = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
|
|
||||||
IsAuth = table.Column<bool>(type: "bit", nullable: false),
|
|
||||||
PaymentInstrumentGroupId = table.Column<long>(type: "bigint", nullable: false),
|
|
||||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_PaymentInstruments", x => x.id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_PaymentInstruments_PaymentInstrumentGroups_PaymentInstrumentGroupId",
|
|
||||||
column: x => x.PaymentInstrumentGroupId,
|
|
||||||
principalTable: "PaymentInstrumentGroups",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_PaymentInstruments_PaymentInstrumentGroupId",
|
|
||||||
table: "PaymentInstruments",
|
|
||||||
column: "PaymentInstrumentGroupId");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "PaymentInstruments");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "PaymentInstrumentGroups");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,29 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace CompanyManagment.EFCore.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddConflictAmounttochekcout : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<bool>(
|
|
||||||
name: "HasAmountConflict",
|
|
||||||
table: "Checkouts",
|
|
||||||
type: "bit",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "HasAmountConflict",
|
|
||||||
table: "Checkouts");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,29 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace CompanyManagment.EFCore.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class AddPaymentInstrumentGroupIsActive : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "IsActive",
|
|
||||||
table: "PaymentInstrumentGroups",
|
|
||||||
type: "int",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "IsActive",
|
|
||||||
table: "PaymentInstrumentGroups");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,40 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace CompanyManagment.EFCore.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class Addhasconflictamounttocheckout : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<bool>(
|
|
||||||
name: "HasAmountConflict",
|
|
||||||
table: "CustomizeCheckoutTemps",
|
|
||||||
type: "bit",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: false);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<bool>(
|
|
||||||
name: "HasAmountConflict",
|
|
||||||
table: "CustomizeCheckouts",
|
|
||||||
type: "bit",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "HasAmountConflict",
|
|
||||||
table: "CustomizeCheckoutTemps");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "HasAmountConflict",
|
|
||||||
table: "CustomizeCheckouts");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,30 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace CompanyManagment.EFCore.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class addemployeemandatorytocheckout : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<string>(
|
|
||||||
name: "EmployeeMandatoryHours",
|
|
||||||
table: "Checkouts",
|
|
||||||
type: "nvarchar(30)",
|
|
||||||
maxLength: 30,
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: "");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "EmployeeMandatoryHours",
|
|
||||||
table: "Checkouts");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -293,11 +293,6 @@ namespace CompanyManagment.EFCore.Migrations
|
|||||||
b.Property<long>("EmployeeId")
|
b.Property<long>("EmployeeId")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
b.Property<string>("EmployeeMandatoryHours")
|
|
||||||
.IsRequired()
|
|
||||||
.HasMaxLength(30)
|
|
||||||
.HasColumnType("nvarchar(30)");
|
|
||||||
|
|
||||||
b.Property<double>("FamilyAllowance")
|
b.Property<double>("FamilyAllowance")
|
||||||
.HasColumnType("float");
|
.HasColumnType("float");
|
||||||
|
|
||||||
@@ -312,9 +307,6 @@ namespace CompanyManagment.EFCore.Migrations
|
|||||||
.HasMaxLength(10)
|
.HasMaxLength(10)
|
||||||
.HasColumnType("nvarchar(10)");
|
.HasColumnType("nvarchar(10)");
|
||||||
|
|
||||||
b.Property<bool>("HasAmountConflict")
|
|
||||||
.HasColumnType("bit");
|
|
||||||
|
|
||||||
b.Property<bool>("HasRollCall")
|
b.Property<bool>("HasRollCall")
|
||||||
.HasColumnType("bit");
|
.HasColumnType("bit");
|
||||||
|
|
||||||
@@ -880,7 +872,7 @@ namespace CompanyManagment.EFCore.Migrations
|
|||||||
b.ToTable("ContractingPartyAccount", (string)null);
|
b.ToTable("ContractingPartyAccount", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Company.Domain.ContractingPartyBankAccountsAgg.ContractingPartyBankAccount", b =>
|
modelBuilder.Entity("Company.Domain.ContractingPartyBankAccountsAgg.ContractingPartyBankAccounts", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("id")
|
b.Property<long>("id")
|
||||||
.ValueGeneratedOnAdd()
|
.ValueGeneratedOnAdd()
|
||||||
@@ -1070,9 +1062,6 @@ namespace CompanyManagment.EFCore.Migrations
|
|||||||
b.Property<double>("FridayPay")
|
b.Property<double>("FridayPay")
|
||||||
.HasColumnType("float");
|
.HasColumnType("float");
|
||||||
|
|
||||||
b.Property<bool>("HasAmountConflict")
|
|
||||||
.HasColumnType("bit");
|
|
||||||
|
|
||||||
b.Property<double>("InstallmentDeduction")
|
b.Property<double>("InstallmentDeduction")
|
||||||
.HasColumnType("float");
|
.HasColumnType("float");
|
||||||
|
|
||||||
@@ -1222,9 +1211,6 @@ namespace CompanyManagment.EFCore.Migrations
|
|||||||
b.Property<double>("FridayPay")
|
b.Property<double>("FridayPay")
|
||||||
.HasColumnType("float");
|
.HasColumnType("float");
|
||||||
|
|
||||||
b.Property<bool>("HasAmountConflict")
|
|
||||||
.HasColumnType("bit");
|
|
||||||
|
|
||||||
b.Property<double>("InstallmentDeduction")
|
b.Property<double>("InstallmentDeduction")
|
||||||
.HasColumnType("float");
|
.HasColumnType("float");
|
||||||
|
|
||||||
@@ -4293,83 +4279,6 @@ namespace CompanyManagment.EFCore.Migrations
|
|||||||
b.ToTable("TextManager_OriginalTitle", (string)null);
|
b.ToTable("TextManager_OriginalTitle", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Company.Domain.PaymentInstrumentAgg.PaymentInstrument", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
|
||||||
|
|
||||||
b.Property<string>("AccountHolderName")
|
|
||||||
.HasMaxLength(50)
|
|
||||||
.HasColumnType("nvarchar(50)");
|
|
||||||
|
|
||||||
b.Property<string>("AccountNumber")
|
|
||||||
.HasMaxLength(25)
|
|
||||||
.HasColumnType("nvarchar(25)");
|
|
||||||
|
|
||||||
b.Property<string>("CardNumber")
|
|
||||||
.HasMaxLength(50)
|
|
||||||
.HasColumnType("nvarchar(50)");
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreationDate")
|
|
||||||
.HasColumnType("datetime2");
|
|
||||||
|
|
||||||
b.Property<string>("Description")
|
|
||||||
.HasMaxLength(200)
|
|
||||||
.HasColumnType("nvarchar(200)");
|
|
||||||
|
|
||||||
b.Property<string>("IBan")
|
|
||||||
.HasMaxLength(50)
|
|
||||||
.HasColumnType("nvarchar(50)");
|
|
||||||
|
|
||||||
b.Property<bool>("IsAuth")
|
|
||||||
.HasColumnType("bit");
|
|
||||||
|
|
||||||
b.Property<long>("PaymentInstrumentGroupId")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.Property<string>("PosTerminalId")
|
|
||||||
.HasMaxLength(25)
|
|
||||||
.HasColumnType("nvarchar(25)");
|
|
||||||
|
|
||||||
b.Property<string>("Type")
|
|
||||||
.IsRequired()
|
|
||||||
.HasMaxLength(50)
|
|
||||||
.HasColumnType("nvarchar(50)");
|
|
||||||
|
|
||||||
b.HasKey("id");
|
|
||||||
|
|
||||||
b.HasIndex("PaymentInstrumentGroupId");
|
|
||||||
|
|
||||||
b.ToTable("PaymentInstruments");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Company.Domain.PaymentInstrumentAgg.PaymentInstrumentGroup", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreationDate")
|
|
||||||
.HasColumnType("datetime2");
|
|
||||||
|
|
||||||
b.Property<int>("IsActive")
|
|
||||||
.HasColumnType("int");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasMaxLength(120)
|
|
||||||
.HasColumnType("nvarchar(120)");
|
|
||||||
|
|
||||||
b.HasKey("id");
|
|
||||||
|
|
||||||
b.ToTable("PaymentInstrumentGroups");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Company.Domain.PaymentToEmployeeAgg.PaymentToEmployee", b =>
|
modelBuilder.Entity("Company.Domain.PaymentToEmployeeAgg.PaymentToEmployee", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("id")
|
b.Property<long>("id")
|
||||||
@@ -6735,7 +6644,7 @@ namespace CompanyManagment.EFCore.Migrations
|
|||||||
b.Navigation("PersonalContractingParty");
|
b.Navigation("PersonalContractingParty");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Company.Domain.ContractingPartyBankAccountsAgg.ContractingPartyBankAccount", b =>
|
modelBuilder.Entity("Company.Domain.ContractingPartyBankAccountsAgg.ContractingPartyBankAccounts", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Company.Domain.ContarctingPartyAgg.PersonalContractingParty", "ContractingParty")
|
b.HasOne("Company.Domain.ContarctingPartyAgg.PersonalContractingParty", "ContractingParty")
|
||||||
.WithMany("ContractingPartyBankAccounts")
|
.WithMany("ContractingPartyBankAccounts")
|
||||||
@@ -9609,17 +9518,6 @@ namespace CompanyManagment.EFCore.Migrations
|
|||||||
b.Navigation("TextManager");
|
b.Navigation("TextManager");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Company.Domain.PaymentInstrumentAgg.PaymentInstrument", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("Company.Domain.PaymentInstrumentAgg.PaymentInstrumentGroup", "PaymentInstrumentGroup")
|
|
||||||
.WithMany("PaymentInstruments")
|
|
||||||
.HasForeignKey("PaymentInstrumentGroupId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("PaymentInstrumentGroup");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Company.Domain.PaymentToEmployeeItemAgg.PaymentToEmployeeItem", b =>
|
modelBuilder.Entity("Company.Domain.PaymentToEmployeeItemAgg.PaymentToEmployeeItem", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("Company.Domain.PaymentToEmployeeAgg.PaymentToEmployee", "PaymentToEmployee")
|
b.HasOne("Company.Domain.PaymentToEmployeeAgg.PaymentToEmployee", "PaymentToEmployee")
|
||||||
@@ -10085,11 +9983,6 @@ namespace CompanyManagment.EFCore.Migrations
|
|||||||
b.Navigation("Subtitles");
|
b.Navigation("Subtitles");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Company.Domain.PaymentInstrumentAgg.PaymentInstrumentGroup", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("PaymentInstruments");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Company.Domain.PaymentToEmployeeAgg.PaymentToEmployee", b =>
|
modelBuilder.Entity("Company.Domain.PaymentToEmployeeAgg.PaymentToEmployee", b =>
|
||||||
{
|
{
|
||||||
b.Navigation("PaymentToEmployeeItemList");
|
b.Navigation("PaymentToEmployeeItemList");
|
||||||
|
|||||||
@@ -244,67 +244,25 @@ public class AdminMonthlyOverviewRepository : RepositoryBase<long, AdminMonthlyO
|
|||||||
.Except([5976]).ToHashSet();
|
.Except([5976]).ToHashSet();
|
||||||
|
|
||||||
|
|
||||||
//var workingCheckoutEmployeeIds = GetWorkingCheckoutEmployeeIds(workshopIds, targetStartDate, targetEndDate, vipGroup);
|
var workingCheckoutEmployeeIds = GetWorkingCheckoutEmployeeIds(workshopIds, targetStartDate, targetEndDate, vipGroup);
|
||||||
var chcekoutLeftWorks = _companyContext.LeftWorkList
|
//var workingCheckoutEmployeeIds = _companyContext.LeftWorkList.AsNoTracking()
|
||||||
.AsNoTracking()
|
// .Join(
|
||||||
.Where(x =>
|
// _companyContext.Contracts.AsNoTracking(),
|
||||||
workshopIds.Contains(x.WorkshopId) &&
|
// leftWork => new { leftWork.EmployeeId, WorkshopId = leftWork.WorkshopId },
|
||||||
x.StartWorkDate <= targetEndDate &&
|
// contract => new { contract.EmployeeId, WorkshopId = contract.WorkshopIds },
|
||||||
x.LeftWorkDate.AddDays(-1) >= targetStartDate &&
|
// (leftWork, contract) => new { leftWork, contract }
|
||||||
!vipGroup.Contains(x.EmployeeId))
|
// )
|
||||||
.Select(x => new
|
// .Where(x =>
|
||||||
{
|
// workshopIds.Contains(x.leftWork.WorkshopId) &&
|
||||||
x.EmployeeId,
|
// x.leftWork.StartWorkDate <= targetEndDate &&
|
||||||
x.WorkshopId,
|
// x.leftWork.LeftWorkDate.AddDays(-1) >= targetStartDate &&
|
||||||
x.StartWorkDate,
|
// x.contract.ContarctStart <= targetEndDate &&
|
||||||
x.LeftWorkDate,
|
// x.contract.ContractEnd >= targetStartDate &&
|
||||||
x.Workshop.CreateCheckout
|
// !vipGroup.Contains(x.leftWork.EmployeeId) &&
|
||||||
})
|
// !_companyContext.EmployeeClientTemps
|
||||||
.ToList();
|
// .Any(temp => temp.EmployeeId == x.leftWork.EmployeeId && temp.WorkshopId == x.leftWork.WorkshopId)
|
||||||
|
// )
|
||||||
var checkoutContracts = _companyContext.Contracts
|
// .Select(x => new { x.leftWork.WorkshopId, x.leftWork.EmployeeId });
|
||||||
.AsNoTracking()
|
|
||||||
.Where(x =>
|
|
||||||
workshopIds.Contains(x.WorkshopIds) &&
|
|
||||||
x.ContarctStart <= targetEndDate &&
|
|
||||||
x.ContractEnd >= targetStartDate)
|
|
||||||
.Select(x => new
|
|
||||||
{
|
|
||||||
x.EmployeeId,
|
|
||||||
WorkshopId = x.WorkshopIds,
|
|
||||||
x.ContarctStart,
|
|
||||||
x.ContractEnd
|
|
||||||
})
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
var computeOptionsDict = _companyContext.EmployeeComputeOptionsSet
|
|
||||||
.AsNoTracking()
|
|
||||||
.Where(o => workshopIds.Contains(o.WorkshopId))
|
|
||||||
.ToDictionary(
|
|
||||||
o => (o.EmployeeId, o.WorkshopId),
|
|
||||||
o => o.CreateCheckout
|
|
||||||
);
|
|
||||||
|
|
||||||
var clientTemps = _companyContext.EmployeeClientTemps
|
|
||||||
.AsNoTracking().AsEnumerable()
|
|
||||||
.Select(x => (x.EmployeeId, x.WorkshopId))
|
|
||||||
.ToHashSet();
|
|
||||||
|
|
||||||
var workingCheckoutEmployeeIds = chcekoutLeftWorks
|
|
||||||
.Join(
|
|
||||||
checkoutContracts,
|
|
||||||
left => new { left.EmployeeId, left.WorkshopId },
|
|
||||||
contract => new { contract.EmployeeId, contract.WorkshopId },
|
|
||||||
(left, contract) => new { left, contract })
|
|
||||||
.Where(x =>
|
|
||||||
!clientTemps.Contains((x.left.EmployeeId, x.left.WorkshopId)) &&
|
|
||||||
(computeOptionsDict.TryGetValue((x.left.EmployeeId, x.left.WorkshopId), out var createCheckout)
|
|
||||||
? createCheckout
|
|
||||||
: x.left.CreateCheckout))
|
|
||||||
.Select(x => (
|
|
||||||
x.left.WorkshopId,
|
|
||||||
x.left.EmployeeId
|
|
||||||
)).ToList();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -354,38 +312,19 @@ public class AdminMonthlyOverviewRepository : RepositoryBase<long, AdminMonthlyO
|
|||||||
Data = x.ToList()
|
Data = x.ToList()
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
var validWorkshops = workingCheckoutGrouping.Select(x => x.Key)
|
var workshopsWithFullContracts = workingContractGrouping
|
||||||
.Union(workingContractGrouping.Select(x => x.WorkshopId)).ToList();
|
.Where(g => g.Data.All(emp => contractSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||||
|
.Select(g => g.WorkshopId)
|
||||||
var notValidWorkshops = workshopIds.Except(validWorkshops).ToList();
|
|
||||||
|
|
||||||
// var workshopsWithFullContracts = workingContractGrouping
|
|
||||||
// .Where(g => g.Data.All(emp => contractSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
|
||||||
// .Select(g => g.WorkshopId)
|
|
||||||
// .ToList();
|
|
||||||
|
|
||||||
var workshopsWithFullContracts = workshopIds
|
|
||||||
.Where(workshopId =>
|
|
||||||
{
|
|
||||||
var group = workingContractGrouping.FirstOrDefault(x => x.WorkshopId == workshopId);
|
|
||||||
return group == null || group.Data.All(emp => contractSet.Contains((emp.WorkshopId, emp.EmployeeId)));
|
|
||||||
})
|
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
var list = workingContractEmployeeIds.ToList().Where(x => !contractSet.Any(a => a.EmployeeId == x.EmployeeId && a.WorkshopIds == x.WorkshopId)).ToList();
|
var list = workingContractEmployeeIds.ToList().Where(x => !contractSet.Any(a => a.EmployeeId == x.EmployeeId && a.WorkshopIds == x.WorkshopId)).ToList();
|
||||||
|
|
||||||
// var workshopsWithFullCheckout = workingCheckoutGrouping
|
var workshopsWithFullCheckout = workingCheckoutGrouping
|
||||||
// .Where(g => g.All(emp => checkoutSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
.Where(g => g.All(emp => checkoutSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||||
// .Select(g => g.Key)
|
.Select(g => g.Key)
|
||||||
// .ToList();
|
|
||||||
var workshopsWithFullCheckout = workshopIds
|
|
||||||
.Where(workshopId =>
|
|
||||||
{
|
|
||||||
var group = workingCheckoutGrouping.FirstOrDefault(x => x.Key == workshopId);
|
|
||||||
return group == null || group.All(emp => checkoutSet.Contains((emp.WorkshopId, emp.EmployeeId)));
|
|
||||||
})
|
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
|
|
||||||
var fullyCoveredWorkshops = workshopsWithFullContracts.Intersect(workshopsWithFullCheckout).ToList();
|
var fullyCoveredWorkshops = workshopsWithFullContracts.Intersect(workshopsWithFullCheckout).ToList();
|
||||||
|
|
||||||
//var notFullyCoveredWorkshops = groupedCheckout
|
//var notFullyCoveredWorkshops = groupedCheckout
|
||||||
@@ -400,10 +339,6 @@ public class AdminMonthlyOverviewRepository : RepositoryBase<long, AdminMonthlyO
|
|||||||
var adminMonthlyOverviews = _companyContext.AdminMonthlyOverviews
|
var adminMonthlyOverviews = _companyContext.AdminMonthlyOverviews
|
||||||
.Where(x => x.Month == month && x.Year == year);
|
.Where(x => x.Month == month && x.Year == year);
|
||||||
|
|
||||||
var notValidMonthlyOverViews =
|
|
||||||
await adminMonthlyOverviews.Where(x => notValidWorkshops.Contains(x.WorkshopId)).ToListAsync();
|
|
||||||
|
|
||||||
|
|
||||||
var adminMonthlyOverviewsWithFullContracts = await adminMonthlyOverviews
|
var adminMonthlyOverviewsWithFullContracts = await adminMonthlyOverviews
|
||||||
.Where(x => fullyCoveredWorkshops.Contains(x.WorkshopId) && x.Status == AdminMonthlyOverviewStatus.CreateDocuments)
|
.Where(x => fullyCoveredWorkshops.Contains(x.WorkshopId) && x.Status == AdminMonthlyOverviewStatus.CreateDocuments)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
@@ -418,7 +353,6 @@ public class AdminMonthlyOverviewRepository : RepositoryBase<long, AdminMonthlyO
|
|||||||
foreach (var adminMonthlyOverview in adminMonthlyOverviewsWithNotFullContracts)
|
foreach (var adminMonthlyOverview in adminMonthlyOverviewsWithNotFullContracts)
|
||||||
adminMonthlyOverview.SetStatus(AdminMonthlyOverviewStatus.CreateDocuments);
|
adminMonthlyOverview.SetStatus(AdminMonthlyOverviewStatus.CreateDocuments);
|
||||||
|
|
||||||
_companyContext.RemoveRange(notValidMonthlyOverViews);
|
|
||||||
await _companyContext.SaveChangesAsync();
|
await _companyContext.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -523,7 +523,6 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
|||||||
entity.SetSalaryAid(command.SalaryAids, command.SalaryAidDeduction);
|
entity.SetSalaryAid(command.SalaryAids, command.SalaryAidDeduction);
|
||||||
entity.SetLoanInstallment(command.LoanInstallments, command.InstallmentDeduction);
|
entity.SetLoanInstallment(command.LoanInstallments, command.InstallmentDeduction);
|
||||||
entity.SetCheckoutRollCall(command.CheckoutRollCall);
|
entity.SetCheckoutRollCall(command.CheckoutRollCall);
|
||||||
entity.SetEmployeeMandatoryHours(command.EmployeeMandatoryHours);
|
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -882,66 +881,66 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
|||||||
|
|
||||||
public List<CheckoutViewModel> PrintAll(List<long> id)
|
public List<CheckoutViewModel> PrintAll(List<long> id)
|
||||||
{
|
{
|
||||||
var checkouts = _context.CheckoutSet.Where(x => id.Contains(x.id)).ToList();
|
|
||||||
var query = new List<CheckoutViewModel>();
|
var query = new List<CheckoutViewModel>();
|
||||||
foreach (var item in checkouts)
|
foreach (var item in id)
|
||||||
{
|
{
|
||||||
var ch = new CheckoutViewModel()
|
var ch = _context.CheckoutSet
|
||||||
|
.AsSplitQuery().Select(x => new CheckoutViewModel()
|
||||||
{
|
{
|
||||||
Id = item.id,
|
Id = x.id,
|
||||||
WorkshopId = item.WorkshopId,
|
WorkshopId = x.WorkshopId,
|
||||||
ContractId = item.ContractId,
|
ContractId = x.ContractId,
|
||||||
EmployeeId = item.EmployeeId,
|
EmployeeId = x.EmployeeId,
|
||||||
EmployeeFullName = item.EmployeeFullName,
|
EmployeeFullName = x.EmployeeFullName,
|
||||||
FathersName = item.FathersName,
|
FathersName = x.FathersName,
|
||||||
NationalCode = item.NationalCode,
|
NationalCode = x.NationalCode,
|
||||||
DateOfBirth = item.DateOfBirth,
|
DateOfBirth = x.DateOfBirth,
|
||||||
WorkshopName = item.WorkshopName,
|
WorkshopName = x.WorkshopName,
|
||||||
Month = item.Month,
|
Month = x.Month,
|
||||||
Year = item.Year,
|
Year = x.Year,
|
||||||
PersonnelCode = item.PersonnelCode,
|
PersonnelCode = x.PersonnelCode,
|
||||||
PersonnelCodeInt = Convert.ToInt32(item.PersonnelCode),
|
PersonnelCodeInt = Convert.ToInt32(x.PersonnelCode),
|
||||||
ContractNo = item.ContractNo,
|
ContractNo = x.ContractNo,
|
||||||
MonthlySalary = item.MonthlySalary.ToMoney(),
|
MonthlySalary = x.MonthlySalary.ToMoney(),
|
||||||
BaseYearsPay = item.BaseYearsPay.ToMoney(),
|
BaseYearsPay = x.BaseYearsPay.ToMoney(),
|
||||||
ConsumableItems = item.ConsumableItems.ToMoney(),
|
ConsumableItems = x.ConsumableItems.ToMoney(),
|
||||||
HousingAllowance = item.HousingAllowance.ToMoney(),
|
HousingAllowance = x.HousingAllowance.ToMoney(),
|
||||||
OvertimePay = item.OvertimePay.ToMoney(),
|
OvertimePay = x.OvertimePay.ToMoney(),
|
||||||
NightworkPay = item.NightworkPay.ToMoney(),
|
NightworkPay = x.NightworkPay.ToMoney(),
|
||||||
FridayPay = item.FridayPay.ToMoney(),
|
FridayPay = x.FridayPay.ToMoney(),
|
||||||
MissionPay = item.MissionPay.ToMoney(),
|
MissionPay = x.MissionPay.ToMoney(),
|
||||||
ShiftPay = item.ShiftPay.ToMoney(),
|
ShiftPay = x.ShiftPay.ToMoney(),
|
||||||
FamilyAllowance = item.FamilyAllowance.ToMoney(),
|
FamilyAllowance = x.FamilyAllowance.ToMoney(),
|
||||||
BonusesPay = item.BonusesPay.ToMoney(),
|
BonusesPay = x.BonusesPay.ToMoney(),
|
||||||
YearsPay = item.YearsPay.ToMoney(),
|
YearsPay = x.YearsPay.ToMoney(),
|
||||||
LeavePay = item.LeavePay.ToMoney(),
|
LeavePay = x.LeavePay.ToMoney(),
|
||||||
InsuranceDeduction = item.InsuranceDeduction.ToMoney(),
|
InsuranceDeduction = x.InsuranceDeduction.ToMoney(),
|
||||||
TaxDeducation = item.TaxDeducation.ToMoney(),
|
TaxDeducation = x.TaxDeducation.ToMoney(),
|
||||||
InstallmentDeduction = item.InstallmentDeduction.ToMoney(),
|
InstallmentDeduction = x.InstallmentDeduction.ToMoney(),
|
||||||
SalaryAidDeduction = item.SalaryAidDeduction.ToMoney(),
|
SalaryAidDeduction = x.SalaryAidDeduction.ToMoney(),
|
||||||
AbsenceDeduction = item.AbsenceDeduction.ToMoney(),
|
AbsenceDeduction = x.AbsenceDeduction.ToMoney(),
|
||||||
TotalClaims = item.TotalClaims,
|
TotalClaims = x.TotalClaims,
|
||||||
TotalDeductions = item.TotalDeductions,
|
TotalDeductions = x.TotalDeductions,
|
||||||
TotalPayment = item.TotalPayment.ToMoney(),
|
TotalPayment = x.TotalPayment.ToMoney(),
|
||||||
RewardPay = item.RewardPay.ToMoneyNullable(),
|
RewardPay = x.RewardPay.ToMoneyNullable(),
|
||||||
ContractStartGr = item.ContractStart,
|
ContractStartGr = x.ContractStart,
|
||||||
ContractEndGr = item.ContractEnd,
|
ContractEndGr = x.ContractEnd,
|
||||||
IsLeft = false,
|
IsLeft = false,
|
||||||
LeftWorkDate = "",
|
LeftWorkDate = "",
|
||||||
LastDayOfWork = "",
|
LastDayOfWork = "",
|
||||||
MarriedAllowance = item.MarriedAllowance.ToMoney(),
|
MarriedAllowance = x.MarriedAllowance.ToMoney(),
|
||||||
HasRollCall = item.HasRollCall,
|
HasRollCall = x.HasRollCall,
|
||||||
SumOfWorkingDays = "-",
|
SumOfWorkingDays = "-",
|
||||||
OverTimeWorkValue = item.OverTimeWorkValue,
|
OverTimeWorkValue = x.OverTimeWorkValue,
|
||||||
OverNightWorkValue = item.OverNightWorkValue,
|
OverNightWorkValue = x.OverNightWorkValue,
|
||||||
FridayWorkValue = item.FridayWorkValue,
|
FridayWorkValue = x.FridayWorkValue,
|
||||||
RotatingShiftValue = item.RotatingShiftValue,
|
RotatingShiftValue = x.RotatingShiftValue,
|
||||||
AbsenceValue = item.AbsenceValue,
|
AbsenceValue = x.AbsenceValue,
|
||||||
MaritalStatus = "",
|
MaritalStatus = "",
|
||||||
TotalDayOfLeaveCompute = "-",
|
TotalDayOfLeaveCompute = "-",
|
||||||
TotalDayOfYearsCompute = "-",
|
TotalDayOfYearsCompute = "-",
|
||||||
TotalDayOfBunosesCompute = "-",
|
TotalDayOfBunosesCompute = "-",
|
||||||
InstallmentViewModels = item.LoanInstallments.Select(i => new LoanInstallmentViewModel()
|
InstallmentViewModels = x.LoanInstallments.Select(i => new LoanInstallmentViewModel()
|
||||||
{
|
{
|
||||||
Amount = i.AmountForMonth,
|
Amount = i.AmountForMonth,
|
||||||
AmountDouble = i.AmountForMonth.MoneyToDouble(),
|
AmountDouble = i.AmountForMonth.MoneyToDouble(),
|
||||||
@@ -951,22 +950,22 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
|||||||
RemainingAmount = i.LoanRemaining,
|
RemainingAmount = i.LoanRemaining,
|
||||||
LoanAmount = i.LoanAmount
|
LoanAmount = i.LoanAmount
|
||||||
}).ToList(),
|
}).ToList(),
|
||||||
SalaryAidViewModels = item.SalaryAids.Select(s => new SalaryAidViewModel()
|
SalaryAidViewModels = x.SalaryAids.Select(s => new SalaryAidViewModel()
|
||||||
{
|
{
|
||||||
Amount = s.Amount,
|
Amount = s.Amount,
|
||||||
AmountDouble = s.Amount.MoneyToDouble(),
|
AmountDouble = s.Amount.MoneyToDouble(),
|
||||||
SalaryAidDateTimeFa = s.SalaryAidDateTimeFa,
|
SalaryAidDateTimeFa = s.SalaryAidDateTimeFa,
|
||||||
SalaryAidDateTimeGe = s.SalaryAidDateTime
|
SalaryAidDateTimeGe = s.SalaryAidDateTime
|
||||||
}).ToList(),
|
}).ToList(),
|
||||||
CheckoutRollCall = item.CheckoutRollCall != null ? new CheckoutRollCallViewModel()
|
CheckoutRollCall = x.CheckoutRollCall != null ? new CheckoutRollCallViewModel()
|
||||||
{
|
{
|
||||||
TotalPresentTimeSpan = item.CheckoutRollCall.TotalPresentTimeSpan,
|
TotalPresentTimeSpan = x.CheckoutRollCall.TotalPresentTimeSpan,
|
||||||
TotalBreakTimeSpan = item.CheckoutRollCall.TotalBreakTimeSpan,
|
TotalBreakTimeSpan = x.CheckoutRollCall.TotalBreakTimeSpan,
|
||||||
TotalWorkingTimeSpan = item.CheckoutRollCall.TotalWorkingTimeSpan,
|
TotalWorkingTimeSpan = x.CheckoutRollCall.TotalWorkingTimeSpan,
|
||||||
TotalPaidLeaveTmeSpan = item.CheckoutRollCall.TotalPaidLeaveTmeSpan,
|
TotalPaidLeaveTmeSpan = x.CheckoutRollCall.TotalPaidLeaveTmeSpan,
|
||||||
TotalMandatoryTimeSpan = item.CheckoutRollCall.TotalMandatoryTimeSpan,
|
TotalMandatoryTimeSpan = x.CheckoutRollCall.TotalMandatoryTimeSpan,
|
||||||
TotalSickLeaveTimeSpan = item.CheckoutRollCall.TotalSickLeaveTimeSpan,
|
TotalSickLeaveTimeSpan = x.CheckoutRollCall.TotalSickLeaveTimeSpan,
|
||||||
RollCallDaysCollection = item.CheckoutRollCall.RollCallDaysCollection.Select(d => new CheckoutRollCallDayViewModel()
|
RollCallDaysCollection = x.CheckoutRollCall.RollCallDaysCollection.Select(d => new CheckoutRollCallDayViewModel()
|
||||||
{
|
{
|
||||||
WorkingTimeSpan = d.WorkingTimeSpan,
|
WorkingTimeSpan = d.WorkingTimeSpan,
|
||||||
BreakTimeSpan = d.BreakTimeSpan,
|
BreakTimeSpan = d.BreakTimeSpan,
|
||||||
@@ -981,14 +980,11 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
|||||||
FirstStartDate = d.FirstStartDate,
|
FirstStartDate = d.FirstStartDate,
|
||||||
Id = d.Id,
|
Id = d.Id,
|
||||||
SecondEndDate = d.SecondEndDate,
|
SecondEndDate = d.SecondEndDate,
|
||||||
SecondStartDate = d.SecondStartDate,
|
SecondStartDate = d.SecondStartDate
|
||||||
}).ToList(),
|
}).ToList()
|
||||||
|
|
||||||
} : null,
|
} : null,
|
||||||
HasAmountConflict =item.HasAmountConflict,
|
}).SingleOrDefault(x => x.Id == item);
|
||||||
EmployeeMandatoryHoursTimeSpan = item.EmployeeMandatoryHours,
|
|
||||||
EmployeeMandatoryHoursStr = Tools.ToFarsiHoursAndMinutes(Convert.ToInt32(item.EmployeeMandatoryHours.TotalHours),item.EmployeeMandatoryHours.Minutes,"-")
|
|
||||||
};
|
|
||||||
var workshopName = _context.Workshops.FirstOrDefault(x => x.id == ch.WorkshopId);
|
var workshopName = _context.Workshops.FirstOrDefault(x => x.id == ch.WorkshopId);
|
||||||
ch.WorkshopName = workshopName.WorkshopName;
|
ch.WorkshopName = workshopName.WorkshopName;
|
||||||
ch.TotalPaymentHide = workshopName.TotalPaymentHide;
|
ch.TotalPaymentHide = workshopName.TotalPaymentHide;
|
||||||
@@ -1131,7 +1127,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
|||||||
ch.TotalBreakTimeStr = ch.CheckoutRollCall.TotalBreakTimeSpan.ToFarsiHoursAndMinutes("-");
|
ch.TotalBreakTimeStr = ch.CheckoutRollCall.TotalBreakTimeSpan.ToFarsiHoursAndMinutes("-");
|
||||||
ch.TotalPresentTimeStr = ch.CheckoutRollCall.TotalPresentTimeSpan.ToFarsiHoursAndMinutes("-");
|
ch.TotalPresentTimeStr = ch.CheckoutRollCall.TotalPresentTimeSpan.ToFarsiHoursAndMinutes("-");
|
||||||
ch.TotalMandatoryTimeStr = ch.CheckoutRollCall.TotalMandatoryTimeSpan.ToFarsiHoursAndMinutes("-");
|
ch.TotalMandatoryTimeStr = ch.CheckoutRollCall.TotalMandatoryTimeSpan.ToFarsiHoursAndMinutes("-");
|
||||||
ch.TotalPaidLeave = Tools.ToFarsiHoursAndMinutes(Convert.ToInt32(ch.CheckoutRollCall.TotalPaidLeaveTmeSpan.TotalHours), ch.CheckoutRollCall.TotalPaidLeaveTmeSpan.Minutes, "-");
|
|
||||||
ch.MonthlyRollCall = ch.CheckoutRollCall.RollCallDaysCollection
|
ch.MonthlyRollCall = ch.CheckoutRollCall.RollCallDaysCollection
|
||||||
.Select(x => new CheckoutDailyRollCallViewModel
|
.Select(x => new CheckoutDailyRollCallViewModel
|
||||||
{
|
{
|
||||||
@@ -1724,7 +1720,6 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
|||||||
SalaryAidDateTimeFa = s.SalaryAidDateTimeFa,
|
SalaryAidDateTimeFa = s.SalaryAidDateTimeFa,
|
||||||
SalaryAidDateTimeGe = s.SalaryAidDateTime
|
SalaryAidDateTimeGe = s.SalaryAidDateTime
|
||||||
}).ToList(),
|
}).ToList(),
|
||||||
HasAmountConflict = x.HasAmountConflict
|
|
||||||
|
|
||||||
}).Where(x => x.WorkshopId == searchModel.WorkshopId);
|
}).Where(x => x.WorkshopId == searchModel.WorkshopId);
|
||||||
if (searchModel.EmployeeId > 0)
|
if (searchModel.EmployeeId > 0)
|
||||||
@@ -2698,12 +2693,5 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
|||||||
}).AsEnumerable().Select(x => (x.EmployeeId, x.CheckoutStart, x.CheckoutEnd)).ToList();
|
}).AsEnumerable().Select(x => (x.EmployeeId, x.CheckoutStart, x.CheckoutEnd)).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<Checkout> GetByWorkshopIdEmployeeIdInDate(long workshopId, long employeeId, DateTime inDate)
|
|
||||||
{
|
|
||||||
return await _context.CheckoutSet.FirstOrDefaultAsync(x =>
|
|
||||||
x.WorkshopId == workshopId && x.EmployeeId == employeeId && x.ContractStart <= inDate &&
|
|
||||||
x.ContractEnd >= inDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user