CalculationDate for SalaryAid
This commit is contained in:
@@ -4,14 +4,19 @@ namespace Company.Domain.CustomizeCheckoutAgg.ValueObjects;
|
||||
|
||||
public class CustomizeCheckoutSalaryAid
|
||||
{
|
||||
public CustomizeCheckoutSalaryAid(string amount, DateTime salaryAidDateTime, string salaryAidDateTimeFa)
|
||||
public CustomizeCheckoutSalaryAid(string amount, DateTime salaryAidDateTime, string salaryAidDateTimeFa, DateTime calculationDateTime, string calculationDateTimeFa)
|
||||
{
|
||||
Amount = amount;
|
||||
SalaryAidDateTime = salaryAidDateTime;
|
||||
SalaryAidDateTimeFa = salaryAidDateTimeFa;
|
||||
CalculationDateTime = calculationDateTime;
|
||||
CalculationDateTimeFa = calculationDateTimeFa;
|
||||
}
|
||||
|
||||
public string Amount { get; private set; }
|
||||
public DateTime SalaryAidDateTime { get; private set; }
|
||||
public string SalaryAidDateTimeFa { get; private set; }
|
||||
|
||||
public DateTime CalculationDateTime { get; private set; }
|
||||
public string CalculationDateTimeFa { get; private set; }
|
||||
}
|
||||
@@ -4,14 +4,20 @@ namespace Company.Domain.CustomizeCheckoutTempAgg.ValueObjects;
|
||||
|
||||
public class CustomizeCheckoutTempSalaryAid
|
||||
{
|
||||
public CustomizeCheckoutTempSalaryAid(string amount, DateTime salaryAidDateTime, string salaryAidDateTimeFa)
|
||||
public CustomizeCheckoutTempSalaryAid(string amount, DateTime salaryAidDateTime, string salaryAidDateTimeFa,
|
||||
DateTime calculationDateTime, string calculationDateTimeFa)
|
||||
{
|
||||
Amount = amount;
|
||||
SalaryAidDateTime = salaryAidDateTime;
|
||||
SalaryAidDateTimeFa = salaryAidDateTimeFa;
|
||||
CalculationDateTime = calculationDateTime;
|
||||
CalculationDateTimeFa = calculationDateTimeFa;
|
||||
}
|
||||
|
||||
public string Amount { get; private set; }
|
||||
public DateTime SalaryAidDateTime { get; private set; }
|
||||
public string SalaryAidDateTimeFa { get; private set; }
|
||||
|
||||
public DateTime CalculationDateTime { get; private set; }
|
||||
public string CalculationDateTimeFa { get; private set; }
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using _0_Framework.Domain;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.EmployeeClientTemp;
|
||||
|
||||
namespace Company.Domain.EmployeeClientTempAgg;
|
||||
@@ -8,4 +10,5 @@ public interface IEmployeeClientTempRepository : IRepository<long, EmployeeClien
|
||||
EmployeeClientTemp GetByEmployeeIdAndWorkshopId(long employeeId, long commandWorkshopId);
|
||||
EmployeeClientTempGetDetailsViewModel GetDetails(long employeeId, long workshopId);
|
||||
void Remove(EmployeeClientTemp entity);
|
||||
Task<List<EmployeeClientTempViewModel>> GetByEmployeeId(long employeeId);
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.LeftWorkTemp;
|
||||
|
||||
@@ -14,4 +15,6 @@ public interface ILeftWorkTempRepository:IRepository<long,LeftWorkTemp>
|
||||
/// <returns></returns>
|
||||
Task<GetStartWorkTempDetails> GetStartAndLeftWorkDetails(long employeeId, long workshopId);
|
||||
void Remove(LeftWorkTemp entity);
|
||||
List<LeftWorkTempViewModel> GetLeftWorksByWorkshopId(long workshopId);
|
||||
Task<List<LeftWorkTempViewModel>> GetLeftWorkTempsByEmployeeId(long employeeId);
|
||||
}
|
||||
@@ -11,20 +11,27 @@ public class SalaryAid:EntityBase
|
||||
{
|
||||
|
||||
}
|
||||
public SalaryAid(long employeeId, long workshopId, double amount, DateTime salaryAidDateTime, long createdByAccountId, UserType createdByUserType)
|
||||
public SalaryAid(long employeeId, long workshopId, double amount, DateTime salaryAidDateTime, long createdByAccountId, UserType createdByUserType, DateTime calculationDate)
|
||||
{
|
||||
EmployeeId = employeeId;
|
||||
WorkshopId = workshopId;
|
||||
Amount = amount;
|
||||
SalaryAidDateTime = salaryAidDateTime;
|
||||
CalculationDate = calculationDate;
|
||||
CreatedByUserType = createdByUserType;
|
||||
CreatedByAccountId = createdByAccountId;
|
||||
}
|
||||
|
||||
public long EmployeeId { get; private set; }
|
||||
public long WorkshopId { get; private set; }
|
||||
public double Amount { get; private set; }
|
||||
/// <summary>
|
||||
/// تاریخ پرداخت
|
||||
/// </summary>
|
||||
public DateTime SalaryAidDateTime { get; private set; }
|
||||
/// <summary>
|
||||
/// تاریخ محاسبه
|
||||
/// </summary>
|
||||
public DateTime CalculationDate { get; private set; }
|
||||
|
||||
|
||||
public long CreatedByAccountId { get; private set; }
|
||||
@@ -36,11 +43,12 @@ public class SalaryAid:EntityBase
|
||||
public UserType LastModifiedByUserType { get; private set; }
|
||||
|
||||
|
||||
public void Edit(double amount, DateTime salaryAidTime, long modifiedByAccountId, UserType modifiedByUserType)
|
||||
public void Edit(double amount, DateTime salaryAidTime, long modifiedByAccountId, UserType modifiedByUserType, DateTime calculationDate)
|
||||
{
|
||||
Amount = amount;
|
||||
SalaryAidDateTime = salaryAidTime;
|
||||
LastModifiedByAccountId = modifiedByAccountId;
|
||||
LastModifiedByUserType = modifiedByUserType;
|
||||
CalculationDate = calculationDate;
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ using LicenseContext = OfficeOpenXml.LicenseContext;
|
||||
|
||||
namespace CompanyManagement.Infrastructure.Excel.SalaryAid;
|
||||
|
||||
public record SalaryAidImportData(long EmployeeId, long WorkshopId, string FullName, double Amount, string AccountNumber, string NationalCode, string SalaryAidDateTime, int Row, bool Duplicated);
|
||||
public record SalaryAidImportData(long EmployeeId, long WorkshopId, string FullName, double Amount, string AccountNumber, string NationalCode, string SalaryAidDateTime,string CalculationDate, int Row, bool Duplicated);
|
||||
|
||||
public class ExcelValidation<T>
|
||||
{
|
||||
@@ -84,24 +84,37 @@ public class SalaryAidImportExcel
|
||||
worksheet.Cells[2, 2].Text != "کد ملی" ||
|
||||
worksheet.Cells[2, 3].Text != "شماره حساب" ||
|
||||
worksheet.Cells[2, 4].Text != "مبلغ قابل پرداخت" ||
|
||||
worksheet.Cells[1, 1].Text != "تاریخ پرداخت")
|
||||
worksheet.Cells[1, 3].Text != "تاریخ پرداخت" ||
|
||||
worksheet.Cells[1, 1].Text != "تاریخ محاسبه")
|
||||
{
|
||||
result.Errors.Add(new SalaryAidImportExcelError("ساختار فایل اکسل اشتباه است.", 0, SalaryAidExcelColumns.None.ToString()));
|
||||
return result;
|
||||
}
|
||||
|
||||
var salaryDateFa = worksheet.Cells[1, 4].Text;
|
||||
var calculationDate = worksheet.Cells[1, 2].Text;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(salaryDateFa))
|
||||
{
|
||||
result.Errors.Add(new SalaryAidImportExcelError("لطفا در سلول زرد رنگ تاریخ پرداخت را وارد کنید", 0, SalaryAidExcelColumns.None.ToString()));
|
||||
return result;
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(calculationDate))
|
||||
{
|
||||
result.Errors.Add(new SalaryAidImportExcelError("لطفا در سلول آبی رنگ تاریخ محاسبه را وارد کنید", 0, SalaryAidExcelColumns.None.ToString()));
|
||||
return result;
|
||||
}
|
||||
|
||||
if (salaryDateFa.TryToGeorgianDateTime(out var salaryDateTime) == false)
|
||||
{
|
||||
result.Errors.Add(new SalaryAidImportExcelError("تاریخ وارد شده نامعتبر است", 0, SalaryAidExcelColumns.None.ToString()));
|
||||
}
|
||||
|
||||
if (calculationDate.TryToGeorgianDateTime(out var calculationDateTime) == false)
|
||||
{
|
||||
result.Errors.Add(new SalaryAidImportExcelError("تاریخ محاسبه وارد شده نامعتبر است", 0, SalaryAidExcelColumns.None.ToString()));
|
||||
}
|
||||
|
||||
if (salaryDateTime > DateTime.Now)
|
||||
{
|
||||
result.Errors.Add(new SalaryAidImportExcelError("تاریخ پرداخت مساعده می بایست تاریخ امروز یا قبل تر باشد", 0, SalaryAidExcelColumns.None.ToString()));
|
||||
@@ -127,11 +140,11 @@ public class SalaryAidImportExcel
|
||||
if (!double.TryParse(amountText, out double amount) || amount <= 0)
|
||||
{
|
||||
result.Errors.Add(new SalaryAidImportExcelError("مبلغ خالی یا نامعتبر است", row, SalaryAidExcelColumns.Amount.ToString()));
|
||||
|
||||
}
|
||||
result.RawData.Add(new SalaryAidImportData(0, workshopId, fullName, amount, accountNumber, nationalCode, salaryDateFa, row, false));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(fullName))
|
||||
}
|
||||
result.RawData.Add(new SalaryAidImportData(0, workshopId, fullName, amount, accountNumber, nationalCode, salaryDateFa, calculationDate,row, false));
|
||||
|
||||
if (string.IsNullOrWhiteSpace(fullName))
|
||||
{
|
||||
result.Errors.Add(new SalaryAidImportExcelError(" نام و نام خانوادگی خالی است", row, SalaryAidExcelColumns.FullName.ToString()));
|
||||
|
||||
@@ -213,16 +226,16 @@ public class SalaryAidImportExcel
|
||||
{
|
||||
// TODO MAHAN: Vafa Add this Code! Please Check it!
|
||||
|
||||
result.RawData.Add(new SalaryAidImportData(employee.id, workshopId, fullName, amount, accountNumber, nationalCode, salaryDateFa, row, true));
|
||||
continue;
|
||||
result.RawData.Add(new SalaryAidImportData(employee.id, workshopId, fullName, amount, accountNumber, nationalCode, salaryDateFa, calculationDate, row, true));
|
||||
continue;
|
||||
}
|
||||
result.ValidData.Add(new SalaryAidImportData(employee.id, workshopId, fullName, amount, accountNumber, nationalCode, salaryDateFa, row, false));
|
||||
result.ValidData.Add(new SalaryAidImportData(employee.id, workshopId, fullName, amount, accountNumber, nationalCode, salaryDateFa, calculationDate, row, false));
|
||||
}
|
||||
|
||||
result.RawData = result.RawData.GroupBy(x => x.Row).Select(x => new SalaryAidImportData(x.First().EmployeeId,
|
||||
x.First().WorkshopId, x.First().FullName,
|
||||
x.First().Amount, x.First().AccountNumber, x.First().NationalCode, x.First().SalaryAidDateTime, x.Key,
|
||||
x.Any(s => s.Duplicated))).ToList();
|
||||
x.First().WorkshopId, x.First().FullName,
|
||||
x.First().Amount, x.First().AccountNumber, x.First().NationalCode, x.First().SalaryAidDateTime, x.First().CalculationDate,x.Key,
|
||||
x.Any(s => s.Duplicated))).ToList();
|
||||
|
||||
|
||||
//result.Errors.GroupBy(x => x.Row).Select(x => new
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.EmployeeClientTemp;
|
||||
@@ -8,7 +10,19 @@ public interface IEmployeeClientTempApplication
|
||||
OperationResult Create(CreateEmployeeClientTemp command);
|
||||
|
||||
EmployeeClientTempGetDetailsViewModel GetDetails(long employeeId, long workshopId);
|
||||
Task<List<EmployeeClientTempViewModel>> GetByEmployeeId(long employeeId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class EmployeeClientTempViewModel
|
||||
{
|
||||
public string EmployeeFullName { get; set; }
|
||||
public long WorkshopId { get; set; }
|
||||
public long EmployeeId { get; set; }
|
||||
public DateTime StartWorkDate { get; set; }
|
||||
|
||||
public string MaritalStatus { get; set; }
|
||||
}
|
||||
|
||||
public class EmployeeClientTempGetDetailsViewModel
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.LeftWork;
|
||||
@@ -30,6 +31,23 @@ public interface ILeftWorkTempApplication
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> AcceptLeftWork(AcceptLeftWorkTemp command);
|
||||
|
||||
Task<List<LeftWorkTempViewModel>> GetLeftWorkTempsByEmployeeId(long employeeId);
|
||||
|
||||
|
||||
List<LeftWorkTempViewModel> GetLeftWorksByWorkshopId(long workshopId);
|
||||
}
|
||||
|
||||
public class LeftWorkTempViewModel
|
||||
{
|
||||
public long LeftWorkId { get; set; }
|
||||
public DateTime StartWork { get; set; }
|
||||
public DateTime LeftWork { get; set; }
|
||||
public DateTime LastDayStanding { get; set; }
|
||||
public long WorkshopId { get; set; }
|
||||
public long EmployeeId { get; set; }
|
||||
public long JobId { get; set; }
|
||||
public LeftWorkTempType LeftWorkType { get; set; }
|
||||
}
|
||||
|
||||
public class AcceptLeftWorkTemp
|
||||
|
||||
@@ -4,9 +4,10 @@ namespace CompanyManagment.App.Contracts.SalaryAid;
|
||||
|
||||
public class CreateSalaryAidViewModel
|
||||
{
|
||||
public List<long> EmployeeIds { get; set; }
|
||||
public long WorkshopId { get; set; }
|
||||
public string Amount { get; set; }
|
||||
public string SalaryDateTime { get; set; }
|
||||
public List<long> EmployeeIds { get; set; }
|
||||
public long WorkshopId { get; set; }
|
||||
public string Amount { get; set; }
|
||||
public string SalaryDateTime { get; set; }
|
||||
public string CalculationDateTime { get; set; }
|
||||
public string NationalCode { get; set; }
|
||||
}
|
||||
@@ -4,17 +4,21 @@ namespace CompanyManagment.App.Contracts.SalaryAid;
|
||||
|
||||
public class SalaryAidViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public long EmployeeId { get; set; }
|
||||
public string Amount { get; set; }
|
||||
public long Id { get; set; }
|
||||
public long EmployeeId { get; set; }
|
||||
public string Amount { get; set; }
|
||||
public double AmountDouble { get; set; }
|
||||
public long WorkshopId { get; set; }
|
||||
public string CreationDate { get; set; }
|
||||
public string SalaryAidDateTimeFa { get; set; }
|
||||
public DateTime SalaryAidDateTimeGe { get; set; }
|
||||
public long WorkshopId { get; set; }
|
||||
public string CreationDate { get; set; }
|
||||
public string SalaryAidDateTimeFa { get; set; }
|
||||
public DateTime SalaryAidDateTimeGe { get; set; }
|
||||
public string CalculationDateTimeFa { get; set; }
|
||||
public DateTime CalculationDateTimeGe { get; set; }
|
||||
|
||||
public string EmployeeFullName { get; set; }
|
||||
public string PersonnelCode { get; set; }
|
||||
|
||||
|
||||
public string EmployeeFullName { get; set; }
|
||||
public string PersonnelCode { get; set; }
|
||||
public string MonthFa { get; set; }
|
||||
public string YearFa { get; set; }
|
||||
}
|
||||
@@ -97,7 +97,7 @@ namespace CompanyManagment.Application
|
||||
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();
|
||||
new CustomizeCheckoutSalaryAid(x.Amount, x.SalaryAidDateTimeGe, x.SalaryAidDateTimeFa, x.CalculationDateTimeGe, x.CalculationDateTimeFa)).ToList();
|
||||
|
||||
|
||||
var regularShift = result.EmployeeSettingsShifts.Select(x =>
|
||||
@@ -154,7 +154,7 @@ namespace CompanyManagment.Application
|
||||
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();
|
||||
new CustomizeCheckoutSalaryAid(x.Amount, x.SalaryAidDateTimeGe, x.SalaryAidDateTimeFa, x.CalculationDateTimeGe, x.CalculationDateTimeFa)).ToList();
|
||||
|
||||
var regularShift = computations.EmployeeSettingsShifts.Select(x =>
|
||||
new CustomizeCheckoutRegularShift(x.StartTime, x.EndTime, x.Placement)).ToList();
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace CompanyManagment.Application
|
||||
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();
|
||||
new CustomizeCheckoutTempSalaryAid(x.Amount, x.SalaryAidDateTimeGe, x.SalaryAidDateTimeFa, x.CalculationDateTimeGe, x.CalculationDateTimeFa)).ToList();
|
||||
|
||||
var regularShift = result.EmployeeSettingsShifts.Select(x =>
|
||||
new CustomizeCheckoutRegularShift(x.StartTime, x.EndTime, x.Placement)).ToList();
|
||||
@@ -136,7 +136,7 @@ namespace CompanyManagment.Application
|
||||
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();
|
||||
new CustomizeCheckoutTempSalaryAid(x.Amount, x.SalaryAidDateTimeGe, x.SalaryAidDateTimeFa, x.CalculationDateTimeGe, x.CalculationDateTimeFa)).ToList();
|
||||
|
||||
var contract = contracts.Where(x => x.IsActiveString == "true").FirstOrDefault(x => x.EmployeeId == employeeId);
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using _0_Framework.Application;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.EmployeeClientTempAgg;
|
||||
using CompanyManagment.App.Contracts.EmployeeClientTemp;
|
||||
|
||||
@@ -29,4 +31,10 @@ public class EmployeeClientTempApplication : IEmployeeClientTempApplication
|
||||
{
|
||||
return _employeeClientTempRepository.GetDetails(employeeId, workshopId);
|
||||
}
|
||||
|
||||
public async Task<List<EmployeeClientTempViewModel>> GetByEmployeeId(long employeeId)
|
||||
{
|
||||
return await _employeeClientTempRepository.GetByEmployeeId(employeeId);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
@@ -57,6 +58,11 @@ public class LeftWorkTempApplication : ILeftWorkTempApplication
|
||||
{
|
||||
#region Validation
|
||||
|
||||
if (_leftWorkTempRepository.Exists(x=>x.WorkshopId == command.WorkshopId && x.EmployeeId == employeeId))
|
||||
{
|
||||
return op.Failed("برای پرسنل وارد شده قبلا درخواست ترک کار ثبت کرده اید");
|
||||
}
|
||||
|
||||
if (command.LeftWorkTime.TryToGeorgianDateTime(out var leftWorkDateGr) == false)
|
||||
{
|
||||
return op.Failed("تاریخ شروع به کار وارد شده نامعتبر است");
|
||||
@@ -233,6 +239,18 @@ public class LeftWorkTempApplication : ILeftWorkTempApplication
|
||||
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
public async Task<List<LeftWorkTempViewModel>> GetLeftWorkTempsByEmployeeId(long employeeId)
|
||||
{
|
||||
return await _leftWorkTempRepository.GetLeftWorkTempsByEmployeeId(employeeId);
|
||||
}
|
||||
|
||||
public List<LeftWorkTempViewModel> GetLeftWorksByWorkshopId(long workshopId)
|
||||
{
|
||||
return _leftWorkTempRepository.GetLeftWorksByWorkshopId(workshopId);
|
||||
|
||||
}
|
||||
|
||||
//این متد ترک کار های کارمند را با فعالیت حضور غیاب یکپارچه می کند
|
||||
private void IfEmployeeHasNewLeftWorkDateAddEndDateToRollCallStatus(long employeeId)
|
||||
{
|
||||
|
||||
@@ -130,6 +130,7 @@ public class ProceedingSessionApplication : IProceedingSessionApplication
|
||||
ArchiveNo = searchModel.File.ArchiveNo.ToString(),
|
||||
FileClass = searchModel.File.FileClass,
|
||||
UserId_RequesterOrSummoned = searchModel.UserId_RequesterOrSummoned,
|
||||
Status = 0
|
||||
});
|
||||
|
||||
if (searchModel.IsSearched)
|
||||
@@ -230,6 +231,10 @@ public class ProceedingSessionApplication : IProceedingSessionApplication
|
||||
|
||||
private List<File_Board_PS> GetFile_Board_PSList(List<EditProceedingSession> list, List<FileViewModel> files, ProceedingSessionSearchModel searchModel)
|
||||
{
|
||||
if (list.Any(x=>x.Id == 1516))
|
||||
{
|
||||
|
||||
}
|
||||
var file_PSList = new List<File_Board_PS>();
|
||||
|
||||
foreach (var item in list)
|
||||
@@ -248,7 +253,9 @@ public class ProceedingSessionApplication : IProceedingSessionApplication
|
||||
continue;
|
||||
}
|
||||
|
||||
var file = _fileRepository.Search(new FileSearchModel { Id = board.File_Id, Status = 0 }).FirstOrDefault();
|
||||
var filelist = _fileRepository.Search(new FileSearchModel { Id = board.File_Id, Status = 0 }).ToList();
|
||||
|
||||
var file = filelist.FirstOrDefault();
|
||||
|
||||
file = _fileApplication.GetFileDetails(file);
|
||||
|
||||
|
||||
@@ -730,8 +730,11 @@ public class RollCallApplication : IRollCallApplication
|
||||
|
||||
if (rollCalls == null)
|
||||
return operation.Failed("چنین آیتمی یافت نشد");
|
||||
foreach (var item in rollCalls)
|
||||
foreach (var item in rollCalls)
|
||||
{
|
||||
item.Edit(item.StartDate.Value,item.EndDate.Value,_rollCallDomainService);
|
||||
item.SetModifyType(RollCallModifyType.EditByEmployer);
|
||||
}
|
||||
|
||||
_rollCallRepository.SaveChanges();
|
||||
|
||||
|
||||
@@ -53,19 +53,24 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
return op.Failed("تاریخ وارد شده نامعتبر است");
|
||||
}
|
||||
|
||||
if (!command.CalculationDateTime.TryToGeorgianDateTime(out var calculationDateTime))
|
||||
{
|
||||
return op.Failed("تاریخ محاسبه وارد شده نامعتبر است");
|
||||
}
|
||||
|
||||
if (startDate > DateTime.Now)
|
||||
{
|
||||
return op.Failed("تاریخ پرداخت مساعده می بایست تاریخ امروز یا قبل تر باشد");
|
||||
|
||||
}
|
||||
|
||||
if (command.Amount.Length > 15)
|
||||
{
|
||||
return op.Failed("مبلغ وارد شده معتبر نیست");
|
||||
}
|
||||
|
||||
var month = Convert.ToInt32(command.SalaryDateTime.Substring(5, 2));
|
||||
var year = Convert.ToInt32(command.SalaryDateTime.Substring(0, 4));
|
||||
|
||||
var month = Convert.ToInt32(command.CalculationDateTime.Substring(5, 2));
|
||||
var year = Convert.ToInt32(command.CalculationDateTime.Substring(0, 4));
|
||||
|
||||
if (_customizeCheckoutRepository.Exists(x => x.WorkshopId == command.WorkshopId && command.EmployeeIds.Contains(x.EmployeeId) && x.YearInt == year && x.MonthInt == month))
|
||||
{
|
||||
@@ -81,7 +86,7 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
foreach (var employeeId in command.EmployeeIds)
|
||||
{
|
||||
|
||||
var entity = new SalaryAid(employeeId, command.WorkshopId, command.Amount.MoneyToDouble(), startDate,userId,userType);
|
||||
var entity = new SalaryAid(employeeId, command.WorkshopId, command.Amount.MoneyToDouble(), startDate,userId,userType,calculationDateTime);
|
||||
_salaryAidRepository.Create(entity);
|
||||
|
||||
}
|
||||
@@ -98,6 +103,11 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
return op.Failed("تاریخ وارد شده نامعتبر است");
|
||||
}
|
||||
|
||||
if (!command.CalculationDateTime.TryToGeorgianDateTime(out var calculationDateTime))
|
||||
{
|
||||
return op.Failed("تاریخ محاسبه وارد شده نامعتبر است");
|
||||
}
|
||||
|
||||
if (startDate > DateTime.Now)
|
||||
{
|
||||
return op.Failed("تاریخ پرداخت مساعده می بایست تاریخ امروز یا قبل تر باشد");
|
||||
@@ -111,8 +121,8 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
if (entity == null)
|
||||
return op.Failed("چنین مساعده ای وجود ندارد");
|
||||
|
||||
var month = Convert.ToInt32(command.SalaryDateTime.Substring(5, 2));
|
||||
var year = Convert.ToInt32(command.SalaryDateTime.Substring(0, 4));
|
||||
var month = Convert.ToInt32(command.CalculationDateTime.Substring(5, 2));
|
||||
var year = Convert.ToInt32(command.CalculationDateTime.Substring(0, 4));
|
||||
|
||||
if (_customizeCheckoutRepository.Exists(x => x.WorkshopId == entity.WorkshopId && entity.EmployeeId == x.EmployeeId && x.YearInt == year && x.MonthInt == month))
|
||||
return op.Failed("شما نمیتوانید برای پرسنلی در تاریخی که برای فیش حقوقی صادر شده است مساعده ای دهید");
|
||||
@@ -124,7 +134,7 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
}
|
||||
var (userId, userType) = _authHelper.GetUserTypeWithId();
|
||||
|
||||
entity.Edit(Tools.MoneyToDouble(command.Amount),startDate,userId,userType);
|
||||
entity.Edit(Tools.MoneyToDouble(command.Amount),startDate,userId,userType,calculationDateTime);
|
||||
_salaryAidRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
@@ -136,8 +146,8 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
if (entity == null)
|
||||
return op.Failed("این آیتم وجود ندارد");
|
||||
|
||||
var month = Convert.ToInt32(entity.SalaryAidDateTime.ToFarsi().Substring(5, 2));
|
||||
var year = Convert.ToInt32(entity.SalaryAidDateTime.ToFarsi().Substring(0, 4));
|
||||
var month = Convert.ToInt32(entity.CalculationDate.ToFarsi().Substring(5, 2));
|
||||
var year = Convert.ToInt32(entity.CalculationDate.ToFarsi().Substring(0, 4));
|
||||
|
||||
if (_customizeCheckoutRepository.Exists(x => x.WorkshopId == entity.WorkshopId && entity.EmployeeId == x.EmployeeId && x.YearInt == year && x.MonthInt == month))
|
||||
return op.Failed("این پرسنل در این تاریخ دارای فیش حقوقی است");
|
||||
@@ -175,6 +185,11 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
return op.Failed("تاریخ وارد شده نامعتبر است");
|
||||
}
|
||||
|
||||
if (!command.CalculationDateTime.TryToGeorgianDateTime(out var calculationDateTime))
|
||||
{
|
||||
return op.Failed("تاریخ محاسبه وارد شده نامعتبر است");
|
||||
}
|
||||
|
||||
if (startDate > DateTime.Now)
|
||||
{
|
||||
return op.Failed("تاریخ پرداخت مساعده می بایست تاریخ امروز یا قبل تر باشد");
|
||||
@@ -185,8 +200,8 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
return op.Failed("مبلغ وارد شده معتبر نیست");
|
||||
}
|
||||
|
||||
var month = Convert.ToInt32(command.SalaryDateTime.Substring(5, 2));
|
||||
var year = Convert.ToInt32(command.SalaryDateTime.Substring(0, 4));
|
||||
var month = Convert.ToInt32(command.CalculationDateTime.Substring(5, 2));
|
||||
var year = Convert.ToInt32(command.CalculationDateTime.Substring(0, 4));
|
||||
|
||||
|
||||
if (_customizeCheckoutRepository.Exists(x => x.WorkshopId == command.WorkshopId && command.EmployeeIds.Contains(x.EmployeeId) && x.YearInt == year && x.MonthInt == month))
|
||||
@@ -203,7 +218,7 @@ public class SalaryAidApplication : ISalaryAidApplication
|
||||
id = employee.id;
|
||||
}
|
||||
|
||||
var entity = new SalaryAid(id, command.WorkshopId, command.Amount.MoneyToDouble(), startDate, userId, userType);
|
||||
var entity = new SalaryAid(id, command.WorkshopId, command.Amount.MoneyToDouble(), startDate, userId, userType,calculationDateTime);
|
||||
await _salaryAidRepository.CreateAsync(entity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,6 +85,7 @@ public class CustomizeCheckoutMapping : IEntityTypeConfiguration<CustomizeChecko
|
||||
{
|
||||
salaryAid.Property(x => x.SalaryAidDateTimeFa).HasMaxLength(15);
|
||||
salaryAid.Property(x => x.Amount).HasMaxLength(25);
|
||||
salaryAid.Property(x => x.CalculationDateTimeFa).HasMaxLength(15);
|
||||
});
|
||||
|
||||
builder.OwnsMany(x => x.CustomizeCheckoutRewards, rewards =>
|
||||
|
||||
@@ -84,6 +84,7 @@ public class CustomizeCheckoutTempMapping : IEntityTypeConfiguration<CustomizeCh
|
||||
{
|
||||
salaryAid.Property(x => x.SalaryAidDateTimeFa).HasMaxLength(15);
|
||||
salaryAid.Property(x => x.Amount).HasMaxLength(25);
|
||||
salaryAid.Property(x => x.CalculationDateTimeFa).HasMaxLength(15);
|
||||
});
|
||||
|
||||
builder.OwnsMany(x => x.CustomizeCheckoutRewards, rewards =>
|
||||
|
||||
@@ -27,6 +27,7 @@ public class InstitutionContractMapping : IEntityTypeConfiguration<InstitutionCo
|
||||
builder.Property(x => x.Signature).HasMaxLength(1);
|
||||
builder.Property(x => x.OfficialCompany).HasMaxLength(12);
|
||||
builder.Property(x => x.TypeOfContract).HasMaxLength(30);
|
||||
builder.Property(x => x.HasValueAddedTax).HasMaxLength(10);
|
||||
|
||||
|
||||
|
||||
|
||||
9407
CompanyManagment.EFCore/Migrations/20250426185835_institutioncontractChanges.Designer.cs
generated
Normal file
9407
CompanyManagment.EFCore/Migrations/20250426185835_institutioncontractChanges.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,38 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class institutioncontractChanges : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "HasValueAddedTax",
|
||||
table: "InstitutionContracts",
|
||||
type: "nvarchar(10)",
|
||||
maxLength: 10,
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
oldNullable: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "HasValueAddedTax",
|
||||
table: "InstitutionContracts",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(10)",
|
||||
oldMaxLength: 10,
|
||||
oldNullable: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
9410
CompanyManagment.EFCore/Migrations/20250427155240_add salaryAid calculation date.Designer.cs
generated
Normal file
9410
CompanyManagment.EFCore/Migrations/20250427155240_add salaryAid calculation date.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addsalaryAidcalculationdate : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "CalculationDate",
|
||||
table: "SalaryAids",
|
||||
type: "datetime2",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CalculationDate",
|
||||
table: "SalaryAids");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addsalaryAidcalculationdatetocustomizecheckouts : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "CalculationDateTime",
|
||||
table: "CustomizeCheckoutTempSalaryAid",
|
||||
type: "datetime2",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CalculationDateTimeFa",
|
||||
table: "CustomizeCheckoutTempSalaryAid",
|
||||
type: "nvarchar(15)",
|
||||
maxLength: 15,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "CalculationDateTime",
|
||||
table: "CustomizeCheckoutSalaryAid",
|
||||
type: "datetime2",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CalculationDateTimeFa",
|
||||
table: "CustomizeCheckoutSalaryAid",
|
||||
type: "nvarchar(15)",
|
||||
maxLength: 15,
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CalculationDateTime",
|
||||
table: "CustomizeCheckoutTempSalaryAid");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CalculationDateTimeFa",
|
||||
table: "CustomizeCheckoutTempSalaryAid");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CalculationDateTime",
|
||||
table: "CustomizeCheckoutSalaryAid");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CalculationDateTimeFa",
|
||||
table: "CustomizeCheckoutSalaryAid");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2841,7 +2841,8 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("HasValueAddedTax")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
|
||||
b.Property<string>("IsActiveString")
|
||||
.HasMaxLength(5)
|
||||
@@ -4696,6 +4697,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<double>("Amount")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<DateTime>("CalculationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<long>("CreatedByAccountId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
@@ -6390,6 +6394,13 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b1.Property<DateTime>("CalculationDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<string>("CalculationDateTimeFa")
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b1.Property<DateTime>("SalaryAidDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
@@ -6665,6 +6676,13 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b1.Property<DateTime>("CalculationDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<string>("CalculationDateTimeFa")
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b1.Property<DateTime>("SalaryAidDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.EmployeeClientTempAgg;
|
||||
using CompanyManagment.App.Contracts.EmployeeClientTemp;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
@@ -32,4 +35,18 @@ public class EmployeeClientTempRepository: RepositoryBase<long, EmployeeClientT
|
||||
WorkshopId = x.WorkshopId
|
||||
}).FirstOrDefault();
|
||||
}
|
||||
|
||||
public async Task<List<EmployeeClientTempViewModel>> GetByEmployeeId(long employeeId)
|
||||
{
|
||||
return await _context.EmployeeClientTemps.Where(x => x.EmployeeId == employeeId).Select(x =>
|
||||
new EmployeeClientTempViewModel()
|
||||
{
|
||||
EmployeeId = x.EmployeeId,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeFullName = x.EmployeeFullName,
|
||||
MaritalStatus = x.MaritalStatus,
|
||||
StartWorkDate = x.StartWorkDate
|
||||
|
||||
}).ToListAsync();
|
||||
}
|
||||
}
|
||||
@@ -226,7 +226,8 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
public List<InstitutionContractViewModel> NewSearch(InstitutionContractSearchModel searchModel)
|
||||
{
|
||||
var timer = Stopwatch.StartNew();
|
||||
var query = _context.InstitutionContractSet.Select(x => new InstitutionContractViewModel()
|
||||
var query = _context.InstitutionContractSet.AsSplitQuery()
|
||||
.Select(x => new InstitutionContractViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
ContractNo = x.ContractNo,
|
||||
@@ -257,7 +258,8 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
// LeftWorkIds = w.LeftWorks.Where(l => l.StartWorkDate <= DateTime.Now && l.LeftWorkDate > DateTime.Now).Select(l => l.EmployeeId).ToList(),
|
||||
// InsuranceLeftWorkIds = w.LeftWorkInsurances.Where(l => (l.StartWorkDate <= DateTime.Now && l.LeftWorkDate > DateTime.Now) || (l.StartWorkDate <= DateTime.Now && l.LeftWorkDate == null)).Select(l => l.EmployeeId).ToList(),
|
||||
//}).Where(w=>w.ContractingPartId == x.ContractingPartyId).ToList(),
|
||||
WorkshopIds = _context.Workshops.Include(w => w.WorkshopEmployers).Select(w => new WorkshopViewModel()
|
||||
WorkshopIds = _context.Workshops
|
||||
.Include(w => w.WorkshopEmployers).Select(w => new WorkshopViewModel()
|
||||
{
|
||||
Id = w.id,
|
||||
ContractingPartId = w.WorkshopEmployers.Select(e => e.Employer.ContractingPartyId).FirstOrDefault(),
|
||||
@@ -270,12 +272,12 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
FullName = e.FName + " " + e.LName,
|
||||
|
||||
}).GroupBy(e => e.Id).Select(e => e.First()).ToList(),
|
||||
EmployerIds = _context.Employers.Where(e => e.ContractingPartyId == x.ContractingPartyId).Select(e => e.id).ToList(),
|
||||
EmployerIds = _context.Employers.AsSplitQuery().Where(e => e.ContractingPartyId == x.ContractingPartyId).Select(e => e.id).ToList(),
|
||||
EmployerNo = "",
|
||||
EmployerName = "",
|
||||
|
||||
IsContractingPartyBlock = _context.PersonalContractingParties.Any(p => p.id == x.ContractingPartyId && p.IsBlock == "true") ? "true" : "false",
|
||||
BlockTimes = _context.PersonalContractingParties.Any(p => p.id == x.ContractingPartyId) ? _context.PersonalContractingParties.FirstOrDefault(p => p.id == x.ContractingPartyId).BlockTimes : 0,
|
||||
IsContractingPartyBlock = _context.PersonalContractingParties.AsSplitQuery().Any(p => p.id == x.ContractingPartyId && p.IsBlock == "true") ? "true" : "false",
|
||||
BlockTimes = _context.PersonalContractingParties.AsSplitQuery().Any(p => p.id == x.ContractingPartyId) ? _context.PersonalContractingParties.FirstOrDefault(p => p.id == x.ContractingPartyId).BlockTimes : 0,
|
||||
|
||||
});
|
||||
|
||||
@@ -407,7 +409,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
BlockTimes = x.BlockTimes,
|
||||
// EmployeeCount = ((x.WorkshopViewModels.Sum(w => w.LeftWorkIds.Count)) + (x.WorkshopViewModels.Sum(w => w.InsuranceLeftWorkIds.Count(c => !w.LeftWorkIds.Contains(c))))).ToString(),
|
||||
// ArchiveCode = x.WorkshopViewModels.Count > 0 ? ArchiveCodeFinder(x.WorkshopViewModels) : 0,
|
||||
WorkshopViewModels = _context.Workshops.Where(w => x.WorkshopIds.Contains(w.id)).Include(w => w.LeftWorks).Include(w => w.LeftWorkInsurances).Select(w => new WorkshopViewModel()
|
||||
WorkshopViewModels = _context.Workshops.AsSplitQuery().Where(w => x.WorkshopIds.Contains(w.id)).Include(w => w.LeftWorks).Include(w => w.LeftWorkInsurances).Select(w => new WorkshopViewModel()
|
||||
{
|
||||
Id = w.id,
|
||||
WorkshopName = w.WorkshopName,
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Threading.Tasks;
|
||||
@@ -7,6 +9,7 @@ using _0_Framework.InfraStructure;
|
||||
using Company.Domain.LeftWorkAgg;
|
||||
using Company.Domain.LeftWorkTempAgg;
|
||||
using CompanyManagment.App.Contracts.LeftWorkTemp;
|
||||
using CompanyManagment.EFCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.ChangeTracking.Internal;
|
||||
|
||||
@@ -36,19 +39,19 @@ public class LeftWorkTempRepository : RepositoryBase<long, LeftWorkTemp>, ILeftW
|
||||
}
|
||||
|
||||
var job = await _companyContext.Jobs.FindAsync(leftWorkTemp.JobId);
|
||||
|
||||
|
||||
|
||||
var previousLeftWorks = _companyContext.LeftWorkList
|
||||
.Where(x => leftWorkTemp.EmployeeId == x.EmployeeId && leftWorkTemp.WorkshopId == x.WorkshopId).ToList();
|
||||
|
||||
|
||||
|
||||
if (leftWorkTemp.LeftWorkType == LeftWorkTempType.LeftWork)
|
||||
{
|
||||
previousLeftWorks = previousLeftWorks.Where(x => x.id != leftWorkTemp.LeftWorkId).ToList();
|
||||
|
||||
|
||||
}
|
||||
if (leftWorkTemp.LeftWorkType == LeftWorkTempType.LeftWork)
|
||||
{
|
||||
previousLeftWorks = previousLeftWorks.Where(x => x.id != leftWorkTemp.LeftWorkId).ToList();
|
||||
|
||||
|
||||
}
|
||||
|
||||
var personnelCode =
|
||||
_companyContext.PersonnelCodeSet.FirstOrDefault(x =>
|
||||
@@ -79,4 +82,38 @@ public class LeftWorkTempRepository : RepositoryBase<long, LeftWorkTemp>, ILeftW
|
||||
}).ToList()
|
||||
};
|
||||
}
|
||||
|
||||
public List<LeftWorkTempViewModel> GetLeftWorksByWorkshopId(long workshopId)
|
||||
{
|
||||
var data = _companyContext.LeftWorkTemps.Where(x => x.WorkshopId == workshopId)
|
||||
.Select(x => new LeftWorkTempViewModel
|
||||
{
|
||||
LeftWorkId = x.LeftWorkId,
|
||||
WorkshopId = x.WorkshopId,
|
||||
EmployeeId = x.EmployeeId,
|
||||
JobId = x.JobId,
|
||||
LastDayStanding = x.LastDayStanding,
|
||||
LeftWork = x.LeftWork,
|
||||
LeftWorkType = x.LeftWorkType,
|
||||
StartWork = x.StartWork
|
||||
}).ToList();
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
public async Task<List<LeftWorkTempViewModel>> GetLeftWorkTempsByEmployeeId(long employeeId)
|
||||
{
|
||||
return await _companyContext.LeftWorkTemps.Where(x => x.EmployeeId == employeeId).Select(x =>
|
||||
new LeftWorkTempViewModel()
|
||||
{
|
||||
EmployeeId = x.EmployeeId,
|
||||
WorkshopId = x.WorkshopId,
|
||||
LeftWorkType = x.LeftWorkType,
|
||||
StartWork = x.StartWork,
|
||||
LeftWork = x.LeftWork,
|
||||
JobId = x.JobId,
|
||||
LastDayStanding = x.LastDayStanding,
|
||||
LeftWorkId = x.LeftWorkId
|
||||
}).ToListAsync();
|
||||
}
|
||||
}
|
||||
@@ -2086,6 +2086,8 @@ CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
AmountDouble = x.Amount,
|
||||
SalaryAidDateTimeFa = x.SalaryAidDateTime.ToFarsi(),
|
||||
SalaryAidDateTimeGe = x.SalaryAidDateTime,
|
||||
CalculationDateTimeGe = x.CalculationDate,
|
||||
CalculationDateTimeFa = x.CalculationDate.ToFarsi(),
|
||||
}).ToList();
|
||||
double salaryAidDeduction = salaryAidViewModel.Sum(x => x.AmountDouble);
|
||||
|
||||
@@ -2640,6 +2642,9 @@ CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
AmountDouble = x.Amount,
|
||||
SalaryAidDateTimeFa = x.SalaryAidDateTime.ToFarsi(),
|
||||
SalaryAidDateTimeGe = x.SalaryAidDateTime,
|
||||
CalculationDateTimeGe = x.CalculationDate,
|
||||
CalculationDateTimeFa = x.CalculationDate.ToFarsi(),
|
||||
|
||||
}).ToList();
|
||||
double salaryAidDeduction = salaryAidViewModel.Sum(x => x.AmountDouble);
|
||||
|
||||
|
||||
@@ -72,7 +72,8 @@ public class SalaryAidRepository : RepositoryBase<long, SalaryAid>, ISalaryAidRe
|
||||
WorkshopId = entity.WorkshopId,
|
||||
EmployeeId = entity.EmployeeId,
|
||||
Amount = entity.Amount.ToMoney(),
|
||||
SalaryDateTime = entity.SalaryAidDateTime.ToFarsi()
|
||||
SalaryDateTime = entity.SalaryAidDateTime.ToFarsi(),
|
||||
CalculationDateTime = entity.CalculationDate.ToFarsi()
|
||||
};
|
||||
|
||||
res.EmployeeFullName = _companyContext.Employees.Find(entity.EmployeeId)?.FullName;
|
||||
|
||||
@@ -6,11 +6,14 @@ using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Contract;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.EmployeeChildren;
|
||||
using CompanyManagment.App.Contracts.EmployeeClientTemp;
|
||||
using CompanyManagment.App.Contracts.EmployeeInsuranceRecord;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
using CompanyManagment.App.Contracts.Error;
|
||||
using CompanyManagment.App.Contracts.Job;
|
||||
using CompanyManagment.App.Contracts.LeftWork;
|
||||
using CompanyManagment.App.Contracts.LeftWorkInsurance;
|
||||
using CompanyManagment.App.Contracts.LeftWorkTemp;
|
||||
using CompanyManagment.App.Contracts.PersonnleCode;
|
||||
using CompanyManagment.App.Contracts.Workshop;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
@@ -42,7 +45,9 @@ public class IndexModel : PageModel
|
||||
private readonly IPersonnelCodeApplication _personnelCodeApplication;
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
private readonly IWorkshopApplication _workShopApplication;
|
||||
public List<CreateEmployeChildren> ChildrenList;
|
||||
private readonly ILeftWorkTempApplication _leftWorkTempApplication;
|
||||
private readonly IEmployeeClientTempApplication _employeeClientTempApplication;
|
||||
public List<CreateEmployeChildren> ChildrenList;
|
||||
public string employeeFullName;
|
||||
public List<EmployeeViewModel> Employees;
|
||||
public string EmployerFullName;
|
||||
@@ -57,7 +62,7 @@ public class IndexModel : PageModel
|
||||
ICheckoutApplication checkoutApplication, ICheckoutRepository checkoutRepository,
|
||||
IWebHostEnvironment webHostEnvironment, ILeftWorkInsuranceApplication leftWorkInsuranceApplication,
|
||||
ILeftWorkApplication leftWorkApplication, IPersonnelCodeApplication personnelCodeApplication,
|
||||
IJobApplication jobApplication, IEmployerApplication employerApplication)
|
||||
IJobApplication jobApplication, IEmployerApplication employerApplication, ILeftWorkTempApplication leftWorkTempApplication, IEmployeeClientTempApplication employeeClientTempApplication)
|
||||
{
|
||||
_employeeApplication = employeeApplication;
|
||||
_employeeChildrenApplication = employeeChildrenApplication;
|
||||
@@ -72,7 +77,9 @@ public class IndexModel : PageModel
|
||||
_personnelCodeApplication = personnelCodeApplication;
|
||||
_jobApplication = jobApplication;
|
||||
_employerApplication = employerApplication;
|
||||
_authHelper = authHelper;
|
||||
_leftWorkTempApplication = leftWorkTempApplication;
|
||||
_employeeClientTempApplication = employeeClientTempApplication;
|
||||
_authHelper = authHelper;
|
||||
}
|
||||
|
||||
[TempData] public string Message { get; set; }
|
||||
@@ -1466,7 +1473,27 @@ public class IndexModel : PageModel
|
||||
PermissionIds = permissionIds
|
||||
};
|
||||
|
||||
return Partial("./LeftWork", command);
|
||||
var leftWorks = _leftWorkTempApplication.GetLeftWorkTempsByEmployeeId(employeeId).GetAwaiter().GetResult();
|
||||
if (leftWorks.Any(x => x.LeftWorkType == LeftWorkTempType.LeftWork))
|
||||
{
|
||||
var resultError = new ErrorViewModel()
|
||||
{
|
||||
Message = "این پرسنل دارای یک درخواست ترک کار میباشد لطفا اول آن را در کارپوشه خود تعیین تکلیف نمایید",
|
||||
};
|
||||
return Partial("../Error/_ErrorModal", resultError);
|
||||
}
|
||||
|
||||
var clientTemps = _employeeClientTempApplication.GetByEmployeeId(employeeId).GetAwaiter().GetResult();
|
||||
if (leftWorks.Any(x => x.LeftWorkType == LeftWorkTempType.StartWork) || clientTemps.Any())
|
||||
{
|
||||
var resultError = new ErrorViewModel()
|
||||
{
|
||||
Message = "این پرسنل دارای یک درخواست شروع به کار میباشد لطفا اول آن را در کارپوشه خود تعیین تکلیف نمایید",
|
||||
};
|
||||
return Partial("../Error/_ErrorModal", resultError);
|
||||
}
|
||||
|
||||
return Partial("./LeftWork", command);
|
||||
}
|
||||
|
||||
public IActionResult OnPostCreateLeftWork(LeftWorkDividedList command)
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
@model CompanyManagment.App.Contracts.Error.ErrorViewModel
|
||||
|
||||
@{
|
||||
<style>
|
||||
.disable {
|
||||
pointer-events: none;
|
||||
filter: grayscale(100%);
|
||||
opacity: 0.6;
|
||||
}
|
||||
.modal-content {
|
||||
padding: 2px !important;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
||||
|
||||
|
||||
<div class="modal-header" style="border-bottom: unset">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h5 class="text-center" id="startBuyLabel">خطا</h5>
|
||||
</div>
|
||||
|
||||
<div class="modal-body clearfix">
|
||||
<section class="container-fluid d-flex justify-content-center align-items-center" style="height: 220px">
|
||||
<div class="row justify-content-center align-items-center">
|
||||
<div class="col-12 mt-2 text-center">
|
||||
<svg viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 124px;">
|
||||
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
|
||||
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
|
||||
<g id="SVGRepo_iconCarrier">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 12.5C4 7.80558 7.80558 4 12.5 4C17.1944 4 21 7.80558 21 12.5C21 17.1944 17.1944 21 12.5 21C7.80558 21 4 17.1944 4 12.5ZM13 14.5V16H12V14.5H13ZM12 9V13H13V9H12Z" fill="#bdbdbd"></path>
|
||||
</g>
|
||||
</svg>
|
||||
<p class="m-0 p-2">@Model.WorkshopFullName</p>
|
||||
<p>@Model.Message</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
@@ -1,4 +1,5 @@
|
||||
using _0_Framework.Application;
|
||||
using System.Transactions;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagement.Infrastructure.Excel.CaseManagement;
|
||||
using CompanyManagment.App.Contracts.Board;
|
||||
using CompanyManagment.App.Contracts.Contact2;
|
||||
@@ -183,63 +184,58 @@ public class IndexModel : PageModel
|
||||
|
||||
public IActionResult OnPostEditFile(EditFile command)
|
||||
{
|
||||
var result = _fileApplication.Edit(command);
|
||||
using var transaction = new TransactionScope();
|
||||
var fileResult = _fileApplication.Edit(command);
|
||||
|
||||
if (!result.IsSuccedded)
|
||||
return new JsonResult(result);
|
||||
if (!fileResult.IsSuccedded)
|
||||
return new JsonResult(fileResult);
|
||||
|
||||
if (
|
||||
command.createDiagnosisBoard.BoardChairman != null
|
||||
|| command.createDiagnosisBoard.Branch != null
|
||||
|| command.createDiagnosisBoard.DisputeResolutionPetitionDate != null
|
||||
|| command.createDiagnosisBoard.ExpertReport != null
|
||||
)
|
||||
{
|
||||
if (command.createDiagnosisBoard.Id == 0)
|
||||
result = _boardApplication.Create(command.createDiagnosisBoard);
|
||||
else
|
||||
result = _boardApplication.Edit(command.createDiagnosisBoard);
|
||||
OperationResult diagnosisBoardResult;
|
||||
if (command.createDiagnosisBoard.Id == 0)
|
||||
diagnosisBoardResult = _boardApplication.Create(command.createDiagnosisBoard);
|
||||
else
|
||||
diagnosisBoardResult = _boardApplication.Edit(command.createDiagnosisBoard);
|
||||
|
||||
if (!result.IsSuccedded)
|
||||
return new JsonResult(result);
|
||||
if (!diagnosisBoardResult.IsSuccedded)
|
||||
return new JsonResult(diagnosisBoardResult);
|
||||
|
||||
if (command.createDiagnosisPS != null)
|
||||
result = _proceedingSessionApplication.CreateProceedingSessions(
|
||||
command.createDiagnosisPS,
|
||||
result.SendId
|
||||
);
|
||||
if (command.createDiagnosisPS is { Count: > 0 })
|
||||
{
|
||||
OperationResult diagnosisPs = _proceedingSessionApplication.CreateProceedingSessions(
|
||||
command.createDiagnosisPS,
|
||||
diagnosisBoardResult.SendId
|
||||
);
|
||||
|
||||
if (!result.IsSuccedded)
|
||||
return new JsonResult(result);
|
||||
}
|
||||
if (!diagnosisPs.IsSuccedded)
|
||||
return new JsonResult(diagnosisPs);
|
||||
}
|
||||
|
||||
if (
|
||||
command.createDisputeResolutionBoard.BoardChairman != null
|
||||
|| command.createDisputeResolutionBoard.Branch != null
|
||||
|| command.createDisputeResolutionBoard.DisputeResolutionPetitionDate != null
|
||||
|| command.createDisputeResolutionBoard.ExpertReport != null
|
||||
)
|
||||
{
|
||||
if (command.createDisputeResolutionBoard.Id == 0)
|
||||
result = _boardApplication.Create(command.createDisputeResolutionBoard);
|
||||
else
|
||||
result = _boardApplication.Edit(command.createDisputeResolutionBoard);
|
||||
OperationResult disputeBoardResult;
|
||||
if (command.createDisputeResolutionBoard.Id == 0)
|
||||
disputeBoardResult = _boardApplication.Create(command.createDisputeResolutionBoard);
|
||||
else
|
||||
disputeBoardResult = _boardApplication.Edit(command.createDisputeResolutionBoard);
|
||||
|
||||
if (!result.IsSuccedded)
|
||||
return new JsonResult(result);
|
||||
if (!disputeBoardResult.IsSuccedded)
|
||||
return new JsonResult(disputeBoardResult);
|
||||
|
||||
if (command.createDisputeResolutionPS != null)
|
||||
result = _proceedingSessionApplication.CreateProceedingSessions(
|
||||
command.createDisputeResolutionPS,
|
||||
result.SendId
|
||||
);
|
||||
|
||||
if (!result.IsSuccedded)
|
||||
return new JsonResult(result);
|
||||
}
|
||||
|
||||
return new JsonResult(result);
|
||||
}
|
||||
if (command.createDisputeResolutionPS is { Count: > 0 })
|
||||
{
|
||||
OperationResult disputePs = _proceedingSessionApplication.CreateProceedingSessions(
|
||||
command.createDisputeResolutionPS,
|
||||
disputeBoardResult.SendId
|
||||
);
|
||||
|
||||
if (!disputePs.IsSuccedded)
|
||||
return new JsonResult(disputePs);
|
||||
}
|
||||
|
||||
transaction.Complete();
|
||||
|
||||
return new JsonResult(disputeBoardResult);
|
||||
}
|
||||
|
||||
public IActionResult OnGetCreateOrEditPetition(long fileId, int boardTypeId)
|
||||
{
|
||||
|
||||
@@ -32,11 +32,11 @@ public class SessionsModel : PageModel
|
||||
|
||||
public void OnGet(ProceedingSessionSearchModel searchModel)
|
||||
{
|
||||
_proceedingSessionApplication.UpdatePastProceedingSessions();
|
||||
_proceedingSessionApplication.UpdatePastProceedingSessions();
|
||||
|
||||
viewModels = _proceedingSessionApplication.FilterSessions(searchModel);
|
||||
|
||||
var files = _fileApplication.Search(new FileSearchModel());
|
||||
var files = _fileApplication.Search(new FileSearchModel(){Status = 0});
|
||||
var ArchiveNo_FileClass_UserIdList = files.Select(x => new ArchiveNo_FileClass_UserIdList
|
||||
{
|
||||
ArchiveNo = x.ArchiveNo.ToString(), FileClass = x.FileClass,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@model CompanyManagment.App.Contracts.InstitutionContract.CreateInstitutionContract
|
||||
@{
|
||||
var adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
<style>
|
||||
|
||||
/* .modal-dialog {
|
||||
width: 94% !important;
|
||||
}*/
|
||||
@@ -398,714 +398,13 @@
|
||||
<script src="~/AdminTheme/js/numeral.min.js"></script>
|
||||
<script src="~/admintheme/js/jquery.mask_1.14.16.min.js"></script>
|
||||
<script>
|
||||
var submitcheck1 = true;
|
||||
var submitcheck2 = true;
|
||||
var submitcheck3 = true;
|
||||
|
||||
|
||||
//$(document).ready(function() {
|
||||
// $('#amount').on('input', function() {
|
||||
// var amount = $(this).val();
|
||||
// var totalAmount = amount * 10;
|
||||
// $('#totalAmount').val(totalAmount);
|
||||
// });
|
||||
//});
|
||||
$(".date").mask("0000/00/00");
|
||||
$('.add_project_file').click(function(e) {
|
||||
e.preventDefault();
|
||||
const a = ($(".items").length) / 4;
|
||||
const html = `<div class="row">
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> نوع شماره </label>
|
||||
<select class="form-control items" data-phonetype="${a}" name="ContactInformationList[${a}].PhoneType">'
|
||||
<option value=""> </option>'
|
||||
<option value="شماره همراه"> شماره همراه </option>
|
||||
<option value="شماره ثابت"> شماره ثابت </option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> سمت </label>
|
||||
<select class="form-control items" name="ContactInformationList[${a}].Position">
|
||||
<option value=""> </option>
|
||||
<option value="طرف قرارداد"> طرف قرارداد </option>
|
||||
<option value="کارفرما"> کارفرما </option>
|
||||
<option value="مدیرعامل"> مدیرعامل </option>
|
||||
<option value="نماینده کارفرما"> نماینده کارفرما </option>
|
||||
<option value="مالی"> مالی </option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> نام و نام خانوادگی </label>
|
||||
<input type="text" class="form-control items" name="ContactInformationList[${a}].FnameLname">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div style="display: flex;align-items: center; ">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> شماره تماس </label>
|
||||
<input type="text" class="form-control items" data-mobile="${a}" onkeyup="mobileValidation(this);" name="ContactInformationList[${a}].PhoneNumber">
|
||||
<span data-mobile-err="${a}" style="font-size: 8px; color: red"></span>
|
||||
<input type="checkbox" onclick="checking(this);" data-checkbox="${a}" name="check" style="position: relative; top: -28px; right:99px;"/>
|
||||
<input type="hidden" data-checkboxStr="${a}" name="ContactInformationList[${a}].SendSmsString"/>
|
||||
</div>
|
||||
<a href="#" class="remove_project_file" data-remove="${a}" style="padding: 0 3px;"><i style="color: red;font-size: 15px;" class="ion-close-circled pull-left"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>`;
|
||||
$(".project_images").append(html);
|
||||
|
||||
});
|
||||
|
||||
//mobile validation
|
||||
function mobileValidation(el) {
|
||||
$(el).on("input",
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
});
|
||||
|
||||
|
||||
const contactRow = $(el).closest('div.row');
|
||||
const elData = $(el).attr("data-mobile");
|
||||
|
||||
let selectedPhoneType;
|
||||
contactRow.find("select").each(function() {
|
||||
if ($(this).attr("data-phonetype") == elData) {
|
||||
selectedPhoneType = $(this).prop("selectedIndex");
|
||||
}
|
||||
});
|
||||
|
||||
if (selectedPhoneType == 1) {
|
||||
if ($(el).val().length < 11 || $(el).val().length > 11) {
|
||||
|
||||
$(el).addClass("invalidMobile");
|
||||
contactRow.find("span[data-mobile-err]").text("شماره همراه 11 رقمی وارد کنید");
|
||||
} else {
|
||||
|
||||
$(el).removeClass("invalidMobile");
|
||||
contactRow.find("span[data-mobile-err]").text("");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Remove parent of 'remove' link when link is clicked.
|
||||
$('.project_images').on('click',
|
||||
'.remove_project_file',
|
||||
function(e) {
|
||||
e.preventDefault();
|
||||
const contactRow = $(this).closest('div.row');
|
||||
if ($(this).attr("data-remove") == 0) {
|
||||
contactRow.find('input:text').val('');
|
||||
contactRow.find('input:checkbox').prop('checked', false);
|
||||
contactRow.find("select").each(function() {
|
||||
$(this).prop("selectedIndex", 0);
|
||||
});
|
||||
} else {
|
||||
$(this).closest('div.row').remove();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//checkbox value copy to string input
|
||||
function checking(el) {
|
||||
const datacheckbox = $(el).attr("data-checkbox");
|
||||
const contactRow = $(el).closest('div.row');
|
||||
if ($(el).is(":checked")) {
|
||||
let selectedPhoneType;
|
||||
contactRow.find("select").each(function() {
|
||||
if ($(this).attr("data-phonetype") == datacheckbox) {
|
||||
selectedPhoneType = $(this).prop("selectedIndex");
|
||||
}
|
||||
});
|
||||
if (selectedPhoneType == 1) {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("true");
|
||||
} else {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("false");
|
||||
$(el).prop("checked", false);
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "ابتدا نوع شماره را همراه انتخاب کنید");
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("false");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function setValueAdded() {
|
||||
$('input[name="checkTaxAdded"]').val("true");
|
||||
calculateTotalAmount();
|
||||
|
||||
}
|
||||
|
||||
function removeValueAdded() {
|
||||
$('input[name="checkTaxAdded"]').val("false");
|
||||
calculateTotalAmount();
|
||||
|
||||
}
|
||||
|
||||
function findEndOfYear(date) {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("/Company/InstitutionContracts/Index", "FindEndOfYear")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "start": date },
|
||||
|
||||
success: function(response) {
|
||||
|
||||
$('#end').val(response.end);
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//ارزش افزوده
|
||||
$('#officialStatus').on('change',
|
||||
function() {
|
||||
if ($(this).val() == "Official") {
|
||||
|
||||
const tax = `<div class="col-xs-12">
|
||||
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
|
||||
|
||||
<div class="radio-box" style=" display: flex">
|
||||
<label class="radio-label" style="background-color: #fad7d7;
|
||||
padding: 5px;
|
||||
border-radius: 5px;"> مالیات بر ارزش افزوده </label>
|
||||
<span> </span> <span> </span> <span> </span> <span> </span>
|
||||
<div class="radio-input">
|
||||
<label>
|
||||
<input type="radio" style="margin: 10px 0px;" value="true" onclick="setValueAdded()" asp-for="HasValueAddedTax" name="HasValueAddedTax"><span> </span> <span>دارد</span>
|
||||
|
||||
</label>
|
||||
<span> </span> <span> </span> <span> </span> <span> </span>
|
||||
<label>
|
||||
<input type="radio" style="margin: 10px 0px;" value="false" onclick="removeValueAdded()" asp-for="HasValueAddedTax" name="HasValueAddedTax"><span> </span> <span>ندارد</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</fieldset>
|
||||
</div>`;
|
||||
$('#valueAdded').append(tax);
|
||||
$('#valueAdded').show();
|
||||
} else {
|
||||
$('#valueAdded').html('');
|
||||
$('#valueAdded').hide();
|
||||
$('input[name="checkTaxAdded"]').val("false");
|
||||
calculateTotalAmount();
|
||||
}
|
||||
});
|
||||
|
||||
// تابع برای محاسبه و نمایش مقدار در فیلد totalAmount
|
||||
function calculateTotalAmount() {
|
||||
const start = $('#start').val();
|
||||
|
||||
const end = $('#end').val();
|
||||
|
||||
const amount = $('#amount').val();
|
||||
|
||||
|
||||
const checkTax = $('input[name="checkTaxAdded"]').val();
|
||||
console.log(checkTax);
|
||||
let isTaxAdded = "false";
|
||||
if ($('#officialStatus').val() == "Official") {
|
||||
|
||||
if (checkTax == "true") {
|
||||
isTaxAdded = "true";
|
||||
} else {
|
||||
isTaxAdded = "false";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (start.length == 10 && end.length == 10 && amount.length > 1) {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("/Company/InstitutionContracts/Index", "MountCounter")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "start": start, "end": end, "amount": amount, "valueAddedtax": isTaxAdded },
|
||||
|
||||
success: function(response) {
|
||||
|
||||
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
const compute = numeral(response.totalAmount).format();
|
||||
const finalAmount = numeral(response.finalAmount).format();
|
||||
const valueAddedTax = numeral(response.valueAddedTax).format();
|
||||
$('#obligation').val(compute);
|
||||
$('#totalAmount').val(compute);
|
||||
$('#finalAmount').val(finalAmount);
|
||||
$('#finalAmountFake').val(finalAmount);
|
||||
$('#valueAddedTax').val(valueAddedTax);
|
||||
$('#valueAddedTaxFake').val(valueAddedTax);
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#sendData').on('click',
|
||||
function(e) {
|
||||
|
||||
if (submitcheck1 === false || submitcheck2 === false || submitcheck3 === false) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
$('#city2').on('change',
|
||||
function() {
|
||||
const selectedcity = jQuery("#city2 option:selected").text();
|
||||
$('#hidencity').val(selectedcity);
|
||||
|
||||
});
|
||||
$('#contractDate').on('change',
|
||||
function() {
|
||||
submitcheck1 = dateValidcheck(this);
|
||||
|
||||
});
|
||||
// هنگام ورود مقدار به فیلد start
|
||||
$('#start').on('input',
|
||||
function() {
|
||||
const startDate = this.value;
|
||||
if (startDate.length == 10) {
|
||||
submitcheck2 = dateValidcheck(this);
|
||||
if (submitcheck2) {
|
||||
findEndOfYear(startDate);
|
||||
calculateTotalAmount();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
// هنگام ورود مقدار به فیلد end
|
||||
$('#end').on('input',
|
||||
function() {
|
||||
const endDate = this.value;
|
||||
if (endDate.length == 10) {
|
||||
submitcheck3 = dateValidcheck(this);
|
||||
calculateTotalAmount();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
// هنگام ورود مقدار به فیلد amount
|
||||
$('#amount').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var contractAmount = $("#amount");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
contractAmount.on("keyup",
|
||||
function(e) {
|
||||
contractAmount.val(numeral(contractAmount.val()).format());
|
||||
});
|
||||
calculateTotalAmount();
|
||||
});
|
||||
$('#obligation').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var obligation = $("#obligation");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
obligation.on("keyup",
|
||||
function(e) {
|
||||
obligation.val(numeral(obligation.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
$('#totalAmount').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var totalAmount = $("#totalAmount");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
totalAmount.on("keyup",
|
||||
function(e) {
|
||||
totalAmount.val(numeral(totalAmount.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
$('#dailyCompenseation').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var dailyCompenseation = $("#dailyCompenseation");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
dailyCompenseation.on("keyup",
|
||||
function(e) {
|
||||
dailyCompenseation.val(numeral(dailyCompenseation.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
var start1valid = false;
|
||||
|
||||
function dateValidcheck(inputField1) {
|
||||
|
||||
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = inputField1.value;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
let s1, s2;
|
||||
for (var i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 4) {
|
||||
s1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 7) {
|
||||
s2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
let yRes = y1 + y2 + y3 + y4;
|
||||
let year = parseInt(yRes);
|
||||
let mRes = m1 + m2;
|
||||
let month = parseInt(mRes);
|
||||
let dRes = d1 + d2;
|
||||
let day = parseInt(dRes);
|
||||
let fixResult = yRes + s1 + mRes + s2 + dRes;
|
||||
let test1 = checkEnValid(inputField1.value);
|
||||
|
||||
let isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(fixResult);
|
||||
|
||||
|
||||
if (isValid && test1) {
|
||||
inputField1.style.backgroundColor = '#a6e9a6';
|
||||
start1valid = true;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
if (inputField1.value != "") {
|
||||
inputField1.style.backgroundColor = '#f94c4c';
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
|
||||
start1valid = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return start1valid;
|
||||
|
||||
}
|
||||
|
||||
function checkEnValid(fixDate1) {
|
||||
|
||||
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = fixDate1;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
for (let i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
let yRes = y1 + y2 + y3 + y4;
|
||||
let year = parseInt(yRes);
|
||||
let mRes = m1 + m2;
|
||||
let month = parseInt(mRes);
|
||||
let dRes = d1 + d2;
|
||||
let day = parseInt(dRes);
|
||||
let kabiseh = false;
|
||||
if (month <= 6 && day > 31) {
|
||||
return false;
|
||||
} else if (month > 6 && month < 12 && day > 30) {
|
||||
return false;
|
||||
} else if (month === 12) {
|
||||
|
||||
switch (year) {
|
||||
case 1346:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1350:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1354:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1358:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1362:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1366:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1370:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1375:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1379:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1383:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1387:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1391:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1395:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1399:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1403:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1408:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1412:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1416:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1420:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1424:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1428:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1432:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1436:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1441:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1445:
|
||||
kabiseh = true;
|
||||
break;
|
||||
default:
|
||||
kabiseh = false;
|
||||
|
||||
}
|
||||
if (kabiseh == true && day > 30) {
|
||||
return false;
|
||||
} else if (kabiseh == false && day > 29) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
var ajaxFindeEndOfYear = '@Url.Page("/Company/InstitutionContracts/Index", "FindEndOfYear")';
|
||||
var ajaxCalculateTotalAmount = '@Url.Page("/Company/InstitutionContracts/Index", "MountCounter")';
|
||||
|
||||
var ajaxLoadContractingPrties = '@Url.Page("/Company/InstitutionContracts/Index", "ContractingParties")';
|
||||
var ajaxLoadContractingPrtiesInfo = '@Url.Page("/Company/InstitutionContracts/Index", "WorkshopCountAndEmployeeCount")';
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
|
||||
async function loadContractingPrties() {
|
||||
/* loadPersonnel();*/
|
||||
const nameId = document.getElementById("getContractingPrties").value;
|
||||
<script src="~/AssetsAdmin/page/InstitutionContract/js/Create.js?ver=@adminVersion"></script>
|
||||
|
||||
|
||||
$('#getContracingPartiesInfo').empty().append('<option selected="selected" value="0" >انتخاب طرف حساب</option>');
|
||||
|
||||
|
||||
if (nameId != "noId") {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("/Company/InstitutionContracts/Index", "ContractingParties")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "id": nameId },
|
||||
|
||||
success: function(response) {
|
||||
//var items2 = [];
|
||||
|
||||
//$.each(response,
|
||||
// function (key, val) {
|
||||
// items2.push({ id: key, vall: val });
|
||||
|
||||
// });
|
||||
|
||||
|
||||
$.each(response.mylist,
|
||||
function(i, item) {
|
||||
$('#getContracingPartiesInfo').append($('<option>',
|
||||
{
|
||||
value: item.id,
|
||||
text: item.fullName,
|
||||
}));
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
async function loadContracingPartiesInfo() {
|
||||
const id = document.getElementById("getContracingPartiesInfo").value;
|
||||
const workshopId = document.getElementById("getContractingPrties").value;
|
||||
|
||||
if (workshopId == "noId") {
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "ابتدا معرف را انتخاب نمایید");
|
||||
}
|
||||
|
||||
if (id > 0 && workshopId != "noId") {
|
||||
$.ajax({
|
||||
//contentType: 'application/json; charset=utf-8',
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("/Company/InstitutionContracts/Index", "WorkshopCountAndEmployeeCount")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "id": id },
|
||||
|
||||
success: function(response) {
|
||||
var items2 = [];
|
||||
$.each(response,
|
||||
function(key, val) {
|
||||
items2.push({ id: key, vall: val });
|
||||
|
||||
});
|
||||
//if (items2[8].vall == "")
|
||||
// $.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ',"ابتدا تاریخ شروع به کار را در بخش پرسنل <br/>برای این شخص و کارگاه مورد نظر ایجاد نموده و سپس اقدام به ایجاد قرارداد نمایید");
|
||||
document.getElementById("WCounter").value = items2[1].vall;
|
||||
document.getElementById("ECounter").value = items2[2].vall;
|
||||
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
@@ -1,5 +1,6 @@
|
||||
@model CompanyManagment.App.Contracts.InstitutionContract.EditInstitutionContract
|
||||
@{
|
||||
var adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
<style>
|
||||
|
||||
/* .modal-dialog {
|
||||
@@ -522,619 +523,10 @@
|
||||
<script language="javascript" src="~/AdminTheme/js/city2.js"></script>
|
||||
<script src="~/AdminTheme/js/numeral.min.js"></script>
|
||||
<script src="~/admintheme/js/jquery.mask_1.14.16.min.js"></script>
|
||||
|
||||
<script>
|
||||
var submitcheck1 = true;
|
||||
var submitcheck2 = true;
|
||||
var submitcheck3 = true;
|
||||
$(".date").mask("0000/00/00");
|
||||
|
||||
$('.add_project_file').click(function(e) {
|
||||
e.preventDefault();
|
||||
const a = ($(".items").length) / 4;
|
||||
const html = `<div class="row">
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> نوع شماره </label>
|
||||
<select class="form-control items" data-phonetype="${a}" name="ContactInformationList[${a}].PhoneType">'
|
||||
<option value=""> </option>'
|
||||
<option value="شماره همراه"> شماره همراه </option>
|
||||
<option value="شماره ثابت"> شماره ثابت </option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> سمت </label>
|
||||
<select class="form-control items" name="ContactInformationList[${a}].Position">
|
||||
<option value=""> </option>
|
||||
<option value="طرف قرارداد"> طرف قرارداد </option>
|
||||
<option value="کارفرما"> کارفرما </option>
|
||||
<option value="مدیرعامل"> مدیرعامل </option>
|
||||
<option value="نماینده کارفرما"> نماینده کارفرما </option>
|
||||
<option value="مالی"> مالی </option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> نام و نام خانوادگی </label>
|
||||
<input type="text" class="form-control items" name="ContactInformationList[${a}].FnameLname">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div style="display: flex;align-items: center; ">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> شماره تماس </label>
|
||||
<input type="text" class="form-control items" data-mobile="${a}" onkeyup="mobileValidation(this);" name="ContactInformationList[${a}].PhoneNumber">
|
||||
<span data-mobile-err="${a}" style="font-size: 8px; color: red"></span>
|
||||
<input type="checkbox" onclick="checking(this);" data-checkbox="${a}" name="check" style="position: relative; top: -28px; right:99px;"/>
|
||||
<input type="hidden" data-checkboxStr="${a}" name="ContactInformationList[${a}].SendSmsString"/>
|
||||
</div>
|
||||
<a href="#" class="remove_project_file" data-remove="${a}" style="padding: 0 3px;"><i style="color: red;font-size: 15px;" class="ion-close-circled pull-left"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>`;
|
||||
$(".project_images").append(html);
|
||||
|
||||
});
|
||||
|
||||
//checkbox value copy to string input
|
||||
function checking(el) {
|
||||
const datacheckbox = $(el).attr("data-checkbox");
|
||||
const contactRow = $(el).closest('div.row');
|
||||
if ($(el).is(":checked")) {
|
||||
let selectedPhoneType;
|
||||
contactRow.find("select").each(function() {
|
||||
if ($(this).attr("data-phonetype") == datacheckbox) {
|
||||
selectedPhoneType = $(this).prop("selectedIndex");
|
||||
}
|
||||
});
|
||||
if (selectedPhoneType == 1) {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("true");
|
||||
} else {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("false");
|
||||
$(el).prop("checked", false);
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "ابتدا نوع شماره را همراه انتخاب کنید");
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("false");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//mobile validation
|
||||
function mobileValidation(el) {
|
||||
$(el).on("input",
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
});
|
||||
|
||||
|
||||
const contactRow = $(el).closest('div.row');
|
||||
const elData = $(el).attr("data-mobile");
|
||||
|
||||
let selectedPhoneType;
|
||||
contactRow.find("select").each(function() {
|
||||
if ($(this).attr("data-phonetype") == elData) {
|
||||
selectedPhoneType = $(this).prop("selectedIndex");
|
||||
}
|
||||
});
|
||||
|
||||
if (selectedPhoneType == 1) {
|
||||
if ($(el).val().length < 11 || $(el).val().length > 11) {
|
||||
|
||||
$(el).addClass("invalidMobile");
|
||||
contactRow.find("span[data-mobile-err]").text("شماره همراه 11 رقمی وارد کنید");
|
||||
} else {
|
||||
|
||||
$(el).removeClass("invalidMobile");
|
||||
contactRow.find("span[data-mobile-err]").text("");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Remove parent of 'remove' link when link is clicked.
|
||||
$('.project_images').on('click',
|
||||
'.remove_project_file',
|
||||
function(e) {
|
||||
e.preventDefault();
|
||||
const contactRow = $(this).closest('div.row');
|
||||
if ($(this).attr("data-remove") == 0) {
|
||||
contactRow.find('input:text').val('');
|
||||
contactRow.find('input:checkbox').prop('checked', false);
|
||||
contactRow.find("select").each(function() {
|
||||
$(this).prop("selectedIndex", 0);
|
||||
});
|
||||
} else {
|
||||
$(this).closest('div.row').remove();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function setValueAdded() {
|
||||
$('input[name="checkTaxAdded"]').val("true");
|
||||
calculateTotalAmount();
|
||||
|
||||
}
|
||||
|
||||
function removeValueAdded() {
|
||||
$('input[name="checkTaxAdded"]').val("false");
|
||||
calculateTotalAmount();
|
||||
|
||||
}
|
||||
|
||||
//ارزش افزوده
|
||||
$('#officialStatus').on('change',
|
||||
function() {
|
||||
if ($(this).val() == "Official") {
|
||||
|
||||
const tax = `<div class="col-xs-12">
|
||||
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
|
||||
|
||||
<div class="radio-box" style=" display: flex">
|
||||
<label class="radio-label" style="background-color: #fad7d7;
|
||||
padding: 5px;
|
||||
border-radius: 5px;"> مالیات بر ارزش افزوده </label>
|
||||
<span> </span> <span> </span> <span> </span> <span> </span>
|
||||
<div class="radio-input">
|
||||
<label>
|
||||
<input type="radio" style="margin: 10px 0px;" value="true" onclick="setValueAdded()" asp-for="HasValueAddedTax" name="HasValueAddedTax"><span> </span> <span>دارد</span>
|
||||
|
||||
</label>
|
||||
<span> </span> <span> </span> <span> </span> <span> </span>
|
||||
<label>
|
||||
<input type="radio" style="margin: 10px 0px;" value="false" onclick="removeValueAdded()" asp-for="HasValueAddedTax" name="HasValueAddedTax"><span> </span> <span>ندارد</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</fieldset>
|
||||
</div>`;
|
||||
$('#valueAdded').append(tax);
|
||||
$('#valueAdded').show();
|
||||
} else {
|
||||
$('#valueAdded').html('');
|
||||
$('#valueAdded').hide();
|
||||
$('input[name="checkTaxAdded"]').val("false");
|
||||
calculateTotalAmount();
|
||||
}
|
||||
});
|
||||
|
||||
// تابع برای محاسبه و نمایش مقدار در فیلد totalAmount
|
||||
function calculateTotalAmount() {
|
||||
const start = $('#start').val();
|
||||
|
||||
const end = $('#end').val();
|
||||
|
||||
const amount = $('#amount').val();
|
||||
|
||||
|
||||
const checkTax = $('input[name="checkTaxAdded"]').val();
|
||||
console.log(checkTax);
|
||||
let isTaxAdded = "false";
|
||||
if ($('#officialStatus').val() == "Official") {
|
||||
|
||||
if (checkTax == "true") {
|
||||
isTaxAdded = "true";
|
||||
} else {
|
||||
isTaxAdded = "false";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (start.length == 10 && end.length == 10 && amount.length > 1) {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("/Company/InstitutionContracts/Index", "MountCounter")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "start": start, "end": end, "amount": amount, "valueAddedtax": isTaxAdded },
|
||||
|
||||
success: function(response) {
|
||||
|
||||
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
const compute = numeral(response.totalAmount).format();
|
||||
const finalAmount = numeral(response.finalAmount).format();
|
||||
const valueAddedTax = numeral(response.valueAddedTax).format();
|
||||
$('#obligation').val(compute);
|
||||
$('#totalAmount').val(compute);
|
||||
$('#finalAmountFake').val(finalAmount);
|
||||
$('#finalAmount').val(finalAmount);
|
||||
$('#valueAddedTax').val(valueAddedTax);
|
||||
$('#valueAddedTaxFake').val(valueAddedTax);
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#sendData').on('click',
|
||||
function(e) {
|
||||
|
||||
const selectedcity = jQuery("#city2 option:selected").text();
|
||||
|
||||
$('#copyCity').val(selectedcity);
|
||||
|
||||
if (submitcheck1 === false || submitcheck2 === false || submitcheck3 === false) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
$('#finalAmountFake').val($('#finalAmount').val());
|
||||
$('#valueAddedTaxFake').val($('#valueAddedTax').val());
|
||||
$('input[name="checkTaxAdded"]').val(@Model.HasValueAddedTax);
|
||||
const state = document.getElementById('state').value;
|
||||
const citySelect = document.getElementById('copyCity').value;
|
||||
console.log(citySelect);
|
||||
|
||||
iranwebsv2(state);
|
||||
|
||||
$('#city2 option:contains("شهرستان")').text(citySelect);
|
||||
|
||||
$('#contractDate').on('change',
|
||||
function() {
|
||||
submitcheck1 = dateValidcheck(this);
|
||||
|
||||
});
|
||||
// هنگام ورود مقدار به فیلد start
|
||||
$('#start').on('input',
|
||||
function() {
|
||||
const startDate = this.value;
|
||||
if (startDate.length == 10) {
|
||||
submitcheck2 = dateValidcheck(this);
|
||||
if (submitcheck2) {
|
||||
findEndOfYear(startDate);
|
||||
calculateTotalAmount();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
// هنگام ورود مقدار به فیلد end
|
||||
$('#end').on('input',
|
||||
function() {
|
||||
const endDate = this.value;
|
||||
if (endDate.length == 10) {
|
||||
submitcheck3 = dateValidcheck(this);
|
||||
calculateTotalAmount();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
// هنگام ورود مقدار به فیلد amount
|
||||
$('#amount').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var contractAmount = $("#amount");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
contractAmount.on("keyup",
|
||||
function(e) {
|
||||
contractAmount.val(numeral(contractAmount.val()).format());
|
||||
});
|
||||
calculateTotalAmount();
|
||||
});
|
||||
$('#obligation').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var obligation = $("#obligation");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
obligation.on("keyup",
|
||||
function(e) {
|
||||
obligation.val(numeral(obligation.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
$('#totalAmount').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var totalAmount = $("#totalAmount");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
totalAmount.on("keyup",
|
||||
function(e) {
|
||||
totalAmount.val(numeral(totalAmount.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
$('#dailyCompenseation').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var dailyCompenseation = $("#dailyCompenseation");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
dailyCompenseation.on("keyup",
|
||||
function(e) {
|
||||
dailyCompenseation.val(numeral(dailyCompenseation.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function findEndOfYear(date) {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("/Company/InstitutionContracts/Index", "FindEndOfYear")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "start": date },
|
||||
|
||||
success: function(response) {
|
||||
|
||||
$('#end').val(response.end);
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
var start1valid = false;
|
||||
|
||||
function dateValidcheck(inputField1) {
|
||||
|
||||
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = inputField1.value;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
let s1, s2;
|
||||
for (var i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 4) {
|
||||
s1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 7) {
|
||||
s2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
let yRes = y1 + y2 + y3 + y4;
|
||||
let year = parseInt(yRes);
|
||||
let mRes = m1 + m2;
|
||||
let month = parseInt(mRes);
|
||||
let dRes = d1 + d2;
|
||||
let day = parseInt(dRes);
|
||||
let fixResult = yRes + s1 + mRes + s2 + dRes;
|
||||
let test1 = checkEnValid(inputField1.value);
|
||||
|
||||
let isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(fixResult);
|
||||
|
||||
|
||||
if (isValid && test1) {
|
||||
inputField1.style.backgroundColor = '#a6e9a6';
|
||||
start1valid = true;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
if (inputField1.value != "") {
|
||||
inputField1.style.backgroundColor = '#f94c4c';
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
|
||||
start1valid = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return start1valid;
|
||||
|
||||
}
|
||||
|
||||
function checkEnValid(fixDate1) {
|
||||
|
||||
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = fixDate1;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
for (let i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
let yRes = y1 + y2 + y3 + y4;
|
||||
let year = parseInt(yRes);
|
||||
let mRes = m1 + m2;
|
||||
let month = parseInt(mRes);
|
||||
let dRes = d1 + d2;
|
||||
let day = parseInt(dRes);
|
||||
let kabiseh = false;
|
||||
if (month <= 6 && day > 31) {
|
||||
return false;
|
||||
} else if (month > 6 && month < 12 && day > 30) {
|
||||
return false;
|
||||
} else if (month === 12) {
|
||||
|
||||
switch (year) {
|
||||
case 1346:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1350:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1354:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1358:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1362:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1366:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1370:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1375:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1379:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1383:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1387:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1391:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1395:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1399:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1403:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1408:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1412:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1416:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1420:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1424:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1428:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1432:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1436:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1441:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1445:
|
||||
kabiseh = true;
|
||||
break;
|
||||
default:
|
||||
kabiseh = false;
|
||||
|
||||
}
|
||||
if (kabiseh == true && day > 30) {
|
||||
return false;
|
||||
} else if (kabiseh == false && day > 29) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
var ajaxCalculateTotalAmount = '@Url.Page("/Company/InstitutionContracts/Index", "MountCounter")';
|
||||
var valueAddedTax = '@Model.HasValueAddedTax';
|
||||
var ajaxFindeEndOfYear = '@Url.Page("/Company/InstitutionContracts/Index", "FindEndOfYear")';
|
||||
</script>
|
||||
<script src="~/AssetsAdmin/page/InstitutionContract/js/Edit.js?ver=@adminVersion"></script>
|
||||
@@ -1,5 +1,8 @@
|
||||
@model CompanyManagment.App.Contracts.FinancilTransaction.EditFinancialTransaction
|
||||
@Html.AntiForgeryToken()
|
||||
@{
|
||||
var adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
}
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
|
||||
<span style="font-size: 24px">×</span>
|
||||
@@ -62,260 +65,6 @@
|
||||
|
||||
<script src="~/AdminTheme/js/numeral.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
const jobRelation = "بابت قرارداد مابین (روابط کار)";
|
||||
const taxAndFinancial = "بابت قرارداد مابین (حسابداری و مالیات)";
|
||||
const debtorOptions = $(
|
||||
`<option class="debtOption" value="0">انتخاب کنید...</option>
|
||||
<option class="debtOption" value = "${jobRelation}"> ${jobRelation} </option>
|
||||
<option class="debtOption" value = "${taxAndFinancial}"> ${taxAndFinancial} </option>
|
||||
<option class="debtOption" value = " بابت قراردادهای گذشته پرسنل" > بابت قراردادهای گذشته پرسنل </option>
|
||||
<option class="debtOption" value = "بابت پرونده" > بابت پرونده</option>
|
||||
<option class="debtOption" value = "بابت مبلغ بیمه کارگاه" > بابت مبلغ بیمه کارگاه </option>
|
||||
<option class="debtOption" value = "بابت مبلغ بیمه خویش فرما " > بابت مبلغ بیمه خویش فرما </option>
|
||||
<option class="debtOption" value = "بابت فیش کارگزاری " > بابت فیش کارگزاری </option>
|
||||
<option class="debtOption" value = "بابت بدهی از قرارداد قبل " > بابت بدهی از قرارداد قبل </option>
|
||||
<option class="debtOption" value = "بابت خرید" > بابت خرید </option>
|
||||
<option class="debtOption" value = "بابت بدهی سایر " > بابت بدهی سایر </option>
|
||||
`
|
||||
);
|
||||
const creditorOptions = $(
|
||||
`<option class="creditOption" value="0">انتخاب کنید...</option>
|
||||
<option class="creditOption" value = "${jobRelation}"> ${jobRelation} </option>
|
||||
<option class="creditOption" value = "${taxAndFinancial}"> ${taxAndFinancial} </option>
|
||||
<option class="creditOption" value = " بابت قراردادهای گذشته پرسنل" > بابت قراردادهای گذشته پرسنل </option>
|
||||
<option class="creditOption" value = "بابت پرونده" > بابت پرونده</option>
|
||||
<option class="creditOption" value = "بابت مبلغ بیمه کارگاه" > بابت مبلغ بیمه کارگاه </option>
|
||||
<option class="creditOption" value = "بابت مبلغ بیمه خویش فرما " > بابت مبلغ بیمه خویش فرما </option>
|
||||
<option class="creditOption" value = "بابت فیش کارگزاری " > بابت فیش کارگزاری </option>
|
||||
<option class="creditOption" value = "بابت بدهی از قرارداد قبل " > بابت بدهی از قرارداد قبل </option>
|
||||
<option class="creditOption" value = "بابت بدهی سایر " > بابت بدهی سایر </option>
|
||||
<option class="creditOption" value = "بابت حق بیمه کارگاه" > بابت حق بیمه کارگاه </option>
|
||||
<option class="creditOption" value = "بابت حق بیمه خویش فرما" > بابت حق بیمه خویش فرما </option>
|
||||
<option class="creditOption" value = "بابت خرید" > بابت خرید </option>
|
||||
<option class="creditOption" value = "بابت خدمات" > بابت خدمات </option>
|
||||
<option class="creditOption" value = "بابت تخفیف" > بابت تخفیف </option>`
|
||||
);
|
||||
|
||||
const typeOfTransAction = $('#EditTransactionBody .options-select').val();
|
||||
const defaultSelect = $('#decriptioOption').val();
|
||||
if (typeOfTransAction == "debt") {
|
||||
$("#EditTransactionBody .options-select2").append(debtorOptions);
|
||||
$("#EditTransactionBody .options-select2").val(defaultSelect).change();
|
||||
$("#EditTransactionBody .debtor").prop("disabled", false);
|
||||
$("#EditTransactionBody .creditor").prop("disabled", true);
|
||||
$("#EditTransactionBody .creditor").val("").removeClass("errored");
|
||||
} else {
|
||||
$("#EditTransactionBody .options-select2").append(creditorOptions);
|
||||
$("#EditTransactionBody .options-select2").val(defaultSelect).change();
|
||||
$("#EditTransactionBody .creditor").prop("disabled", false);
|
||||
$("#EditTransactionBody .debtor").prop("disabled", true);
|
||||
$("#EditTransactionBody .debtor").val("").removeClass("errored");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//تاریخ امروز
|
||||
$('.currentDay').on("click",
|
||||
function() {
|
||||
$('#todayFa').val($('#hiddenToday').val());
|
||||
});
|
||||
|
||||
//فعال سازی دکمه ی اینتر برای ثبت نهایی
|
||||
$('.EditTransactionForm .form-control').keypress(function(event) {
|
||||
if (event.which === 13) {
|
||||
checkNecessaryInputs();
|
||||
}
|
||||
});
|
||||
let jobRelation = "بابت قرارداد مابین (روابط کار)";
|
||||
let taxAndFinancial = "بابت قرارداد مابین (حسابداری و مالیات)";
|
||||
//غیرفعال یا فعالسازی اینپوت های بدهکار و بستانکار , آپشن های پرداخت / ایجاد بدهی
|
||||
let debtorOptions = $(
|
||||
`<option class="debtOption" value="0">انتخاب کنید...</option>
|
||||
<option class="debtOption" value = "${jobRelation}"> ${jobRelation} </option>
|
||||
<option class="debtOption" value = "${taxAndFinancial}"> ${taxAndFinancial} </option>
|
||||
<option class="debtOption" value = " بابت قراردادهای گذشته پرسنل" > بابت قراردادهای گذشته پرسنل </option>
|
||||
<option class="debtOption" value = "بابت پرونده" > بابت پرونده</option>
|
||||
<option class="debtOption" value = "بابت مبلغ بیمه کارگاه" > بابت مبلغ بیمه کارگاه </option>
|
||||
<option class="debtOption" value = "بابت مبلغ بیمه خویش فرما " > بابت مبلغ بیمه خویش فرما </option>
|
||||
<option class="debtOption" value = "بابت فیش کارگزاری " > بابت فیش کارگزاری </option>
|
||||
<option class="debtOption" value = "بابت بدهی از قرارداد قبل " > بابت بدهی از قرارداد قبل </option>
|
||||
<option class="debtOption" value = "بابت خرید" > بابت خرید </option>
|
||||
<option class="debtOption" value = "بابت بدهی سایر " > بابت بدهی سایر </option>
|
||||
`
|
||||
);
|
||||
let creditorOptions = $(
|
||||
`<option class="creditOption" value="0">انتخاب کنید...</option>
|
||||
<option class="creditOption" value = "${jobRelation}"> ${jobRelation} </option>
|
||||
<option class="creditOption" value = "${taxAndFinancial}"> ${taxAndFinancial} </option>
|
||||
<option class="creditOption" value = " بابت قراردادهای گذشته پرسنل" > بابت قراردادهای گذشته پرسنل </option>
|
||||
<option class="creditOption" value = "بابت پرونده" > بابت پرونده</option>
|
||||
<option class="creditOption" value = "بابت مبلغ بیمه کارگاه" > بابت مبلغ بیمه کارگاه </option>
|
||||
<option class="creditOption" value = "بابت مبلغ بیمه خویش فرما " > بابت مبلغ بیمه خویش فرما </option>
|
||||
<option class="creditOption" value = "بابت فیش کارگزاری " > بابت فیش کارگزاری </option>
|
||||
<option class="creditOption" value = "بابت بدهی از قرارداد قبل " > بابت بدهی از قرارداد قبل </option>
|
||||
<option class="creditOption" value = "بابت بدهی سایر " > بابت بدهی سایر </option>
|
||||
<option class="creditOption" value = "بابت حق بیمه کارگاه" > بابت حق بیمه کارگاه </option>
|
||||
<option class="creditOption" value = "بابت حق بیمه خویش فرما" > بابت حق بیمه خویش فرما </option>
|
||||
<option class="creditOption" value = "بابت خرید" > بابت خرید </option>
|
||||
<option class="creditOption" value = "بابت خدمات" > بابت خدمات </option>
|
||||
<option class="creditOption" value = "بابت تخفیف" > بابت تخفیف </option>`
|
||||
);
|
||||
$("#EditTransactionBody .options-select").change(function() {
|
||||
const selectedOption = $(this).val();
|
||||
$("#EditTransactionBody .options-select2").html("");
|
||||
if (selectedOption == "debt") {
|
||||
$("#EditTransactionBody .options-select2").append(debtorOptions);
|
||||
$("#EditTransactionBody .debtor").prop("disabled", false);
|
||||
$("#EditTransactionBody .creditor").prop("disabled", true);
|
||||
$("#EditTransactionBody .creditor").val("").removeClass("errored");
|
||||
} else if (selectedOption == "credit") {
|
||||
$("#EditTransactionBody .options-select2").append(creditorOptions);
|
||||
$("#EditTransactionBody .creditor").prop("disabled", false);
|
||||
$("#EditTransactionBody .debtor").prop("disabled", true);
|
||||
$("#EditTransactionBody .debtor").val("").removeClass("errored");
|
||||
} else {
|
||||
$("#EditTransactionBody .creditor").val("").prop("disabled", true);
|
||||
$("#EditTransactionBody .debtor").val("").prop("disabled", true);
|
||||
}
|
||||
});
|
||||
|
||||
//غیرفعال کردن datepicker پس از بستن مودال
|
||||
$("#close , .close").on('click',
|
||||
function() {
|
||||
$(".datepicker-container").hide();
|
||||
});
|
||||
$(document).on("click",
|
||||
function(event) {
|
||||
const target = $(event.target);
|
||||
if (!target.is("#EditTransactionBody") && !target.is("#EditTransactionBody *")
|
||||
) {
|
||||
$(".datepicker-container").hide();
|
||||
}
|
||||
});
|
||||
|
||||
//تنظیمات بخش های پول
|
||||
$('#EditTransactionBody #debtInput').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var contractAmount = $("#EditTransactionBody #debtInput");
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
contractAmount.on("keyup",
|
||||
function(e) {
|
||||
contractAmount.val(numeral(contractAmount.val()).format());
|
||||
});
|
||||
});
|
||||
$('#EditTransactionBody #creditInput').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var contractAmount = $("#EditTransactionBody #creditInput");
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
contractAmount.on("keyup",
|
||||
function(e) {
|
||||
contractAmount.val(numeral(contractAmount.val()).format());
|
||||
});
|
||||
});
|
||||
|
||||
// چک کردن اینپوت های ضروری هنگام ثبت
|
||||
function checkNecessaryInputs() {
|
||||
if ($("#EditTransactionBody .persianDateInput").val().length < 10) {
|
||||
$("#EditTransactionBody .persianDateInput").addClass("errored");
|
||||
} else {
|
||||
$("#EditTransactionBody .persianDateInput").removeClass("errored");
|
||||
}
|
||||
const selectedOption = $("#EditTransactionBody .options-select").val();
|
||||
const selectedOption2 = $("#EditTransactionBody .options-select2").val();
|
||||
if (selectedOption == 0) {
|
||||
$("#EditTransactionBody .options-select").addClass("errored");
|
||||
} else {
|
||||
$("#EditTransactionBody .options-select").removeClass("errored");
|
||||
}
|
||||
if (selectedOption2 == 0 || selectedOption2 == null) {
|
||||
$("#EditTransactionBody .options-select2").addClass("errored");
|
||||
} else {
|
||||
$("#EditTransactionBody .options-select2").removeClass("errored");
|
||||
}
|
||||
|
||||
if (selectedOption == "debt" && $("#EditTransactionBody .debtor").val() == "") {
|
||||
$("#EditTransactionBody .debtor").addClass("errored");
|
||||
} else {
|
||||
$("#EditTransactionBody .debtor").removeClass("errored");
|
||||
}
|
||||
if (selectedOption == "credit" && $("#EditTransactionBody .creditor").val() == "" && $("#EditTransactionBody .creditor").prop("disabled") == false) {
|
||||
$("#EditTransactionBody .creditor").addClass("errored");
|
||||
} else {
|
||||
$("#EditTransactionBody .creditor").removeClass("errored");
|
||||
}
|
||||
|
||||
if ($('#EditTransactionBody .errored').length > 0) {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', "لطفا موارد اجباری را تکمیل کنید.");
|
||||
} else {
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("./FinancialStatments", "Edit")',
|
||||
data: {
|
||||
"id": $('#transactionId').val(),
|
||||
"tDateFa": $("#EditTransactionBody .persianDateInput").val(),
|
||||
"typeOfTransaction": $("#EditTransactionBody .options-select").val(),
|
||||
"descriptionOption": $("#EditTransactionBody .options-select2").val(),
|
||||
"description": $('#desc').val(),
|
||||
"deptorString": $("#EditTransactionBody .debtor").val(),
|
||||
"creditorString": $("#EditTransactionBody .creditor").val()
|
||||
|
||||
},
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
window.location.reload();
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
}); //endOf Ajax
|
||||
}
|
||||
} //endOfFunction
|
||||
|
||||
|
||||
// چک کردن درستی تاریخ وارد شده
|
||||
$("#EditTransactionBody .persianDateInput").on('keyup',
|
||||
function() {
|
||||
if (event.which !== 8 && event.which !== 46) {
|
||||
let value = $(this).val();
|
||||
const lengthValue = value.length;
|
||||
if (lengthValue === 4) {
|
||||
value += '/';
|
||||
}
|
||||
if (lengthValue === 7) {
|
||||
value += '/';
|
||||
}
|
||||
$(this).val(value);
|
||||
}
|
||||
});
|
||||
$("#EditTransactionBody .persianDateInput").on("keydown",
|
||||
function(event) {
|
||||
const keyCode = event.which || event.keyCode;
|
||||
const isDigit = (keyCode >= 48 && keyCode <= 57) || (keyCode >= 96 && keyCode <= 105);
|
||||
const isControlKey = (keyCode === 8) || (keyCode === 9) || (keyCode === 13) || (keyCode === 35) || (keyCode === 36) || (keyCode === 37) || (keyCode === 39) || (keyCode === 46);
|
||||
if (!isDigit && !isControlKey) {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
$("#EditTransactionBody .persianDateInput").on('blur',
|
||||
function() {
|
||||
const value = $(this).val();
|
||||
const lengthValue = value.length;
|
||||
if (lengthValue == 10) {
|
||||
if (!dateValidCheck(this)) {
|
||||
$(this).addClass("errored");
|
||||
} else {
|
||||
$(this).removeClass("errored");
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
var ajaxEditSave = '@Url.Page("./FinancialStatments", "Edit")';
|
||||
</script>
|
||||
<script src="~/AssetsAdmin/page/InstitutionContract/js/EditTransaction.js?ver=@adminVersion"></script>
|
||||
@@ -1,5 +1,6 @@
|
||||
@model CompanyManagment.App.Contracts.InstitutionContract.CreateInstitutionContract
|
||||
@{
|
||||
var adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
<style>
|
||||
|
||||
/* .modal-dialog {
|
||||
@@ -506,639 +507,10 @@
|
||||
<script language="javascript" src="~/AdminTheme/js/city2.js"></script>
|
||||
<script src="~/AdminTheme/js/numeral.min.js"></script>
|
||||
<script src="~/admintheme/js/jquery.mask_1.14.16.min.js"></script>
|
||||
|
||||
<script>
|
||||
var submitcheck1 = true;
|
||||
var submitcheck2 = true;
|
||||
var submitcheck3 = true;
|
||||
|
||||
|
||||
$('.add_project_file').click(function(e) {
|
||||
e.preventDefault();
|
||||
const a = ($(".items").length) / 4;
|
||||
const html = `<div class="row">
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> نوع شماره </label>
|
||||
<select class="form-control items" data-phonetype="${a}" name="ContactInformationList[${a}].PhoneType">'
|
||||
<option value=""> </option>'
|
||||
<option value="شماره همراه"> شماره همراه </option>
|
||||
<option value="شماره ثابت"> شماره ثابت </option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> سمت </label>
|
||||
<select class="form-control items" name="ContactInformationList[${a}].Position">
|
||||
<option value=""> </option>
|
||||
<option value="طرف قرارداد"> طرف قرارداد </option>
|
||||
<option value="کارفرما"> کارفرما </option>
|
||||
<option value="مدیرعامل"> مدیرعامل </option>
|
||||
<option value="نماینده کارفرما"> نماینده کارفرما </option>
|
||||
<option value="مالی"> مالی </option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> نام و نام خانوادگی </label>
|
||||
<input type="text" class="form-control items" name="ContactInformationList[${a}].FnameLname">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div style="display: flex;align-items: center; ">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> شماره تماس </label>
|
||||
<input type="text" class="form-control items" data-mobile="${a}" onkeyup="mobileValidation(this);" asp-for="ContactInformationList[${a}].PhoneNumber">
|
||||
<span data-mobile-err="${a}" style="font-size: 8px; color: red"></span>
|
||||
<input type="checkbox" onclick="checking(this);" data-checkbox="${a}" name="check" style="position: relative; top: -28px; right:99px;"/>
|
||||
<input type="hidden" data-checkboxStr="${a}" asp-for="ContactInformationList[${a}].SendSmsString"/>
|
||||
</div>
|
||||
<a href="#" class="remove_project_file" data-remove="${a}" style="padding: 0 3px;"><i style="color: red;font-size: 15px;" class="ion-close-circled pull-left"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
$(".project_images").append(html);
|
||||
|
||||
});
|
||||
|
||||
//mobile validation
|
||||
function mobileValidation(el) {
|
||||
$(el).on("input",
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
});
|
||||
|
||||
|
||||
const contactRow = $(el).closest('div.row');
|
||||
const elData = $(el).attr("data-mobile");
|
||||
|
||||
let selectedPhoneType;
|
||||
contactRow.find("select").each(function() {
|
||||
if ($(this).attr("data-phonetype") == elData) {
|
||||
selectedPhoneType = $(this).prop("selectedIndex");
|
||||
}
|
||||
});
|
||||
|
||||
if (selectedPhoneType == 1) {
|
||||
if ($(el).val().length < 11 || $(el).val().length > 11) {
|
||||
|
||||
$(el).addClass("invalidMobile");
|
||||
contactRow.find("span[data-mobile-err]").text("شماره همراه 11 رقمی وارد کنید");
|
||||
} else {
|
||||
|
||||
$(el).removeClass("invalidMobile");
|
||||
contactRow.find("span[data-mobile-err]").text("");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Remove parent of 'remove' link when link is clicked.
|
||||
$('.project_images').on('click',
|
||||
'.remove_project_file',
|
||||
function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$(this).closest('div.row').remove();
|
||||
});
|
||||
|
||||
//checkbox value copy to string input
|
||||
function checking(el) {
|
||||
const datacheckbox = $(el).attr("data-checkbox");
|
||||
const contactRow = $(el).closest('div.row');
|
||||
if ($(el).is(":checked")) {
|
||||
let selectedPhoneType;
|
||||
contactRow.find("select").each(function() {
|
||||
if ($(this).attr("data-phonetype") == datacheckbox) {
|
||||
selectedPhoneType = $(this).prop("selectedIndex");
|
||||
}
|
||||
});
|
||||
if (selectedPhoneType == 1) {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("true");
|
||||
} else {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("false");
|
||||
$(el).prop("checked", false);
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "ابتدا نوع شماره را همراه انتخاب کنید");
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("false");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function setValueAdded() {
|
||||
$('input[name="checkTaxAdded"]').val("true");
|
||||
calculateTotalAmount();
|
||||
|
||||
}
|
||||
|
||||
function removeValueAdded() {
|
||||
$('input[name="checkTaxAdded"]').val("false");
|
||||
calculateTotalAmount();
|
||||
|
||||
}
|
||||
|
||||
//ارزش افزوده
|
||||
$('#officialStatus').on('change',
|
||||
function() {
|
||||
if ($(this).val() == "Official") {
|
||||
|
||||
const tax = `<div class="col-xs-12">
|
||||
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
|
||||
|
||||
<div class="radio-box" style=" display: flex">
|
||||
<label class="radio-label" style="background-color: #fad7d7;
|
||||
padding: 5px;
|
||||
border-radius: 5px;"> مالیات بر ارزش افزوده </label>
|
||||
<span> </span> <span> </span> <span> </span> <span> </span>
|
||||
<div class="radio-input">
|
||||
<label>
|
||||
<input type="radio" style="margin: 10px 0px;" value="true" onclick="setValueAdded()" asp-for="HasValueAddedTax" name="HasValueAddedTax"><span> </span> <span>دارد</span>
|
||||
|
||||
</label>
|
||||
<span> </span> <span> </span> <span> </span> <span> </span>
|
||||
<label>
|
||||
<input type="radio" style="margin: 10px 0px;" value="false" onclick="removeValueAdded()" asp-for="HasValueAddedTax" name="HasValueAddedTax"><span> </span> <span>ندارد</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</fieldset>
|
||||
</div>`;
|
||||
$('#valueAdded').append(tax);
|
||||
$('#valueAdded').show();
|
||||
} else {
|
||||
$('#valueAdded').html('');
|
||||
$('#valueAdded').hide();
|
||||
$('input[name="checkTaxAdded"]').val("false");
|
||||
calculateTotalAmount();
|
||||
}
|
||||
});
|
||||
|
||||
// تابع برای محاسبه و نمایش مقدار در فیلد totalAmount
|
||||
function calculateTotalAmount() {
|
||||
const start = $('#start').val();
|
||||
|
||||
const end = $('#end').val();
|
||||
|
||||
const amount = $('#amount').val();
|
||||
|
||||
|
||||
const checkTax = $('input[name="checkTaxAdded"]').val();
|
||||
|
||||
let isTaxAdded = "false";
|
||||
if ($('#officialStatus').val() == "Official") {
|
||||
|
||||
if (checkTax == "true") {
|
||||
isTaxAdded = "true";
|
||||
} else {
|
||||
isTaxAdded = "false";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
console.log($('#officialStatus').val());
|
||||
if (start.length == 10 && end.length == 10 && amount.length > 1) {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("/Company/InstitutionContracts/Index", "MountCounter")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "start": start, "end": end, "amount": amount, "valueAddedtax": isTaxAdded },
|
||||
|
||||
success: function(response) {
|
||||
|
||||
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
const compute = numeral(response.totalAmount).format();
|
||||
const finalAmount = numeral(response.finalAmount).format();
|
||||
const valueAddedTax = numeral(response.valueAddedTax).format();
|
||||
$('#obligation').val(compute);
|
||||
$('#totalAmount').val(compute);
|
||||
$('#finalAmountFake').val(finalAmount);
|
||||
$('#finalAmount').val(finalAmount);
|
||||
$('#valueAddedTax').val(valueAddedTax);
|
||||
$('#valueAddedTaxFake').val(valueAddedTax);
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
$(".date").mask("0000/00/00");
|
||||
$('#sendData').on('click',
|
||||
function(e) {
|
||||
//var y = document.getElementById('city2');
|
||||
//var city1 = y.options[y.selectedIndex].text;
|
||||
|
||||
//if (city1 == "ویرایش نام شهر" || city1 == "شهرستان") {
|
||||
|
||||
// document.getElementById('hidencity').value = " ";
|
||||
|
||||
//} else {
|
||||
// document.getElementById('hidencity').value = city1;
|
||||
//}
|
||||
|
||||
|
||||
//var x = document.getElementById('state');
|
||||
//var state1 = x.options[x.selectedIndex].text;
|
||||
//var state2 = x.options[x.selectedIndex].value;
|
||||
//if (state1 == "ویرایش نام استان") {
|
||||
// document.getElementById('hide1').value = state2;
|
||||
//} else {
|
||||
// document.getElementById('hide1').value = state1;
|
||||
//}
|
||||
|
||||
|
||||
const selectedcity = jQuery("#city2 option:selected").text();
|
||||
//if (selectedcity == "ویرایش نام شهر" || selectedcity == "شهرستان") {
|
||||
|
||||
// $('#copyCity').val("");
|
||||
|
||||
//} else {
|
||||
$('#copyCity').val(selectedcity);
|
||||
//}
|
||||
|
||||
|
||||
if (submitcheck1 === false || submitcheck2 === false || submitcheck3 === false) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
$('#finalAmountFake').val($('#finalAmount').val());
|
||||
$('#valueAddedTaxFake').val($('#valueAddedTax').val());
|
||||
$('input[name="checkTaxAdded"]').val(@Model.HasValueAddedTax);
|
||||
const state = document.getElementById('state').value;
|
||||
const citySelect = document.getElementById('copyCity').value;
|
||||
console.log(citySelect);
|
||||
|
||||
iranwebsv2(state);
|
||||
|
||||
$('#city2 option:contains("شهرستان")').text(citySelect);
|
||||
|
||||
$('#contractDate').on('change',
|
||||
function() {
|
||||
submitcheck1 = dateValidcheck(this);
|
||||
|
||||
});
|
||||
// هنگام ورود مقدار به فیلد start
|
||||
$('#start').on('input',
|
||||
function() {
|
||||
const startDate = this.value;
|
||||
if (startDate.length == 10) {
|
||||
submitcheck2 = dateValidcheck(this);
|
||||
if (submitcheck2) {
|
||||
findEndOfYear(startDate);
|
||||
calculateTotalAmount();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
// هنگام ورود مقدار به فیلد end
|
||||
$('#end').on('input',
|
||||
function() {
|
||||
const endDate = this.value;
|
||||
if (endDate.length == 10) {
|
||||
submitcheck3 = dateValidcheck(this);
|
||||
calculateTotalAmount();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
// هنگام ورود مقدار به فیلد amount
|
||||
$('#amount').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var contractAmount = $("#amount");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
contractAmount.on("keyup",
|
||||
function(e) {
|
||||
contractAmount.val(numeral(contractAmount.val()).format());
|
||||
});
|
||||
calculateTotalAmount();
|
||||
});
|
||||
$('#obligation').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var obligation = $("#obligation");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
obligation.on("keyup",
|
||||
function(e) {
|
||||
obligation.val(numeral(obligation.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
$('#totalAmount').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var totalAmount = $("#totalAmount");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
totalAmount.on("keyup",
|
||||
function(e) {
|
||||
totalAmount.val(numeral(totalAmount.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
$('#dailyCompenseation').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var dailyCompenseation = $("#dailyCompenseation");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
dailyCompenseation.on("keyup",
|
||||
function(e) {
|
||||
dailyCompenseation.val(numeral(dailyCompenseation.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function findEndOfYear(date) {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("/Company/InstitutionContracts/Index", "FindEndOfYear")',
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "start": date },
|
||||
|
||||
success: function(response) {
|
||||
|
||||
$('#end').val(response.end);
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
var start1valid = false;
|
||||
|
||||
function dateValidcheck(inputField1) {
|
||||
|
||||
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = inputField1.value;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
let s1, s2;
|
||||
for (var i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 4) {
|
||||
s1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 7) {
|
||||
s2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
let yRes = y1 + y2 + y3 + y4;
|
||||
let year = parseInt(yRes);
|
||||
let mRes = m1 + m2;
|
||||
let month = parseInt(mRes);
|
||||
let dRes = d1 + d2;
|
||||
let day = parseInt(dRes);
|
||||
let fixResult = yRes + s1 + mRes + s2 + dRes;
|
||||
let test1 = checkEnValid(inputField1.value);
|
||||
|
||||
let isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(fixResult);
|
||||
|
||||
|
||||
if (isValid && test1) {
|
||||
inputField1.style.backgroundColor = '#a6e9a6';
|
||||
start1valid = true;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
if (inputField1.value != "") {
|
||||
inputField1.style.backgroundColor = '#f94c4c';
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
|
||||
start1valid = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return start1valid;
|
||||
|
||||
}
|
||||
|
||||
function checkEnValid(fixDate1) {
|
||||
|
||||
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = fixDate1;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
for (let i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
let yRes = y1 + y2 + y3 + y4;
|
||||
let year = parseInt(yRes);
|
||||
let mRes = m1 + m2;
|
||||
let month = parseInt(mRes);
|
||||
let dRes = d1 + d2;
|
||||
let day = parseInt(dRes);
|
||||
let kabiseh = false;
|
||||
if (month <= 6 && day > 31) {
|
||||
return false;
|
||||
} else if (month > 6 && month < 12 && day > 30) {
|
||||
return false;
|
||||
} else if (month === 12) {
|
||||
|
||||
switch (year) {
|
||||
case 1346:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1350:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1354:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1358:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1362:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1366:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1370:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1375:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1379:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1383:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1387:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1391:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1395:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1399:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1403:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1408:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1412:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1416:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1420:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1424:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1428:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1432:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1436:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1441:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1445:
|
||||
kabiseh = true;
|
||||
break;
|
||||
default:
|
||||
kabiseh = false;
|
||||
|
||||
}
|
||||
if (kabiseh == true && day > 30) {
|
||||
return false;
|
||||
} else if (kabiseh == false && day > 29) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
var ajaxCalculateTotalAmount = '@Url.Page("/Company/InstitutionContracts/Index", "MountCounter")';
|
||||
var valueAddedTax = '@Model.HasValueAddedTax';
|
||||
var ajaxFindeEndOfYear = '@Url.Page("/Company/InstitutionContracts/Index", "FindEndOfYear")';
|
||||
</script>
|
||||
<script src="~/AssetsAdmin/page/InstitutionContract/js/Extention.js?ver=@adminVersion"></script>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
@page
|
||||
@model ServiceHost.Areas.Admin.Pages.Company.InstitutionContracts.FinancialStatmentsModel
|
||||
@{
|
||||
var adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
var Green = "green-row";
|
||||
<style>
|
||||
.blocked {
|
||||
@@ -277,504 +278,13 @@
|
||||
|
||||
@section Script {
|
||||
<script src="~/AdminTheme/assets/js/site.js"></script>
|
||||
<script src="~/AdminTheme/js/numeral.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(".debtor").prop("disabled", true);
|
||||
$(".creditor").prop("disabled", true);
|
||||
});
|
||||
|
||||
//رنگ بندی ستون های جمع مبلغ
|
||||
let cols = $(".totalBalance").val();
|
||||
if (cols > 0) {
|
||||
$(".totalBalanceTd").css("color", "#9f210c");
|
||||
} else {
|
||||
$(".totalBalanceTd").css("color", "#2b8f1b");
|
||||
}
|
||||
$('.main-table').find(".balance").each(function() {
|
||||
const balance = $(this).closest(".remainder-td");
|
||||
const value = $(this).val();
|
||||
if (value > 0) {
|
||||
balance.css("color", "#9f210c");
|
||||
} else {
|
||||
balance.css("color", "#2b8f1b");
|
||||
}
|
||||
});
|
||||
|
||||
//فعال سازی دکمه ی اینتر برای ثبت نهایی
|
||||
$('.panelRequiredFields .form-control').keypress(function(event) {
|
||||
if (event.which === 13) {
|
||||
checkNecessaryInputs();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//بدست آوردن تاریخ امروز
|
||||
$('.currentDay').on("click",
|
||||
function() {
|
||||
console.log("clicked");
|
||||
$.ajax({
|
||||
async: false,
|
||||
url: '@Url.Page("./FinancialStatments", "DateOfToday")',
|
||||
type: "Get",
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
|
||||
$('#today').val(response.datOfToday);
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
}); //endOf Ajax
|
||||
});
|
||||
//صفحه بندی
|
||||
|
||||
//صفحه اول
|
||||
$('.first-page-number').on("click",
|
||||
function() {
|
||||
pagination(1);
|
||||
$("input[name=currentPageNumber]").val(1);
|
||||
});
|
||||
//صفحه اول
|
||||
$('.first-page-text').on("click",
|
||||
function() {
|
||||
pagination(1);
|
||||
$("input[name=currentPageNumber]").val(1);
|
||||
});
|
||||
//صفحه قبل
|
||||
$('.prev-page').on("click",
|
||||
function() {
|
||||
const firstPageNumber = $("input[name=firtPageNumber]").val();
|
||||
|
||||
let currentPageNumber = $("input[name=currentPageNumber]").val();
|
||||
currentPageNumber = Number(currentPageNumber);
|
||||
currentPageNumber -= 1;
|
||||
if (currentPageNumber >= firstPageNumber) {
|
||||
$('.table-container').remove();
|
||||
|
||||
$("input[name=currentPageNumber]").val(currentPageNumber);
|
||||
pagination(currentPageNumber);
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
// اینتر بر روی عدد
|
||||
$("input[name=currentPageNumber]").on('keyup keypress',
|
||||
function(e) {
|
||||
const keyCode = e.keyCode || e.which;
|
||||
if (keyCode === 13) {
|
||||
e.preventDefault();
|
||||
const firstPageNumber = Number($("input[name=firtPageNumber]").val());
|
||||
const goToCurrentNumber = $(this).val();
|
||||
const lastPageNumber = Number($("input[name=lastPageNumber]").val());
|
||||
if (goToCurrentNumber >= firstPageNumber && goToCurrentNumber <= lastPageNumber) {
|
||||
pagination(goToCurrentNumber);
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
//صفحه بعد
|
||||
$('.next-page').on("click",
|
||||
function() {
|
||||
const lastPageNumber = $("input[name=lastPageNumber]").val();
|
||||
let currentPageNumber = $("input[name=currentPageNumber]").val();
|
||||
currentPageNumber = Number(currentPageNumber);
|
||||
currentPageNumber += 1;
|
||||
console.log(`cuntentPlusOne ${currentPageNumber}`);
|
||||
if (currentPageNumber <= lastPageNumber) {
|
||||
$('.table-container').remove();
|
||||
$("input[name=currentPageNumber]").val(currentPageNumber);
|
||||
pagination(currentPageNumber);
|
||||
}
|
||||
});
|
||||
|
||||
//صفحه آخر
|
||||
$(".last-page-text").on("click",
|
||||
function() {
|
||||
const lastPageNumber = $("input[name=lastPageNumber]").val();
|
||||
const goToLastPage = Number(lastPageNumber);
|
||||
$("input[name=currentPageNumber]").val(goToLastPage);
|
||||
pagination(goToLastPage);
|
||||
|
||||
});
|
||||
//صفحه آخر
|
||||
$(".last-page-number").on("click",
|
||||
function() {
|
||||
const lastPageNumber = $("input[name=lastPageNumber]").val();
|
||||
const goToLastPage = Number(lastPageNumber);
|
||||
$("input[name=currentPageNumber]").val(goToLastPage);
|
||||
pagination(goToLastPage);
|
||||
});
|
||||
|
||||
//Ajax Pagination
|
||||
function pagination(currentPageNumber) {
|
||||
const contractingPartyId = $('#contractingPartyId').val();
|
||||
$.ajax({
|
||||
async: false,
|
||||
url: '@Url.Page("./FinancialStatments", "Pagination")',
|
||||
data: {
|
||||
"id": contractingPartyId,
|
||||
"pageNumber": currentPageNumber
|
||||
},
|
||||
type: "Get",
|
||||
dataType: 'html',
|
||||
|
||||
|
||||
success: function(response) {
|
||||
|
||||
$('.table-panel').html(response);
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
}); //endOf Ajax
|
||||
}
|
||||
|
||||
//غیرفعال یا فعالسازی اینپوت های بدهکار و بستانکار , آپشن های پرداخت / ایجاد بدهی
|
||||
let jobRelation = "بابت قرارداد مابین (روابط کار)";
|
||||
let taxAndFinancial = "بابت قرارداد مابین (حسابداری و مالیات)";
|
||||
let debtorOptions = $(
|
||||
`<option class="debtOption" value="0">انتخاب کنید...</option>
|
||||
<option class="debtOption" value = "${jobRelation}"> ${jobRelation} </option>
|
||||
<option class="debtOption" value = "${taxAndFinancial}"> ${taxAndFinancial} </option>
|
||||
<option class="debtOption" value = " بابت قراردادهای گذشته پرسنل" > بابت قراردادهای گذشته پرسنل </option>
|
||||
<option class="debtOption" value = "بابت پرونده" > بابت پرونده</option>
|
||||
<option class="debtOption" value = "بابت مبلغ بیمه کارگاه" > بابت مبلغ بیمه کارگاه </option>
|
||||
<option class="debtOption" value = "بابت مبلغ بیمه خویش فرما " > بابت مبلغ بیمه خویش فرما </option>
|
||||
<option class="debtOption" value = "بابت فیش کارگزاری " > بابت فیش کارگزاری </option>
|
||||
<option class="debtOption" value = "بابت بدهی از قرارداد قبل " > بابت بدهی از قرارداد قبل </option>
|
||||
<option class="debtOption" value = "بابت خرید" > بابت خرید </option>
|
||||
<option class="debtOption" value = "بابت بدهی سایر " > بابت بدهی سایر </option>
|
||||
`
|
||||
);
|
||||
let creditorOptions = $(
|
||||
`<option class="creditOption" value="0">انتخاب کنید...</option>
|
||||
<option class="creditOption" value = "${jobRelation}"> ${jobRelation} </option>
|
||||
<option class="creditOption" value = "${taxAndFinancial}"> ${taxAndFinancial} </option>
|
||||
<option class="creditOption" value = " بابت قراردادهای گذشته پرسنل" > بابت قراردادهای گذشته پرسنل </option>
|
||||
<option class="creditOption" value = "بابت پرونده" > بابت پرونده</option>
|
||||
<option class="creditOption" value = "بابت مبلغ بیمه کارگاه" > بابت مبلغ بیمه کارگاه </option>
|
||||
<option class="creditOption" value = "بابت مبلغ بیمه خویش فرما " > بابت مبلغ بیمه خویش فرما </option>
|
||||
<option class="creditOption" value = "بابت فیش کارگزاری " > بابت فیش کارگزاری </option>
|
||||
<option class="creditOption" value = "بابت بدهی از قرارداد قبل " > بابت بدهی از قرارداد قبل </option>
|
||||
<option class="creditOption" value = "بابت بدهی سایر " > بابت بدهی سایر </option>
|
||||
<option class="creditOption" value = "بابت حق بیمه کارگاه" > بابت حق بیمه کارگاه </option>
|
||||
<option class="creditOption" value = "بابت حق بیمه خویش فرما" > بابت حق بیمه خویش فرما </option>
|
||||
<option class="creditOption" value = "بابت خرید" > بابت خرید </option>
|
||||
<option class="creditOption" value = "بابت خدمات" > بابت خدمات </option>
|
||||
<option class="creditOption" value = "بابت تخفیف" > بابت تخفیف </option>`
|
||||
);
|
||||
|
||||
$(".options-select").change(function() {
|
||||
const selectedOption = $(this).val();
|
||||
$(".options-select2").html("");
|
||||
if (selectedOption == "debt") {
|
||||
$(".options-select2").append(debtorOptions);
|
||||
$(".debtor").prop("disabled", false);
|
||||
$(".creditor").prop("disabled", true);
|
||||
$(".creditor").val("").removeClass("errored");
|
||||
} else if (selectedOption == "credit") {
|
||||
$(".options-select2").append(creditorOptions);
|
||||
$(".creditor").prop("disabled", false);
|
||||
$(".debtor").prop("disabled", true);
|
||||
$(".debtor").val("").removeClass("errored");
|
||||
} else {
|
||||
$(".creditor").val("").prop("disabled", true);
|
||||
$(".debtor").val("").prop("disabled", true);
|
||||
}
|
||||
});
|
||||
|
||||
//تنظیمات بخش های پول
|
||||
$('#debtInput').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var contractAmount = $("#debtInput");
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
contractAmount.on("keyup",
|
||||
function(e) {
|
||||
contractAmount.val(numeral(contractAmount.val()).format());
|
||||
});
|
||||
});
|
||||
$('#creditInput').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var contractAmount = $("#creditInput");
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
contractAmount.on("keyup",
|
||||
function(e) {
|
||||
contractAmount.val(numeral(contractAmount.val()).format());
|
||||
});
|
||||
});
|
||||
|
||||
//لرزیدن دکمه ها
|
||||
$(".op-container a").on("mouseenter",
|
||||
function() {
|
||||
vibratingAnimation(this);
|
||||
});
|
||||
|
||||
function vibratingAnimation(element) {
|
||||
$(element).animate({ left: "-2px" }, 50)
|
||||
.animate({ left: "2px" }, 50)
|
||||
.animate({ left: "0px" }, 50);
|
||||
}
|
||||
|
||||
|
||||
//حذف
|
||||
function removeTransaction(Id) {
|
||||
swal({
|
||||
title: "توجه داشته باشید با تایید این پیام سند مورد نظر بطور کامل از بانک اطلاعات حذف می شود ",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "تایید",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: false
|
||||
},
|
||||
function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: '@Url.Page("./FinancialStatments", "RemoveTransaction")',
|
||||
data: { "id": Id },
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
window.location.reload();
|
||||
}
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
}); //endOf Ajax
|
||||
} else {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// چک کردن اینپوت های ضروری هنگام ثبت
|
||||
function checkNecessaryInputs() {
|
||||
if ($(".persianDateInput").val().length < 10) {
|
||||
$(".persianDateInput").addClass("errored");
|
||||
} else {
|
||||
$(".persianDateInput").removeClass("errored");
|
||||
}
|
||||
var selectedOption = $(".options-select").val();
|
||||
var selectedOption2 = $(".options-select2").val();
|
||||
if (selectedOption == 0) {
|
||||
$(".options-select").addClass("errored");
|
||||
} else {
|
||||
$(".options-select").removeClass("errored");
|
||||
}
|
||||
if (selectedOption2 == 0 || selectedOption2 == null) {
|
||||
$(".options-select2").addClass("errored");
|
||||
} else {
|
||||
$(".options-select2").removeClass("errored");
|
||||
}
|
||||
|
||||
if (selectedOption == "debt" && $(".debtor").val() == "") {
|
||||
$(".debtor").addClass("errored");
|
||||
} else {
|
||||
$(".debtor").removeClass("errored");
|
||||
}
|
||||
if (selectedOption == "credit" && $(".creditor").val() == "" && $(".creditor").prop("disabled") == false) {
|
||||
$(".creditor").addClass("errored");
|
||||
} else {
|
||||
$(".creditor").removeClass("errored");
|
||||
}
|
||||
|
||||
if ($('.errored').length > 0) {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', "لطفا موارد اجباری را تکمیل کنید.");
|
||||
} else {
|
||||
$.Notification.autoHideNotify('success', 'top right', 'پیام سیستم ', "ثبت با موفقیت انجام شد.");
|
||||
var command = {};
|
||||
command.ContractingPartyId = $('#contractingPartyId').val();
|
||||
command.ContractingPartyName = $('#contractingPartyName').val();
|
||||
command.TdateFa = $(".persianDateInput").val();
|
||||
command.Description = $('#description').val();
|
||||
command.TypeOfTransaction = selectedOption;
|
||||
command.DeptorString = $(".debtor").val();
|
||||
command.Deptor = 0;
|
||||
command.Creditor = 0;
|
||||
command.CreditorString = $(".creditor").val();
|
||||
command.DescriptionOption = selectedOption2;
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: '@Url.Page("./FinancialStatments", "Create")',
|
||||
data: command,
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
success: function(response) {
|
||||
if (response.success) {
|
||||
console.log("success");
|
||||
window.location.reload();
|
||||
}
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
}); //endOf Ajax
|
||||
}
|
||||
}
|
||||
|
||||
// چک کردن درستی تاریخ وارد شده
|
||||
$(".persianDateInput").on('keyup',
|
||||
function() {
|
||||
if (event.which !== 8 && event.which !== 46) {
|
||||
let value = $(this).val();
|
||||
const lengthValue = value.length;
|
||||
if (lengthValue === 4) {
|
||||
value += '/';
|
||||
}
|
||||
if (lengthValue === 7) {
|
||||
value += '/';
|
||||
}
|
||||
$(this).val(value);
|
||||
}
|
||||
});
|
||||
if ($(window).width() < 768) {
|
||||
$(".persianDateInput").on("keydown",
|
||||
function(event) {
|
||||
const keyCode = event.which || event.keyCode;
|
||||
const isDigit = (keyCode >= 48 && keyCode <= 57) || (keyCode >= 96 && keyCode <= 105);
|
||||
const isControlKey = (keyCode === 8) || (keyCode === 9) || (keyCode === 13) || (keyCode === 229); // Adjusted for mobile
|
||||
const isSlash = (keyCode === 191); // Adjusted for mobile
|
||||
const isBackspace = (keyCode === 8); // Adjusted for mobile
|
||||
|
||||
if (!(isDigit || isControlKey || isSlash || isBackspace)) {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
}
|
||||
if ($(window).width() > 768) {
|
||||
$(".persianDateInput").on("keydown",
|
||||
function(event) {
|
||||
const keyCode = event.which || event.keyCode;
|
||||
const isDigit = (keyCode >= 48 && keyCode <= 57) || (keyCode >= 96 && keyCode <= 105);
|
||||
const isControlKey = (keyCode === 8) || (keyCode === 9) || (keyCode === 13) || (keyCode === 35) || (keyCode === 36) || (keyCode === 37) || (keyCode === 39) || (keyCode === 46);
|
||||
if (!isDigit && !isControlKey) {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(".persianDateInput").on('blur',
|
||||
function() {
|
||||
const value = $(this).val();
|
||||
const lengthValue = value.length;
|
||||
if (lengthValue == 10) {
|
||||
if (!dateValidCheck(this)) {
|
||||
$(this).addClass("errored");
|
||||
} else {
|
||||
$(this).removeClass("errored");
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$(window).on('resize',
|
||||
function() {
|
||||
if ($(window).width() < 768) {
|
||||
locateButtonContainerMobile();
|
||||
}
|
||||
});
|
||||
$(document).on("click",
|
||||
function(event) {
|
||||
const target = $(event.target);
|
||||
if (!target.closest(".buttons-container").length && !target.is(".employee-operations") && !target.is("#EditTransactionBody") && !target.is("#EditTransactionBody *")
|
||||
) {
|
||||
$(".buttons-container").removeClass("active").addClass("reverse");
|
||||
$(".more-buttons").removeClass("active");
|
||||
setTimeout(function() {
|
||||
$(".buttons-container").removeClass("reverse").css("display", "none");
|
||||
},
|
||||
200);
|
||||
}
|
||||
});
|
||||
$(".employee-operations").on("click",
|
||||
function() {
|
||||
console.log(1);
|
||||
if ($(window).width() < 768) {
|
||||
locateButtonContainerMobile();
|
||||
}
|
||||
var buttonsContainer = $(this).next(".buttons-container");
|
||||
if (buttonsContainer.hasClass("active")) {
|
||||
buttonsContainer.removeClass("active").addClass("reverse");
|
||||
$(this).closest(".more-buttons").removeClass("active");
|
||||
setTimeout(function() {
|
||||
buttonsContainer.removeClass("reverse").css("display", "none");
|
||||
},
|
||||
200);
|
||||
} else {
|
||||
buttonsContainer.removeClass("reverse").addClass("active").css("display", "flex");
|
||||
$(this).closest(".more-buttons").addClass("active");
|
||||
}
|
||||
|
||||
$(".buttons-container").not(buttonsContainer).removeClass("active reverse").css("display", "none");
|
||||
$(".more-buttons").not($(this).closest(".more-buttons")).removeClass("active");
|
||||
});
|
||||
|
||||
function locateButtonContainerMobile() {
|
||||
const beforePosition = $(".mobile-view .employee-operations").position();
|
||||
const containerWidth = $('.mobile-view .buttons-container').outerWidth();
|
||||
const containerHeight = $('.mobile-view .buttons-container').outerHeight();
|
||||
const containerLeft = beforePosition.left + $(".mobile-view .employee-operations").outerWidth() + 25;
|
||||
const containerTop = beforePosition.top + ($(".mobile-view .employee-operations").outerHeight() / 2) - (containerHeight / 2);
|
||||
$('.mobile-view .buttons-container').css({
|
||||
left: containerLeft,
|
||||
top: containerTop
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function removeBlocked(trId) {
|
||||
|
||||
swal({
|
||||
title: "توجه داشته باشید با تایید این پیام رنگ طوسی آیتم نظر حذف می شود ",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "تایید",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: true
|
||||
},
|
||||
function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: '@Url.Page("./FinancialStatments", "RemoveBlocked")',
|
||||
data: { "id": Number(trId) },
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
success: function(response) {
|
||||
if (response.isSuccedded) {
|
||||
$(`#${trId}`).removeClass("blocked");
|
||||
$(`#closeBtn-${trId}`).remove();
|
||||
}
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
}); //endOf Ajax
|
||||
} else {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<script src="~/AdminTheme/js/numeral.min.js"></script>
|
||||
<script>
|
||||
var ajaxCurrentDay ='@Url.Page("./FinancialStatments", "DateOfToday")';
|
||||
var ajaxPagination ='@Url.Page("./FinancialStatments", "Pagination")';
|
||||
var ajaxRemoveTransaction = '@Url.Page("./FinancialStatments", "RemoveTransaction")';
|
||||
var ajaxCreate ='@Url.Page("./FinancialStatments", "Create")';
|
||||
var ajaxRemoveBlocked = '@Url.Page("./FinancialStatments", "RemoveBlocked")';
|
||||
</script>
|
||||
<script src="~/AssetsAdmin/page/InstitutionContract/js/FinancialStatment.js?ver=@adminVersion"></script>
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
@model ServiceHost.Areas.Admin.Pages.Company.InstitutionContracts.IndexModel
|
||||
|
||||
@{
|
||||
var adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
var i = 1;
|
||||
|
||||
var myclass = "noworkshop";
|
||||
@@ -317,6 +318,24 @@
|
||||
background-color:#b5b5b5 !important;
|
||||
color: #646464;
|
||||
}
|
||||
|
||||
.mobileView {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.eye {
|
||||
z-index: 0;
|
||||
position: relative !important;
|
||||
top: 63px !important;
|
||||
display: inline-block !important;
|
||||
color: #363636 !important;
|
||||
float: left !important;
|
||||
direction: ltr !important;
|
||||
font-size: 14px !important;
|
||||
margin-left: 10px !important;
|
||||
}
|
||||
|
||||
|
||||
@@media screen and (max-width: 1920px) {
|
||||
.fulltext {
|
||||
font-family: 'IranSans' !important;
|
||||
@@ -483,6 +502,19 @@
|
||||
}
|
||||
}
|
||||
@@media screen and (max-width: 600px) {
|
||||
.eye{
|
||||
z-index: 1;
|
||||
top: 25px !important;
|
||||
margin-left: 0px !important;
|
||||
color: #f4f4f4 !important;
|
||||
}
|
||||
|
||||
.mobileView {
|
||||
display:block;
|
||||
}
|
||||
.desktopVeiw{
|
||||
display: none;
|
||||
}
|
||||
.form-group{
|
||||
margin-bottom: 3px !important;
|
||||
}
|
||||
@@ -598,11 +630,37 @@
|
||||
}
|
||||
}
|
||||
@@media screen and (max-width: 412px) {
|
||||
.eye {
|
||||
z-index: 1;
|
||||
top: 25px !important;
|
||||
margin-left: 0px !important;
|
||||
color: #f4f4f4 !important;
|
||||
}
|
||||
|
||||
.mobileView {
|
||||
display: block;
|
||||
}
|
||||
.desktopVeiw {
|
||||
display: none;
|
||||
}
|
||||
.table > tbody > tr > td{
|
||||
padding: 5px 4px;
|
||||
}
|
||||
}
|
||||
@@media screen and (max-width: 400px) {
|
||||
.eye {
|
||||
z-index: 1;
|
||||
top: 25px !important;
|
||||
margin-left : 0px !important;
|
||||
color: #f4f4f4 !important;
|
||||
}
|
||||
|
||||
.mobileView{
|
||||
display : block;
|
||||
}
|
||||
.desktopVeiw {
|
||||
display: none;
|
||||
}
|
||||
.name-td {
|
||||
max-width: 60px;
|
||||
}
|
||||
@@ -644,16 +702,8 @@
|
||||
|
||||
|
||||
}
|
||||
.eye{ z-index: 1;
|
||||
position: relative !important;
|
||||
top: 63px !important;
|
||||
display: inline-block !important;
|
||||
color: #363636 !important;
|
||||
float: left !important;
|
||||
direction: ltr !important;
|
||||
font-size: 14px !important;
|
||||
margin-left: 10px !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@media screen and (max-width: 400px) {
|
||||
.SumOfAmounts {
|
||||
@@ -662,14 +712,20 @@
|
||||
}
|
||||
|
||||
.eye{
|
||||
float: right !important;
|
||||
top: 20px !important; margin-right: 5px !important;
|
||||
z-index : 1;
|
||||
z-index: 1;
|
||||
top: 25px !important;
|
||||
margin-left: 0px !important;
|
||||
color: #f4f4f4 !important;
|
||||
}
|
||||
}
|
||||
@@media screen and (max-width: 500px) {
|
||||
.SumOfAmounts {
|
||||
float: right!important;
|
||||
.mobileView
|
||||
|
||||
{
|
||||
display: block;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -881,15 +937,44 @@
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading" style="background-color: #2f6002 !important ">
|
||||
<h3 class="panel-title" style="display: inline-block"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست قرارداد های موسسه</h3>
|
||||
<div class="desktopVeiw">
|
||||
<h3 class="TotalBalance">
|
||||
<span span class="panelTopText">بدهی کل</span><span> </span> <span class="amount">@Model.TotalBalance</span>
|
||||
</h3>
|
||||
<h3 class="SumOfAmounts">
|
||||
<span class="amount">@Model.SumOfAmounts</span> <span> </span> <span class="panelTopText">مبلغ قراردادها</span>
|
||||
</h3>
|
||||
<i permission="30719" onclick="showAmount(this)" class="fa fa-eye eye pointer"></i>
|
||||
</div>
|
||||
|
||||
<h3 class="TotalBalance">
|
||||
<span span class="panelTopText">بدهی کل</span><span> </span> <span class="amount">@Model.TotalBalance</span>
|
||||
</h3>
|
||||
<h3 class="SumOfAmounts">
|
||||
<span class="amount">@Model.SumOfAmounts</span> <span> </span> <span class="panelTopText">مبلغ قراردادها</span>
|
||||
</h3>
|
||||
<i permission="30719" onclick="showAmount(this)" class="fa fa-eye eye pointer"></i>
|
||||
@* <h3 class="countPersonel"><span>تعداد پرسنل:</span> <span>@Model.InstitutionContracts.Sum(x=>Convert.ToInt32(x.EmployeeCount))</span></h3> *@
|
||||
<div class="mobileView">
|
||||
<div class="row">
|
||||
<div class="col-xs-5">
|
||||
<h3 class="TotalBalance" style="width: 100%;height: 50px;">
|
||||
<span>بدهی کل</span>
|
||||
<br/>
|
||||
<span class="amount" style="font-size: 16px; position: relative;right: 10px;bottom: 5px;">@Model.TotalBalance</span>
|
||||
</h3>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-xs-5">
|
||||
|
||||
|
||||
<h3 class="SumOfAmounts" style="width: 100%;height: 50px;">
|
||||
<span >مبلغ قراردادها</span>
|
||||
<br/>
|
||||
<span class="amount" style="font-size: 16px; position: relative;right: 10px;bottom: 5px;">@Model.SumOfAmounts</span>
|
||||
</h3>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-xs-2">
|
||||
<i permission="30719" onclick="showAmount(this)" class="fa fa-eye eye pointer"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1269,654 +1354,17 @@
|
||||
<script src="~/adminTheme/assets/datatables/jquery.dataTables.min.js"></script>
|
||||
<script src="~/adminTheme/assets/datatables/dataTables.bootstrap.js"></script>
|
||||
<script language="javascript" src="~/AdminTheme/js/city.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
$('.myLinkSign').click(function(event) {
|
||||
signAjax(event, this);
|
||||
});
|
||||
});
|
||||
|
||||
function signAjax(event, element) {
|
||||
event.preventDefault();
|
||||
|
||||
|
||||
if ($(element).find('input[name="unsigned"]').length > 0) { // اگر بایگانی نبود بود به ابایگانی اضافه شود
|
||||
swal({
|
||||
title: "آیا نسخه قرارداد منتخب را به بایگانی اضافه می کنید؟",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: true
|
||||
},
|
||||
function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
const signId = Number($(element).find('input[name="unsigned"]').val());
|
||||
var contractNoTd = $(`td[data-signId = '${signId}']`);
|
||||
|
||||
$.ajax({
|
||||
contentType: 'charset=utf-8',
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: '@Url.Page("./Index", "Sign")',
|
||||
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
|
||||
data: { "Id": signId },
|
||||
success: function(response) {
|
||||
|
||||
if (response.isSuccedded) {
|
||||
$(element).find('span').replaceWith('<span class="hasSignature"> موجود </span>');
|
||||
|
||||
// تغییر name در تگ input
|
||||
$(element).find('input[name="unsigned"]').attr('name', 'signed');
|
||||
$(contractNoTd).removeClass("hasNoSignature").addClass("hasSignature");
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
} else if ($(element).find('input[name="signed"]').length > 0) { //اگر بایگانی شده بود از بایگانی حذف شود
|
||||
swal({
|
||||
title: "آیا قرارداد منتخب را از بایگانی حذف می کنید؟",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: true
|
||||
},
|
||||
function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
const unsignId = Number($(element).find('input[name="signed"]').val());
|
||||
var contractNoTd = $(`td[data-signId = '${unsignId}']`);
|
||||
$.ajax({
|
||||
contentType: 'charset=utf-8',
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: '@Url.Page("./Index", "UnSign")',
|
||||
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
|
||||
data: { "Id": unsignId },
|
||||
success: function(response) {
|
||||
|
||||
if (response.isSuccedded) {
|
||||
$(element).find('span').replaceWith('<span class="hasNoSignature"> ناموجود </span>');
|
||||
|
||||
// تغییر name در تگ input
|
||||
$(element).find('input[name="signed"]').attr('name', 'unsigned');
|
||||
$(contractNoTd).removeClass("hasSignature").addClass("hasNoSignature");
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//function hasContract(element) {
|
||||
// if ($(element).hasClass("hasSignature")){
|
||||
// $(element).removeClass("hasSignature").addClass("hasNoSignature");
|
||||
// $(element).text("ناموجود");
|
||||
// $(element).parent().next().addClass("hasNoSignature");
|
||||
// }else{
|
||||
// $(element).removeClass("hasNoSignature").addClass("hasSignature");
|
||||
// $(element).text("موجود");
|
||||
// $(element).parent().next().removeClass("hasNoSignature");
|
||||
// }
|
||||
|
||||
//}
|
||||
$(".activateContract-td span").on('click',
|
||||
function() {
|
||||
hasContract($(this));
|
||||
});
|
||||
$('.activer').on('change',
|
||||
function(e) {
|
||||
e.preventDefault();
|
||||
$('.search').click();
|
||||
|
||||
});
|
||||
$('#datatable').find("tbody tr").each(function() {
|
||||
const cols = $(this).find(".BalanceDouble").val();
|
||||
if (cols > 0) {
|
||||
$(this).find(".BalanceDoubleTd").css("color", "red");
|
||||
} else {
|
||||
$(this).find(".BalanceDoubleTd").css("color", "#009300");
|
||||
}
|
||||
});
|
||||
|
||||
//var a = window.location.href;
|
||||
//var res = a.split("#")[1];
|
||||
//if (res == "false") {
|
||||
// $.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " ابتدا یکی از فیلد های کارگاه، کارفرما، پرسنل را انتخاب نموده و سپس جستجو را بزنید ");
|
||||
//}
|
||||
|
||||
</script>
|
||||
<script>
|
||||
|
||||
//if (document.getElementById("activing").selectedIndex == 1) {
|
||||
// $('.deact').remove();
|
||||
// $('.act').append(
|
||||
// ' <a class="btn btn-success pull-right m-rl-5 rad react" onclick="reActiveAll()">' + '<i class="fa faSize fa-rotate-left"></i>' + ' </a>'
|
||||
// );
|
||||
//}
|
||||
//if (document.getElementById("activing").selectedIndex == 2) {
|
||||
// $('.deact').remove();
|
||||
|
||||
|
||||
//}
|
||||
$('.persianDateInputa').persianDatepicker({
|
||||
format: 'YYYY/MM/DD',
|
||||
initialValueType: 'persian',
|
||||
initialValue: false,
|
||||
/* 'position': [-270, 25],*/
|
||||
autoClose: true,
|
||||
|
||||
calendar: {
|
||||
persian: {
|
||||
leapYearMode: 'astronomical'
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
$('.persianDateInputb').persianDatepicker({
|
||||
format: 'YYYY/MM/DD',
|
||||
initialValueType: 'persian',
|
||||
|
||||
initialValue: false,
|
||||
/*'position': [-270, 25],*/
|
||||
autoClose: true,
|
||||
|
||||
calendar: {
|
||||
persian: {
|
||||
leapYearMode: 'astronomical'
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$(".datepicker-container").hide();
|
||||
$(document).ready(function() {
|
||||
$('#datatable').dataTable({
|
||||
"lengthMenu": [[25, 10, 50, 100, -1], [25, 10, 50, 100, "All"]]
|
||||
});
|
||||
$(".datepicker-container").hide();
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
<script>
|
||||
@*function copyLink() {
|
||||
|
||||
|
||||
if (document.getElementById("checkSelect").checked == false) {
|
||||
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " هیچ قراردادی انتخاب نشده است ");
|
||||
|
||||
|
||||
} else {
|
||||
if (document.getElementById("sercheCheck").value == "true") {
|
||||
checkboxes = document.getElementsByName('foo');
|
||||
var url3 = '';
|
||||
for (var i = 0, n = checkboxes.length; i < n; i++) {
|
||||
if (checkboxes[i].checked == true) {
|
||||
var u = '&ids=' + checkboxes[i].value;
|
||||
url3 = url3 + u;
|
||||
}
|
||||
}
|
||||
var url1 = '#showmodal=';
|
||||
var url2 = '@Url.Page("/Company/Checkouts/Index", "PrintAll")';
|
||||
|
||||
window.location.href = url1 + url2 + url3;
|
||||
} else if (document.getElementById("sercheCheck").value == "false") {
|
||||
console.log(document.getElementById("sercheCheck").value);
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی قرارداد حداقل یکی از فیلدهای کارکاه یا پرسنل را انتخاب نموده و سپس جستجو را کلیک کنید ");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}*@
|
||||
|
||||
@*function deactiveAll() {
|
||||
|
||||
|
||||
if (document.getElementById("checkSelect").checked == false) {
|
||||
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " هیچ تصفیه حسابی انتخاب نشده است ");
|
||||
|
||||
|
||||
} else {
|
||||
if (document.getElementById("sercheCheck").value == "true") {
|
||||
swal({
|
||||
title: "توجه داشته باشید با تایید این پیام تمامی تصفیه حساب های انتخاب شده بطور کامل از بانک اطلاعات حذف می شوند",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "تایید",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: false
|
||||
},
|
||||
function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
checkboxes2 = document.getElementsByName('foo');
|
||||
var url3b = '';
|
||||
for (var i2 = 0, n2 = checkboxes2.length; i2 < n2; i2++) {
|
||||
if (checkboxes2[i2].checked == true) {
|
||||
var u2 = '&ids=' + checkboxes2[i2].value;
|
||||
url3b = url3b + u2;
|
||||
}
|
||||
}
|
||||
/* var url1 = '#showmodal=';*/
|
||||
var url2b = '@Url.Page("/Company/Checkouts/Index", "MultiRemoveCheckout")';
|
||||
/* var url3 = document.getElementById('yearSend').value;*/
|
||||
window.location.href = url2b + url3b;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
} else if (document.getElementById("sercheCheck").value == "false") {
|
||||
console.log(document.getElementById("sercheCheck").value);
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی قرارداد حداقل یکی از فیلدهای کارکاه یا پرسنل را انتخاب نموده و سپس جستجو را کلیک کنید ");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}*@
|
||||
|
||||
function removeOneCheckout(aTag) {
|
||||
swal({
|
||||
title: "توجه داشته باشید با تایید این پیام قرارداد مورد نظر بطور کامل از بانک اطلاعات حذف می شود ",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "تایید",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: false
|
||||
},
|
||||
function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
/* $("a.dell").click();*/
|
||||
const inputTag = aTag.querySelector('input[name="checkoutId"]');
|
||||
const chekoutId = inputTag.value;
|
||||
let url3b = '';
|
||||
const u2 = `&id=${chekoutId}`;
|
||||
url3b = url3b + u2;
|
||||
const url2b = '@Url.Page("/Company/InstitutionContracts/Index", "RemoveOne")';
|
||||
window.location.href = url2b + url3b;
|
||||
} else {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function deactiveOneCheckout(Id, Balance) {
|
||||
|
||||
swal({
|
||||
title: "توجه داشته باشید با تایید این پیام قرارداد مورد نظر غیر فعال می شود ",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "تایید",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: false,
|
||||
customClass: "disableSwall"
|
||||
},
|
||||
function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
let url3b = '';
|
||||
const u2 = `&id=${Id}`;
|
||||
const u3 = `&balance=${Balance}`;
|
||||
url3b = url3b + u2 + u3;
|
||||
const url2b = '@Url.Page("/Company/InstitutionContracts/Index", "DeActive")';
|
||||
window.location.href = url2b + url3b;
|
||||
} else {
|
||||
}
|
||||
});
|
||||
}
|
||||
@*function print() {
|
||||
/* $("a.dell").click();*/
|
||||
var url2b = '@Url.Page("/Company/InstitutionContracts/Index", "Print")';
|
||||
window.location.href = url2b;
|
||||
}*@
|
||||
</script>
|
||||
<script>
|
||||
function reActiveAll() {
|
||||
if (document.getElementById("checkSelect").checked == false) {
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " هیچ قراردادی انتخاب نشده است ");
|
||||
} else {
|
||||
if (document.getElementById("sercheCheck").value == "false") {
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی قرارداد حداقل یکی از فیلدهای کارکاه یا پرسنل را انتخاب نموده و سپس جستجو را کلیک کنید ");
|
||||
|
||||
} else if (document.getElementById("sercheCheck").value == "true") {
|
||||
swal({
|
||||
title: "آیا فعال نمودن این قراردادها اطمینان دارید؟",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: false
|
||||
},
|
||||
function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
checkboxes2 = document.getElementsByName('foo');
|
||||
let url3b = '';
|
||||
for (var i2 = 0, n2 = checkboxes2.length; i2 < n2; i2++) {
|
||||
if (checkboxes2[i2].checked == true) {
|
||||
const u2 = `&ids=${checkboxes2[i2].value}`;
|
||||
url3b = url3b + u2;
|
||||
}
|
||||
}
|
||||
const url2b = '@Url.Page("/Company/Checkouts/Index", "GroupReActive")';
|
||||
window.location.href = url2b + url3b;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
$(window).on('resize',
|
||||
function() {
|
||||
if ($(window).width() < 768) {
|
||||
locateButtonContainerMobile();
|
||||
}
|
||||
if ($(window).width() > 768) {
|
||||
locateButtonContainer();
|
||||
}
|
||||
});
|
||||
$(document).on("click",
|
||||
function(event) {
|
||||
const target = $(event.target);
|
||||
if (!target.closest(".buttons-container").length && !target.is(".employee-operations") && !target.is("#LeftWorkInsuranceForm") && !target.is("#LeftWorkInsuranceForm *") && !target.is("#LeftWorkForm") && !target.is("#LeftWorkForm *") && !target.is("#LeftWorkInsuranceForm #closing") && !target.is("#LeftWorkForm #close") && !target.is("#LeftWorkInsuranceForm .close") && !target.is("#LeftWorkForm .close") && !target.is("#LeftWorkInsuranceForm #btnSaveData") && !target.is("#LeftWorkForm #btnSaveData")
|
||||
) {
|
||||
$(".buttons-container").removeClass("active").addClass("reverse");
|
||||
$(".more-buttons").removeClass("active");
|
||||
setTimeout(function() {
|
||||
$(".buttons-container").removeClass("reverse").css("display", "none");
|
||||
},
|
||||
200);
|
||||
}
|
||||
});
|
||||
$(".employee-operations").on("click",
|
||||
function() {
|
||||
if ($(window).width() < 768) {
|
||||
locateButtonContainerMobile();
|
||||
}
|
||||
if ($(window).width() > 768) {
|
||||
locateButtonContainer();
|
||||
}
|
||||
var buttonsContainer = $(this).next(".buttons-container");
|
||||
if (buttonsContainer.hasClass("active")) {
|
||||
buttonsContainer.removeClass("active").addClass("reverse");
|
||||
$(this).closest(".more-buttons").removeClass("active");
|
||||
setTimeout(function() {
|
||||
buttonsContainer.removeClass("reverse").css("display", "none");
|
||||
},
|
||||
200);
|
||||
} else {
|
||||
buttonsContainer.removeClass("reverse").addClass("active").css("display", "flex");
|
||||
$(this).closest(".more-buttons").addClass("active");
|
||||
}
|
||||
|
||||
$(".buttons-container").not(buttonsContainer).removeClass("active reverse").css("display", "none");
|
||||
$(".more-buttons").not($(this).closest(".more-buttons")).removeClass("active");
|
||||
});
|
||||
|
||||
function locateButtonContainer() {
|
||||
const beforePosition = $(".screen-view .employee-operations").position();
|
||||
const containerWidth = $('.screen-view .buttons-container').outerWidth();
|
||||
const containerHeight = $('.screen-view .buttons-container').outerHeight();
|
||||
const containerLeft = beforePosition.left + $(".screen-view .employee-operations").outerWidth() + 20;
|
||||
const containerTop = beforePosition.top + ($(".screen-view .employee-operations").outerHeight() / 2) - (containerHeight / 2);
|
||||
$('.screen-view .buttons-container').css({
|
||||
left: containerLeft,
|
||||
top: containerTop
|
||||
});
|
||||
}
|
||||
|
||||
function locateButtonContainerMobile() {
|
||||
const beforePosition = $(".mobile-view .employee-operations").position();
|
||||
const containerWidth = $('.mobile-view .buttons-container').outerWidth();
|
||||
const containerHeight = $('.mobile-view .buttons-container').outerHeight();
|
||||
const containerLeft = beforePosition.left + $(".mobile-view .employee-operations").outerWidth() + 25;
|
||||
const containerTop = beforePosition.top + ($(".mobile-view .employee-operations").outerHeight() / 2) - (containerHeight / 2);
|
||||
$('.mobile-view .buttons-container').css({
|
||||
left: containerLeft,
|
||||
top: containerTop
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function showAmount(element) {
|
||||
|
||||
if ($(element).hasClass("fa-eye-slash")) {
|
||||
$(element).removeClass("fa-eye-slash");
|
||||
$(element).addClass("fa-eye");
|
||||
$('.amount').css("visibility", "hidden");
|
||||
} else if ($(element).hasClass("fa-eye")) {
|
||||
$(element).removeClass("fa-eye");
|
||||
$(element).addClass("fa-eye-slash");
|
||||
$('.amount').css("visibility", "visible");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function showTooltip(id) {
|
||||
|
||||
|
||||
// var id= $(this).attr("id").replace("p_","");
|
||||
|
||||
|
||||
console.log($(`tooltip_${id}`).hasClass('show'));
|
||||
|
||||
|
||||
if ($(`tooltip_${id}`).hasClass('show')) {
|
||||
$(`tooltip_${id}`).removeClass('show');
|
||||
$(`tooltip_${id}`).css({ 'visibility': 'hidden' });
|
||||
} else {
|
||||
$(`tooltip_${id}`).addClass('show');
|
||||
$(`tooltip_${id}`).css({ 'visibility': 'visible' });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function block(id) {
|
||||
$('.sweet-alert').removeClass("successSwall");
|
||||
$('.sweet-alert').removeClass("errorSwall");
|
||||
swal({
|
||||
title: "آیا از مسدود کردن این طرف حساب مطمئن هستید؟",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: true,
|
||||
closeOnCancel: true
|
||||
},
|
||||
function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("./Index", "BlockPersonalContractingParties")',
|
||||
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
|
||||
data: { "id": id },
|
||||
success: function(response) {
|
||||
// console.log(response);
|
||||
if (response.isSuccedded) {
|
||||
bloked(id, response.blockTimes);
|
||||
|
||||
} else {
|
||||
|
||||
swal({
|
||||
title: response.message,
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
//confirmButtonText: "بستن",
|
||||
cancelButtonText: "بستن",
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: true,
|
||||
customClass: "errorSwall"
|
||||
});
|
||||
}
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function bloked(id, blocktime) {
|
||||
const blocked = `<a onclick="disableBlock(${id},${blocktime})" class="btn btn-inverse unblock pull-left rad btn-table" permission="10114" style="margin-left:5px" class="btn pull-right btn-danger btn-table">
|
||||
<span class="blockCount">${blocktime}</span>
|
||||
<i class="fa fa-minus-circle"></i><span>آنبلاک</span></a>`;
|
||||
|
||||
|
||||
$(`#blockspan${id}`).html('');
|
||||
$(`#blockspan${id}`).append(blocked);
|
||||
$(`.blockingTr${id}`).addClass("blockTr");
|
||||
$(`.blockingTr${id}`).addClass("progress-bar-striped");
|
||||
$(`.extention${id}`).addClass("disabled");
|
||||
$(`.deactive${id}`).addClass("disabled");
|
||||
$(`.edit${id}`).addClass("disabled");
|
||||
$(`.delete${id}`).addClass("disabled");
|
||||
|
||||
}
|
||||
|
||||
function disableBlock(id, blocktime) {
|
||||
$('.sweet-alert').removeClass("successSwall");
|
||||
$('.sweet-alert').removeClass("errorSwall");
|
||||
|
||||
|
||||
swal({
|
||||
title: "آیا میخواهید این طرف حساب را از حالت مسدود خارج نمایید؟ ",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: true,
|
||||
closeOnCancel: true
|
||||
},
|
||||
function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: '@Url.Page("./Index", "DisableBlockPersonalContractingParties")',
|
||||
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
|
||||
data: { "id": id },
|
||||
success: function(response) {
|
||||
//console.log(response);
|
||||
if (response.isSuccedded) {
|
||||
$(`.blockingTr${id}`).removeClass("blockTr");
|
||||
$(`.blockingTr${id}`).removeClass("progress-bar-striped");
|
||||
$(`.extention${id}`).removeClass("disabled");
|
||||
$(`.deactive${id}`).removeClass("disabled");
|
||||
$(`.edit${id}`).removeClass("disabled");
|
||||
$(`.delete${id}`).removeClass("disabled");
|
||||
if (response.blockTimes == 1) {
|
||||
const orange = `<a onclick="block(${id})" class="btn btn-inverse bgOrange pull-left rad btn-table" permission="10114" style="margin-left:5px" class="btn pull-right btn-danger btn-table">
|
||||
<span class="blockCount">${response.blockTimes}</span> <i class="fa fa-minus-circle"></i><span>بلاک کردن</span></a>`;
|
||||
$(`#blockspan${id}`).html('');
|
||||
$(`#blockspan${id}`).append(orange);
|
||||
|
||||
|
||||
} else if (response.blockTimes >= 2) {
|
||||
const red = `<a onclick="block(${id})" class="btn btn-inverse bgRed pull-left rad btn-table" permission="10114" style="margin-left:5px" class="btn pull-right btn-danger btn-table">
|
||||
<span class="blockCount">${response.blockTimes}</span> <i class="fa fa-minus-circle"></i><span>بلاک کردن</span></a>`;
|
||||
|
||||
$(`#blockspan${id}`).html('');
|
||||
$(`#blockspan${id}`).append(red);
|
||||
|
||||
|
||||
}
|
||||
swal({
|
||||
title: response.message,
|
||||
text: "",
|
||||
type: "success",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بستن",
|
||||
//cancelButtonText: "خیر",
|
||||
closeOnConfirm: true,
|
||||
customClass: "successSwall"
|
||||
},
|
||||
function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
$("#btnSearch").click();
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
swal({
|
||||
title: response.message,
|
||||
// text: "برای حذف قرارداد، ابتدا تیک مربوط به امضای قرارداد را حذف نمایید.",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
//confirmButtonText: "بستن",
|
||||
cancelButtonText: "بستن",
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: true,
|
||||
customClass: "errorSwall"
|
||||
});
|
||||
}
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
|
||||
var signAjaxUrl = '@Url.Page("./Index", "Sign")';
|
||||
var unSignAjax ='@Url.Page("./Index", "UnSign")';
|
||||
var removeOneCheckoutUrl = '@Url.Page("/Company/InstitutionContracts/Index", "RemoveOne")';
|
||||
var deactiveOneCheckoutUrl = '@Url.Page("/Company/InstitutionContracts/Index", "DeActive")';
|
||||
|
||||
var reActiveAllUrl = '@Url.Page("/Company/Checkouts/Index", "GroupReActive")';
|
||||
var blockAjax = '@Url.Page("./Index", "BlockPersonalContractingParties")';
|
||||
var disableBlockAjax = '@Url.Page("./Index", "DisableBlockPersonalContractingParties")';
|
||||
</script>
|
||||
<script src="~/AssetsAdmin/page/InstitutionContract/js/Index.js?ver=@adminVersion"></script>
|
||||
}
|
||||
@@ -73,16 +73,16 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.AndroidApk
|
||||
|
||||
public IActionResult OnPostShiftDateNew2()
|
||||
{
|
||||
var startRollCall = new DateTime(2025, 2, 19);
|
||||
var rollCalls = _context.RollCalls.Where(x => x.ShiftDate >= startRollCall && x.WorkshopId == 170).ToList();
|
||||
var startRollCall = new DateTime(2025, 3, 21);
|
||||
var rollCalls = _context.RollCalls.Where(x => x.StartDate >= startRollCall &&x.EndDate != null && x.ShiftDate == new DateTime()).ToList();
|
||||
var r1 = rollCalls.Take(3000).ToList();
|
||||
|
||||
var r2 = rollCalls.Skip(3000).ToList();
|
||||
Console.ForegroundColor = ConsoleColor.DarkRed;
|
||||
Console.WriteLine("endStep 1 ============");
|
||||
SetRollCall(r1);
|
||||
|
||||
Console.ForegroundColor = ConsoleColor.Yellow;
|
||||
Console.WriteLine("endStep 2 ============");
|
||||
SetRollCall2(r2);
|
||||
|
||||
ViewData["message"] = "تومام دو";
|
||||
ViewData["message"] = "تومام دو";
|
||||
return Page();
|
||||
}
|
||||
|
||||
|
||||
@@ -294,6 +294,20 @@ namespace ServiceHost.Areas.Client.Pages.Company.Employees
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetEmployeeListLeftWorkTemp()
|
||||
{
|
||||
var exists = _leftWorkTempApplication.GetLeftWorksByWorkshopId(_workshopId);
|
||||
|
||||
var employees = (await _employeeApplication.WorkedEmployeesInWorkshopSelectList(_workshopId))
|
||||
.Where(x=> exists.All(a => a.EmployeeId != x.Id)).ToList();
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
data = employees
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostCreateEmployeeLeftWork(CreateLeftWorkTemp command)
|
||||
{
|
||||
command.WorkshopId = _workshopId;
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
<script src="~/assetsclient/libs/wordifyfa/wordifyfa.min.js"></script>
|
||||
<script>
|
||||
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
|
||||
var employeeListAjax = `@Url.Page("./EmployeeList", "EmployeeList")`; // EmployeeList Handler
|
||||
var employeeListAjax = `@Url.Page("./EmployeeList", "EmployeeListLeftWorkTemp")`; // EmployeeList Handler
|
||||
var dayOfWeekDataUrl = `@Url.Page("./EmployeeList", "DayOfWeek")`; // EmployeeList Handler
|
||||
var saveLeftWorkAjax = `@Url.Page("./EmployeeList", "CreateEmployeeLeftWork")`; // EmployeeList Handler
|
||||
|
||||
|
||||
@@ -164,7 +164,8 @@ namespace ServiceHost.Areas.Client.Pages.Company.SalaryAid
|
||||
Amount = x.Amount.ToMoney(),
|
||||
EmployeeIds = [x.EmployeeId],
|
||||
SalaryDateTime = x.SalaryAidDateTime,
|
||||
NationalCode = x.NationalCode
|
||||
NationalCode = x.NationalCode,
|
||||
CalculationDateTime = x.CalculationDate
|
||||
}).ToList();
|
||||
OperationResult result = await _salaryAidApplication.CreateRange(commands);
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
}
|
||||
|
||||
<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>
|
||||
@@ -33,13 +32,17 @@
|
||||
</div>
|
||||
<div class="col-12 my-1" style="height: 30px;">
|
||||
<div class="d-block">
|
||||
<div id="amountRials" style="font-size: 12px;color: #4f4f4f;"></div>
|
||||
<div id="amountTomans" style="font-size: 12px;color: #4f4f4f;"></div>
|
||||
<div id="amountRials" class="scroll-container-amount"></div>
|
||||
<div id="amountTomans" class="scroll-container-amount"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 my-1">
|
||||
<span class="spanTitleText">تاریخ</span>
|
||||
<input class="form-control form-control-date text-center dateTime" asp-for="@Model.SalaryDateTime" placeholder="تاریخ را وارد نمائید" style="direction: ltr" />
|
||||
<span class="spanTitleText">تاریخ پرداخت</span>
|
||||
<input class="form-control form-control-date text-center dateTime" asp-for="@Model.SalaryDateTime" placeholder="تاریخ پرداخت را وارد نمائید" style="direction: ltr" />
|
||||
</div>
|
||||
<div class="col-12 my-1">
|
||||
<span class="spanTitleText">تاریخ محاسبه</span>
|
||||
<input class="form-control form-control-date text-center dateTime" asp-for="@Model.CalculationDateTime" placeholder="تاریخ محاسبه را وارد نمائید" style="direction: ltr" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -65,6 +68,7 @@
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<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>
|
||||
|
||||
@@ -31,14 +31,18 @@
|
||||
</div>
|
||||
<div class="col-12 my-1" style="height: 30px;">
|
||||
<div class="d-block">
|
||||
<div id="amountRials" style="font-size: 12px;color: #4f4f4f;"></div>
|
||||
<div id="amountTomans" style="font-size: 12px;color: #4f4f4f;"></div>
|
||||
<div id="amountRials" class="scroll-container-amount"></div>
|
||||
<div id="amountTomans" class="scroll-container-amount"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 my-1">
|
||||
<span class="spanTitleText">تاریخ</span>
|
||||
<input class="form-control form-control-date text-center dateTime" asp-for="@Model.SalaryDateTime" placeholder="تاریخ را وارد نمائید" style="direction: ltr"/>
|
||||
</div>
|
||||
<div class="col-12 my-1">
|
||||
<span class="spanTitleText">تاریخ محاسبه</span>
|
||||
<input class="form-control form-control-date text-center dateTime" asp-for="@Model.CalculationDateTime" placeholder="تاریخ محاسبه را وارد نمائید" style="direction: ltr" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -583,7 +583,10 @@ namespace ServiceHost.Areas.Client.Pages
|
||||
{
|
||||
var workshopSlug = User.FindFirst("WorkshopSlug")?.Value;
|
||||
long workshopIDecrypt = _passwordHasher.SlugDecrypt(workshopSlug);
|
||||
var employees = await _employeeApplication.WorkedEmployeesInWorkshopSelectList(workshopIDecrypt);
|
||||
var exists = _leftWorkTempApplication.GetLeftWorksByWorkshopId(workshopIDecrypt);
|
||||
|
||||
var employees = (await _employeeApplication.WorkedEmployeesInWorkshopSelectList(workshopIDecrypt))
|
||||
.Where(x => exists.All(a => a.EmployeeId != x.Id)).ToList();
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
|
||||
@@ -0,0 +1,705 @@
|
||||
|
||||
var submitcheck1 = true;
|
||||
var submitcheck2 = true;
|
||||
var submitcheck3 = true;
|
||||
|
||||
|
||||
//$(document).ready(function() {
|
||||
// $('#amount').on('input', function() {
|
||||
// var amount = $(this).val();
|
||||
// var totalAmount = amount * 10;
|
||||
// $('#totalAmount').val(totalAmount);
|
||||
// });
|
||||
//});
|
||||
$(".date").mask("0000/00/00");
|
||||
$('.add_project_file').click(function(e) {
|
||||
e.preventDefault();
|
||||
const a = ($(".items").length) / 4;
|
||||
const html = `<div class="row">
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> نوع شماره </label>
|
||||
<select class="form-control items" data-phonetype="${a}" name="ContactInformationList[${a}].PhoneType">'
|
||||
<option value=""> </option>'
|
||||
<option value="شماره همراه"> شماره همراه </option>
|
||||
<option value="شماره ثابت"> شماره ثابت </option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> سمت </label>
|
||||
<select class="form-control items" name="ContactInformationList[${a}].Position">
|
||||
<option value=""> </option>
|
||||
<option value="طرف قرارداد"> طرف قرارداد </option>
|
||||
<option value="کارفرما"> کارفرما </option>
|
||||
<option value="مدیرعامل"> مدیرعامل </option>
|
||||
<option value="نماینده کارفرما"> نماینده کارفرما </option>
|
||||
<option value="مالی"> مالی </option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> نام و نام خانوادگی </label>
|
||||
<input type="text" class="form-control items" name="ContactInformationList[${a}].FnameLname">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div style="display: flex;align-items: center; ">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> شماره تماس </label>
|
||||
<input type="text" class="form-control items" data-mobile="${a}" onkeyup="mobileValidation(this);" name="ContactInformationList[${a}].PhoneNumber">
|
||||
<span data-mobile-err="${a}" style="font-size: 8px; color: red"></span>
|
||||
<input type="checkbox" onclick="checking(this);" data-checkbox="${a}" name="check" style="position: relative; top: -28px; right:99px;"/>
|
||||
<input type="hidden" data-checkboxStr="${a}" name="ContactInformationList[${a}].SendSmsString"/>
|
||||
</div>
|
||||
<a href="#" class="remove_project_file" data-remove="${a}" style="padding: 0 3px;"><i style="color: red;font-size: 15px;" class="ion-close-circled pull-left"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>`;
|
||||
$(".project_images").append(html);
|
||||
|
||||
});
|
||||
|
||||
//mobile validation
|
||||
function mobileValidation(el) {
|
||||
$(el).on("input",
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
});
|
||||
|
||||
|
||||
const contactRow = $(el).closest('div.row');
|
||||
const elData = $(el).attr("data-mobile");
|
||||
|
||||
let selectedPhoneType;
|
||||
contactRow.find("select").each(function() {
|
||||
if ($(this).attr("data-phonetype") == elData) {
|
||||
selectedPhoneType = $(this).prop("selectedIndex");
|
||||
}
|
||||
});
|
||||
|
||||
if (selectedPhoneType == 1) {
|
||||
if ($(el).val().length < 11 || $(el).val().length > 11) {
|
||||
|
||||
$(el).addClass("invalidMobile");
|
||||
contactRow.find("span[data-mobile-err]").text("شماره همراه 11 رقمی وارد کنید");
|
||||
} else {
|
||||
|
||||
$(el).removeClass("invalidMobile");
|
||||
contactRow.find("span[data-mobile-err]").text("");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Remove parent of 'remove' link when link is clicked.
|
||||
$('.project_images').on('click',
|
||||
'.remove_project_file',
|
||||
function(e) {
|
||||
e.preventDefault();
|
||||
const contactRow = $(this).closest('div.row');
|
||||
if ($(this).attr("data-remove") == 0) {
|
||||
contactRow.find('input:text').val('');
|
||||
contactRow.find('input:checkbox').prop('checked', false);
|
||||
contactRow.find("select").each(function() {
|
||||
$(this).prop("selectedIndex", 0);
|
||||
});
|
||||
} else {
|
||||
$(this).closest('div.row').remove();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//checkbox value copy to string input
|
||||
function checking(el) {
|
||||
const datacheckbox = $(el).attr("data-checkbox");
|
||||
const contactRow = $(el).closest('div.row');
|
||||
if ($(el).is(":checked")) {
|
||||
let selectedPhoneType;
|
||||
contactRow.find("select").each(function() {
|
||||
if ($(this).attr("data-phonetype") == datacheckbox) {
|
||||
selectedPhoneType = $(this).prop("selectedIndex");
|
||||
}
|
||||
});
|
||||
if (selectedPhoneType == 1) {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("true");
|
||||
} else {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("false");
|
||||
$(el).prop("checked", false);
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "ابتدا نوع شماره را همراه انتخاب کنید");
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("false");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function setValueAdded() {
|
||||
$('input[name="checkTaxAdded"]').val("true");
|
||||
calculateTotalAmount();
|
||||
|
||||
}
|
||||
|
||||
function removeValueAdded() {
|
||||
$('input[name="checkTaxAdded"]').val("false");
|
||||
calculateTotalAmount();
|
||||
|
||||
}
|
||||
|
||||
function findEndOfYear(date) {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: ajaxFindeEndOfYear,
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "start": date },
|
||||
|
||||
success: function(response) {
|
||||
|
||||
$('#end').val(response.end);
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//ارزش افزوده
|
||||
$('#officialStatus').on('change',
|
||||
function() {
|
||||
if ($(this).val() == "Official") {
|
||||
|
||||
const tax = `<div class="col-xs-12">
|
||||
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
|
||||
|
||||
<div class="radio-box" style=" display: flex">
|
||||
<label class="radio-label" style="background-color: #fad7d7;
|
||||
padding: 5px;
|
||||
border-radius: 5px;"> مالیات بر ارزش افزوده </label>
|
||||
<span> </span> <span> </span> <span> </span> <span> </span>
|
||||
<div class="radio-input">
|
||||
<label>
|
||||
<input type="radio" style="margin: 10px 0px;" value="true" onclick="setValueAdded()" asp-for="HasValueAddedTax" name="HasValueAddedTax"><span> </span> <span>دارد</span>
|
||||
|
||||
</label>
|
||||
<span> </span> <span> </span> <span> </span> <span> </span>
|
||||
<label>
|
||||
<input type="radio" style="margin: 10px 0px;" value="false" onclick="removeValueAdded()" asp-for="HasValueAddedTax" name="HasValueAddedTax"><span> </span> <span>ندارد</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</fieldset>
|
||||
</div>`;
|
||||
$('#valueAdded').append(tax);
|
||||
$('#valueAdded').show();
|
||||
} else {
|
||||
$('#valueAdded').html('');
|
||||
$('#valueAdded').hide();
|
||||
$('input[name="checkTaxAdded"]').val("false");
|
||||
calculateTotalAmount();
|
||||
}
|
||||
});
|
||||
|
||||
// تابع برای محاسبه و نمایش مقدار در فیلد totalAmount
|
||||
function calculateTotalAmount() {
|
||||
const start = $('#start').val();
|
||||
|
||||
const end = $('#end').val();
|
||||
|
||||
const amount = $('#amount').val();
|
||||
|
||||
|
||||
const checkTax = $('input[name="checkTaxAdded"]').val();
|
||||
console.log(checkTax);
|
||||
let isTaxAdded = "false";
|
||||
if ($('#officialStatus').val() == "Official") {
|
||||
|
||||
if (checkTax == "true") {
|
||||
isTaxAdded = "true";
|
||||
} else {
|
||||
isTaxAdded = "false";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (start.length == 10 && end.length == 10 && amount.length > 1) {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: ajaxCalculateTotalAmount,
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "start": start, "end": end, "amount": amount, "valueAddedtax": isTaxAdded },
|
||||
|
||||
success: function(response) {
|
||||
|
||||
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
const compute = numeral(response.totalAmount).format();
|
||||
const finalAmount = numeral(response.finalAmount).format();
|
||||
const valueAddedTax = numeral(response.valueAddedTax).format();
|
||||
$('#obligation').val(compute);
|
||||
$('#totalAmount').val(compute);
|
||||
$('#finalAmount').val(finalAmount);
|
||||
$('#finalAmountFake').val(finalAmount);
|
||||
$('#valueAddedTax').val(valueAddedTax);
|
||||
$('#valueAddedTaxFake').val(valueAddedTax);
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#sendData').on('click',
|
||||
function(e) {
|
||||
|
||||
if (submitcheck1 === false || submitcheck2 === false || submitcheck3 === false) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
$('#city2').on('change',
|
||||
function() {
|
||||
const selectedcity = jQuery("#city2 option:selected").text();
|
||||
$('#hidencity').val(selectedcity);
|
||||
|
||||
});
|
||||
$('#contractDate').on('change',
|
||||
function() {
|
||||
submitcheck1 = dateValidcheck(this);
|
||||
|
||||
});
|
||||
// هنگام ورود مقدار به فیلد start
|
||||
$('#start').on('input',
|
||||
function() {
|
||||
const startDate = this.value;
|
||||
if (startDate.length == 10) {
|
||||
submitcheck2 = dateValidcheck(this);
|
||||
if (submitcheck2) {
|
||||
findEndOfYear(startDate);
|
||||
calculateTotalAmount();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
// هنگام ورود مقدار به فیلد end
|
||||
$('#end').on('input',
|
||||
function() {
|
||||
const endDate = this.value;
|
||||
if (endDate.length == 10) {
|
||||
submitcheck3 = dateValidcheck(this);
|
||||
calculateTotalAmount();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
// هنگام ورود مقدار به فیلد amount
|
||||
$('#amount').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var contractAmount = $("#amount");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
contractAmount.on("keyup",
|
||||
function(e) {
|
||||
contractAmount.val(numeral(contractAmount.val()).format());
|
||||
});
|
||||
calculateTotalAmount();
|
||||
});
|
||||
$('#obligation').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var obligation = $("#obligation");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
obligation.on("keyup",
|
||||
function(e) {
|
||||
obligation.val(numeral(obligation.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
$('#totalAmount').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var totalAmount = $("#totalAmount");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
totalAmount.on("keyup",
|
||||
function(e) {
|
||||
totalAmount.val(numeral(totalAmount.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
$('#dailyCompenseation').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var dailyCompenseation = $("#dailyCompenseation");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
dailyCompenseation.on("keyup",
|
||||
function(e) {
|
||||
dailyCompenseation.val(numeral(dailyCompenseation.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
var start1valid = false;
|
||||
|
||||
function dateValidcheck(inputField1) {
|
||||
|
||||
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = inputField1.value;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
let s1, s2;
|
||||
for (var i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 4) {
|
||||
s1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 7) {
|
||||
s2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
let yRes = y1 + y2 + y3 + y4;
|
||||
let year = parseInt(yRes);
|
||||
let mRes = m1 + m2;
|
||||
let month = parseInt(mRes);
|
||||
let dRes = d1 + d2;
|
||||
let day = parseInt(dRes);
|
||||
let fixResult = yRes + s1 + mRes + s2 + dRes;
|
||||
let test1 = checkEnValid(inputField1.value);
|
||||
|
||||
let isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(fixResult);
|
||||
|
||||
|
||||
if (isValid && test1) {
|
||||
inputField1.style.backgroundColor = '#a6e9a6';
|
||||
start1valid = true;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
if (inputField1.value != "") {
|
||||
inputField1.style.backgroundColor = '#f94c4c';
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
|
||||
start1valid = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return start1valid;
|
||||
|
||||
}
|
||||
|
||||
function checkEnValid(fixDate1) {
|
||||
|
||||
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = fixDate1;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
for (let i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
let yRes = y1 + y2 + y3 + y4;
|
||||
let year = parseInt(yRes);
|
||||
let mRes = m1 + m2;
|
||||
let month = parseInt(mRes);
|
||||
let dRes = d1 + d2;
|
||||
let day = parseInt(dRes);
|
||||
let kabiseh = false;
|
||||
if (month <= 6 && day > 31) {
|
||||
return false;
|
||||
} else if (month > 6 && month < 12 && day > 30) {
|
||||
return false;
|
||||
} else if (month === 12) {
|
||||
|
||||
switch (year) {
|
||||
case 1346:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1350:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1354:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1358:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1362:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1366:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1370:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1375:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1379:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1383:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1387:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1391:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1395:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1399:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1403:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1408:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1412:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1416:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1420:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1424:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1428:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1432:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1436:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1441:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1445:
|
||||
kabiseh = true;
|
||||
break;
|
||||
default:
|
||||
kabiseh = false;
|
||||
|
||||
}
|
||||
if (kabiseh == true && day > 30) {
|
||||
return false;
|
||||
} else if (kabiseh == false && day > 29) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
async function loadContractingPrties() {
|
||||
/* loadPersonnel();*/
|
||||
const nameId = document.getElementById("getContractingPrties").value;
|
||||
|
||||
|
||||
$('#getContracingPartiesInfo').empty().append('<option selected="selected" value="0" >انتخاب طرف حساب</option>');
|
||||
|
||||
|
||||
if (nameId != "noId") {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: ajaxLoadContractingPrties,
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "id": nameId },
|
||||
|
||||
success: function (response) {
|
||||
//var items2 = [];
|
||||
|
||||
//$.each(response,
|
||||
// function (key, val) {
|
||||
// items2.push({ id: key, vall: val });
|
||||
|
||||
// });
|
||||
|
||||
|
||||
$.each(response.mylist,
|
||||
function (i, item) {
|
||||
$('#getContracingPartiesInfo').append($('<option>',
|
||||
{
|
||||
value: item.id,
|
||||
text: item.fullName,
|
||||
}));
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
failure: function (response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
async function loadContracingPartiesInfo() {
|
||||
const id = document.getElementById("getContracingPartiesInfo").value;
|
||||
const workshopId = document.getElementById("getContractingPrties").value;
|
||||
|
||||
if (workshopId == "noId") {
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "ابتدا معرف را انتخاب نمایید");
|
||||
}
|
||||
|
||||
if (id > 0 && workshopId != "noId") {
|
||||
$.ajax({
|
||||
//contentType: 'application/json; charset=utf-8',
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: ajaxLoadContractingPrtiesInfo,
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "id": id },
|
||||
|
||||
success: function (response) {
|
||||
var items2 = [];
|
||||
$.each(response,
|
||||
function (key, val) {
|
||||
items2.push({ id: key, vall: val });
|
||||
|
||||
});
|
||||
//if (items2[8].vall == "")
|
||||
// $.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ',"ابتدا تاریخ شروع به کار را در بخش پرسنل <br/>برای این شخص و کارگاه مورد نظر ایجاد نموده و سپس اقدام به ایجاد قرارداد نمایید");
|
||||
document.getElementById("WCounter").value = items2[1].vall;
|
||||
document.getElementById("ECounter").value = items2[2].vall;
|
||||
|
||||
|
||||
},
|
||||
failure: function (response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,614 @@
|
||||
|
||||
var submitcheck1 = true;
|
||||
var submitcheck2 = true;
|
||||
var submitcheck3 = true;
|
||||
$(".date").mask("0000/00/00");
|
||||
|
||||
$('.add_project_file').click(function(e) {
|
||||
e.preventDefault();
|
||||
const a = ($(".items").length) / 4;
|
||||
const html = `<div class="row">
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> نوع شماره </label>
|
||||
<select class="form-control items" data-phonetype="${a}" name="ContactInformationList[${a}].PhoneType">'
|
||||
<option value=""> </option>'
|
||||
<option value="شماره همراه"> شماره همراه </option>
|
||||
<option value="شماره ثابت"> شماره ثابت </option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> سمت </label>
|
||||
<select class="form-control items" name="ContactInformationList[${a}].Position">
|
||||
<option value=""> </option>
|
||||
<option value="طرف قرارداد"> طرف قرارداد </option>
|
||||
<option value="کارفرما"> کارفرما </option>
|
||||
<option value="مدیرعامل"> مدیرعامل </option>
|
||||
<option value="نماینده کارفرما"> نماینده کارفرما </option>
|
||||
<option value="مالی"> مالی </option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> نام و نام خانوادگی </label>
|
||||
<input type="text" class="form-control items" name="ContactInformationList[${a}].FnameLname">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div style="display: flex;align-items: center; ">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> شماره تماس </label>
|
||||
<input type="text" class="form-control items" data-mobile="${a}" onkeyup="mobileValidation(this);" name="ContactInformationList[${a}].PhoneNumber">
|
||||
<span data-mobile-err="${a}" style="font-size: 8px; color: red"></span>
|
||||
<input type="checkbox" onclick="checking(this);" data-checkbox="${a}" name="check" style="position: relative; top: -28px; right:99px;"/>
|
||||
<input type="hidden" data-checkboxStr="${a}" name="ContactInformationList[${a}].SendSmsString"/>
|
||||
</div>
|
||||
<a href="#" class="remove_project_file" data-remove="${a}" style="padding: 0 3px;"><i style="color: red;font-size: 15px;" class="ion-close-circled pull-left"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>`;
|
||||
$(".project_images").append(html);
|
||||
|
||||
});
|
||||
|
||||
//checkbox value copy to string input
|
||||
function checking(el) {
|
||||
const datacheckbox = $(el).attr("data-checkbox");
|
||||
const contactRow = $(el).closest('div.row');
|
||||
if ($(el).is(":checked")) {
|
||||
let selectedPhoneType;
|
||||
contactRow.find("select").each(function() {
|
||||
if ($(this).attr("data-phonetype") == datacheckbox) {
|
||||
selectedPhoneType = $(this).prop("selectedIndex");
|
||||
}
|
||||
});
|
||||
if (selectedPhoneType == 1) {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("true");
|
||||
} else {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("false");
|
||||
$(el).prop("checked", false);
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "ابتدا نوع شماره را همراه انتخاب کنید");
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("false");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//mobile validation
|
||||
function mobileValidation(el) {
|
||||
$(el).on("input",
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
});
|
||||
|
||||
|
||||
const contactRow = $(el).closest('div.row');
|
||||
const elData = $(el).attr("data-mobile");
|
||||
|
||||
let selectedPhoneType;
|
||||
contactRow.find("select").each(function() {
|
||||
if ($(this).attr("data-phonetype") == elData) {
|
||||
selectedPhoneType = $(this).prop("selectedIndex");
|
||||
}
|
||||
});
|
||||
|
||||
if (selectedPhoneType == 1) {
|
||||
if ($(el).val().length < 11 || $(el).val().length > 11) {
|
||||
|
||||
$(el).addClass("invalidMobile");
|
||||
contactRow.find("span[data-mobile-err]").text("شماره همراه 11 رقمی وارد کنید");
|
||||
} else {
|
||||
|
||||
$(el).removeClass("invalidMobile");
|
||||
contactRow.find("span[data-mobile-err]").text("");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Remove parent of 'remove' link when link is clicked.
|
||||
$('.project_images').on('click',
|
||||
'.remove_project_file',
|
||||
function(e) {
|
||||
e.preventDefault();
|
||||
const contactRow = $(this).closest('div.row');
|
||||
if ($(this).attr("data-remove") == 0) {
|
||||
contactRow.find('input:text').val('');
|
||||
contactRow.find('input:checkbox').prop('checked', false);
|
||||
contactRow.find("select").each(function() {
|
||||
$(this).prop("selectedIndex", 0);
|
||||
});
|
||||
} else {
|
||||
$(this).closest('div.row').remove();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function setValueAdded() {
|
||||
$('input[name="checkTaxAdded"]').val("true");
|
||||
calculateTotalAmount();
|
||||
|
||||
}
|
||||
|
||||
function removeValueAdded() {
|
||||
$('input[name="checkTaxAdded"]').val("false");
|
||||
calculateTotalAmount();
|
||||
|
||||
}
|
||||
|
||||
//ارزش افزوده
|
||||
$('#officialStatus').on('change',
|
||||
function() {
|
||||
if ($(this).val() == "Official") {
|
||||
|
||||
const tax = `<div class="col-xs-12">
|
||||
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
|
||||
|
||||
<div class="radio-box" style=" display: flex">
|
||||
<label class="radio-label" style="background-color: #fad7d7;
|
||||
padding: 5px;
|
||||
border-radius: 5px;"> مالیات بر ارزش افزوده </label>
|
||||
<span> </span> <span> </span> <span> </span> <span> </span>
|
||||
<div class="radio-input">
|
||||
<label>
|
||||
<input type="radio" style="margin: 10px 0px;" value="true" onclick="setValueAdded()" asp-for="HasValueAddedTax" name="HasValueAddedTax"><span> </span> <span>دارد</span>
|
||||
|
||||
</label>
|
||||
<span> </span> <span> </span> <span> </span> <span> </span>
|
||||
<label>
|
||||
<input type="radio" style="margin: 10px 0px;" value="false" onclick="removeValueAdded()" asp-for="HasValueAddedTax" name="HasValueAddedTax"><span> </span> <span>ندارد</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</fieldset>
|
||||
</div>`;
|
||||
$('#valueAdded').append(tax);
|
||||
$('#valueAdded').show();
|
||||
} else {
|
||||
$('#valueAdded').html('');
|
||||
$('#valueAdded').hide();
|
||||
$('input[name="checkTaxAdded"]').val("false");
|
||||
calculateTotalAmount();
|
||||
}
|
||||
});
|
||||
|
||||
// تابع برای محاسبه و نمایش مقدار در فیلد totalAmount
|
||||
function calculateTotalAmount() {
|
||||
const start = $('#start').val();
|
||||
|
||||
const end = $('#end').val();
|
||||
|
||||
const amount = $('#amount').val();
|
||||
|
||||
|
||||
const checkTax = $('input[name="checkTaxAdded"]').val();
|
||||
console.log(checkTax);
|
||||
let isTaxAdded = "false";
|
||||
if ($('#officialStatus').val() == "Official") {
|
||||
|
||||
if (checkTax == "true") {
|
||||
isTaxAdded = "true";
|
||||
} else {
|
||||
isTaxAdded = "false";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (start.length == 10 && end.length == 10 && amount.length > 1) {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: ajaxCalculateTotalAmount,
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "start": start, "end": end, "amount": amount, "valueAddedtax": isTaxAdded },
|
||||
|
||||
success: function(response) {
|
||||
|
||||
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
const compute = numeral(response.totalAmount).format();
|
||||
const finalAmount = numeral(response.finalAmount).format();
|
||||
const valueAddedTax = numeral(response.valueAddedTax).format();
|
||||
$('#obligation').val(compute);
|
||||
$('#totalAmount').val(compute);
|
||||
$('#finalAmountFake').val(finalAmount);
|
||||
$('#finalAmount').val(finalAmount);
|
||||
$('#valueAddedTax').val(valueAddedTax);
|
||||
$('#valueAddedTaxFake').val(valueAddedTax);
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#sendData').on('click',
|
||||
function(e) {
|
||||
|
||||
const selectedcity = jQuery("#city2 option:selected").text();
|
||||
|
||||
$('#copyCity').val(selectedcity);
|
||||
|
||||
if (submitcheck1 === false || submitcheck2 === false || submitcheck3 === false) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
$('#finalAmountFake').val($('#finalAmount').val());
|
||||
$('#valueAddedTaxFake').val($('#valueAddedTax').val());
|
||||
$('input[name="checkTaxAdded"]').val(valueAddedTax);
|
||||
const state = document.getElementById('state').value;
|
||||
const citySelect = document.getElementById('copyCity').value;
|
||||
console.log(citySelect);
|
||||
|
||||
iranwebsv2(state);
|
||||
|
||||
$('#city2 option:contains("شهرستان")').text(citySelect);
|
||||
|
||||
$('#contractDate').on('change',
|
||||
function() {
|
||||
submitcheck1 = dateValidcheck(this);
|
||||
|
||||
});
|
||||
// هنگام ورود مقدار به فیلد start
|
||||
$('#start').on('input',
|
||||
function() {
|
||||
const startDate = this.value;
|
||||
if (startDate.length == 10) {
|
||||
submitcheck2 = dateValidcheck(this);
|
||||
if (submitcheck2) {
|
||||
findEndOfYear(startDate);
|
||||
calculateTotalAmount();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
// هنگام ورود مقدار به فیلد end
|
||||
$('#end').on('input',
|
||||
function() {
|
||||
const endDate = this.value;
|
||||
if (endDate.length == 10) {
|
||||
submitcheck3 = dateValidcheck(this);
|
||||
calculateTotalAmount();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
// هنگام ورود مقدار به فیلد amount
|
||||
$('#amount').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var contractAmount = $("#amount");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
contractAmount.on("keyup",
|
||||
function(e) {
|
||||
contractAmount.val(numeral(contractAmount.val()).format());
|
||||
});
|
||||
calculateTotalAmount();
|
||||
});
|
||||
$('#obligation').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var obligation = $("#obligation");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
obligation.on("keyup",
|
||||
function(e) {
|
||||
obligation.val(numeral(obligation.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
$('#totalAmount').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var totalAmount = $("#totalAmount");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
totalAmount.on("keyup",
|
||||
function(e) {
|
||||
totalAmount.val(numeral(totalAmount.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
$('#dailyCompenseation').on('input',
|
||||
function() {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var dailyCompenseation = $("#dailyCompenseation");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
dailyCompenseation.on("keyup",
|
||||
function(e) {
|
||||
dailyCompenseation.val(numeral(dailyCompenseation.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function findEndOfYear(date) {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: ajaxFindeEndOfYear,
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "start": date },
|
||||
|
||||
success: function(response) {
|
||||
|
||||
$('#end').val(response.end);
|
||||
|
||||
},
|
||||
failure: function(response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
var start1valid = false;
|
||||
|
||||
function dateValidcheck(inputField1) {
|
||||
|
||||
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = inputField1.value;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
let s1, s2;
|
||||
for (var i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 4) {
|
||||
s1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 7) {
|
||||
s2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
let yRes = y1 + y2 + y3 + y4;
|
||||
let year = parseInt(yRes);
|
||||
let mRes = m1 + m2;
|
||||
let month = parseInt(mRes);
|
||||
let dRes = d1 + d2;
|
||||
let day = parseInt(dRes);
|
||||
let fixResult = yRes + s1 + mRes + s2 + dRes;
|
||||
let test1 = checkEnValid(inputField1.value);
|
||||
|
||||
let isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(fixResult);
|
||||
|
||||
|
||||
if (isValid && test1) {
|
||||
inputField1.style.backgroundColor = '#a6e9a6';
|
||||
start1valid = true;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
if (inputField1.value != "") {
|
||||
inputField1.style.backgroundColor = '#f94c4c';
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
|
||||
start1valid = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return start1valid;
|
||||
|
||||
}
|
||||
|
||||
function checkEnValid(fixDate1) {
|
||||
|
||||
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function(str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = fixDate1;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
for (let i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
let yRes = y1 + y2 + y3 + y4;
|
||||
let year = parseInt(yRes);
|
||||
let mRes = m1 + m2;
|
||||
let month = parseInt(mRes);
|
||||
let dRes = d1 + d2;
|
||||
let day = parseInt(dRes);
|
||||
let kabiseh = false;
|
||||
if (month <= 6 && day > 31) {
|
||||
return false;
|
||||
} else if (month > 6 && month < 12 && day > 30) {
|
||||
return false;
|
||||
} else if (month === 12) {
|
||||
|
||||
switch (year) {
|
||||
case 1346:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1350:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1354:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1358:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1362:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1366:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1370:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1375:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1379:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1383:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1387:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1391:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1395:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1399:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1403:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1408:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1412:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1416:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1420:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1424:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1428:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1432:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1436:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1441:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1445:
|
||||
kabiseh = true;
|
||||
break;
|
||||
default:
|
||||
kabiseh = false;
|
||||
|
||||
}
|
||||
if (kabiseh == true && day > 30) {
|
||||
return false;
|
||||
} else if (kabiseh == false && day > 29) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,257 @@
|
||||
|
||||
$(document).ready(function () {
|
||||
const jobRelation = "بابت قرارداد مابین (روابط کار)";
|
||||
const taxAndFinancial = "بابت قرارداد مابین (حسابداری و مالیات)";
|
||||
const debtorOptions = $(
|
||||
`<option class="debtOption" value="0">انتخاب کنید...</option>
|
||||
<option class="debtOption" value = "${jobRelation}"> ${jobRelation} </option>
|
||||
<option class="debtOption" value = "${taxAndFinancial}"> ${taxAndFinancial} </option>
|
||||
<option class="debtOption" value = " بابت قراردادهای گذشته پرسنل" > بابت قراردادهای گذشته پرسنل </option>
|
||||
<option class="debtOption" value = "بابت پرونده" > بابت پرونده</option>
|
||||
<option class="debtOption" value = "بابت مبلغ بیمه کارگاه" > بابت مبلغ بیمه کارگاه </option>
|
||||
<option class="debtOption" value = "بابت مبلغ بیمه خویش فرما " > بابت مبلغ بیمه خویش فرما </option>
|
||||
<option class="debtOption" value = "بابت فیش کارگزاری " > بابت فیش کارگزاری </option>
|
||||
<option class="debtOption" value = "بابت بدهی از قرارداد قبل " > بابت بدهی از قرارداد قبل </option>
|
||||
<option class="debtOption" value = "بابت خرید" > بابت خرید </option>
|
||||
<option class="debtOption" value = "بابت بدهی سایر " > بابت بدهی سایر </option>
|
||||
`
|
||||
);
|
||||
const creditorOptions = $(
|
||||
`<option class="creditOption" value="0">انتخاب کنید...</option>
|
||||
<option class="creditOption" value = "${jobRelation}"> ${jobRelation} </option>
|
||||
<option class="creditOption" value = "${taxAndFinancial}"> ${taxAndFinancial} </option>
|
||||
<option class="creditOption" value = " بابت قراردادهای گذشته پرسنل" > بابت قراردادهای گذشته پرسنل </option>
|
||||
<option class="creditOption" value = "بابت پرونده" > بابت پرونده</option>
|
||||
<option class="creditOption" value = "بابت مبلغ بیمه کارگاه" > بابت مبلغ بیمه کارگاه </option>
|
||||
<option class="creditOption" value = "بابت مبلغ بیمه خویش فرما " > بابت مبلغ بیمه خویش فرما </option>
|
||||
<option class="creditOption" value = "بابت فیش کارگزاری " > بابت فیش کارگزاری </option>
|
||||
<option class="creditOption" value = "بابت بدهی از قرارداد قبل " > بابت بدهی از قرارداد قبل </option>
|
||||
<option class="creditOption" value = "بابت بدهی سایر " > بابت بدهی سایر </option>
|
||||
<option class="creditOption" value = "بابت حق بیمه کارگاه" > بابت حق بیمه کارگاه </option>
|
||||
<option class="creditOption" value = "بابت حق بیمه خویش فرما" > بابت حق بیمه خویش فرما </option>
|
||||
<option class="creditOption" value = "بابت خرید" > بابت خرید </option>
|
||||
<option class="creditOption" value = "بابت خدمات" > بابت خدمات </option>
|
||||
<option class="creditOption" value = "بابت تخفیف" > بابت تخفیف </option>`
|
||||
);
|
||||
|
||||
const typeOfTransAction = $('#EditTransactionBody .options-select').val();
|
||||
const defaultSelect = $('#decriptioOption').val();
|
||||
if (typeOfTransAction == "debt") {
|
||||
$("#EditTransactionBody .options-select2").append(debtorOptions);
|
||||
$("#EditTransactionBody .options-select2").val(defaultSelect).change();
|
||||
$("#EditTransactionBody .debtor").prop("disabled", false);
|
||||
$("#EditTransactionBody .creditor").prop("disabled", true);
|
||||
$("#EditTransactionBody .creditor").val("").removeClass("errored");
|
||||
} else {
|
||||
$("#EditTransactionBody .options-select2").append(creditorOptions);
|
||||
$("#EditTransactionBody .options-select2").val(defaultSelect).change();
|
||||
$("#EditTransactionBody .creditor").prop("disabled", false);
|
||||
$("#EditTransactionBody .debtor").prop("disabled", true);
|
||||
$("#EditTransactionBody .debtor").val("").removeClass("errored");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//تاریخ امروز
|
||||
$('.currentDay').on("click",
|
||||
function () {
|
||||
$('#todayFa').val($('#hiddenToday').val());
|
||||
});
|
||||
|
||||
//فعال سازی دکمه ی اینتر برای ثبت نهایی
|
||||
$('.EditTransactionForm .form-control').keypress(function (event) {
|
||||
if (event.which === 13) {
|
||||
checkNecessaryInputs();
|
||||
}
|
||||
});
|
||||
let jobRelation = "بابت قرارداد مابین (روابط کار)";
|
||||
let taxAndFinancial = "بابت قرارداد مابین (حسابداری و مالیات)";
|
||||
//غیرفعال یا فعالسازی اینپوت های بدهکار و بستانکار , آپشن های پرداخت / ایجاد بدهی
|
||||
let debtorOptions = $(
|
||||
`<option class="debtOption" value="0">انتخاب کنید...</option>
|
||||
<option class="debtOption" value = "${jobRelation}"> ${jobRelation} </option>
|
||||
<option class="debtOption" value = "${taxAndFinancial}"> ${taxAndFinancial} </option>
|
||||
<option class="debtOption" value = " بابت قراردادهای گذشته پرسنل" > بابت قراردادهای گذشته پرسنل </option>
|
||||
<option class="debtOption" value = "بابت پرونده" > بابت پرونده</option>
|
||||
<option class="debtOption" value = "بابت مبلغ بیمه کارگاه" > بابت مبلغ بیمه کارگاه </option>
|
||||
<option class="debtOption" value = "بابت مبلغ بیمه خویش فرما " > بابت مبلغ بیمه خویش فرما </option>
|
||||
<option class="debtOption" value = "بابت فیش کارگزاری " > بابت فیش کارگزاری </option>
|
||||
<option class="debtOption" value = "بابت بدهی از قرارداد قبل " > بابت بدهی از قرارداد قبل </option>
|
||||
<option class="debtOption" value = "بابت خرید" > بابت خرید </option>
|
||||
<option class="debtOption" value = "بابت بدهی سایر " > بابت بدهی سایر </option>
|
||||
`
|
||||
);
|
||||
let creditorOptions = $(
|
||||
`<option class="creditOption" value="0">انتخاب کنید...</option>
|
||||
<option class="creditOption" value = "${jobRelation}"> ${jobRelation} </option>
|
||||
<option class="creditOption" value = "${taxAndFinancial}"> ${taxAndFinancial} </option>
|
||||
<option class="creditOption" value = " بابت قراردادهای گذشته پرسنل" > بابت قراردادهای گذشته پرسنل </option>
|
||||
<option class="creditOption" value = "بابت پرونده" > بابت پرونده</option>
|
||||
<option class="creditOption" value = "بابت مبلغ بیمه کارگاه" > بابت مبلغ بیمه کارگاه </option>
|
||||
<option class="creditOption" value = "بابت مبلغ بیمه خویش فرما " > بابت مبلغ بیمه خویش فرما </option>
|
||||
<option class="creditOption" value = "بابت فیش کارگزاری " > بابت فیش کارگزاری </option>
|
||||
<option class="creditOption" value = "بابت بدهی از قرارداد قبل " > بابت بدهی از قرارداد قبل </option>
|
||||
<option class="creditOption" value = "بابت بدهی سایر " > بابت بدهی سایر </option>
|
||||
<option class="creditOption" value = "بابت حق بیمه کارگاه" > بابت حق بیمه کارگاه </option>
|
||||
<option class="creditOption" value = "بابت حق بیمه خویش فرما" > بابت حق بیمه خویش فرما </option>
|
||||
<option class="creditOption" value = "بابت خرید" > بابت خرید </option>
|
||||
<option class="creditOption" value = "بابت خدمات" > بابت خدمات </option>
|
||||
<option class="creditOption" value = "بابت تخفیف" > بابت تخفیف </option>`
|
||||
);
|
||||
$("#EditTransactionBody .options-select").change(function () {
|
||||
const selectedOption = $(this).val();
|
||||
$("#EditTransactionBody .options-select2").html("");
|
||||
if (selectedOption == "debt") {
|
||||
$("#EditTransactionBody .options-select2").append(debtorOptions);
|
||||
$("#EditTransactionBody .debtor").prop("disabled", false);
|
||||
$("#EditTransactionBody .creditor").prop("disabled", true);
|
||||
$("#EditTransactionBody .creditor").val("").removeClass("errored");
|
||||
} else if (selectedOption == "credit") {
|
||||
$("#EditTransactionBody .options-select2").append(creditorOptions);
|
||||
$("#EditTransactionBody .creditor").prop("disabled", false);
|
||||
$("#EditTransactionBody .debtor").prop("disabled", true);
|
||||
$("#EditTransactionBody .debtor").val("").removeClass("errored");
|
||||
} else {
|
||||
$("#EditTransactionBody .creditor").val("").prop("disabled", true);
|
||||
$("#EditTransactionBody .debtor").val("").prop("disabled", true);
|
||||
}
|
||||
});
|
||||
|
||||
//غیرفعال کردن datepicker پس از بستن مودال
|
||||
$("#close , .close").on('click',
|
||||
function () {
|
||||
$(".datepicker-container").hide();
|
||||
});
|
||||
$(document).on("click",
|
||||
function (event) {
|
||||
const target = $(event.target);
|
||||
if (!target.is("#EditTransactionBody") && !target.is("#EditTransactionBody *")
|
||||
) {
|
||||
$(".datepicker-container").hide();
|
||||
}
|
||||
});
|
||||
|
||||
//تنظیمات بخش های پول
|
||||
$('#EditTransactionBody #debtInput').on('input',
|
||||
function () {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var contractAmount = $("#EditTransactionBody #debtInput");
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
contractAmount.on("keyup",
|
||||
function (e) {
|
||||
contractAmount.val(numeral(contractAmount.val()).format());
|
||||
});
|
||||
});
|
||||
$('#EditTransactionBody #creditInput').on('input',
|
||||
function () {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var contractAmount = $("#EditTransactionBody #creditInput");
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
contractAmount.on("keyup",
|
||||
function (e) {
|
||||
contractAmount.val(numeral(contractAmount.val()).format());
|
||||
});
|
||||
});
|
||||
|
||||
// چک کردن اینپوت های ضروری هنگام ثبت
|
||||
function checkNecessaryInputs() {
|
||||
if ($("#EditTransactionBody .persianDateInput").val().length < 10) {
|
||||
$("#EditTransactionBody .persianDateInput").addClass("errored");
|
||||
} else {
|
||||
$("#EditTransactionBody .persianDateInput").removeClass("errored");
|
||||
}
|
||||
const selectedOption = $("#EditTransactionBody .options-select").val();
|
||||
const selectedOption2 = $("#EditTransactionBody .options-select2").val();
|
||||
if (selectedOption == 0) {
|
||||
$("#EditTransactionBody .options-select").addClass("errored");
|
||||
} else {
|
||||
$("#EditTransactionBody .options-select").removeClass("errored");
|
||||
}
|
||||
if (selectedOption2 == 0 || selectedOption2 == null) {
|
||||
$("#EditTransactionBody .options-select2").addClass("errored");
|
||||
} else {
|
||||
$("#EditTransactionBody .options-select2").removeClass("errored");
|
||||
}
|
||||
|
||||
if (selectedOption == "debt" && $("#EditTransactionBody .debtor").val() == "") {
|
||||
$("#EditTransactionBody .debtor").addClass("errored");
|
||||
} else {
|
||||
$("#EditTransactionBody .debtor").removeClass("errored");
|
||||
}
|
||||
if (selectedOption == "credit" && $("#EditTransactionBody .creditor").val() == "" && $("#EditTransactionBody .creditor").prop("disabled") == false) {
|
||||
$("#EditTransactionBody .creditor").addClass("errored");
|
||||
} else {
|
||||
$("#EditTransactionBody .creditor").removeClass("errored");
|
||||
}
|
||||
|
||||
if ($('#EditTransactionBody .errored').length > 0) {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', "لطفا موارد اجباری را تکمیل کنید.");
|
||||
} else {
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: ajaxEditSave,
|
||||
data: {
|
||||
"id": $('#transactionId').val(),
|
||||
"tDateFa": $("#EditTransactionBody .persianDateInput").val(),
|
||||
"typeOfTransaction": $("#EditTransactionBody .options-select").val(),
|
||||
"descriptionOption": $("#EditTransactionBody .options-select2").val(),
|
||||
"description": $('#desc').val(),
|
||||
"deptorString": $("#EditTransactionBody .debtor").val(),
|
||||
"creditorString": $("#EditTransactionBody .creditor").val()
|
||||
|
||||
},
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
window.location.reload();
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
failure: function (response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
}); //endOf Ajax
|
||||
}
|
||||
} //endOfFunction
|
||||
|
||||
|
||||
// چک کردن درستی تاریخ وارد شده
|
||||
$("#EditTransactionBody .persianDateInput").on('keyup',
|
||||
function () {
|
||||
if (event.which !== 8 && event.which !== 46) {
|
||||
let value = $(this).val();
|
||||
const lengthValue = value.length;
|
||||
if (lengthValue === 4) {
|
||||
value += '/';
|
||||
}
|
||||
if (lengthValue === 7) {
|
||||
value += '/';
|
||||
}
|
||||
$(this).val(value);
|
||||
}
|
||||
});
|
||||
$("#EditTransactionBody .persianDateInput").on("keydown",
|
||||
function (event) {
|
||||
const keyCode = event.which || event.keyCode;
|
||||
const isDigit = (keyCode >= 48 && keyCode <= 57) || (keyCode >= 96 && keyCode <= 105);
|
||||
const isControlKey = (keyCode === 8) || (keyCode === 9) || (keyCode === 13) || (keyCode === 35) || (keyCode === 36) || (keyCode === 37) || (keyCode === 39) || (keyCode === 46);
|
||||
if (!isDigit && !isControlKey) {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
$("#EditTransactionBody .persianDateInput").on('blur',
|
||||
function () {
|
||||
const value = $(this).val();
|
||||
const lengthValue = value.length;
|
||||
if (lengthValue == 10) {
|
||||
if (!dateValidCheck(this)) {
|
||||
$(this).addClass("errored");
|
||||
} else {
|
||||
$(this).removeClass("errored");
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,632 @@
|
||||
var submitcheck1 = true;
|
||||
var submitcheck2 = true;
|
||||
var submitcheck3 = true;
|
||||
|
||||
|
||||
$('.add_project_file').click(function (e) {
|
||||
e.preventDefault();
|
||||
const a = ($(".items").length) / 4;
|
||||
const html = `<div class="row">
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> نوع شماره </label>
|
||||
<select class="form-control items" data-phonetype="${a}" name="ContactInformationList[${a}].PhoneType">'
|
||||
<option value=""> </option>'
|
||||
<option value="شماره همراه"> شماره همراه </option>
|
||||
<option value="شماره ثابت"> شماره ثابت </option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> سمت </label>
|
||||
<select class="form-control items" name="ContactInformationList[${a}].Position">
|
||||
<option value=""> </option>
|
||||
<option value="طرف قرارداد"> طرف قرارداد </option>
|
||||
<option value="کارفرما"> کارفرما </option>
|
||||
<option value="مدیرعامل"> مدیرعامل </option>
|
||||
<option value="نماینده کارفرما"> نماینده کارفرما </option>
|
||||
<option value="مالی"> مالی </option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> نام و نام خانوادگی </label>
|
||||
<input type="text" class="form-control items" name="ContactInformationList[${a}].FnameLname">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" style="padding: 0 0;">
|
||||
<div style="display: flex;align-items: center; ">
|
||||
<div class="form-group">
|
||||
<label class="control-label"> شماره تماس </label>
|
||||
<input type="text" class="form-control items" data-mobile="${a}" onkeyup="mobileValidation(this);" asp-for="ContactInformationList[${a}].PhoneNumber">
|
||||
<span data-mobile-err="${a}" style="font-size: 8px; color: red"></span>
|
||||
<input type="checkbox" onclick="checking(this);" data-checkbox="${a}" name="check" style="position: relative; top: -28px; right:99px;"/>
|
||||
<input type="hidden" data-checkboxStr="${a}" asp-for="ContactInformationList[${a}].SendSmsString"/>
|
||||
</div>
|
||||
<a href="#" class="remove_project_file" data-remove="${a}" style="padding: 0 3px;"><i style="color: red;font-size: 15px;" class="ion-close-circled pull-left"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
$(".project_images").append(html);
|
||||
|
||||
});
|
||||
|
||||
//mobile validation
|
||||
function mobileValidation(el) {
|
||||
$(el).on("input",
|
||||
function () {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
});
|
||||
|
||||
|
||||
const contactRow = $(el).closest('div.row');
|
||||
const elData = $(el).attr("data-mobile");
|
||||
|
||||
let selectedPhoneType;
|
||||
contactRow.find("select").each(function () {
|
||||
if ($(this).attr("data-phonetype") == elData) {
|
||||
selectedPhoneType = $(this).prop("selectedIndex");
|
||||
}
|
||||
});
|
||||
|
||||
if (selectedPhoneType == 1) {
|
||||
if ($(el).val().length < 11 || $(el).val().length > 11) {
|
||||
|
||||
$(el).addClass("invalidMobile");
|
||||
contactRow.find("span[data-mobile-err]").text("شماره همراه 11 رقمی وارد کنید");
|
||||
} else {
|
||||
|
||||
$(el).removeClass("invalidMobile");
|
||||
contactRow.find("span[data-mobile-err]").text("");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Remove parent of 'remove' link when link is clicked.
|
||||
$('.project_images').on('click',
|
||||
'.remove_project_file',
|
||||
function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$(this).closest('div.row').remove();
|
||||
});
|
||||
|
||||
//checkbox value copy to string input
|
||||
function checking(el) {
|
||||
const datacheckbox = $(el).attr("data-checkbox");
|
||||
const contactRow = $(el).closest('div.row');
|
||||
if ($(el).is(":checked")) {
|
||||
let selectedPhoneType;
|
||||
contactRow.find("select").each(function () {
|
||||
if ($(this).attr("data-phonetype") == datacheckbox) {
|
||||
selectedPhoneType = $(this).prop("selectedIndex");
|
||||
}
|
||||
});
|
||||
if (selectedPhoneType == 1) {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("true");
|
||||
} else {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("false");
|
||||
$(el).prop("checked", false);
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "ابتدا نوع شماره را همراه انتخاب کنید");
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
$(`input[data-checkboxStr='${datacheckbox}']`).val("false");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function setValueAdded() {
|
||||
$('input[name="checkTaxAdded"]').val("true");
|
||||
calculateTotalAmount();
|
||||
|
||||
}
|
||||
|
||||
function removeValueAdded() {
|
||||
$('input[name="checkTaxAdded"]').val("false");
|
||||
calculateTotalAmount();
|
||||
|
||||
}
|
||||
|
||||
//ارزش افزوده
|
||||
$('#officialStatus').on('change',
|
||||
function () {
|
||||
if ($(this).val() == "Official") {
|
||||
|
||||
const tax = `<div class="col-xs-12">
|
||||
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
|
||||
|
||||
<div class="radio-box" style=" display: flex">
|
||||
<label class="radio-label" style="background-color: #fad7d7;
|
||||
padding: 5px;
|
||||
border-radius: 5px;"> مالیات بر ارزش افزوده </label>
|
||||
<span> </span> <span> </span> <span> </span> <span> </span>
|
||||
<div class="radio-input">
|
||||
<label>
|
||||
<input type="radio" style="margin: 10px 0px;" value="true" onclick="setValueAdded()" asp-for="HasValueAddedTax" name="HasValueAddedTax"><span> </span> <span>دارد</span>
|
||||
|
||||
</label>
|
||||
<span> </span> <span> </span> <span> </span> <span> </span>
|
||||
<label>
|
||||
<input type="radio" style="margin: 10px 0px;" value="false" onclick="removeValueAdded()" asp-for="HasValueAddedTax" name="HasValueAddedTax"><span> </span> <span>ندارد</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</fieldset>
|
||||
</div>`;
|
||||
$('#valueAdded').append(tax);
|
||||
$('#valueAdded').show();
|
||||
} else {
|
||||
$('#valueAdded').html('');
|
||||
$('#valueAdded').hide();
|
||||
$('input[name="checkTaxAdded"]').val("false");
|
||||
calculateTotalAmount();
|
||||
}
|
||||
});
|
||||
|
||||
// تابع برای محاسبه و نمایش مقدار در فیلد totalAmount
|
||||
function calculateTotalAmount() {
|
||||
const start = $('#start').val();
|
||||
|
||||
const end = $('#end').val();
|
||||
|
||||
const amount = $('#amount').val();
|
||||
|
||||
|
||||
const checkTax = $('input[name="checkTaxAdded"]').val();
|
||||
|
||||
let isTaxAdded = "false";
|
||||
if ($('#officialStatus').val() == "Official") {
|
||||
|
||||
if (checkTax == "true") {
|
||||
isTaxAdded = "true";
|
||||
} else {
|
||||
isTaxAdded = "false";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
console.log($('#officialStatus').val());
|
||||
if (start.length == 10 && end.length == 10 && amount.length > 1) {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: ajaxCalculateTotalAmount,
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "start": start, "end": end, "amount": amount, "valueAddedtax": isTaxAdded },
|
||||
|
||||
success: function (response) {
|
||||
|
||||
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
const compute = numeral(response.totalAmount).format();
|
||||
const finalAmount = numeral(response.finalAmount).format();
|
||||
const valueAddedTax = numeral(response.valueAddedTax).format();
|
||||
$('#obligation').val(compute);
|
||||
$('#totalAmount').val(compute);
|
||||
$('#finalAmountFake').val(finalAmount);
|
||||
$('#finalAmount').val(finalAmount);
|
||||
$('#valueAddedTax').val(valueAddedTax);
|
||||
$('#valueAddedTaxFake').val(valueAddedTax);
|
||||
|
||||
},
|
||||
failure: function (response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function () {
|
||||
$(".date").mask("0000/00/00");
|
||||
$('#sendData').on('click',
|
||||
function (e) {
|
||||
//var y = document.getElementById('city2');
|
||||
//var city1 = y.options[y.selectedIndex].text;
|
||||
|
||||
//if (city1 == "ویرایش نام شهر" || city1 == "شهرستان") {
|
||||
|
||||
// document.getElementById('hidencity').value = " ";
|
||||
|
||||
//} else {
|
||||
// document.getElementById('hidencity').value = city1;
|
||||
//}
|
||||
|
||||
|
||||
//var x = document.getElementById('state');
|
||||
//var state1 = x.options[x.selectedIndex].text;
|
||||
//var state2 = x.options[x.selectedIndex].value;
|
||||
//if (state1 == "ویرایش نام استان") {
|
||||
// document.getElementById('hide1').value = state2;
|
||||
//} else {
|
||||
// document.getElementById('hide1').value = state1;
|
||||
//}
|
||||
|
||||
|
||||
const selectedcity = jQuery("#city2 option:selected").text();
|
||||
//if (selectedcity == "ویرایش نام شهر" || selectedcity == "شهرستان") {
|
||||
|
||||
// $('#copyCity').val("");
|
||||
|
||||
//} else {
|
||||
$('#copyCity').val(selectedcity);
|
||||
//}
|
||||
|
||||
|
||||
if (submitcheck1 === false || submitcheck2 === false || submitcheck3 === false) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
$('#finalAmountFake').val($('#finalAmount').val());
|
||||
$('#valueAddedTaxFake').val($('#valueAddedTax').val());
|
||||
$('input[name="checkTaxAdded"]').val(valueAddedTax);
|
||||
const state = document.getElementById('state').value;
|
||||
const citySelect = document.getElementById('copyCity').value;
|
||||
console.log(citySelect);
|
||||
|
||||
iranwebsv2(state);
|
||||
|
||||
$('#city2 option:contains("شهرستان")').text(citySelect);
|
||||
|
||||
$('#contractDate').on('change',
|
||||
function () {
|
||||
submitcheck1 = dateValidcheck(this);
|
||||
|
||||
});
|
||||
// هنگام ورود مقدار به فیلد start
|
||||
$('#start').on('input',
|
||||
function () {
|
||||
const startDate = this.value;
|
||||
if (startDate.length == 10) {
|
||||
submitcheck2 = dateValidcheck(this);
|
||||
if (submitcheck2) {
|
||||
findEndOfYear(startDate);
|
||||
calculateTotalAmount();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
// هنگام ورود مقدار به فیلد end
|
||||
$('#end').on('input',
|
||||
function () {
|
||||
const endDate = this.value;
|
||||
if (endDate.length == 10) {
|
||||
submitcheck3 = dateValidcheck(this);
|
||||
calculateTotalAmount();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
// هنگام ورود مقدار به فیلد amount
|
||||
$('#amount').on('input',
|
||||
function () {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var contractAmount = $("#amount");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
contractAmount.on("keyup",
|
||||
function (e) {
|
||||
contractAmount.val(numeral(contractAmount.val()).format());
|
||||
});
|
||||
calculateTotalAmount();
|
||||
});
|
||||
$('#obligation').on('input',
|
||||
function () {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var obligation = $("#obligation");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
obligation.on("keyup",
|
||||
function (e) {
|
||||
obligation.val(numeral(obligation.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
$('#totalAmount').on('input',
|
||||
function () {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var totalAmount = $("#totalAmount");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
totalAmount.on("keyup",
|
||||
function (e) {
|
||||
totalAmount.val(numeral(totalAmount.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
$('#dailyCompenseation').on('input',
|
||||
function () {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var dailyCompenseation = $("#dailyCompenseation");
|
||||
//setting format
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
dailyCompenseation.on("keyup",
|
||||
function (e) {
|
||||
dailyCompenseation.val(numeral(dailyCompenseation.val()).format());
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function findEndOfYear(date) {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: ajaxFindeEndOfYear,
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
data: { "start": date },
|
||||
|
||||
success: function (response) {
|
||||
|
||||
$('#end').val(response.end);
|
||||
|
||||
},
|
||||
failure: function (response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
var start1valid = false;
|
||||
|
||||
function dateValidcheck(inputField1) {
|
||||
|
||||
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function (str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = inputField1.value;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
let s1, s2;
|
||||
for (var i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 4) {
|
||||
s1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 7) {
|
||||
s2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
let yRes = y1 + y2 + y3 + y4;
|
||||
let year = parseInt(yRes);
|
||||
let mRes = m1 + m2;
|
||||
let month = parseInt(mRes);
|
||||
let dRes = d1 + d2;
|
||||
let day = parseInt(dRes);
|
||||
let fixResult = yRes + s1 + mRes + s2 + dRes;
|
||||
let test1 = checkEnValid(inputField1.value);
|
||||
|
||||
let isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(fixResult);
|
||||
|
||||
|
||||
if (isValid && test1) {
|
||||
inputField1.style.backgroundColor = '#a6e9a6';
|
||||
start1valid = true;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
if (inputField1.value != "") {
|
||||
inputField1.style.backgroundColor = '#f94c4c';
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
|
||||
start1valid = false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return start1valid;
|
||||
|
||||
}
|
||||
|
||||
function checkEnValid(fixDate1) {
|
||||
|
||||
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
|
||||
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
|
||||
fixNumbers = function (str) {
|
||||
if (typeof str === 'string') {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
}
|
||||
return str;
|
||||
};
|
||||
let getdate = fixDate1;
|
||||
|
||||
let m1, m2;
|
||||
let y1, y2, y3, y4;
|
||||
let d1, d2;
|
||||
for (let i = 0; i < getdate.length; i++) {
|
||||
if (i === 0) {
|
||||
y1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 1) {
|
||||
y2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 2) {
|
||||
y3 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 3) {
|
||||
y4 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 5) {
|
||||
m1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 6) {
|
||||
m2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 8) {
|
||||
d1 = fixNumbers(getdate[i]);
|
||||
}
|
||||
if (i === 9) {
|
||||
d2 = fixNumbers(getdate[i]);
|
||||
}
|
||||
|
||||
}
|
||||
let yRes = y1 + y2 + y3 + y4;
|
||||
let year = parseInt(yRes);
|
||||
let mRes = m1 + m2;
|
||||
let month = parseInt(mRes);
|
||||
let dRes = d1 + d2;
|
||||
let day = parseInt(dRes);
|
||||
let kabiseh = false;
|
||||
if (month <= 6 && day > 31) {
|
||||
return false;
|
||||
} else if (month > 6 && month < 12 && day > 30) {
|
||||
return false;
|
||||
} else if (month === 12) {
|
||||
|
||||
switch (year) {
|
||||
case 1346:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1350:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1354:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1358:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1362:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1366:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1370:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1375:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1379:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1383:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1387:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1391:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1395:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1399:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1403:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1408:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1412:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1416:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1420:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1424:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1428:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1432:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1436:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1441:
|
||||
kabiseh = true;
|
||||
break;
|
||||
case 1445:
|
||||
kabiseh = true;
|
||||
break;
|
||||
default:
|
||||
kabiseh = false;
|
||||
|
||||
}
|
||||
if (kabiseh == true && day > 30) {
|
||||
return false;
|
||||
} else if (kabiseh == false && day > 29) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,495 @@
|
||||
|
||||
$(document).ready(function () {
|
||||
$(".debtor").prop("disabled", true);
|
||||
$(".creditor").prop("disabled", true);
|
||||
});
|
||||
|
||||
//رنگ بندی ستون های جمع مبلغ
|
||||
let cols = $(".totalBalance").val();
|
||||
if (cols > 0) {
|
||||
$(".totalBalanceTd").css("color", "#9f210c");
|
||||
} else {
|
||||
$(".totalBalanceTd").css("color", "#2b8f1b");
|
||||
}
|
||||
$('.main-table').find(".balance").each(function () {
|
||||
const balance = $(this).closest(".remainder-td");
|
||||
const value = $(this).val();
|
||||
if (value > 0) {
|
||||
balance.css("color", "#9f210c");
|
||||
} else {
|
||||
balance.css("color", "#2b8f1b");
|
||||
}
|
||||
});
|
||||
|
||||
//فعال سازی دکمه ی اینتر برای ثبت نهایی
|
||||
$('.panelRequiredFields .form-control').keypress(function (event) {
|
||||
if (event.which === 13) {
|
||||
checkNecessaryInputs();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//بدست آوردن تاریخ امروز
|
||||
$('.currentDay').on("click",
|
||||
function () {
|
||||
console.log("clicked");
|
||||
$.ajax({
|
||||
async: false,
|
||||
url: ajaxCurrentDay,
|
||||
type: "Get",
|
||||
dataType: 'json',
|
||||
success: function (response) {
|
||||
|
||||
$('#today').val(response.datOfToday);
|
||||
|
||||
},
|
||||
failure: function (response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
}); //endOf Ajax
|
||||
});
|
||||
//صفحه بندی
|
||||
|
||||
//صفحه اول
|
||||
$('.first-page-number').on("click",
|
||||
function () {
|
||||
pagination(1);
|
||||
$("input[name=currentPageNumber]").val(1);
|
||||
});
|
||||
//صفحه اول
|
||||
$('.first-page-text').on("click",
|
||||
function () {
|
||||
pagination(1);
|
||||
$("input[name=currentPageNumber]").val(1);
|
||||
});
|
||||
//صفحه قبل
|
||||
$('.prev-page').on("click",
|
||||
function () {
|
||||
const firstPageNumber = $("input[name=firtPageNumber]").val();
|
||||
|
||||
let currentPageNumber = $("input[name=currentPageNumber]").val();
|
||||
currentPageNumber = Number(currentPageNumber);
|
||||
currentPageNumber -= 1;
|
||||
if (currentPageNumber >= firstPageNumber) {
|
||||
$('.table-container').remove();
|
||||
|
||||
$("input[name=currentPageNumber]").val(currentPageNumber);
|
||||
pagination(currentPageNumber);
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
// اینتر بر روی عدد
|
||||
$("input[name=currentPageNumber]").on('keyup keypress',
|
||||
function (e) {
|
||||
const keyCode = e.keyCode || e.which;
|
||||
if (keyCode === 13) {
|
||||
e.preventDefault();
|
||||
const firstPageNumber = Number($("input[name=firtPageNumber]").val());
|
||||
const goToCurrentNumber = $(this).val();
|
||||
const lastPageNumber = Number($("input[name=lastPageNumber]").val());
|
||||
if (goToCurrentNumber >= firstPageNumber && goToCurrentNumber <= lastPageNumber) {
|
||||
pagination(goToCurrentNumber);
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
//صفحه بعد
|
||||
$('.next-page').on("click",
|
||||
function () {
|
||||
const lastPageNumber = $("input[name=lastPageNumber]").val();
|
||||
let currentPageNumber = $("input[name=currentPageNumber]").val();
|
||||
currentPageNumber = Number(currentPageNumber);
|
||||
currentPageNumber += 1;
|
||||
console.log(`cuntentPlusOne ${currentPageNumber}`);
|
||||
if (currentPageNumber <= lastPageNumber) {
|
||||
$('.table-container').remove();
|
||||
$("input[name=currentPageNumber]").val(currentPageNumber);
|
||||
pagination(currentPageNumber);
|
||||
}
|
||||
});
|
||||
|
||||
//صفحه آخر
|
||||
$(".last-page-text").on("click",
|
||||
function () {
|
||||
const lastPageNumber = $("input[name=lastPageNumber]").val();
|
||||
const goToLastPage = Number(lastPageNumber);
|
||||
$("input[name=currentPageNumber]").val(goToLastPage);
|
||||
pagination(goToLastPage);
|
||||
|
||||
});
|
||||
//صفحه آخر
|
||||
$(".last-page-number").on("click",
|
||||
function () {
|
||||
const lastPageNumber = $("input[name=lastPageNumber]").val();
|
||||
const goToLastPage = Number(lastPageNumber);
|
||||
$("input[name=currentPageNumber]").val(goToLastPage);
|
||||
pagination(goToLastPage);
|
||||
});
|
||||
|
||||
//Ajax Pagination
|
||||
function pagination(currentPageNumber) {
|
||||
const contractingPartyId = $('#contractingPartyId').val();
|
||||
$.ajax({
|
||||
async: false,
|
||||
url: ajaxPagination,
|
||||
data: {
|
||||
"id": contractingPartyId,
|
||||
"pageNumber": currentPageNumber
|
||||
},
|
||||
type: "Get",
|
||||
dataType: 'html',
|
||||
|
||||
|
||||
success: function (response) {
|
||||
|
||||
$('.table-panel').html(response);
|
||||
|
||||
},
|
||||
failure: function (response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
}); //endOf Ajax
|
||||
}
|
||||
|
||||
//غیرفعال یا فعالسازی اینپوت های بدهکار و بستانکار , آپشن های پرداخت / ایجاد بدهی
|
||||
let jobRelation = "بابت قرارداد مابین (روابط کار)";
|
||||
let taxAndFinancial = "بابت قرارداد مابین (حسابداری و مالیات)";
|
||||
let debtorOptions = $(
|
||||
`<option class="debtOption" value="0">انتخاب کنید...</option>
|
||||
<option class="debtOption" value = "${jobRelation}"> ${jobRelation} </option>
|
||||
<option class="debtOption" value = "${taxAndFinancial}"> ${taxAndFinancial} </option>
|
||||
<option class="debtOption" value = " بابت قراردادهای گذشته پرسنل" > بابت قراردادهای گذشته پرسنل </option>
|
||||
<option class="debtOption" value = "بابت پرونده" > بابت پرونده</option>
|
||||
<option class="debtOption" value = "بابت مبلغ بیمه کارگاه" > بابت مبلغ بیمه کارگاه </option>
|
||||
<option class="debtOption" value = "بابت مبلغ بیمه خویش فرما " > بابت مبلغ بیمه خویش فرما </option>
|
||||
<option class="debtOption" value = "بابت فیش کارگزاری " > بابت فیش کارگزاری </option>
|
||||
<option class="debtOption" value = "بابت بدهی از قرارداد قبل " > بابت بدهی از قرارداد قبل </option>
|
||||
<option class="debtOption" value = "بابت خرید" > بابت خرید </option>
|
||||
<option class="debtOption" value = "بابت بدهی سایر " > بابت بدهی سایر </option>
|
||||
`
|
||||
);
|
||||
let creditorOptions = $(
|
||||
`<option class="creditOption" value="0">انتخاب کنید...</option>
|
||||
<option class="creditOption" value = "${jobRelation}"> ${jobRelation} </option>
|
||||
<option class="creditOption" value = "${taxAndFinancial}"> ${taxAndFinancial} </option>
|
||||
<option class="creditOption" value = " بابت قراردادهای گذشته پرسنل" > بابت قراردادهای گذشته پرسنل </option>
|
||||
<option class="creditOption" value = "بابت پرونده" > بابت پرونده</option>
|
||||
<option class="creditOption" value = "بابت مبلغ بیمه کارگاه" > بابت مبلغ بیمه کارگاه </option>
|
||||
<option class="creditOption" value = "بابت مبلغ بیمه خویش فرما " > بابت مبلغ بیمه خویش فرما </option>
|
||||
<option class="creditOption" value = "بابت فیش کارگزاری " > بابت فیش کارگزاری </option>
|
||||
<option class="creditOption" value = "بابت بدهی از قرارداد قبل " > بابت بدهی از قرارداد قبل </option>
|
||||
<option class="creditOption" value = "بابت بدهی سایر " > بابت بدهی سایر </option>
|
||||
<option class="creditOption" value = "بابت حق بیمه کارگاه" > بابت حق بیمه کارگاه </option>
|
||||
<option class="creditOption" value = "بابت حق بیمه خویش فرما" > بابت حق بیمه خویش فرما </option>
|
||||
<option class="creditOption" value = "بابت خرید" > بابت خرید </option>
|
||||
<option class="creditOption" value = "بابت خدمات" > بابت خدمات </option>
|
||||
<option class="creditOption" value = "بابت تخفیف" > بابت تخفیف </option>`
|
||||
);
|
||||
|
||||
$(".options-select").change(function () {
|
||||
const selectedOption = $(this).val();
|
||||
$(".options-select2").html("");
|
||||
if (selectedOption == "debt") {
|
||||
$(".options-select2").append(debtorOptions);
|
||||
$(".debtor").prop("disabled", false);
|
||||
$(".creditor").prop("disabled", true);
|
||||
$(".creditor").val("").removeClass("errored");
|
||||
} else if (selectedOption == "credit") {
|
||||
$(".options-select2").append(creditorOptions);
|
||||
$(".creditor").prop("disabled", false);
|
||||
$(".debtor").prop("disabled", true);
|
||||
$(".debtor").val("").removeClass("errored");
|
||||
} else {
|
||||
$(".creditor").val("").prop("disabled", true);
|
||||
$(".debtor").val("").prop("disabled", true);
|
||||
}
|
||||
});
|
||||
|
||||
//تنظیمات بخش های پول
|
||||
$('#debtInput').on('input',
|
||||
function () {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var contractAmount = $("#debtInput");
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
contractAmount.on("keyup",
|
||||
function (e) {
|
||||
contractAmount.val(numeral(contractAmount.val()).format());
|
||||
});
|
||||
});
|
||||
$('#creditInput').on('input',
|
||||
function () {
|
||||
this.value = this.value.replace(/[^\d]/, '');
|
||||
var contractAmount = $("#creditInput");
|
||||
numeral.defaultFormat("0,0 تومان");
|
||||
contractAmount.on("keyup",
|
||||
function (e) {
|
||||
contractAmount.val(numeral(contractAmount.val()).format());
|
||||
});
|
||||
});
|
||||
|
||||
//لرزیدن دکمه ها
|
||||
$(".op-container a").on("mouseenter",
|
||||
function () {
|
||||
vibratingAnimation(this);
|
||||
});
|
||||
|
||||
function vibratingAnimation(element) {
|
||||
$(element).animate({ left: "-2px" }, 50)
|
||||
.animate({ left: "2px" }, 50)
|
||||
.animate({ left: "0px" }, 50);
|
||||
}
|
||||
|
||||
|
||||
//حذف
|
||||
function removeTransaction(Id) {
|
||||
swal({
|
||||
title: "توجه داشته باشید با تایید این پیام سند مورد نظر بطور کامل از بانک اطلاعات حذف می شود ",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "تایید",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: false
|
||||
},
|
||||
function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: ajaxRemoveTransaction,
|
||||
data: { "id": Id },
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
window.location.reload();
|
||||
}
|
||||
},
|
||||
failure: function (response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
}); //endOf Ajax
|
||||
} else {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// چک کردن اینپوت های ضروری هنگام ثبت
|
||||
function checkNecessaryInputs() {
|
||||
if ($(".persianDateInput").val().length < 10) {
|
||||
$(".persianDateInput").addClass("errored");
|
||||
} else {
|
||||
$(".persianDateInput").removeClass("errored");
|
||||
}
|
||||
var selectedOption = $(".options-select").val();
|
||||
var selectedOption2 = $(".options-select2").val();
|
||||
if (selectedOption == 0) {
|
||||
$(".options-select").addClass("errored");
|
||||
} else {
|
||||
$(".options-select").removeClass("errored");
|
||||
}
|
||||
if (selectedOption2 == 0 || selectedOption2 == null) {
|
||||
$(".options-select2").addClass("errored");
|
||||
} else {
|
||||
$(".options-select2").removeClass("errored");
|
||||
}
|
||||
|
||||
if (selectedOption == "debt" && $(".debtor").val() == "") {
|
||||
$(".debtor").addClass("errored");
|
||||
} else {
|
||||
$(".debtor").removeClass("errored");
|
||||
}
|
||||
if (selectedOption == "credit" && $(".creditor").val() == "" && $(".creditor").prop("disabled") == false) {
|
||||
$(".creditor").addClass("errored");
|
||||
} else {
|
||||
$(".creditor").removeClass("errored");
|
||||
}
|
||||
|
||||
if ($('.errored').length > 0) {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', "لطفا موارد اجباری را تکمیل کنید.");
|
||||
} else {
|
||||
$.Notification.autoHideNotify('success', 'top right', 'پیام سیستم ', "ثبت با موفقیت انجام شد.");
|
||||
var command = {};
|
||||
command.ContractingPartyId = $('#contractingPartyId').val();
|
||||
command.ContractingPartyName = $('#contractingPartyName').val();
|
||||
command.TdateFa = $(".persianDateInput").val();
|
||||
command.Description = $('#description').val();
|
||||
command.TypeOfTransaction = selectedOption;
|
||||
command.DeptorString = $(".debtor").val();
|
||||
command.Deptor = 0;
|
||||
command.Creditor = 0;
|
||||
command.CreditorString = $(".creditor").val();
|
||||
command.DescriptionOption = selectedOption2;
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: ajaxCreate,
|
||||
data: command,
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
console.log("success");
|
||||
window.location.reload();
|
||||
}
|
||||
},
|
||||
failure: function (response) {
|
||||
console.log(5, response);
|
||||
|
||||
}
|
||||
}); //endOf Ajax
|
||||
}
|
||||
}
|
||||
|
||||
// چک کردن درستی تاریخ وارد شده
|
||||
$(".persianDateInput").on('keyup',
|
||||
function () {
|
||||
if (event.which !== 8 && event.which !== 46) {
|
||||
let value = $(this).val();
|
||||
const lengthValue = value.length;
|
||||
if (lengthValue === 4) {
|
||||
value += '/';
|
||||
}
|
||||
if (lengthValue === 7) {
|
||||
value += '/';
|
||||
}
|
||||
$(this).val(value);
|
||||
}
|
||||
});
|
||||
if ($(window).width() < 768) {
|
||||
$(".persianDateInput").on("keydown",
|
||||
function (event) {
|
||||
const keyCode = event.which || event.keyCode;
|
||||
const isDigit = (keyCode >= 48 && keyCode <= 57) || (keyCode >= 96 && keyCode <= 105);
|
||||
const isControlKey = (keyCode === 8) || (keyCode === 9) || (keyCode === 13) || (keyCode === 229); // Adjusted for mobile
|
||||
const isSlash = (keyCode === 191); // Adjusted for mobile
|
||||
const isBackspace = (keyCode === 8); // Adjusted for mobile
|
||||
|
||||
if (!(isDigit || isControlKey || isSlash || isBackspace)) {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
}
|
||||
if ($(window).width() > 768) {
|
||||
$(".persianDateInput").on("keydown",
|
||||
function (event) {
|
||||
const keyCode = event.which || event.keyCode;
|
||||
const isDigit = (keyCode >= 48 && keyCode <= 57) || (keyCode >= 96 && keyCode <= 105);
|
||||
const isControlKey = (keyCode === 8) || (keyCode === 9) || (keyCode === 13) || (keyCode === 35) || (keyCode === 36) || (keyCode === 37) || (keyCode === 39) || (keyCode === 46);
|
||||
if (!isDigit && !isControlKey) {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(".persianDateInput").on('blur',
|
||||
function () {
|
||||
const value = $(this).val();
|
||||
const lengthValue = value.length;
|
||||
if (lengthValue == 10) {
|
||||
if (!dateValidCheck(this)) {
|
||||
$(this).addClass("errored");
|
||||
} else {
|
||||
$(this).removeClass("errored");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(window).on('resize',
|
||||
function () {
|
||||
if ($(window).width() < 768) {
|
||||
locateButtonContainerMobile();
|
||||
}
|
||||
});
|
||||
$(document).on("click",
|
||||
function (event) {
|
||||
const target = $(event.target);
|
||||
if (!target.closest(".buttons-container").length && !target.is(".employee-operations") && !target.is("#EditTransactionBody") && !target.is("#EditTransactionBody *")
|
||||
) {
|
||||
$(".buttons-container").removeClass("active").addClass("reverse");
|
||||
$(".more-buttons").removeClass("active");
|
||||
setTimeout(function () {
|
||||
$(".buttons-container").removeClass("reverse").css("display", "none");
|
||||
},
|
||||
200);
|
||||
}
|
||||
});
|
||||
$(".employee-operations").on("click",
|
||||
function () {
|
||||
console.log(1);
|
||||
if ($(window).width() < 768) {
|
||||
locateButtonContainerMobile();
|
||||
}
|
||||
var buttonsContainer = $(this).next(".buttons-container");
|
||||
if (buttonsContainer.hasClass("active")) {
|
||||
buttonsContainer.removeClass("active").addClass("reverse");
|
||||
$(this).closest(".more-buttons").removeClass("active");
|
||||
setTimeout(function () {
|
||||
buttonsContainer.removeClass("reverse").css("display", "none");
|
||||
},
|
||||
200);
|
||||
} else {
|
||||
buttonsContainer.removeClass("reverse").addClass("active").css("display", "flex");
|
||||
$(this).closest(".more-buttons").addClass("active");
|
||||
}
|
||||
|
||||
$(".buttons-container").not(buttonsContainer).removeClass("active reverse").css("display", "none");
|
||||
$(".more-buttons").not($(this).closest(".more-buttons")).removeClass("active");
|
||||
});
|
||||
|
||||
function locateButtonContainerMobile() {
|
||||
const beforePosition = $(".mobile-view .employee-operations").position();
|
||||
const containerWidth = $('.mobile-view .buttons-container').outerWidth();
|
||||
const containerHeight = $('.mobile-view .buttons-container').outerHeight();
|
||||
const containerLeft = beforePosition.left + $(".mobile-view .employee-operations").outerWidth() + 25;
|
||||
const containerTop = beforePosition.top + ($(".mobile-view .employee-operations").outerHeight() / 2) - (containerHeight / 2);
|
||||
$('.mobile-view .buttons-container').css({
|
||||
left: containerLeft,
|
||||
top: containerTop
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function removeBlocked(trId) {
|
||||
|
||||
swal({
|
||||
title: "توجه داشته باشید با تایید این پیام رنگ طوسی آیتم نظر حذف می شود ",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "تایید",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: true
|
||||
},
|
||||
function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: ajaxRemoveBlocked,
|
||||
data: { "id": Number(trId) },
|
||||
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
|
||||
success: function (response) {
|
||||
if (response.isSuccedded) {
|
||||
$(`#${trId}`).removeClass("blocked");
|
||||
$(`#closeBtn-${trId}`).remove();
|
||||
}
|
||||
},
|
||||
failure: function (response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
}); //endOf Ajax
|
||||
} else {
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,551 @@
|
||||
|
||||
$(document).ready(function () {
|
||||
$('.myLinkSign').click(function (event) {
|
||||
signAjax(event, this);
|
||||
});
|
||||
});
|
||||
|
||||
function signAjax(event, element) {
|
||||
event.preventDefault();
|
||||
|
||||
|
||||
if ($(element).find('input[name="unsigned"]').length > 0) { // اگر بایگانی نبود بود به ابایگانی اضافه شود
|
||||
swal({
|
||||
title: "آیا نسخه قرارداد منتخب را به بایگانی اضافه می کنید؟",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: true
|
||||
},
|
||||
function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
const signId = Number($(element).find('input[name="unsigned"]').val());
|
||||
var contractNoTd = $(`td[data-signId = '${signId}']`);
|
||||
|
||||
$.ajax({
|
||||
contentType: 'charset=utf-8',
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: signAjaxUrl,
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
data: { "Id": signId },
|
||||
success: function (response) {
|
||||
|
||||
if (response.isSuccedded) {
|
||||
$(element).find('span').replaceWith('<span class="hasSignature"> موجود </span>');
|
||||
|
||||
// تغییر name در تگ input
|
||||
$(element).find('input[name="unsigned"]').attr('name', 'signed');
|
||||
$(contractNoTd).removeClass("hasNoSignature").addClass("hasSignature");
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
} else if ($(element).find('input[name="signed"]').length > 0) { //اگر بایگانی شده بود از بایگانی حذف شود
|
||||
swal({
|
||||
title: "آیا قرارداد منتخب را از بایگانی حذف می کنید؟",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: true
|
||||
},
|
||||
function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
const unsignId = Number($(element).find('input[name="signed"]').val());
|
||||
var contractNoTd = $(`td[data-signId = '${unsignId}']`);
|
||||
$.ajax({
|
||||
contentType: 'charset=utf-8',
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: unSignAjax,
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
data: { "Id": unsignId },
|
||||
success: function (response) {
|
||||
|
||||
if (response.isSuccedded) {
|
||||
$(element).find('span').replaceWith('<span class="hasNoSignature"> ناموجود </span>');
|
||||
|
||||
// تغییر name در تگ input
|
||||
$(element).find('input[name="signed"]').attr('name', 'unsigned');
|
||||
$(contractNoTd).removeClass("hasSignature").addClass("hasNoSignature");
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//function hasContract(element) {
|
||||
// if ($(element).hasClass("hasSignature")){
|
||||
// $(element).removeClass("hasSignature").addClass("hasNoSignature");
|
||||
// $(element).text("ناموجود");
|
||||
// $(element).parent().next().addClass("hasNoSignature");
|
||||
// }else{
|
||||
// $(element).removeClass("hasNoSignature").addClass("hasSignature");
|
||||
// $(element).text("موجود");
|
||||
// $(element).parent().next().removeClass("hasNoSignature");
|
||||
// }
|
||||
|
||||
//}
|
||||
$(".activateContract-td span").on('click',
|
||||
function () {
|
||||
hasContract($(this));
|
||||
});
|
||||
$('.activer').on('change',
|
||||
function (e) {
|
||||
e.preventDefault();
|
||||
$('.search').click();
|
||||
|
||||
});
|
||||
$('#datatable').find("tbody tr").each(function () {
|
||||
const cols = $(this).find(".BalanceDouble").val();
|
||||
if (cols > 0) {
|
||||
$(this).find(".BalanceDoubleTd").css("color", "red");
|
||||
} else {
|
||||
$(this).find(".BalanceDoubleTd").css("color", "#009300");
|
||||
}
|
||||
});
|
||||
|
||||
//var a = window.location.href;
|
||||
//var res = a.split("#")[1];
|
||||
//if (res == "false") {
|
||||
// $.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " ابتدا یکی از فیلد های کارگاه، کارفرما، پرسنل را انتخاب نموده و سپس جستجو را بزنید ");
|
||||
//}
|
||||
|
||||
|
||||
|
||||
//if (document.getElementById("activing").selectedIndex == 1) {
|
||||
// $('.deact').remove();
|
||||
// $('.act').append(
|
||||
// ' <a class="btn btn-success pull-right m-rl-5 rad react" onclick="reActiveAll()">' + '<i class="fa faSize fa-rotate-left"></i>' + ' </a>'
|
||||
// );
|
||||
//}
|
||||
//if (document.getElementById("activing").selectedIndex == 2) {
|
||||
// $('.deact').remove();
|
||||
|
||||
|
||||
//}
|
||||
$('.persianDateInputa').persianDatepicker({
|
||||
format: 'YYYY/MM/DD',
|
||||
initialValueType: 'persian',
|
||||
initialValue: false,
|
||||
/* 'position': [-270, 25],*/
|
||||
autoClose: true,
|
||||
|
||||
calendar: {
|
||||
persian: {
|
||||
leapYearMode: 'astronomical'
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
$('.persianDateInputb').persianDatepicker({
|
||||
format: 'YYYY/MM/DD',
|
||||
initialValueType: 'persian',
|
||||
|
||||
initialValue: false,
|
||||
/*'position': [-270, 25],*/
|
||||
autoClose: true,
|
||||
|
||||
calendar: {
|
||||
persian: {
|
||||
leapYearMode: 'astronomical'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(".datepicker-container").hide();
|
||||
$(document).ready(function () {
|
||||
$('#datatable').dataTable({
|
||||
"lengthMenu": [[25, 10, 50, 100, -1], [25, 10, 50, 100, "All"]]
|
||||
});
|
||||
$(".datepicker-container").hide();
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function removeOneCheckout(aTag) {
|
||||
swal({
|
||||
title: "توجه داشته باشید با تایید این پیام قرارداد مورد نظر بطور کامل از بانک اطلاعات حذف می شود ",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "تایید",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: false
|
||||
},
|
||||
function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
/* $("a.dell").click();*/
|
||||
const inputTag = aTag.querySelector('input[name="checkoutId"]');
|
||||
const chekoutId = inputTag.value;
|
||||
let url3b = '';
|
||||
const u2 = `&id=${chekoutId}`;
|
||||
url3b = url3b + u2;
|
||||
const url2b = removeOneCheckoutUrl;
|
||||
window.location.href = url2b + url3b;
|
||||
} else {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function deactiveOneCheckout(Id, Balance) {
|
||||
|
||||
swal({
|
||||
title: "توجه داشته باشید با تایید این پیام قرارداد مورد نظر غیر فعال می شود ",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "تایید",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: false,
|
||||
customClass: "disableSwall"
|
||||
},
|
||||
function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
let url3b = '';
|
||||
const u2 = `&id=${Id}`;
|
||||
const u3 = `&balance=${Balance}`;
|
||||
url3b = url3b + u2 + u3;
|
||||
const url2b = deactiveOneCheckoutUrl;
|
||||
window.location.href = url2b + url3b;
|
||||
} else {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function reActiveAll() {
|
||||
if (document.getElementById("checkSelect").checked == false) {
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " هیچ قراردادی انتخاب نشده است ");
|
||||
} else {
|
||||
if (document.getElementById("sercheCheck").value == "false") {
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی قرارداد حداقل یکی از فیلدهای کارکاه یا پرسنل را انتخاب نموده و سپس جستجو را کلیک کنید ");
|
||||
|
||||
} else if (document.getElementById("sercheCheck").value == "true") {
|
||||
swal({
|
||||
title: "آیا فعال نمودن این قراردادها اطمینان دارید؟",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: false
|
||||
},
|
||||
function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
checkboxes2 = document.getElementsByName('foo');
|
||||
let url3b = '';
|
||||
for (var i2 = 0, n2 = checkboxes2.length; i2 < n2; i2++) {
|
||||
if (checkboxes2[i2].checked == true) {
|
||||
const u2 = `&ids=${checkboxes2[i2].value}`;
|
||||
url3b = url3b + u2;
|
||||
}
|
||||
}
|
||||
const url2b = reActiveAllUrl;
|
||||
window.location.href = url2b + url3b;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$(window).on('resize',
|
||||
function () {
|
||||
if ($(window).width() < 768) {
|
||||
locateButtonContainerMobile();
|
||||
}
|
||||
if ($(window).width() > 768) {
|
||||
locateButtonContainer();
|
||||
}
|
||||
});
|
||||
$(document).on("click",
|
||||
function (event) {
|
||||
const target = $(event.target);
|
||||
if (!target.closest(".buttons-container").length && !target.is(".employee-operations") && !target.is("#LeftWorkInsuranceForm") && !target.is("#LeftWorkInsuranceForm *") && !target.is("#LeftWorkForm") && !target.is("#LeftWorkForm *") && !target.is("#LeftWorkInsuranceForm #closing") && !target.is("#LeftWorkForm #close") && !target.is("#LeftWorkInsuranceForm .close") && !target.is("#LeftWorkForm .close") && !target.is("#LeftWorkInsuranceForm #btnSaveData") && !target.is("#LeftWorkForm #btnSaveData")
|
||||
) {
|
||||
$(".buttons-container").removeClass("active").addClass("reverse");
|
||||
$(".more-buttons").removeClass("active");
|
||||
setTimeout(function () {
|
||||
$(".buttons-container").removeClass("reverse").css("display", "none");
|
||||
},
|
||||
200);
|
||||
}
|
||||
});
|
||||
$(".employee-operations").on("click",
|
||||
function () {
|
||||
if ($(window).width() < 768) {
|
||||
locateButtonContainerMobile();
|
||||
}
|
||||
if ($(window).width() > 768) {
|
||||
locateButtonContainer();
|
||||
}
|
||||
var buttonsContainer = $(this).next(".buttons-container");
|
||||
if (buttonsContainer.hasClass("active")) {
|
||||
buttonsContainer.removeClass("active").addClass("reverse");
|
||||
$(this).closest(".more-buttons").removeClass("active");
|
||||
setTimeout(function () {
|
||||
buttonsContainer.removeClass("reverse").css("display", "none");
|
||||
},
|
||||
200);
|
||||
} else {
|
||||
buttonsContainer.removeClass("reverse").addClass("active").css("display", "flex");
|
||||
$(this).closest(".more-buttons").addClass("active");
|
||||
}
|
||||
|
||||
$(".buttons-container").not(buttonsContainer).removeClass("active reverse").css("display", "none");
|
||||
$(".more-buttons").not($(this).closest(".more-buttons")).removeClass("active");
|
||||
});
|
||||
|
||||
function locateButtonContainer() {
|
||||
const beforePosition = $(".screen-view .employee-operations").position();
|
||||
const containerWidth = $('.screen-view .buttons-container').outerWidth();
|
||||
const containerHeight = $('.screen-view .buttons-container').outerHeight();
|
||||
const containerLeft = beforePosition.left + $(".screen-view .employee-operations").outerWidth() + 20;
|
||||
const containerTop = beforePosition.top + ($(".screen-view .employee-operations").outerHeight() / 2) - (containerHeight / 2);
|
||||
$('.screen-view .buttons-container').css({
|
||||
left: containerLeft,
|
||||
top: containerTop
|
||||
});
|
||||
}
|
||||
|
||||
function locateButtonContainerMobile() {
|
||||
const beforePosition = $(".mobile-view .employee-operations").position();
|
||||
const containerWidth = $('.mobile-view .buttons-container').outerWidth();
|
||||
const containerHeight = $('.mobile-view .buttons-container').outerHeight();
|
||||
const containerLeft = beforePosition.left + $(".mobile-view .employee-operations").outerWidth() + 25;
|
||||
const containerTop = beforePosition.top + ($(".mobile-view .employee-operations").outerHeight() / 2) - (containerHeight / 2);
|
||||
$('.mobile-view .buttons-container').css({
|
||||
left: containerLeft,
|
||||
top: containerTop
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function showAmount(element) {
|
||||
|
||||
if ($(element).hasClass("fa-eye-slash")) {
|
||||
$(element).removeClass("fa-eye-slash");
|
||||
$(element).addClass("fa-eye");
|
||||
$('.amount').css("visibility", "hidden");
|
||||
} else if ($(element).hasClass("fa-eye")) {
|
||||
$(element).removeClass("fa-eye");
|
||||
$(element).addClass("fa-eye-slash");
|
||||
$('.amount').css("visibility", "visible");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function showTooltip(id) {
|
||||
|
||||
|
||||
// var id= $(this).attr("id").replace("p_","");
|
||||
|
||||
|
||||
console.log($(`tooltip_${id}`).hasClass('show'));
|
||||
|
||||
|
||||
if ($(`tooltip_${id}`).hasClass('show')) {
|
||||
$(`tooltip_${id}`).removeClass('show');
|
||||
$(`tooltip_${id}`).css({ 'visibility': 'hidden' });
|
||||
} else {
|
||||
$(`tooltip_${id}`).addClass('show');
|
||||
$(`tooltip_${id}`).css({ 'visibility': 'visible' });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function block(id) {
|
||||
$('.sweet-alert').removeClass("successSwall");
|
||||
$('.sweet-alert').removeClass("errorSwall");
|
||||
swal({
|
||||
title: "آیا از مسدود کردن این طرف حساب مطمئن هستید؟",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: true,
|
||||
closeOnCancel: true
|
||||
},
|
||||
function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: blockAjax,
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
data: { "id": id },
|
||||
success: function (response) {
|
||||
// console.log(response);
|
||||
if (response.isSuccedded) {
|
||||
bloked(id, response.blockTimes);
|
||||
|
||||
} else {
|
||||
|
||||
swal({
|
||||
title: response.message,
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
//confirmButtonText: "بستن",
|
||||
cancelButtonText: "بستن",
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: true,
|
||||
customClass: "errorSwall"
|
||||
});
|
||||
}
|
||||
},
|
||||
failure: function (response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function bloked(id, blocktime) {
|
||||
const blocked = `<a onclick="disableBlock(${id},${blocktime})" class="btn btn-inverse unblock pull-left rad btn-table" permission="10114" style="margin-left:5px" class="btn pull-right btn-danger btn-table">
|
||||
<span class="blockCount">${blocktime}</span>
|
||||
<i class="fa fa-minus-circle"></i><span>آنبلاک</span></a>`;
|
||||
|
||||
|
||||
$(`#blockspan${id}`).html('');
|
||||
$(`#blockspan${id}`).append(blocked);
|
||||
$(`.blockingTr${id}`).addClass("blockTr");
|
||||
$(`.blockingTr${id}`).addClass("progress-bar-striped");
|
||||
$(`.extention${id}`).addClass("disabled");
|
||||
$(`.deactive${id}`).addClass("disabled");
|
||||
$(`.edit${id}`).addClass("disabled");
|
||||
$(`.delete${id}`).addClass("disabled");
|
||||
|
||||
}
|
||||
|
||||
function disableBlock(id, blocktime) {
|
||||
$('.sweet-alert').removeClass("successSwall");
|
||||
$('.sweet-alert').removeClass("errorSwall");
|
||||
|
||||
|
||||
swal({
|
||||
title: "آیا میخواهید این طرف حساب را از حالت مسدود خارج نمایید؟ ",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بله",
|
||||
cancelButtonText: "خیر",
|
||||
closeOnConfirm: true,
|
||||
closeOnCancel: true
|
||||
},
|
||||
function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
|
||||
$.ajax({
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
type: 'POST',
|
||||
url: disableBlockAjax,
|
||||
headers: { "RequestVerificationToken": antiForgeryToken },
|
||||
data: { "id": id },
|
||||
success: function (response) {
|
||||
//console.log(response);
|
||||
if (response.isSuccedded) {
|
||||
$(`.blockingTr${id}`).removeClass("blockTr");
|
||||
$(`.blockingTr${id}`).removeClass("progress-bar-striped");
|
||||
$(`.extention${id}`).removeClass("disabled");
|
||||
$(`.deactive${id}`).removeClass("disabled");
|
||||
$(`.edit${id}`).removeClass("disabled");
|
||||
$(`.delete${id}`).removeClass("disabled");
|
||||
if (response.blockTimes == 1) {
|
||||
const orange = `<a onclick="block(${id})" class="btn btn-inverse bgOrange pull-left rad btn-table" permission="10114" style="margin-left:5px" class="btn pull-right btn-danger btn-table">
|
||||
<span class="blockCount">${response.blockTimes}</span> <i class="fa fa-minus-circle"></i><span>بلاک کردن</span></a>`;
|
||||
$(`#blockspan${id}`).html('');
|
||||
$(`#blockspan${id}`).append(orange);
|
||||
|
||||
|
||||
} else if (response.blockTimes >= 2) {
|
||||
const red = `<a onclick="block(${id})" class="btn btn-inverse bgRed pull-left rad btn-table" permission="10114" style="margin-left:5px" class="btn pull-right btn-danger btn-table">
|
||||
<span class="blockCount">${response.blockTimes}</span> <i class="fa fa-minus-circle"></i><span>بلاک کردن</span></a>`;
|
||||
|
||||
$(`#blockspan${id}`).html('');
|
||||
$(`#blockspan${id}`).append(red);
|
||||
|
||||
|
||||
}
|
||||
swal({
|
||||
title: response.message,
|
||||
text: "",
|
||||
type: "success",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
confirmButtonText: "بستن",
|
||||
//cancelButtonText: "خیر",
|
||||
closeOnConfirm: true,
|
||||
customClass: "successSwall"
|
||||
},
|
||||
function (isConfirm) {
|
||||
if (isConfirm) {
|
||||
$("#btnSearch").click();
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
|
||||
swal({
|
||||
title: response.message,
|
||||
// text: "برای حذف قرارداد، ابتدا تیک مربوط به امضای قرارداد را حذف نمایید.",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: "#DD6B55",
|
||||
//confirmButtonText: "بستن",
|
||||
cancelButtonText: "بستن",
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: true,
|
||||
customClass: "errorSwall"
|
||||
});
|
||||
}
|
||||
},
|
||||
failure: function (response) {
|
||||
console.log(5, response);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
@@ -850,8 +850,8 @@ function attachFileChangeHandler(fileInput, id, boxClass) {
|
||||
e.preventDefault();
|
||||
var fileInputFile = fileInput.files[0];
|
||||
|
||||
if (fileInputFile.size > 5000000) {
|
||||
showAlertMessage('.alert-msg', 'لطفا فایل حجم کمتر از 5 مگابایت را انتخاب کنید.', 3500);
|
||||
if (fileInputFile.size > 50000000) {
|
||||
showAlertMessage('.alert-msg', 'لطفا فایل حجم کمتر از 50 مگابایت را انتخاب کنید.', 3500);
|
||||
$(`#Command_Document${id}`).val('');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -546,8 +546,8 @@ function attachFileChangeHandler(fileInput, index) {
|
||||
$(fileInput).off('change').on('change', function () {
|
||||
let file = fileInput.files[0];
|
||||
|
||||
if (file.size > 5000000) {
|
||||
showAlertMessage('.alert-msg', 'لطفا فایل حجم کمتر از 5 مگابایت را انتخاب کنید.', 3500);
|
||||
if (file.size > 50000000) {
|
||||
showAlertMessage('.alert-msg', 'لطفا فایل حجم کمتر از 50 مگابایت را انتخاب کنید.', 3500);
|
||||
$(`#EditTask_Document${index}`).val('');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -626,8 +626,8 @@ function attachFileChangeHandler(fileInput, id, boxClass) {
|
||||
e.preventDefault();
|
||||
var fileInputFile = fileInput.files[0];
|
||||
|
||||
if (fileInputFile.size > 5000000) {
|
||||
showAlertMessage('.alert-msg', 'لطفا فایل حجم کمتر از 5 مگابایت را انتخاب کنید.', 3500);
|
||||
if (fileInputFile.size > 50000000) {
|
||||
showAlertMessage('.alert-msg', 'لطفا فایل حجم کمتر از 50 مگابایت را انتخاب کنید.', 3500);
|
||||
$(`#Command_Document${id}`).val('');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -147,6 +147,7 @@ function SaveDataAjax() {
|
||||
var employeeSelect = $('#employeeSelect').val();
|
||||
var Amount = $('#Amount ');
|
||||
var SalaryDateTime = $('#SalaryDateTime');
|
||||
var CalculationDateTime = $('#CalculationDateTime');
|
||||
|
||||
if (employeeSelect.length === 0) {
|
||||
$('.alert-msg').show();
|
||||
@@ -184,6 +185,19 @@ function SaveDataAjax() {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!CalculationDateTime.val()) {
|
||||
CalculationDateTime.addClass('errored');
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text('لطفا تاریخ محاسبه را مشخص نمائید');
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
CalculationDateTime.removeClass('errored');
|
||||
}, 3500);
|
||||
return;
|
||||
}
|
||||
|
||||
$('#createData').addClass('disable');
|
||||
|
||||
var data = $('#create-form').serialize();
|
||||
|
||||
@@ -82,6 +82,7 @@ function SaveDataAjax() {
|
||||
|
||||
var Amount = $('#Amount ');
|
||||
var SalaryDateTime = $('#SalaryDateTime');
|
||||
var CalculationDateTime = $('#CalculationDateTime');
|
||||
|
||||
if (!Amount.val() || Amount.val() === "0") {
|
||||
Amount.addClass('errored');
|
||||
@@ -106,6 +107,18 @@ function SaveDataAjax() {
|
||||
}, 3500);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CalculationDateTime.val()) {
|
||||
CalculationDateTime.addClass('errored');
|
||||
$('.alert-msg').show();
|
||||
$('.alert-msg p').text('لطفا تاریخ محاسبه را مشخص نمائید');
|
||||
setTimeout(function () {
|
||||
$('.alert-msg').hide();
|
||||
$('.alert-msg p').text('');
|
||||
CalculationDateTime.removeClass('errored');
|
||||
}, 3500);
|
||||
return;
|
||||
}
|
||||
|
||||
$('#createData').addClass('disable');
|
||||
|
||||
|
||||
@@ -144,7 +144,10 @@ function loadErrorExcelDataAjax(data) {
|
||||
<div class="excelTable Rtable Rtable--5cols Rtable--collapse rowCustom px-1">
|
||||
<div class="Rtable-row Rtable-row--head align-items-center d-flex flex-column w-100 error-header sticky p-0">
|
||||
|
||||
<div class="Rtable-cell column-heading rowHeaderCustom text-center justify-content-center w-100 px-1">تاریخ ${data.rawData[0]?.salaryAidDateTime ?? ""}</div>
|
||||
<div class="Rtable-cell column-heading rowHeaderCustom text-center d-flex justify-content-between w-100 px-3">
|
||||
<div>تاریخ پرداخت ${data.rawData[0]?.salaryAidDateTime ?? ""}</div>
|
||||
<div>تاریخ محاسبه ${data.rawData[0]?.calculationDate ?? ""}</div>
|
||||
</div>
|
||||
<div class="lineHead w-100"></div>
|
||||
<div class="d-flex w-100 px-1 gap-2">
|
||||
<div class="Rtable-cell column-heading rowHeaderCustom width1">
|
||||
@@ -394,7 +397,8 @@ function loadFinalExcelDataAjax(data) {
|
||||
<div class="excelValidTable Rtable Rtable--5cols Rtable--collapse rowCustom px-1">
|
||||
<div class="Rtable-row Rtable-row--head align-items-center d-flex flex-column w-100 sticky p-0">
|
||||
<div class="Rtable-cell column-heading rowHeaderCustom d-flex align-items-center ${rowValidDataDuplicateExist.length > 0 ? 'justify-content-between' : 'justify-content-center'} w-100 px-2">
|
||||
<div>تاریخ ${data.rawData[0].salaryAidDateTime}</div>`;
|
||||
<div>تاریخ پرداخت ${data.rawData[0].salaryAidDateTime}</div>
|
||||
<div>تاریخ محاسبه ${data.rawData[0]?.calculationDate ?? ""}</div>`;
|
||||
|
||||
|
||||
if (rowValidDataDuplicateExist.length > 0) {
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user