Excel - customizeChekoutPrint bug fixed

This commit is contained in:
SamSys
2025-01-20 17:31:03 +03:30
parent e17b8f88e7
commit 0412ec66ab
81 changed files with 23001 additions and 662 deletions

View File

@@ -72,16 +72,40 @@
/// </summary>
public const int PaymentToEmployeePermissionCode = 10304;
#region عملیات وام
/// <summary>
/// عملیات وام
/// عملیات حساب بانکی پرسنل
/// </summary>
public const int LoanOperationsPermissionCode = 10305;
public const int EmployeeBankInformationPermissionCode = 10309;
/// <summary>
/// ایجاد وام
/// </summary>
public const int CreateLoanPermissionCode = 1030501;
public const int CreateLoanPermissionCode = 114;
/// <summary>
/// ایجاد پاداش
/// </summary>
public const int CreateRewardPermissionCode = 115;
/// <summary>
/// ایجاد مساعده
/// </summary>
public const int CreateSalaryAidPermissionCode = 116;
/// <summary>
/// ایجاد جریمه
/// </summary>
public const int CreateFinePermissionCode = 117;
#region عملیات وام
/// <summary>
/// عملیات وام
/// </summary>
public const int LoanOperationsPermissionCode = 10305;
///// <summary>
///// ایجاد وام
///// </summary>
//public const int CreateLoanPermissionCode = 1030501;
/// <summary>
/// ویرایش وام
@@ -100,10 +124,10 @@
/// </summary>
public const int RewardOperationsPermissionCode = 10306;
/// <summary>
/// ایجاد پاداش
/// </summary>
public const int CreateRewardPermissionCode = 1030601;
///// <summary>
///// ایجاد پاداش
///// </summary>
//public const int CreateRewardPermissionCode = 1030601;
/// <summary>
/// ویرایش پاداش
@@ -123,10 +147,10 @@
/// </summary>
public const int SalaryAidOperationsPermissionCode = 10307;
/// <summary>
/// ایجاد مساعده
/// </summary>
public const int CreateSalaryAidPermissionCode = 1030701;
///// <summary>
///// ایجاد مساعده
///// </summary>
//public const int CreateSalaryAidPermissionCode = 1030701;
/// <summary>
/// ویرایش مساعده
@@ -145,10 +169,10 @@
/// </summary>
public const int FineOperationsPermissionCode = 10308;
/// <summary>
/// ایجاد جریمه
/// </summary>
public const int CreateFinePermissionCode = 1030801;
///// <summary>
///// ایجاد جریمه
///// </summary>
//public const int CreateFinePermissionCode = 1030801;
/// <summary>
/// ایجاد عنوان جریمه
@@ -409,7 +433,39 @@
Code = PersonnelOperationsPermissionCode,
ParentId = 0
};
public static SubAccountPermissionDto CustomizeCheckoutOperationsPermission { get; } = new()
public static SubAccountPermissionDto LoanOperationsPermission { get; } = new()
{
Id = LoanOperationsPermissionCode,
Name = "عملیات وام",
Code = LoanOperationsPermissionCode,
ParentId = 0
};
public static SubAccountPermissionDto RewardOperationsPermission { get; } = new()
{
Id = RewardOperationsPermissionCode,
Name = "عملیات پاداش",
Code = RewardOperationsPermissionCode,
ParentId = 0
};
public static SubAccountPermissionDto SalaryAidOperationsPermission { get; } = new()
{
Id = SalaryAidOperationsPermissionCode,
Name = "عملیات مساعده",
Code = SalaryAidOperationsPermissionCode,
ParentId = 0
};
public static SubAccountPermissionDto FineOperationsPermission { get; } = new()
{
Id = FineOperationsPermissionCode,
Name = "عملیات جرایم",
Code = FineOperationsPermissionCode,
ParentId = PersonnelOperationsPermissionCode
};
public static SubAccountPermissionDto CustomizeCheckoutOperationsPermission { get; } = new()
{
Id = CustomizeCheckoutOperationsPermissionCode,
Name = "فیش حقوقی غیر رسمی",
@@ -540,6 +596,7 @@
ParentId = PersonnelOperationsPermissionCode
};
public static SubAccountPermissionDto PaymentToEmployeePermission { get; } = new()
{
Id = PaymentToEmployeePermissionCode,
@@ -548,44 +605,20 @@
ParentId = PersonnelOperationsPermissionCode
};
public static SubAccountPermissionDto LoanOperationsPermission { get; } = new()
public static SubAccountPermissionDto EmployeeBankInformationPermission { get; } = new()
{
Id = LoanOperationsPermissionCode,
Name = "عملیات وام",
Code = LoanOperationsPermissionCode,
ParentId = PersonnelOperationsPermissionCode
Id = EmployeeBankInformationPermissionCode,
Name = "عملیات حساب بانکی پرسنل",
Code = EmployeeBankInformationPermissionCode,
ParentId = PersonnelOperationsPermissionCode
};
public static SubAccountPermissionDto RewardOperationsPermission { get; } = new()
{
Id = RewardOperationsPermissionCode,
Name = "عملیات پاداش",
Code = RewardOperationsPermissionCode,
ParentId = PersonnelOperationsPermissionCode
};
#endregion
public static SubAccountPermissionDto SalaryAidOperationsPermission { get; } = new()
{
Id = SalaryAidOperationsPermissionCode,
Name = "عملیات مساعده",
Code = SalaryAidOperationsPermissionCode,
ParentId = PersonnelOperationsPermissionCode
};
public static SubAccountPermissionDto FineOperationsPermission { get; } = new()
{
Id = FineOperationsPermissionCode,
Name = "عملیات جرایم",
Code = FineOperationsPermissionCode,
ParentId = PersonnelOperationsPermissionCode
};
#endregion
#region فیش حقوقی غیر رسمی,ParentId = CustomizeCheckoutOperationsPermissionCode
#region فیش حقوقی غیر رسمی,ParentId = CustomizeCheckoutOperationsPermissionCode
public static SubAccountPermissionDto CustomizeCheckoutSetGroupAndSalaryPermission { get; } = new()
public static SubAccountPermissionDto CustomizeCheckoutSetGroupAndSalaryPermission { get; } = new()
{
Id = CustomizeCheckoutSetGroupAndSalaryPermissionCode,
Name = "تنظیم گروه بندی و حقوق پرسنل",

View File

@@ -1,180 +1,201 @@
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using _0_Framework.Application;
using OfficeOpenXml;
namespace _0_Framework.Excel.Checkout;
using OfficeOpenXml;
using OfficeOpenXml.Style;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
public class CustomizeCheckoutExcelGenerator
{
public static byte[] GenerateCheckoutTempExcelInfo(List<CustomizeCheckoutTempExcelViewModel> data)
{
OfficeOpenXml.ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
using var package = new OfficeOpenXml.ExcelPackage();
var worksheet = package.Workbook.Worksheets.Add("Sheet1");
//worksheet.Cells["A1:AC1"].Merge = true;
//var headerImagePath = Path.Combine("wwwroot", "Excel", "header", "2.png");
//using (var stream = new FileStream(headerImagePath, FileMode.Open, FileAccess.Read))
//{
// var picture = worksheet.Drawings.AddPicture("HeaderImage", stream);
// picture.SetPosition(0, 0, 0, 0); // Set position to the merged cell
// //picture.SetSize(600, 75); // Adjust the size as needed
//}
public static byte[] GenerateCheckoutTempExcelInfo(List<CustomizeCheckoutTempExcelViewModel> data, List<string> selectedParameters)
{
OfficeOpenXml.ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
using var package = new ExcelPackage();
var worksheet = package.Workbook.Worksheets.Add("Sheet1");
string[] headers =
[
//جزییات
"ردیف", "سال", "ماه", "نام و نام خانوادگی", "شماره پرسنلی", "کدملی", "روز کارکرد",
//مطالبات
"حقوق ماهانه", "پاداش", "جمعه کاری", "اضافه کاری", "نوبت کاری", "شب کاری",
"حق تاهل", "حق فرزند", "عیدی", "سنوات", "مزد مرخصی",
//کسورات
"غیبت", "تاخیر در ورود", "تعجیل در خروج", "مساعده", "قسط وام", "جریمه", "حق بیمه", "مالیات",
//مجموع
"جمع مطالبات", "جمع کسورات", "مبلغ قابل پرداخت"
];
// Define headers
Dictionary<string, string> headers = new Dictionary<string, string>
{
{ "Month", "ماه" },
{ "Year", "سال" },
{ "EmployeeFullName", "نام و نام خانوادگی" },
{ "PersonnelCodeString", "شماره پرسنلی" },
{ "NationalCode", "کدملی" },
{ "SumOfWorkingDays", "روز کارکرد" },
{ "MonthlySalary", "حقوق ماهانه" },
{ "BaseYearsPay", "سنوات" },
{ "MarriedAllowance", "حق تاهل" },
{ "OvertimePay", "اضافه کاری" },
{ "NightworkPay", "شب کاری" },
{ "FridayPay", "جمعه کاری" },
{ "MissionPay", "مأموریت" },
{ "ShiftPay", "نوبت کاری" },
{ "FamilyAllowance", "حق فرزند" },
{ "BonusesPay", "پاداش" },
{ "LeavePay", "مزد مرخصی" },
{ "RewardPay", "پاداش" },
{ "FineDeduction", "جریمه" },
{ "InsuranceDeduction", "حق بیمه" },
{ "TaxDeducation", "مالیات" },
{ "InstallmentDeduction", "قسط وام" },
{ "SalaryAidDeduction", "مساعده" },
{ "AbsenceDeduction", "غیبت" },
{ "EarlyExitDeduction", "تعجیل در خروج" },
{ "LateToWorkDeduction", "تاخیر در ورود" },
{ "TotalClaims", "جمع مطالبات" },
{ "TotalDeductions", "جمع کسورات" },
{ "TotalPayment", "مبلغ قابل پرداخت" },
{ "CardNumber", "شماره کارت" },
{ "ShebaNumber", "شماره شبا" },
{ "BankAccountNumber", "شماره حساب" },
};
Dictionary<string, string> filteredHeaders;
if (!selectedParameters.Any())
{
filteredHeaders = headers;
}
else
{
// Filter headers based on selected parameters
filteredHeaders = headers.Where(h => selectedParameters.Contains(h.Key)).ToDictionary();
}
var indexCell = worksheet.Cells[1, 1];
indexCell.Value = "ردیف";
ApplyHeaderStyle(indexCell);
// Add headers to worksheet
for (int i = 0; i < filteredHeaders.Count; i++)
{
worksheet.Cells[1, i + 2].Value = filteredHeaders.ElementAt(i).Value;
ApplyHeaderStyle(worksheet.Cells[1, i + 2]);
}
var dataRow = 2;
foreach (var item in data)
{
var column = 2;
foreach (var header in filteredHeaders)
{
var property = item.GetType().GetProperty(header.Key);
var value = property.GetValue(item, null)?.ToString();
// Check if the property requires MoneyToDouble()
if (RequiresMoneyToDouble(property.Name))
{
worksheet.Cells[dataRow, column].Value = MoneyToDouble(value);
}
else
{
worksheet.Cells[dataRow, column].Value = value;
}
for (int i = 0; i < headers.Length; i++)
{
worksheet.Cells[1, i + 1].Value = headers[i];
}
ApplyGeneralDataStyle(worksheet.Cells[dataRow, column]);
ApplySpecificStyle(worksheet.Cells[dataRow, column], column); // Apply specific styles
column++;
}
var rowCounter = worksheet.Cells[dataRow, 1];
rowCounter.Value = dataRow - 1;
ApplyGeneralDataStyle(rowCounter);
ApplySpecificStyle(rowCounter, 1);
dataRow++;
}
worksheet.Cells[worksheet.Dimension.Address].AutoFitColumns();
worksheet.PrinterSettings.PaperSize = ePaperSize.A4;
worksheet.PrinterSettings.Orientation = eOrientation.Landscape;
worksheet.PrinterSettings.FitToPage = true;
worksheet.PrinterSettings.FitToWidth = 1;
worksheet.PrinterSettings.FitToHeight = 0;
worksheet.PrinterSettings.Scale = 85;
worksheet.View.RightToLeft = true;
// Lock cells A1 to H6
//worksheet.Cells.Style.Locked = false;
//worksheet.Cells["A1:AC1"].Style.Locked = true;
//// Set worksheet protection with password
return package.GetAsByteArray();
}
//worksheet.Protection.IsProtected = true;
//worksheet.Protection.SetPassword("Gozareshgir2049"); // Set your desired password here
// Method to check if a property requires MoneyToDouble()
private static bool RequiresMoneyToDouble(string propertyName)
{
var propertiesRequiringConversion = new HashSet<string>
{
"MonthlySalary", "RewardPay", "FridayPay", "OvertimePay", "ShiftPay", "NightWorkPay",
"MarriedAllowance", "FamilyAllowance", "BonusesPay", "BaseYearsPay", "LeavePay",
"AbsenceDeduction", "LateToWorkDeduction", "EarlyExitDeduction", "SalaryAidDeduction",
"InstallmentDeduction", "FineDeduction", "InsuranceDeduction", "TaxDeduction",
"TotalClaims", "TotalDeductions", "TotalPayment"
};
return propertiesRequiringConversion.Contains(propertyName);
}
//worksheet.Protection.AllowSelectLockedCells = true; // Unlock all other cells
// Placeholder for the MoneyToDouble() method
private static double MoneyToDouble(string value)
{
Console.WriteLine(value);
var min = value.Length>1? value.Substring(0, 2): "";
var test = min == "\u200e\u2212" ? value.MoneyToDouble() * -1 : value.MoneyToDouble();
using (var range = worksheet.Cells[1, 1, 1, 29])
{
range.Style.Font.Bold = true;
range.Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
range.Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.LightGray);
range.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
range.Style.Border.Right.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
range.Style.Border.Left.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
range.Style.Border.Bottom.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
range.Style.Border.Top.Style = OfficeOpenXml.Style.ExcelBorderStyle.Thin;
}
Console.WriteLine(test);
return test;
}
var dataRow = 2;
var numberFormat = "#,##0";
for (int i = 0; i < data.Count; i++)
{
var checkout = data[i];
worksheet.Cells[i + dataRow, 1].Value = i + 1;
worksheet.Cells[i + dataRow, 2].Value = checkout.Year;
worksheet.Cells[i + dataRow, 3].Value = checkout.Month;
worksheet.Cells[i + dataRow, 4].Value = checkout.EmployeeFullName;
worksheet.Cells[i + dataRow, 5].Value = checkout.PersonnelCodeString;
worksheet.Cells[i + dataRow, 6].Value = checkout.NationalCode;
worksheet.Cells[i + dataRow, 7].Value = checkout.SumOfWorkingDays;
worksheet.Cells[i + dataRow, 8].Value = checkout.MonthlySalary.MoneyToDouble();
worksheet.Cells[i + dataRow, 9].Value = checkout.RewardPay.MoneyToDouble();
worksheet.Cells[i + dataRow, 10].Value = checkout.FridayPay.MoneyToDouble();
worksheet.Cells[i + dataRow, 11].Value = checkout.OvertimePay.MoneyToDouble();
worksheet.Cells[i + dataRow, 12].Value = checkout.ShiftPay.MoneyToDouble();
worksheet.Cells[i + dataRow, 13].Value = checkout.NightworkPay.MoneyToDouble();
worksheet.Cells[i + dataRow, 14].Value = checkout.MarriedAllowance.MoneyToDouble();
worksheet.Cells[i + dataRow, 15].Value = checkout.FamilyAllowance.MoneyToDouble();
worksheet.Cells[i + dataRow, 16].Value = checkout.BonusesPay.MoneyToDouble();
worksheet.Cells[i + dataRow, 17].Value = checkout.BaseYearsPay.MoneyToDouble();
worksheet.Cells[i + dataRow, 18].Value = checkout.LeavePay.MoneyToDouble();
worksheet.Cells[i + dataRow, 19].Value = checkout.AbsenceDeduction.MoneyToDouble();
worksheet.Cells[i + dataRow, 20].Value = checkout.LateToWorkDeduction.MoneyToDouble();
worksheet.Cells[i + dataRow, 21].Value = checkout.EarlyExitDeduction.MoneyToDouble();
worksheet.Cells[i + dataRow, 22].Value = checkout.SalaryAidDeduction.MoneyToDouble();
worksheet.Cells[i + dataRow, 23].Value = checkout.InstallmentDeduction.MoneyToDouble();
worksheet.Cells[i + dataRow, 24].Value = checkout.FineDeduction.MoneyToDouble();
worksheet.Cells[i + dataRow, 25].Value = checkout.InsuranceDeduction.MoneyToDouble();
worksheet.Cells[i + dataRow, 26].Value = checkout.TaxDeducation.MoneyToDouble();
worksheet.Cells[i + dataRow, 27].Value = checkout.TotalClaims.MoneyToDouble();
worksheet.Cells[i + dataRow, 28].Value = checkout.TotalDeductions.MoneyToDouble();
worksheet.Cells[i + dataRow, 29].Value = checkout.TotalPayment.MoneyToDouble();
private static void ApplyHeaderStyle(ExcelRange cell)
{
cell.Style.Font.Bold = true;
cell.Style.Fill.PatternType = ExcelFillStyle.Solid;
cell.Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.LightGray);
cell.Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
cell.Style.Border.BorderAround(ExcelBorderStyle.Thin);
}
private static void ApplyGeneralDataStyle(ExcelRange cell)
{
cell.Style.Border.BorderAround(ExcelBorderStyle.Thin);
cell.Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
cell.Style.VerticalAlignment = ExcelVerticalAlignment.Center;
cell.Style.Fill.PatternType = ExcelFillStyle.Solid;
}
// Style data cells
for (int j = 1; j <= 29; j++)
{
var cell = worksheet.Cells[i + 2, j];
cell.Style.Border.BorderAround(OfficeOpenXml.Style.ExcelBorderStyle.Thin);
cell.Style.HorizontalAlignment = OfficeOpenXml.Style.ExcelHorizontalAlignment.Center;
cell.Style.VerticalAlignment = OfficeOpenXml.Style.ExcelVerticalAlignment.Center;
cell.Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid;
private static void ApplySpecificStyle(ExcelRange cell, int columnIndex)
{
switch (columnIndex)
{
case int n when (n >= 1 && n <= 8):
cell.Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.LightYellow);
break;
case int n when (n >= 9 && n <= 19):
cell.Style.Fill.BackgroundColor.SetColor(1, 208, 248, 208);
cell.Style.Numberformat.Format = "#,##0";
break;
case int n when (n >= 20 && n <= 27):
cell.Style.Fill.BackgroundColor.SetColor(1, 246, 176, 176);
cell.Style.Numberformat.Format = "#,##0";
break;
case 28:
cell.Style.Fill.BackgroundColor.SetColor(1, 169, 208, 142);
cell.Style.Numberformat.Format = "#,##0";
break;
case 29:
cell.Style.Fill.BackgroundColor.SetColor(1, 241, 143, 143);
cell.Style.Numberformat.Format = "#,##0";
break;
case 30:
cell.Style.Fill.BackgroundColor.SetColor(1, 168, 186, 254);
cell.Style.Numberformat.Format = "#,##0";
break;
case >= 31 and <= 33:
cell.Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.LightYellow);
break;
}
}
}
if (j >= 1 && j <= 7)
{
cell.Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.LightYellow);
}
else if (j >= 8 && j <= 18)
{
cell.Style.Fill.BackgroundColor.SetColor(1,208,248,208);
cell.Style.Numberformat.Format = numberFormat;
}
else if (j >= 19 && j <= 26)
{
cell.Style.Fill.BackgroundColor.SetColor(1,246,176,176);
cell.Style.Numberformat.Format = numberFormat;
}
switch (j)
{
//جمع مطالبات
case 27:
cell.Style.Fill.BackgroundColor.SetColor(1, 169, 208, 142);
cell.Style.Numberformat.Format = numberFormat;
break;
//جمع کسورات
case 28:
cell.Style.Fill.BackgroundColor.SetColor(1, 241, 143, 143);
cell.Style.Numberformat.Format = numberFormat;
break;
//مبلغ قابل پرداخت
case 29:
cell.Style.Fill.BackgroundColor.SetColor(1, 168, 186, 254);
cell.Style.Numberformat.Format = numberFormat;
break;
}
}
}
worksheet.Cells[worksheet.Dimension.Address].AutoFitColumns();
worksheet.PrinterSettings.PaperSize = ePaperSize.A4;
worksheet.PrinterSettings.Orientation = eOrientation.Landscape;
worksheet.PrinterSettings.FitToPage = true;
worksheet.PrinterSettings.FitToWidth = 1;
worksheet.PrinterSettings.FitToHeight = 0;
worksheet.PrinterSettings.Scale = 85; // Scale to fit content within A4 width
worksheet.View.RightToLeft = true;
worksheet.PrinterSettings.RepeatRows = new OfficeOpenXml.ExcelAddress("1:1"); // Repeat rows 1 to 6 on every page
return package.GetAsByteArray();
}
}

View File

@@ -48,5 +48,9 @@ public class CustomizeCheckoutTempExcelViewModel
public string TotalDeductions { get; set; }
public string TotalPayment { get; set; }
public string BankAccountNumber { get; set; }
public string CardNumber { get; set; }
public string ShebaNumber { get; set; }
}

View File

@@ -5,6 +5,7 @@ using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using OfficeOpenXml;
using OfficeOpenXml.Style;
using LicenseContext = OfficeOpenXml.LicenseContext;
@@ -198,5 +199,5 @@ public class ExcelGenerator
return resultList;
}
}

View File

@@ -0,0 +1,15 @@
using _0_Framework.Application;
using Microsoft.AspNetCore.Http;
using System.Collections.Generic;
namespace AccountManagement.Application.Contracts.Media
{
public interface IMediaApplication
{
MediaViewModel Get(long id);
OperationResult UploadFile(IFormFile file, string fileLabel, string relativePath, int maximumFileLength, List<string> allowedExtensions);
OperationResult MoveFile(long mediaId, string newRelativePath);
OperationResult DeleteFile(long mediaId);
List<MediaViewModel> GetRange(IEnumerable<long> select);
}
}

View File

@@ -0,0 +1,153 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using _0_Framework.Application;
using AccountManagement.Application.Contracts.Media;
using AccountManagement.Domain.MediaAgg;
using Microsoft.AspNetCore.Http;
namespace AccountManagement.Application
{
public class MediaApplication:IMediaApplication
{
private const string _basePath = "Medias";
private readonly IMediaRepository _mediaRepository;
public MediaApplication(IMediaRepository mediaRepository)
{
_mediaRepository = mediaRepository;
}
/// <summary>
/// دریافت فایل و نوشتن آن در مسیر داده شده، و ثبت مدیا
/// </summary>
/// <param name="file">فایل</param>
/// <param name="fileLabel">برچسب فایل که در نام فایل ظاهر می شود</param>
/// <param name="relativePath">مسیر فایل</param>
/// <param name="allowedExtensions">[.png,.jpg,.jpeg] پسوند های مجاز مثلا </param>
/// <param name="maximumFileLength">حداکثر حجم فایل به مگابایت</param>
/// <returns></returns>
public OperationResult UploadFile(IFormFile file, string fileLabel, string relativePath,int maximumFileLength,List<string> allowedExtensions)
{
OperationResult op = new();
var path = Path.Combine(_basePath, relativePath);
var fileExtension = Path.GetExtension(file.FileName);
if (file == null || file.Length == 0)
return op.Failed("خطای سیستمی");
if (file.Length > (maximumFileLength * 1024 * 1024))
return op.Failed($"حجم فایل نمی تواند بیشتر از " +
$"{maximumFileLength}" +
$"مگابایت باشد");
if (!allowedExtensions.Contains(fileExtension.ToLower()))
{
var operationMessage = ":فرمت فایل باید یکی از موارد زیر باشد";
operationMessage += "\n";
operationMessage += string.Join(" ", allowedExtensions);
return op.Failed(operationMessage);
}
Directory.CreateDirectory(path);
var extension = Path.GetExtension(file.FileName);
var uniqueFileName = $"{fileLabel}-{DateTime.Now.Ticks}{extension}";
var filePath = Path.Combine(path, uniqueFileName);
using (var fileStream = new FileStream(filePath, FileMode.CreateNew))
{
file.CopyTo(fileStream);
}
var mediaEntity = new Media(filePath, extension, "فایل", "EmployeeDocuments");
_mediaRepository.Create(mediaEntity);
_mediaRepository.SaveChanges();
return op.Succcedded(mediaEntity.id);
}
/// <summary>
/// حذف فایل
/// </summary>
public OperationResult DeleteFile(long mediaId)
{
OperationResult op = new();
var media = _mediaRepository.Get(mediaId);
if (media == null)
return op.Failed("رکورد مورد نظر یافت نشد");
try
{
if (File.Exists(media.Path))
File.Delete(media.Path);
else
return op.Failed("فایل یافت نشد");
}
catch
{
return op.Failed("خطایی در حذف فایل رخ داده است");
}
_mediaRepository.Remove(media.id);
_mediaRepository.SaveChanges();
return op.Succcedded();
}
/// <summary>
/// جابجا کردن فایل
/// </summary>
public OperationResult MoveFile(long mediaId, string newRelativePath)
{
OperationResult op = new();
var media = _mediaRepository.Get(mediaId);
var oldPath = media.Path;
var path = Path.Combine(_basePath, newRelativePath);
Directory.CreateDirectory(path);
string filepath = Path.Combine(path, Path.GetFileName(oldPath));
try
{
File.Move(oldPath, filepath);
}
catch
{
return op.Failed("در جابجایی فایل خطایی رخ داده است");
}
media.Edit(filepath, media.Type, media.Category);
_mediaRepository.SaveChanges();
return op.Succcedded();
}
public MediaViewModel Get(long id)
{
var media = _mediaRepository.Get(id);
return new MediaViewModel()
{
Category = media.Category,
Path = media.Path,
Id = media.id,
Type = media.Type
};
}
public List<MediaViewModel> GetRange(IEnumerable<long> ids)
{
var medias = _mediaRepository.GetRange(ids);
return medias.Select(x=>new MediaViewModel()
{
Category = x.Category,
Path = x.Path,
Id = x.id,
Type = x.Type,
}).ToList();
}
}
}

View File

@@ -943,7 +943,7 @@ public class TaskApplication : ITaskApplication
}
var type = Path.GetExtension(filepath);
var media = new Media(filepath, type, "فایل");
var media = new Media(filepath, type, "فایل", "Task");
_mediaRepository.Create(media);
_mediaRepository.SaveChanges();
return operation.Succcedded(media.id);

View File

@@ -461,7 +461,7 @@ public class TicketApplication : ITicketApplication
}
var type = Path.GetExtension(filepath);
var media = new Media(filepath, type, "فایل");
var media = new Media(filepath, type, "فایل", "Ticket");
_mediaRepository.Create(media);
_mediaRepository.SaveChanges();
return operation.Succcedded(media.id);

View File

@@ -1,6 +1,7 @@
using AccountManagement.Application;
using AccountManagement.Application.Contracts.Account;
using AccountManagement.Application.Contracts.CameraAccount;
using AccountManagement.Application.Contracts.Media;
using AccountManagement.Application.Contracts.Position;
using AccountManagement.Application.Contracts.Role;
using AccountManagement.Application.Contracts.SubAccount;
@@ -68,8 +69,9 @@ namespace AccountManagement.Configuration
services.AddTransient<IAssignRepository, AssignRepository>();
services.AddTransient<IMediaRepository, MediaRepository>();
services.AddTransient<IMediaApplication, MediaApplication>();
services.AddTransient<ITicketRepository, TicketRepository>();
services.AddTransient<ITicketRepository, TicketRepository>();
services.AddTransient<ITicketApplication, TicketApplication>();
services.AddTransient<ITaskMessageRepository, TaskMessageRepository>();

View File

@@ -10,8 +10,17 @@ public interface IMediaRepository:IRepository<long,Media>
void CreateMediaWithTaskMedia(long taskId, long mediaId);
List<MediaViewModel> GetMediaByTaskId(long taskId);
void Remove(long id);
void RemoveRange(IEnumerable<Media> medias);
void CreateTicketMedia(long ticketId, long mediaId);
void CreateAdminResponseMedia(long adminResponseId, long mediaId);
void CreateClientResponseMedia(long clientResponseId, long mediaId);
#region Pooya
List<MediaViewModel> GetMedias(List<long> ids);
List<Media> GetRange(IEnumerable<long> mediaIds);
#endregion
}

View File

