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.Permissions = Tools.DeserializeFromBsonList<int>(claims.FirstOrDefault(x => x is { Type: "permissions" })?.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;
|
||||
}
|
||||
|
||||
@@ -77,7 +76,7 @@ public class AuthHelper : IAuthHelper
|
||||
|
||||
#region Vafa
|
||||
|
||||
public void UpdateWorkshopSlugClaim(string newWorkshopSlug, string newWorkshopName,long newWorkshopId)
|
||||
public void UpdateWorkshopSlugClaim(string newWorkshopSlug, string newWorkshopName)
|
||||
{
|
||||
var user = _contextAccessor.HttpContext.User;
|
||||
|
||||
@@ -86,7 +85,6 @@ public class AuthHelper : IAuthHelper
|
||||
var claimsIdentity = (ClaimsIdentity)user.Identity;
|
||||
var existingClaimSlug = claimsIdentity.FindFirst("WorkshopSlug");
|
||||
var existingClaimName = claimsIdentity.FindFirst("WorkshopName");
|
||||
var existingWorkshopId = claimsIdentity.FindFirst("WorkshopId");
|
||||
|
||||
if (existingClaimSlug != null)
|
||||
{
|
||||
@@ -98,14 +96,9 @@ public class AuthHelper : IAuthHelper
|
||||
claimsIdentity.RemoveClaim(existingClaimName);
|
||||
}
|
||||
|
||||
if (existingWorkshopId != null)
|
||||
{
|
||||
claimsIdentity.RemoveClaim(existingWorkshopId);
|
||||
}
|
||||
|
||||
claimsIdentity.AddClaim(new Claim("WorkshopSlug", newWorkshopSlug));
|
||||
claimsIdentity.AddClaim(new Claim("WorkshopName", newWorkshopName));
|
||||
claimsIdentity.AddClaim(new Claim("WorkshopId",newWorkshopId.ToString()));
|
||||
|
||||
|
||||
var authProperties = new AuthenticationProperties
|
||||
@@ -135,16 +128,8 @@ public class AuthHelper : IAuthHelper
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
public long GetWorkshopId()
|
||||
{
|
||||
return long.Parse(_contextAccessor.HttpContext?.User.Claims.FirstOrDefault(x => x.Type == "WorkshopId")?.Value ?? "0");
|
||||
|
||||
|
||||
}
|
||||
|
||||
public string CurrentAccountRole()
|
||||
{
|
||||
@@ -197,7 +182,6 @@ public class AuthHelper : IAuthHelper
|
||||
//mahanChanges
|
||||
new("workshopList",workshopBson),
|
||||
new("WorkshopSlug",slug),
|
||||
new("WorkshopId", account.WorkshopId.ToString()),
|
||||
new("WorkshopName",account.WorkshopName??"")
|
||||
|
||||
};
|
||||
|
||||
@@ -20,7 +20,6 @@ public class AuthViewModel
|
||||
|
||||
public int? PositionValue { get; set; }
|
||||
public string WorkshopSlug { get; set; }
|
||||
public long WorkshopId { get; set; }
|
||||
public string WorkshopName { get; set; }
|
||||
public List<WorkshopClaim> WorkshopList { get; set; }
|
||||
|
||||
|
||||
@@ -17,12 +17,11 @@ public interface IAuthHelper
|
||||
|
||||
#region Vafa
|
||||
|
||||
void UpdateWorkshopSlugClaim(string workshopSlug, string workshopName, long workshopId);
|
||||
void UpdateWorkshopSlugClaim(string workshopSlug, string workshopName);
|
||||
|
||||
#endregion
|
||||
long CurrentSubAccountId();
|
||||
string GetWorkshopSlug();
|
||||
string GetWorkshopName();
|
||||
long GetWorkshopId();
|
||||
(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();
|
||||
|
||||
if (appSetting.Value.Domain == ".dadmehrg.ir")
|
||||
if (appSetting.Value.Domain == ".dad-mehr.ir")
|
||||
{
|
||||
_pin = "7349F84E81AB584862D9";
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ public interface ISmsService
|
||||
#region Mahan
|
||||
|
||||
Task<double> GetCreditAmount();
|
||||
SmsResult TaskReminderSms(string number, string taskCount);
|
||||
|
||||
#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
|
||||
}
|
||||
|
||||
@@ -30,9 +30,8 @@ public static class StaticWorkshopAccounts
|
||||
/// 380 - افروز نظری
|
||||
/// 381 - مهدی قربانی
|
||||
/// 392 - عمار حسن دوست
|
||||
/// 20 - سمیرا الهی نیا
|
||||
/// </summary>
|
||||
public static List<long> StaticAccountIds = [2, 3, 380, 381, 392, 20];
|
||||
public static List<long> StaticAccountIds = [2, 3, 380, 381, 392];
|
||||
|
||||
/// <summary>
|
||||
/// این تاریخ در جدول اکانت لفت ورک به این معنیست
|
||||
|
||||
@@ -38,7 +38,7 @@ public class UidBasicInformation
|
||||
{
|
||||
"GENDER_MALE" => Application.Gender.Male,
|
||||
"GENDER_FEMALE" => Application.Gender.Female,
|
||||
_ => Application.Gender.None
|
||||
_ => throw new ArgumentOutOfRangeException()
|
||||
};
|
||||
}
|
||||
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 List<WeeklyOffDay> WeeklyOffDays { get; set; } = [];
|
||||
public List<WeeklyOffDay> WeeklyOffDays { get; set; }
|
||||
|
||||
public void FridayWorkToWeeklyDayOfWeek()
|
||||
{
|
||||
|
||||
@@ -4,7 +4,6 @@ using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
|
||||
namespace _0_Framework.Domain;
|
||||
|
||||
@@ -18,6 +17,4 @@ public interface IRepository<TKey, T> where T:class
|
||||
bool Exists(Expression<Func<T, bool>> expression);
|
||||
void SaveChanges();
|
||||
Task SaveChangesAsync();
|
||||
Task<IDbContextTransaction> BeginTransactionAsync();
|
||||
|
||||
}
|
||||
@@ -6,7 +6,6 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Domain;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Storage;
|
||||
|
||||
namespace _0_Framework.InfraStructure
|
||||
{
|
||||
@@ -71,10 +70,5 @@ namespace _0_Framework.InfraStructure
|
||||
{
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
public async Task<IDbContextTransaction> BeginTransactionAsync()
|
||||
{
|
||||
return await _context.Database.BeginTransactionAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,8 +259,7 @@ public class AccountApplication : IAccountApplication
|
||||
var workshop = workshopList.First();
|
||||
authViewModel.WorkshopName = workshop.Name;
|
||||
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.Id);
|
||||
authViewModel.WorkshopId = workshop.Id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_authHelper.Signin(authViewModel);
|
||||
@@ -318,7 +317,6 @@ public class AccountApplication : IAccountApplication
|
||||
var workshop = workshopList.First();
|
||||
authViewModel.WorkshopName = workshop.WorkshopName;
|
||||
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.WorkshopId);
|
||||
authViewModel.WorkshopId = workshop.WorkshopId;
|
||||
}
|
||||
_authHelper.Signin(authViewModel);
|
||||
idAutoriz = 2;
|
||||
@@ -370,7 +368,6 @@ public class AccountApplication : IAccountApplication
|
||||
var workshop = workshopList.First();
|
||||
authViewModel.WorkshopName = workshop.Name;
|
||||
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.Id);
|
||||
authViewModel.WorkshopId = workshop.Id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -518,7 +515,6 @@ public class AccountApplication : IAccountApplication
|
||||
var workshop = authViewModel.WorkshopList.First();
|
||||
authViewModel.WorkshopSlug = _passwordHasher.SlugHasher(workshop.Id);
|
||||
authViewModel.WorkshopName = workshop.Name;
|
||||
authViewModel.WorkshopId = workshop.Id;
|
||||
}
|
||||
_authHelper.Signin(authViewModel);
|
||||
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 totalDayOfLeaveCompute, string totalDayOfYearsCompute, string totalDayOfBunosesCompute,
|
||||
ICollection<CheckoutLoanInstallment> loanInstallments,
|
||||
ICollection<CheckoutSalaryAid> salaryAids,CheckoutRollCall checkoutRollCall,TimeSpan employeeMandatoryHours)
|
||||
ICollection<CheckoutSalaryAid> salaryAids,CheckoutRollCall checkoutRollCall)
|
||||
{
|
||||
EmployeeFullName = employeeFullName;
|
||||
FathersName = fathersName;
|
||||
@@ -90,10 +90,8 @@ public class Checkout : EntityBase
|
||||
LoanInstallments = loanInstallments;
|
||||
SalaryAids = salaryAids;
|
||||
CheckoutRollCall = checkoutRollCall;
|
||||
EmployeeMandatoryHours = employeeMandatoryHours;
|
||||
}
|
||||
|
||||
|
||||
public string EmployeeFullName { get; private set; }
|
||||
public string IsActiveString { get; private set; }
|
||||
public string Signature { get; private set; }
|
||||
@@ -195,16 +193,7 @@ public class Checkout : EntityBase
|
||||
/// </summary>
|
||||
public string TotalDayOfBunosesCompute { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// دارای تداخل مبلغ است. این در زمانی اتفاق می افتد که فیش مبلغ آن تغییر کرده ولی به دلیل مسائل قانونی امکان صدور دوباره آن وجود ندارد
|
||||
/// </summary>
|
||||
public bool HasAmountConflict { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// ساعت موظفی پرسنل در ماه
|
||||
/// </summary>
|
||||
public TimeSpan EmployeeMandatoryHours { get; set; }
|
||||
|
||||
#region valueObjects
|
||||
|
||||
public ICollection<CheckoutLoanInstallment> LoanInstallments { get; set; } = [];
|
||||
@@ -327,16 +316,6 @@ public class Checkout : EntityBase
|
||||
{
|
||||
CheckoutRollCall = checkoutRollCall;
|
||||
}
|
||||
|
||||
public void SetAmountConflict(bool hasAmountConflict)
|
||||
{
|
||||
HasAmountConflict = hasAmountConflict;
|
||||
}
|
||||
|
||||
public void SetEmployeeMandatoryHours(TimeSpan employeeMandatoryHours)
|
||||
{
|
||||
EmployeeMandatoryHours = employeeMandatoryHours;
|
||||
}
|
||||
}
|
||||
|
||||
public class CheckoutRollCall
|
||||
|
||||
@@ -78,6 +78,4 @@ public interface ICheckoutRepository : IRepository<long, Checkout>
|
||||
long workshopId, DateTime start, DateTime end);
|
||||
|
||||
#endregion
|
||||
|
||||
Task<Checkout> GetByWorkshopIdEmployeeIdInDate(long workshopId, long employeeId, DateTime inDate);
|
||||
}
|
||||
@@ -10,7 +10,6 @@ namespace Company.Domain.ClassifiedSalaryAgg
|
||||
{
|
||||
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)
|
||||
{
|
||||
Group1 = group1;
|
||||
|
||||
@@ -8,12 +8,10 @@ namespace Company.Domain.ContractingPartyBankAccountsAgg;
|
||||
|
||||
public interface IContractingPartyBankAccountsRepository:IRepository<long,ContractingPartyBankAccount>
|
||||
{
|
||||
Task<GetContractingPartyBankAccountViewModel> GetList(ContractingPartyBankAccountSearchModel searchModel);
|
||||
Task<List<string>> ContractingPartyOrAccountHolderNameSelectList(string search, string selected);
|
||||
Task<List<string>> IBanSelectList(string search, string selected);
|
||||
Task<OperationResult<List<GetContractingPartyBankAccountViewModel>>> GetList(ContractingPartyBankAccountSearchModel searchModel);
|
||||
Task<OperationResult<List<string>>> ContractingPartyOrAccountHolderNameSelectList(string search, string selected);
|
||||
Task<OperationResult<List<string>>> IBanSelectList(string search, string selected);
|
||||
|
||||
Task<List<string>> CardNumberSelectList(string search, string selected);
|
||||
Task<List<string>> AccountNumberSelectList(string search, string selected);
|
||||
Task<List<string>> GetAccountHolderNameSelectList(string search, string selected);
|
||||
Task<List<string>> ContractingPartyNamesSelectList(string search, string selected);
|
||||
Task<OperationResult<List<string>>> CardNumberSelectList(string search, string selected);
|
||||
Task<OperationResult<List<string>>> AccountNumberSelectList(string search, string selected);
|
||||
}
|
||||
@@ -374,13 +374,6 @@ public class CustomizeCheckout : EntityBase
|
||||
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;
|
||||
}
|
||||
|
||||
/// <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>
|
||||
{
|
||||
|
||||
[Obsolete("این متد منسوخ شده است. لطفاً از متد GetDetailsByContractingParty استفاده کنید.")]
|
||||
FinancialStatmentViewModel GetDetailsByContractingPartyId(long contractingPartyId);
|
||||
List<FinancialStatmentViewModel> Search(FinancialStatmentSearchModel searchModel);
|
||||
Task<ClientFinancialStatementViewModel> GetClientFinancialStatement(long accountId,
|
||||
FinancialStatementSearchModel searchModel);
|
||||
ClientFinancialStatementSearchModel searchModel);
|
||||
|
||||
Task<OperationResult<ClientFinancialStatementViewModel>> GetDetailsByPublicId(string publicId);
|
||||
Task<GetFinancialStatementBalanceAmount> GetBalanceAmount(long id);
|
||||
Task<double> GetClientDebtAmount(long accountId);
|
||||
Task<FinancialStatmentDetailsByContractingPartyViewModel> GetDetailsByContractingParty(long contractingPartyId,FinancialStatementSearchModel searchModel);
|
||||
}
|
||||
@@ -2,7 +2,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.InstitutionContract;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
@@ -44,7 +43,4 @@ public interface IInstitutionContractRepository : IRepository<long, InstitutionC
|
||||
/// <param name="endOfMonth"></param>
|
||||
/// <param name="description"></param>
|
||||
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>
|
||||
{
|
||||
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>
|
||||
/// محاسبه ساعات کارکرد پرسنل در صورت داشتن حضور غیاب
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.Reward;
|
||||
using CompanyManagment.App.Contracts.SalaryAid;
|
||||
@@ -22,5 +21,4 @@ public interface ISalaryAidRepository:IRepository<long,SalaryAid>
|
||||
|
||||
SalaryAidsGroupedViewModel GetSearchListAsGrouped(SalaryAidSearchViewModel searchModel);
|
||||
#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 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);
|
||||
|
||||
/// <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);
|
||||
Task<DayliFeeViewModel> DayliFeeComputingAsync(DateTime startDateW, DateTime contractStart, DateTime endDateW, long employeeId, long workshopId, List<LeftWorkViewModel> leftWorkList);
|
||||
string ConsumableItems(DateTime endDateW);
|
||||
|
||||
@@ -141,9 +141,7 @@ public class CheckoutViewModel
|
||||
public List<LoanInstallmentViewModel> InstallmentViewModels { get; set; }
|
||||
public List<SalaryAidViewModel> SalaryAidViewModels { 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
|
||||
|
||||
@@ -135,11 +135,6 @@ public class CreateCheckout
|
||||
/// </summary>
|
||||
public string TotalDayOfBunosesCompute { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ساعت موظفی پرسنل برای این ماه
|
||||
/// </summary>
|
||||
public TimeSpan EmployeeMandatoryHours { get; set; }
|
||||
|
||||
public bool HolidayWorking { get; set; }
|
||||
|
||||
public string ShiftWork { get; set; }
|
||||
|
||||
@@ -56,14 +56,5 @@ public class ComputingViewModel
|
||||
public TimeSpan TotalPaidLeave { 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;
|
||||
}
|
||||
@@ -6,16 +6,6 @@ namespace CompanyManagment.App.Contracts.ContractingPartyBankAccounts;
|
||||
/// لیست اطلاعات بانکی طرف حساب
|
||||
/// </summary>
|
||||
public class GetContractingPartyBankAccountViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// تعداد
|
||||
/// </summary>
|
||||
public int Count { get; set; }
|
||||
public List<ContractingPartyBankAccountsGroupedViewModel> List { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class ContractingPartyBankAccountsGroupedViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// لیست حساب های بانکی
|
||||
@@ -37,7 +27,6 @@ public class ContractingPartyBankAccountsGroupedViewModel
|
||||
/// </summary>
|
||||
public string WorkshopName { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// حساب بانکی طرف حساب
|
||||
/// </summary>
|
||||
|
||||
@@ -18,14 +18,14 @@ public interface IContractingPartyBankAccountsApplication
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> Create(CreateContractingPartyBankAccounts command);
|
||||
Task<OperationResult> Create(List<CreateContractingPartyBankAccounts> commands);
|
||||
|
||||
/// <summary>
|
||||
/// لیست اطلاعات طرف حساب بانکی
|
||||
/// </summary>
|
||||
/// <param name="searchModel"></param>
|
||||
/// <returns></returns>
|
||||
Task<GetContractingPartyBankAccountViewModel> GetList(ContractingPartyBankAccountSearchModel searchModel);
|
||||
Task<OperationResult<List<GetContractingPartyBankAccountViewModel>>> GetList(
|
||||
ContractingPartyBankAccountSearchModel searchModel);
|
||||
|
||||
/// <summary>
|
||||
/// سلکت لیست جستجو برای نام طرف حساب / صاحب حساب
|
||||
@@ -33,7 +33,7 @@ public interface IContractingPartyBankAccountsApplication
|
||||
/// <param name="search">نام جستجو</param>
|
||||
/// <param name="selected">نام سلکت شده</param>
|
||||
/// <returns></returns>
|
||||
Task<List<string>> ContractingPartyOrAccountHolderNameSelectList(string search, string selected);
|
||||
Task<OperationResult<List<string>>> ContractingPartyOrAccountHolderNameSelectList(string search, string selected);
|
||||
|
||||
/// <summary>
|
||||
/// سلکت لیست شماره کارت
|
||||
@@ -41,7 +41,7 @@ public interface IContractingPartyBankAccountsApplication
|
||||
/// <param name="search">نام جستجو</param>
|
||||
/// <param name="selected">نام سلکت شده</param>
|
||||
/// <returns></returns>
|
||||
Task<List<string>> CardNumberSelectList(string search, string selected);
|
||||
Task<OperationResult<List<string>>> CardNumberSelectList(string search, string selected);
|
||||
|
||||
/// <summary>
|
||||
/// سلکت لیست شماره شبا
|
||||
@@ -49,7 +49,7 @@ public interface IContractingPartyBankAccountsApplication
|
||||
/// <param name="search">نام جستجو</param>
|
||||
/// <param name="selected">نام سلکت شده</param>
|
||||
/// <returns></returns>
|
||||
Task<List<string>> IBanSelectList(string search, string selected);
|
||||
Task<OperationResult<List<string>>> IBanSelectList(string search, string selected);
|
||||
|
||||
/// <summary>
|
||||
/// سلکت لیست شماره حساب
|
||||
@@ -57,22 +57,6 @@ public interface IContractingPartyBankAccountsApplication
|
||||
/// <param name="search">نام جستجو</param>
|
||||
/// <param name="selected">نام سلکت شده</param>
|
||||
/// <returns></returns>
|
||||
Task<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);
|
||||
Task<OperationResult<List<string>>> AccountNumberSelectList(string search, string selected);
|
||||
}
|
||||
|
||||
|
||||
@@ -109,8 +109,6 @@ namespace CompanyManagment.App.Contracts.CustomizeCheckout
|
||||
public List<CustomizeRotatingShift> CustomizeRotatingShifts { get; set; }
|
||||
public List<CustomizeSifts> RegularShift { get; set; }
|
||||
|
||||
public bool HasAmountConflict { get; set; }
|
||||
|
||||
//public bool HasLeft { get; set; }
|
||||
//public string IsBlockCantracingParty { get; set; }
|
||||
//public string IsActiveString { get; set; }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace CompanyManagment.App.Contracts.FinancialStatment;
|
||||
|
||||
public class FinancialStatementSearchModel
|
||||
public class ClientFinancialStatementSearchModel
|
||||
{
|
||||
/// <summary>
|
||||
/// از تاریخ
|
||||
@@ -30,5 +30,5 @@ public class ClientFinancialStatementViewModel
|
||||
/// <summary>
|
||||
/// تراکنش ها
|
||||
/// </summary>
|
||||
public List<FinancialTransactionDetailViewModel> Transactions { get; set; }
|
||||
public List<ClientFinancialTransactionViewModel> Transactions { get; set; }
|
||||
}
|
||||
@@ -2,9 +2,8 @@
|
||||
|
||||
namespace CompanyManagment.App.Contracts.FinancialStatment;
|
||||
|
||||
public class FinancialTransactionDetailViewModel
|
||||
public class ClientFinancialTransactionViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// زمان و تاریخ میلادی
|
||||
/// </summary>
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.FinancilTransaction;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Collections.Generic;
|
||||
@@ -20,7 +19,6 @@ public interface IFinancialStatmentApplication
|
||||
OperationResult Create(CreateFinancialStatment command);
|
||||
|
||||
List<FinancialStatmentViewModel> Search(FinancialStatmentSearchModel searchModel);
|
||||
[Obsolete("این متد منسوخ شده است. لطفاً از متد GetDetailsByContractingParty استفاده کنید.")]
|
||||
FinancialStatmentViewModel GetDetailsByContractingPartyId(long contractingPartyId);
|
||||
|
||||
/// <summary>
|
||||
@@ -29,10 +27,9 @@ public interface IFinancialStatmentApplication
|
||||
/// <param name="searchModel"></param>
|
||||
/// <param name="accountId"></param>
|
||||
/// <returns>مدل صورت حساب مالی کلاینت</returns>
|
||||
Task<ClientFinancialStatementViewModel> GetClientFinancialStatement(FinancialStatementSearchModel searchModel,
|
||||
Task<ClientFinancialStatementViewModel> GetClientFinancialStatement(ClientFinancialStatementSearchModel searchModel,
|
||||
long accountId);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// نمایش اطلاعات صورت حساب مالی کلاینت بر اساس کد هش
|
||||
/// </summary>
|
||||
@@ -53,46 +50,6 @@ public interface IFinancialStatmentApplication
|
||||
/// <param name="accountId"></param>
|
||||
/// <returns></returns>
|
||||
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
|
||||
|
||||
@@ -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,19 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
||||
|
||||
public interface IInstitutionContractApplication
|
||||
{
|
||||
OperationResult Create(CreateInstitutionContract command);
|
||||
OperationResult Extension(CreateInstitutionContract command);
|
||||
OperationResult Extension(CreateInstitutionContract command);
|
||||
OperationResult Edit(EditInstitutionContract command);
|
||||
EditInstitutionContract GetDetails(long id);
|
||||
|
||||
@@ -27,107 +23,19 @@ public interface IInstitutionContractApplication
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
List<InstitutionContractViewModel> GetInstitutionContractToSetServicesExcelImport();
|
||||
|
||||
List<InstitutionContractViewModel> PrintAll(List<long> id);
|
||||
InstitutionContractViewModel PrintOne(long id);
|
||||
|
||||
OperationResult Active(long id);
|
||||
|
||||
|
||||
OperationResult DeActive(long id);
|
||||
|
||||
|
||||
OperationResult DeActiveBlue(long id);
|
||||
|
||||
|
||||
OperationResult DeActiveAllConnections(long id);
|
||||
|
||||
|
||||
OperationResult ReActiveAllConnections(long id);
|
||||
|
||||
void ReActiveAllAfterCreateNew(long contractingPartyId);
|
||||
|
||||
|
||||
void RemoveContract(long id);
|
||||
|
||||
|
||||
OperationResult Sign(long id);
|
||||
|
||||
|
||||
OperationResult UnSign(long id);
|
||||
void CreateContractingPartyAccount(long contractingPartyid, long accountId);
|
||||
|
||||
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>
|
||||
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
|
||||
{
|
||||
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>
|
||||
/// گزارش نوبت کاری حضور غیاب
|
||||
|
||||
@@ -22,5 +22,5 @@ public interface ISalaryAidApplication
|
||||
SalaryAidsGroupedViewModel GetSearchListAsGrouped(SalaryAidSearchViewModel searchModel);
|
||||
#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,8 +184,7 @@ public class CheckoutApplication : ICheckoutApplication
|
||||
{
|
||||
command.AbsenceDeduction = command.AbsenceDeduction - command.OvertimePay;
|
||||
command.OvertimePay = 0;
|
||||
command.OverTimeWorkValue = "00:00";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
command.OvertimePay = command.OvertimePay - command.AbsenceDeduction;
|
||||
@@ -346,7 +345,8 @@ public class CheckoutApplication : ICheckoutApplication
|
||||
{
|
||||
command.Signature = "0";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
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,
|
||||
@@ -354,7 +354,7 @@ public class CheckoutApplication : ICheckoutApplication
|
||||
, 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.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.SaveChanges();
|
||||
@@ -497,7 +497,6 @@ public class CheckoutApplication : ICheckoutApplication
|
||||
x.TotalPresentTimeStr =
|
||||
Tools.ToFarsiHoursAndMinutes((int)totalPresent.TotalHours, totalPresent.Minutes, "-");
|
||||
x.TotalMandatoryTimeStr = Tools.ToFarsiHoursAndMinutes(mandatoryWholeHours, mandatoryMinutes, "-");
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -8,13 +8,12 @@ using CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
public class ContractingPartyBankAccountsApplication : IContractingPartyBankAccountsApplication
|
||||
public class ContractingPartyBankAccountsApplication:IContractingPartyBankAccountsApplication
|
||||
{
|
||||
private readonly IContractingPartyBankAccountsRepository _contractingPartyBankAccountsRepository;
|
||||
private readonly IPersonalContractingPartyRepository _personalContractingPartyRepository;
|
||||
|
||||
public ContractingPartyBankAccountsApplication(
|
||||
IContractingPartyBankAccountsRepository contractingPartyBankAccountsRepository,
|
||||
public ContractingPartyBankAccountsApplication(IContractingPartyBankAccountsRepository contractingPartyBankAccountsRepository,
|
||||
IPersonalContractingPartyRepository personalContractingPartyRepository)
|
||||
{
|
||||
_contractingPartyBankAccountsRepository = contractingPartyBankAccountsRepository;
|
||||
@@ -24,13 +23,13 @@ public class ContractingPartyBankAccountsApplication : IContractingPartyBankAcco
|
||||
public async Task<OperationResult> Create(CreateContractingPartyBankAccounts command)
|
||||
{
|
||||
var operationResult = new OperationResult();
|
||||
|
||||
|
||||
if (!_personalContractingPartyRepository.Exists(x => x.id == command.ContractingPartyId))
|
||||
return operationResult.Failed("طرف حساب مورد نظر یافت نشد");
|
||||
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.CardNumber))
|
||||
return operationResult.Failed("شماره کارت خود را وارد کنید");
|
||||
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.AccountNumber))
|
||||
return operationResult.Failed("شماره حساب خود را وارد کنید");
|
||||
|
||||
@@ -39,95 +38,42 @@ public class ContractingPartyBankAccountsApplication : IContractingPartyBankAcco
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.AccountHolderName))
|
||||
return operationResult.Failed("نام صاحب حساب را وارد کنید");
|
||||
|
||||
|
||||
var entity = new ContractingPartyBankAccount(command.ContractingPartyId, command.CardNumber,
|
||||
command.AccountHolderName, command.AccountNumber, command.IBan, command.IsAuth);
|
||||
|
||||
command.AccountHolderName,command.AccountNumber, command.IBan,command.IsAuth);
|
||||
|
||||
await _contractingPartyBankAccountsRepository.CreateAsync(entity);
|
||||
|
||||
|
||||
await _contractingPartyBankAccountsRepository.SaveChangesAsync();
|
||||
|
||||
|
||||
return operationResult.Succcedded();
|
||||
|
||||
}
|
||||
|
||||
public async Task<OperationResult> Create(List<CreateContractingPartyBankAccounts> commands)
|
||||
{
|
||||
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(
|
||||
public async Task<OperationResult<List<GetContractingPartyBankAccountViewModel>>> GetList(
|
||||
ContractingPartyBankAccountSearchModel 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)
|
||||
{
|
||||
return await _contractingPartyBankAccountsRepository.ContractingPartyOrAccountHolderNameSelectList(search,
|
||||
selected);
|
||||
return await _contractingPartyBankAccountsRepository.ContractingPartyOrAccountHolderNameSelectList(search, 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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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))
|
||||
return op.Failed("حجم فایل نمی تواند بیشتر از 50 مگابایت باشد");
|
||||
|
||||
if (!allowedExtensions.Contains(fileExtension.ToLower()))
|
||||
if (!allowedExtensions.Contains(fileExtension))
|
||||
{
|
||||
var operationMessage = ":فرمت فایل باید یکی از موارد زیر باشد";
|
||||
operationMessage += "\n";
|
||||
|
||||
@@ -176,7 +176,7 @@ public class FinancialStatmentApplication : IFinancialStatmentApplication
|
||||
}
|
||||
|
||||
public async Task<ClientFinancialStatementViewModel> GetClientFinancialStatement(
|
||||
FinancialStatementSearchModel searchModel, long accountId)
|
||||
ClientFinancialStatementSearchModel searchModel, long accountId)
|
||||
{
|
||||
return await _financialStatmentRepository.GetClientFinancialStatement(accountId, searchModel);
|
||||
}
|
||||
@@ -196,10 +196,4 @@ public class FinancialStatmentApplication : IFinancialStatmentApplication
|
||||
{
|
||||
return _financialStatmentRepository.GetClientDebtAmount(accountId);
|
||||
}
|
||||
|
||||
public async Task<FinancialStatmentDetailsByContractingPartyViewModel> GetDetailsByContractingParty(
|
||||
long contractingPartyId, FinancialStatementSearchModel searchModel)
|
||||
{
|
||||
return await _financialStatmentRepository.GetDetailsByContractingParty(contractingPartyId,searchModel);
|
||||
}
|
||||
}
|
||||
@@ -30,13 +30,9 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
private readonly IWorkshopRepository _workshopRepository;
|
||||
private readonly ILeftWorkRepository _leftWorkRepository;
|
||||
private readonly IWorkshopApplication _workshopApplication;
|
||||
|
||||
|
||||
|
||||
public InstitutionContractApplication(IInstitutionContractRepository institutionContractRepository,
|
||||
IPersonalContractingPartyRepository contractingPartyRepository,
|
||||
IRepresentativeRepository representativeRepository, IEmployerRepository employerRepository,
|
||||
IWorkshopRepository workshopRepository, ILeftWorkRepository leftWorkRepository,
|
||||
IFinancialStatmentApplication financialStatmentApplication, IWorkshopApplication workshopApplication)
|
||||
public InstitutionContractApplication(IInstitutionContractRepository institutionContractRepository, IPersonalContractingPartyRepository contractingPartyRepository, IRepresentativeRepository representativeRepository, IEmployerRepository employerRepository, IWorkshopRepository workshopRepository, ILeftWorkRepository leftWorkRepository, IFinancialStatmentApplication financialStatmentApplication, IWorkshopApplication workshopApplication)
|
||||
{
|
||||
_institutionContractRepository = institutionContractRepository;
|
||||
_contractingPartyRepository = contractingPartyRepository;
|
||||
@@ -50,28 +46,25 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
|
||||
public OperationResult Create(CreateInstitutionContract 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(
|
||||
"برای این معرف و طرف حساب قبلا قرارداد ایجاد شده است، شما میتوانید از تمدید استفاده کنید");
|
||||
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 += "تاریخ پایان قراراداد اجباری است. ";
|
||||
@@ -88,6 +81,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
else if (command.ContractingPartyId < 1 && command.RepresentativeId > 1)
|
||||
{
|
||||
return opration.Failed("طرف حساب را انتخاب کنید");
|
||||
|
||||
}
|
||||
else if (command.ContractingPartyId < 1 && command.RepresentativeId < 1)
|
||||
{
|
||||
@@ -100,17 +94,15 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
var contractingParty = _contractingPartyRepository.GetDetails(command.ContractingPartyId);
|
||||
//شماره قرارداد
|
||||
var contractNo = $"{syear}{smonth}{sday}/{contractingParty.ArchiveCode}/0";
|
||||
|
||||
|
||||
///////////////////////
|
||||
if (command.ContactInformationList.Count == 0)
|
||||
return opration.Failed("ورود شماره تماس برای ارسال پیامک الزامیست");
|
||||
var accountContact = command.ContactInformationList.Where(x =>
|
||||
x.SendSmsString == "true" && x.Position == "طرف قرارداد" && x.PhoneType == "شماره همراه" &&
|
||||
!string.IsNullOrWhiteSpace(x.PhoneNumber)).ToList();
|
||||
if (accountContact.Count == 0)
|
||||
x.SendSmsString == "true" && x.Position == "طرف قرارداد" && x.PhoneType == "شماره همراه" && !string.IsNullOrWhiteSpace(x.PhoneNumber)).ToList();
|
||||
if(accountContact.Count == 0)
|
||||
return opration.Failed("ورود شماره همراه با سمت طرف قرارداد برای ساخت حساب کاربری الزامیست");
|
||||
var accountContactCount = command.ContactInformationList
|
||||
.Where(x => x.PhoneType == "شماره همراه" && x.Position == "طرف قرارداد").ToList();
|
||||
var accountContactCount = command.ContactInformationList.Where(x => x.PhoneType == "شماره همراه" && x.Position == "طرف قرارداد").ToList();
|
||||
if (accountContactCount.Count > 1)
|
||||
return opration.Failed("فقط یکی از شماره تلفن ها میتواند سمت طرف قرارداد داشته باشد");
|
||||
|
||||
@@ -125,22 +117,25 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
|
||||
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))
|
||||
if(command.OfficialCompany == "Official" && string.IsNullOrWhiteSpace(command.HasValueAddedTax))
|
||||
return opration.Failed("وضعیت ارزش افزوده را مشخص کنید");
|
||||
if (string.IsNullOrWhiteSpace(command.TypeOfContract))
|
||||
return opration.Failed("عنوان قرارداد را انتخاب کنید");
|
||||
@@ -153,9 +148,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
command.ObligationString = "0";
|
||||
if (string.IsNullOrWhiteSpace(command.TotalAmountString))
|
||||
command.TotalAmountString = "0";
|
||||
command.ValueAddedTax = string.IsNullOrWhiteSpace(command.ValueAddedTaxStr)
|
||||
? 0
|
||||
: command.ValueAddedTaxStr.MoneyToDouble();
|
||||
command.ValueAddedTax = string.IsNullOrWhiteSpace(command.ValueAddedTaxStr) ? 0 : command.ValueAddedTaxStr.MoneyToDouble();
|
||||
var contractAmount = command.ContractAmountString.ToDoubleMoney();
|
||||
command.ContractAmount = Convert.ToDouble(contractAmount);
|
||||
var DailyCompenseation = command.DailyCompenseationString.ToDoubleMoney();
|
||||
@@ -172,15 +165,14 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
// 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, command.ContractAmount,
|
||||
command.DailyCompenseation, command.Obligation,
|
||||
command.TotalAmount, 0, command.WorkshopManualCount, command.EmployeeManualCount, command.Description,
|
||||
command.OfficialCompany, command.TypeOfContract, command.HasValueAddedTax, command.ValueAddedTax);
|
||||
command.TotalAmount, 0,command.WorkshopManualCount,command.EmployeeManualCount,command.Description, command.OfficialCompany, command.TypeOfContract,command.HasValueAddedTax,command.ValueAddedTax);
|
||||
|
||||
_institutionContractRepository.Create(createContract);
|
||||
_institutionContractRepository.SaveChanges();
|
||||
@@ -189,29 +181,27 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
|
||||
public OperationResult Extension(CreateInstitutionContract 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))
|
||||
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 += "تاریخ پایان قراراداد اجباری است. ";
|
||||
@@ -221,8 +211,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
if (dateMessages)
|
||||
return opration.Failed(dateMaessageResult);
|
||||
|
||||
var firstContract =
|
||||
_institutionContractRepository.GetFirstContract(command.ContractingPartyId, command.TypeOfContract);
|
||||
var firstContract = _institutionContractRepository.GetFirstContract(command.ContractingPartyId, command.TypeOfContract);
|
||||
|
||||
var syear = firstContract.ContractStartFa.Substring(0, 4);
|
||||
var smonth = firstContract.ContractStartFa.Substring(5, 2);
|
||||
@@ -230,32 +219,32 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
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))
|
||||
((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))
|
||||
@@ -270,9 +259,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
command.ObligationString = "0";
|
||||
if (string.IsNullOrWhiteSpace(command.TotalAmountString))
|
||||
command.TotalAmountString = "0";
|
||||
command.ValueAddedTax = string.IsNullOrWhiteSpace(command.ValueAddedTaxStr)
|
||||
? 0
|
||||
: command.ValueAddedTaxStr.MoneyToDouble();
|
||||
command.ValueAddedTax = string.IsNullOrWhiteSpace(command.ValueAddedTaxStr) ? 0 : command.ValueAddedTaxStr.MoneyToDouble();
|
||||
var contractAmount = command.ContractAmountString.ToDoubleMoney();
|
||||
command.ContractAmount = Convert.ToDouble(contractAmount);
|
||||
var DailyCompenseation = command.DailyCompenseationString.ToDoubleMoney();
|
||||
@@ -287,13 +274,11 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
command.Address, contractStartGr,
|
||||
command.ContractStartFa, contractEndGr, command.ContractEndFa, command.ContractAmount,
|
||||
command.DailyCompenseation, command.Obligation,
|
||||
command.TotalAmount, command.ExtensionNo, command.WorkshopManualCount, command.EmployeeManualCount,
|
||||
command.Description, command.OfficialCompany, command.TypeOfContract, command.HasValueAddedTax,
|
||||
command.ValueAddedTax);
|
||||
command.TotalAmount, command.ExtensionNo, command.WorkshopManualCount, command.EmployeeManualCount, command.Description,command.OfficialCompany, command.TypeOfContract, command.HasValueAddedTax, command.ValueAddedTax);
|
||||
|
||||
_institutionContractRepository.Create(createContract);
|
||||
_institutionContractRepository.SaveChanges();
|
||||
|
||||
|
||||
|
||||
return opration.Succcedded(createContract.id);
|
||||
}
|
||||
@@ -306,17 +291,14 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
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))
|
||||
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))
|
||||
@@ -326,13 +308,11 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
dateMaessageResult = "تاریخ قراراداد اجباری است. ";
|
||||
dateMessages = true;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.ContractStartFa))
|
||||
{
|
||||
dateMaessageResult += "تاریخ شروع قراراداد اجباری است. ";
|
||||
dateMessages = true;
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.ContractEndFa))
|
||||
{
|
||||
dateMaessageResult += "تاریخ پایان قراراداد اجباری است. ";
|
||||
@@ -343,16 +323,19 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
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("لطفا آدرس را وارد کنید");
|
||||
}
|
||||
|
||||
@@ -371,7 +354,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
command.ObligationString = "0";
|
||||
if (string.IsNullOrWhiteSpace(command.TotalAmountString))
|
||||
command.TotalAmountString = "0";
|
||||
|
||||
|
||||
command.ValueAddedTax = command.ValueAddedTaxStr.MoneyToDouble();
|
||||
var contractAmount = command.ContractAmountString.ToDoubleMoney();
|
||||
command.ContractAmount = Convert.ToDouble(contractAmount);
|
||||
@@ -382,15 +365,12 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
var TotalAmount = command.TotalAmountString.ToDoubleMoney();
|
||||
command.TotalAmount = Convert.ToDouble(TotalAmount);
|
||||
|
||||
ContractEdit.Edit(contractDateGr, command.ContractDateFa, command.State, command.City, command.Address,
|
||||
contractStartGr,
|
||||
command.ContractStartFa, contractEndGr, command.ContractEndFa, command.ContractAmount,
|
||||
command.DailyCompenseation,
|
||||
command.Obligation, command.TotalAmount, command.WorkshopManualCount, command.EmployeeManualCount,
|
||||
command.Description, command.OfficialCompany, command.TypeOfContract, command.ValueAddedTax,
|
||||
command.HasValueAddedTax);
|
||||
ContractEdit.Edit(contractDateGr, command.ContractDateFa,command.State,command.City,command.Address,contractStartGr,
|
||||
command.ContractStartFa,contractEndGr,command.ContractEndFa,command.ContractAmount,command.DailyCompenseation,
|
||||
command.Obligation,command.TotalAmount,command.WorkshopManualCount, command.EmployeeManualCount,command.Description,command.OfficialCompany, command.TypeOfContract, command.ValueAddedTax, command.HasValueAddedTax);
|
||||
_institutionContractRepository.SaveChanges();
|
||||
return opration.Succcedded(command.Id);
|
||||
|
||||
}
|
||||
|
||||
public EditInstitutionContract GetDetails(long id)
|
||||
@@ -400,17 +380,18 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
|
||||
public List<InstitutionContractViewModel> Search(InstitutionContractSearchModel searchModel)
|
||||
{
|
||||
|
||||
var query = _institutionContractRepository.Search(searchModel);
|
||||
var join = new List<InstitutionContractViewModel>();
|
||||
|
||||
var now = DateTime.Now;
|
||||
var nowFa = now.ToFarsi();
|
||||
|
||||
|
||||
var endFa = nowFa.FindeEndOfMonth();
|
||||
var endThisMontGr = endFa.ToGeorgianDateTime();
|
||||
//var watch = System.Diagnostics.Stopwatch.StartNew();
|
||||
|
||||
|
||||
|
||||
|
||||
var newResult = query.Select(x => new InstitutionContractViewModel
|
||||
{
|
||||
Id = x.Id,
|
||||
@@ -426,10 +407,8 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
//BlockTimes = _contractingPartyRepository.GetDetails(x.ContractingPartyId).BlockTimes,
|
||||
ContractingPartyId = x.ContractingPartyId,
|
||||
EmployerViewModels = _employerRepository.GetEmployerByContracrtingPartyID(x.ContractingPartyId),
|
||||
EmployerNo = _employerRepository.GetEmployerByContracrtingPartyID(x.ContractingPartyId)
|
||||
.FirstOrDefault(xn => xn.ContractingPartyID == x.ContractingPartyId)?.EmployerNo,
|
||||
EmployerName = _employerRepository.GetEmployerByContracrtingPartyID(x.ContractingPartyId)
|
||||
.FirstOrDefault(xn => xn.ContractingPartyID == x.ContractingPartyId)?.FullName,
|
||||
EmployerNo = _employerRepository.GetEmployerByContracrtingPartyID(x.ContractingPartyId).FirstOrDefault(xn => xn.ContractingPartyID == x.ContractingPartyId)?.EmployerNo,
|
||||
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 :
|
||||
// _employerRepository.GetEmployerByContracrtingPartyID(x.ContractingPartyId).FirstOrDefault(xn => xn.ContractingPartyID == x.ContractingPartyId)!.Id,
|
||||
ContractAmount = x.ContractAmount,
|
||||
@@ -446,6 +425,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
//EmployeeCount = WorkShopDetailsAndEmployeeCount(x.ContractingPartyId).EmployeeCount,
|
||||
//ArchiveCode = WorkShopDetailsAndEmployeeCount(x.ContractingPartyId).ArchiveCode,
|
||||
TypeOfContract = x.TypeOfContract
|
||||
|
||||
}).ToList();
|
||||
//Console.WriteLine("efTime : " + watch.Elapsed);
|
||||
|
||||
@@ -471,7 +451,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
item.IsContractingPartyBlock = contractingParty.IsBlock;
|
||||
item.BlockTimes = contractingParty.BlockTimes;
|
||||
}
|
||||
|
||||
|
||||
|
||||
var employer = _employerRepository.GetEmployerByContracrtingPartyID(item.ContractingPartyId);
|
||||
item.EmployerViewModels = employer;
|
||||
@@ -493,13 +473,14 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
//var reslt = _workshopApplication.GetConnectedPersonnels(workshopId);
|
||||
//var noBlock = reslt.Where(x => x.Black == false).ToList();
|
||||
//joinPersonelList.AddRange(noBlock);
|
||||
var p = _workshopApplication.PersonnelCount(workshopId);
|
||||
pCount += p;
|
||||
var p = _workshopApplication.PersonnelCount(workshopId);
|
||||
pCount += p;
|
||||
|
||||
}
|
||||
//var joinlistWithoutDuplicat = joinPersonelList.GroupBy(x => x.PersonName).Select(x => x.First()).ToList();
|
||||
//left = joinlistWithoutDuplicat.Count();
|
||||
// var left= _leftWorkRepository.GetLeftPersonelByWorkshopId(workshopIds).Count();
|
||||
|
||||
|
||||
item.EmployeeCount = Convert.ToString(pCount);
|
||||
//if (item.ContractEndGr < now)
|
||||
// item.ExpireColor = "black";
|
||||
@@ -515,8 +496,8 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
var arc = workshop.Select(x => new ArchiveCodConvertoint
|
||||
{
|
||||
ArchiveCodeInt = x.ArchiveCode.Substring(0, 1) == "b" ? 10000000 : x.ArchiveCode.ConvertToInt(),
|
||||
}).OrderBy(x => x.ArchiveCodeInt).ToList();
|
||||
var minArchiveCode = arc.Min(x => x.ArchiveCodeInt);
|
||||
}).OrderBy(x=>x.ArchiveCodeInt).ToList();
|
||||
var minArchiveCode = arc.Min(x=>x.ArchiveCodeInt);
|
||||
archiveCode = minArchiveCode == 10000000 ? 0 : minArchiveCode;
|
||||
}
|
||||
|
||||
@@ -556,10 +537,11 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
var findeByFilter = new List<InstitutionContractViewModel>();
|
||||
if (searchModel.WorkshopId != 0)
|
||||
{
|
||||
|
||||
foreach (var item in join)
|
||||
{
|
||||
var check = item.WorkshopViewModels.Where(x => x.Id == searchModel.WorkshopId).ToList();
|
||||
if (check.Count > 0)
|
||||
if(check.Count >0)
|
||||
findeByFilter.Add(item);
|
||||
}
|
||||
|
||||
@@ -569,29 +551,32 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
var findeByFilter2 = new List<InstitutionContractViewModel>();
|
||||
if (searchModel.EmployerId != 0)
|
||||
{
|
||||
|
||||
foreach (var item in join)
|
||||
{
|
||||
var check = item.EmployerViewModels.Where(x => x.Id == searchModel.EmployerId).ToList();
|
||||
if (check.Count > 0)
|
||||
findeByFilter2.Add(item);
|
||||
|
||||
|
||||
}
|
||||
|
||||
join = findeByFilter2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
join = join.OrderBy(x => x.WorkshopCount != "0" && string.IsNullOrWhiteSpace(x.ExpireColor))
|
||||
.ThenBy(x => x.WorkshopCount == "0" && string.IsNullOrWhiteSpace(x.ExpireColor))
|
||||
.ThenBy(x => x.ExpireColor == "red")
|
||||
.ThenBy(x=>x.ExpireColor=="red")
|
||||
.ThenBy(x => x.ExpireColor == "purple")
|
||||
.ThenBy(x => x.ExpireColor == "black").ToList();
|
||||
.ThenBy(x=>x.ExpireColor=="black").ToList();
|
||||
|
||||
return join;
|
||||
}
|
||||
|
||||
public List<InstitutionContractViewModel> NewSearch(InstitutionContractSearchModel searchModel)
|
||||
{
|
||||
return _institutionContractRepository.NewSearch(searchModel);
|
||||
return _institutionContractRepository.NewSearch(searchModel);
|
||||
}
|
||||
|
||||
|
||||
@@ -599,13 +584,10 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
{
|
||||
var result = _institutionContractRepository.NewSearch(new InstitutionContractSearchModel());
|
||||
|
||||
return result.Where(x =>
|
||||
x.IsActiveString == "true" && x.IsContractingPartyBlock != "true" && x.WorkshopCount != "0" &&
|
||||
x.ContractStartGr <= DateTime.Now && x.ContractEndGr >= DateTime.Now).ToList();
|
||||
return result.Where(x => 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,
|
||||
string isActiveString)
|
||||
public string ExpCheckColor(DateTime now, DateTime ContractEndGr, DateTime endThisMontGr, string ContractAmount, string isActiveString)
|
||||
{
|
||||
string result = "";
|
||||
|
||||
@@ -623,7 +605,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
public TotalbalancViewModel TotalBalance(long contractingPartyId)
|
||||
{
|
||||
var result = new TotalbalancViewModel();
|
||||
|
||||
|
||||
var firstGetStatement = _financialStatmentApplication.GetDetailsByContractingPartyId(contractingPartyId);
|
||||
var allTransactions = firstGetStatement.FinancialTransactionViewModels;
|
||||
if (allTransactions != null)
|
||||
@@ -634,7 +616,6 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
result.TotalBalanceDbl = debt - credit;
|
||||
result.TotalBalanceStr = result.TotalBalanceDbl.ToMoney();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -642,13 +623,11 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
{
|
||||
var result = new WorkshopsAndEmployeeViewModel();
|
||||
|
||||
var emplId = _employerRepository.GetEmployerByContracrtingPartyID(contractingPartyId).Select(x => x.Id)
|
||||
.ToList();
|
||||
;
|
||||
var emplId = _employerRepository.GetEmployerByContracrtingPartyID(contractingPartyId).Select(x => x.Id).ToList(); ;
|
||||
result.WorkshopViewModels = _workshopRepository.GetWorkshopsByEmployerId(emplId);
|
||||
var workshopIds = result.WorkshopViewModels.Select(x => x.Id).ToList();
|
||||
var left = 0;
|
||||
result.WorkshopCount = Convert.ToString(workshopIds.Count);
|
||||
result.WorkshopCount= Convert.ToString(workshopIds.Count);
|
||||
var joinPersonelList = new List<ConnectedPersonnelViewModel>();
|
||||
foreach (var workshopId in workshopIds)
|
||||
{
|
||||
@@ -657,6 +636,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
//joinPersonelList.AddRange(noBlock);
|
||||
var pCount = _workshopApplication.PersonnelCount(workshopId);
|
||||
result.EmployeeCount = Convert.ToString(pCount);
|
||||
|
||||
}
|
||||
//var joinlistWithoutDuplicat = joinPersonelList.GroupBy(x => x.PersonName).Select(x => x.First()).ToList();
|
||||
//left = joinlistWithoutDuplicat.Count();
|
||||
@@ -675,7 +655,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
var minArchiveCode = arc.Min(x => x.ArchiveCodeInt);
|
||||
result.ArchiveCode = minArchiveCode == 10000000 ? 0 : minArchiveCode;
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -695,13 +675,13 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
{
|
||||
Id = get.Id,
|
||||
ContractNo = get.ContractNo,
|
||||
|
||||
|
||||
ContractStartFa = get.ContractStartFa,
|
||||
|
||||
ContractEndFa = get.ContractEndFa,
|
||||
|
||||
ContractingPartyName = get.ContractingPartyName,
|
||||
|
||||
|
||||
ContractingPartyId = get.ContractingPartyId,
|
||||
ContractDateFa = get.ContractDateFa,
|
||||
State = get.State,
|
||||
@@ -715,6 +695,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
Obligation = get.ObligationString,
|
||||
TotalAmount = get.TotalAmountString,
|
||||
WorkshopViewModels = workshops
|
||||
|
||||
};
|
||||
return res;
|
||||
}
|
||||
@@ -722,6 +703,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
|
||||
public OperationResult Active(long id)
|
||||
{
|
||||
|
||||
var opration = new OperationResult();
|
||||
var contract = _institutionContractRepository.Get(id);
|
||||
if (contract == null)
|
||||
@@ -786,7 +768,6 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
var res = _employerRepository.DeActiveAll(employer.Id);
|
||||
}
|
||||
}
|
||||
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
@@ -816,7 +797,6 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
var res = _employerRepository.ActiveAll(employer.Id);
|
||||
}
|
||||
}
|
||||
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
@@ -830,10 +810,10 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
contractingParty.Active();
|
||||
_contractingPartyRepository.SaveChanges();
|
||||
}
|
||||
|
||||
|
||||
var employers =
|
||||
_employerRepository.GetEmployerByContracrtingPartyID(contractingPartyId);
|
||||
|
||||
|
||||
foreach (var employer in employers)
|
||||
{
|
||||
var res = _employerRepository.ActiveAll(employer.Id);
|
||||
@@ -845,6 +825,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
public void RemoveContract(long id)
|
||||
{
|
||||
_institutionContractRepository.RemoveContract(id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -880,376 +861,16 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
|
||||
public void CreateContractingPartyAccount(long contractingPartyid, long accountId)
|
||||
{
|
||||
_institutionContractRepository.CreateContractingPartyAccount(contractingPartyid, accountId);
|
||||
_institutionContractRepository.CreateContractingPartyAccount(contractingPartyid,accountId);
|
||||
}
|
||||
|
||||
public double GetcontractAmount(int 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
|
||||
|
||||
public class TotalbalancViewModel
|
||||
@@ -1262,7 +883,7 @@ public class WorkshopsAndEmployeeViewModel
|
||||
{
|
||||
public List<WorkshopViewModel> WorkshopViewModels { get; set; }
|
||||
public string WorkshopCount { get; set; }
|
||||
public string EmployeeCount { get; set; }
|
||||
public string EmployeeCount { get; set;}
|
||||
public int ArchiveCode { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
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,
|
||||
|
||||
@@ -30,11 +30,8 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
private readonly ICheckoutRepository _checkoutRepository;
|
||||
|
||||
|
||||
public SalaryAidApplication(ISalaryAidRepository salaryAidRepository,
|
||||
ICustomizeCheckoutRepository customizeCheckoutRepository,
|
||||
IEmployeeRepository employeeRepository, ICustomizeCheckoutTempRepository customizeCheckoutTempRepository,
|
||||
IAuthHelper authHelper, ICustomizeCheckoutApplication customizeCheckoutApplication,
|
||||
ICustomizeCheckoutTempApplication customizeCheckoutTempApplication, ICheckoutRepository checkoutRepository)
|
||||
public SalaryAidApplication(ISalaryAidRepository salaryAidRepository, ICustomizeCheckoutRepository customizeCheckoutRepository,
|
||||
IEmployeeRepository employeeRepository, ICustomizeCheckoutTempRepository customizeCheckoutTempRepository, IAuthHelper authHelper, ICustomizeCheckoutApplication customizeCheckoutApplication, ICustomizeCheckoutTempApplication customizeCheckoutTempApplication, ICheckoutRepository checkoutRepository)
|
||||
{
|
||||
_salaryAidRepository = salaryAidRepository;
|
||||
_customizeCheckoutRepository = customizeCheckoutRepository;
|
||||
@@ -65,7 +62,6 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
{
|
||||
return op.Failed("تاریخ وارد شده نامعتبر است");
|
||||
}
|
||||
|
||||
var calculationDate = $"{command.CalculationYear:0000}/{command.CalculationMonth:00}/01";
|
||||
if (!calculationDate.TryToGeorgianDateTime(out var calculationDateGr))
|
||||
{
|
||||
@@ -75,6 +71,7 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
if (startDate > DateTime.Now)
|
||||
{
|
||||
return op.Failed("تاریخ پرداخت مساعده می بایست تاریخ امروز یا قبل تر باشد");
|
||||
|
||||
}
|
||||
|
||||
if (command.Amount.Length > 15)
|
||||
@@ -88,30 +85,30 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
|
||||
_ = DateTime.Now.Date.AddMonthsFa(-1, out var oneMonthAgoGr);
|
||||
|
||||
// if (oneMonthAgoGr > calculationDateGr)
|
||||
// {
|
||||
// var prevCheckouts = _customizeCheckoutRepository.ValidateExistsCheckouts(calculationDateGr,
|
||||
// oneMonthAgoGr, command.WorkshopId, command.EmployeeIds);
|
||||
//
|
||||
// if (prevCheckouts.CustomizeCheckout || prevCheckouts.CustomizeCheckoutTemp)
|
||||
// {
|
||||
// return op.Failed("شما نمیتوانید در تاریخ قبل از یک ماه گذشته که فیش صادر شده باشد مساعده دهید");
|
||||
// }
|
||||
// }
|
||||
if (oneMonthAgoGr > calculationDateGr)
|
||||
{
|
||||
var prevCheckouts = _customizeCheckoutRepository.ValidateExistsCheckouts(calculationDateGr,
|
||||
oneMonthAgoGr, command.WorkshopId, command.EmployeeIds);
|
||||
|
||||
if (prevCheckouts.CustomizeCheckout || prevCheckouts.CustomizeCheckoutTemp)
|
||||
{
|
||||
return op.Failed("شما نمیتوانید در تاریخ قبل از یک ماه گذشته که فیش صادر شده باشد مساعده دهید");
|
||||
}
|
||||
}
|
||||
|
||||
var existsCheckouts = _customizeCheckoutRepository.ValidateExistsCheckouts(calculationDateGr,
|
||||
calculationDateGr, command.WorkshopId, command.EmployeeIds);
|
||||
|
||||
//if (existsCheckouts.Checkout)
|
||||
// return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی رسمی صادر شده است مساعده ای دهید");
|
||||
// return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی رسمی صادر شده است مساعده ای دهید");
|
||||
|
||||
|
||||
var (userId, userType, _) = _authHelper.GetUserTypeWithId();
|
||||
using var transaction = new TransactionScope();
|
||||
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.SaveChanges();
|
||||
if (existsCheckouts.CustomizeCheckout)
|
||||
@@ -122,14 +119,13 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
|
||||
if (customizeCheckouts != null)
|
||||
{
|
||||
// customizeCheckouts.SetHasAmountConflict(true);
|
||||
|
||||
var salaryAids = customizeCheckouts.CustomizeCheckoutSalaryAids.ToList();
|
||||
|
||||
salaryAids.Add(new(entity.Amount.ToMoney(), entity.SalaryAidDateTime,
|
||||
entity.SalaryAidDateTime.ToFarsi(), entity.CalculationDate, entity.CalculationDate.ToFarsi(),
|
||||
entity.id));
|
||||
|
||||
salaryAids.Add(new(entity.Amount.ToMoney(), entity.SalaryAidDateTime, entity.SalaryAidDateTime.ToFarsi(), entity.CalculationDate, entity.CalculationDate.ToFarsi(), entity.id));
|
||||
customizeCheckouts.SetSalaryAids(salaryAids);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (existsCheckouts.CustomizeCheckoutTemp)
|
||||
@@ -139,24 +135,13 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
|
||||
if (customizeCheckoutTemp != null)
|
||||
{
|
||||
// customizeCheckoutTemp.SetHasAmountConflict(true);
|
||||
var salaryAids = customizeCheckoutTemp.CustomizeCheckoutSalaryAids.ToList();
|
||||
|
||||
salaryAids.Add(new(entity.Amount.ToMoney(), entity.SalaryAidDateTime,
|
||||
entity.SalaryAidDateTime.ToFarsi(), entity.CalculationDate, entity.CalculationDate.ToFarsi(),
|
||||
entity.id));
|
||||
|
||||
salaryAids.Add(new(entity.Amount.ToMoney(), entity.SalaryAidDateTime, entity.SalaryAidDateTime.ToFarsi(), entity.CalculationDate, entity.CalculationDate.ToFarsi(), entity.id));
|
||||
customizeCheckoutTemp.SetSalaryAids(salaryAids);
|
||||
}
|
||||
}
|
||||
|
||||
if (existsCheckouts.Checkout)
|
||||
{
|
||||
var checkouts = _checkoutRepository.GetByWorkshopIdEmployeeIdInDate(
|
||||
command.WorkshopId, employeeId, calculationDateGr).GetAwaiter().GetResult();
|
||||
|
||||
checkouts?.SetAmountConflict(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
_customizeCheckoutRepository.SaveChanges();
|
||||
@@ -182,13 +167,12 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
if (startDate > DateTime.Now)
|
||||
{
|
||||
return op.Failed("تاریخ پرداخت مساعده می بایست تاریخ امروز یا قبل تر باشد");
|
||||
}
|
||||
|
||||
}
|
||||
if (command.Amount.Length > 15)
|
||||
{
|
||||
return op.Failed("مبلغ وارد شده معتبر نیست");
|
||||
}
|
||||
|
||||
var entity = _salaryAidRepository.Get(command.Id);
|
||||
if (entity == null)
|
||||
return op.Failed("چنین مساعده ای وجود ندارد");
|
||||
@@ -199,30 +183,29 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
|
||||
_ = DateTime.Now.Date.AddMonthsFa(-1, out var oneMonthAgoGr);
|
||||
|
||||
// if (oneMonthAgoGr > calculationDateGr)
|
||||
// {
|
||||
// var prevCheckouts = _customizeCheckoutRepository.ValidateExistsCheckouts(calculationDateGr,
|
||||
// oneMonthAgoGr, entity.WorkshopId, [entity.EmployeeId]);
|
||||
//
|
||||
// if (prevCheckouts.CustomizeCheckout || prevCheckouts.CustomizeCheckoutTemp)
|
||||
// {
|
||||
// return op.Failed("شما نمیتوانید در تاریخ قبل از یک ماه گذشته که فیش صادر شده باشد مساعده ای دهید");
|
||||
// }
|
||||
// }
|
||||
if (oneMonthAgoGr > calculationDateGr)
|
||||
{
|
||||
var prevCheckouts = _customizeCheckoutRepository.ValidateExistsCheckouts(calculationDateGr,
|
||||
oneMonthAgoGr, entity.WorkshopId, [entity.EmployeeId]);
|
||||
|
||||
if (prevCheckouts.CustomizeCheckout || prevCheckouts.CustomizeCheckoutTemp)
|
||||
{
|
||||
return op.Failed("شما نمیتوانید در تاریخ قبل از یک ماه گذشته که فیش صادر شده باشد مساعده ای دهید");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var existsCheckouts = _customizeCheckoutRepository.ValidateExistsCheckouts(calculationDateGr,
|
||||
calculationDateGr, entity.WorkshopId, [entity.EmployeeId]);
|
||||
|
||||
// if (existsCheckouts.Checkout)
|
||||
// return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی رسمی صادر شده است مساعده ای دهید");
|
||||
// if (existsCheckouts.Checkout)
|
||||
// return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی رسمی صادر شده است مساعده ای دهید");
|
||||
|
||||
|
||||
using var transaction = new TransactionScope();
|
||||
var (userId, userType, _) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
entity.Edit(Tools.MoneyToDouble(command.Amount), startDate, userId, userType, command.CalculationMonth,
|
||||
command.CalculationYear);
|
||||
entity.Edit(Tools.MoneyToDouble(command.Amount), startDate, userId, userType, command.CalculationMonth, command.CalculationYear);
|
||||
_salaryAidRepository.SaveChanges();
|
||||
|
||||
if (existsCheckouts.CustomizeCheckout)
|
||||
@@ -230,7 +213,6 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
var customizeCheckouts = _customizeCheckoutRepository.GetByWorkshopIdEmployeeIdMonthYear(
|
||||
entity.WorkshopId, entity.EmployeeId,
|
||||
year, month).GetAwaiter().GetResult();
|
||||
// customizeCheckouts?.SetHasAmountConflict(true);
|
||||
|
||||
var salaryAids = customizeCheckouts.CustomizeCheckoutSalaryAids.ToList();
|
||||
|
||||
@@ -244,15 +226,13 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
entity.CalculationDate, entity.CalculationDate.ToFarsi(), entity.id));
|
||||
|
||||
customizeCheckouts.SetSalaryAids(salaryAids);
|
||||
}
|
||||
|
||||
}
|
||||
if (existsCheckouts.CustomizeCheckoutTemp)
|
||||
{
|
||||
var customizeCheckoutTemp = _customizeCheckoutTempRepository.GetByWorkshopIdEmployeeIdInDate(
|
||||
entity.WorkshopId, entity.EmployeeId, calculationDateGr).GetAwaiter().GetResult();
|
||||
|
||||
// customizeCheckoutTemp?.SetHasAmountConflict(true);
|
||||
|
||||
var salaryAids = customizeCheckoutTemp.CustomizeCheckoutSalaryAids.ToList();
|
||||
|
||||
var existsSalaryAid = salaryAids.FirstOrDefault(x => x.EntityId == entity.id);
|
||||
@@ -265,15 +245,8 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
entity.CalculationDate, entity.CalculationDate.ToFarsi(), entity.id));
|
||||
|
||||
customizeCheckoutTemp.SetSalaryAids(salaryAids);
|
||||
}
|
||||
if (existsCheckouts.Checkout)
|
||||
{
|
||||
var checkouts = _checkoutRepository.GetByWorkshopIdEmployeeIdInDate(
|
||||
command.WorkshopId, entity.EmployeeId, calculationDateGr).GetAwaiter().GetResult();
|
||||
|
||||
checkouts?.SetAmountConflict(true);
|
||||
}
|
||||
|
||||
_customizeCheckoutRepository.SaveChanges();
|
||||
transaction.Complete();
|
||||
return op.Succcedded();
|
||||
@@ -289,23 +262,18 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
var month = Convert.ToInt32(entity.CalculationDate.ToFarsi().Substring(5, 2));
|
||||
var year = Convert.ToInt32(entity.CalculationDate.ToFarsi().Substring(0, 4));
|
||||
|
||||
if (_customizeCheckoutRepository.Exists(x =>
|
||||
x.WorkshopId == entity.WorkshopId && entity.EmployeeId == x.EmployeeId && x.YearInt == year &&
|
||||
x.MonthInt == month))
|
||||
if (_customizeCheckoutRepository.Exists(x => x.WorkshopId == entity.WorkshopId && entity.EmployeeId == x.EmployeeId && x.YearInt == year && x.MonthInt == month))
|
||||
return op.Failed("این پرسنل در این تاریخ دارای فیش حقوقی است");
|
||||
|
||||
|
||||
if (_customizeCheckoutTempRepository.Exists(x =>
|
||||
x.WorkshopId == entity.WorkshopId && entity.EmployeeId == x.EmployeeId &&
|
||||
x.YearInt == year && x.MonthInt == month && x.ContractStart <= entity.CalculationDate &&
|
||||
x.ContractEnd >= entity.CalculationDate))
|
||||
if (_customizeCheckoutTempRepository.Exists(x => x.WorkshopId == entity.WorkshopId && entity.EmployeeId == x.EmployeeId &&
|
||||
x.YearInt == year && x.MonthInt == month && x.ContractStart <= entity.CalculationDate && x.ContractEnd >= entity.CalculationDate))
|
||||
{
|
||||
return op.Failed("این پرسنل در این تاریخ دارای فیش حقوقی موقت است");
|
||||
}
|
||||
|
||||
if (_checkoutRepository.Exists(x => x.WorkshopId == entity.WorkshopId && entity.EmployeeId == x.EmployeeId &&
|
||||
x.ContractStart <= entity.CalculationDate &&
|
||||
x.ContractEnd >= entity.CalculationDate))
|
||||
x.ContractStart <= entity.CalculationDate && x.ContractEnd >= entity.CalculationDate))
|
||||
{
|
||||
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();
|
||||
await using var transaction = await _salaryAidRepository.BeginTransactionAsync();
|
||||
|
||||
using var transaction = new TransactionScope();
|
||||
foreach (var command in commands)
|
||||
{
|
||||
|
||||
if (!command.SalaryDateTime.TryToGeorgianDateTime(out var startDate))
|
||||
{
|
||||
return op.Failed("تاریخ وارد شده نامعتبر است");
|
||||
}
|
||||
|
||||
var calculationDate = $"{command.CalculationYear:0000}/{command.CalculationMonth:00}/01";
|
||||
if (!calculationDate.TryToGeorgianDateTime(out var calculationDateGr))
|
||||
{
|
||||
@@ -346,37 +313,37 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
if (startDate > DateTime.Now)
|
||||
{
|
||||
return op.Failed("تاریخ پرداخت مساعده می بایست تاریخ امروز یا قبل تر باشد");
|
||||
}
|
||||
|
||||
}
|
||||
if (command.Amount.Length > 15)
|
||||
{
|
||||
return op.Failed("مبلغ وارد شده معتبر نیست");
|
||||
}
|
||||
|
||||
_ = DateTime.Now.Date.AddMonthsFa(-1, out var oneMonthAgoGr);
|
||||
//
|
||||
// if (oneMonthAgoGr > calculationDateGr)
|
||||
// {
|
||||
// var prevCheckouts = _customizeCheckoutRepository.ValidateExistsCheckouts(calculationDateGr,
|
||||
// oneMonthAgoGr, command.WorkshopId, command.EmployeeIds);
|
||||
//
|
||||
// if (prevCheckouts.CustomizeCheckout || prevCheckouts.Checkout || prevCheckouts.CustomizeCheckoutTemp)
|
||||
// {
|
||||
// return op.Failed("شما نمیتوانید در تاریخ قبل از یک ماه گذشته که فیش صادر شده باشد مساعده دهید");
|
||||
// }
|
||||
// }
|
||||
|
||||
if (oneMonthAgoGr > calculationDateGr)
|
||||
{
|
||||
var prevCheckouts = _customizeCheckoutRepository.ValidateExistsCheckouts(calculationDateGr,
|
||||
oneMonthAgoGr, command.WorkshopId, command.EmployeeIds);
|
||||
|
||||
if (prevCheckouts.CustomizeCheckout || prevCheckouts.Checkout || prevCheckouts.CustomizeCheckoutTemp)
|
||||
{
|
||||
return op.Failed("شما نمیتوانید در تاریخ قبل از یک ماه گذشته که فیش صادر شده باشد مساعده دهید");
|
||||
}
|
||||
}
|
||||
|
||||
var existsCheckouts = _customizeCheckoutRepository.ValidateExistsCheckouts(calculationDateGr,
|
||||
calculationDateGr, command.WorkshopId, command.EmployeeIds);
|
||||
|
||||
|
||||
// if (existsCheckouts.Checkout)
|
||||
// return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی رسمی صادر شده است مساعده ای دهید");
|
||||
// if (existsCheckouts.Checkout)
|
||||
// return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی رسمی صادر شده است مساعده ای دهید");
|
||||
|
||||
var month = Convert.ToInt32(command.CalculationMonth);
|
||||
var year = Convert.ToInt32(command.CalculationYear);
|
||||
|
||||
|
||||
|
||||
var (userId, userType, _) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
foreach (var employeeId in command.EmployeeIds)
|
||||
@@ -388,10 +355,9 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
id = employee.id;
|
||||
}
|
||||
|
||||
var entity = new SalaryAid(id, command.WorkshopId, command.Amount.MoneyToDouble(), startDate, userId,
|
||||
userType, command.CalculationMonth, command.CalculationYear);
|
||||
await _salaryAidRepository.CreateAsync(entity);
|
||||
await _salaryAidRepository.SaveChangesAsync();
|
||||
var entity = new SalaryAid(id, command.WorkshopId, command.Amount.MoneyToDouble(), startDate, userId, userType, command.CalculationMonth, command.CalculationYear);
|
||||
_salaryAidRepository.Create(entity);
|
||||
_salaryAidRepository.SaveChanges();
|
||||
|
||||
if (existsCheckouts.CustomizeCheckout)
|
||||
{
|
||||
@@ -399,17 +365,15 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
command.WorkshopId, employeeId,
|
||||
year, month).GetAwaiter().GetResult();
|
||||
|
||||
// customizeCheckouts?.SetHasAmountConflict(true);
|
||||
|
||||
if (customizeCheckouts != null)
|
||||
{
|
||||
|
||||
var salaryAids = customizeCheckouts.CustomizeCheckoutSalaryAids.ToList();
|
||||
|
||||
salaryAids.Add(new(entity.Amount.ToMoney(), entity.SalaryAidDateTime,
|
||||
entity.SalaryAidDateTime.ToFarsi(), entity.CalculationDate,
|
||||
entity.CalculationDate.ToFarsi(), entity.id));
|
||||
|
||||
salaryAids.Add(new(entity.Amount.ToMoney(), entity.SalaryAidDateTime, entity.SalaryAidDateTime.ToFarsi(), entity.CalculationDate, entity.CalculationDate.ToFarsi(), entity.id));
|
||||
customizeCheckouts.SetSalaryAids(salaryAids);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (existsCheckouts.CustomizeCheckoutTemp)
|
||||
@@ -417,35 +381,21 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
var customizeCheckoutTemp = _customizeCheckoutTempRepository.GetByWorkshopIdEmployeeIdInDate(
|
||||
command.WorkshopId, employeeId, calculationDateGr).GetAwaiter().GetResult();
|
||||
|
||||
// customizeCheckoutTemp?.SetHasAmountConflict(true);
|
||||
if (customizeCheckoutTemp != null)
|
||||
{
|
||||
var salaryAids = customizeCheckoutTemp.CustomizeCheckoutSalaryAids.ToList();
|
||||
|
||||
salaryAids.Add(new(entity.Amount.ToMoney(), entity.SalaryAidDateTime,
|
||||
entity.SalaryAidDateTime.ToFarsi(), entity.CalculationDate,
|
||||
entity.CalculationDate.ToFarsi(), entity.id));
|
||||
|
||||
salaryAids.Add(new(entity.Amount.ToMoney(), entity.SalaryAidDateTime, entity.SalaryAidDateTime.ToFarsi(), entity.CalculationDate, entity.CalculationDate.ToFarsi(), entity.id));
|
||||
customizeCheckoutTemp.SetSalaryAids(salaryAids);
|
||||
}
|
||||
}
|
||||
if (existsCheckouts.Checkout)
|
||||
{
|
||||
var checkouts = _checkoutRepository.GetByWorkshopIdEmployeeIdInDate(
|
||||
command.WorkshopId, employeeId, calculationDateGr).GetAwaiter().GetResult();
|
||||
|
||||
checkouts?.SetAmountConflict(true);
|
||||
}
|
||||
}
|
||||
|
||||
await _customizeCheckoutRepository.SaveChangesAsync();
|
||||
_customizeCheckoutRepository.SaveChanges();
|
||||
}
|
||||
|
||||
await transaction.CommitAsync();
|
||||
transaction.Complete();
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
#region Pooya
|
||||
|
||||
/// <summary>
|
||||
/// گروهبندی بر اساس ماه هنگام جستجو با انتخاب کارمند
|
||||
/// </summary>
|
||||
@@ -454,6 +404,6 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
return _salaryAidRepository.GetSearchListAsGrouped(searchModel);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -77,7 +77,6 @@ using Company.Domain.MasterWorkHistory;
|
||||
using Company.Domain.ModuleAgg;
|
||||
using Company.Domain.ModuleTextManagerAgg;
|
||||
using Company.Domain.OriginalTitleAgg;
|
||||
using Company.Domain.PaymentInstrumentAgg;
|
||||
using Company.Domain.PaymentToEmployeeAgg;
|
||||
using Company.Domain.PaymentToEmployeeItemAgg;
|
||||
using Company.Domain.PaymentTransactionAgg;
|
||||
@@ -133,9 +132,7 @@ public class CompanyContext : DbContext
|
||||
public DbSet<EntityModule> EntityModules { get; set; }
|
||||
public DbSet<EntityModuleTextManager> EntityModuleTextManagers { get; set; }
|
||||
public DbSet<EntityBill> EntityBills { get; set; }
|
||||
|
||||
public DbSet<EntityContact> EntityContacts { get; set; }
|
||||
|
||||
//---------Files------------------------------
|
||||
public DbSet<Board> Boards { get; set; }
|
||||
public DbSet<BoardType> BoardTypes { get; set; }
|
||||
@@ -152,7 +149,6 @@ public class CompanyContext : DbContext
|
||||
public DbSet<FileTitle> FileTitles { get; set; }
|
||||
public DbSet<FileTiming> FileTimings { get; set; }
|
||||
public DbSet<FileState> FileStates { get; set; }
|
||||
|
||||
public DbSet<FileAlert> FileAlerts { get; set; }
|
||||
//-------Task Manager----------------------------
|
||||
//public DbSet<Task> Tasks { get; set; }
|
||||
@@ -188,13 +184,9 @@ public class CompanyContext : DbContext
|
||||
|
||||
public DbSet<EmployeeAuthorizeTemp> EmployeeAuthorizeTemps { get; set; }
|
||||
public DbSet<AdminMonthlyOverview> AdminMonthlyOverviews { get; set; }
|
||||
public DbSet<PaymentTransaction> PaymentTransactions { get; set; }
|
||||
public DbSet<PaymentTransaction> PaymentTransactions{ get; set; }
|
||||
|
||||
public DbSet<ContractingPartyBankAccount> ContractingPartyBankAccounts { get; set; }
|
||||
|
||||
public DbSet<PaymentInstrument> PaymentInstruments { get; set; }
|
||||
public DbSet<PaymentInstrumentGroup> PaymentInstrumentGroups { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Pooya
|
||||
@@ -217,9 +209,7 @@ public class CompanyContext : DbContext
|
||||
public DbSet<WorkshopTemp> WorkshopTemps { get; set; }
|
||||
public DbSet<WorkshopServicesTemp> WorkshopServicesTemps { get; set; }
|
||||
public DbSet<InstitutionContractTemp> InstitutionContractTemps { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
public DbSet<CustomizeCheckout> CustomizeCheckouts { get; set; }
|
||||
public DbSet<CustomizeCheckoutTemp> CustomizeCheckoutTemps { get; set; }
|
||||
public DbSet<TaxLeftWorkItem> TaxLeftWorkItems { get; set; }
|
||||
@@ -261,7 +251,7 @@ public class CompanyContext : DbContext
|
||||
|
||||
public DbSet<DateSalary> DateSalaries { get; set; }
|
||||
public DbSet<DateSalaryItem> DateSalaryItems { get; set; }
|
||||
|
||||
|
||||
public DbSet<Percentage> Percentages { get; set; }
|
||||
public DbSet<InsuranceJobItem> InsuranceJobItems { get; set; }
|
||||
public DbSet<InsuranceJob> InsuranceJobs { get; set; }
|
||||
@@ -279,14 +269,14 @@ public class CompanyContext : DbContext
|
||||
public DbSet<WorkingHours> WorkingHoursSet { get; set; }
|
||||
public DbSet<HolidayItem> HolidayItems { get; set; }
|
||||
public DbSet<Holiday> Holidays { get; set; }
|
||||
public DbSet<MandatoryHours> MandatoryHoursDbSet { get; set; }
|
||||
public DbSet<MandatoryHours> MandatoryHoursDbSet { get; set; }
|
||||
public DbSet<WorkshopEmployer> WorkshopEmployers { get; set; }
|
||||
public DbSet<Job> Jobs { get; set; }
|
||||
public DbSet<Job> Jobs { get; set; }
|
||||
public DbSet<Contract> Contracts { get; set; }
|
||||
public DbSet<YearlySalaryTitle> YearlySalaryTitles { get; set; }
|
||||
public DbSet<YearlySalaryItem> YearlySalaryItems { get; set; }
|
||||
public DbSet<YearlySalary> YearlySalaries { get; set; }
|
||||
public DbSet<EmployeeChildren> EmployeeChildrenSet { get; set; }
|
||||
public DbSet<EmployeeChildren> EmployeeChildrenSet { get; set; }
|
||||
public DbSet<Employee> Employees { get; set; }
|
||||
public DbSet<Workshop> Workshops { get; set; }
|
||||
public DbSet<PersonalContractingParty> PersonalContractingParties { get; set; }
|
||||
@@ -301,15 +291,17 @@ public class CompanyContext : DbContext
|
||||
public DbSet<Employer> Employers { get; set; }
|
||||
|
||||
|
||||
public CompanyContext(DbContextOptions<CompanyContext> options) : base(options)
|
||||
public CompanyContext(DbContextOptions<CompanyContext> options) :base(options)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public CompanyContext()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
@@ -317,5 +309,6 @@ public class CompanyContext : DbContext
|
||||
modelBuilder.ApplyConfigurationsFromAssembly(assembly);
|
||||
modelBuilder.Entity<RollCall>().HasQueryFilter(x => x.RollCallModifyType != RollCallModifyType.Undefined);
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,6 @@ class CheckoutMapping : IEntityTypeConfiguration<Checkout>
|
||||
builder.Property(x => x.TotalDayOfYearsCompute).HasMaxLength(10);
|
||||
builder.Property(x => x.TotalDayOfBunosesCompute).HasMaxLength(10);
|
||||
|
||||
builder.Property(x => x.EmployeeMandatoryHours).HasTimeSpanConversion();
|
||||
builder.HasOne(x => x.Workshop)
|
||||
.WithMany(x => x.Checkouts)
|
||||
.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")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("EmployeeMandatoryHours")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b.Property<double>("FamilyAllowance")
|
||||
.HasColumnType("float");
|
||||
|
||||
@@ -312,9 +307,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
|
||||
b.Property<bool>("HasAmountConflict")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("HasRollCall")
|
||||
.HasColumnType("bit");
|
||||
|
||||
@@ -880,7 +872,7 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("ContractingPartyAccount", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.ContractingPartyBankAccountsAgg.ContractingPartyBankAccount", b =>
|
||||
modelBuilder.Entity("Company.Domain.ContractingPartyBankAccountsAgg.ContractingPartyBankAccounts", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -1070,9 +1062,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<double>("FridayPay")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<bool>("HasAmountConflict")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<double>("InstallmentDeduction")
|
||||
.HasColumnType("float");
|
||||
|
||||
@@ -1222,9 +1211,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<double>("FridayPay")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<bool>("HasAmountConflict")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<double>("InstallmentDeduction")
|
||||
.HasColumnType("float");
|
||||
|
||||
@@ -4293,83 +4279,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
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 =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
@@ -6735,7 +6644,7 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Navigation("PersonalContractingParty");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.ContractingPartyBankAccountsAgg.ContractingPartyBankAccount", b =>
|
||||
modelBuilder.Entity("Company.Domain.ContractingPartyBankAccountsAgg.ContractingPartyBankAccounts", b =>
|
||||
{
|
||||
b.HasOne("Company.Domain.ContarctingPartyAgg.PersonalContractingParty", "ContractingParty")
|
||||
.WithMany("ContractingPartyBankAccounts")
|
||||
@@ -9609,17 +9518,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
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 =>
|
||||
{
|
||||
b.HasOne("Company.Domain.PaymentToEmployeeAgg.PaymentToEmployee", "PaymentToEmployee")
|
||||
@@ -10085,11 +9983,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Navigation("Subtitles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.PaymentInstrumentAgg.PaymentInstrumentGroup", b =>
|
||||
{
|
||||
b.Navigation("PaymentInstruments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.PaymentToEmployeeAgg.PaymentToEmployee", b =>
|
||||
{
|
||||
b.Navigation("PaymentToEmployeeItemList");
|
||||
|
||||
@@ -94,7 +94,7 @@ public class AdminMonthlyOverviewRepository : RepositoryBase<long, AdminMonthlyO
|
||||
|
||||
|
||||
var workshopIds = workshopsWithContractingParty.Select(x => x.Workshop.id).ToList();
|
||||
|
||||
|
||||
|
||||
// پیدا کردن کارگاههایی که قبلاً برای این ماه/سال AdminMonthlyOverview دارند
|
||||
var adminMonthlyOverviewWorkshopIds = await _companyContext.AdminMonthlyOverviews
|
||||
@@ -244,67 +244,25 @@ public class AdminMonthlyOverviewRepository : RepositoryBase<long, AdminMonthlyO
|
||||
.Except([5976]).ToHashSet();
|
||||
|
||||
|
||||
//var workingCheckoutEmployeeIds = GetWorkingCheckoutEmployeeIds(workshopIds, targetStartDate, targetEndDate, vipGroup);
|
||||
var chcekoutLeftWorks = _companyContext.LeftWorkList
|
||||
.AsNoTracking()
|
||||
.Where(x =>
|
||||
workshopIds.Contains(x.WorkshopId) &&
|
||||
x.StartWorkDate <= targetEndDate &&
|
||||
x.LeftWorkDate.AddDays(-1) >= targetStartDate &&
|
||||
!vipGroup.Contains(x.EmployeeId))
|
||||
.Select(x => new
|
||||
{
|
||||
x.EmployeeId,
|
||||
x.WorkshopId,
|
||||
x.StartWorkDate,
|
||||
x.LeftWorkDate,
|
||||
x.Workshop.CreateCheckout
|
||||
})
|
||||
.ToList();
|
||||
|
||||
var checkoutContracts = _companyContext.Contracts
|
||||
.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();
|
||||
var workingCheckoutEmployeeIds = GetWorkingCheckoutEmployeeIds(workshopIds, targetStartDate, targetEndDate, vipGroup);
|
||||
//var workingCheckoutEmployeeIds = _companyContext.LeftWorkList.AsNoTracking()
|
||||
// .Join(
|
||||
// _companyContext.Contracts.AsNoTracking(),
|
||||
// leftWork => new { leftWork.EmployeeId, WorkshopId = leftWork.WorkshopId },
|
||||
// contract => new { contract.EmployeeId, WorkshopId = contract.WorkshopIds },
|
||||
// (leftWork, contract) => new { leftWork, contract }
|
||||
// )
|
||||
// .Where(x =>
|
||||
// workshopIds.Contains(x.leftWork.WorkshopId) &&
|
||||
// x.leftWork.StartWorkDate <= targetEndDate &&
|
||||
// x.leftWork.LeftWorkDate.AddDays(-1) >= targetStartDate &&
|
||||
// x.contract.ContarctStart <= targetEndDate &&
|
||||
// x.contract.ContractEnd >= targetStartDate &&
|
||||
// !vipGroup.Contains(x.leftWork.EmployeeId) &&
|
||||
// !_companyContext.EmployeeClientTemps
|
||||
// .Any(temp => temp.EmployeeId == x.leftWork.EmployeeId && temp.WorkshopId == x.leftWork.WorkshopId)
|
||||
// )
|
||||
// .Select(x => new { x.leftWork.WorkshopId, x.leftWork.EmployeeId });
|
||||
|
||||
|
||||
|
||||
@@ -354,38 +312,19 @@ public class AdminMonthlyOverviewRepository : RepositoryBase<long, AdminMonthlyO
|
||||
Data = x.ToList()
|
||||
}).ToList();
|
||||
|
||||
var validWorkshops = workingCheckoutGrouping.Select(x => x.Key)
|
||||
.Union(workingContractGrouping.Select(x => x.WorkshopId)).ToList();
|
||||
|
||||
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)));
|
||||
})
|
||||
var workshopsWithFullContracts = workingContractGrouping
|
||||
.Where(g => g.Data.All(emp => contractSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||
.Select(g => g.WorkshopId)
|
||||
.ToList();
|
||||
|
||||
var list = workingContractEmployeeIds.ToList().Where(x => !contractSet.Any(a => a.EmployeeId == x.EmployeeId && a.WorkshopIds == x.WorkshopId)).ToList();
|
||||
|
||||
// var workshopsWithFullCheckout = workingCheckoutGrouping
|
||||
// .Where(g => g.All(emp => checkoutSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||
// .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)));
|
||||
})
|
||||
var workshopsWithFullCheckout = workingCheckoutGrouping
|
||||
.Where(g => g.All(emp => checkoutSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||
.Select(g => g.Key)
|
||||
.ToList();
|
||||
|
||||
|
||||
var fullyCoveredWorkshops = workshopsWithFullContracts.Intersect(workshopsWithFullCheckout).ToList();
|
||||
|
||||
//var notFullyCoveredWorkshops = groupedCheckout
|
||||
@@ -400,10 +339,6 @@ public class AdminMonthlyOverviewRepository : RepositoryBase<long, AdminMonthlyO
|
||||
var adminMonthlyOverviews = _companyContext.AdminMonthlyOverviews
|
||||
.Where(x => x.Month == month && x.Year == year);
|
||||
|
||||
var notValidMonthlyOverViews =
|
||||
await adminMonthlyOverviews.Where(x => notValidWorkshops.Contains(x.WorkshopId)).ToListAsync();
|
||||
|
||||
|
||||
var adminMonthlyOverviewsWithFullContracts = await adminMonthlyOverviews
|
||||
.Where(x => fullyCoveredWorkshops.Contains(x.WorkshopId) && x.Status == AdminMonthlyOverviewStatus.CreateDocuments)
|
||||
.ToListAsync();
|
||||
@@ -418,7 +353,6 @@ public class AdminMonthlyOverviewRepository : RepositoryBase<long, AdminMonthlyO
|
||||
foreach (var adminMonthlyOverview in adminMonthlyOverviewsWithNotFullContracts)
|
||||
adminMonthlyOverview.SetStatus(AdminMonthlyOverviewStatus.CreateDocuments);
|
||||
|
||||
_companyContext.RemoveRange(notValidMonthlyOverViews);
|
||||
await _companyContext.SaveChangesAsync();
|
||||
}
|
||||
|
||||
|
||||
@@ -523,7 +523,6 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
entity.SetSalaryAid(command.SalaryAids, command.SalaryAidDeduction);
|
||||
entity.SetLoanInstallment(command.LoanInstallments, command.InstallmentDeduction);
|
||||
entity.SetCheckoutRollCall(command.CheckoutRollCall);
|
||||
entity.SetEmployeeMandatoryHours(command.EmployeeMandatoryHours);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
}
|
||||
@@ -882,66 +881,66 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
|
||||
public List<CheckoutViewModel> PrintAll(List<long> id)
|
||||
{
|
||||
var checkouts = _context.CheckoutSet.Where(x => id.Contains(x.id)).ToList();
|
||||
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,
|
||||
WorkshopId = item.WorkshopId,
|
||||
ContractId = item.ContractId,
|
||||
EmployeeId = item.EmployeeId,
|
||||
EmployeeFullName = item.EmployeeFullName,
|
||||
FathersName = item.FathersName,
|
||||
NationalCode = item.NationalCode,
|
||||
DateOfBirth = item.DateOfBirth,
|
||||
WorkshopName = item.WorkshopName,
|
||||
Month = item.Month,
|
||||
Year = item.Year,
|
||||
PersonnelCode = item.PersonnelCode,
|
||||
PersonnelCodeInt = Convert.ToInt32(item.PersonnelCode),
|
||||
ContractNo = item.ContractNo,
|
||||
MonthlySalary = item.MonthlySalary.ToMoney(),
|
||||
BaseYearsPay = item.BaseYearsPay.ToMoney(),
|
||||
ConsumableItems = item.ConsumableItems.ToMoney(),
|
||||
HousingAllowance = item.HousingAllowance.ToMoney(),
|
||||
OvertimePay = item.OvertimePay.ToMoney(),
|
||||
NightworkPay = item.NightworkPay.ToMoney(),
|
||||
FridayPay = item.FridayPay.ToMoney(),
|
||||
MissionPay = item.MissionPay.ToMoney(),
|
||||
ShiftPay = item.ShiftPay.ToMoney(),
|
||||
FamilyAllowance = item.FamilyAllowance.ToMoney(),
|
||||
BonusesPay = item.BonusesPay.ToMoney(),
|
||||
YearsPay = item.YearsPay.ToMoney(),
|
||||
LeavePay = item.LeavePay.ToMoney(),
|
||||
InsuranceDeduction = item.InsuranceDeduction.ToMoney(),
|
||||
TaxDeducation = item.TaxDeducation.ToMoney(),
|
||||
InstallmentDeduction = item.InstallmentDeduction.ToMoney(),
|
||||
SalaryAidDeduction = item.SalaryAidDeduction.ToMoney(),
|
||||
AbsenceDeduction = item.AbsenceDeduction.ToMoney(),
|
||||
TotalClaims = item.TotalClaims,
|
||||
TotalDeductions = item.TotalDeductions,
|
||||
TotalPayment = item.TotalPayment.ToMoney(),
|
||||
RewardPay = item.RewardPay.ToMoneyNullable(),
|
||||
ContractStartGr = item.ContractStart,
|
||||
ContractEndGr = item.ContractEnd,
|
||||
Id = x.id,
|
||||
WorkshopId = x.WorkshopId,
|
||||
ContractId = x.ContractId,
|
||||
EmployeeId = x.EmployeeId,
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
FathersName = x.FathersName,
|
||||
NationalCode = x.NationalCode,
|
||||
DateOfBirth = x.DateOfBirth,
|
||||
WorkshopName = x.WorkshopName,
|
||||
Month = x.Month,
|
||||
Year = x.Year,
|
||||
PersonnelCode = x.PersonnelCode,
|
||||
PersonnelCodeInt = Convert.ToInt32(x.PersonnelCode),
|
||||
ContractNo = x.ContractNo,
|
||||
MonthlySalary = x.MonthlySalary.ToMoney(),
|
||||
BaseYearsPay = x.BaseYearsPay.ToMoney(),
|
||||
ConsumableItems = x.ConsumableItems.ToMoney(),
|
||||
HousingAllowance = x.HousingAllowance.ToMoney(),
|
||||
OvertimePay = x.OvertimePay.ToMoney(),
|
||||
NightworkPay = x.NightworkPay.ToMoney(),
|
||||
FridayPay = x.FridayPay.ToMoney(),
|
||||
MissionPay = x.MissionPay.ToMoney(),
|
||||
ShiftPay = x.ShiftPay.ToMoney(),
|
||||
FamilyAllowance = x.FamilyAllowance.ToMoney(),
|
||||
BonusesPay = x.BonusesPay.ToMoney(),
|
||||
YearsPay = x.YearsPay.ToMoney(),
|
||||
LeavePay = x.LeavePay.ToMoney(),
|
||||
InsuranceDeduction = x.InsuranceDeduction.ToMoney(),
|
||||
TaxDeducation = x.TaxDeducation.ToMoney(),
|
||||
InstallmentDeduction = x.InstallmentDeduction.ToMoney(),
|
||||
SalaryAidDeduction = x.SalaryAidDeduction.ToMoney(),
|
||||
AbsenceDeduction = x.AbsenceDeduction.ToMoney(),
|
||||
TotalClaims = x.TotalClaims,
|
||||
TotalDeductions = x.TotalDeductions,
|
||||
TotalPayment = x.TotalPayment.ToMoney(),
|
||||
RewardPay = x.RewardPay.ToMoneyNullable(),
|
||||
ContractStartGr = x.ContractStart,
|
||||
ContractEndGr = x.ContractEnd,
|
||||
IsLeft = false,
|
||||
LeftWorkDate = "",
|
||||
LastDayOfWork = "",
|
||||
MarriedAllowance = item.MarriedAllowance.ToMoney(),
|
||||
HasRollCall = item.HasRollCall,
|
||||
MarriedAllowance = x.MarriedAllowance.ToMoney(),
|
||||
HasRollCall = x.HasRollCall,
|
||||
SumOfWorkingDays = "-",
|
||||
OverTimeWorkValue = item.OverTimeWorkValue,
|
||||
OverNightWorkValue = item.OverNightWorkValue,
|
||||
FridayWorkValue = item.FridayWorkValue,
|
||||
RotatingShiftValue = item.RotatingShiftValue,
|
||||
AbsenceValue = item.AbsenceValue,
|
||||
OverTimeWorkValue = x.OverTimeWorkValue,
|
||||
OverNightWorkValue = x.OverNightWorkValue,
|
||||
FridayWorkValue = x.FridayWorkValue,
|
||||
RotatingShiftValue = x.RotatingShiftValue,
|
||||
AbsenceValue = x.AbsenceValue,
|
||||
MaritalStatus = "",
|
||||
TotalDayOfLeaveCompute = "-",
|
||||
TotalDayOfYearsCompute = "-",
|
||||
TotalDayOfBunosesCompute = "-",
|
||||
InstallmentViewModels = item.LoanInstallments.Select(i => new LoanInstallmentViewModel()
|
||||
InstallmentViewModels = x.LoanInstallments.Select(i => new LoanInstallmentViewModel()
|
||||
{
|
||||
Amount = i.AmountForMonth,
|
||||
AmountDouble = i.AmountForMonth.MoneyToDouble(),
|
||||
@@ -951,22 +950,22 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
RemainingAmount = i.LoanRemaining,
|
||||
LoanAmount = i.LoanAmount
|
||||
}).ToList(),
|
||||
SalaryAidViewModels = item.SalaryAids.Select(s => new SalaryAidViewModel()
|
||||
SalaryAidViewModels = x.SalaryAids.Select(s => new SalaryAidViewModel()
|
||||
{
|
||||
Amount = s.Amount,
|
||||
AmountDouble = s.Amount.MoneyToDouble(),
|
||||
SalaryAidDateTimeFa = s.SalaryAidDateTimeFa,
|
||||
SalaryAidDateTimeGe = s.SalaryAidDateTime
|
||||
}).ToList(),
|
||||
CheckoutRollCall = item.CheckoutRollCall != null ? new CheckoutRollCallViewModel()
|
||||
CheckoutRollCall = x.CheckoutRollCall != null ? new CheckoutRollCallViewModel()
|
||||
{
|
||||
TotalPresentTimeSpan = item.CheckoutRollCall.TotalPresentTimeSpan,
|
||||
TotalBreakTimeSpan = item.CheckoutRollCall.TotalBreakTimeSpan,
|
||||
TotalWorkingTimeSpan = item.CheckoutRollCall.TotalWorkingTimeSpan,
|
||||
TotalPaidLeaveTmeSpan = item.CheckoutRollCall.TotalPaidLeaveTmeSpan,
|
||||
TotalMandatoryTimeSpan = item.CheckoutRollCall.TotalMandatoryTimeSpan,
|
||||
TotalSickLeaveTimeSpan = item.CheckoutRollCall.TotalSickLeaveTimeSpan,
|
||||
RollCallDaysCollection = item.CheckoutRollCall.RollCallDaysCollection.Select(d => new CheckoutRollCallDayViewModel()
|
||||
TotalPresentTimeSpan = x.CheckoutRollCall.TotalPresentTimeSpan,
|
||||
TotalBreakTimeSpan = x.CheckoutRollCall.TotalBreakTimeSpan,
|
||||
TotalWorkingTimeSpan = x.CheckoutRollCall.TotalWorkingTimeSpan,
|
||||
TotalPaidLeaveTmeSpan = x.CheckoutRollCall.TotalPaidLeaveTmeSpan,
|
||||
TotalMandatoryTimeSpan = x.CheckoutRollCall.TotalMandatoryTimeSpan,
|
||||
TotalSickLeaveTimeSpan = x.CheckoutRollCall.TotalSickLeaveTimeSpan,
|
||||
RollCallDaysCollection = x.CheckoutRollCall.RollCallDaysCollection.Select(d => new CheckoutRollCallDayViewModel()
|
||||
{
|
||||
WorkingTimeSpan = d.WorkingTimeSpan,
|
||||
BreakTimeSpan = d.BreakTimeSpan,
|
||||
@@ -981,14 +980,11 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
FirstStartDate = d.FirstStartDate,
|
||||
Id = d.Id,
|
||||
SecondEndDate = d.SecondEndDate,
|
||||
SecondStartDate = d.SecondStartDate,
|
||||
}).ToList(),
|
||||
SecondStartDate = d.SecondStartDate
|
||||
}).ToList()
|
||||
|
||||
} : null,
|
||||
HasAmountConflict =item.HasAmountConflict,
|
||||
EmployeeMandatoryHoursTimeSpan = item.EmployeeMandatoryHours,
|
||||
EmployeeMandatoryHoursStr = Tools.ToFarsiHoursAndMinutes(Convert.ToInt32(item.EmployeeMandatoryHours.TotalHours),item.EmployeeMandatoryHours.Minutes,"-")
|
||||
};
|
||||
}).SingleOrDefault(x => x.Id == item);
|
||||
var workshopName = _context.Workshops.FirstOrDefault(x => x.id == ch.WorkshopId);
|
||||
ch.WorkshopName = workshopName.WorkshopName;
|
||||
ch.TotalPaymentHide = workshopName.TotalPaymentHide;
|
||||
@@ -1131,7 +1127,7 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
ch.TotalBreakTimeStr = ch.CheckoutRollCall.TotalBreakTimeSpan.ToFarsiHoursAndMinutes("-");
|
||||
ch.TotalPresentTimeStr = ch.CheckoutRollCall.TotalPresentTimeSpan.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
|
||||
.Select(x => new CheckoutDailyRollCallViewModel
|
||||
{
|
||||
@@ -1724,7 +1720,6 @@ public class CheckoutRepository : RepositoryBase<long, Checkout>, ICheckoutRepos
|
||||
SalaryAidDateTimeFa = s.SalaryAidDateTimeFa,
|
||||
SalaryAidDateTimeGe = s.SalaryAidDateTime
|
||||
}).ToList(),
|
||||
HasAmountConflict = x.HasAmountConflict
|
||||
|
||||
}).Where(x => x.WorkshopId == searchModel.WorkshopId);
|
||||
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();
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user