sepration js : EditTransaction - Extention - DinancialStatment - Index
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2797,7 +2797,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)
|
||||
|
||||
@@ -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,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>
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user