@@ -1,20 +1,22 @@
using System.Collections.Generic;
using _0_Framework.Domain;
using _0_Framework.Domain;
using AccountManagement.Domain.AdminResponseMediaAgg;
using AccountManagement.Domain.ClientResponseMediaAgg;
using AccountManagement.Domain.TaskMediaAgg;
using AccountManagement.Domain.TicketMediasAgg;
using System.Collections.Generic;
namespace AccountManagement.Domain.MediaAgg;
public class Media : EntityBase
{
public Media(string path, string type, string category)
public Media(string path, string type, string category, string serviceName)
{
Path = path;
Type = type;
Category = category;
ServiceName = serviceName;
}
@@ -26,6 +28,10 @@ public class Media : EntityBase
//دسته بندی ذخیره فایل
public string Category { get; private set; }
//نام ماژولی که رکورد را ایجاد کرده
public string ServiceName { get; private set; }
public List<TaskMedia> TaskMedias { get; set; }
public List<AdminResponseMedia> AdminResponseMedias { get; set; }
public List<ClientResponseMedia> ClientResponseMedias { get; set; }
@@ -33,8 +39,8 @@ public class Media : EntityBase
public void Edit(string path, string type, string category)
{
Path = path;
Type = type;
Path = path;
Type = type;
Category = category;
}

View File

@@ -77,7 +77,7 @@ namespace AccountMangement.Infrastructure.EFCore
{
var assembly = typeof(AccountMapping).Assembly;
modelBuilder.ApplyConfigurationsFromAssembly(assembly);
// SubAccountPermissionSeeder.Seed(modelBuilder);
//SubAccountPermissionSeeder.Seed(modelBuilder);
base.OnModelCreating(modelBuilder);
}
}

View File

@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace AccountMangement.Infrastructure.EFCore.Mappings;
public class MediaMapping:IEntityTypeConfiguration<Media>
public class MediaMapping : IEntityTypeConfiguration<Media>
{
public void Configure(EntityTypeBuilder<Media> builder)
{
@@ -14,6 +14,7 @@ public class MediaMapping:IEntityTypeConfiguration<Media>
builder.Property(x => x.Path).HasColumnType("ntext");
builder.Property(x => x.Type).HasMaxLength(10);
builder.Property(x => x.Category).HasMaxLength(10);
builder.Property(x => x.ServiceName).HasMaxLength(50);

View File

@@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AccountMangement.Infrastructure.EFCore.Migrations
{
/// <inheritdoc />
public partial class AddServiceNameToMedia : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "ServiceName",
table: "Medias",
type: "nvarchar(50)",
maxLength: 50,
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ServiceName",
table: "Medias");
}
}
}

View File

@@ -355,6 +355,10 @@ namespace AccountMangement.Infrastructure.EFCore.Migrations
b.Property<string>("Path")
.HasColumnType("ntext");
b.Property<string>("ServiceName")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Type")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");

View File

@@ -13,17 +13,17 @@ namespace AccountMangement.Infrastructure.EFCore.Repository;
public class MediaRepository:RepositoryBase<long,Media>,IMediaRepository
{
private readonly AccountContext _taskManagerContext;
private readonly AccountContext _accountContext;
public MediaRepository( AccountContext taskManagerContext) : base(taskManagerContext)
{
_taskManagerContext = taskManagerContext;
_accountContext = taskManagerContext;
}
//ساخت جدول واسط بین مدیا و نسک
//نکته: این متد ذخیره انجام نمیدهد
public void CreateMediaWithTaskMedia(long taskId, long mediaId)
{
var Taskmedias = new TaskMedia(taskId,mediaId);
_taskManagerContext.Add(Taskmedias);
_accountContext.Add(Taskmedias);
}
public void Remove(long id)
{
@@ -34,24 +34,24 @@ public class MediaRepository:RepositoryBase<long,Media>,IMediaRepository
public void CreateTicketMedia(long ticketId, long mediaId)
{
var ticketMedias = new TicketMedia(ticketId, mediaId);
_taskManagerContext.Add(ticketMedias);
_accountContext.Add(ticketMedias);
}
public void CreateAdminResponseMedia(long adminResponseId, long mediaId)
{
var adminResMedia = new AdminResponseMedia(adminResponseId, mediaId);
_taskManagerContext.Add(adminResMedia);
_accountContext.Add(adminResMedia);
}
public void CreateClientResponseMedia(long clientResponseId, long mediaId)
{
var clientResMedia = new ClientResponseMedia(clientResponseId, mediaId);
_taskManagerContext.Add(clientResMedia);
_accountContext.Add(clientResMedia);
}
public List<MediaViewModel> GetMediaByTaskId(long taskId)
{
return _taskManagerContext.TaskMedias.Include(x => x.Media).Where(x => x.TaskId == taskId).Select(x =>
return _accountContext.TaskMedias.Include(x => x.Media).Where(x => x.TaskId == taskId).Select(x =>
new MediaViewModel()
{
Id = x.Media.id,
@@ -59,4 +59,24 @@ public class MediaRepository:RepositoryBase<long,Media>,IMediaRepository
Type = x.Media.Type,
}).ToList();
}
}
#region Pooya
public List<MediaViewModel> GetMedias(List<long> ids)
{
return _accountContext.Medias.Where(x => ids.Contains(x.id)).Select(x => new MediaViewModel()
{
Id = x.id,
Path = x.Path,
Category = x.Category,
Type = x.Type
}).ToList();
}
public List<Media> GetRange(IEnumerable<long> mediaIds)
{
return _accountContext.Medias.Where(x => mediaIds.Contains(x.id)).ToList();
}
}
#endregion

View File

@@ -0,0 +1,24 @@
using _0_Framework.Domain;
namespace Company.Domain.BankAgg
{
public class Bank : EntityBaseWithoutCreationDate
{
public string BankName { get; private set; }
public long BankLogoMediaId { get; private set; }
public Bank(string bankName, long bankLogoMediaId)
{
BankName = bankName;
BankLogoMediaId = bankLogoMediaId;
}
public void Edit(string bankName, long bankLogoMediaId)
{
BankName = bankName;
BankLogoMediaId = bankLogoMediaId;
}
}
}

View File

@@ -0,0 +1,12 @@
using System.Collections.Generic;
using _0_Framework.Domain;
using CompanyManagment.App.Contracts.Bank;
namespace Company.Domain.BankAgg
{
public interface IBankRepository:IRepository<long,Bank>
{
public void Remove(Bank entity);
List<BankViewModel> Search(string name);
}
}

View File

@@ -5,18 +5,20 @@ namespace Company.Domain.CustomizeCheckoutAgg.ValueObjects;
public class CustomizeCheckoutLoanInstallments
{
public CustomizeCheckoutLoanInstallments(string amountForMonth, string month, string year, IsActive isActive, string loanRemaining)
public CustomizeCheckoutLoanInstallments(string amountForMonth, string month, string year, IsActive isActive, string loanRemaining, string loanAmount)
{
AmountForMonth = amountForMonth;
Month = month;
Year = year;
IsActive = isActive;
LoanRemaining = loanRemaining;
LoanAmount = loanAmount;
}
public string AmountForMonth { get; private set; }
public string Month { get; private set; }
public string Year { get; private set; }
public string LoanRemaining { get; set; }
public string LoanAmount { get; set; }
public IsActive IsActive { get; private set; }
}

View File

@@ -4,13 +4,14 @@ namespace Company.Domain.CustomizeCheckoutTempAgg.ValueObjects;
public class CustomizeCheckoutTempLoanInstallments
{
public CustomizeCheckoutTempLoanInstallments(string amountForMonth, string month, string year, IsActive isActive, string loanRemaining)
public CustomizeCheckoutTempLoanInstallments(string amountForMonth, string month, string year, IsActive isActive, string loanRemaining, string loanAmount)
{
AmountForMonth = amountForMonth;
Month = month;
Year = year;
IsActive = isActive;
LoanRemaining = loanRemaining;
LoanAmount = loanAmount;
}
public string AmountForMonth { get; private set; }
@@ -18,4 +19,6 @@ public class CustomizeCheckoutTempLoanInstallments
public string Year { get; private set; }
public IsActive IsActive { get; private set; }
public string LoanRemaining { get; set; }
public string LoanAmount { get; set; }
}

View File

@@ -4,6 +4,7 @@ using _0_Framework.Domain;
using Company.Domain.ClientEmployeeWorkshopAgg;
using Company.Domain.ContractAgg;
using Company.Domain.CustomizeCheckoutAgg;
using Company.Domain.EmployeeBankInformationAgg;
using Company.Domain.EmployeeChildrenAgg;
using Company.Domain.EmployeeInsuranceRecordAgg;
using Company.Domain.InsuranceEmployeeInfoAgg;
@@ -129,6 +130,10 @@ public class Employee : EntityBase
public string FullName => $"{FName} {LName}";
#region Pooya
public List<EmployeeBankInformation> EmployeeBankInformationList { get; set; }
#endregion
//public List<Checkout> Checkouts { get; set; }
public Employee()
{

View File

@@ -0,0 +1,62 @@
using _0_Framework.Domain;
using Company.Domain.BankAgg;
using Company.Domain.EmployeeAgg;
namespace Company.Domain.EmployeeBankInformationAgg
{
public class EmployeeBankInformation : EntityBase
{
public long EmployeeId { get;private set; }
public long WorkshopId { get; private set; }
public Bank Bank { get; set; }
public long BankId { get; private set; }
/// <summary>
/// شماره حساب
/// </summary>
public string BankAccountNumber { get;private set; }
/// <summary>
/// شماره کارت
/// </summary>
public string CardNumber { get; private set; }
/// <summary>
/// شماره شبا
/// </summary>
public string ShebaNumber { get; private set; }
public bool IsDefault { get; private set; } = false;
//ONE TO MANY WITH EMPLOYEE
public Employee Employee { get; set; }
private EmployeeBankInformation()
{
}
public EmployeeBankInformation(long employeeId, long workshopId, long bankId, string bankAccountNumber, string cardNumber, string shebaNumber)
{
EmployeeId = employeeId;
WorkshopId = workshopId;
BankId = bankId;
BankAccountNumber = bankAccountNumber;
CardNumber = cardNumber;
ShebaNumber = shebaNumber;
}
public void Edit(long bankId, string bankAccountNumber, string cardNumber, string shebaNumber)
{
BankId = bankId;
BankAccountNumber = bankAccountNumber;
CardNumber = cardNumber;
ShebaNumber = shebaNumber;
}
public void SetDefault(bool setAsDefault = true)
{
IsDefault = setAsDefault;
}
}
}

View File

@@ -0,0 +1,20 @@
using _0_Framework.Domain;
using CompanyManagment.App.Contracts.EmployeeBankInformation;
using System.Collections.Generic;
namespace Company.Domain.EmployeeBankInformationAgg
{
public interface IEmployeeBankInformationRepository : IRepository<long, EmployeeBankInformation>
{
List<GroupedEmployeeBankInformationViewModel> Search(long workshopId, EmployeeBankInformationSearchModel searchParams);
void Remove(EmployeeBankInformation bankInformation);
GroupedEmployeeBankInformationViewModel GetByEmployeeId(long workshopId, long employeeId);
List<EmployeeBankInformation> GetRangeByEmployeeId(long workshopId, long employeeId);
void RemoveRange(List<EmployeeBankInformation> entities);
EmployeeBankInformationViewModel GetDetails(long id);
List<GroupedEmployeeBankInformationViewModel> GetAllByWorkshopId(long workshopId);
}
}

View File

@@ -0,0 +1,9 @@
namespace CompanyManagment.App.Contracts.Bank;
public class BankViewModel
{
public long Id { get; set; }
public string BankName { get; set; }
public string BankLogoPicturePath { get; set; }
public long BankLogoPictureMediaId { get; set; }
}

View File

@@ -0,0 +1,11 @@
using Microsoft.AspNetCore.Http;
namespace CompanyManagment.App.Contracts.Bank
{
public class CreateBank
{
public string BankName { get; set; }
public IFormFile BankLogoPictureFile { get; set; }
}
}

View File

@@ -0,0 +1,6 @@
namespace CompanyManagment.App.Contracts.Bank;
public class EditBank : CreateBank
{
public long Id { get; set; }
}

View File

@@ -0,0 +1,14 @@
using System.Collections.Generic;
using _0_Framework.Application;
namespace CompanyManagment.App.Contracts.Bank
{
public interface IBankApplication
{
BankViewModel GetBy(long id);
OperationResult Remove(long id);
OperationResult Create(CreateBank command);
OperationResult Edit(EditBank command);
List<BankViewModel> Search(string name);
}
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CompanyManagment.App.Contracts.EmployeeBankInformation
{
public class CreateEmployeeInformation
{
public long EmployeeId { get; set; }
public string EmployeeName { get; set; }
public long WorkshopId { get; set; }
public long BankId { get; set; }
//شماره حساب
public string BankAccountNumber { get; set; }
//شماره کارت
public string CardNumber { get; set; }
//شماره شبا
public string ShebaNumber { get; set; }
}
}

View File

@@ -0,0 +1,6 @@
namespace CompanyManagment.App.Contracts.EmployeeBankInformation;
public class EditEmployeeInformation:CreateEmployeeInformation
{
public long Id { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace CompanyManagment.App.Contracts.EmployeeBankInformation;
public class EmployeeBankInformationSearchModel
{
public long EmployeeId { get; set; }
public long BankId { get; set; }
}

View File

@@ -0,0 +1,17 @@
using System.Security.AccessControl;
namespace CompanyManagment.App.Contracts.EmployeeBankInformation;
public class EmployeeBankInformationViewModel
{
public long Id { get; set; }
public long EmployeeId { get; set; }
public string EmployeeName { get; set; }
public string BankName { get; set; }
public string BankLogoPath { get; set; }
public string CardNumber { get; set; }
public string ShebaNumber { get; set; }
public string BankAccountNumber { get; set; }
public bool IsDefault { get; set; }
public long BankId { get; set; }
}

View File

@@ -0,0 +1,21 @@
namespace CompanyManagment.App.Contracts.EmployeeBankInformation;
public class EmployeeInformationViewModel
{
public long EmployeeId { get; set; }
public string EmployeeName { get; set; }
public long WorkshopId { get; set; }
//نام بانک
public string BankName { get; set; }
//شماره حساب
public string BankAccountNumber { get; set; }
//شماره کارت
public string CardNumber { get; set; }
//شماره شبا
public string ShebaNumber { get; set; }
}

View File

@@ -0,0 +1,14 @@
using System.Collections.Generic;
namespace CompanyManagment.App.Contracts.EmployeeBankInformation;
public class GroupedEmployeeBankInformationViewModel
{
public long EmployeeId { get; set; }
public long WorkshopId { get; set; }
public string EmployeeName { get; set; }
public string PersonnelCode { get; set; }
public int TotalBankAccountsCount { get; set; }
public List<EmployeeBankInformationViewModel> BankInformation { get; set; }
public List<string> BankPicturesList { get; set; }
}

View File

@@ -0,0 +1,18 @@
using _0_Framework.Application;
using System.Collections.Generic;
namespace CompanyManagment.App.Contracts.EmployeeBankInformation
{
public interface IEmployeeBankInformationApplication
{
OperationResult Create(CreateEmployeeInformation command);
OperationResult Edit(EditEmployeeInformation command);
List<GroupedEmployeeBankInformationViewModel> Search(long workshopId, EmployeeBankInformationSearchModel searchParams);
GroupedEmployeeBankInformationViewModel GetByEmployeeId(long workshopId, long employeeId);
EmployeeBankInformationViewModel GetDetails(long id);
OperationResult Remove(long id);
OperationResult RemoveByEmployeeId(long workshopId, long employeeId);
List<GroupedEmployeeBankInformationViewModel> GetAllByWorkshopId(long workshopId);
OperationResult SetDefault(long workshopId, long bankInfoId);
}
}

View File

@@ -15,4 +15,5 @@ public class LoanInstallmentViewModel
public DateTime DateGr { get; set; }
public IsActive IsActive { get; set; }
public string RemainingAmount { get; set; }
public string LoanAmount { get; set; }
}

View File

@@ -0,0 +1,109 @@
using System.Collections.Generic;
using System.Linq;
using _0_Framework.Application;
using AccountManagement.Application.Contracts.Media;
using AccountManagement.Domain.MediaAgg;
using Company.Domain.BankAgg;
using CompanyManagment.App.Contracts.Bank;
namespace CompanyManagment.Application
{
public class BankApplication : IBankApplication
{
private readonly IBankRepository _bankRepository;
private readonly IMediaApplication _mediaApplication;
private const string _basePath = "BankLogos";
public BankApplication(IBankRepository bankRepository, IMediaApplication mediaApplication)
{
_bankRepository = bankRepository;
_mediaApplication = mediaApplication;
}
public BankViewModel GetBy(long id)
{
var entity = _bankRepository.Get(id);
if (entity == null)
return new();
var media = _mediaApplication.Get(entity.BankLogoMediaId);
return new BankViewModel()
{
Id = entity.id,
BankName = entity.BankName,
BankLogoPicturePath = media.Path
};
}
public OperationResult Remove(long id)
{
OperationResult op = new();
var entity = _bankRepository.Get(id);
if (entity == null)
return op.Failed(ApplicationMessages.RecordNotFound);
_bankRepository.Remove(entity);
_bankRepository.SaveChanges();
return op.Succcedded();
}
public OperationResult Create(CreateBank command)
{
OperationResult op = new();
if (string.IsNullOrWhiteSpace(command.BankName))
return op.Failed("فیلد نام بانک نمی تواند خالی باشد");
long mediaId = 0;
if(command.BankLogoPictureFile != null && command.BankLogoPictureFile.Length >0 )
{
var uploadResult = _mediaApplication.UploadFile(command.BankLogoPictureFile, command.BankName,
_basePath, 10, [".jpg", ".jpeg", ".png"]);
if (uploadResult.IsSuccedded == false)
return uploadResult;
mediaId = uploadResult.SendId;
}
var newEntity = new Bank(command.BankName, mediaId);
_bankRepository.Create(newEntity);
_bankRepository.SaveChanges();
return op.Succcedded();
}
public OperationResult Edit(EditBank command)
{
OperationResult op = new();
if (string.IsNullOrWhiteSpace(command.BankName))
return op.Failed("فیلد نام بانک نمی تواند خالی باشد");
var entity = _bankRepository.Get(command.Id);
if (entity == null)
return op.Failed(ApplicationMessages.RecordNotFound);
long mediaId = entity.BankLogoMediaId;
if (command.BankLogoPictureFile != null && command.BankLogoPictureFile.Length > 0)
{
var uploadResult = _mediaApplication.UploadFile(command.BankLogoPictureFile, command.BankName,
_basePath, 10, [".jpg", ".jpeg", ".png"]);
if (uploadResult.IsSuccedded == false)
return uploadResult;
_mediaApplication.DeleteFile(entity.BankLogoMediaId);
mediaId = uploadResult.SendId;
}
entity.Edit(command.BankName,mediaId);
_bankRepository.SaveChanges();
return op.Succcedded();
}
public List<BankViewModel> Search(string name)
{
var banks = _bankRepository.Search(name);
var medias = _mediaApplication.GetRange(banks.Select(x => x.Id));
return banks.Select(x=> new BankViewModel()
{
BankLogoPicturePath = medias.FirstOrDefault(y=>y.Id == x.BankLogoPictureMediaId)?.Path ??"",
BankName = x.BankName,
Id = x.Id
}).ToList();
}
}
}

View File

@@ -96,7 +96,7 @@ namespace CompanyManagment.Application
x.IsActive,x.Title)).ToList();
var loanInstallments = result.InstallmentViewModels.Select(x =>
new CustomizeCheckoutLoanInstallments(x.Amount, x.Month, x.Year, x.IsActive,x.RemainingAmount)).ToList();
new CustomizeCheckoutLoanInstallments(x.Amount, x.Month, x.Year, x.IsActive,x.RemainingAmount,x.LoanAmount)).ToList();
var salaryAids = result.SalaryAidViewModels.Select(x =>
new CustomizeCheckoutSalaryAid(x.Amount, x.SalaryAidDateTimeGe, x.SalaryAidDateTimeFa)).ToList();
@@ -150,7 +150,7 @@ namespace CompanyManagment.Application
x.IsActive,x.Title)).ToList();
var loanInstallments = computations.InstallmentViewModels.Select(x =>
new CustomizeCheckoutLoanInstallments(x.Amount, x.Month, x.Year, x.IsActive,x.RemainingAmount)).ToList();
new CustomizeCheckoutLoanInstallments(x.Amount, x.Month, x.Year, x.IsActive,x.RemainingAmount,x.LoanAmount)).ToList();
var salaryAids = computations.SalaryAidViewModels.Select(x =>
new CustomizeCheckoutSalaryAid(x.Amount, x.SalaryAidDateTimeGe, x.SalaryAidDateTimeFa)).ToList();

View File

@@ -79,7 +79,7 @@ namespace CompanyManagment.Application
x.IsActive,x.Title)).ToList();
var loanInstallments = result.InstallmentViewModels.Select(x =>
new CustomizeCheckoutTempLoanInstallments(x.Amount, x.Month, x.Year, x.IsActive, x.RemainingAmount)).ToList();
new CustomizeCheckoutTempLoanInstallments(x.Amount, x.Month, x.Year, x.IsActive, x.RemainingAmount,x.LoanAmount)).ToList();
var salaryAids = result.SalaryAidViewModels.Select(x =>
new CustomizeCheckoutTempSalaryAid(x.Amount, x.SalaryAidDateTimeGe, x.SalaryAidDateTimeFa)).ToList();
@@ -128,7 +128,7 @@ namespace CompanyManagment.Application
x.IsActive,x.Title)).ToList();
var loanInstallments = computations.InstallmentViewModels.Select(x =>
new CustomizeCheckoutTempLoanInstallments(x.Amount, x.Month, x.Year, x.IsActive, x.RemainingAmount)).ToList();
new CustomizeCheckoutTempLoanInstallments(x.Amount, x.Month, x.Year, x.IsActive, x.RemainingAmount, x.LoanAmount)).ToList();
var salaryAids = computations.SalaryAidViewModels.Select(x =>
new CustomizeCheckoutTempSalaryAid(x.Amount, x.SalaryAidDateTimeGe, x.SalaryAidDateTimeFa)).ToList();

View File

@@ -0,0 +1,207 @@
using _0_Framework.Application;
using Company.Domain.EmployeeBankInformationAgg;
using CompanyManagment.App.Contracts.EmployeeBankInformation;
using System.Collections.Generic;
using System.Linq;
namespace CompanyManagment.Application
{
public class EmployeeBankInformationApplication : IEmployeeBankInformationApplication
{
private readonly IEmployeeBankInformationRepository _employeeBankInformationRepository;
public EmployeeBankInformationApplication(IEmployeeBankInformationRepository employeeBankInformationRepository)
{
_employeeBankInformationRepository = employeeBankInformationRepository;
}
//todo: add CardNumber, BankAccountNumber, etc validations
public OperationResult Create(CreateEmployeeInformation command)
{
OperationResult op = new();
if (HasAtLeastOneFormFilled(command) == false)
return op.Failed("لطفا حداقل یکی از مشخصات بانکی را کامل کنید");
//if (_employeeBankInformationRepository.Exists(x =>
// x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId &&
// x.BankId == command.BankId))
// return op.Failed("این کاربر در بانک انتخاب شده حساب دارد");
if (!string.IsNullOrWhiteSpace(command.BankAccountNumber) && _employeeBankInformationRepository.Exists(x =>
x.WorkshopId == command.WorkshopId &&
x.BankAccountNumber == command.BankAccountNumber))
return op.Failed("این شماره حساب قبلا ثبت شده است");
if (!string.IsNullOrWhiteSpace(command.CardNumber) && _employeeBankInformationRepository.Exists(x =>
x.WorkshopId == command.WorkshopId &&
x.CardNumber == command.CardNumber))
return op.Failed("این شماره کارت قبلا ثبت شده است");
if (!string.IsNullOrWhiteSpace(command.ShebaNumber) && _employeeBankInformationRepository.Exists(x =>
x.WorkshopId == command.WorkshopId &&
x.ShebaNumber == command.ShebaNumber))
return op.Failed("این شماره شبا قبلا ثبت شده است");
var entity = new EmployeeBankInformation(command.EmployeeId, command.WorkshopId, command.BankId,
command.BankAccountNumber, command.CardNumber, command.ShebaNumber);
if(HasNoRecordInWorkshop(command.WorkshopId,command.EmployeeId))
entity.SetDefault();
_employeeBankInformationRepository.Create(entity);
_employeeBankInformationRepository.SaveChanges();
return op.Succcedded(entity.id);
}
public OperationResult SetDefault(long workshopId, long bankInfoId)
{
OperationResult op = new();
var entity = _employeeBankInformationRepository.Get(bankInfoId);
if (entity == null)
return op.Failed("خطای سیستمی");
var employeeRecordsInWorkshop =
_employeeBankInformationRepository.GetRangeByEmployeeId(workshopId, entity.EmployeeId);
if(employeeRecordsInWorkshop.Count > 1)
employeeRecordsInWorkshop.ForEach(x =>
{
if (x.id != entity.id)
x.SetDefault(false);
else
x.SetDefault();
});
_employeeBankInformationRepository.SaveChanges();
return op.Succcedded();
}
//todo: add CardNumber, BankAccountNumber, etc validations
public OperationResult Edit(EditEmployeeInformation command)
{
OperationResult op = new();
var entity = _employeeBankInformationRepository.Get(command.Id);
if (entity == null)
return op.Failed(ApplicationMessages.RecordNotFound);
if (HasAtLeastOneFormFilled(command) == false)
return op.Failed("لطفا حداقل یکی از مشخصات بانکی را کامل کنید");
//if (_employeeBankInformationRepository.Exists(x =>
// x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId &&
// x.BankId == command.BankId && x.id!= command.Id))
// return op.Failed("این کاربر در بانک انتخاب شده حساب دارد");
if (!string.IsNullOrWhiteSpace(command.BankAccountNumber) && _employeeBankInformationRepository.Exists(x =>
x.WorkshopId == command.WorkshopId &&
x.BankAccountNumber == command.BankAccountNumber && x.id != command.Id))
return op.Failed("این شماره حساب قبلا ثبت شده است");
if (!string.IsNullOrWhiteSpace(command.CardNumber) && _employeeBankInformationRepository.Exists(x =>
x.WorkshopId == command.WorkshopId &&
x.CardNumber == command.CardNumber && x.id != command.Id))
return op.Failed("این شماره کارت قبلا ثبت شده است");
if (!string.IsNullOrWhiteSpace(command.ShebaNumber) && _employeeBankInformationRepository.Exists(x =>
x.WorkshopId == command.WorkshopId &&
x.ShebaNumber == command.ShebaNumber && x.id != command.Id))
return op.Failed("این شماره شبا قبلا ثبت شده است");
entity.Edit(command.BankId, command.BankAccountNumber, command.CardNumber, command.ShebaNumber);
_employeeBankInformationRepository.SaveChanges();
return op.Succcedded();
}
public List<GroupedEmployeeBankInformationViewModel> Search(long workshopId, EmployeeBankInformationSearchModel searchParams)
{
return _employeeBankInformationRepository.Search(workshopId, searchParams);
}
public List<GroupedEmployeeBankInformationViewModel> GetAllByWorkshopId(long workshopId, EmployeeBankInformationSearchModel searchParams)
{
return _employeeBankInformationRepository.GetAllByWorkshopId(workshopId);
}
/// <summary>
/// دریافت مشخصات بانکی پرسنل
/// </summary>
/// <returns>تمامی رکورد های مربوط به پرسنل</returns>
public GroupedEmployeeBankInformationViewModel GetByEmployeeId(long workshopId, long employeeId)
{
var entity = _employeeBankInformationRepository.GetByEmployeeId(workshopId, employeeId);
if (entity == null)
return new();
return entity;
}
public EmployeeBankInformationViewModel GetDetails(long id)
{
return _employeeBankInformationRepository.GetDetails(id);
}
public OperationResult Remove(long id)
{
OperationResult op = new();
var entity = _employeeBankInformationRepository.Get(id);
if (entity == null)
return op.Failed(ApplicationMessages.RecordNotFound);
_employeeBankInformationRepository.Remove(entity);
_employeeBankInformationRepository.SaveChanges();
return op.Succcedded();
}
public OperationResult RemoveByEmployeeId(long workshopId, long employeeId)
{
OperationResult op = new();
var entities = _employeeBankInformationRepository.GetRangeByEmployeeId(workshopId, employeeId);
if (entities == null || !entities.Any())
return op.Failed(ApplicationMessages.RecordNotFound);
_employeeBankInformationRepository.RemoveRange(entities);
_employeeBankInformationRepository.SaveChanges();
return op.Succcedded();
}
public List<GroupedEmployeeBankInformationViewModel> GetAllByWorkshopId(long workshopId)
{
return _employeeBankInformationRepository.GetAllByWorkshopId(workshopId);
}
#region Private Methods
private bool HasAtLeastOneFormFilled(CreateEmployeeInformation inputs)
{
return !string.IsNullOrWhiteSpace(inputs.BankAccountNumber) ||
!string.IsNullOrWhiteSpace(inputs.CardNumber) ||
!string.IsNullOrWhiteSpace(inputs.ShebaNumber);
}
private bool HasNoRecordInWorkshop(long workshopId, long employeeId)
{
return !_employeeBankInformationRepository.Exists(x =>
x.WorkshopId == workshopId && x.EmployeeId == employeeId);
}
#endregion
}
}

View File

@@ -51,15 +51,15 @@ public class LoanApplication : ILoanApplication
var lastInstallment = installment.MaxBy(x => x.DateGr).DateGr;
#region Validation
if (startInstallmentDate.Date < now.Date)
{
return op.Failed("تاریخ شروع وام نمیتواند در گذشته باشد");
}
//if (startInstallmentDate.Date < now.Date)
//{
// return op.Failed("تاریخ شروع وام نمیتواند در گذشته باشد");
//}
if (loanGrantDate>now)
{
return op.Failed("تاریخ پرداخت وام می بایست تاریخ امروز یا قبل تر باشد");
}
//if (loanGrantDate>now)
//{
// return op.Failed("تاریخ پرداخت وام می بایست تاریخ امروز یا قبل تر باشد");
//}
if (!command.LoanGrantDate.TryToGeorgianDateTime(out var grantDate))
{
@@ -68,12 +68,12 @@ public class LoanApplication : ILoanApplication
if (amountD < 1000000)
return op.Failed("حداقل مبلغ وام 1.000.000 ریال میباشد");
if (_customizeCheckoutRepository.Exists(x =>
command.EmployeeIds.Contains(x.EmployeeId) && x.WorkshopId == command.WorkshopId &&
(x.ContractStart > startInstallmentDate && x.ContractStart < lastInstallment)))
{
return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی صادر شده است وام دهید");
}
//if (_customizeCheckoutRepository.Exists(x =>
// command.EmployeeIds.Contains(x.EmployeeId) && x.WorkshopId == command.WorkshopId &&
// (x.ContractStart > startInstallmentDate && x.ContractStart < lastInstallment)))
//{
// return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی صادر شده است وام دهید");
//}
#endregion

View File

@@ -1,4 +1,5 @@
using Company.Domain.AndroidApkVersionAgg;
using Company.Domain.BankAgg;
using Company.Domain.BillAgg;
using Company.Domain.Board;
using Company.Domain.BoardType;
@@ -22,6 +23,7 @@ using Company.Domain.DateSalaryAgg;
using Company.Domain.DateSalaryItemAgg;
using Company.Domain.EmployeeAccountAgg;
using Company.Domain.EmployeeAgg;
using Company.Domain.EmployeeBankInformationAgg;
using Company.Domain.EmployeeChildrenAgg;
using Company.Domain.EmployeeComputeOptionsAgg;
using Company.Domain.EmployeeInsuranceRecordAgg;
@@ -170,10 +172,13 @@ public class CompanyContext : DbContext
public DbSet<WorkshopSubAccount> WorkshopSubAccounts { get; set; }
#endregion
public DbSet<Bank> Banks { get; set; }
public DbSet<EmployeeBankInformation> EmployeeBankInformationSet { get; set; }
#endregion
public DbSet<CustomizeCheckout> CustomizeCheckouts { get; set; }
public DbSet<CustomizeCheckout> CustomizeCheckouts { get; set; }
public DbSet<CustomizeCheckoutTemp> CustomizeCheckoutTemps { get; set; }
public DbSet<TaxLeftWorkItem> TaxLeftWorkItems { get; set; }
public DbSet<TaxLeftWorkCategory> TaxLeftWorkCategories { get; set; }

View File

@@ -0,0 +1,15 @@
using Company.Domain.BankAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping
{
public class BankMapping : IEntityTypeConfiguration<Bank>
{
public void Configure(EntityTypeBuilder<Bank> builder)
{
builder.ToTable("Banks");
builder.Property(x => x.BankName).HasMaxLength(50);
}
}
}

View File

@@ -73,6 +73,7 @@ public class CustomizeCheckoutMapping : IEntityTypeConfiguration<CustomizeChecko
installments.Property(x => x.Year).HasMaxLength(4);
installments.Property(x => x.Month).HasMaxLength(2);
installments.Property(x => x.LoanRemaining).HasMaxLength(25);
installments.Property(x => x.LoanAmount).HasMaxLength(30);
});
builder.OwnsMany(x => x.CustomizeCheckoutSalaryAids, salaryAid =>

View File

@@ -73,7 +73,9 @@ public class CustomizeCheckoutTempMapping : IEntityTypeConfiguration<CustomizeCh
installments.Property(x => x.Year).HasMaxLength(4);
installments.Property(x => x.Month).HasMaxLength(2);
installments.Property(x => x.LoanRemaining).HasMaxLength(25);
});
installments.Property(x => x.LoanAmount).HasMaxLength(30);
});
builder.OwnsMany(x => x.CustomizeCheckoutSalaryAids, salaryAid =>
{

View File

@@ -0,0 +1,22 @@
using Company.Domain.EmployeeBankInformationAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping
{
public class EmployeeBankInformationMapping:IEntityTypeConfiguration<EmployeeBankInformation>
{
public void Configure(EntityTypeBuilder<EmployeeBankInformation> builder)
{
builder.ToTable("EmployeeBankInformationSet");
builder.Property(x => x.BankAccountNumber).HasMaxLength(20);
builder.Property(x => x.CardNumber).HasMaxLength(16);
builder.Property(x => x.ShebaNumber).HasMaxLength(26);
builder.HasOne(x => x.Employee).WithMany(x => x.EmployeeBankInformationList)
.HasForeignKey(x => x.EmployeeId);
}
}
}

View File

@@ -74,10 +74,12 @@ public class EmployeeMapping : IEntityTypeConfiguration<Employee>
.WithOne(x => x.Employee)
.HasForeignKey(x => x.EmployeeId);
#region Pooya
#region Pooya
builder.HasMany(x => x.EmployeeBankInformationList).WithOne(x => x.Employee)
.HasForeignKey(x => x.EmployeeId);
builder.Ignore(x => x.FullName);
builder.Ignore(x => x.FullName);
#endregion
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,81 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class EbiAdded : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Banks",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
BankName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
BankLogoMediaId = table.Column<long>(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Banks", x => x.id);
});
migrationBuilder.CreateTable(
name: "EmployeeBankInformationSet",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
EmployeeId = table.Column<long>(type: "bigint", nullable: false),
WorkshopId = table.Column<long>(type: "bigint", nullable: false),
BankId = table.Column<long>(type: "bigint", nullable: false),
BankAccountNumber = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
CardNumber = table.Column<string>(type: "nvarchar(16)", maxLength: 16, nullable: true),
ShebaNumber = table.Column<string>(type: "nvarchar(26)", maxLength: 26, nullable: true),
IsDefault = table.Column<bool>(type: "bit", nullable: false),
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_EmployeeBankInformationSet", x => x.id);
table.ForeignKey(
name: "FK_EmployeeBankInformationSet_Banks_BankId",
column: x => x.BankId,
principalTable: "Banks",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_EmployeeBankInformationSet_Employees_EmployeeId",
column: x => x.EmployeeId,
principalTable: "Employees",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_EmployeeBankInformationSet_BankId",
table: "EmployeeBankInformationSet",
column: "BankId");
migrationBuilder.CreateIndex(
name: "IX_EmployeeBankInformationSet_EmployeeId",
table: "EmployeeBankInformationSet",
column: "EmployeeId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "EmployeeBankInformationSet");
migrationBuilder.DropTable(
name: "Banks");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,40 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class addloanamounttocheckout : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "LoanAmount",
table: "CustomizeCheckoutTempLoanInstallments",
type: "nvarchar(30)",
maxLength: 30,
nullable: true);
migrationBuilder.AddColumn<string>(
name: "LoanAmount",
table: "CustomizeCheckoutLoanInstallments",
type: "nvarchar(30)",
maxLength: 30,
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "LoanAmount",
table: "CustomizeCheckoutTempLoanInstallments");
migrationBuilder.DropColumn(
name: "LoanAmount",
table: "CustomizeCheckoutLoanInstallments");
}
}
}

View File

@@ -59,6 +59,26 @@ namespace CompanyManagment.EFCore.Migrations
b.ToTable("AndroidApkVersions", (string)null);
});
modelBuilder.Entity("Company.Domain.BankAgg.Bank", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<long>("BankLogoMediaId")
.HasColumnType("bigint");
b.Property<string>("BankName")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.HasKey("id");
b.ToTable("Banks", (string)null);
});
modelBuilder.Entity("Company.Domain.BillAgg.EntityBill", b =>
{
b.Property<long>("id")
@@ -1513,6 +1533,50 @@ namespace CompanyManagment.EFCore.Migrations
b.ToTable("Employees", (string)null);
});
modelBuilder.Entity("Company.Domain.EmployeeBankInformationAgg.EmployeeBankInformation", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<string>("BankAccountNumber")
.HasMaxLength(20)
.HasColumnType("nvarchar(20)");
b.Property<long>("BankId")
.HasColumnType("bigint");
b.Property<string>("CardNumber")
.HasMaxLength(16)
.HasColumnType("nvarchar(16)");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<long>("EmployeeId")
.HasColumnType("bigint");
b.Property<bool>("IsDefault")
.HasColumnType("bit");
b.Property<string>("ShebaNumber")
.HasMaxLength(26)
.HasColumnType("nvarchar(26)");
b.Property<long>("WorkshopId")
.HasColumnType("bigint");
b.HasKey("id");
b.HasIndex("BankId");
b.HasIndex("EmployeeId");
b.ToTable("EmployeeBankInformationSet", (string)null);
});
modelBuilder.Entity("Company.Domain.EmployeeChildrenAgg.EmployeeChildren", b =>
{
b.Property<long>("id")
@@ -5511,6 +5575,10 @@ namespace CompanyManagment.EFCore.Migrations
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b1.Property<string>("LoanAmount")
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b1.Property<string>("LoanRemaining")
.HasMaxLength(25)
.HasColumnType("nvarchar(25)");
@@ -5692,6 +5760,10 @@ namespace CompanyManagment.EFCore.Migrations
.HasMaxLength(5)
.HasColumnType("nvarchar(5)");
b1.Property<string>("LoanAmount")
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b1.Property<string>("LoanRemaining")
.HasMaxLength(25)
.HasColumnType("nvarchar(25)");
@@ -7425,6 +7497,25 @@ namespace CompanyManagment.EFCore.Migrations
b.Navigation("Employee");
});
modelBuilder.Entity("Company.Domain.EmployeeBankInformationAgg.EmployeeBankInformation", b =>
{
b.HasOne("Company.Domain.BankAgg.Bank", "Bank")
.WithMany()
.HasForeignKey("BankId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Company.Domain.EmployeeAgg.Employee", "Employee")
.WithMany("EmployeeBankInformationList")
.HasForeignKey("EmployeeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Bank");
b.Navigation("Employee");
});
modelBuilder.Entity("Company.Domain.EmployeeChildrenAgg.EmployeeChildren", b =>
{
b.HasOne("Company.Domain.EmployeeAgg.Employee", "Employee")
@@ -8169,6 +8260,8 @@ namespace CompanyManagment.EFCore.Migrations
b.Navigation("CustomizeCheckouts");
b.Navigation("EmployeeBankInformationList");
b.Navigation("EmployeeChildrenList");
b.Navigation("EmployeeInsuranceRecords");

View File

@@ -0,0 +1,35 @@
using System.Collections.Generic;
using System.Linq;
using _0_Framework.InfraStructure;
using Company.Domain.BankAgg;
using CompanyManagment.App.Contracts.Bank;
using Microsoft.EntityFrameworkCore;
namespace CompanyManagment.EFCore.Repository
{
public class BankRepository:RepositoryBase<long,Bank>,IBankRepository
{
private readonly CompanyContext context;
public BankRepository(CompanyContext context) : base(context)
{
this.context = context;
}
public List<BankViewModel> Search(string name)
{
var query = context.Banks.AsQueryable();
if (!string.IsNullOrWhiteSpace(name))
query = query.Where(x => x.BankName.Contains(name));
return query.Select(x => new BankViewModel()
{
BankName = x.BankName,
Id = x.id,
BankLogoPictureMediaId = x.BankLogoMediaId
}).ToList();
}
}
}

View File

@@ -141,12 +141,14 @@ namespace CompanyManagment.EFCore.Repository
}).ToList(),
InstallmentViewModels = x.CustomizeCheckoutLoanInstallments.Select(i=>new LoanInstallmentViewModel()
{
Amount = i.AmountForMonth,
//موقتا مبلغ کل وام بجای قسط ارسال شده است
Amount = i.LoanAmount,
AmountDouble = i.AmountForMonth.MoneyToDouble(),
Year = i.Year,
Month = i.Month,
IsActive = i.IsActive,
RemainingAmount = i.LoanRemaining
RemainingAmount = i.LoanRemaining,
LoanAmount = i.LoanAmount
}).ToList(),
RewardViewModels = x.CustomizeCheckoutRewards.Select(r=>new RewardViewModel()
{

View File

@@ -276,13 +276,17 @@ namespace CompanyManagment.EFCore.Repository
}).ToList(),
InstallmentViewModels = x.CustomizeCheckoutLoanInstallments.Select(i => new LoanInstallmentViewModel()
{
Amount = i.AmountForMonth,
//موقتا مبلغ کل وام بجای قسط ارسال شده است
Amount = i.LoanAmount,
AmountDouble = i.AmountForMonth.MoneyToDouble(),
Year = i.Year,
Month = i.Month,
IsActive = i.IsActive,
RemainingAmount = i.LoanRemaining
}).ToList(),
RemainingAmount = i.LoanRemaining,
LoanAmount = i.LoanAmount
}).ToList(),
RewardViewModels = x.CustomizeCheckoutRewards.Select(r => new RewardViewModel()
{
IsActive = r.IsActive,

View File

@@ -0,0 +1,192 @@
using _0_Framework.InfraStructure;
using AccountMangement.Infrastructure.EFCore;
using Company.Domain.EmployeeBankInformationAgg;
using CompanyManagment.App.Contracts.EmployeeBankInformation;
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.Linq;
namespace CompanyManagment.EFCore.Repository
{
public class EmployeeBankInformationRepository : RepositoryBase<long, EmployeeBankInformation>, IEmployeeBankInformationRepository
{
private readonly CompanyContext _companyContext;
private readonly AccountContext _accountContext;
public EmployeeBankInformationRepository(CompanyContext context, CompanyContext companyContext, AccountContext accountContext) : base(context)
{
_companyContext = companyContext;
_accountContext = accountContext;
}
public List<GroupedEmployeeBankInformationViewModel> Search(long workshopId, EmployeeBankInformationSearchModel searchParams)
{
var bankInfoQuery = _companyContext.EmployeeBankInformationSet.Where(x => x.WorkshopId == workshopId)
.Include(x => x.Employee).Include(x => x.Bank)
.Select(x => new
{
x.Bank,
x.BankId,
FullName = (x.Employee.FName + " " + x.Employee.LName),
x.EmployeeId,
x.WorkshopId,
})
.AsQueryable();
if (searchParams.BankId > 0)
bankInfoQuery = bankInfoQuery.Where(x => x.BankId == searchParams.BankId);
if (searchParams.EmployeeId > 0)
bankInfoQuery = bankInfoQuery.Where(x => x.EmployeeId == searchParams.EmployeeId);
var personnelCodes =
_companyContext.PersonnelCodeSet.Where(x => bankInfoQuery.Any(y => y.EmployeeId == x.EmployeeId)).ToList();
var bankInfoList = bankInfoQuery.ToList();
var groupedBanks = bankInfoList.GroupBy(x => x.Bank).Select(x => x.Key).ToList();
//Get bank logos from account context
var mediaIds = groupedBanks.Select(x => x.BankLogoMediaId).ToList();
var banksLogos = _accountContext.Medias.Where(y => mediaIds.Contains(y.id))
.Select(media => new { media.Path, MediaId = media.id }).ToList();
return bankInfoList.GroupBy(x => x.EmployeeId).Select(x => new GroupedEmployeeBankInformationViewModel()
{
BankPicturesList = banksLogos.Select(y => y.Path).ToList(),
EmployeeId = x.Key,
WorkshopId = workshopId,
EmployeeName = x.FirstOrDefault()?.FullName ?? "",
TotalBankAccountsCount = x.Count(),
PersonnelCode = personnelCodes.FirstOrDefault(y => y.EmployeeId == x.Key)?.PersonnelCode.ToString() ?? "",
}).ToList();
}
public void RemoveByEmployeeId(IEnumerable<EmployeeBankInformation> entities)
{
_companyContext.EmployeeBankInformationSet.RemoveRange(entities);
}
public GroupedEmployeeBankInformationViewModel GetByEmployeeId(long workshopId, long employeeId)
{
//todo: optimize
var entities = _companyContext.EmployeeBankInformationSet
.Include(x => x.Bank).Include(x => x.Employee)
.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId);
var personnelCode =
_companyContext.PersonnelCodeSet.FirstOrDefault(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId)?
.PersonnelCode.ToString() ?? "";
var bankInfoList = entities.ToList();
var groupedBanks = bankInfoList.GroupBy(x => x.Bank).Select(x => x.Key).ToList();
var mediaIds = groupedBanks.Select(x => x.BankLogoMediaId).ToList();
var banksLogos = _accountContext.Medias.Where(y => mediaIds.Contains(y.id))
.Select(media => new { media.Path, MediaId = media.id }).ToList();
return new GroupedEmployeeBankInformationViewModel()
{
BankPicturesList = banksLogos.Select(y => y.Path).ToList(),
EmployeeId = employeeId,
WorkshopId = workshopId,
EmployeeName = entities.FirstOrDefault()?.Employee.FullName ?? "",
TotalBankAccountsCount = entities.Count(),
PersonnelCode = personnelCode,
BankInformation = entities.Select(y => new EmployeeBankInformationViewModel()
{
Id = y.id,
BankId = y.BankId,
BankAccountNumber = y.BankAccountNumber,
BankName = y.Bank.BankName,
CardNumber = y.CardNumber,
ShebaNumber = y.ShebaNumber,
IsDefault = y.IsDefault
}).OrderByDescending(y=>y.IsDefault).ToList()
};
}
public List<EmployeeBankInformation> GetRangeByEmployeeId(long workshopId, long employeeId)
{
return _companyContext.EmployeeBankInformationSet.Where(x =>
x.WorkshopId == workshopId && x.EmployeeId == employeeId).ToList();
}
public void RemoveRange(List<EmployeeBankInformation> entities)
{
_companyContext.EmployeeBankInformationSet.RemoveRange(entities);
}
public EmployeeBankInformationViewModel GetDetails(long id)
{
var entity = _companyContext.EmployeeBankInformationSet.Include(x => x.Bank)
.Include(x => x.Employee).FirstOrDefault(x => x.id == id);
if (entity == null)
return new();
var mediaId = entity.Bank.BankLogoMediaId;
var mediaPath = _accountContext.Medias.FirstOrDefault(x => x.id == mediaId)?.Path ?? "";
return new EmployeeBankInformationViewModel()
{
EmployeeId = entity.EmployeeId,
BankAccountNumber = entity.BankAccountNumber,
BankLogoPath = mediaPath,
BankName = entity.Bank.BankName,
CardNumber = entity.CardNumber,
EmployeeName = entity.Employee.FullName,
Id = entity.id,
ShebaNumber = entity.ShebaNumber,
IsDefault = entity.IsDefault
};
}
public List<GroupedEmployeeBankInformationViewModel> GetAllByWorkshopId(long workshopId)
{
//todo: optimize
var bankInfoQuery = _companyContext.EmployeeBankInformationSet.Where(x => x.WorkshopId == workshopId)
.Include(x => x.Employee).Include(x => x.Bank).AsQueryable();
var personnelCodes =
_companyContext.PersonnelCodeSet.Where(x => bankInfoQuery.Any(y => y.EmployeeId == x.EmployeeId));
var bankInfoList = bankInfoQuery.ToList();
//Get bank logos from account context
var groupedBanks = bankInfoList.GroupBy(x => x.Bank).Select(x => x.Key).ToList();
var mediaIds = groupedBanks.Select(x => x.BankLogoMediaId).ToList();
var banksLogos = _accountContext.Medias.Where(y => mediaIds.Contains(y.id))
.Select(media => new { media.Path, MediaId = media.id }).ToList();
return bankInfoQuery.GroupBy(x => x.Employee).Select(x => new GroupedEmployeeBankInformationViewModel()
{
BankPicturesList = banksLogos.Select(y => y.Path).ToList(),
EmployeeId = x.Key.id,
WorkshopId = workshopId,
EmployeeName = x.Key.FullName,
TotalBankAccountsCount = x.Count(),
PersonnelCode = personnelCodes.FirstOrDefault(y => y.EmployeeId == x.Key.id).PersonnelCode.ToString(),
BankInformation = x.OrderByDescending(y=>y.IsDefault).Select(y => new EmployeeBankInformationViewModel()
{
Id = y.id,
BankAccountNumber = y.BankAccountNumber,
BankName = y.Bank.BankName,
CardNumber = y.CardNumber,
ShebaNumber = y.ShebaNumber,
IsDefault = y.IsDefault,
}).ToList()
}).ToList();
}
}
}

View File

@@ -1864,7 +1864,8 @@ CreateWorkingHoursTemp command, long leavId)
Year = x.Year,
AmountDouble = x.AmountForMonth,
RemainingAmount = _context.Loans.SelectMany(l => l.LoanInstallments).Where(i => i.LoanId == x.LoanId && i.IsActive == IsActive.True && i.InstallmentDate > x.InstallmentDate)
.Sum(i => i.AmountForMonth).ToMoney()
.Sum(i => i.AmountForMonth).ToMoney(),
LoanAmount = _context.Loans.FirstOrDefault(l => l.id == x.LoanId).Amount.ToMoney()
}).ToList();
double loanDeduction = loanInstallments.Sum(x => x.AmountDouble);

View File

@@ -179,6 +179,7 @@ using CompanyManagment.App.Contracts.Loan;
using CompanyManagment.App.Contracts.Reward;
using CompanyManagment.App.Contracts.SalaryAid;
using Company.Domain.AndroidApkVersionAgg;
using Company.Domain.BankAgg;
using CompanyManagment.App.Contracts.AndroidApkVersion;
using Company.Domain.FineSubjectAgg;
using CompanyManagment.App.Contracts.FineSubject;
@@ -186,7 +187,10 @@ using Company.Domain.CustomizeCheckoutAgg;
using CompanyManagment.App.Contracts.CustomizeCheckout;
using Company.Domain.WorkshopSubAccountAgg;
using Company.Domain.CustomizeCheckoutTempAgg;
using Company.Domain.EmployeeBankInformationAgg;
using Company.Domain.RollCallAgg.DomainService;
using CompanyManagment.App.Contracts.Bank;
using CompanyManagment.App.Contracts.EmployeeBankInformation;
namespace PersonalContractingParty.Config;
@@ -406,6 +410,12 @@ public class PersonalBootstrapper
services.AddTransient<ICustomizeCheckoutTempApplication, CustomizeCheckoutTempApplication>();
services.AddTransient<IWorkshopSubAccountRepository, WorkshopSubAccountRepository>();
services.AddTransient<IBankRepository, BankRepository>();
services.AddTransient<IBankApplication, BankApplication>();
services.AddTransient<IEmployeeBankInformationRepository, EmployeeBankInformationRepository>();
services.AddTransient<IEmployeeBankInformationApplication, EmployeeBankInformationApplication>();
#endregion
services.AddTransient<IRollCallDomainService, RollCallDomainService>();

View File

@@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Mvc.RazorPages;
using System.Security.Claims;
using System.Text.RegularExpressions;
using _0_Framework.Excel.Checkout;
using CompanyManagment.App.Contracts.EmployeeBankInformation;
namespace ServiceHost.Areas.Client.Pages.Company.CustomizeCheckout
{
@@ -17,6 +18,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.CustomizeCheckout
private readonly IPasswordHasher _passwordHasher;
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly ICustomizeCheckoutTempApplication _customizeCheckoutTempApplication;
private readonly IEmployeeBankInformationApplication _employeeBankInformationApplication;
public long WorkshopId;
private readonly long _workshopId;
@@ -32,13 +34,14 @@ namespace ServiceHost.Areas.Client.Pages.Company.CustomizeCheckout
public CustomizeCheckoutBatchPrintViewModel sendIds;
public PrintAllCheckoutTemporaryModel(IPasswordHasher passwordHasher, IHttpContextAccessor httpContextAccessor, IWorkshopApplication workshopApplication, IYearlySalaryApplication yearlySalaryApplication, ICustomizeCheckoutTempApplication customizeCheckoutTempApplication)
public PrintAllCheckoutTemporaryModel(IPasswordHasher passwordHasher, IHttpContextAccessor httpContextAccessor, IWorkshopApplication workshopApplication, IYearlySalaryApplication yearlySalaryApplication, ICustomizeCheckoutTempApplication customizeCheckoutTempApplication, IEmployeeBankInformationApplication employeeBankInformationApplication)
{
_passwordHasher = passwordHasher;
_httpContextAccessor = httpContextAccessor;
_workshopApplication = workshopApplication;
_yearlySalaryApplication = yearlySalaryApplication;
_customizeCheckoutTempApplication = customizeCheckoutTempApplication;
_employeeBankInformationApplication = employeeBankInformationApplication;
var workshopHash = _httpContextAccessor.HttpContext?.User.FindFirstValue("WorkshopSlug");
_workshopId = _passwordHasher.SlugDecrypt(workshopHash);
@@ -240,47 +243,53 @@ namespace ServiceHost.Areas.Client.Pages.Company.CustomizeCheckout
public IActionResult OnGetDownloadExcelAll(string idList)
{
var ids = idList.ExtractNumbers();
var ids = idList.ExtractNumbers();
var res = _customizeCheckoutTempApplication.PrintAll(_workshopId, ids);
var bankInformation = _employeeBankInformationApplication.GetAllByWorkshopId(_workshopId);
var customizeCheckoutTempExcelViewModels = res.Select(x => new CustomizeCheckoutTempExcelViewModel()
var customizeCheckoutTempExcelViewModels = res.Select(x =>
{
EmployeeId = x.EmployeeId,
Month = x.Month,
Year = x.Year,
PersonnelCode = x.PersonnelCode,
MonthlySalary = x.MonthlySalary,
BaseYearsPay = x.BaseYearsPay,
OvertimePay = x.OvertimePay,
NightworkPay = x.NightworkPay,
FridayPay = x.FridayPay,
ShiftPay = x.ShiftPay,
FamilyAllowance = x.FamilyAllowance,
BonusesPay = x.BonusesPay,
LeavePay = x.LeavePay,
InsuranceDeduction = x.InsuranceDeduction,
TaxDeducation = x.TaxDeducation,
InstallmentDeduction = x.InstallmentDeduction,
SalaryAidDeduction = x.SalaryAidDeduction,
AbsenceDeduction = x.AbsenceDeduction,
TotalClaims = x.TotalClaims,
TotalDeductions = x.TotalDeductions,
TotalPayment = x.TotalPayment,
RewardPay = x.RewardPay,
MarriedAllowance = x.MarriedAllowance,
SumOfWorkingDays = x.SumOfWorkingDays,
NationalCode = x.NationalCode,
EmployeeFName = x.EmployeeFName,
EmployeeLName = x.EmployeeLName,
EarlyExitDeduction = x.EarlyExitDeduction,
LateToWorkDeduction = x.LateToWorkDeduction,
FineDeduction = x.FineDeduction,
var employeeBankInformation = bankInformation.FirstOrDefault(b => b.EmployeeId == x.EmployeeId)?.BankInformation.FirstOrDefault();
return new CustomizeCheckoutTempExcelViewModel()
{
EmployeeId = x.EmployeeId,
Month = x.Month,
Year = x.Year,
PersonnelCode = x.PersonnelCode,
MonthlySalary = x.MonthlySalary,
BaseYearsPay = x.BaseYearsPay,
OvertimePay = x.OvertimePay,
NightworkPay = x.NightworkPay,
FridayPay = x.FridayPay,
ShiftPay = x.ShiftPay,
FamilyAllowance = x.FamilyAllowance,
BonusesPay = x.BonusesPay,
LeavePay = x.LeavePay,
InsuranceDeduction = x.InsuranceDeduction,
TaxDeducation = x.TaxDeducation,
InstallmentDeduction = x.InstallmentDeduction,
SalaryAidDeduction = x.SalaryAidDeduction,
AbsenceDeduction = x.AbsenceDeduction,
TotalClaims = x.TotalClaims,
TotalDeductions = x.TotalDeductions,
TotalPayment = x.TotalPayment,
RewardPay = x.RewardPay,
MarriedAllowance = x.MarriedAllowance,
SumOfWorkingDays = x.SumOfWorkingDays,
NationalCode = x.NationalCode,
EmployeeFName = x.EmployeeFName,
EmployeeLName = x.EmployeeLName,
EarlyExitDeduction = x.EarlyExitDeduction,
LateToWorkDeduction = x.LateToWorkDeduction,
FineDeduction = x.FineDeduction,
BankAccountNumber = employeeBankInformation?.BankAccountNumber,
CardNumber = employeeBankInformation?.CardNumber,
ShebaNumber = employeeBankInformation?.ShebaNumber
};
}).ToList();
var excelBytes = CustomizeCheckoutExcelGenerator.GenerateCheckoutTempExcelInfo(customizeCheckoutTempExcelViewModels);
var excelBytes = CustomizeCheckoutExcelGenerator.GenerateCheckoutTempExcelInfo(customizeCheckoutTempExcelViewModels, []);
return File(excelBytes,
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",

View File

@@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using System.Security.Claims;
using System.Text.RegularExpressions;
using CompanyManagment.App.Contracts.EmployeeBankInformation;
namespace ServiceHost.Areas.Client.Pages.Company.CustomizeCheckout
{
@@ -18,6 +19,8 @@ namespace ServiceHost.Areas.Client.Pages.Company.CustomizeCheckout
private readonly IPasswordHasher _passwordHasher;
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly ICustomizeCheckoutApplication _customizeCheckoutApplication;
private readonly IEmployeeBankInformationApplication _employeeBankInformationApplication;
public long WorkshopId;
private readonly long _workshopId;
@@ -33,13 +36,14 @@ namespace ServiceHost.Areas.Client.Pages.Company.CustomizeCheckout
public CustomizeCheckoutBatchPrintViewModel sendIds;
public PrintAllCheckoutUnofficialModel(IPasswordHasher passwordHasher, IHttpContextAccessor httpContextAccessor, IWorkshopApplication workshopApplication, IYearlySalaryApplication yearlySalaryApplication, ICustomizeCheckoutApplication customizeCheckoutApplication)
public PrintAllCheckoutUnofficialModel(IPasswordHasher passwordHasher, IHttpContextAccessor httpContextAccessor, IWorkshopApplication workshopApplication, IYearlySalaryApplication yearlySalaryApplication, ICustomizeCheckoutApplication customizeCheckoutApplication, IEmployeeBankInformationApplication employeeBankInformationApplication)
{
_passwordHasher = passwordHasher;
_httpContextAccessor = httpContextAccessor;
_workshopApplication = workshopApplication;
_yearlySalaryApplication = yearlySalaryApplication;
_customizeCheckoutApplication = customizeCheckoutApplication;
_employeeBankInformationApplication = employeeBankInformationApplication;
var workshopHash = _httpContextAccessor.HttpContext?.User.FindFirstValue("WorkshopSlug");
_workshopId = _passwordHasher.SlugDecrypt(workshopHash);
@@ -240,44 +244,50 @@ namespace ServiceHost.Areas.Client.Pages.Company.CustomizeCheckout
{
var ids = idList.ExtractNumbers();
var res = _customizeCheckoutApplication.PrintAll(_workshopId, ids);
var bankInformation = _employeeBankInformationApplication.GetAllByWorkshopId(_workshopId);
var customizeCheckoutTempExcelViewModels = res.Select(x=> new CustomizeCheckoutTempExcelViewModel()
var customizeCheckoutTempExcelViewModels = res.Select(x=>
{
EmployeeId = x.EmployeeId,
Month = x.Month,
Year = x.Year,
PersonnelCode = x.PersonnelCode,
MonthlySalary = x.MonthlySalary,
BaseYearsPay = x.BaseYearsPay,
OvertimePay = x.OvertimePay,
NightworkPay = x.NightworkPay,
FridayPay = x.FridayPay,
ShiftPay = x.ShiftPay,
FamilyAllowance = x.FamilyAllowance,
BonusesPay = x.BonusesPay,
LeavePay = x.LeavePay,
InsuranceDeduction = x.InsuranceDeduction,
TaxDeducation = x.TaxDeducation,
InstallmentDeduction = x.InstallmentDeduction,
SalaryAidDeduction = x.SalaryAidDeduction,
AbsenceDeduction = x.AbsenceDeduction,
TotalClaims = x.TotalClaims,
TotalDeductions = x.TotalDeductions,
TotalPayment = x.TotalPayment,
RewardPay = x.RewardPay,
MarriedAllowance = x.MarriedAllowance,
SumOfWorkingDays = x.SumOfWorkingDays,
NationalCode = x.NationalCode,
EmployeeFName = x.EmployeeFName,
EmployeeLName = x.EmployeeLName,
EarlyExitDeduction = x.EarlyExitDeduction,
LateToWorkDeduction = x.LateToWorkDeduction,
FineDeduction = x.FineDeduction,
}).ToList();
var employeeBankInformation = bankInformation.FirstOrDefault(b => b.EmployeeId == x.EmployeeId)?.BankInformation.FirstOrDefault();
return new CustomizeCheckoutTempExcelViewModel()
{
EmployeeId = x.EmployeeId,
Month = x.Month,
Year = x.Year,
PersonnelCode = x.PersonnelCode,
MonthlySalary = x.MonthlySalary,
BaseYearsPay = x.BaseYearsPay,
OvertimePay = x.OvertimePay,
NightworkPay = x.NightworkPay,
FridayPay = x.FridayPay,
ShiftPay = x.ShiftPay,
FamilyAllowance = x.FamilyAllowance,
BonusesPay = x.BonusesPay,
LeavePay = x.LeavePay,
InsuranceDeduction = x.InsuranceDeduction,
TaxDeducation = x.TaxDeducation,
InstallmentDeduction = x.InstallmentDeduction,
SalaryAidDeduction = x.SalaryAidDeduction,
AbsenceDeduction = x.AbsenceDeduction,
TotalClaims = x.TotalClaims,
TotalDeductions = x.TotalDeductions,
TotalPayment = x.TotalPayment,
RewardPay = x.RewardPay,
MarriedAllowance = x.MarriedAllowance,
SumOfWorkingDays = x.SumOfWorkingDays,
NationalCode = x.NationalCode,
EmployeeFName = x.EmployeeFName,
EmployeeLName = x.EmployeeLName,
EarlyExitDeduction = x.EarlyExitDeduction,
LateToWorkDeduction = x.LateToWorkDeduction,
FineDeduction = x.FineDeduction,
BankAccountNumber = employeeBankInformation?.BankAccountNumber,
CardNumber = employeeBankInformation?.CardNumber,
ShebaNumber = employeeBankInformation?.ShebaNumber
};
}).ToList();
var excelBytes = CustomizeCheckoutExcelGenerator.GenerateCheckoutTempExcelInfo(customizeCheckoutTempExcelViewModels);
var excelBytes = CustomizeCheckoutExcelGenerator.GenerateCheckoutTempExcelInfo(customizeCheckoutTempExcelViewModels, []);
return File(excelBytes,
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",

View File

@@ -333,182 +333,181 @@
</div>
<div class="row" style="margin-top: 10px;padding: 0 12px;">
<fieldset style="border: 1px solid black !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; border-radius: 10px 10px 10px 10px; margin: 0px 0px; overflow: hidden; padding: 0; display: flex;width: 100%;">
@* <table style="/* table-layout: fixed; */width: 5%">
<div class="row" style="margin-top: 10px;padding: 0 12px;">
<fieldset style="border: 1px solid black !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; border-radius: 10px 10px 10px 10px; margin: 0px 0px; overflow: hidden; padding: 0; display: flex;width: 100%;">
@* <table style="/* table-layout: fixed; */width: 5%">
<tr style="text-align: center; font-size: 10px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-left: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th cstyle="height: 24px;"></th>
</tr>
<tr style="text-align: center; font-size: 10px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-left: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th cstyle="height: 24px;"></th>
</tr>
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 10px; height: 24px;">
<th style="border-left: 1px solid black; text-align: center; padding: 2px 4px;">ردیف</th>
</tr>
@for (int i = 0; i < 5; i++)
{
<tr class="trTable" style="text-align: right; font-size: 10px; border-left: 1px solid black; height: 24px;">
<th style="text-align: center; padding: 2px 4px;">
@(indexTable = indexTable + 1)
</th>
</tr>
}
</table> *@
<div class="table-container">
<table>
<colgroup>
<col style="width: 30%;">
<col style="width: 40%;">
<col style="width: 30%;">
</colgroup>
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 10px; height: 24px;">
<th style="border-left: 1px solid black; text-align: center; padding: 2px 4px;">ردیف</th>
</tr>
@for (int i = 0; i < 5; i++)
{
<tr class="trTable" style="text-align: right; font-size: 10px; border-left: 1px solid black; height: 24px;">
<th style="text-align: center; padding: 2px 4px;">
@(indexTable = indexTable + 1)
</th>
</tr>
}
</table> *@
<div class="table-container">
<table>
<colgroup>
<col style="width: 30%;">
<col style="width: 40%;">
<col style="width: 30%;">
</colgroup>
<tr style="text-align: center; font-size: 9px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-left: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th colspan="3">جریمه ها</th>
</tr>
<tr style="text-align: center; font-size: 9px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-left: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th colspan="3">جریمه ها</th>
</tr>
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 9px; height: 24px;">
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:3rem;">تاریخ</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:4rem;">عنوان</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:3rem;">مبلغ</th>
</tr>
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 9px; height: 24px;">
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:3rem;">تاریخ</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:4rem;">عنوان</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:3rem;">مبلغ</th>
</tr>
@for (int i = 0; i < 7; i++)
{
<tr class="trTable" style="text-align: right; font-size: 9px; height: 24px;border-left: 1px solid black">
<td style="padding: 2px 4px;text-align: center;border-left: 1px solid black; white-space: nowrap;overflow: hidden !important;text-overflow: ellipsis;">
@for (int i = 0; i < 7; i++)
{
<tr class="trTable" style="text-align: right; font-size: 9px; height: 24px;border-left: 1px solid black">
<td style="padding: 2px 4px;text-align: center;border-left: 1px solid black; white-space: nowrap;overflow: hidden !important;text-overflow: ellipsis;">
@(Model.FineViewModelList != null && i < Model.FineViewModelList.Count
? Model.FineViewModelList[i]?.FineDate ?? ""
: "")
</td>
<td style="padding: 2px 4px;border-left: 1px solid black; white-space: nowrap;overflow: hidden !important;text-overflow: ellipsis;">
<div style="display: inline-block;width: 4rem; white-space: nowrap; overflow: hidden !important; text-overflow: ellipsis;">
@(Model.FineViewModelList != null && i < Model.FineViewModelList.Count
? Model.FineViewModelList[i]?.FineDate ?? ""
? Model.FineViewModelList[i]?.Title ?? ""
: "")
</td>
<td style="padding: 2px 4px;border-left: 1px solid black; white-space: nowrap;overflow: hidden !important;text-overflow: ellipsis;">
<div style="display: inline-block;width: 4rem; white-space: nowrap; overflow: hidden !important; text-overflow: ellipsis;">
@(Model.FineViewModelList != null && i < Model.FineViewModelList.Count
? Model.FineViewModelList[i]?.Title ?? ""
: "")
</div>
</td>
<td style="padding: 2px 4px; text-align: center;">
@(Model.FineViewModelList != null && i < Model.FineViewModelList.Count
? Model.FineViewModelList[i]?.Amount ?? ""
</div>
</td>
<td style="padding: 2px 4px; text-align: center;">
@(Model.FineViewModelList != null && i < Model.FineViewModelList.Count
? Model.FineViewModelList[i]?.Amount ?? ""
: "")
</td>
</tr>
}
</table>
<table>
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<tr style="border-left: 1px solid black;text-align: center; font-size: 9px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th colspan="3">مساعده</th>
</tr>
<tr style="border-bottom: 1px solid;border-left: 1px solid black; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 9px; height: 24px;">
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black;min-width:3rem;">تاریخ</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black;min-width:4rem;">مبلغ</th>
</tr>
@for (int i = 0; i < 7; i++)
{
<tr class="trTable" style="text-align: right; font-size: 10px; height: 24px;">
<td style="padding: 2px 4px; text-align: center;border-left: 1px solid black">
@(Model.SalaryAidViewModels != null && i < Model.SalaryAidViewModels.Count
? Model.SalaryAidViewModels[i]?.SalaryAidDateTimeFa ?? ""
: "")
</td>
<td style="padding: 2px 4px; text-align: center;border-left: 1px solid black">
@(Model.SalaryAidViewModels != null && i < Model.SalaryAidViewModels.Count
? Model.SalaryAidViewModels[i]?.Amount ?? ""
: "")
</td>
</tr>
}
</table>
<table>
<colgroup>
<col style="width: 40%;">
<col style="width: 60%;">
</colgroup>
<tr style="border-left: 1px solid black;text-align: center; font-size: 9px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th colspan="3" style="text-align: center">وام</th>
</tr>
<tr style="border-left: 1px solid black;border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 9px; height: 24px;">
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:4rem;">مبلغ کل وام</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:4rem;">مبلغ باقیمانده وام</th>
</tr>
@for (int i = 0; i < 7; i++)
{
<tr class="trTable" style="text-align: right; font-size: 9px;border-left: 1px solid black; height: 24px;">
<td style="padding: 2px 4px; text-align: center;border-left: 1px solid black">
@(Model.InstallmentViewModels != null && i < Model.InstallmentViewModels.Count
? Model.InstallmentViewModels[i]?.Amount ?? ""
: "")
</td>
<td style="padding: 2px 4px; text-align: center;">
@(Model.InstallmentViewModels != null && i < Model.InstallmentViewModels.Count
? Model.InstallmentViewModels[i]?.RemainingAmount ?? ""
: "")
</td>
</tr>
}
</table>
<table>
<colgroup>
<col style="width: 30%;">
<col style="width: 40%;">
<col style="width: 30%;">
</colgroup>
<tr style="text-align: center; font-size: 9px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th colspan="3">پاداش</th>
</tr>
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 10px; height: 24px;">
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:3rem;">تاریخ</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:4rem;">عنوان</th>
<th style="padding: 2px 4px; text-align: center; min-width:80px;">مبلغ</th>
</tr>
@for (int i = 0; i < 7; i++)
{
<tr class="trTable" style="text-align: right; font-size: 9px; height: 24px;">
<td style="padding: 2px 4px; text-align: center;border-left: 1px solid black">
@(Model.RewardViewModels != null && i < Model.RewardViewModels.Count
? Model.RewardViewModels[i]?.GrantDateFa ?? ""
: "")
</td>
<td style="padding: 2px 4px; text-align: right;border-left: 1px solid black; white-space: nowrap;overflow: hidden !important;text-overflow: ellipsis;">
<div style="display: inline-block;width: 4rem; white-space: nowrap; overflow: hidden !important; text-overflow: ellipsis;">
@(Model.RewardViewModels != null && i < Model.RewardViewModels.Count
? Model.RewardViewModels[i]?.Title ?? "-"
: "")
</td>
</tr>
}
</table>
<table>
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<tr style="border-left: 1px solid black;text-align: center; font-size: 9px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th colspan="3">مساعده</th>
</div>
</td>
<td style="padding: 2px 4px; text-align: center;">
@(Model.RewardViewModels != null && i < Model.RewardViewModels.Count
? Model.RewardViewModels[i]?.Amount ?? ""
: "")
</td>
</tr>
}
<tr style="border-bottom: 1px solid;border-left: 1px solid black; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 9px; height: 24px;">
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black;min-width:3rem;">تاریخ</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black;min-width:4rem;">مبلغ</th>
</tr>
@for (int i = 0; i < 7; i++)
{
<tr class="trTable" style="text-align: right; font-size: 10px; height: 24px;">
<td style="padding: 2px 4px; text-align: center;border-left: 1px solid black">
@(Model.SalaryAidViewModels != null && i < Model.SalaryAidViewModels.Count
? Model.SalaryAidViewModels[i]?.SalaryAidDateTimeFa ?? ""
: "")
</td>
<td style="padding: 2px 4px; text-align: center;border-left: 1px solid black">
@(Model.SalaryAidViewModels != null && i < Model.SalaryAidViewModels.Count
? Model.SalaryAidViewModels[i]?.Amount ?? ""
: "")
</td>
</tr>
}
</table>
<table>
<colgroup>
<col style="width: 40%;">
<col style="width: 60%;">
</colgroup>
<tr style="border-left: 1px solid black;text-align: center; font-size: 9px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th colspan="3" style="text-align: center">وام</th>
</tr>
<tr style="border-left: 1px solid black;border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 9px; height: 24px;">
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:4rem;">مبلغ کل وام</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:4rem;">مبلغ باقیمانده وام</th>
</tr>
@for (int i = 0; i < 7; i++)
{
<tr class="trTable" style="text-align: right; font-size: 9px;border-left: 1px solid black; height: 24px;">
<td style="padding: 2px 4px; text-align: center;border-left: 1px solid black">
@(Model.InstallmentViewModels != null && i < Model.InstallmentViewModels.Count
? Model.InstallmentViewModels[i]?.Amount ?? ""
: "")
</td>
<td style="padding: 2px 4px; text-align: center;">
@(Model.InstallmentViewModels != null && i < Model.InstallmentViewModels.Count
? Model.InstallmentViewModels[i]?.RemainingAmount ?? ""
: "")
</td>
</tr>
}
</table>
<table>
<colgroup>
<col style="width: 30%;">
<col style="width: 40%;">
<col style="width: 30%;">
</colgroup>
<tr style="text-align: center; font-size: 9px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th colspan="3">پاداش</th>
</tr>
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 10px; height: 24px;">
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:3rem;">تاریخ</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:4rem;">عنوان</th>
<th style="padding: 2px 4px; text-align: center; min-width:80px;">مبلغ</th>
</tr>
@for (int i = 0; i < 7; i++)
{
<tr class="trTable" style="text-align: right; font-size: 9px; height: 24px;">
<td style="padding: 2px 4px; text-align: center;border-left: 1px solid black">
@(Model.RewardViewModels != null && i < Model.RewardViewModels.Count
? Model.RewardViewModels[i]?.GrantDateFa ?? ""
: "")
</td>
<td style="padding: 2px 4px; text-align: right;border-left: 1px solid black; white-space: nowrap;overflow: hidden !important;text-overflow: ellipsis;">
<div style="display: inline-block;width: 4rem; white-space: nowrap; overflow: hidden !important; text-overflow: ellipsis;">
@(Model.RewardViewModels != null && i < Model.RewardViewModels.Count
? Model.RewardViewModels[i]?.Title ?? "-"
: "")
</div>
</td>
<td style="padding: 2px 4px; text-align: center;">
@(Model.RewardViewModels != null && i < Model.RewardViewModels.Count
? Model.RewardViewModels[i]?.Amount ?? ""
: "")
</td>
</tr>
}
</table>
</div>
</fieldset>
</div>
</table>
</div>
</fieldset>
</div>
</fieldset>

View File

@@ -15,6 +15,23 @@
.trTable:nth-child(even) {
background-color: #f1f1f1 !important;
}
.table-container {
display: flex;
width: 100%;
justify-content: space-between;
}
.table-container table {
flex: 1; /*Ensures equal width */
}
table {
width: 100%;
max-width: 100%;
table-layout: auto;
}
@@media print {
#printSize {
width: 20cm !important;
@@ -316,47 +333,57 @@
</div>
</div>
</div>
<div class="row" style="margin-top: 10px;padding: 0 12px;">
<fieldset style="border: 1px solid black !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; border-radius: 10px 10px 10px 10px; margin: 0px 0px; overflow: hidden; padding: 0; display: flex;width: 100%;">
@* <table style="/* table-layout: fixed; */width: 5%">
<tr style="text-align: center; font-size: 10px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-left: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th cstyle="height: 24px;"></th>
</tr>
<tr style="text-align: center; font-size: 10px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-left: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th cstyle="height: 24px;"></th>
</tr>
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 10px; height: 24px;">
<th style="border-left: 1px solid black; text-align: center; padding: 2px 4px;">ردیف</th>
</tr>
@for (int i = 0; i < 5; i++)
{
<tr class="trTable" style="text-align: right; font-size: 10px; border-left: 1px solid black; height: 24px;">
<th style="text-align: center; padding: 2px 4px;">
@(indexTable = indexTable + 1)
</th>
</tr>
}
</table> *@
<table style="/* table-layout: fixed; */width: 25%">
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 10px; height: 24px;">
<th style="border-left: 1px solid black; text-align: center; padding: 2px 4px;">ردیف</th>
</tr>
@for (int i = 0; i < 5; i++)
{
<tr class="trTable" style="text-align: right; font-size: 10px; border-left: 1px solid black; height: 24px;">
<th style="text-align: center; padding: 2px 4px;">
@(indexTable = indexTable + 1)
</th>
</tr>
}
</table> *@
<tr style="text-align: center; font-size: 10px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-left: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<div class="table-container">
<table>
<colgroup>
<col style="width: 30%;">
<col style="width: 40%;">
<col style="width: 30%;">
</colgroup>
<tr style="text-align: center; font-size: 9px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-left: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th colspan="3">جریمه ها</th>
</tr>
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 10px; height: 24px;">
<th style="padding: 2px 4px; text-align: center;border-left: 1px solid black;">عنوان</th>
<th style="padding: 2px 4px; text-align: center;border-left: 1px solid black">مبلغ</th>
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 9px; height: 24px;">
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:3rem;">تاریخ</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:4rem;">عنوان</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:3rem;">مبلغ</th>
</tr>
@for (int i = 0; i < 7; i++)
{
<tr class="trTable" style="text-align: right; font-size: 10px; height: 24px;border-left: 1px solid black">
<tr class="trTable" style="text-align: right; font-size: 9px; height: 24px;border-left: 1px solid black">
<td style="padding: 2px 4px;text-align: center;border-left: 1px solid black; white-space: nowrap;overflow: hidden !important;text-overflow: ellipsis;">
@(Model.FineViewModelList != null && i < Model.FineViewModelList.Count
? Model.FineViewModelList[i]?.FineDate ?? ""
: "")
</td>
<td style="padding: 2px 4px;border-left: 1px solid black; white-space: nowrap;overflow: hidden !important;text-overflow: ellipsis;">
<div style="display: inline-block;width: 110px; white-space: nowrap; overflow: hidden !important; text-overflow: ellipsis;">
<div style="display: inline-block;width: 4rem; white-space: nowrap; overflow: hidden !important; text-overflow: ellipsis;">
@(Model.FineViewModelList != null && i < Model.FineViewModelList.Count
? Model.FineViewModelList[i]?.Title ?? ""
: "")
@@ -372,15 +399,19 @@
</table>
<table style="/* table-layout: fixed; */width: 25%">
<table>
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<tr style="border-left: 1px solid black;text-align: center; font-size: 10px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<tr style="border-left: 1px solid black;text-align: center; font-size: 9px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th colspan="3">مساعده</th>
</tr>
<tr style="border-bottom: 1px solid;border-left: 1px solid black; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 10px; height: 24px;">
<th style="padding: 2px 4px; text-align: center;border-left: 1px solid black">تاریخ</th>
<th style="padding: 2px 4px; text-align: center;border-left: 1px solid black">مبلغ</th>
<tr style="border-bottom: 1px solid;border-left: 1px solid black; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 9px; height: 24px;">
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black;min-width:3rem;">تاریخ</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black;min-width:4rem;">مبلغ</th>
</tr>
@for (int i = 0; i < 7; i++)
@@ -401,20 +432,24 @@
</table>
<table style="/* table-layout: fixed; */width: 25%">
<table>
<colgroup>
<col style="width: 40%;">
<col style="width: 60%;">
</colgroup>
<tr style="border-left: 1px solid black;text-align: center; font-size: 10px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<tr style="border-left: 1px solid black;text-align: center; font-size: 9px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th colspan="3" style="text-align: center">وام</th>
</tr>
<tr style="border-left: 1px solid black;border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 10px; height: 24px;">
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black">مبلغ کل وام</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black">مبلغ باقیمانده وام</th>
<tr style="border-left: 1px solid black;border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 9px; height: 24px;">
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:4rem;">مبلغ کل وام</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:4rem;">مبلغ باقیمانده وام</th>
</tr>
@for (int i = 0; i < 7; i++)
{
<tr class="trTable" style="text-align: right; font-size: 10px;border-left: 1px solid black; height: 24px;">
<tr class="trTable" style="text-align: right; font-size: 9px;border-left: 1px solid black; height: 24px;">
<td style="padding: 2px 4px; text-align: center;border-left: 1px solid black">
@(Model.InstallmentViewModels != null && i < Model.InstallmentViewModels.Count
? Model.InstallmentViewModels[i]?.Amount ?? ""
@@ -430,28 +465,33 @@
</table>
<table style="/* table-layout: fixed; */width: 25%">
<table>
<colgroup>
<col style="width: 30%;">
<col style="width: 40%;">
<col style="width: 30%;">
</colgroup>
<tr style="text-align: center; font-size: 10px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<tr style="text-align: center; font-size: 9px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th colspan="3">پاداش</th>
</tr>
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 10px; height: 24px;">
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black">تاریخ</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black">عنوان</th>
<th style="padding: 2px 4px; text-align: center;">مبلغ</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:3rem;">تاریخ</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:4rem;">عنوان</th>
<th style="padding: 2px 4px; text-align: center; min-width:80px;">مبلغ</th>
</tr>
@for (int i = 0; i < 7; i++)
{
<tr class="trTable" style="text-align: right; font-size: 10px; height: 24px;">
<tr class="trTable" style="text-align: right; font-size: 9px; height: 24px;">
<td style="padding: 2px 4px; text-align: center;border-left: 1px solid black">
@(Model.RewardViewModels != null && i < Model.RewardViewModels.Count
? Model.RewardViewModels[i]?.GrantDateFa ?? ""
: "")
</td>
<td style="padding: 2px 4px; text-align: center;border-left: 1px solid black; white-space: nowrap;overflow: hidden !important;text-overflow: ellipsis;">
<div style="display: inline-block;width: 110px; white-space: nowrap; overflow: hidden !important; text-overflow: ellipsis;">
<td style="padding: 2px 4px; text-align: right;border-left: 1px solid black; white-space: nowrap;overflow: hidden !important;text-overflow: ellipsis;">
<div style="display: inline-block;width: 4rem; white-space: nowrap; overflow: hidden !important; text-overflow: ellipsis;">
@(Model.RewardViewModels != null && i < Model.RewardViewModels.Count
? Model.RewardViewModels[i]?.Title ?? "-"
: "")
@@ -467,6 +507,7 @@
</table>
</div>
</fieldset>
</div>

View File

@@ -6,8 +6,23 @@
.trTable:nth-child(even) {
background-color: #f1f1f1 !important;
}
</style>
.table-container {
display: flex;
width: 100%;
justify-content: space-between;
}
.table-container table {
flex: 1; /*Ensures equal width */
}
table {
width: 100%;
max-width: 100%;
table-layout: auto;
}
</style>
}
<div class="">
@@ -288,11 +303,9 @@
</div>
</div>
@if (Model.FineViewModelList.Any() || Model.SalaryAidViewModels.Any() || Model.InstallmentViewModels.Any() || Model.RewardViewModels.Any())
{
<div class="row" style="margin-top: 10px;padding: 0 12px;">
<fieldset style="border: 1px solid black !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; border-radius: 10px 10px 10px 10px; margin: 0px 0px; overflow: hidden; padding: 0; display: flex;width: 100%;">
@* <table style="/* table-layout: fixed; */width: 5%">
<div class="row" style="margin-top: 10px;padding: 0 12px;">
<fieldset style="border: 1px solid black !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; border-radius: 10px 10px 10px 10px; margin: 0px 0px; overflow: hidden; padding: 0; display: flex;width: 100%;">
@* <table style="/* table-layout: fixed; */width: 5%">
<tr style="text-align: center; font-size: 10px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-left: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th cstyle="height: 24px;"></th>
@@ -310,22 +323,35 @@
</tr>
}
</table> *@
<table style="/* table-layout: fixed; */width: 25%">
<tr style="text-align: center; font-size: 10px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-left: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<div class="table-container">
<table>
<colgroup>
<col style="width: 30%;">
<col style="width: 40%;">
<col style="width: 30%;">
</colgroup>
<tr style="text-align: center; font-size: 9px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-left: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th colspan="3">جریمه ها</th>
</tr>
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 10px; height: 24px;">
<th style="padding: 2px 4px; text-align: center;border-left: 1px solid black;">عنوان</th>
<th style="padding: 2px 4px; text-align: center;border-left: 1px solid black">مبلغ</th>
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 9px; height: 24px;">
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:3rem;">تاریخ</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:4rem;">عنوان</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:3rem;">مبلغ</th>
</tr>
@for (int i = 0; i < 7; i++)
{
<tr class="trTable" style="text-align: right; font-size: 10px; height: 24px;border-left: 1px solid black">
<tr class="trTable" style="text-align: right; font-size: 9px; height: 24px;border-left: 1px solid black">
<td style="padding: 2px 4px;text-align: center;border-left: 1px solid black; white-space: nowrap;overflow: hidden !important;text-overflow: ellipsis;">
@(Model.FineViewModelList != null && i < Model.FineViewModelList.Count
? Model.FineViewModelList[i]?.FineDate ?? ""
: "")
</td>
<td style="padding: 2px 4px;border-left: 1px solid black; white-space: nowrap;overflow: hidden !important;text-overflow: ellipsis;">
<div style="display: inline-block;width: 110px; white-space: nowrap; overflow: hidden !important; text-overflow: ellipsis;">
<div style="display: inline-block;width: 4rem; white-space: nowrap; overflow: hidden !important; text-overflow: ellipsis;">
@(Model.FineViewModelList != null && i < Model.FineViewModelList.Count
? Model.FineViewModelList[i]?.Title ?? ""
: "")
@@ -341,15 +367,19 @@
</table>
<table style="/* table-layout: fixed; */width: 25%">
<table>
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<tr style="border-left: 1px solid black;text-align: center; font-size: 10px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<tr style="border-left: 1px solid black;text-align: center; font-size: 9px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th colspan="3">مساعده</th>
</tr>
<tr style="border-bottom: 1px solid;border-left: 1px solid black; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 10px; height: 24px;">
<th style="padding: 2px 4px; text-align: center;border-left: 1px solid black">تاریخ</th>
<th style="padding: 2px 4px; text-align: center;border-left: 1px solid black">مبلغ</th>
<tr style="border-bottom: 1px solid;border-left: 1px solid black; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 9px; height: 24px;">
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black;min-width:3rem;">تاریخ</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black;min-width:4rem;">مبلغ</th>
</tr>
@for (int i = 0; i < 7; i++)
@@ -370,20 +400,24 @@
</table>
<table style="/* table-layout: fixed; */width: 25%">
<table>
<colgroup>
<col style="width: 40%;">
<col style="width: 60%;">
</colgroup>
<tr style="border-left: 1px solid black;text-align: center; font-size: 10px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<tr style="border-left: 1px solid black;text-align: center; font-size: 9px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th colspan="3" style="text-align: center">وام</th>
</tr>
<tr style="border-left: 1px solid black;border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 10px; height: 24px;">
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black">مبلغ کل وام</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black">مبلغ باقیمانده وام</th>
<tr style="border-left: 1px solid black;border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 9px; height: 24px;">
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:4rem;">مبلغ کل وام</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:4rem;">مبلغ باقیمانده وام</th>
</tr>
@for (int i = 0; i < 7; i++)
{
<tr class="trTable" style="text-align: right; font-size: 10px;border-left: 1px solid black; height: 24px;">
<tr class="trTable" style="text-align: right; font-size: 9px;border-left: 1px solid black; height: 24px;">
<td style="padding: 2px 4px; text-align: center;border-left: 1px solid black">
@(Model.InstallmentViewModels != null && i < Model.InstallmentViewModels.Count
? Model.InstallmentViewModels[i]?.Amount ?? ""
@@ -399,28 +433,33 @@
</table>
<table style="/* table-layout: fixed; */width: 25%">
<table>
<colgroup>
<col style="width: 30%;">
<col style="width: 40%;">
<col style="width: 30%;">
</colgroup>
<tr style="text-align: center; font-size: 10px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<tr style="text-align: center; font-size: 9px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th colspan="3">پاداش</th>
</tr>
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 10px; height: 24px;">
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black">تاریخ</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black">عنوان</th>
<th style="padding: 2px 4px; text-align: center;">مبلغ</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:3rem;">تاریخ</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:4rem;">عنوان</th>
<th style="padding: 2px 4px; text-align: center; min-width:80px;">مبلغ</th>
</tr>
@for (int i = 0; i < 7; i++)
{
<tr class="trTable" style="text-align: right; font-size: 10px; height: 24px;">
<tr class="trTable" style="text-align: right; font-size: 9px; height: 24px;">
<td style="padding: 2px 4px; text-align: center;border-left: 1px solid black">
@(Model.RewardViewModels != null && i < Model.RewardViewModels.Count
? Model.RewardViewModels[i]?.GrantDateFa ?? ""
: "")
</td>
<td style="padding: 2px 4px; text-align: center;border-left: 1px solid black; white-space: nowrap;overflow: hidden !important;text-overflow: ellipsis;">
<div style="display: inline-block;width: 110px; white-space: nowrap; overflow: hidden !important; text-overflow: ellipsis;">
<td style="padding: 2px 4px; text-align: right;border-left: 1px solid black; white-space: nowrap;overflow: hidden !important;text-overflow: ellipsis;">
<div style="display: inline-block;width: 4rem; white-space: nowrap; overflow: hidden !important; text-overflow: ellipsis;">
@(Model.RewardViewModels != null && i < Model.RewardViewModels.Count
? Model.RewardViewModels[i]?.Title ?? "-"
: "")
@@ -436,9 +475,9 @@
</table>
</fieldset>
</div>
}
</div>
</fieldset>
</div>
</fieldset>
</div>

View File

@@ -2,9 +2,25 @@
@model CompanyManagment.App.Contracts.CustomizeCheckout.CustomizeCheckoutViewModel
@{
<style>
.trTable:nth-child(even) {
background-color: #f1f1f1 !important;
}
.trTable:nth-child(even) {
background-color: #f1f1f1 !important;
}
.table-container {
display: flex;
width: 100%;
justify-content: space-between;
}
.table-container table {
flex: 1; /*Ensures equal width */
}
table {
width: 100%;
max-width: 100%;
table-layout: auto;
}
</style>
}
@@ -286,11 +302,9 @@
</div>
</div>
@if (Model.FineViewModelList.Any() || Model.SalaryAidViewModels.Any() || Model.InstallmentViewModels.Any() || Model.RewardViewModels.Any())
{
<div class="row" style="margin-top: 10px;padding: 0 12px;">
<fieldset style="border: 1px solid black !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; border-radius: 10px 10px 10px 10px; margin: 0px 0px; overflow: hidden; padding: 0; display: flex;width: 100%;">
@* <table style="/* table-layout: fixed; */width: 5%">
<div class="row" style="margin-top: 10px;padding: 0 12px;">
<fieldset style="border: 1px solid black !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; border-radius: 10px 10px 10px 10px; margin: 0px 0px; overflow: hidden; padding: 0; display: flex;width: 100%;">
@* <table style="/* table-layout: fixed; */width: 5%">
<tr style="text-align: center; font-size: 10px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-left: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th cstyle="height: 24px;"></th>
@@ -308,22 +322,35 @@
</tr>
}
</table> *@
<table style="/* table-layout: fixed; */width: 25%">
<tr style="text-align: center; font-size: 10px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-left: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<div class="table-container">
<table>
<colgroup>
<col style="width: 30%;">
<col style="width: 40%;">
<col style="width: 30%;">
</colgroup>
<tr style="text-align: center; font-size: 9px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-left: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th colspan="3">جریمه ها</th>
</tr>
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 10px; height: 24px;">
<th style="padding: 2px 4px; text-align: center;border-left: 1px solid black;">عنوان</th>
<th style="padding: 2px 4px; text-align: center;border-left: 1px solid black">مبلغ</th>
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 9px; height: 24px;">
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:3rem;">تاریخ</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:4rem;">عنوان</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:3rem;">مبلغ</th>
</tr>
@for (int i = 0; i < 7; i++)
{
<tr class="trTable" style="text-align: right; font-size: 10px; height: 24px;border-left: 1px solid black">
<tr class="trTable" style="text-align: right; font-size: 9px; height: 24px;border-left: 1px solid black">
<td style="padding: 2px 4px;text-align: center;border-left: 1px solid black; white-space: nowrap;overflow: hidden !important;text-overflow: ellipsis;">
@(Model.FineViewModelList != null && i < Model.FineViewModelList.Count
? Model.FineViewModelList[i]?.FineDate ?? ""
: "")
</td>
<td style="padding: 2px 4px;border-left: 1px solid black; white-space: nowrap;overflow: hidden !important;text-overflow: ellipsis;">
<div style="display: inline-block;width: 110px; white-space: nowrap; overflow: hidden !important; text-overflow: ellipsis;">
<div style="display: inline-block;width: 4rem; white-space: nowrap; overflow: hidden !important; text-overflow: ellipsis;">
@(Model.FineViewModelList != null && i < Model.FineViewModelList.Count
? Model.FineViewModelList[i]?.Title ?? ""
: "")
@@ -339,15 +366,19 @@
</table>
<table style="/* table-layout: fixed; */width: 25%">
<table>
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<tr style="border-left: 1px solid black;text-align: center; font-size: 10px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<tr style="border-left: 1px solid black;text-align: center; font-size: 9px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th colspan="3">مساعده</th>
</tr>
<tr style="border-bottom: 1px solid;border-left: 1px solid black; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 10px; height: 24px;">
<th style="padding: 2px 4px; text-align: center;border-left: 1px solid black">تاریخ</th>
<th style="padding: 2px 4px; text-align: center;border-left: 1px solid black">مبلغ</th>
<tr style="border-bottom: 1px solid;border-left: 1px solid black; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 9px; height: 24px;">
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black;min-width:3rem;">تاریخ</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black;min-width:4rem;">مبلغ</th>
</tr>
@for (int i = 0; i < 7; i++)
@@ -368,20 +399,24 @@
</table>
<table style="/* table-layout: fixed; */width: 25%">
<table>
<colgroup>
<col style="width: 40%;">
<col style="width: 60%;">
</colgroup>
<tr style="border-left: 1px solid black;text-align: center; font-size: 10px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<tr style="border-left: 1px solid black;text-align: center; font-size: 9px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th colspan="3" style="text-align: center">وام</th>
</tr>
<tr style="border-left: 1px solid black;border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 10px; height: 24px;">
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black">مبلغ کل وام</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black">مبلغ باقیمانده وام</th>
<tr style="border-left: 1px solid black;border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 9px; height: 24px;">
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:4rem;">مبلغ کل وام</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:4rem;">مبلغ باقیمانده وام</th>
</tr>
@for (int i = 0; i < 7; i++)
{
<tr class="trTable" style="text-align: right; font-size: 10px;border-left: 1px solid black; height: 24px;">
<tr class="trTable" style="text-align: right; font-size: 9px;border-left: 1px solid black; height: 24px;">
<td style="padding: 2px 4px; text-align: center;border-left: 1px solid black">
@(Model.InstallmentViewModels != null && i < Model.InstallmentViewModels.Count
? Model.InstallmentViewModels[i]?.Amount ?? ""
@@ -397,28 +432,33 @@
</table>
<table style="/* table-layout: fixed; */width: 25%">
<table>
<colgroup>
<col style="width: 30%;">
<col style="width: 40%;">
<col style="width: 30%;">
</colgroup>
<tr style="text-align: center; font-size: 10px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<tr style="text-align: center; font-size: 9px; padding: 2px 4px; height: 24px; border-bottom: 1px solid; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
<th colspan="3">پاداش</th>
</tr>
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; font-size: 10px; height: 24px;">
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black">تاریخ</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black">عنوان</th>
<th style="padding: 2px 4px; text-align: center;">مبلغ</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:3rem;">تاریخ</th>
<th style="padding: 2px 4px; text-align: center; border-left: 1px solid black; min-width:4rem;">عنوان</th>
<th style="padding: 2px 4px; text-align: center; min-width:80px;">مبلغ</th>
</tr>
@for (int i = 0; i < 7; i++)
{
<tr class="trTable" style="text-align: right; font-size: 10px; height: 24px;">
<tr class="trTable" style="text-align: right; font-size: 9px; height: 24px;">
<td style="padding: 2px 4px; text-align: center;border-left: 1px solid black">
@(Model.RewardViewModels != null && i < Model.RewardViewModels.Count
? Model.RewardViewModels[i]?.GrantDateFa ?? ""
: "")
</td>
<td style="padding: 2px 4px; text-align: center;border-left: 1px solid black; white-space: nowrap;overflow: hidden !important;text-overflow: ellipsis;">
<div style="display: inline-block;width: 110px; white-space: nowrap; overflow: hidden !important; text-overflow: ellipsis;">
<td style="padding: 2px 4px; text-align: right;border-left: 1px solid black; white-space: nowrap;overflow: hidden !important;text-overflow: ellipsis;">
<div style="display: inline-block;width: 4rem; white-space: nowrap; overflow: hidden !important; text-overflow: ellipsis;">
@(Model.RewardViewModels != null && i < Model.RewardViewModels.Count
? Model.RewardViewModels[i]?.Title ?? "-"
: "")
@@ -434,9 +474,9 @@
</table>
</fieldset>
</div>
}
</div>
</fieldset>
</div>
</fieldset>
</div>

View File

@@ -3,7 +3,7 @@
@using Microsoft.AspNetCore.Mvc.TagHelpers
@using Version = _0_Framework.Application.Version
@model ServiceHost.Areas.Client.Pages.Company.Employees.IndexModel
@inject _0_Framework.Application.IAuthHelper authHelper
@{
string clientVerion = _0_Framework.Application.Version.StyleVersion;
Layout = "Shared/_ClientLayout";
@@ -129,7 +129,7 @@
</div>
<div class="gwb-card" Permission="@SubAccountPermissionHelper.LeaveCreatePermissionCode">
<a onclick="location.href = '#showmodal=@Url.Page("./Index", "LeaveCreate")';" class="click loadingButton">
<a onclick="AjaxUrlContentModal('@Url.Page("./Index", "LeaveCreate")');" class="click loadingButton">
<div class="d-flex align-items-center justify-content-start p-1">
<img src="~/AssetsClient/images/icons/leave.png" alt="" class="img-fluid mx-1" width="50px"/>
<div class="text-start ms-1">
@@ -141,8 +141,22 @@
</div>
</a>
</div>
<div class="gwb-card" Permission="@SubAccountPermissionHelper.EmployeeBankInformationPermissionCode">
<a asp-page="/Company/EmployeesBankInfo/Index" class="click loadingButton">
<div class="d-flex align-items-center justify-content-start p-1">
<img src="~/AssetsClient/images/icons/banks.png" alt="" class="img-fluid mx-1" width="50px" />
<div class="text-start ms-1">
<div class="card-title">عملیات حساب بانکی پرسنل</div>
</div>
</div>
<div class="spinner-loading loading" style="display: none;">
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
</div>
</a>
</div>
<div class="gwb-card disable" Permission="@SubAccountPermissionHelper.EmployeeDocumentsOperationsPermissionCode">
<div class="gwb-card disable" Permission="@SubAccountPermissionHelper.EmployeeDocumentsOperationsPermissionCode" >
<a asp-page="/Company/EmployeesDocuments/Index" class="click loadingButton">
<div class="d-flex align-items-center justify-content-start p-1">
<img src="~/AssetsClient/images/icons/money.png" alt="" class="img-fluid mx-1" width="50px"/>
@@ -175,17 +189,23 @@
<div class="row p-2">
<div class="hrTitle d-flex w-100">
<div class="hrDiv"></div>
<span>تنظیمات فیش حقوقی پرسنل</span>
</div>
@if (authHelper.GetPermissions().Contains(SubAccountPermissionHelper.LoanOperationsPermissionCode) ||
authHelper.GetPermissions().Contains(SubAccountPermissionHelper.RewardOperationsPermissionCode) ||
authHelper.GetPermissions().Contains(SubAccountPermissionHelper.SalaryAidOperationsPermissionCode) ||
authHelper.GetPermissions().Contains(SubAccountPermissionHelper.FineOperationsPermissionCode))
{
<div class="hrTitle d-flex w-100">
<div class="hrDiv"></div>
<span>تنظیمات فیش حقوقی پرسنل</span>
</div>
}
<div class="d-grid card-area-employees-section gap-2 p-0">
<div class="gwb-card @(Model.HasCustomizeCheckoutService != "true" ? "disable" : "")" Permission="@SubAccountPermissionHelper.LoanOperationsPermissionCode">
<div class="gwb-card @(Model.HasCustomizeCheckoutService != "true" ? "disable" : "")" Permission="@SubAccountPermissionHelper.LoanOperationsPermissionCode">
<a asp-page="/Company/Loan/Index" class="click loadingButton">
<div class="d-flex align-items-center justify-content-start p-1">
<img src="~/AssetsClient/images/icons/loan.png" alt="" class="img-fluid mx-1" width="50px" />
<img src="~/AssetsClient/images/icons/loan.png" alt="" class="img-fluid mx-1" width="50px"/>
<div class="text-start ms-1">
<div class="card-title">عملیات وام</div>
</div>
@@ -195,10 +215,10 @@
</div>
</a>
</div>
<div class="gwb-card @(Model.HasCustomizeCheckoutService != "true" ? "disable" : "")" Permission="@SubAccountPermissionHelper.RewardOperationsPermissionCode">
<div class="gwb-card @(Model.HasCustomizeCheckoutService != "true" ? "disable" : "")" Permission="@SubAccountPermissionHelper.RewardOperationsPermissionCode">
<a asp-page="/Company/Reward/Index" class="click loadingButton">
<div class="d-flex align-items-center justify-content-start p-1">
<img src="~/AssetsClient/images/icons/reward.png" alt="" class="img-fluid mx-1" width="50px" />
<img src="~/AssetsClient/images/icons/reward.png" alt="" class="img-fluid mx-1" width="50px"/>
<div class="text-start ms-1">
<div class="card-title">عملیات پاداش</div>
</div>
@@ -208,10 +228,10 @@
</div>
</a>
</div>
<div class="gwb-card @(Model.HasCustomizeCheckoutService != "true" ? "disable" : "")" Permission="@SubAccountPermissionHelper.SalaryAidOperationsPermissionCode">
<div class="gwb-card @(Model.HasCustomizeCheckoutService != "true" ? "disable" : "")" Permission="@SubAccountPermissionHelper.SalaryAidOperationsPermissionCode">
<a asp-page="/Company/SalaryAid/Index" class="click loadingButton">
<div class="d-flex align-items-center justify-content-start p-1">
<img src="~/AssetsClient/images/icons/salary.png" alt="" class="img-fluid mx-1" width="50px" />
<img src="~/AssetsClient/images/icons/salary.png" alt="" class="img-fluid mx-1" width="50px"/>
<div class="text-start ms-1">
<div class="card-title">عملیات مساعده</div>
</div>
@@ -221,7 +241,7 @@
</div>
</a>
</div>
<div class="gwb-card @(Model.HasCustomizeCheckoutService != "true" ? "disable" : "")" Permission="@SubAccountPermissionHelper.FineOperationsPermissionCode">
<div class="gwb-card @(Model.HasCustomizeCheckoutService != "true" ? "disable" : "")" Permission="@SubAccountPermissionHelper.FineOperationsPermissionCode">
<a asp-page="/Company/Fine/Index" class="click loadingButton">
<div class="d-flex align-items-center justify-content-start p-1">
<img src="~/AssetsClient/images/icons/fine.png" alt="" class="img-fluid mx-1" width="50px"/>
@@ -262,49 +282,47 @@
});
});
function printAllPersonnelInfo(workshopId) {
var idlist = "";
$('.idPersonnel').each(function () {
if ($(this).text()) {
var a = $(this).text();
var b = a + "+";
idlist += b;
}
});
// function printAllPersonnelInfo(workshopId) {
// var idlist = "";
// $('.idPersonnel').each(function () {
// if ($(this).text()) {
// var a = $(this).text();
// var b = a + "+";
// idlist += b;
// }
// });
console.log(idlist);
// console.log(idlist);
var workshop_ID = Number(workshopId);
var goTo = `#showmodal=/Client/Company/Employees/Index?workshopID=${workshop_ID}&idlist=${idlist}&handler=PrintAllDetailsPersonnelInfo`;
window.location.href = goTo;
}
// var workshop_ID = Number(workshopId);
// var goTo = `/Client/Company/Employees/Index?workshopID=${workshop_ID}&idlist=${idlist}&handler=PrintAllDetailsPersonnelInfo`;
// AjaxUrlContentModal(goTo);
// }
function printAllPersonnelInfoMobile(workshopId) {
var idlist = "";
$('.idPersonnel').each(function () {
if ($(this).text()) {
var a = $(this).text();
var b = a + "+";
idlist += b;
}
});
// function printAllPersonnelInfoMobile(workshopId) {
// var idlist = "";
// $('.idPersonnel').each(function () {
// if ($(this).text()) {
// var a = $(this).text();
// var b = a + "+";
// idlist += b;
// }
// });
console.log(idlist);
var workshop_ID = Number(workshopId);
var goTo = `#showmodal=/Client/Company/Employees/Index?workshopID=${workshop_ID}&idlist=${idlist}&handler=PrintAllDetailsPersonnelInfoMobile`;
window.location.href = goTo;
}
// var workshop_ID = Number(workshopId);
// var goTo = `/Client/Company/Employees/Index?workshopID=${workshop_ID}&idlist=${idlist}&handler=PrintAllDetailsPersonnelInfoMobile`;
// AjaxUrlContentModal(goTo);
// }
function printAllPersonnelList() {
var idlist = "";
if (window.matchMedia('(min-width: 992px)').matches) {
var goTo = `#showmodal=/Client/Company/Employees/Index?idlist=${idlist}&handler=PrintAllPersonnelInfo`;
window.location.href = goTo;
} else {
var goTo = `#showmodal=/Client/Company/Employees/Index?idlist=${idlist}&handler=PrintAllPersonnelInfoMobile`;
window.location.href = goTo;
}
}
// function printAllPersonnelList() {
// var idlist = "";
// if (window.matchMedia('(min-width: 992px)').matches) {
// var goTo = `/Client/Company/Employees/Index?idlist=${idlist}&handler=PrintAllPersonnelInfo`;
// AjaxUrlContentModal(goTo);
// } else {
// var goTo = `/Client/Company/Employees/Index?idlist=${idlist}&handler=PrintAllPersonnelInfoMobile`;
// AjaxUrlContentModal(goTo);
// }
// }
</script>
}

View File

@@ -0,0 +1,121 @@
@using Microsoft.AspNetCore.Mvc.TagHelpers
@model CompanyManagment.App.Contracts.EmployeeBankInformation.CreateEmployeeInformation
@{
string clientVersion = _0_Framework.Application.Version.StyleVersion;
<link href="~/AssetsClient/css/select2.css?ver=@clientVersion" rel="stylesheet" />
<link href="~/assetsclient/pages/employeesbankinfo/css/createbankinfomodal.css?ver=@clientVersion" rel="stylesheet" />
}
<form role="form" method="post" name="create-form" id="create-form" autocomplete="off">
<div class="modal-content">
<div class="modal-header pb-0 d-flex align-items-center justify-content-center text-center">
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="modal" aria-label="Close"></button>
<div>
<p class="m-0 pdHeaderTitle1">ایجاد شماره حساب پرسنل</p>
</div>
</div>
<div class="modal-body pb-0">
<div class="container-fluid">
<div class="row">
<div class="col-12 my-1">
<span class="spanTitleText">اسامی پرسنل</span>
<div class="select-alert select-alert-employee">
<select class="form-select select2Option" aria-label="انتخاب پرسنل ..." asp-for="@Model.EmployeeId" id="employeeSelectCreate">
</select>
</div>
</div>
<div class="col-12 my-1">
<span class="spanTitleText">نام بانک</span>
<div class="select-alert select-alert-bank">
<select class="form-select select2Option" aria-label="انتخاب بانک ..." asp-for="@Model.BankId" id="bankSelectCreate">
</select>
</div>
</div>
<div class="col-12 my-1">
<span class="spanTitleText">شماره کارت</span>
<input type="text" class="form-control" id="CardNumber" asp-for="@Model.CardNumber" placeholder="شماره کارت را وارد نمائید" style="direction: ltr">
</div>
<div class="col-12 my-1 position-relative">
<span class="spanTitleText">شماره شبا</span>
<input class="form-control" id="ShebaNumber" asp-for="@Model.ShebaNumber" placeholder="شماره شبا را وارد نمائید" style="direction: ltr" />
</div>
<div class="col-12 my-1">
<span class="spanTitleText">شماره حساب</span>
<input class="form-control" id="BankAccountNumber" asp-for="@Model.BankAccountNumber" placeholder="شماره حساب را وارد نمائید" style="direction: ltr" />
</div>
<div class="col-12 my-1">
<div class="data-load">
<div class="wrapper" style="display: none">
<div class="Rtable Rtable--collapse">
<div class="Rtable-row Rtable-row--head align-items-center sticky-div">
<div class="Rtable-cell column-heading width1 d-flex align-items-center">ردیف</div>
<div class="Rtable-cell column-heading width2">نام پرسنل</div>
<div class="Rtable-cell column-heading width3 text-center">تعداد افزودن</div>
<div class="Rtable-cell column-heading width4">بانک</div>
<div class="Rtable-cell column-heading width5">عملیات</div>
</div>
<div class="w-100" id="dataLoad"></div>
</div>
</div>
<div class="text-center d-flex align-items-center justify-content-center" id="emptyData">
<div class="">
<img src="/assetsclient/images/empty2.png" width="250px" alt="" class="img-fluid"/>
<h5 style="font-size: 14px;">هیچ اطلاعات بانکی وارد نشده است!</h5>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer d-block">
<div class="container p-0 m-0">
<div class="row">
<div class="col-6 text-end">
<button type="button" class="btn-cancel2 justify-content-center" data-bs-dismiss="modal" aria-label="Close">انصراف</button>
</div>
<div class="col-6 text-start">
<button type="button" class="btnCreateNew position-relative" id="createData">
<span class="text-nowrap">ثبت</span>
<div class="spinner-loading loading" style="display: none;">
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
</div>
</button>
</div>
</div>
</div>
</div>
</div>
</form>
<!-- The Modal -->
<div id="modalCustom" class="modalCustom">
<partial name="_Partials/EditBankInfoModal" />
</div>
<script src="~/assetsclient/js/site.js?ver=@clientVersion"></script>
<script src="~/admintheme/js/jquery.mask_1.14.16.min.js"></script>
<script src="~/assetsclient/js/jquery-mask-v1.13.4.js"></script>
<script>
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
var saveNewEmployeeBankAjax = `@Url.Page("./Index", "Create")`;
var removeBankAjax = `@Url.Page("./Index", "Delete")`;
</script>
<script src="~/assetsclient/pages/employeesbankinfo/js/createbankinfomodal.js?ver=@clientVersion"></script>

View File

@@ -0,0 +1,55 @@
@model CompanyManagment.App.Contracts.EmployeeBankInformation.GroupedEmployeeBankInformationViewModel
@{
string clientVersion = _0_Framework.Application.Version.StyleVersion;
<link href="~/AssetsClient/css/select2.css?ver=@clientVersion" rel="stylesheet" />
<link href="~/assetsclient/pages/employeesbankinfo/css/detailsbankinfomodal.css?ver=@clientVersion" rel="stylesheet" />
}
<div class="modal-content">
<div class="modal-header pb-0 d-flex align-items-center justify-content-center text-center">
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="modal" aria-label="Close"></button>
<div>
<p class="m-0 pdHeaderTitle1">ایجاد شماره حساب پرسنل</p>
<p class="m-0 pdHeaderTitle1" id="detailsEmployeeName">@Model.EmployeeName</p>
</div>
</div>
<div class="modal-body pb-0">
<div class="d-grid grid-cols gap-2" id="loadDetails">
</div>
</div>
<div class="modal-footer d-block">
<div class="container p-0 m-0">
<div class="row">
<div class="col-12 text-end">
<button type="button" class="btn-cancel2 justify-content-center" data-bs-dismiss="modal" aria-label="Close">انصراف</button>
</div>
</div>
</div>
</div>
</div>
<!-- The Modal -->
<div id="modalCustom" class="modalCustom">
<partial name="_Partials/EditBankInfoModal" />
</div>
<script src="~/assetsclient/js/site.js?ver=@clientVersion"></script>
<script src="~/assetsclient/libs/jalaali-js/jalaali.js"></script>
@* <script src="~/admintheme/js/jquery.mask_1.14.16.min.js"></script> *@
<script src="~/assetsclient/js/jquery-mask-v1.13.4.js"></script>
<script>
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
var loadDetailsAjaxUrl = `@Url.Page("./Index", "DetailsAjax")`;
var setDefaultAjaxUrl = `@Url.Page("./Index", "SetDefault")`;
var removeBankAjax = `@Url.Page("./Index", "Delete")`;
var countData = @(Model.BankInformation.Count());
var employeeId = Number(@Model.EmployeeId);
</script>
<script src="~/assetsclient/pages/employeesbankinfo/js/detailsbankinfomodal.js?ver=@clientVersion"></script>

View File

@@ -0,0 +1,268 @@
@page
@using _0_Framework.Application
@using Microsoft.AspNetCore.Mvc.TagHelpers
@model ServiceHost.Areas.Client.Pages.Company.EmployeesBankInfo.IndexModel
@{
string clientVersion = _0_Framework.Application.Version.StyleVersion;
Layout = "Shared/_ClientLayout";
ViewData["title"] = " - عملیات حساب بانکی پرنسل";
int index = 1;
}
@section Styles {
<link href="~/AssetsClient/css/table-style.css?ver=@clientVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/table-responsive.css?ver=@clientVersion" rel="stylesheet" />
<link href="~/assetsclient/css/operation-button.css?ver=@clientVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/filter-search.css?ver=@clientVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/card.css?ver=@clientVersion" rel="stylesheet" />
<link href="~/AssetsClient/css/datetimepicker.css?ver=@clientVersion" rel="stylesheet" />
<link href="~/AdminTheme/assets/sweet-alert/sweet-alert.min.css" rel="stylesheet">
<link href="~/AssetsClient/css/select2.css?ver=@clientVersion" rel="stylesheet" />
<link href="~/assetsclient/pages/employeesbankinfo/css/index.css?ver=@clientVersion" rel="stylesheet" />
}
<div class="content-container">
<div class="container-fluid">
<div class="row p-2">
<div class="col p-0 m-0 d-flex align-items-center justify-content-between">
<div class="col d-flex align-items-center justify-content-start">
<img src="~/AssetsClient/images/icons/banks.png" alt="" class="img-fluid me-2" style="width: 45px;" />
<div>
<h4 class="title d-flex align-items-center">عملیات حساب بانکی پرنسل</h4>
<div>@Model.WorkshopFullName</div>
</div>
</div>
<div>
<a asp-page="/Company/Employees/Index" class="back-btn" type="button">
<span>بازگشت</span>
</a>
</div>
</div>
</div>
</div>
<button class="btn btn-rounded mb-5 goToTop">
<div class="d-flex align-items-center">
<span>برو بالا</span>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" width="20px" class="ms-1">
<path stroke-linecap="round" stroke-linejoin="round" d="m4.5 18.75 7.5-7.5 7.5 7.5" />
<path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 7.5-7.5 7.5 7.5" />
</svg>
</div>
</button>
<div class="container-fluid d-none d-md-block">
<div class="row px-2">
<div class="search-box card">
<div class="row">
<div class="col-12">
<div class="row search-personal-section">
<div class="col-3 col-xxl-2">
<select class="form-select employeeName select2OptionIndex" id="employeeSelectIndex" aria-label="انتخاب پرسنل ...">
</select>
</div>
<div class="col-3 col-xxl-2">
<select class="form-select banlName select2OptionIndex" id="bankSelectIndex" aria-label="انتخاب بانک ...">
</select>
</div>
<button class="btn-search btn-w-size btn-search-click text-nowrap d-flex align-items-center justify-content-center me-2" id="searchBtn" type="submit">
<span>جستجو</span>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<circle cx="11" cy="11" r="6" stroke="white" />
<path d="M20 20L17 17" stroke="white" stroke-linecap="round" />
</svg>
</button>
<div class="btn-clear-filter btn-w-size text-nowrap d-flex align-items-center justify-content-center disable">
<span>حذف جستجو</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container-fluid">
<!-- Advance Search Box -->
<div class="d-block d-md-none mb-1">
<div class="row d-flex align-items-center justify-content-between">
<div class="search-box bg-white p-2">
<div class="d-flex justify-content-between text-center">
<button class="btn-search w-100" type="button" data-bs-toggle="modal" data-bs-target="#searchModal">
<span>جستجو پیشرفته</span>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
<circle cx="11" cy="11" r="6" stroke="white" />
<path d="M20 20L17 17" stroke="white" stroke-linecap="round" />
</svg>
</button>
</div>
</div>
</div>
</div>
<!-- End Advance Search Box -->
<div class="row p-lg-2">
<div class="card p-2">
<div class="row align-items-center">
<div class="col-6 col-md-4">
<button class="btn-create mb-1" onclick="openCreateEmployeeBankModal()">
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="11" cy="11" r="8.25" stroke-width="1.5" stroke="white" />
<path d="M11 13.75L11 8.25" stroke-width="1.5" stroke="white" stroke-linecap="round" />
<path d="M13.75 11L8.25 11" stroke-width="1.5" stroke="white" stroke-linecap="round" />
</svg>
ایجاد حساب بانکی
</button>
@* <div class="select-all d-flex d-md-none align-items-center">
<input type="checkbox" class="form-check-input checkAll" name="" id="checkAll1">
<label for="checkAll1">انتخاب همه</label>
</div> *@
</div>
<div class="d-none d-md-block col-4 text-center">
<span>
لیست حساب بانکی
</span>
</div>
<div class="col-6 col-md-4 text-end">
@* <div class="d-flex align-items-center justify-content-end my-1">
<button class="btn-print-all" type="button" onclick="printAll()">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
<path d="M15.0001 11.2493H15.139C16.0279 11.2493 16.4723 11.2493 16.759 10.9866C16.7805 10.967 16.801 10.9464 16.8207 10.9249C17.0834 10.6382 17.0834 10.1938 17.0834 9.3049V9.3049C17.0834 7.52714 17.0834 6.63826 16.558 6.06484C16.5187 6.02194 16.4775 5.98077 16.4346 5.94146C15.8612 5.41602 14.9723 5.41602 13.1945 5.41602H6.91675C5.03113 5.41602 4.08832 5.41602 3.50253 6.0018C2.91675 6.58759 2.91675 7.5304 2.91675 9.41602V10.2493C2.91675 10.7208 2.91675 10.9565 3.06319 11.1029C3.20964 11.2493 3.44534 11.2493 3.91675 11.2493H5.00008" stroke="#1E293B"/>
<path d="M5.41675 16.3903L5.41675 9.91732C5.41675 8.97451 5.41675 8.5031 5.70964 8.21021C6.00253 7.91732 6.47394 7.91732 7.41675 7.91732L12.5834 7.91732C13.5262 7.91732 13.9976 7.91732 14.2905 8.21021C14.5834 8.5031 14.5834 8.97451 14.5834 9.91732L14.5834 16.3903C14.5834 16.7068 14.5834 16.8651 14.4796 16.9399C14.3758 17.0148 14.2256 16.9647 13.9253 16.8646L12.2572 16.3086C12.1712 16.2799 12.1282 16.2656 12.0839 16.2669C12.0396 16.2682 11.9975 16.285 11.9134 16.3187L10.1858 17.0097C10.0941 17.0464 10.0482 17.0647 10.0001 17.0647C9.95194 17.0647 9.90609 17.0464 9.81439 17.0097L8.0868 16.3187C8.00267 16.285 7.9606 16.2682 7.91627 16.2669C7.87194 16.2656 7.82896 16.2799 7.74299 16.3086L6.07486 16.8646C5.77455 16.9647 5.62439 17.0148 5.52057 16.9399C5.41675 16.8651 5.41675 16.7068 5.41675 16.3903Z" stroke="#1E293B"/>
<path d="M7.91675 11.25L11.2501 11.25" stroke="#1E293B" stroke-linecap="round"/>
<path d="M7.91675 13.75L12.0834 13.75" stroke="#1E293B" stroke-linecap="round"/>
<path d="M14.5834 5.41732V5.41732C14.5834 3.97799 14.5834 3.25833 14.1954 2.76756C14.1087 2.65791 14.0095 2.55874 13.8998 2.47204C13.4091 2.08398 12.6894 2.08398 11.2501 2.08398H8.75008C7.31076 2.08398 6.5911 2.08398 6.10032 2.47204C5.99068 2.55874 5.8915 2.65791 5.8048 2.76756C5.41675 3.25833 5.41675 3.97799 5.41675 5.41732V5.41732" stroke="#1E293B"/>
</svg>
<span>پرینت گروهی</span>
</button>
<button class="btn-delete-all ms-2" type="button" onclick="printAll()">
<svg width="20" height="20" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.70825 13.2891L8.70825 10.5391" stroke="#BF3737" stroke-linecap="round"/>
<path d="M13.2917 13.2891L13.2917 10.5391" stroke="#BF3737" stroke-linecap="round"/>
<path d="M2.75 5.96094H19.25V5.96094C18.122 5.96094 17.558 5.96094 17.1279 6.18191C16.7561 6.37284 16.4536 6.67541 16.2626 7.04713C16.0417 7.47732 16.0417 8.0413 16.0417 9.16927V13.8776C16.0417 15.7632 16.0417 16.706 15.4559 17.2918C14.8701 17.8776 13.9273 17.8776 12.0417 17.8776H9.95833C8.07271 17.8776 7.12991 17.8776 6.54412 17.2918C5.95833 16.706 5.95833 15.7632 5.95833 13.8776V9.16927C5.95833 8.0413 5.95833 7.47732 5.73737 7.04713C5.54643 6.67541 5.24386 6.37284 4.87214 6.18191C4.44195 5.96094 3.87797 5.96094 2.75 5.96094V5.96094Z" stroke="#BF3737" stroke-linecap="round"/>
<path d="M8.70841 3.20595C8.70841 3.20595 9.16675 2.28906 11.0001 2.28906C12.8334 2.28906 13.2917 3.20573 13.2917 3.20573" stroke="#BF3737" stroke-linecap="round"/>
</svg>
<span>حذف گروهی</span>
</button>
</div> *@
</div>
</div>
<div class="wrapper">
<div class="fineList Rtable Rtable--collapse">
<div class="Rtable-row Rtable-row--head align-items-center sticky-div">
<div class="Rtable-cell column-heading width1 d-flex align-items-center">
<label for="checkAll2">ردیف</label>
</div>
<div class="Rtable-cell column-heading width2">نام پرسنل</div>
<div class="Rtable-cell column-heading width3 text-center">شماره پرسنلی</div>
<div class="Rtable-cell column-heading width4">تعداد کارت ثبت شده</div>
<div class="Rtable-cell column-heading width5">بانک</div>
<div class="Rtable-cell column-heading text-end pe-2 width6">عملیات</div>
</div>
<div class="w-100" id="EmployeeBankListAjax">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@* <input type="hidden" asp-for="@Model.PageIndex" /> *@
<!-- Modal From Bottom For Advance Search -->
<div class="modal fade" id="searchModal" tabindex="-1" data-bs-backdrop="static" aria-labelledby="searchModalModalLabel" aria-hidden="true">
<div class="modal-dialog modal-fullscreen">
<div class="modal-content">
<div class="modal-header d-block text-center pb-0">
<div class="iphone-line mx-auto mb-3"></div>
<h5 class="modal-title mb-4 text-start" id="searchModalLabel">جستجوی پیشرفته</h5>
</div>
<div class="modal-body pt-0 mb-3">
<div class="container-fluid search-box">
<div id="overlaySearchAdvance" class=""></div>
<div class="row">
<div class="col-12 text-start mb-4">
<select class="form-select employeeName select2OptionIndexMobile" id="employeeSelectIndexMobile" aria-label="انتخاب پرسنل ...">
</select>
</div>
<div class="col-12">
<input type="text" class="form-control text-center form-control-date date start-date" id="start-date-mobile" placeholder="تاریخ شروع" style="direction: ltr">
</div>
<div class="col-12">
<input type="text" class="form-control text-center form-control-date date end-date" id="end-date-mobile" placeholder="تاریخ پایان" style="direction: ltr">
</div>
<div class="col-12">
<div class="btn-clear-filter disable py-2 text-center d-block w-100 mt-2">
<span class="w-100">حذف جستجو</span>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer justify-content-center align-items-center">
<div class="container-fluid">
<div class="row">
<div class="col-6 text-end">
<button type="button" class="btn-cancel w-100" data-bs-dismiss="modal">بستن</button>
</div>
<div class="col-6 text-start">
<button type="submit" class="btn-search btn-search-click-mobile w-100">جستجو</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- End Modal From Bottom For Advance Search -->
<div id="MainModal" class="modal fade" tabindex="-1" data-bs-backdrop="static" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable Modal-width">
<div class="modal-content" id="ModalContent">
</div>
</div>
</div>
@section Script {
<script src="~/assetsclient/js/site.js?ver=@clientVersion"></script>
<script src="~/AdminTheme/assets/sweet-alert/sweet-alert.min.js"></script>
<script src="~/assetsclient/libs/jalaali-js/jalaali.js"></script>
<script src="~/assetsclient/libs/cleave/cleave.min.js"></script>
<script>
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
var employeeBankInfoListLoadDataAjax = `@Url.Page("./Index", "EmployeeBankInfoListAjax")`;
var employeeListAjax = `@Url.Page("./Index", "EmployeeListAjax")`;
var bankListAjax = `@Url.Page("./Index", "BankListAjax")`;
var removeByEmployeeIdAjax = `@Url.Page("./Index", "DeleteByEmployeeId")`;
</script>
<script src="~/assetsclient/pages/employeesbankinfo/js/index.js?ver=@clientVersion"></script>
}

View File

@@ -0,0 +1,190 @@
using _0_Framework.Application;
using CompanyManagment.App.Contracts.Bank;
using CompanyManagment.App.Contracts.Employee;
using CompanyManagment.App.Contracts.EmployeeBankInformation;
using CompanyManagment.App.Contracts.Workshop;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using System.Security.Claims;
namespace ServiceHost.Areas.Client.Pages.Company.EmployeesBankInfo
{
[Authorize]
public class IndexModel : PageModel
{
private readonly IPasswordHasher _passwordHasher;
private readonly IWorkshopApplication _workshopApplication;
private readonly IEmployeeApplication _employeeApplication;
private readonly IEmployeeBankInformationApplication _employeeBankInformationApplication;
private readonly IBankApplication _bankApplication;
private readonly IHttpContextAccessor _contextAccessor;
private readonly IAuthHelper _authHelper;
private readonly long _workshopId;
public string WorkshopFullName;
public int PageIndex = 0;
public IndexModel(IPasswordHasher passwordHasher, IWorkshopApplication workshopApplication, IHttpContextAccessor contextAccessor, IAuthHelper authHelper, IEmployeeBankInformationApplication employeeBankInformationApplication, IEmployeeApplication employeeApplication, IBankApplication bankApplication)
{
_passwordHasher = passwordHasher;
_workshopApplication = workshopApplication;
_contextAccessor = contextAccessor;
_authHelper = authHelper;
_employeeBankInformationApplication = employeeBankInformationApplication;
_employeeApplication = employeeApplication;
_bankApplication = bankApplication;
var workshopHash = _contextAccessor.HttpContext?.User.FindFirstValue("WorkshopSlug");
_workshopId = _passwordHasher.SlugDecrypt(workshopHash);
if (_workshopId < 1)
throw new InvalidDataException("اختلال در کارگاه");
}
public void OnGet()
{
var workshop = _workshopApplication.GetWorkshopInfo(_workshopId);
WorkshopFullName = workshop.WorkshopFullName;
}
public IActionResult OnGetEmployeeListAjax()
{
var resultData = _employeeApplication.GetWorkingEmployeesByWorkshopId(_workshopId);
return new JsonResult(new
{
success = true,
data = resultData,
});
}
public IActionResult OnGetEmployeeBankInfoListAjax(EmployeeBankInformationSearchModel searchModel)
{
var resultData = _employeeBankInformationApplication.Search(_workshopId, searchModel);
return new JsonResult(new
{
success = true,
data = resultData,
});
}
public IActionResult OnGetBankListAjax()
{
var resultData = _bankApplication.Search("");
return new JsonResult(new
{
success = true,
data = resultData,
});
}
public IActionResult OnPostSetDefault(long bankId)
{
var result = _employeeBankInformationApplication.SetDefault(_workshopId, bankId);
return new JsonResult(new
{
success = result.IsSuccedded,
message = result.Message,
id = result.SendId
});
}
public IActionResult OnGetDetails(long employeeId)
{
var command = _employeeBankInformationApplication.GetByEmployeeId(_workshopId, employeeId);
return Partial("DetailsBankInfoModal", command);
//return Partial("DetailsBankInfoModal");
}
public IActionResult OnGetDetailsAjax(long employeeId)
{
var resultData = _employeeBankInformationApplication.GetByEmployeeId(_workshopId, employeeId);
return new JsonResult(new
{
success = true,
data = resultData
});
}
public IActionResult OnGetCreate()
{
var command = new CreateEmployeeInformation()
{
WorkshopId = _workshopId,
};
return Partial("CreateBankInfoModal", command);
}
public IActionResult OnPostCreate(CreateEmployeeInformation command)
{
command.WorkshopId = _workshopId;
if(!string.IsNullOrWhiteSpace(command.CardNumber))
command.CardNumber = command.CardNumber.Replace("-", "");
if (!string.IsNullOrWhiteSpace(command.ShebaNumber))
command.ShebaNumber = command.ShebaNumber.Replace("-", "");
var result = _employeeBankInformationApplication.Create(command);
return new JsonResult(new
{
success = result.IsSuccedded,
message = result.Message,
id = result.SendId
});
}
//public IActionResult OnGetEdit(long id)
//{
// var dataBankInfo = _employeeBankInformationApplication.GetDetails(id);
// var command = new EditEmployeeInformation()
// {
// Id = dataBankInfo.Id,
// WorkshopId = _workshopId,
// EmployeeId = dataBankInfo.EmployeeId,
// EmployeeName = dataBankInfo.EmployeeName,
// BankAccountNumber = dataBankInfo.BankAccountNumber,
// CardNumber = dataBankInfo.CardNumber,
// ShebaNumber = dataBankInfo.ShebaNumber
// };
// return Partial("EditBankInfoModal", command);
//}
public IActionResult OnPostEdit(EditEmployeeInformation command)
{
command.WorkshopId = _workshopId;
if (!string.IsNullOrWhiteSpace(command.CardNumber))
command.CardNumber = command.CardNumber.Replace("-", "");
if (!string.IsNullOrWhiteSpace(command.ShebaNumber))
command.ShebaNumber = command.ShebaNumber.Replace("-", "");
var result = _employeeBankInformationApplication.Edit(command);
return new JsonResult(new
{
success = result.IsSuccedded,
message = result.Message,
});
}
public IActionResult OnPostDeleteByEmployeeId(long employeeId)
{
var result = _employeeBankInformationApplication.RemoveByEmployeeId(_workshopId, employeeId);
return new JsonResult(new
{
success = result.IsSuccedded,
message = result.Message,
});
}
public IActionResult OnPostDelete(long id)
{
var result = _employeeBankInformationApplication.Remove(id);
return new JsonResult(new
{
success = result.IsSuccedded,
message = result.Message,
});
}
}
}

View File

@@ -0,0 +1,84 @@
@using Microsoft.AspNetCore.Mvc.TagHelpers
@{
string clientVersion = _0_Framework.Application.Version.StyleVersion;
<link href="~/AssetsClient/css/select2.css?ver=@clientVersion" rel="stylesheet" />
<link href="~/assetsclient/pages/employeesbankinfo/css/editbankinfomodal.css?ver=@clientVersion" rel="stylesheet" />
}
<div class="modal-content-custom">
<form role="form" method="post" name="edit-form" id="edit-form" autocomplete="off">
<div class="modal-content">
<div class="modal-header pb-0 d-flex align-items-center justify-content-center text-center">
<button type="button" class="btn-close position-absolute text-start closeCustomModal" aria-label="Close"></button>
<div>
<p class="m-0 pdHeaderTitle1">ویرایش شماره حساب پرسنل</p>
<p class="m-0 pdHeaderTitle1" id="EmployeeNameShow"></p>
</div>
</div>
<div class="modal-body pb-0">
<div class="container-fluid">
<input type="hidden" name="Command.Id" id="editId" />
<input type="hidden" name="Command.EmployeeId" id="employeeId" />
<div class="row">
<div class="col-12 my-1">
<span class="spanTitleText">نام بانک</span>
<div class="select-alert select-alert-bank">
<select class="form-select select2Option" name="Command.BankId" aria-label="انتخاب بانک ..." id="bankSelect2Edit">
</select>
<input type="hidden" id="bankSelectEdit" />
</div>
</div>
<div class="col-12 my-1">
<span class="spanTitleText">شماره کارت</span>
<input type="text" class="form-control" name="Command.CardNumber" id="CardNumberEdit" placeholder="شماره کارت را وارد نمائید" style="direction: ltr">
</div>
<div class="col-12 my-1 position-relative">
<span class="spanTitleText">شماره شبا</span>
<input class="form-control" name="Command.ShebaNumber" id="ShebaNumberEdit" placeholder="شماره شبا را وارد نمائید" style="direction: ltr" />
</div>
<div class="col-12 my-1">
<span class="spanTitleText">شماره حساب</span>
<input class="form-control" name="Command.BankAccountNumber" id="BankAccountNumberEdit" placeholder="شماره حساب را وارد نمائید" style="direction: ltr" />
</div>
</div>
</div>
</div>
<div class="modal-footer d-block">
<div class="container p-0 m-0">
<div class="row">
<div class="col-6 text-end">
<button type="button" class="btn-cancel2 d-flex justify-content-center closeCustomModal">انصراف</button>
</div>
<div class="col-6 text-start">
<button type="button" class="btnCreateNew position-relative d-flex justify-content-center" id="editData">
<span class="text-nowrap">ثبت ویرایش</span>
<div class="spinner-loading loading" style="display: none;">
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
</div>
</button>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
<script src="~/assetsclient/js/site.js?ver=@clientVersion"></script>
<script>
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
var saveEditEmployeeBankAjax = `@Url.Page("./Index", "Edit")`;
</script>
<script src="~/assetsclient/pages/employeesbankinfo/js/editbankinfomodal.js?ver=@clientVersion"></script>

View File

@@ -218,6 +218,10 @@
<None Include="Areas\Client\Pages\Company\CustomizeCheckout\_Partials\ConfirmEmployeeChangeModal.cshtml" />
<None Include="Areas\Client\Pages\Company\CustomizeCheckout\_Partials\PrintDetailsCheckoutTemporaryRaw.cshtml" />
<None Include="Areas\Client\Pages\Company\CustomizeCheckout\_Partials\PrintDetailsCheckoutUnofficialRaw.cshtml" />
<None Include="Areas\Client\Pages\Company\EmployeesBankInfo\CreateBankInfoModal.cshtml" />
<None Include="Areas\Client\Pages\Company\EmployeesBankInfo\DetailsBankInfoModal.cshtml" />
<None Include="Areas\Client\Pages\Company\EmployeesBankInfo\Index.cshtml" />
<None Include="Areas\Client\Pages\Company\EmployeesBankInfo\_Partials\EditBankInfoModal.cshtml" />
<None Include="Areas\Client\Pages\Company\Employees\alert.cshtml" />
<None Include="Areas\Client\Pages\Company\Employees\ChangeCode.cshtml" />
<None Include="Areas\Client\Pages\Company\Employees\ContractCheckoutStatus.cshtml" />
@@ -739,6 +743,10 @@
<None Include="wwwroot\AssetsClient\pages\CustomizeCheckout\js\ModalSettingEmployee.js" />
<None Include="wwwroot\AssetsClient\pages\CustomizeCheckout\js\ModalSettingGroup.js" />
<None Include="wwwroot\AssetsClient\pages\CustomizeCheckout\js\PrintOne.js" />
<None Include="wwwroot\AssetsClient\pages\EmployeesBankInfo\js\CreateBankInfoModal.js" />
<None Include="wwwroot\AssetsClient\pages\EmployeesBankInfo\js\DetailsBankInfoModal.js" />
<None Include="wwwroot\AssetsClient\pages\EmployeesBankInfo\js\EditBankInfoModal.js" />
<None Include="wwwroot\AssetsClient\pages\EmployeesBankInfo\js\Index.js" />
<None Include="wwwroot\AssetsClient\pages\Employees\js\createleave.js" />
<None Include="wwwroot\AssetsClient\pages\Fine\js\CRUDFineSubjectModal.js" />
<None Include="wwwroot\AssetsClient\pages\Fine\js\Index.js" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,52 @@
// jQuery Mask Plugin v1.13.4
// github.com/igorescobar/jQuery-Mask-Plugin
(function (b) { "function" === typeof define && define.amd ? define(["jquery"], b) : "object" === typeof exports ? module.exports = b(require("jquery")) : b(jQuery || Zepto) })(function (b) {
var y = function (a, c, d) {
a = b(a); var g = this, k = a.val(), l; c = "function" === typeof c ? c(a.val(), void 0, a, d) : c; var e = {
invalid: [], getCaret: function () {
try {
var q, b = 0, e = a.get(0), f = document.selection, c = e.selectionStart; if (f && -1 === navigator.appVersion.indexOf("MSIE 10")) q = f.createRange(), q.moveStart("character", a.is("input") ? -a.val().length : -a.text().length),
b = q.text.length; else if (c || "0" === c) b = c; return b
} catch (d) { }
}, setCaret: function (q) { try { if (a.is(":focus")) { var b, c = a.get(0); c.setSelectionRange ? c.setSelectionRange(q, q) : c.createTextRange && (b = c.createTextRange(), b.collapse(!0), b.moveEnd("character", q), b.moveStart("character", q), b.select()) } } catch (f) { } }, events: function () {
a.on("input.mask keyup.mask", e.behaviour).on("paste.mask drop.mask", function () { setTimeout(function () { a.keydown().keyup() }, 100) }).on("change.mask", function () { a.data("changed", !0) }).on("blur.mask",
function () { k === a.val() || a.data("changed") || a.triggerHandler("change"); a.data("changed", !1) }).on("blur.mask", function () { k = a.val() }).on("focus.mask", function (a) { !0 === d.selectOnFocus && b(a.target).select() }).on("focusout.mask", function () { d.clearIfNotMatch && !l.test(e.val()) && e.val("") })
}, getRegexMask: function () {
for (var a = [], b, e, f, d, h = 0; h < c.length; h++)(b = g.translation[c.charAt(h)]) ? (e = b.pattern.toString().replace(/.{1}$|^.{1}/g, ""), f = b.optional, (b = b.recursive) ? (a.push(c.charAt(h)), d = {
digit: c.charAt(h),
pattern: e
}) : a.push(f || b ? e + "?" : e)) : a.push(c.charAt(h).replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&")); a = a.join(""); d && (a = a.replace(new RegExp("(" + d.digit + "(.*" + d.digit + ")?)"), "($1)?").replace(new RegExp(d.digit, "g"), d.pattern)); return new RegExp(a)
}, destroyEvents: function () { a.off("input keydown keyup paste drop blur focusout ".split(" ").join(".mask ")) }, val: function (b) { var c = a.is("input") ? "val" : "text"; if (0 < arguments.length) { if (a[c]() !== b) a[c](b); c = a } else c = a[c](); return c }, getMCharsBeforeCount: function (a,
b) { for (var e = 0, f = 0, d = c.length; f < d && f < a; f++)g.translation[c.charAt(f)] || (a = b ? a + 1 : a, e++); return e }, caretPos: function (a, b, d, f) { return g.translation[c.charAt(Math.min(a - 1, c.length - 1))] ? Math.min(a + d - b - f, d) : e.caretPos(a + 1, b, d, f) }, behaviour: function (a) {
a = a || window.event; e.invalid = []; var c = a.keyCode || a.which; if (-1 === b.inArray(c, g.byPassKeys)) {
var d = e.getCaret(), f = e.val().length, n = d < f, h = e.getMasked(), k = h.length, m = e.getMCharsBeforeCount(k - 1) - e.getMCharsBeforeCount(f - 1); e.val(h); !n || 65 === c && a.ctrlKey || (8 !==
c && 46 !== c && (d = e.caretPos(d, f, k, m)), e.setCaret(d)); return e.callbacks(a)
}
}, getMasked: function (a) {
var b = [], k = e.val(), f = 0, n = c.length, h = 0, l = k.length, m = 1, p = "push", u = -1, t, w; d.reverse ? (p = "unshift", m = -1, t = 0, f = n - 1, h = l - 1, w = function () { return -1 < f && -1 < h }) : (t = n - 1, w = function () { return f < n && h < l }); for (; w();) {
var x = c.charAt(f), v = k.charAt(h), r = g.translation[x]; if (r) v.match(r.pattern) ? (b[p](v), r.recursive && (-1 === u ? u = f : f === t && (f = u - m), t === u && (f -= m)), f += m) : r.optional ? (f += m, h -= m) : r.fallback ? (b[p](r.fallback), f += m, h -= m) : e.invalid.push({
p: h,
v: v, e: r.pattern
}), h += m; else { if (!a) b[p](x); v === x && (h += m); f += m }
} a = c.charAt(t); n !== l + 1 || g.translation[a] || b.push(a); return b.join("")
}, callbacks: function (b) { var g = e.val(), l = g !== k, f = [g, b, a, d], n = function (a, b, c) { "function" === typeof d[a] && b && d[a].apply(this, c) }; n("onChange", !0 === l, f); n("onKeyPress", !0 === l, f); n("onComplete", g.length === c.length, f); n("onInvalid", 0 < e.invalid.length, [g, b, a, e.invalid, d]) }
}; g.mask = c; g.options = d; g.remove = function () {
var b = e.getCaret(); e.destroyEvents(); e.val(g.getCleanVal()); e.setCaret(b -
e.getMCharsBeforeCount(b)); return a
}; g.getCleanVal = function () { return e.getMasked(!0) }; g.init = function (c) {
c = c || !1; d = d || {}; g.byPassKeys = b.jMaskGlobals.byPassKeys; g.translation = b.jMaskGlobals.translation; g.translation = b.extend({}, g.translation, d.translation); g = b.extend(!0, {}, g, d); l = e.getRegexMask(); !1 === c ? (d.placeholder && a.attr("placeholder", d.placeholder), b("input").length && !1 === "oninput" in b("input")[0] && "on" === a.attr("autocomplete") && a.attr("autocomplete", "off"), e.destroyEvents(), e.events(), c = e.getCaret(),
e.val(e.getMasked()), e.setCaret(c + e.getMCharsBeforeCount(c, !0))) : (e.events(), e.val(e.getMasked()))
}; g.init(!a.is("input"))
}; b.maskWatchers = {}; var A = function () { var a = b(this), c = {}, d = a.attr("data-mask"); a.attr("data-mask-reverse") && (c.reverse = !0); a.attr("data-mask-clearifnotmatch") && (c.clearIfNotMatch = !0); "true" === a.attr("data-mask-selectonfocus") && (c.selectOnFocus = !0); if (z(a, d, c)) return a.data("mask", new y(this, d, c)) }, z = function (a, c, d) {
d = d || {}; var g = b(a).data("mask"), k = JSON.stringify; a = b(a).val() ||
b(a).text(); try { return "function" === typeof c && (c = c(a)), "object" !== typeof g || k(g.options) !== k(d) || g.mask !== c } catch (l) { }
}; b.fn.mask = function (a, c) { c = c || {}; var d = this.selector, g = b.jMaskGlobals, k = b.jMaskGlobals.watchInterval, l = function () { if (z(this, a, c)) return b(this).data("mask", new y(this, a, c)) }; b(this).each(l); d && "" !== d && g.watchInputs && (clearInterval(b.maskWatchers[d]), b.maskWatchers[d] = setInterval(function () { b(document).find(d).each(l) }, k)); return this }; b.fn.unmask = function () {
clearInterval(b.maskWatchers[this.selector]);
delete b.maskWatchers[this.selector]; return this.each(function () { var a = b(this).data("mask"); a && a.remove().removeData("mask") })
}; b.fn.cleanVal = function () { return this.data("mask").getCleanVal() }; b.applyDataMask = function (a) { a = a || b.jMaskGlobals.maskElements; (a instanceof b ? a : b(a)).filter(b.jMaskGlobals.dataMaskAttr).each(A) }; var p = {
maskElements: "input,td,span,div", dataMaskAttr: "*[data-mask]", dataMask: !0, watchInterval: 300, watchInputs: !0, watchDataMask: !1, byPassKeys: [9, 16, 17, 18, 36, 37, 38, 39, 40, 91], translation: {
0: { pattern: /\d/ },
9: { pattern: /\d/, optional: !0 }, "#": { pattern: /\d/, recursive: !0 }, A: { pattern: /[a-zA-Z0-9]/ }, S: { pattern: /[a-zA-Z]/ }
}
}; b.jMaskGlobals = b.jMaskGlobals || {}; p = b.jMaskGlobals = b.extend(!0, {}, p, b.jMaskGlobals); p.dataMask && b.applyDataMask(); setInterval(function () { b.jMaskGlobals.watchDataMask && b.applyDataMask() }, p.watchInterval)
});

View File

@@ -0,0 +1,71 @@
.Modal-width {
max-width: 520px;
}
.errored {
animation: shake 300ms;
color: #eb3434 !important;
background-color: #fef2f2 !important;
border: 1px solid #eb3434 !important;
}
.select-alert {
border: 1px solid #FFFFFF;
}
.textLFontColor,
.form-control {
color: #797979;
font-size: 12px;
font-weight: 500;
}
.textLFontColor span {
font-size: 16px;
font-weight: 600;
}
.btnCreateNew {
font-size: 14px;
font-weight: 500;
background-color: #84CC16;
color: #FFFFFF;
border-radius: 8px;
padding: 10px 70px;
}
.btnCreateNew:hover {
background-color: #5f9213;
}
.btnCreateNew,
.btn-cancel2 {
width: 100% !important;
}
.spanTitleText {
font-size: 13px;
font-weight: 500;
color: #454545;
}
.data-load {
background-color: #F0F0F0;
border-radius: 6px;
padding: 5px;
height: 180px;
overflow-y: scroll;
}
@media (max-width:1366px) {
.modal-dialog-scrollable .modal-content {
max-height: auto;
overflow: hidden;
}
}
@media (max-width:768px) {
}
@media (max-width:576px) {
}

View File

@@ -0,0 +1,127 @@
.Modal-width {
max-width: 900px;
}
.modal-body {
height: 430px;
overflow-y: scroll;
}
.grid-cols {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.card.active {
border: 1px solid #36D1D1 !important;
}
.btn-detail {
font-size: 11px;
padding: 4px 2px;
width: 33.333%;
}
.btn-detail-default {
background-color: #ecfccb;
color: #65a30d;
border: 1px solid #84cc16;
}
.btn-detail-edit {
background-color: #C3F2F2;
color: #0086BF;
border: 1px solid #009EE2;
}
.btn-detail-delete {
background-color: #F8E0E0;
color: #BF3737;
border: 1px solid #BF3737;
}
.btn-detail-default.active {
background-color: #84cc16;
color: #FFFFFF;
pointer-events: none;
cursor: none;
}
.btn-detail-default.active svg {
stroke: #ffffff;
}
.btn-detail-default:hover {
background-color: #84cc16;
color: #FFFFFF;
stroke: #ffffff;
}
.btn-detail-default svg {
stroke: #84cc16;
}
.btn-detail-default:hover svg {
stroke: #ffffff;
}
.btn-detail-edit:hover {
background-color: #009EE2;
color: #FFFFFF;
stroke: #ffffff;
}
.btn-detail-edit svg {
stroke: #009EE2;
}
.btn-detail-edit:hover svg {
stroke: #ffffff;
}
.btn-detail-delete:hover {
background-color: #BF3737;
color: #FFFFFF;
}
.btn-detail-delete svg {
stroke: #BF3737;
}
.btn-detail-delete:hover svg {
stroke: #ffffff;
}
@media (max-width:1366px) {
}
@media (max-width:1120px) {
.grid-cols {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.Modal-width {
max-width: 700px;
}
}
@media (max-width:992px) {
.grid-cols {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
@media (max-width:768px) {
.Modal-width {
max-width: 500px;
}
.grid-cols {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
@media (max-width:576px) {
.grid-cols {
grid-template-columns: repeat(1, minmax(0, 1fr));
}
}

View File

@@ -0,0 +1,104 @@
.modalCustom {
display: none;
position: fixed;
z-index: 1000;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgb(0, 0, 0);
background-color: rgba(0, 0, 0, 0.5);
}
.modal-content-custom {
width: 30%;
position: fixed;
transform: translate(50%, -50%);
top: 50%;
right: 50%;
}
.modal-content-custom .modal-body {
height: auto;
}
.errored {
animation: shake 300ms;
color: #eb3434 !important;
background-color: #fef2f2 !important;
border: 1px solid #eb3434 !important;
}
.select-alert {
border: 1px solid #FFFFFF;
}
.textLFontColor,
.form-control {
color: #797979;
font-size: 12px;
font-weight: 500;
}
.textLFontColor span {
font-size: 16px;
font-weight: 600;
}
.btnCreateNew {
font-size: 14px;
font-weight: 500;
background-color: #84CC16;
color: #FFFFFF;
border-radius: 8px;
padding: 10px 70px;
}
.btnCreateNew:hover {
background-color: #5f9213;
}
.btnCreateNew,
.btn-cancel2 {
width: 100% !important;
}
.spanTitleText {
font-size: 13px;
font-weight: 500;
color: #454545;
}
.data-load {
background-color: #F0F0F0;
border-radius: 6px;
padding: 5px;
height: 180px;
overflow-y: scroll;
}
@media (max-width:1366px) {
.modal-dialog-scrollable .modal-content {
max-height: auto;
overflow: hidden;
}
}
@media (max-width:992px) {
.modal-content-custom {
width: 50%;
}
}
@media (max-width:768px) {
.modal-content-custom {
width: 60%;
}
}
@media (max-width:576px) {
.modal-content-custom {
width: 90%;
}
}

View File

@@ -0,0 +1,252 @@
.sweet-alert button {
font-family: 'IRANYekanX';
}
.errored {
animation: shake 300ms;
color: #eb3434 !important;
background-color: #fef2f2 !important;
border: 1px solid #eb3434 !important;
border-radius: 7px;
}
.goToTop {
position: fixed;
bottom: -10px;
margin-right: 100px;
z-index: 100;
color: #fff;
background-color: #25acacd6;
display: none;
}
.goToTop:hover {
color: #fff;
background-color: #2ca4a4;
}
.width1 {
width: 5% !important;
}
.widthNumberCustom span {
width: 50px !important;
padding: 9px !important;
}
.width2 {
width: 18% !important;
}
.width3 {
width: 15% !important;
}
.width4 {
width: 15% !important;
}
.width5 {
width: 10% !important;
}
.width6 {
width: 15% !important;
}
.width7 {
width: 10% !important;
text-align: center;
}
.withdraw {
background-color: rgb(177 195 195) !important;
}
.operations-btns span {
font-size: 12px;
font-weight: 500;
color: #0B5959;
}
.btn-create {
background-color: #84CC16;
border-radius: 7px;
color: #ffffff;
padding: 3px 12px;
font-size: 12px;
font-style: normal;
font-weight: 400;
line-height: 24px;
}
.btn-operation-more {
background: #C7F8F8;
border: 1px solid #0B5959;
border-radius: 7px;
position: relative;
overflow: hidden;
color: #0B5959;
text-align: right;
font-size: 11px;
padding: 3px;
font-style: normal;
font-weight: 400;
line-height: normal;
white-space: nowrap;
}
.btn-operation-more:hover {
background: #ACD2D2;
}
.btn-delete-all {
display: flex;
align-items: center;
justify-content: space-around;
background-color: #FFCECE;
border-radius: 7px;
color: #BF3737;
padding: 3px 7px;
font-size: 12px;
font-style: normal;
font-weight: 400;
line-height: 24px;
transition: all ease-in .3s;
}
.btn-delete-all:hover {
background-color: #f3afaf;
}
.select-all {
border-radius: 7px;
padding: 6px 8px;
background-color: #3AD1D1;
}
.select-all input:checked[type="checkbox"] + label {
color: #ffffff;
}
.select-all label {
color: #ffffff !important;
}
/************************ Radio Button Input (Like Checkbox appearance) ************************/
.form-check-input[type="radio"],
.form-check-input[type="checkbox"] {
width: 15px;
height: 15px;
border-radius: 6px;
padding: 8px;
border: 1px solid #CFD3D4;
background-color: white;
background-position: center;
background-size: contain;
background-repeat: no-repeat;
appearance: none;
}
.form-check-input[type="radio"]:checked,
.form-check-input[type="checkbox"]:checked {
background-color: #148989;
border: 1px solid #ffffff !important;
background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="white" stroke-width="3"%3E%3Cpath stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" /%3E%3C/svg%3E');
background-size: 75%;
}
.form-check-input[type="radio"]:focus,
.form-check-input[type="checkbox"]:focus {
outline: none;
box-shadow: none;
}
.form-check-input[type="radio"] + label,
.form-check-input[type="checkbox"] + label {
color: #83898C;
}
.form-check-input[type="radio"]:checked + label,
.form-check-input[type="checkbox"]:checked + label {
color: #2B2F32;
}
/************************ Radio Button Input (Like Checkbox appearance) ************************/
@media (max-width: 1366px) {
.fineListModal-width {
max-width: 390px;
}
.Rtable .Rtable-row .Rtable-cell {
font-size: 12px;
}
.Rtable .Rtable-row .Rtable-cell .Rtable-cell--content {
font-size: 11px;
}
.btn-uploadingPD {
font-size: 10px;
}
}
@media (max-width: 767px) {
.goToTop {
position: fixed;
bottom: 54px;
margin-right: 39%;
z-index: 100;
color: #fff;
background-color: #25acac70;
}
.wrapper {
margin: 0 0 60px 0;
}
.Rtable--collapse .Rtable-row {
outline: none;
border: 1px solid #D2D2D2;
}
.Rtable .Rtable-row .Rtable-cell {
padding: 0;
}
.width1 {
width: 18% !important;
}
.width2 {
width: 50% !important;
}
.width8 {
width: 30% !important;
justify-content: end;
display: flex;
}
button.btn-print, button.btn-edit, button.btn-delete {
width: 32%;
}
button.btn-print, button.btn-edit span, button.btn-delete span {
display: unset;
}
}

View File

@@ -0,0 +1,400 @@
var urlPathname = location.pathname;
var filledBankCount = 0;
hasModalCreate = true;
$(document).ready(function () {
$('.loading').hide();
$(".modal-xxl").css('max-width', '520px');
$(".select2Option").select2({
language: "fa",
dir: "rtl",
dropdownParent: $('#MainModal'),
templateResult: function (data, container) {
if (data.element) {
$(container).addClass($(data.element).attr("class"));
}
return data.text;
}
});
$("#CardNumber").each(function () {
$("#CardNumber").mask("0000-0000-0000-0000");
$("#CardNumber").attr("placeholder", "XXXX-XXXX-XXXX-XXXX");
});
$("#ShebaNumber").each(function () {
$("#ShebaNumber").mask("IR-00-0000-0000-0000-0000-0000-00");
$("#ShebaNumber").attr("placeholder", "IR-XX-XXXX-XXXX-XXXX-XXXX-XXXX-XX");
});
$("#BankAccountNumber").each(function () {
$("#BankAccountNumber").unmask();
$("#BankAccountNumber").attr("placeholder", "");
});
$('#BankAccountNumber').on('keypress', function (e) {
if (e.which < 48 || e.which > 57) {
e.preventDefault();
}
});
ajaxCreatePersonals();
ajaxCreateBanks();
});
function ajaxCreatePersonals() {
$.ajax({
url: employeeListAjax,
type: 'GET',
success: function (response) {
if (response.success) {
var employees = response.data;
var employeeOptionsHtml = '<option value="0">انتخاب پرسنل ...</option>';
employees.forEach(function (employee) {
employeeOptionsHtml += `<option value="${employee.id}">${employee.employeeFullName}</option>`;
});
$('#employeeSelectCreate').html(employeeOptionsHtml);
} else {
$('.alert-msg').show();
$('.alert-msg p').text(response.message);
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
}
},
error: function (xhr, status, error) {
console.error(xhr.responseText);
}
});
}
function ajaxCreateBanks() {
$.ajax({
url: bankListAjax,
type: 'GET',
success: function (response) {
if (response.success) {
var banks = response.data;
var bankOptionsHtml = '<option value="0">انتخاب بانک ...</option>';
banks.forEach(function (bank) {
bankOptionsHtml += `<option value="${bank.id}">${bank.bankName}</option>`;
});
$('#bankSelectCreate').html(bankOptionsHtml);
} else {
$('.alert-msg').show();
$('.alert-msg p').text(response.message);
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
}
},
error: function (xhr, status, error) {
console.error(xhr.responseText);
}
});
}
$(document).on('click', 'button[data-edit-id]', function () {
// Get the data attributes from the clicked button
var editId = $(this).data('edit-id');
var employeeId = $(this).data('edit-employeeid');
var employeeName = $(this).data('edit-employeename');
var bankId = $(this).data('edit-bankid');
var cardNumber = $(this).data('edit-cardnumber');
var shebaNumber = $(this).data('edit-sheba-number');
var bankAccountNumber = $(this).data('edit-bankaccountnumber');
$('#modalCustom').find('#editId').val(editId);
$('#modalCustom').find('#bankSelectEdit').val(bankId);
$('#modalCustom').find('#employeeId').val(employeeId);
$('#CardNumberEdit').mask("0000-0000-0000-0000", {
placeholder: "XXXX-XXXX-XXXX-XXXX"
});
$('#CardNumberEdit').val(cardNumber).keyup();
$('#ShebaNumberEdit').mask("IR-00-0000-0000-0000-0000-0000-00", {
placeholder: "IR-XX-XXXX-XXXX-XXXX-XXXX-XXXX-XX"
});
$('#ShebaNumberEdit').val(shebaNumber).keyup();
//$('#modalCustom').find('#CardNumberEdit').val(cardNumber);
//$('#modalCustom').find('#ShebaNumberEdit').val(shebaNumber);
$('#modalCustom').find('#BankAccountNumberEdit').val(bankAccountNumber);
$('#EmployeeNameShow').text(employeeName);
ajaxBanksListEdit(bankId);
});
$('#createData').on('click', SaveDataAjax);
function SaveDataAjax() {
var loading = $('#createData .spinner-loading');
var employeeSelectName = $('#select2-employeeSelectCreate-container').text();
var employeeSelect = $('#employeeSelectCreate').val();
var bankSelectName = $('#select2-bankSelectCreate-container').text();
var bankSelect = $('#bankSelectCreate').val();
var cardNumber = $('#CardNumber');
var shebaNumber = $('#ShebaNumber');
var bankAccountNumber = $('#BankAccountNumber');
if (cardNumber.val() !== '') {
filledBankCount++;
}
if (shebaNumber.val() !== '') {
filledBankCount++;
}
if (bankAccountNumber.val() !== '') {
filledBankCount++;
}
if (employeeSelect === "0") {
$('.alert-msg').show();
$('.alert-msg p').text('لطفا اسامی پرسنل را کلیک و مشخص نمائید');
$('.select-alert-employee').addClass('errored');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
$('.select-alert-employee').removeClass('errored');
}, 3500);
return;
}
if (bankSelect === "0") {
$('.alert-msg').show();
$('.alert-msg p').text('لطفا نام بانک را کلیک و مشخص نمائید');
$('.select-alert-bank').addClass('errored');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
$('.select-alert-bank').removeClass('errored');
}, 3500);
return;
}
if (!cardNumber.val() && !shebaNumber.val() && !bankAccountNumber.val()) {
cardNumber.addClass('errored');
shebaNumber.addClass('errored');
bankAccountNumber.addClass('errored');
$('.alert-msg').show();
$('.alert-msg p').text('لطفا حداقل یکی از فیلدها را وارد نمائید');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
cardNumber.removeClass('errored');
shebaNumber.removeClass('errored');
bankAccountNumber.removeClass('errored');
}, 3500);
return;
}
var cardNumberLength = cardNumber.val().length;
if (cardNumberLength > 0 && cardNumberLength !== 19) {
cardNumber.addClass('errored');
$('.alert-msg').show();
$('.alert-msg p').text('شماره کارت باید 16 رقم باشد');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
cardNumber.removeClass('errored');
}, 3500);
return;
}
var shebaNumberLength = shebaNumber.val().length;
if (shebaNumber.val() && shebaNumberLength !== 33) {
shebaNumber.addClass('errored');
$('.alert-msg').show();
$('.alert-msg p').text('شماره کارت باید 24 رقم باشد');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
shebaNumber.removeClass('errored');
}, 3500);
return;
}
$('#createData').addClass('disable');
var data = $('#create-form').serialize();
$.ajax({
async: false,
dataType: 'json',
type: 'POST',
url: saveNewEmployeeBankAjax,
headers: { "RequestVerificationToken": antiForgeryToken },
data: data,
success: function (response) {
if (response.success) {
loading.show();
$('.alert-success-msg').show();
$('.alert-success-msg p').text(response.message);
setTimeout(function () {
$('.alert-success-msg').hide();
$('.alert-success-msg p').text('');
}, 2000);
$('#emptyData').addClass("d-none");
loadDataCreate(response.id, employeeSelectName, bankSelectName, filledBankCount, employeeSelect, bankSelect, cardNumber.val(), shebaNumber.val(), bankAccountNumber.val());
$('#EmployeeBankListAjax').html('');
loadEmployeeBankList();
loading.hide();
$('#createData').removeClass('disable');
} else {
$('.alert-msg').show();
$('.alert-msg p').text(response.message);
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
loading.hide();
$('#createData').removeClass('disable');
}
},
error: function (err) {
loading.hide();
$('#createData').removeClass('disable');
console.log(err);
}
});
}
function loadDataCreate(id, employeeName, bankName, bankCount, employeeId, bankId, cardNumber, shebaNumber, bankAccountNumber) {
var n = $('#dataLoad .Rtable-row').length + 1;
var html = `<div></div>
<div class="Rtable-row align-items-center openAction load-create-row" id="Employees" data-employee-id="${id}">
<div class="Rtable-cell width1 widthNumberCustom1">
<label for="${n}" class="Rtable-cell--content prevent-select">
<span class="d-flex justify-content-center align-items-center justify-content-center row-number">
${n}
</span>
</label>
</div>
<div class="Rtable-cell justify-content-start width2">
<div class="Rtable-cell--content text-start">${employeeName}</div>
</div>
<div class="Rtable-cell d-md-flex justify-content-center d-none width3">
<div class="Rtable-cell--content">${bankCount}</div>
</div>
<div class="Rtable-cell d-md-block d-none width4">
<div class="Rtable-cell--content">${bankName}</div>
</div>
<div class="Rtable-cell width5">
<div class="Rtable-cell--content align-items-center justify-content-end d-flex text-end">
<button onclick="alertRemoveBank(${id})" type="button" class="btn-delete d-md-block d-none">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-width="1.5" stroke-linecap="round" />
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-width="1.5" stroke-linecap="round" />
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-width="1.5" stroke-linecap="round" />
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-width="1.5" stroke-linecap="round" />
</svg>
<span class="mx-1">حذف</span>
</button>
</div>
</div>
</div>`;
//<button type="button" onclick="openModalEdit()"
//data-edit-id="${id}"
//data-edit-employeeId="${employeeId}"
//data-edit-employeeName="${employeeName}"
//data-edit-bankId="${bankId}"
//data-edit-cardNumber="${cardNumber}"
//data-edit-sheba-number="${shebaNumber}"
//data-edit-bankAccountNumber="${bankAccountNumber}"
//class="btn-edit position-relative d-md-block d-none">
// <svg width="20" height="20" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
// <path d="M12.6027 6.838L5.85304 13.5876C5.84201 13.5987 5.83107 13.6096 5.8202 13.6204C5.65773 13.7825 5.5139 13.9261 5.41254 14.1051C5.31117 14.2841 5.2621 14.4813 5.20667 14.704C5.20296 14.7189 5.19923 14.7339 5.19545 14.7491L4.5813 17.2057C4.57908 17.2145 4.57686 17.2234 4.57462 17.2323C4.53537 17.389 4.49347 17.5564 4.47972 17.6969C4.46458 17.8516 4.46811 18.1127 4.67752 18.3221L5.03035 17.9693L4.67752 18.3221C4.88693 18.5315 5.14799 18.535 5.30272 18.5199C5.44326 18.5062 5.6106 18.4643 5.76728 18.425C5.77622 18.4228 5.78512 18.4205 5.79398 18.4183L8.25057 17.8042C8.26569 17.8004 8.28069 17.7967 8.29558 17.793C8.51832 17.7375 8.71549 17.6885 8.89452 17.5871C9.07356 17.4857 9.21708 17.3419 9.37921 17.1794C9.39005 17.1686 9.40097 17.1576 9.412 17.1466L16.1616 10.397L16.1849 10.3737C16.4983 10.0603 16.7684 9.79025 16.9556 9.54492C17.1562 9.282 17.3081 8.98958 17.3081 8.6292C17.3081 8.26759 17.1541 7.97384 16.9522 7.71001C16.7633 7.46303 16.4905 7.1903 16.1731 6.87292L16.1499 6.84972L16.1267 6.82652C15.8093 6.5091 15.5366 6.23634 15.2896 6.04738C15.0258 5.84553 14.732 5.69156 14.3704 5.69156C14.01 5.69156 13.7176 5.84345 13.4547 6.04405C13.2094 6.23123 12.9393 6.5013 12.6259 6.81474L12.6027 6.838Z" stroke-width="1.5" stroke="#4DA9D1" />
// <path d="M11.9939 7.20397L14.8457 5.30273L17.6976 8.15459L15.7964 11.0064L11.9939 7.20397Z" fill="#4DA9D1" />
// </svg>
// <span class="mx-1">ویرایش</span>
// </button>
filledBankCount = 0;
$('.data-load .wrapper').show();
$('#dataLoad').append(html);
}
function alertRemoveBank(id) {
swal({
title: "آیا از حذف این حساب اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: true,
closeOnCancel: true
}, function (isConfirm) {
if (isConfirm) {
removeBank(id);
}
});
}
function removeBank(id) {
$.ajax({
async: false,
dataType: 'json',
type: 'POST',
url: removeBankAjax,
headers: { "RequestVerificationToken": antiForgeryToken },
data: { id: Number(id) },
success: function (response) {
if (response.success) {
$('.alert-success-msg').show();
$('.alert-success-msg p').text(response.message);
setTimeout(function () {
$('.alert-success-msg').hide();
$('.alert-success-msg p').text('');
}, 2000);
$(`[data-employee-id="${id}"]`).remove();
updateRows();
$('#EmployeeBankListAjax').html('');
loadEmployeeBankList();
} else {
$('.alert-msg').show();
$('.alert-msg p').text(response.message);
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
}
},
error: function (err) {
console.log(err);
}
});
}
function updateRows() {
$('.load-create-row.width1').each(function (index) {
$(this).find('span.row-number').text(index + 1);
});
}
function openModalEdit() {
var modalCustom = document.getElementById("modalCustom");
modalCustom.style.display = "block";
}

View File

@@ -0,0 +1,283 @@
$(document).ready(function () {
$('.loading').hide();
$(".modal-xxl").css('max-width', '520px');
$(".select2Option").select2({
language: "fa",
dir: "rtl",
dropdownParent: $('#MainModal'),
templateResult: function (data, container) {
if (data.element) {
$(container).addClass($(data.element).attr("class"));
}
return data.text;
}
});
//$("#CardNumberEdit").each(function () {
// $("#CardNumberEdit").mask("0000-0000-0000-0000");
// $("#CardNumberEdit").attr("placeholder", "XXXX-XXXX-XXXX-XXXX");
//});
//$("#ShebaNumberEdit").each(function () {
// $("#ShebaNumberEdit").mask("IR-00-0000-0000-0000-0000-0000-00");
// $("#ShebaNumberEdit").attr("placeholder", "IR-XX-XXXX-XXXX-XXXX-XXXX-XXXX-XX");
//});
//$("#BankAccountNumberEdit").each(function () {
// $("#BankAccountNumberEdit").unmask();
// $("#BankAccountNumberEdit").attr("placeholder", "");
//});
$('#BankAccountNumberEdit').on('keypress', function (e) {
if (e.which < 48 || e.which > 57) {
e.preventDefault();
}
});
loadDetailsAjax();
});
//var cardNumber = 0;
$(document).on('click', 'button[data-edit-id]', function () {
// Get the data attributes from the clicked button
var editId = $(this).data('edit-id');
var employeeId = $(this).data('edit-employeeid');
var employeeName = $(this).data('edit-employeename');
var bankId = $(this).data('edit-bankid');
var cardNumber = $(this).data('edit-cardnumber');
var shebaNumber = $(this).data('edit-sheba-number');
var bankAccountNumber = $(this).data('edit-bankaccountnumber');
$('#modalCustom').find('#editId').val(editId);
$('#modalCustom').find('#bankSelectEdit').val(bankId);
$('#modalCustom').find('#employeeId').val(employeeId);
$('#CardNumberEdit').mask("0000-0000-0000-0000", {
placeholder: "XXXX-XXXX-XXXX-XXXX"
});
$('#CardNumberEdit').val(cardNumber).keyup();
$('#ShebaNumberEdit').mask("IR-00-0000-0000-0000-0000-0000-00", {
placeholder: "IR-XX-XXXX-XXXX-XXXX-XXXX-XXXX-XX"
});
$('#ShebaNumberEdit').val(shebaNumber).keyup();
//$('#modalCustom').find('#CardNumberEdit').val(cardNumber);
//$('#modalCustom').find('#ShebaNumberEdit').val(shebaNumber);
$('#modalCustom').find('#BankAccountNumberEdit').val(bankAccountNumber);
$('#EmployeeNameShow').text(employeeName);
ajaxBanksListEdit(bankId);
});
function loadDetailsAjax() {
var html = '';
var index = 0;
$.ajax({
async: false,
contentType: 'charset=utf-8',
dataType: 'json',
type: 'GET',
url: loadDetailsAjaxUrl,
data: { employeeId: employeeId },
headers: { "RequestVerificationToken": antiForgeryToken },
success: function (response) {
var responseData = response.data;
if (response.success) {
if (responseData.bankInformation.length > 0) {
responseData.bankInformation.forEach(function (item) {
index++;
html += `<div class="" data-bank-information-id="${item.id}">
<div id="DefaultDiv" class="card border p-2 ${item.isDefault ? `active` : ``}" data-default-div-id="${item.id}">
<div class="mb-2" id="detailBankName">${item.bankName}</div>
<div>
<div class="d-flex align-items-center justify-content-between" style="font-size: 12px;">
<div>شماره کارت:</div>
<div id="detailCardNumber">${item.cardNumber ?? `-`}</div>
</div>
<div class="d-flex align-items-center justify-content-between" style="font-size: 12px;">
<div>شماره شبا:</div>
<div id="detailShebaNumber">${item.shebaNumber ?? `-`}</div>
</div>
<div class="d-flex align-items-center justify-content-between" style="font-size: 12px;">
<div>شماره حساب:</div>
<div id="detailBankAccountNumber">${item.bankAccountNumber ?? `-`}</div>
</div>
</div>
<div class="d-flex align-items-center justify-content-between gap-1 mt-3">
<button type="button" id="DefaultBtn" data-default-btn-id="${item.id}" onclick="setDefaultAction(${item.id})" class="d-flex align-items-center justify-content-center gap-1 btn-detail btn-detail-default ${item.isDefault ? `active` : ``}">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="9" stroke-width="1.5" />
<path d="M8 12L11 15L16 9" stroke-width="1.5" stroke-linecap="round" />
</svg>
پیش‌فرض
</button>
<button type="button" onclick="openModalEdit()"
data-edit-id="${item.id}"
data-edit-employeeId="${responseData.employeeId}"
data-edit-employeeName="${responseData.employeeName}"
data-edit-bankId="${item.bankId}"
data-edit-cardNumber="${item.cardNumber}"
data-edit-sheba-number="${item.shebaNumber}"
data-edit-bankAccountNumber="${item.bankAccountNumber}"
class="d-flex align-items-center justify-content-center gap-1 btn-detail btn-detail-edit">
<svg width="20" height="20" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3.82937 11.3025L3.82938 11.3025L3.85116 11.2971L4.80323 11.0591C4.81835 11.0553 4.83335 11.0516 4.84824 11.0479C5.07098 10.9924 5.26815 10.9434 5.44718 10.842L5.20084 10.4069L5.44719 10.842C5.62622 10.7406 5.76974 10.5968 5.93187 10.4343C5.94271 10.4235 5.95363 10.4125 5.96465 10.4015L9.92243 6.44372C9.93162 6.43452 9.94073 6.42542 9.94975 6.41642C10.0738 6.29257 10.1806 6.18595 10.2587 6.07289C10.6132 5.55975 10.6132 4.88078 10.2587 4.36764C10.1806 4.25458 10.0738 4.14797 9.94976 4.02412C9.94074 4.01512 9.93163 4.00602 9.92244 3.99682L9.92252 3.99674L9.91869 3.99307C9.91076 3.98515 9.90292 3.97729 9.89513 3.96949C9.77128 3.84546 9.66466 3.73868 9.55161 3.66057L9.2674 4.07194L9.55161 3.66057C9.03847 3.30605 8.35949 3.30605 7.84635 3.66057C7.73329 3.73868 7.62667 3.84546 7.50282 3.96949C7.49381 3.97851 7.48472 3.98762 7.47553 3.99681L3.51775 7.95459C3.50673 7.96561 3.49578 7.97653 3.48492 7.98737C3.32245 8.1495 3.17862 8.29303 3.07725 8.47206C2.97589 8.65109 2.92682 8.84826 2.87138 9.071C2.86768 9.08589 2.86394 9.10089 2.86016 9.11602L2.6167 10.0899C2.61448 10.0987 2.61226 10.1076 2.61002 10.1166C2.57078 10.2732 2.52887 10.4406 2.51512 10.5811C2.49998 10.7359 2.50351 10.9969 2.71292 11.2063C2.92233 11.4157 3.18339 11.4193 3.33812 11.4041C3.47865 11.3904 3.64598 11.3485 3.80266 11.3092C3.8116 11.307 3.82051 11.3048 3.82937 11.3025Z"/>
<path d="M7.24915 4.34932L8.98894 3.18945L10.7287 4.92925L9.56887 6.66904L7.24915 4.34932Z"/>
</svg>
ویرایش
</button>
<button type="button" onclick="alertRemoveBank(${item.id})" class="d-flex align-items-center justify-content-center gap-1 btn-detail btn-detail-delete">
<svg width="20" height="20" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5.50937 8.4082L5.50937 6.66841" stroke-linecap="round" />
<path d="M8.40903 8.4082L8.40903 6.66841" stroke-linecap="round" />
<path d="M1.73981 3.76953H12.1786V3.76953C12.1509 3.76953 12.1371 3.76953 12.1254 3.76967C11.0392 3.78236 10.1617 4.65987 10.149 5.74616C10.1488 5.75784 10.1488 5.77166 10.1488 5.79929V8.11902C10.1488 9.22934 10.1488 9.7845 9.93452 10.2094C9.7418 10.5914 9.43161 10.9016 9.04954 11.0943C8.62467 11.3086 8.06951 11.3086 6.95919 11.3086V11.3086C5.84888 11.3086 5.29372 11.3086 4.86885 11.0943C4.48678 10.9016 4.17659 10.5914 3.98387 10.2094C3.76957 9.7845 3.76957 9.22934 3.76957 8.11902V5.7993C3.76957 5.77166 3.76957 5.75784 3.76943 5.74616C3.75674 4.65987 2.87923 3.78236 1.79294 3.76967C1.78126 3.76953 1.76744 3.76953 1.73981 3.76953V3.76953Z" stroke-linecap="round" />
<path d="M5.50934 2.02929C5.50934 2.02929 5.7993 1.44922 6.95917 1.44922C8.11903 1.44922 8.409 2.02915 8.409 2.02915" stroke-linecap="round" />
</svg>
حذف
</button>
</div>
</div>
</div>`;
});
$('#loadDetails').html(html);
} else {
html += `<div class="text-center bg-white d-flex align-items-center justify-content-center">
<div class="">
<img src="/assetsclient/images/empty.png" alt="" class="img-fluid" />
<h5>اطلاعاتی وجود ندارد.</h5>
</div>
</div>`;
$('#loadDetails').html(html);
}
}
},
failure: function (response) {
console.log(response);
}
});
}
function setDefaultAction(id) {
$.ajax({
async: false,
dataType: 'json',
type: 'POST',
url: setDefaultAjaxUrl,
headers: { "RequestVerificationToken": antiForgeryToken },
data: { bankId: Number(id) },
success: function (response) {
if (response.success) {
$('.alert-success-msg').show();
$('.alert-success-msg p').text(response.message);
setTimeout(function () {
$('.alert-success-msg').hide();
$('.alert-success-msg p').text('');
}, 2000);
var targetElement = $(`[data-bank-information-id="${id}"]`);
var parentElement = targetElement.closest('.d-grid');
targetElement.prependTo(parentElement);
$(`#DefaultDiv.active`).removeClass("active");
$(`#DefaultBtn.active`).removeClass("active");
$(`[data-default-div-id="${id}"]`).addClass("active");
$(`[data-default-btn-id="${id}"]`).addClass("active");
targetElement[0].scrollIntoView({
behavior: 'smooth',
block: 'center'
});
} else {
$('.alert-msg').show();
$('.alert-msg p').text(response.message);
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
}
},
error: function (err) {
console.log(err);
}
});
}
function alertRemoveBank(id) {
swal({
title: "آیا از حذف این حساب اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: true,
closeOnCancel: true
}, function (isConfirm) {
if (isConfirm) {
removeBank(id);
}
});
}
function removeBank(id) {
$.ajax({
async: false,
dataType: 'json',
type: 'POST',
url: removeBankAjax,
headers: { "RequestVerificationToken": antiForgeryToken },
data: { id: Number(id) },
success: function (response) {
if (response.success) {
$('.alert-success-msg').show();
$('.alert-success-msg p').text(response.message);
setTimeout(function () {
$('.alert-success-msg').hide();
$('.alert-success-msg p').text('');
}, 2000);
countData--;
$(`[data-bank-information-id="${id}"]`).remove();
if (countData === 0) {
$('#EmployeeBankListAjax').html('');
loadEmployeeBankList();
$('#MainModal').modal('hide');
}
} else {
$('.alert-msg').show();
$('.alert-msg p').text(response.message);
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
}
},
error: function (err) {
console.log(err);
}
});
}
function openModalEdit() {
var modalCustom = document.getElementById("modalCustom");
modalCustom.style.display = "block";
}

View File

@@ -0,0 +1,158 @@
var hasModalCreate = false;
$(document).ready(function () {
$('.closeCustomModal').on('click', function() {
var modalCustom = document.getElementById("modalCustom");
modalCustom.style.display = "none";
});
});
function ajaxBanksListEdit(id) {
$.ajax({
url: bankListAjax,
type: 'GET',
success: function (response) {
if (response.success) {
var banks = response.data;
var bankOptionsHtml = '<option value="0">انتخاب بانک ...</option>';
banks.forEach(function (bank) {
bankOptionsHtml += `<option value="${bank.id}" ${bank.id === id ? `selected` : ``}>${bank.bankName}</option>`;
});
$('#bankSelect2Edit').html(bankOptionsHtml);
} else {
$('.alert-msg').show();
$('.alert-msg p').text(response.message);
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
}
},
error: function (xhr, status, error) {
console.error(xhr.responseText);
}
});
}
$('#editData').on('click', SaveEditDataAjax);
function SaveEditDataAjax() {
var loading = $('#editData .spinner-loading');
var bankSelect = $('#bankSelectEdit').val();
var cardNumber = $('#CardNumberEdit');
var shebaNumber = $('#ShebaNumberEdit');
var bankAccountNumber = $('#BankAccountNumberEdit');
if (bankSelect === "0") {
$('.alert-msg').show();
$('.alert-msg p').text('لطفا نام بانک را کلیک و مشخص نمائید');
$('.select-alert-bank').addClass('errored');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
$('.select-alert-bank').removeClass('errored');
}, 3500);
return;
}
if (!cardNumber.val() && !shebaNumber.val() && !bankAccountNumber.val()) {
cardNumber.addClass('errored');
shebaNumber.addClass('errored');
bankAccountNumber.addClass('errored');
$('.alert-msg').show();
$('.alert-msg p').text('لطفا حداقل یکی از فیلدها را وارد نمائید');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
cardNumber.removeClass('errored');
shebaNumber.removeClass('errored');
bankAccountNumber.removeClass('errored');
}, 3500);
return;
}
var cardNumberLength = cardNumber.val().length;
if (cardNumberLength > 0 && cardNumberLength !== 19) {
cardNumber.addClass('errored');
$('.alert-msg').show();
$('.alert-msg p').text('شماره کارت باید 16 رقم باشد');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
cardNumber.removeClass('errored');
}, 3500);
return;
}
var shebaNumberLength = shebaNumber.val().length;
if (shebaNumber.val() && shebaNumberLength !== 33) {
shebaNumber.addClass('errored');
$('.alert-msg').show();
$('.alert-msg p').text('شماره کارت باید 24 رقم باشد');
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
shebaNumber.removeClass('errored');
}, 3500);
return;
}
$('#editData').addClass('disable');
var data = $('#edit-form').serialize();
$.ajax({
async: false,
dataType: 'json',
type: 'POST',
url: saveEditEmployeeBankAjax,
headers: { "RequestVerificationToken": antiForgeryToken },
data: data,
success: function (response) {
if (response.success) {
loading.show();
$('.alert-success-msg').show();
$('.alert-success-msg p').text(response.message);
setTimeout(function () {
$('.alert-success-msg').hide();
$('.alert-success-msg p').text('');
}, 2000);
$('#modalCustom').hide();
if (hasModalCreate) {
} else {
loadDetailsAjax();
}
$('#EmployeeBankListAjax').html('');
loadEmployeeBankList();
loading.hide();
$('#editData').removeClass('disable');
} else {
$('.alert-msg').show();
$('.alert-msg p').text(response.message);
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
loading.hide();
$('#editData').removeClass('disable');
}
},
error: function (err) {
loading.hide();
$('#createData').removeClass('disable');
console.log(err);
}
});
}

View File

@@ -0,0 +1,368 @@
var searchName = '';
var searchBank = '';
$(document).ready(function () {
loadEmployeeBankList();
ajaxPersonals();
ajaxBanks();
$(".select2OptionIndex").select2({
language: "fa",
dir: "rtl"
});
$(".select2OptionIndexMobile").select2({
language: "fa",
dir: "rtl",
dropdownParent: $('#searchModal'),
templateResult: function (data, container) {
if (data.element) {
$(container).addClass($(data.element).attr("class"));
}
return data.text;
}
});
//******************** انتخاب همه ی چک باکس ها ********************
$(".checkAll").change(function () {
//let dataValYear = $('#year').val();
//let dataValMonth = $('#month').val();
//let dataValPersonel = Number($('#employeeId').val());
//if ((dataValYear == '' || dataValMonth == '') && dataValPersonel == 0) {
//$('#dropdown-year').addClass("errored");
//$('#dropdown-month').addClass("errored");
//$(this).prop('checked', false);
//$('.alert-msg').show();
//$('.alert-msg p').text('جهت انتخاب گروهی قراردادها ابتدا میبایست سال و ماه مورد نظر را انتخاب نمائید.');
//setTimeout(function () {
// $('.alert-msg').hide();
// $('.alert-msg p').text('');
// $('#dropdown-year').removeClass("errored");
// $('#dropdown-month').removeClass("errored");
//},
//3500);
//} else {
//loadAllToPrint();
$('input:checkbox').not(this).prop('checked', this.checked);
//}
});
//******************** انتخاب همه ی چک باکس ها ********************
});
$(document).on('click', ".openAction", function () {
if (window.matchMedia('(max-width: 767px)').matches) {
$(this).next().find(".operations-btns").slideToggle(500);
$(".operations-btns").not($(this).next().find(".operations-btns")).slideUp(500);
}
});
$(document).on('click', '.btn-search-click, .btn-search-click-mobile', function () {
let isMobile = $(this).hasClass('btn-search-click-mobile');
searchName = isMobile ? $('#employeeSelectIndexMobile') : $('#employeeSelectIndex');
searchBank = $('#bankSelectIndex');
$('.btn-clear-filter').removeClass('disable');
if (searchName.val() === "0" && searchBank.val() === "0") {
$('.btn-clear-filter').addClass('disable');
}
if (isMobile) {
$('#searchModal').modal('hide');
}
$('#EmployeeBankListAjax').html('');
loadEmployeeBankList();
});
$(document).on('click', '.btn-clear-filter', function () {
window.location.reload();
});
// همگام‌سازی متن ورودی برای موبایل و دسکتاپ
$('.d-none.d-md-block .employeeName').on('input', function () {
var desktopInput = $(this).val();
$('#searchModal .employeeName').val(desktopInput);
});
$('#searchModal .employeeName').on('input', function () {
var mobileInput = $(this).val();
$('.d-none.d-md-block .employeeName').val(mobileInput);
});
// همگام‌سازی متن ورودی برای موبایل و دسکتاپ
$('.goToTop').on('click', function () {
$('html, body').animate({ scrollTop: 0 }, 360);
return false;
});
$(window).scroll(function () {
//if ($(window).scrollTop() + $(window).height() > $(document).height() - 600) {
// loadFineList();
//}
if ($(this).scrollTop() > 100) {
$('.goToTop').show().fadeIn();
} else {
$('.goToTop').fadeOut().hide();
}
});
function loadEmployeeBankList() {
var searchViewModel = {
'EmployeeId': $('#employeeSelectIndex').val(),
'BankId': $('#bankSelectIndex').val(),
}
var html = '';
var index = 0;
$.ajax({
async: false,
contentType: 'charset=utf-8',
dataType: 'json',
type: 'GET',
url: employeeBankInfoListLoadDataAjax,
data: searchViewModel,
headers: { "RequestVerificationToken": antiForgeryToken },
success: function (response) {
var responseData = response.data;
if (response.success) {
if (responseData.length > 0) {
responseData.forEach(function (item) {
index++;
html += `<div></div>
<div class="Rtable-row align-items-center openAction ${item.isBlack === "true" ? `withdraw` : ``}" id="Employees">
<div class="Rtable-cell width1 widthNumberCustom1">
<label for="${index}" class="Rtable-cell--content prevent-select">
<span class="d-flex justify-content-center align-items-center justify-content-center">
<input id="${index}" type="checkbox" class="d-none form-check-input foo" name="foo" value="${item.Id}">
${index}
</span>
</label>
</div>
<div class="Rtable-cell justify-content-start width2">
<div class="Rtable-cell--content text-start">${item.employeeName}</div>
</div>
<div class="Rtable-cell d-md-flex justify-content-center d-none width3">
<div class="Rtable-cell--content">${item.personnelCode}</div>
</div>
<div class="Rtable-cell d-md-block d-none width4">
<div class="Rtable-cell--content">${item.totalBankAccountsCount}</div>
</div>
<div class="Rtable-cell d-md-block d-none width5">
<div class="Rtable-cell--content ">بانک ها</div>
</div>
<div class="Rtable-cell width6">
<div class="Rtable-cell--content align-items-center justify-content-end d-flex text-end">
<button class="btn-edit position-relative d-md-block d-none" style="width: auto;" onclick="openEditEmployeeBankModal(${item.employeeId})">
<span class="mx-1 d-block">جزئیات</span>
</button>
<button onclick="deleteEmployeeBankModal(${item.employeeId})" type="button" class="btn-delete d-md-block d-none">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-width="1.5" stroke-linecap="round" />
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-width="1.5" stroke-linecap="round" />
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-width="1.5" stroke-linecap="round" />
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-width="1.5" stroke-linecap="round" />
</svg>
<span class="mx-1">حذف</span>
</button>
<button type="button" class="btn-operation-more btn-open-div position-relative d-md-none d-block">
<span class="align-items-center d-flex justify-content-center">
<span class="mx-1">عملیات</span>
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16" fill="currentColor">
<circle cx="8.4001" cy="8.39922" r="1.2" transform="rotate(90 8.4001 8.39922)"/>
<circle cx="8.4001" cy="4.39922" r="1.2" transform="rotate(90 8.4001 4.39922)"/>
<circle cx="8.4001" cy="12.3992" r="1.2" transform="rotate(90 8.4001 12.3992)"/>
</svg>
</span>
</button>
</div>
</div>
</div>
<div class="operation-div w-100">
<div class="operations-btns">
<div class="row p-0">
<div class="d-flex align-items-center justify-content-between">
<span class="span1">شماره پرسنلی:</span>
<span class="span1">${item.personnelCode}</span>
</div>
<div class="d-flex align-items-center justify-content-between">
<span class="span1">تعداد کارت ثبت شده:</span>
<span class="span1">${item.totalBankAccountsCount}</span>
</div>
<div class="d-flex align-items-center justify-content-between">
<span class="span1">بانک:</span>
<span class="span1">بانک</span>
</div>
<div class="col-md-12 col-12 text-center">
<button onclick="openEditEmployeeBankModal(${item.employeeId})" class="btn-edit position-relative">
<svg width="20" height="20" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12.6027 6.838L5.85304 13.5876C5.84201 13.5987 5.83107 13.6096 5.8202 13.6204C5.65773 13.7825 5.5139 13.9261 5.41254 14.1051C5.31117 14.2841 5.2621 14.4813 5.20667 14.704C5.20296 14.7189 5.19923 14.7339 5.19545 14.7491L4.5813 17.2057C4.57908 17.2145 4.57686 17.2234 4.57462 17.2323C4.53537 17.389 4.49347 17.5564 4.47972 17.6969C4.46458 17.8516 4.46811 18.1127 4.67752 18.3221L5.03035 17.9693L4.67752 18.3221C4.88693 18.5315 5.14799 18.535 5.30272 18.5199C5.44326 18.5062 5.6106 18.4643 5.76728 18.425C5.77622 18.4228 5.78512 18.4205 5.79398 18.4183L8.25057 17.8042C8.26569 17.8004 8.28069 17.7967 8.29558 17.793C8.51832 17.7375 8.71549 17.6885 8.89452 17.5871C9.07356 17.4857 9.21708 17.3419 9.37921 17.1794C9.39005 17.1686 9.40097 17.1576 9.412 17.1466L16.1616 10.397L16.1849 10.3737C16.4983 10.0603 16.7684 9.79025 16.9556 9.54492C17.1562 9.282 17.3081 8.98958 17.3081 8.6292C17.3081 8.26759 17.1541 7.97384 16.9522 7.71001C16.7633 7.46303 16.4905 7.1903 16.1731 6.87292L16.1499 6.84972L16.1267 6.82652C15.8093 6.5091 15.5366 6.23634 15.2896 6.04738C15.0258 5.84553 14.732 5.69156 14.3704 5.69156C14.01 5.69156 13.7176 5.84345 13.4547 6.04405C13.2094 6.23123 12.9393 6.5013 12.6259 6.81474L12.6027 6.838Z" stroke-width="1.5" stroke="#4DA9D1" />
<path d="M11.9939 7.20397L14.8457 5.30273L17.6976 8.15459L15.7964 11.0064L11.9939 7.20397Z" fill="#4DA9D1" />
</svg>
<span class="mx-1">جزئیات</span>
</button>
<button onclick="deleteEmployeeBankModal(${item.employeeId})" type="button" class="btn-delete">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 22 22" fill="none" stroke="currentColor">
<path d="M8.70825 13.2915L8.70825 10.5415" stroke-width="1.5" stroke-linecap="round" />
<path d="M13.2917 13.2915L13.2917 10.5415" stroke-width="1.5" stroke-linecap="round" />
<path d="M2.75 5.9585H19.25V5.9585C18.122 5.9585 17.558 5.9585 17.1279 6.17946C16.7561 6.3704 16.4536 6.67297 16.2626 7.04469C16.0417 7.47488 16.0417 8.03886 16.0417 9.16683V13.8752C16.0417 15.7608 16.0417 16.7036 15.4559 17.2894C14.8701 17.8752 13.9273 17.8752 12.0417 17.8752H9.95833C8.07271 17.8752 7.12991 17.8752 6.54412 17.2894C5.95833 16.7036 5.95833 15.7608 5.95833 13.8752V9.16683C5.95833 8.03886 5.95833 7.47488 5.73737 7.04469C5.54643 6.67297 5.24386 6.3704 4.87214 6.17946C4.44195 5.9585 3.87797 5.9585 2.75 5.9585V5.9585Z" stroke-width="1.5" stroke-linecap="round" />
<path d="M8.70841 3.20839C8.70841 3.20839 9.16675 2.2915 11.0001 2.2915C12.8334 2.2915 13.2917 3.20817 13.2917 3.20817" stroke-width="1.5" stroke-linecap="round" />
</svg>
<span class="mx-1">حذف</span>
</button>
</div>
</div>
</div>
</div>`;
});
$('#EmployeeBankListAjax').append(html);
} else {
html += `<div class="text-center bg-white d-flex align-items-center justify-content-center">
<div class="">
<img src="/assetsclient/images/empty.png" alt="" class="img-fluid" />
<h5>اطلاعاتی وجود ندارد.</h5>
</div>
</div>`;
$('#EmployeeBankListAjax').append(html);
}
}
},
failure: function (response) {
console.log(response);
}
});
}
function ajaxPersonals() {
$.ajax({
url: employeeListAjax,
type: 'GET',
success: function (response) {
if (response.success) {
var employees = response.data;
var employeeOptionsHtml = '<option value="0">انتخاب پرسنل ...</option>';
employees.forEach(function (employee) {
employeeOptionsHtml += `<option value="${employee.id}">${employee.employeeFullName}</option>`;
});
$('#employeeSelectIndex').html(employeeOptionsHtml);
$('#employeeSelectIndexMobile').html(employeeOptionsHtml);
} else {
$('.alert-msg').show();
$('.alert-msg p').text(response.message);
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
}
},
error: function (xhr, status, error) {
console.error(xhr.responseText);
}
});
}
function ajaxBanks() {
$.ajax({
url: bankListAjax,
type: 'GET',
success: function (response) {
if (response.success) {
var banks = response.data;
var bankOptionsHtml = '<option value="0">انتخاب بانک ...</option>';
banks.forEach(function (bank) {
bankOptionsHtml += `<option value="${bank.id}">${bank.bankName}</option>`;
});
$('#bankSelectIndex').html(bankOptionsHtml);
//$('#employeeSelectIndexMobile').html(employeeOptionsHtml);
} else {
$('.alert-msg').show();
$('.alert-msg p').text(response.message);
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
}
},
error: function (xhr, status, error) {
console.error(xhr.responseText);
}
});
}
function openCreateEmployeeBankModal() {
var goTo = `/Client/Company/EmployeesBankInfo/Index?handler=Create`;
AjaxUrlContentModal(goTo);
//window.location.href = goTo;
}
function openEditEmployeeBankModal(employeeId) {
var goTo = `/Client/Company/EmployeesBankInfo/Index?handler=Details&employeeId=${employeeId}`;
AjaxUrlContentModal(goTo);
//window.location.href = goTo;
}
function deleteEmployeeBankModal(id) {
swal({
title: "آیا از تمامی حذف این حساب اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: true,
closeOnCancel: true
}, function (isConfirm) {
if (isConfirm) {
removeByEmployeeId(id);
}
});
}
function removeByEmployeeId(id) {
$.ajax({
async: false,
dataType: 'json',
type: 'POST',
url: removeByEmployeeIdAjax,
headers: { "RequestVerificationToken": antiForgeryToken },
data: { employeeId: Number(id) },
success: function (response) {
if (response.success) {
$('.alert-success-msg').show();
$('.alert-success-msg p').text(response.message);
setTimeout(function () {
$('.alert-success-msg').hide();
$('.alert-success-msg p').text('');
}, 2000);
$('#EmployeeBankListAjax').html('');
loadEmployeeBankList();
} else {
$('.alert-msg').show();
$('.alert-msg p').text(response.message);
setTimeout(function () {
$('.alert-msg').hide();
$('.alert-msg p').text('');
}, 3500);
}
},
error: function (err) {
console.log(err);
}
});
}