Compare commits
80 Commits
Fix/instit
...
Feature/ro
| Author | SHA1 | Date | |
|---|---|---|---|
| 5d55118c3c | |||
| c5a1e5c274 | |||
| 4c6de6a76f | |||
| 25c7b67eb5 | |||
| 19b390b17d | |||
| 3d86ba401f | |||
| ca6638d6a3 | |||
| 608fb824dc | |||
| 4686151bbb | |||
| d7fae42e4f | |||
| 2cfe480733 | |||
|
|
c574ce534d | ||
| 174edbf87d | |||
| a827470831 | |||
| c9b61c3fc6 | |||
| 45002b88c4 | |||
| 0bacb24aa2 | |||
| 7fd8851f71 | |||
| bc6ae854f8 | |||
| 68f1f81b53 | |||
| d4c2ab939e | |||
| 5822005b68 | |||
| 53aeb60861 | |||
| c2a08d9c33 | |||
| 85e2481680 | |||
| b711e803a9 | |||
| 232a834dc9 | |||
| 55f7b4f7c0 | |||
| c5b521bc50 | |||
| acdd7de4f6 | |||
| 78458f24e5 | |||
| fde58a7c75 | |||
|
|
dbddccf011 | ||
| 488454d354 | |||
| 4126a7370f | |||
| 7aff8ba59f | |||
| 7d6b57affd | |||
| 950f2884ac | |||
| 2edf150ef6 | |||
| df9c268959 | |||
| 3c6303e817 | |||
| 23386fda76 | |||
| 119f4496cd | |||
| ce4fc33daa | |||
| f5d95b21b0 | |||
| 6e83904e11 | |||
| 1f7785581c | |||
| 9140f1ea0b | |||
| 81e6094817 | |||
| e5c0a7db58 | |||
| d44a9224be | |||
| c8018948c2 | |||
| a5e68cbd90 | |||
| 37a6920a74 | |||
| db40ab567c | |||
| 5f324a6fa1 | |||
| d1703ad20e | |||
| 2f38470746 | |||
| 23c02abe65 | |||
| 475142744f | |||
| 230cde7c15 | |||
| 13a2cd78cd | |||
| 4aa3c10466 | |||
| 91fc560355 | |||
| 8acb25dd67 | |||
| 9297bdefb5 | |||
| 61b326aed4 | |||
|
|
397280d0a2 | ||
| 5975a92aa1 | |||
| 0cec7c0cce | |||
| be6cb6430f | |||
| 76aa1eae88 | |||
| f1106deff9 | |||
| 94a5741906 | |||
| 221d06a0fc | |||
| 2b993fb746 | |||
| 756e06cc2f | |||
| 761ac352df | |||
| ecfb7af386 | |||
| 92fd8d6b0e |
@@ -27,9 +27,10 @@ public interface ISmsService
|
||||
|
||||
Task<double> GetCreditAmount();
|
||||
|
||||
public Task<bool> SendInstitutionVerificationLink(string number,string fullName, Guid institutionId);
|
||||
public Task<bool> SendInstitutionVerificationLink(string number, string fullName, Guid institutionId, long contractingPartyId, long institutionContractId);
|
||||
|
||||
public Task<bool> SendInstitutionVerificationCode(string number, string code);
|
||||
public Task<bool> SendInstitutionVerificationCode(string number, string code, string contractingPartyFullName,
|
||||
long contractingPartyId, long institutionContractId);
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -1512,6 +1512,14 @@ public static class Tools
|
||||
#region Mahan
|
||||
|
||||
|
||||
public static bool IsvalidIban(this string iban)
|
||||
{
|
||||
return Regex.IsMatch(iban, @"^IR[0-9]{24}$");
|
||||
}
|
||||
public static bool IsValidCardNumber(this string cardNumber)
|
||||
{
|
||||
return Regex.IsMatch(cardNumber, @"^[0-9]{16}$");
|
||||
}
|
||||
/// <summary>
|
||||
/// این متد حروف عربی را به فارسی در میاورد. مثال: علي را به علی تبدیل میکند
|
||||
/// </summary>
|
||||
|
||||
@@ -110,6 +110,53 @@ public interface IUidService
|
||||
{
|
||||
Task<PersonalInfoResponse> GetPersonalInfo(string nationalCode , string birthDate);
|
||||
Task<MatchMobileWithNationalCodeResponse> IsMachPhoneWithNationalCode(string nationalCode , string phoneNumber);
|
||||
Task<IbanInquiryResponse> IbanInquiry (string iban);
|
||||
Task<AccountToIbanResponse> AccountToIban(string accountNumber, UidBanks bank);
|
||||
Task<CardToNumberResponse> CardToIban(string cardNumber);
|
||||
}
|
||||
|
||||
public class CardToNumberResponse:UidBaseResponse
|
||||
{
|
||||
public string Iban { get; set; }
|
||||
public string CardNumber { get; set; }
|
||||
}
|
||||
|
||||
public class AccountToIbanResponse:UidBaseResponse
|
||||
{
|
||||
public string Iban { get; set; }
|
||||
}
|
||||
|
||||
public class IbanInquiryResponse:UidBaseResponse
|
||||
{
|
||||
public IbanInquiryAccountBasicInformation AccountBasicInformation { get; set; }
|
||||
[JsonProperty("owners")]
|
||||
public List<IbanInquiryOwner> Owners { get; set; }
|
||||
}
|
||||
|
||||
public class IbanInquiryAccountBasicInformation
|
||||
{
|
||||
public string Iban { get; set; }
|
||||
public string AccountNumber { get; set; }
|
||||
public IbanInquiryBankInformation BankInformation { get; set; }
|
||||
public string AccountStatus { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class IbanInquiryBankInformation
|
||||
{
|
||||
public string BankName { get; set; }
|
||||
}
|
||||
|
||||
public class IbanInquiryOwner
|
||||
{
|
||||
[JsonProperty("firstName")]
|
||||
public string FirstName { get; set; }
|
||||
[JsonProperty("lastName")]
|
||||
public string LastName { get; set; }
|
||||
[JsonProperty("nationalIdentifier")]
|
||||
public string NationalIdentifier { get; set; }
|
||||
[JsonProperty("customerType")]
|
||||
public string CustomerType { get; set; }
|
||||
}
|
||||
|
||||
public class MatchMobileWithNationalCodeResponse
|
||||
@@ -118,4 +165,7 @@ public class MatchMobileWithNationalCodeResponse
|
||||
|
||||
public ResponseContext ResponseContext { get; set; }
|
||||
}
|
||||
|
||||
public class UidBaseResponse
|
||||
{
|
||||
public ResponseContext ResponseContext { get; set; }
|
||||
}
|
||||
|
||||
117
0_Framework/Application/UID/UidBanks.cs
Normal file
117
0_Framework/Application/UID/UidBanks.cs
Normal file
@@ -0,0 +1,117 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace _0_Framework.Application.UID;
|
||||
|
||||
public enum UidBanks
|
||||
{
|
||||
[Description("بانک دی")]
|
||||
BANK_DEY = 66,
|
||||
|
||||
[Description("بانک سپه")]
|
||||
BANK_SEPAH = 15,
|
||||
|
||||
[Description("بانک شهر")]
|
||||
BANK_SHAHR = 61,
|
||||
|
||||
[Description("بانک ملت")]
|
||||
BANK_MELAT = 12,
|
||||
|
||||
[Description("بانک ملی")]
|
||||
BANK_MELLI = 17,
|
||||
|
||||
[Description("بانک رفاه کارگران")]
|
||||
BANK_REFAH = 13,
|
||||
|
||||
[Description("بانک سینا")]
|
||||
BANK_SINA = 59,
|
||||
|
||||
[Description("بانک مسکن")]
|
||||
BANK_MASKAN = 14,
|
||||
|
||||
[Description("بانک آینده")]
|
||||
BANK_AYANDEH = 62,
|
||||
|
||||
[Description("بانک انصار")]
|
||||
BANK_ANSAR = 63,
|
||||
|
||||
[Description("بانک تجارت")]
|
||||
BANK_TEJARAT = 18,
|
||||
|
||||
[Description("بانک رسالت")]
|
||||
BANK_RESALAT = 70,
|
||||
|
||||
[Description("بانک سامان")]
|
||||
BANK_SAMAN = 56,
|
||||
|
||||
[Description("بانک مرکزی")]
|
||||
BANK_MARKAZI = 10,
|
||||
|
||||
[Description("بانک سرمایه")]
|
||||
BANK_SARMAYEH = 58,
|
||||
|
||||
[Description("بانک صادرات")]
|
||||
BANK_SADERAT = 19,
|
||||
|
||||
[Description("بانک قوامین")]
|
||||
BANK_GHAVAMIN = 52,
|
||||
|
||||
[Description("بانک پارسیان")]
|
||||
BANK_PARSIAN = 54,
|
||||
|
||||
[Description("بانک کشاورزی")]
|
||||
BANK_KESHAVARZI = 16,
|
||||
|
||||
[Description("بانک گردشگری")]
|
||||
BANK_GARDESHGARI = 64,
|
||||
|
||||
[Description("پست بانک")]
|
||||
BANK_POST_BANK = 21,
|
||||
|
||||
[Description("بانک پاسارگاد")]
|
||||
BANK_PASARGAD = 57,
|
||||
|
||||
[Description("بانک کارآفرین")]
|
||||
BANK_KARAFARIN = 53,
|
||||
|
||||
[Description("بانک خاورمیانه")]
|
||||
BANK_KHAVARMIANEH = 78,
|
||||
|
||||
[Description("بانک ایران زمین")]
|
||||
BANK_IRAN_ZAMIN = 69,
|
||||
|
||||
[Description("بانک مهر اقتصاد")]
|
||||
BANK_MEHR_EQTESAD = 79,
|
||||
|
||||
[Description("بانک صنعت و معدن")]
|
||||
BANK_SANAT_MADAN = 11,
|
||||
|
||||
[Description("بانک اقتصاد نوین")]
|
||||
BANK_EGHTESAD_NOVIN = 55,
|
||||
|
||||
[Description("بانک توسعه تعاون")]
|
||||
BANK_TOSSE_TAAVON = 22,
|
||||
|
||||
[Description("بانک توسعه صادرات")]
|
||||
BANK_TOSSE_SADERAT = 20,
|
||||
|
||||
[Description("بانک ایران و ونزوئلا")]
|
||||
BANK_IRAN_VENEZUELA = 95,
|
||||
|
||||
[Description("بانک حکمت ایرانیان")]
|
||||
BANK_HEKMAT_IRANIAN = 65,
|
||||
|
||||
[Description("بانک قرض الحسنه مهر")]
|
||||
BANK_GHARZOLHASANEH_MEHR = 60,
|
||||
|
||||
[Description("موسسه مالی و اعتباری ملل")]
|
||||
BANK_MOASSASE_MELLAL = 75,
|
||||
|
||||
[Description("موسسه مالی و اعتباری نور")]
|
||||
BANK_MOASSASE_NOOR = 80,
|
||||
|
||||
[Description("موسسه مالی و اعتباری کوثر")]
|
||||
BANK_MOASSASE_KOSAR = 73,
|
||||
|
||||
[Description("موسسه مالی و اعتباری توسعه")]
|
||||
BANK_MOASSASE_TOSSE = 51
|
||||
}
|
||||
27
0_Framework/Application/UID/UidBanksExtension.cs
Normal file
27
0_Framework/Application/UID/UidBanksExtension.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Reflection;
|
||||
|
||||
namespace _0_Framework.Application.UID
|
||||
{
|
||||
public static class UidBanksExtension
|
||||
{
|
||||
/// <summary>
|
||||
/// دریافت نام فارسی بانک
|
||||
/// </summary>
|
||||
/// <param name="bank">بانک</param>
|
||||
/// <returns>نام فارسی بانک</returns>
|
||||
public static string GetPersianName(this UidBanks bank)
|
||||
{
|
||||
var fieldInfo = bank.GetType().GetField(bank.ToString());
|
||||
|
||||
if (fieldInfo == null)
|
||||
return string.Empty;
|
||||
|
||||
var attribute = (DescriptionAttribute)Attribute.GetCustomAttribute(
|
||||
fieldInfo, typeof(DescriptionAttribute));
|
||||
|
||||
return attribute?.Description ?? bank.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework_b.Domain;
|
||||
|
||||
namespace Company.Domain.AuthorizedBankDetailsAgg
|
||||
{
|
||||
public class AuthorizedBankDetails : EntityBase
|
||||
{
|
||||
private AuthorizedBankDetails()
|
||||
{
|
||||
OwnersList = new List<AuthorizedBankDetailsOwner>();
|
||||
}
|
||||
|
||||
public AuthorizedBankDetails(string cardNumber, string accountNumber, string ban, string bankName, List<AuthorizedBankDetailsOwner> ownersList)
|
||||
{
|
||||
CardNumber = cardNumber;
|
||||
AccountNumber = accountNumber;
|
||||
IBan = ban;
|
||||
BankName = bankName;
|
||||
OwnersList = ownersList ?? new List<AuthorizedBankDetailsOwner>();
|
||||
}
|
||||
|
||||
public string CardNumber { get; private set; }
|
||||
public string AccountNumber { get; private set; }
|
||||
public string IBan { get; private set; }
|
||||
public string BankName { get; private set; }
|
||||
public List<AuthorizedBankDetailsOwner> OwnersList { get; private set; }
|
||||
}
|
||||
|
||||
public class AuthorizedBankDetailsOwner // Value Object - not inheriting from EntityBase
|
||||
{
|
||||
private AuthorizedBankDetailsOwner() { }
|
||||
|
||||
public AuthorizedBankDetailsOwner(string fName, string lName, string nationalIdentifier, string customerType)
|
||||
{
|
||||
FName = fName;
|
||||
LName = lName;
|
||||
NationalIdentifier = nationalIdentifier;
|
||||
CustomerType = customerType;
|
||||
}
|
||||
|
||||
public string FName { get; private set; }
|
||||
public string LName { get; private set; }
|
||||
public string NationalIdentifier { get; private set; }
|
||||
public string CustomerType { get; private set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using _0_Framework_b.Domain;
|
||||
using System.Collections.Generic;
|
||||
using Company.Application.Contracts.AuthorizedBankDetails;
|
||||
|
||||
namespace Company.Domain.AuthorizedBankDetailsAgg
|
||||
{
|
||||
public interface IAuthorizedBankDetailsRepository : IRepository<long, AuthorizedBankDetails>
|
||||
{
|
||||
EditAuthorizedBankDetails GetDetails(long id);
|
||||
List<AuthorizedBankDetailsViewModel> Search(AuthorizedBankDetailsSearchModel searchModel);
|
||||
AuthorizedBankDetailsViewModel GetByIban(string iban);
|
||||
}
|
||||
}
|
||||
@@ -54,10 +54,25 @@ public interface IInstitutionContractRepository : IRepository<long, InstitutionC
|
||||
void UpdateStatusIfNeeded(long institutionContractId);
|
||||
Task<GetInstitutionVerificationDetailsViewModel> GetVerificationDetails(Guid id);
|
||||
Task<InstitutionContract> GetByPublicIdAsync(Guid id);
|
||||
|
||||
#region Extension
|
||||
|
||||
Task<InstitutionContractExtensionInquiryResult> GetExtensionInquiry(long previousContractId);
|
||||
Task<InstitutionContractExtensionWorkshopsResponse> GetExtensionWorkshops(InstitutionContractExtensionWorkshopsRequest request);
|
||||
Task<InstitutionContractExtensionPlanResponse> GetExtensionInstitutionPlan(InstitutionContractExtensionPlanRequest request);
|
||||
Task<InstitutionContractExtensionPaymentResponse> GetExtensionPaymentMethod(InstitutionContractExtensionPaymentRequest request);
|
||||
Task<OperationResult> ExtensionComplete(InstitutionContractExtensionCompleteRequest request);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Upgrade(Amendment)
|
||||
|
||||
Task<InstitutionContractAmendmentWorkshopsResponse> GetAmendmentWorkshops(long institutionContractId);
|
||||
Task<InsitutionContractAmendmentPaymentResponse> GetAmendmentPaymentDetails(InsitutionContractAmendmentPaymentRequest request);
|
||||
|
||||
Task<InsertAmendmentTempWorkshopResponse> InsertAmendmentTempWorkshops(InstitutionContractAmendmentTempWorkshopViewModel request);
|
||||
Task RemoveAmendmentWorkshops(Guid workshopTempId);
|
||||
#endregion
|
||||
|
||||
Task<List<InstitutionContractSelectListViewModel>> GetInstitutionContractSelectList(string search, string selected);
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using _0_Framework.Domain;
|
||||
using Company.Domain.InstitutionContractContactInfoAgg;
|
||||
@@ -119,26 +120,23 @@ public class InstitutionContract : EntityBase
|
||||
public string HasValueAddedTax { get; private set; }
|
||||
|
||||
public double ValueAddedTax { get; private set; }
|
||||
|
||||
|
||||
public Guid PublicId { get; private set; }
|
||||
|
||||
public string VerifyCode { get; private set; }
|
||||
public DateTime VerifyCodeCreation { get; private set; }
|
||||
|
||||
[NotMapped]
|
||||
public bool VerifyCodeExpired => VerifyCodeCreation.Add(ExpireTime) <= DateTime.Now;
|
||||
|
||||
[NotMapped]
|
||||
public bool CanResendVerifyCode => VerifyCodeCreation.Add(ReSendTime) <= DateTime.Now;
|
||||
|
||||
[NotMapped] public bool VerifyCodeExpired => VerifyCodeCreation.Add(ExpireTime) <= DateTime.Now;
|
||||
|
||||
[NotMapped] public bool CanResendVerifyCode => VerifyCodeCreation.Add(ReSendTime) <= DateTime.Now;
|
||||
|
||||
[NotMapped] public TimeSpan ExpireTime => TimeSpan.FromMinutes(5);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[NotMapped] public TimeSpan ReSendTime => TimeSpan.FromMinutes(2);
|
||||
|
||||
|
||||
public bool IsInstallment { get; set; }
|
||||
|
||||
|
||||
public InstitutionContractVerificationStatus VerificationStatus { get; private set; }
|
||||
|
||||
public InstitutionContractWorkshopGroup WorkshopGroup { get; private set; }
|
||||
@@ -254,6 +252,19 @@ public class InstitutionContract : EntityBase
|
||||
|
||||
public class InstitutionContractAmendment : EntityBase
|
||||
{
|
||||
private InstitutionContractAmendment(){}
|
||||
public InstitutionContractAmendment(long institutionContractId,
|
||||
List<InstitutionContractInstallment> installments, double amount, bool hasInstallment,
|
||||
InstitutionContractAmendmentChange amendmentChange, long lawId)
|
||||
{
|
||||
InstitutionContractId = institutionContractId;
|
||||
Installments = installments is { Count: > 0} ? installments : [];
|
||||
Amount = amount;
|
||||
HasInstallment = hasInstallment;
|
||||
AmendmentChanges = [amendmentChange];
|
||||
LawId = lawId;
|
||||
}
|
||||
|
||||
public long InstitutionContractId { get; set; }
|
||||
public InstitutionContract InstitutionContract { get; set; }
|
||||
public List<InstitutionContractInstallment> Installments { get; set; }
|
||||
@@ -262,10 +273,39 @@ public class InstitutionContractAmendment : EntityBase
|
||||
public string VerifyCode { get; set; }
|
||||
public DateTime VerificationCreation { get; set; }
|
||||
public List<InstitutionContractAmendmentChange> AmendmentChanges { get; set; }
|
||||
|
||||
public long LawId { get; set; }
|
||||
|
||||
public void SetVerifyCode(string code)
|
||||
{
|
||||
VerifyCode = code;
|
||||
VerificationCreation = DateTime.Now;
|
||||
}
|
||||
}
|
||||
|
||||
public class InstitutionContractAmendmentChange : EntityBase
|
||||
{
|
||||
private InstitutionContractAmendmentChange() { }
|
||||
private InstitutionContractAmendmentChange(long institutionContractAmendmentId,
|
||||
InstitutionContractAmendment institutionContractAmendment, InstitutionContractAmendmentChangeType changeType,
|
||||
DateTime changeDateGr, bool? hasRollCallPlan, bool? hasCustomizeCheckoutPlan, bool? hasContractPlan,
|
||||
bool? hasContractPlanInPerson, bool? hasInsurancePlan, bool? hasInsurancePlanInPerson, int? personnelCount,
|
||||
long? workshopDetailsId)
|
||||
{
|
||||
InstitutionContractAmendmentId = institutionContractAmendmentId;
|
||||
InstitutionContractAmendment = institutionContractAmendment;
|
||||
ChangeType = changeType;
|
||||
ChangeDateGr = changeDateGr;
|
||||
HasRollCallPlan = hasRollCallPlan;
|
||||
HasCustomizeCheckoutPlan = hasCustomizeCheckoutPlan;
|
||||
HasContractPlan = hasContractPlan;
|
||||
HasContractPlanInPerson = hasContractPlanInPerson;
|
||||
HasInsurancePlan = hasInsurancePlan;
|
||||
HasInsurancePlanInPerson = hasInsurancePlanInPerson;
|
||||
PersonnelCount = personnelCount;
|
||||
WorkshopDetailsId = workshopDetailsId;
|
||||
}
|
||||
|
||||
public long InstitutionContractAmendmentId { get; private set; }
|
||||
public InstitutionContractAmendment InstitutionContractAmendment { get; private set; }
|
||||
public InstitutionContractAmendmentChangeType ChangeType { get; private set; }
|
||||
@@ -310,8 +350,6 @@ public class InstitutionContractAmendmentChange : EntityBase
|
||||
/// تعداد کارگاه
|
||||
/// </summary>
|
||||
public long? WorkshopDetailsId { get; private set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
public enum InstitutionContractAmendmentChangeType
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace Company.Domain.InstitutionContractAmendmentTempAgg;
|
||||
|
||||
public class InstitutionContractAmendmentTemp
|
||||
{
|
||||
public InstitutionContractAmendmentTemp(List<InstitutionContractAmendmentTempPrevWorkshop> prevWorkshops,
|
||||
long institutionContractId)
|
||||
{
|
||||
Id = Guid.NewGuid();
|
||||
PrevWorkshops = prevWorkshops;
|
||||
NewWorkshops = prevWorkshops.Select(x=> new InstitutionContractAmendmentTempNewWorkshop(
|
||||
x.WorkshopName, x.CountPerson, x.ContractAndCheckout, x.ContractAndCheckoutInPerson, x.Insurance,
|
||||
x.InsuranceInPerson, x.RollCall, x.RollCallInPerson, x.CustomizeCheckout, x.Price, x.WorkshopId,
|
||||
x.CurrentWorkshopId, 0)).ToList();
|
||||
InstitutionContractId = institutionContractId;
|
||||
}
|
||||
|
||||
[BsonId]
|
||||
[BsonRepresentation(BsonType.String)]
|
||||
public Guid Id { get; private set; }
|
||||
public List<InstitutionContractAmendmentTempPrevWorkshop> PrevWorkshops { get; private set; }
|
||||
public List<InstitutionContractAmendmentTempNewWorkshop> NewWorkshops { get; private set; }
|
||||
public long InstitutionContractId { get; private set; }
|
||||
}
|
||||
|
||||
public class InstitutionContractAmendmentTempNewWorkshop : InstitutionContractAmendmentTempPrevWorkshop
|
||||
{
|
||||
public InstitutionContractAmendmentTempNewWorkshop(string workshopName, int countPerson, bool contractAndCheckout,
|
||||
bool contractAndCheckoutInPerson, bool insurance, bool insuranceInPerson, bool rollCall, bool rollCallInPerson,
|
||||
bool customizeCheckout, double price, long workshopId, long currentWorkshopId,double priceDifference) : base(
|
||||
workshopName, countPerson, contractAndCheckout, contractAndCheckoutInPerson, insurance, insuranceInPerson,
|
||||
rollCall, rollCallInPerson, customizeCheckout, price, workshopId, currentWorkshopId)
|
||||
{
|
||||
PriceDifference = priceDifference;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ اختلاف کارگاه جدید با کارگاه قبلی(مبلغ اصلی ارتقاء)
|
||||
/// </summary>
|
||||
public double PriceDifference { get; private set; }
|
||||
|
||||
|
||||
public void Edit(string workshopName, int countPerson, bool contractAndCheckout,
|
||||
bool contractAndCheckoutInPerson,
|
||||
bool insurance, bool insuranceInPerson, bool rollCall, bool customizeCheckout,
|
||||
double price,double priceDifference)
|
||||
{
|
||||
base.Edit(workshopName, countPerson, contractAndCheckout, contractAndCheckoutInPerson, insurance,
|
||||
insuranceInPerson, rollCall, customizeCheckout, price);
|
||||
PriceDifference = priceDifference;
|
||||
}
|
||||
}
|
||||
|
||||
public class InstitutionContractAmendmentTempPrevWorkshop
|
||||
{
|
||||
public InstitutionContractAmendmentTempPrevWorkshop(string workshopName, int countPerson, bool contractAndCheckout,
|
||||
bool contractAndCheckoutInPerson,
|
||||
bool insurance, bool insuranceInPerson,
|
||||
bool rollCall, bool rollCallInPerson, bool customizeCheckout, double price, long workshopId,
|
||||
long currentWorkshopId)
|
||||
{
|
||||
Id = Guid.NewGuid();
|
||||
WorkshopName = workshopName;
|
||||
CountPerson = countPerson;
|
||||
ContractAndCheckout = contractAndCheckout;
|
||||
Insurance = insurance;
|
||||
RollCall = rollCall;
|
||||
CustomizeCheckout = customizeCheckout;
|
||||
ContractAndCheckoutInPerson = contractAndCheckoutInPerson;
|
||||
InsuranceInPerson = insuranceInPerson;
|
||||
RollCallInPerson = rollCallInPerson;
|
||||
Price = price;
|
||||
WorkshopId = workshopId;
|
||||
CurrentWorkshopId = currentWorkshopId;
|
||||
}
|
||||
|
||||
[BsonRepresentation(BsonType.String)]
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public long CurrentWorkshopId { get; private set; }
|
||||
public long WorkshopId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام کارگاه
|
||||
/// </summary>
|
||||
public string WorkshopName { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// تعداد پرسنل
|
||||
/// </summary>
|
||||
public int CountPerson { get; private set; }
|
||||
|
||||
|
||||
#region ServiceSelection
|
||||
|
||||
/// <summary>
|
||||
/// قرارداد و تصفیه
|
||||
/// </summary>
|
||||
public bool ContractAndCheckout { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// بیمه
|
||||
/// </summary>
|
||||
public bool Insurance { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// حضورغباب
|
||||
/// </summary>
|
||||
public bool RollCall { get; private set; }
|
||||
|
||||
public bool RollCallInPerson { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// فیش غیر رسمی
|
||||
/// </summary>
|
||||
public bool CustomizeCheckout { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// خدمات حضوری قرداد و تصفیه
|
||||
/// </summary>
|
||||
public bool ContractAndCheckoutInPerson { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// خدمات حضوری بیمه
|
||||
/// </summary>
|
||||
public bool InsuranceInPerson { get; private set; }
|
||||
|
||||
public double Price { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
public void Edit(string workshopName, int countPerson, bool contractAndCheckout, bool contractAndCheckoutInPerson,
|
||||
bool insurance, bool insuranceInPerson, bool rollCall, bool customizeCheckout,
|
||||
double price)
|
||||
{
|
||||
WorkshopName = workshopName;
|
||||
CountPerson = countPerson;
|
||||
ContractAndCheckout = contractAndCheckout;
|
||||
Insurance = insurance;
|
||||
RollCall = rollCall;
|
||||
CustomizeCheckout = customizeCheckout;
|
||||
ContractAndCheckoutInPerson = contractAndCheckoutInPerson;
|
||||
InsuranceInPerson = insuranceInPerson;
|
||||
Price = price;
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace Company.Domain.InstitutionContractInsertTempAgg;
|
||||
namespace Company.Domain.InstitutionContractExtensionTempAgg;
|
||||
|
||||
public interface IInstitutionContractExtenstionTempRepository
|
||||
{
|
||||
@@ -5,7 +5,7 @@ using CompanyManagment.App.Contracts.InstitutionContractContactinfo;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace Company.Domain.InstitutionContractInsertTempAgg;
|
||||
namespace Company.Domain.InstitutionContractExtensionTempAgg;
|
||||
|
||||
public class InstitutionContractExtensionTemp
|
||||
{
|
||||
@@ -30,8 +30,8 @@ public class InstitutionContractExtensionTemp
|
||||
public InstitutionContractExtensionPlanDetail ThreeMonths { get; set; }
|
||||
public InstitutionContractExtensionPlanDetail SixMonths { get; set; }
|
||||
public InstitutionContractExtensionPlanDetail TwelveMonths { get; set; }
|
||||
public InstitutionContractExtensionPaymentMonthly MonthlyPayment { get; set; }
|
||||
public InstitutionContractExtensionPaymentOneTime OneTimePayment { get; set; }
|
||||
public InstitutionContractPaymentMonthlyViewModel MonthlyPayment { get; set; }
|
||||
public InstitutionContractPaymentOneTimeViewModel OneTimePayment { get; set; }
|
||||
|
||||
public bool HasContractInPerson { get; set; }
|
||||
|
||||
@@ -58,8 +58,8 @@ public class InstitutionContractExtensionTemp
|
||||
HasContractInPerson = hasContractInPerson;
|
||||
}
|
||||
|
||||
public void SetAmountAndDuration(InstitutionContractDuration duration,InstitutionContractExtensionPaymentMonthly monthly,
|
||||
InstitutionContractExtensionPaymentOneTime oneTime)
|
||||
public void SetAmountAndDuration(InstitutionContractDuration duration,InstitutionContractPaymentMonthlyViewModel monthly,
|
||||
InstitutionContractPaymentOneTimeViewModel oneTime)
|
||||
{
|
||||
Duration = duration;
|
||||
MonthlyPayment = monthly;
|
||||
@@ -5,7 +5,8 @@ namespace Company.Domain.SmsResultAgg;
|
||||
|
||||
public class SmsResult: EntityBase
|
||||
{
|
||||
public SmsResult(int messageId, string status,string typeOfSms, string contractingPartyName,string mobile, long contractingPatyId, long institutionContractId)
|
||||
public SmsResult(int messageId, string status,string typeOfSms,
|
||||
string contractingPartyName,string mobile, long contractingPatyId, long institutionContractId)
|
||||
{
|
||||
MessageId = messageId;
|
||||
Status = status;
|
||||
|
||||
@@ -70,6 +70,7 @@ public interface IWorkshopRepository : IRepository<long, Workshop>
|
||||
Task<List<WorkshopWithLeftWorkTempEmployeesDto>> GetWorkshopsForLeftWorkTemp(long accountId);
|
||||
Task<int> GetWorkshopsForLeftWorkTempCount(long accountId);
|
||||
Task<List<WorkshopSelectListViewModel>> GetSelectList(string search, long id);
|
||||
int GetLastArchiveCode();
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.AccessControl;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
using Company.Domain.ContarctingPartyAgg;
|
||||
using Company.Domain.ContractAgg;
|
||||
@@ -66,6 +68,11 @@ public class Employer : EntityBase
|
||||
public string SanaPassword { get; private set; }
|
||||
|
||||
public string EmployerNo { get; set; }
|
||||
public bool IsAuth { get; set; }
|
||||
public string IdNumberSerial { get; set; }
|
||||
|
||||
public string IdNumberSeri { get; set; }
|
||||
|
||||
public PersonalContractingParty ContractingParty { get; set; }
|
||||
|
||||
//public List<Workshop> Workshops { get; private set; }
|
||||
@@ -227,4 +234,35 @@ public class Employer : EntityBase
|
||||
this.IsActive = false;
|
||||
this.Address = "false";
|
||||
}
|
||||
|
||||
public void Authentication(string fName, string lName, string fatherName,string idNumber,
|
||||
string idNumberSeri, string idNumberSerial, string dateOfBirth, Gender gender,string phone)
|
||||
{
|
||||
this.FName = fName;
|
||||
this.LName = lName;
|
||||
this.FatherName = fatherName;
|
||||
this.IdNumberSeri = idNumberSeri;
|
||||
this.IdNumberSerial = idNumberSerial;
|
||||
this.DateOfBirth = !string.IsNullOrWhiteSpace(dateOfBirth) ? dateOfBirth.ToGeorgianDateTime() : new();
|
||||
this.IdNumber = idNumber;
|
||||
this.Gender = gender == _0_Framework.Application.Gender.Male? "مرد" : "زن";
|
||||
this.IsAuth = true;
|
||||
Phone = phone;
|
||||
}
|
||||
|
||||
|
||||
public void LegalAuthentication(string fName, string lName, string fatherName,string idNumber, string idNumberSeri,
|
||||
string idNumberSerial, string dateOfBirth, Gender gender,string phone)
|
||||
{
|
||||
FName = fName;
|
||||
EmployerLName = lName;
|
||||
this.FatherName = fatherName;
|
||||
this.IdNumberSeri = idNumberSeri;
|
||||
this.IdNumberSerial = idNumberSerial;
|
||||
this.DateOfBirth = !string.IsNullOrWhiteSpace(dateOfBirth) ? dateOfBirth.ToGeorgianDateTime() : new();
|
||||
this.IdNumber = idNumber;
|
||||
this.Gender =gender == _0_Framework.Application.Gender.Male? "مرد" : "زن";
|
||||
this.IsAuth = true;
|
||||
Phone = phone;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using _0_Framework.Domain;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Company.Domain.empolyerAgg;
|
||||
|
||||
@@ -34,7 +36,7 @@ public interface IEmployerRepository : IRepository<long, Employer>
|
||||
|
||||
List<EmployerViewModel> GetEmployersHasWorkshop();
|
||||
|
||||
Task<List<EmployerSelectListViewModel>> GetSelectList(string search,long id);
|
||||
Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id, LegalType? legalType);
|
||||
|
||||
|
||||
#endregion
|
||||
@@ -68,5 +70,5 @@ public interface IEmployerRepository : IRepository<long, Employer>
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
Task<ActionResult<EditEmployerWorkflowRegistration>> GetWorkflowRegistrationForEdit(long employerId, long institutionWorkshopDetailsId);
|
||||
}
|
||||
@@ -12,9 +12,7 @@ public class CaseHistoryRollCallExcelForEmployeeViewModel
|
||||
public string EmployeeFullName { get; set; }
|
||||
public string TotalWorkingHoursFa { get; set; }
|
||||
public string TotalWorkingTimeSpan { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
public List<RollCallItemForEmployeeExcelViewModel> RollCalls { get; set; }
|
||||
}
|
||||
|
||||
@@ -40,7 +38,8 @@ public class RollCallItemForEmployeeExcelViewModel
|
||||
public bool HasLeave { get; set; }
|
||||
|
||||
public string TotalWorkingHours { get; set; }
|
||||
|
||||
public string EnterTimeDifferences { get; set; }
|
||||
public string ExitTimeDifferences { get; set; }
|
||||
}
|
||||
|
||||
public class RollCallTimeExcelViewModel
|
||||
|
||||
@@ -113,11 +113,12 @@ public class RollCallExcelGenerator : ExcelGenerator
|
||||
worksheet.Cells[i + row + 1, 1].Value = i + 1;
|
||||
worksheet.Cells[i + row + 1, 2].Value = rollCall.DayOfWeekFa;
|
||||
worksheet.Cells[i + row + 1, 3].Value = rollCall.DateFa;
|
||||
worksheet.Cells[i + row + 1, 4].Value = "-";
|
||||
worksheet.Cells[i + row + 1, 4].Value = rollCall.EnterTimeDifferences;
|
||||
worksheet.Cells[i + row + 1, 5].Value = rollCall.StartsItems;
|
||||
worksheet.Cells[i + row + 1, 6].Value = rollCall.EndsItems;
|
||||
worksheet.Cells[i + row + 1, 7].Value = "-";
|
||||
worksheet.Cells[i + row + 1, 8].Value = rollCall.TotalWorkingHours == string.Empty ? "ندارد" : rollCall.TotalWorkingHours;
|
||||
worksheet.Cells[i + row + 1, 7].Value = rollCall.ExitTimeDifferences;
|
||||
worksheet.Cells[i + row + 1, 8].Value = rollCall.TotalWorkingHours == string.Empty
|
||||
? "ندارد" : rollCall.TotalWorkingHours;
|
||||
|
||||
// Style data cells
|
||||
for (int j = 1; j <= 8; j++)
|
||||
@@ -307,6 +308,49 @@ public class RollCallExcelGenerator : ExcelGenerator
|
||||
return package.GetAsByteArray();
|
||||
}
|
||||
|
||||
private string CalculateExitMinuteDifference(TimeSpan early, TimeSpan late)
|
||||
{
|
||||
if (early == TimeSpan.Zero && late == TimeSpan.Zero)
|
||||
{
|
||||
return "-";
|
||||
}
|
||||
else if (late != TimeSpan.Zero)
|
||||
{
|
||||
var minutes = late.TotalMinutes > 999 ? "999" : late.TotalMinutes.ToString();
|
||||
return $"{minutes}+";
|
||||
}
|
||||
else if (early != TimeSpan.Zero)
|
||||
{
|
||||
var minutes = early.TotalMinutes > 999 ? "999" : early.TotalMinutes.ToString();
|
||||
return $"{minutes}-";
|
||||
}
|
||||
else
|
||||
{
|
||||
return $"";
|
||||
}
|
||||
}
|
||||
|
||||
private string CalculateEntryMinuteDifference(TimeSpan early, TimeSpan late)
|
||||
{
|
||||
if (early == TimeSpan.Zero && late == TimeSpan.Zero)
|
||||
{
|
||||
return "-";
|
||||
}
|
||||
else if (late != TimeSpan.Zero)
|
||||
{
|
||||
var minutes = late.TotalMinutes > 999 ? "999" : late.TotalMinutes.ToString();
|
||||
return $"{minutes}-";
|
||||
}
|
||||
else if (early != TimeSpan.Zero)
|
||||
{
|
||||
var minutes = early.TotalMinutes > 999 ? "999" : early.TotalMinutes.ToString();
|
||||
return $"{minutes}+";
|
||||
}
|
||||
else
|
||||
{
|
||||
return $"";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Company.Domain.InstitutionContractInsertTempAgg;
|
||||
using Company.Domain.InstitutionContractExtensionTempAgg;
|
||||
using MongoDB.Driver;
|
||||
|
||||
namespace CompanyManagement.Infrastructure.Mongo.InstitutionContractInsertTempRepo;
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace Company.Application.Contracts.AuthorizedBankDetails
|
||||
{
|
||||
public class AuthorizedBankDetailsSearchModel
|
||||
{
|
||||
public string CardNumber { get; set; }
|
||||
public string AccountNumber { get; set; }
|
||||
public string IBan { get; set; }
|
||||
public string BankName { get; set; }
|
||||
public string NationalIdentifier { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System;
|
||||
|
||||
using System.Collections.Generic;
|
||||
namespace Company.Application.Contracts.AuthorizedBankDetails;
|
||||
|
||||
public class AuthorizedBankDetailsViewModel
|
||||
{
|
||||
public string NationalIdentifier { get; set; }
|
||||
|
||||
public long Id { get; set; }
|
||||
public string CustomerType { get; set; }
|
||||
public string CardNumber { get; set; }
|
||||
public string AccountNumber { get; set; }
|
||||
public string IBan { get; set; }
|
||||
public string BankName { get; set; }
|
||||
public List<AuthorizedBankDetailsOwnerViewModel> Owners { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Company.Application.Contracts.AuthorizedBankDetails
|
||||
{
|
||||
public class CreateAuthorizedBankDetails
|
||||
{
|
||||
public string CardNumber { get; set; }
|
||||
|
||||
public string AccountNumber { get; set; }
|
||||
|
||||
public string IBan { get; set; }
|
||||
|
||||
public string BankName { get; set; }
|
||||
|
||||
public List<CreateAuthorizedBankDetailsOwner> OwnersList { get; set; }
|
||||
}
|
||||
|
||||
public class CreateAuthorizedBankDetailsOwner
|
||||
{
|
||||
public string FName { get; set; }
|
||||
|
||||
public string LName { get; set; }
|
||||
|
||||
public string NationalIdentifier { get; set; }
|
||||
|
||||
public string CustomerType { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Company.Application.Contracts.AuthorizedBankDetails
|
||||
{
|
||||
public class EditAuthorizedBankDetails
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
public string CardNumber { get; set; }
|
||||
|
||||
public string AccountNumber { get; set; }
|
||||
|
||||
public string IBan { get; set; }
|
||||
|
||||
public string BankName { get; set; }
|
||||
|
||||
public List<AuthorizedBankDetailsOwnerViewModel> OwnersList { get; set; }
|
||||
}
|
||||
|
||||
public class AuthorizedBankDetailsOwnerViewModel
|
||||
{
|
||||
public string FName { get; set; }
|
||||
public string LName { get; set; }
|
||||
public string NationalIdentifier { get; set; }
|
||||
public string CustomerType { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Application;
|
||||
using Company.Application.Contracts.AuthorizedBankDetails;
|
||||
|
||||
namespace Company.Application.Contracts.AuthorizedBankDetails
|
||||
{
|
||||
public interface IAuthorizedBankDetailsApplication
|
||||
{
|
||||
OperationResult Create(CreateAuthorizedBankDetails command);
|
||||
EditAuthorizedBankDetails GetDetails(long id);
|
||||
List<AuthorizedBankDetailsViewModel> Search(AuthorizedBankDetailsSearchModel searchModel);
|
||||
AuthorizedBankDetailsViewModel GetByIban(string iban);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Security.AccessControl;
|
||||
using System.Security.Cryptography;
|
||||
using System.Threading.Tasks;
|
||||
using System.Transactions;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.UID;
|
||||
using CompanyManagment.App.Contracts.OriginalTitle;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.ContractingPartyBankAccounts;
|
||||
@@ -74,5 +76,27 @@ public interface IContractingPartyBankAccountsApplication
|
||||
/// <param name="selected">نام سلکت شده</param>
|
||||
/// <returns></returns>
|
||||
Task<List<string>> ContractingPartyNamesSelectList(string search, string selected);
|
||||
|
||||
/// <summary>
|
||||
/// احراز هویت اطلاعات بانکی طرف حساب
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<ContractingPartyBankInquiryResponse> InquiryContractingPartyBankDetails(InquiryContractingPartyBankDetailsRequest command);
|
||||
|
||||
}
|
||||
public class InquiryContractingPartyBankDetailsRequest
|
||||
{
|
||||
public string CardNumber { get; set; }
|
||||
public string AccountNumber { get; set; }
|
||||
public string IBan { get; set; }
|
||||
public UidBanks? UidBank { get; set; }
|
||||
}
|
||||
public class ContractingPartyBankInquiryResponse
|
||||
{
|
||||
public string FullName { get; set; }
|
||||
public string Iban { get; set; }
|
||||
public string AccountNumber { get; set; }
|
||||
public string CardNumber { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Employer;
|
||||
@@ -46,8 +47,9 @@ public interface IEmployerApplication
|
||||
/// </summary>
|
||||
/// <param name="search"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="legalType"></param>
|
||||
/// <returns></returns>
|
||||
Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id);
|
||||
Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id, LegalType? legalType = null);
|
||||
|
||||
#endregion
|
||||
#region NewByHeydari
|
||||
@@ -145,6 +147,7 @@ public interface IEmployerApplication
|
||||
Task<OperationResult> DeleteWorkflowRegistration(long employerId, long institutionWorkshopDetailsId);
|
||||
|
||||
Task<OperationResult<AuthenticateUserViewModel>> AuthenticateEmployer(string nationalCode, string dateOfBirth, string mobile);
|
||||
Task<ActionResult<EditEmployerWorkflowRegistration>> GetWorkflowRegistrationForEdit(long employerId, long institutionWorkshopDetailsId);
|
||||
}
|
||||
|
||||
public class AuthenticateUserViewModel
|
||||
@@ -207,6 +210,11 @@ public class AuthenticateUserViewModel
|
||||
/// </summary>
|
||||
public class CreateEmployerWorkflowRegistration
|
||||
{
|
||||
/// <summary>
|
||||
/// درزمانی که یوزر کارفرمایی رو انتخاب کرد که از قبل ثبت شده است
|
||||
/// این فیلد باید مقدار داشته باشد
|
||||
/// </summary>
|
||||
public long EmployerId { get; set; }
|
||||
/// <summary>
|
||||
/// اطلاعات کارفرمای حقیقی
|
||||
/// </summary>
|
||||
@@ -323,7 +331,9 @@ public class CreateLegalEmployerWorkflowRegistration
|
||||
/// اطلاعات سیستم دولتی
|
||||
/// </summary>
|
||||
public GovernmentSystemInfo GovernmentSystemInfo { get; set; }
|
||||
|
||||
|
||||
public string IdNumberSeri { get; set; }
|
||||
public string IdNumberSerial { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -395,6 +405,9 @@ public class CreateRealEmployerWorkflowRegistration
|
||||
/// شماره تلفن
|
||||
/// </summary>
|
||||
public string Telephone { get; set; }
|
||||
|
||||
public string IdNumberSeri { get; set; }
|
||||
public string IdNumberSerial { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -87,6 +87,10 @@ public class GetInstitutionContractListItemsViewModel
|
||||
public long ContractingPartyId { get; set; }
|
||||
|
||||
public List<InstitutionContractListWorkshop> Workshops { get; set; }
|
||||
|
||||
public bool IsInPersonContract { get; set; }
|
||||
|
||||
public bool IsOldContract { get; set; }
|
||||
}
|
||||
|
||||
public class InstitutionContractListWorkshop
|
||||
@@ -102,13 +106,13 @@ public class WorkshopServicesViewModel
|
||||
public string InsuranceLabel => "ارسال لیست بیمه";
|
||||
|
||||
public bool InsuranceInPerson { get; set; }
|
||||
public string InsuranceInPersonLabel => "خدمات حضوری";
|
||||
public string InsuranceInPersonLabel => "خدمات مستقیم";
|
||||
|
||||
public bool Contract { get; set; }
|
||||
public string ContractLabel => "قرارداد و تصفیه حساب";
|
||||
|
||||
public bool ContractInPerson { get; set; }
|
||||
public string ContractInPersonLabel => "خدمات حضوری";
|
||||
public string ContractInPersonLabel => "خدمات مستقیم";
|
||||
|
||||
public bool RollCall { get; set; }
|
||||
public string RollCallLabel => "ساعت حضور و غیاب";
|
||||
|
||||
@@ -212,14 +212,52 @@ public interface IInstitutionContractApplication
|
||||
Task<OperationResult<OtpResultViewModel>> SendVerifyOtp(Guid id);
|
||||
Task<OperationResult> VerifyOtp(Guid publicId, string code);
|
||||
Task<InstitutionContractWorkshopDetailViewModel> GetWorkshopInitialDetails(long workshopDetailsId);
|
||||
|
||||
#region Extension
|
||||
|
||||
Task<InstitutionContractExtensionInquiryResult> GetExtensionInquiry(long previousContractId);
|
||||
Task<InstitutionContractExtensionWorkshopsResponse> GetExtensionWorkshops(InstitutionContractExtensionWorkshopsRequest request);
|
||||
Task<InstitutionContractExtensionPlanResponse> GetExtensionInstitutionPlan(InstitutionContractExtensionPlanRequest request);
|
||||
|
||||
Task<InstitutionContractExtensionWorkshopsResponse> GetExtensionWorkshops(
|
||||
InstitutionContractExtensionWorkshopsRequest request);
|
||||
|
||||
Task<InstitutionContractExtensionPlanResponse> GetExtensionInstitutionPlan(
|
||||
InstitutionContractExtensionPlanRequest request);
|
||||
|
||||
Task<InstitutionContractExtensionPaymentResponse> GetExtensionPaymentMethod(
|
||||
InstitutionContractExtensionPaymentRequest request);
|
||||
|
||||
|
||||
Task<OperationResult> ExtensionComplete(InstitutionContractExtensionCompleteRequest request);
|
||||
Task<List<InstitutionContractSelectListViewModel>> GetInstitutionContractSelectList(string search,string selected);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Upgrade (Amendment)
|
||||
|
||||
Task<InstitutionContractAmendmentWorkshopsResponse> GetAmendmentWorkshops(long institutionContractId);
|
||||
Task<InsertAmendmentTempWorkshopResponse> InsertAmendmentTempWorkshops(InstitutionContractAmendmentTempWorkshopViewModel request);
|
||||
Task RemoveAmendmentWorkshops(Guid workshopTempId);
|
||||
Task<InsitutionContractAmendmentPaymentResponse> GetAmendmentPaymentDetails(InsitutionContractAmendmentPaymentRequest request);
|
||||
|
||||
#endregion
|
||||
|
||||
Task<OperationResult> ResendVerifyLink(long institutionContractId);
|
||||
}
|
||||
|
||||
public class InsertAmendmentTempWorkshopResponse
|
||||
{
|
||||
public Guid WorkshopTempId { get; set; }
|
||||
public string Amount { get; set; }
|
||||
}
|
||||
|
||||
public class InstitutionContractAmendmentWorkshopsResponse
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public List<InstitutionContractAmendmentTempWorkshopViewModel> Workshops { get; set; }
|
||||
|
||||
public Guid TempId { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class InstitutionContractSelectListViewModel : SelectListViewModel;
|
||||
@@ -241,19 +279,7 @@ public class InstitutionContractExtensionInquiryResponse
|
||||
public string NationalCode { get; set; }
|
||||
}
|
||||
|
||||
public class InstitutionContractExtensionCompleteRequest
|
||||
{
|
||||
public Guid TemporaryId { get; set; }
|
||||
public bool IsInstallment { get; set; }
|
||||
public long LawId { get; set; }
|
||||
}
|
||||
|
||||
public class InstitutionContractExtensionPaymentResponse
|
||||
{
|
||||
public InstitutionContractExtensionPaymentOneTime OneTime { get; set; }
|
||||
public InstitutionContractExtensionPaymentMonthly Monthly { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class InstitutionContractExtensionPaymentMonthly:InstitutionContractExtensionPaymentOneTime
|
||||
{
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
||||
|
||||
public class InsitutionContractAmendmentPaymentRequest
|
||||
{
|
||||
public Guid TempId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
||||
|
||||
public class InsitutionContractAmendmentPaymentResponse
|
||||
{
|
||||
public InstitutionContractPaymentOneTimeViewModel OneTime { get; set; }
|
||||
public InstitutionContractPaymentMonthlyViewModel Monthly { get; set; }
|
||||
public string ContractStart { get; set; }
|
||||
public string ContractEnd { get; set; }
|
||||
public string OneMonthAmount { get; set; }
|
||||
public string TotalAmount { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
||||
|
||||
public class InstitutionContractAmendmentTempWorkshopViewModel
|
||||
{
|
||||
public Guid TempId { get; set; }
|
||||
|
||||
public Guid WorkshopTempId { get; set; }
|
||||
|
||||
public long CurrentWorkshopId { get; set; }
|
||||
|
||||
public long WorkshopId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام کارگاه
|
||||
/// </summary>
|
||||
public string WorkshopName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تعداد پرسنل
|
||||
/// </summary>
|
||||
public int CountPerson { get; set; }
|
||||
|
||||
|
||||
#region ServiceSelection
|
||||
|
||||
/// <summary>
|
||||
/// قرارداد و تصفیه
|
||||
/// </summary>
|
||||
public bool ContractAndCheckout { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// بیمه
|
||||
/// </summary>
|
||||
public bool Insurance { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// حضورغباب
|
||||
/// </summary>
|
||||
public bool RollCall { get; set; }
|
||||
|
||||
public bool RollCallInPerson { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// فیش غیر رسمی
|
||||
/// </summary>
|
||||
public bool CustomizeCheckout { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// خدمات حضوری قرداد و تصفیه
|
||||
/// </summary>
|
||||
public bool ContractAndCheckoutInPerson { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// خدمات حضوری بیمه
|
||||
/// </summary>
|
||||
public bool InsuranceInPerson { get; set; }
|
||||
|
||||
public double Price{ get; set; }
|
||||
public string PriceStr{ get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
||||
|
||||
public class InstitutionContractExtensionCompleteRequest
|
||||
{
|
||||
public Guid TemporaryId { get; set; }
|
||||
public bool IsInstallment { get; set; }
|
||||
public long LawId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
||||
|
||||
public class InstitutionContractExtensionPaymentResponse
|
||||
{
|
||||
public InstitutionContractPaymentOneTimeViewModel OneTime { get; set; }
|
||||
public InstitutionContractPaymentMonthlyViewModel Monthly { get; set; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
||||
|
||||
public class InstitutionContractPaymentOneTimeViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// مجموع مبالغ
|
||||
/// </summary>
|
||||
public string TotalAmount { get; set; }
|
||||
/// <summary>
|
||||
/// ارزش افزوده
|
||||
/// </summary>
|
||||
public string Tax { get; set; }
|
||||
/// <summary>
|
||||
/// مبلغ قابل پرداخت
|
||||
/// </summary>
|
||||
public string PaymentAmount { get; set; }
|
||||
}
|
||||
public class InstitutionContractPaymentMonthlyViewModel:InstitutionContractPaymentOneTimeViewModel
|
||||
{
|
||||
public List<MonthlyInstallment> Installments { get; set; }
|
||||
}
|
||||
@@ -3,4 +3,6 @@ namespace CompanyManagment.App.Contracts.InstitutionContract;
|
||||
public class InstitutionContractWorkshopDetailViewModel
|
||||
{
|
||||
public WorkshopServicesViewModel ServicesViewModel { get; set; }
|
||||
public string WorkshopName { get; set; }
|
||||
public int ArchiveCode { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Application;
|
||||
using Company.Application.Contracts.AuthorizedBankDetails;
|
||||
using Company.Domain.AuthorizedBankDetailsAgg;
|
||||
|
||||
namespace CompanyManagment.Application
|
||||
{
|
||||
public class AuthorizedBankDetailsApplication : IAuthorizedBankDetailsApplication
|
||||
{
|
||||
private readonly IAuthorizedBankDetailsRepository _authorizedBankDetailsRepository;
|
||||
|
||||
public AuthorizedBankDetailsApplication(IAuthorizedBankDetailsRepository authorizedBankDetailsRepository)
|
||||
{
|
||||
_authorizedBankDetailsRepository = authorizedBankDetailsRepository;
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateAuthorizedBankDetails command)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
|
||||
if (_authorizedBankDetailsRepository.Exists(x => x.CardNumber == command.CardNumber &&
|
||||
x.AccountNumber == command.AccountNumber &&
|
||||
x.IBan == command.IBan))
|
||||
return operation.Failed(ApplicationMessages.DuplicatedRecord);
|
||||
|
||||
var ownersList = new List<AuthorizedBankDetailsOwner>();
|
||||
if (command.OwnersList != null && command.OwnersList.Count > 0)
|
||||
{
|
||||
foreach (var owner in command.OwnersList)
|
||||
{
|
||||
var bankDetailsOwner = new AuthorizedBankDetailsOwner(
|
||||
owner.FName,
|
||||
owner.LName,
|
||||
owner.NationalIdentifier,
|
||||
owner.CustomerType
|
||||
);
|
||||
ownersList.Add(bankDetailsOwner);
|
||||
}
|
||||
}
|
||||
|
||||
var authorizedBankDetails = new AuthorizedBankDetails(
|
||||
command.CardNumber,
|
||||
command.AccountNumber,
|
||||
command.IBan,
|
||||
command.BankName,
|
||||
ownersList
|
||||
);
|
||||
|
||||
_authorizedBankDetailsRepository.Create(authorizedBankDetails);
|
||||
_authorizedBankDetailsRepository.SaveChanges();
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
public EditAuthorizedBankDetails GetDetails(long id)
|
||||
{
|
||||
return _authorizedBankDetailsRepository.GetDetails(id);
|
||||
}
|
||||
|
||||
public List<AuthorizedBankDetailsViewModel> Search(AuthorizedBankDetailsSearchModel searchModel)
|
||||
{
|
||||
return _authorizedBankDetailsRepository.Search(searchModel);
|
||||
}
|
||||
|
||||
public AuthorizedBankDetailsViewModel GetByIban(string iban)
|
||||
{
|
||||
return _authorizedBankDetailsRepository.GetByIban(iban);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.UID;
|
||||
using _0_Framework.Exceptions;
|
||||
using Company.Domain.ContarctingPartyAgg;
|
||||
using Company.Domain.ContractingPartyBankAccountsAgg;
|
||||
using CompanyManagment.App.Contracts.ContractingPartyBankAccounts;
|
||||
@@ -12,13 +16,15 @@ public class ContractingPartyBankAccountsApplication : IContractingPartyBankAcco
|
||||
{
|
||||
private readonly IContractingPartyBankAccountsRepository _contractingPartyBankAccountsRepository;
|
||||
private readonly IPersonalContractingPartyRepository _personalContractingPartyRepository;
|
||||
private readonly IUidService _uidService;
|
||||
|
||||
public ContractingPartyBankAccountsApplication(
|
||||
IContractingPartyBankAccountsRepository contractingPartyBankAccountsRepository,
|
||||
IPersonalContractingPartyRepository personalContractingPartyRepository)
|
||||
IPersonalContractingPartyRepository personalContractingPartyRepository, IUidService uidService)
|
||||
{
|
||||
_contractingPartyBankAccountsRepository = contractingPartyBankAccountsRepository;
|
||||
_personalContractingPartyRepository = personalContractingPartyRepository;
|
||||
_uidService = uidService;
|
||||
}
|
||||
|
||||
public async Task<OperationResult> Create(CreateContractingPartyBankAccounts command)
|
||||
@@ -69,18 +75,19 @@ public class ContractingPartyBankAccountsApplication : IContractingPartyBankAcco
|
||||
if (string.IsNullOrWhiteSpace(command.IBan))
|
||||
return operationResult.Failed("شماره شبا خود را وارد کنید");
|
||||
}
|
||||
else if(string.IsNullOrWhiteSpace(command.CardNumber) &&
|
||||
else if (string.IsNullOrWhiteSpace(command.CardNumber) &&
|
||||
string.IsNullOrWhiteSpace(command.AccountNumber) &&
|
||||
string.IsNullOrWhiteSpace(command.IBan))
|
||||
{
|
||||
return operationResult.Failed(" حداقل یکی از اطلاعات بانکی را وارد کنید: شماره کارت، شماره حساب یا شماره شبا");
|
||||
return operationResult.Failed(
|
||||
" حداقل یکی از اطلاعات بانکی را وارد کنید: شماره کارت، شماره حساب یا شماره شبا");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.AccountHolderName))
|
||||
{
|
||||
return operationResult.Failed("نام صاحب حساب را وارد کنید");
|
||||
}
|
||||
|
||||
|
||||
|
||||
var entity = new ContractingPartyBankAccount(command.ContractingPartyId, command.CardNumber,
|
||||
command.AccountHolderName, command.AccountNumber, command.IBan, command.IsAuth);
|
||||
@@ -130,4 +137,83 @@ public class ContractingPartyBankAccountsApplication : IContractingPartyBankAcco
|
||||
{
|
||||
return await _contractingPartyBankAccountsRepository.ContractingPartyNamesSelectList(search, selected);
|
||||
}
|
||||
|
||||
public async Task<ContractingPartyBankInquiryResponse> InquiryContractingPartyBankDetails(
|
||||
InquiryContractingPartyBankDetailsRequest command)
|
||||
{
|
||||
var iBan = command.IBan;
|
||||
var cardNumber = command.CardNumber;
|
||||
var accountNumber = command.AccountNumber;
|
||||
var uidBank = command.UidBank;
|
||||
ContractingPartyBankInquiryResponse result = new ContractingPartyBankInquiryResponse();
|
||||
if (!string.IsNullOrWhiteSpace(iBan))
|
||||
{
|
||||
if (!iBan.IsvalidIban())
|
||||
{
|
||||
throw new BadRequestException("شماره شبا وارد شده معتبر نمی باشد");
|
||||
}
|
||||
|
||||
var response = await _uidService.IbanInquiry(iBan);
|
||||
if (response.ResponseContext.Status.Code != 0)
|
||||
{
|
||||
throw new BadRequestException("خطای احراز هویت. کد خطا: " + response.ResponseContext.Status.Code);
|
||||
}
|
||||
|
||||
var owner = response.Owners.FirstOrDefault();
|
||||
var ownerFirstName = owner != null ? $"{owner.FirstName} {owner.LastName}" : "";
|
||||
result.FullName = ownerFirstName;
|
||||
result.AccountNumber = response.AccountBasicInformation.AccountNumber;
|
||||
result.Iban = response.AccountBasicInformation.Iban;
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(cardNumber))
|
||||
{
|
||||
if (!cardNumber.IsValidCardNumber())
|
||||
{
|
||||
throw new BadRequestException("شماره کارت وارد شده معتبر نمی باشد");
|
||||
}
|
||||
|
||||
var bankCardRes = await _uidService.CardToIban(cardNumber);
|
||||
if (bankCardRes.ResponseContext.Status.Code != 0)
|
||||
{
|
||||
throw new BadRequestException("خطای احراز هویت. کد خطا: " + bankCardRes.ResponseContext.Status.Code);
|
||||
}
|
||||
|
||||
var response = await _uidService.IbanInquiry(bankCardRes.Iban);
|
||||
if (response.ResponseContext.Status.Code != 0)
|
||||
{
|
||||
throw new BadRequestException("خطای احراز هویت. کد خطا: " + response.ResponseContext.Status.Code);
|
||||
}
|
||||
|
||||
var owner = response.Owners.FirstOrDefault();
|
||||
var ownerFirstName = owner != null ? $"{owner.FirstName} {owner.LastName}" : "";
|
||||
result.FullName = ownerFirstName;
|
||||
result.AccountNumber = response.AccountBasicInformation.AccountNumber;
|
||||
result.CardNumber = cardNumber;
|
||||
result.Iban = response.AccountBasicInformation.Iban;
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(accountNumber))
|
||||
{
|
||||
var accountNumberRes = await _uidService.AccountToIban(accountNumber, uidBank.Value);
|
||||
if (accountNumberRes.ResponseContext.Status.Code != 0)
|
||||
{
|
||||
throw new BadRequestException(
|
||||
"خطای احراز هویت. کد خطا: " + accountNumberRes.ResponseContext.Status.Code);
|
||||
}
|
||||
|
||||
var response = await _uidService.IbanInquiry(accountNumberRes.Iban);
|
||||
|
||||
var owner = response.Owners.FirstOrDefault();
|
||||
var ownerFirstName = owner != null ? $"{owner.FirstName} {owner.LastName}" : "";
|
||||
result.FullName = ownerFirstName;
|
||||
result.AccountNumber = response.AccountBasicInformation.AccountNumber;
|
||||
result.Iban = response.AccountBasicInformation.Iban;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new BadRequestException(
|
||||
"حداقل یکی از اطلاعات بانکی را وارد کنید: شماره کارت، شماره حساب یا شماره شبا");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -373,7 +373,9 @@ namespace CompanyManagment.Application
|
||||
Color = color,
|
||||
PersonnelCode = personnelCodes.FirstOrDefault(y => x.Id == y.EmployeeId)?.PersonnelCode.ToString() ?? "-"
|
||||
};
|
||||
}).OrderByDescending(x => x.IsEligible).ThenByDescending(x => x.Reason).ToList();
|
||||
}).OrderBy(x => x.Color switch { "orange" => 0, "white" => 1, "red" => 2, "green" => 3, "black" => 4, _ => 5 })
|
||||
.ToList();
|
||||
|
||||
return op.Succcedded(employees);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.AccessControl;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using _0_Framework.Application.UID;
|
||||
@@ -13,6 +14,7 @@ using Company.Domain.WorkshopAgg;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
using CompanyManagment.EFCore.Repository;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Identity.Client;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
@@ -42,7 +44,6 @@ public class EmployerApplication : IEmployerApplication
|
||||
}
|
||||
|
||||
|
||||
|
||||
public OperationResult Active(long id)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
@@ -1029,7 +1030,7 @@ public class EmployerApplication : IEmployerApplication
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Api
|
||||
|
||||
public async Task<List<GetEmployerListViewModel>> GetEmployerList(GetEmployerSearchModel searchModel)
|
||||
@@ -1285,9 +1286,10 @@ public class EmployerApplication : IEmployerApplication
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
public async Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id)
|
||||
public async Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id,
|
||||
LegalType? legalType = null)
|
||||
{
|
||||
return await _EmployerRepository.GetSelectList(search, id);
|
||||
return await _EmployerRepository.GetSelectList(search, id, legalType);
|
||||
}
|
||||
|
||||
async Task<OperationResult<string>> IEmployerApplication.Remove(long id)
|
||||
@@ -1312,19 +1314,36 @@ public class EmployerApplication : IEmployerApplication
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
var tranasction = await _EmployerRepository.BeginTransactionAsync();
|
||||
OperationResult<Employer> createEmployerResult = command.LegalType switch
|
||||
Employer employer;
|
||||
if (command.EmployerId != 0)
|
||||
{
|
||||
LegalType.Real => await CreateRealEmployerRegistration(command.RealEmployer, command.ContractingPartyId),
|
||||
LegalType.Legal => await CreateLegalEmployerRegistration(command.LegalEmployer, command.ContractingPartyId),
|
||||
_ => throw new ArgumentOutOfRangeException()
|
||||
};
|
||||
var employer = createEmployerResult.Data;
|
||||
employer = _EmployerRepository.Get(command.EmployerId);
|
||||
if (employer == null)
|
||||
throw new NotFoundException("کارفرمای مورد نظر یافت نشد");
|
||||
}
|
||||
else
|
||||
{
|
||||
OperationResult<Employer> createEmployerResult = command.LegalType switch
|
||||
{
|
||||
LegalType.Real =>
|
||||
await CreateRealEmployerRegistration(command.RealEmployer, command.ContractingPartyId),
|
||||
LegalType.Legal => await CreateLegalEmployerRegistration(command.LegalEmployer,
|
||||
command.ContractingPartyId),
|
||||
_ => throw new ArgumentOutOfRangeException()
|
||||
};
|
||||
employer = createEmployerResult.Data;
|
||||
|
||||
if (!createEmployerResult.IsSuccedded)
|
||||
return operation.Failed(createEmployerResult.Message);
|
||||
if (!createEmployerResult.IsSuccedded)
|
||||
return operation.Failed(createEmployerResult.Message);
|
||||
}
|
||||
|
||||
var workshopDetails =
|
||||
await _institutionContractRepository.GetInstitutionWorkshopInitialDetails(command.InstitutionWorkshopInitialId);
|
||||
await _institutionContractRepository.GetInstitutionWorkshopInitialDetails(command
|
||||
.InstitutionWorkshopInitialId);
|
||||
if (workshopDetails.Employers.Any(x => x.EmployerId == employer.id))
|
||||
{
|
||||
throw new BadRequestException("این کارفرما قبلا در این کارگاه ثبت شده است");
|
||||
}
|
||||
workshopDetails.AddEmployer(employer.id);
|
||||
|
||||
await _institutionContractRepository.SaveChangesAsync();
|
||||
@@ -1335,7 +1354,7 @@ public class EmployerApplication : IEmployerApplication
|
||||
public async Task<OperationResult> EditWorkflowRegistration(EditEmployerWorkflowRegistration command)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
|
||||
|
||||
// Get the existing employer
|
||||
var employer = _EmployerRepository.Get(command.EmployerId);
|
||||
if (employer == null)
|
||||
@@ -1364,55 +1383,55 @@ public class EmployerApplication : IEmployerApplication
|
||||
public async Task<OperationResult> DeleteWorkflowRegistration(long employerId, long institutionWorkshopDetailsId)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
|
||||
|
||||
// Check if employer exists
|
||||
var employer = _EmployerRepository.Get(employerId);
|
||||
if (employer == null)
|
||||
return operation.Failed("کارفرمای مورد نظر یافت نشد");
|
||||
|
||||
|
||||
// Get workshop details
|
||||
var workshopDetails = await _institutionContractRepository.GetInstitutionWorkshopInitialDetails(institutionWorkshopDetailsId);
|
||||
var workshopDetails =
|
||||
await _institutionContractRepository
|
||||
.GetInstitutionWorkshopInitialDetails(institutionWorkshopDetailsId);
|
||||
if (workshopDetails == null)
|
||||
return operation.Failed("جزئیات کارگاه موسسه یافت نشد");
|
||||
|
||||
|
||||
// Find and remove the employer from workshop details
|
||||
var employerDetail = workshopDetails.Employers.FirstOrDefault(e => e.EmployerId == employerId);
|
||||
var employerDetail = workshopDetails
|
||||
.Employers.FirstOrDefault(e => e.EmployerId == employerId);
|
||||
if (employerDetail == null)
|
||||
return operation.Failed("کارفرما در لیست کارگاه یافت نشد");
|
||||
|
||||
|
||||
// Remove the employer from the list
|
||||
workshopDetails.Employers.Remove(employerDetail);
|
||||
|
||||
|
||||
await _institutionContractRepository.SaveChangesAsync();
|
||||
|
||||
// Delete the employer
|
||||
_EmployerRepository.Remove(employerId);
|
||||
await _EmployerRepository.SaveChangesAsync();
|
||||
|
||||
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
|
||||
public async Task<OperationResult<AuthenticateUserViewModel>> AuthenticateEmployer(string nationalCode,
|
||||
string dateOfBirth,
|
||||
string mobile)
|
||||
{
|
||||
var op = new OperationResult<AuthenticateUserViewModel>();
|
||||
|
||||
|
||||
var dateOfBirthGr = dateOfBirth.ToGeorgianDateTime();
|
||||
|
||||
|
||||
var isMachMobilAndNationalCode = await _uidService.IsMachPhoneWithNationalCode(nationalCode, mobile);
|
||||
if (isMachMobilAndNationalCode == null)
|
||||
return op.Failed("خطا در سرویس احراز هویت");
|
||||
if (!isMachMobilAndNationalCode.IsMatched)
|
||||
return op.Failed("شماره همراه وارد شده با کد ملی مطابقت ندارد");
|
||||
var apiRespons = await _uidService.GetPersonalInfo(nationalCode, dateOfBirth);
|
||||
|
||||
|
||||
if (apiRespons == null)
|
||||
throw new InternalServerException("سیستم احراز هویت در دسترس نمی باشد");
|
||||
|
||||
if (apiRespons.ResponseContext.Status.Code ==14)
|
||||
|
||||
if (apiRespons.ResponseContext.Status.Code == 14)
|
||||
throw new InternalServerException("سیستم احراز هویت در دسترس نمی باشد");
|
||||
|
||||
|
||||
if (apiRespons.ResponseContext.Status.Code != 0)
|
||||
return op.Failed($"{apiRespons.ResponseContext.Status.Message}");
|
||||
|
||||
@@ -1420,6 +1439,7 @@ public class EmployerApplication : IEmployerApplication
|
||||
? apiRespons.IdentificationInformation.NationalId
|
||||
: apiRespons.IdentificationInformation.ShenasnamehNumber;
|
||||
|
||||
|
||||
var res = new AuthenticateUserViewModel()
|
||||
{
|
||||
DateOfBirth = dateOfBirth,
|
||||
@@ -1436,6 +1456,12 @@ public class EmployerApplication : IEmployerApplication
|
||||
return op.Succcedded(res);
|
||||
}
|
||||
|
||||
public Task<ActionResult<EditEmployerWorkflowRegistration>> GetWorkflowRegistrationForEdit(long employerId,
|
||||
long institutionWorkshopDetailsId)
|
||||
{
|
||||
return _EmployerRepository.GetWorkflowRegistrationForEdit(employerId, institutionWorkshopDetailsId);
|
||||
}
|
||||
|
||||
private async Task<OperationResult<Employer>> CreateLegalEmployerRegistration(
|
||||
CreateLegalEmployerWorkflowRegistration command, long contractingPartyId)
|
||||
{
|
||||
@@ -1502,6 +1528,11 @@ public class EmployerApplication : IEmployerApplication
|
||||
command.GovernmentSystemInfo.EServiceUsername, command.GovernmentSystemInfo.EServicePassword,
|
||||
command.GovernmentSystemInfo.TaxUsername, command.GovernmentSystemInfo.TaxPassword,
|
||||
command.GovernmentSystemInfo.SanaUsername, command.GovernmentSystemInfo.SanaPassword);
|
||||
if (command.IsAuth)
|
||||
{
|
||||
legalEmployerData.LegalAuthentication(command.CeoFName,command.CeoLName,command.CeoFatherName,
|
||||
command.CeoIdNumber,command.IdNumberSeri,command.IdNumberSerial,command.CeoDateOfBirth,command.Gender,command.PhoneNumber);
|
||||
}
|
||||
|
||||
await _EmployerRepository.CreateAsync(legalEmployerData);
|
||||
await _EmployerRepository.SaveChangesAsync();
|
||||
@@ -1555,6 +1586,12 @@ public class EmployerApplication : IEmployerApplication
|
||||
command.GovernmentSystemInfo.EServicePassword,
|
||||
command.GovernmentSystemInfo.TaxUsername, command.GovernmentSystemInfo.TaxPassword,
|
||||
command.GovernmentSystemInfo.SanaUsername, command.GovernmentSystemInfo.SanaPassword);
|
||||
if (command.IsAuth)
|
||||
{
|
||||
employerData.Authentication(command.FName, command.LName, command.FatherName, command.IdNumber,
|
||||
command.IdNumberSeri,
|
||||
command.IdNumberSerial, command.DateOfBirth, command.Gender, command.PhoneNumber);
|
||||
}
|
||||
|
||||
await _EmployerRepository.CreateAsync(employerData);
|
||||
await _EmployerRepository.SaveChangesAsync();
|
||||
@@ -1664,5 +1701,6 @@ public class EmployerApplication : IEmployerApplication
|
||||
await _EmployerRepository.SaveChangesAsync();
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -106,8 +106,11 @@ public class FinancialStatmentApplication : IFinancialStatmentApplication
|
||||
debtor = command.DeptorString.MoneyToDouble();
|
||||
|
||||
}
|
||||
|
||||
var tDateGr = command.TdateFa.ToGeorgianDateTime();
|
||||
|
||||
if (!command.TdateFa.TryToGeorgianDateTime(out var tDateGr))
|
||||
{
|
||||
return op.Failed("تاریخ وارد شده صحیح نمی باشد");
|
||||
}
|
||||
if (_financialStatmentRepository.Exists(x => x.ContractingPartyId == command.ContractingPartyId))
|
||||
{
|
||||
var financialStatment = _financialStatmentRepository.GetDetailsByContractingPartyId(command.ContractingPartyId);
|
||||
|
||||
@@ -318,7 +318,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
command.DailyCompenseation, command.Obligation,
|
||||
command.TotalAmount, command.ExtensionNo, command.WorkshopManualCount, command.EmployeeManualCount,
|
||||
command.Description, command.OfficialCompany, command.TypeOfContract, command.HasValueAddedTax,
|
||||
command.ValueAddedTax, [],command.LawId);
|
||||
command.ValueAddedTax, [], command.LawId);
|
||||
|
||||
_institutionContractRepository.Create(createContract);
|
||||
_institutionContractRepository.SaveChanges();
|
||||
@@ -1046,7 +1046,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
command.Workshops.Count.ToString(),
|
||||
command.Workshops.Sum(x => x.PersonnelCount).ToString(), command.Description,
|
||||
"NotOfficial", "JobRelation", hasValueAddedTax,
|
||||
command.TaxAmount, workshopDetails,command.LawId);
|
||||
command.TaxAmount, workshopDetails, command.LawId);
|
||||
|
||||
|
||||
FinancialStatment financialStatement;
|
||||
@@ -1139,11 +1139,11 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
if (res.IsSuccedded)
|
||||
CreateContractingPartyAccount(contractingParty.id, res.SendId);
|
||||
|
||||
await _institutionContractRepository.SaveChangesAsync();
|
||||
|
||||
await _smsService.SendInstitutionVerificationLink(contractingParty.Phone, contractingPartyFullName,
|
||||
entity.PublicId);
|
||||
entity.PublicId, contractingParty.id,entity.id );
|
||||
|
||||
await _institutionContractRepository.SaveChangesAsync();
|
||||
|
||||
await transaction.CommitAsync();
|
||||
return opration.Succcedded();
|
||||
@@ -1153,7 +1153,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Task<List<RegistrationWorkflowMainListViewModel>> RegistrationWorkflowMainList()
|
||||
{
|
||||
@@ -1249,8 +1249,31 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
|
||||
if (institutionContract.VerifyCode != code)
|
||||
return op.Failed("کد وارد شده صحیح نمی باشد");
|
||||
|
||||
var transaction = await _institutionContractRepository.BeginTransactionAsync();
|
||||
institutionContract.SetPendingWorkflow();
|
||||
|
||||
var phone = institutionContract.ContactInfoList.FirstOrDefault(x =>
|
||||
x.SendSms && x.Position == "طرف قرارداد" && x.PhoneType == "شماره همراه");
|
||||
if (phone !=null)
|
||||
{
|
||||
var userPass = contractingParty.IsLegal == "حقیقی"
|
||||
? contractingParty.Nationalcode
|
||||
: contractingParty.NationalId;
|
||||
var createAcc = new RegisterAccount
|
||||
{
|
||||
Fullname = contractingParty.LName,
|
||||
Username = userPass,
|
||||
Password = userPass,
|
||||
Mobile = phone.PhoneNumber,
|
||||
NationalCode = userPass
|
||||
};
|
||||
var res = _accountApplication.RegisterClient(createAcc);
|
||||
if (res.IsSuccedded)
|
||||
CreateContractingPartyAccount(contractingParty.id, res.SendId);
|
||||
}
|
||||
|
||||
await transaction.CommitAsync();
|
||||
await _institutionContractRepository.SaveChangesAsync();
|
||||
return op.Succcedded();
|
||||
}
|
||||
@@ -1259,6 +1282,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
{
|
||||
var details = await _institutionContractRepository.GetInstitutionWorkshopInitialDetails(workshopDetailsId);
|
||||
var services = details.Services;
|
||||
var newArchiveCode = _workshopRepository.GetLastArchiveCode() + 1;
|
||||
|
||||
var res = new InstitutionContractWorkshopDetailViewModel()
|
||||
{
|
||||
@@ -1271,7 +1295,9 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
InsuranceInPerson = services.InsuranceInPerson,
|
||||
RollCall = services.RollCall,
|
||||
RollCallInPerson = services.RollCallInPerson
|
||||
}
|
||||
},
|
||||
WorkshopName = details.WorkshopName,
|
||||
ArchiveCode = newArchiveCode
|
||||
};
|
||||
return res;
|
||||
}
|
||||
@@ -1287,12 +1313,14 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
return await _institutionContractRepository.GetExtensionWorkshops(request);
|
||||
}
|
||||
|
||||
public async Task<InstitutionContractExtensionPlanResponse> GetExtensionInstitutionPlan(InstitutionContractExtensionPlanRequest request)
|
||||
public async Task<InstitutionContractExtensionPlanResponse> GetExtensionInstitutionPlan(
|
||||
InstitutionContractExtensionPlanRequest request)
|
||||
{
|
||||
return await _institutionContractRepository.GetExtensionInstitutionPlan(request);
|
||||
}
|
||||
|
||||
public async Task<InstitutionContractExtensionPaymentResponse> GetExtensionPaymentMethod(InstitutionContractExtensionPaymentRequest request)
|
||||
public async Task<InstitutionContractExtensionPaymentResponse> GetExtensionPaymentMethod(
|
||||
InstitutionContractExtensionPaymentRequest request)
|
||||
{
|
||||
return await _institutionContractRepository.GetExtensionPaymentMethod(request);
|
||||
}
|
||||
@@ -1307,6 +1335,48 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
return await _institutionContractRepository.GetInstitutionContractSelectList(search,selected);
|
||||
}
|
||||
|
||||
public async Task<InstitutionContractAmendmentWorkshopsResponse> GetAmendmentWorkshops(long institutionContractId)
|
||||
{
|
||||
return await _institutionContractRepository.GetAmendmentWorkshops(institutionContractId);
|
||||
}
|
||||
|
||||
public async Task<InsertAmendmentTempWorkshopResponse> InsertAmendmentTempWorkshops(InstitutionContractAmendmentTempWorkshopViewModel request)
|
||||
{
|
||||
return await _institutionContractRepository.InsertAmendmentTempWorkshops(request);
|
||||
}
|
||||
|
||||
public Task RemoveAmendmentWorkshops(Guid workshopTempId)
|
||||
{
|
||||
return _institutionContractRepository.RemoveAmendmentWorkshops(workshopTempId);
|
||||
}
|
||||
|
||||
public Task<InsitutionContractAmendmentPaymentResponse> GetAmendmentPaymentDetails(InsitutionContractAmendmentPaymentRequest request)
|
||||
{
|
||||
return _institutionContractRepository.GetAmendmentPaymentDetails(request);
|
||||
}
|
||||
|
||||
public async Task<OperationResult> ResendVerifyLink(long institutionContractId)
|
||||
{
|
||||
var institutionContract = _institutionContractRepository.Get(institutionContractId);
|
||||
|
||||
if (institutionContract == null)
|
||||
{
|
||||
throw new NotFoundException("رکورد مورد نظر یافت نشد");
|
||||
}
|
||||
|
||||
if (institutionContract.VerificationStatus != InstitutionContractVerificationStatus.PendingForVerify)
|
||||
{
|
||||
throw new BadRequestException("این قرارداد مالی در وضعیت مناسبی برای ارسال مجدد لینک تایید نمی باشد");
|
||||
}
|
||||
var contractingParty = _contractingPartyRepository.Get(institutionContract.ContractingPartyId);
|
||||
if (contractingParty == null)
|
||||
throw new NotFoundException("طرف قرارداد یافت نشد");
|
||||
var contractingPartyFullName = contractingParty.FName + " " + contractingParty.LName;
|
||||
await _smsService.SendInstitutionVerificationLink(contractingParty.Phone, contractingPartyFullName,
|
||||
institutionContract.PublicId, contractingParty.id, institutionContract.id);
|
||||
return new OperationResult().Succcedded();
|
||||
}
|
||||
|
||||
|
||||
private async Task<OperationResult<PersonalContractingParty>> CreateLegalContractingPartyEntity(
|
||||
CreateInstitutionContractLegalPartyRequest request, long representativeId, string address, string city,
|
||||
@@ -1347,8 +1417,8 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
|
||||
if (request.IsAuth)
|
||||
{
|
||||
legalContractingParty.LegalAuthentication(request.FName,request.LName,request.FatherName,
|
||||
request.IdNumber,null,null,request.BirthDateFa,request.Gender,request.PhoneNumber);
|
||||
legalContractingParty.LegalAuthentication(request.FName, request.LName, request.FatherName,
|
||||
request.IdNumber, null, null, request.BirthDateFa, request.Gender, request.PhoneNumber);
|
||||
}
|
||||
|
||||
await _contractingPartyRepository.CreateAsync(legalContractingParty);
|
||||
@@ -1393,7 +1463,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
if (request.IsAuth)
|
||||
{
|
||||
personalContractingParty.Authentication(request.FName, request.LName, request.FatherName,
|
||||
request.IdNumber, null,null, request.BirthDateFa, request.Gender,request.PhoneNumber);
|
||||
request.IdNumber, null, null, request.BirthDateFa, request.Gender, request.PhoneNumber);
|
||||
}
|
||||
|
||||
await _contractingPartyRepository.CreateAsync(personalContractingParty);
|
||||
@@ -1402,7 +1472,7 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
||||
return operation.Succcedded(personalContractingParty);
|
||||
}
|
||||
|
||||
private List<InstitutionContractInstallment> CalculateInstallment(double amount, int installmentCount,
|
||||
public static List<InstitutionContractInstallment> CalculateInstallment(double amount, int installmentCount,
|
||||
string loanStartDate, bool getRounded)
|
||||
{
|
||||
int day = Convert.ToInt32(loanStartDate.Substring(8, 2));
|
||||
@@ -1510,4 +1580,4 @@ public class WorkshopsAndEmployeeViewModel
|
||||
public int ArchiveCode { get; set; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
@@ -1869,6 +1869,11 @@ public class InsuranceListApplication : IInsuranceListApplication
|
||||
bool isManager = jobId is 10 or 16 or 17 or 18 or 3498;
|
||||
if (isManager && !includeStatus)
|
||||
return 0;
|
||||
|
||||
//پرسنل استثناء سیدعسکر موسوی زاده - فروشگاه ولی عصر
|
||||
if (employeeId == 1496)
|
||||
return 0;
|
||||
|
||||
//پرسنل استثناء
|
||||
if (employeeId == 42783)
|
||||
return 53082855;
|
||||
|
||||
@@ -674,7 +674,7 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
result.MonthlyValueAddedTaxStr= tenPercent.ToMoney();
|
||||
var monthlyTotalPaymentDouble = sumOfWorkshopsPaymentDouble + tenPercent;
|
||||
result.MonthlyTotalPaymentStr = monthlyTotalPaymentDouble.ToMoney();
|
||||
var installmentList = InstitutionContractRepository.InstitutionMonthlyInstallmentCaculation(duration, monthlyTotalPaymentDouble, installmentstart);
|
||||
var installmentList = InstitutionContractRepository.InstitutionMonthlyInstallmentCaculation((int)duration, monthlyTotalPaymentDouble, installmentstart);
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -1048,7 +1048,7 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
|
||||
var institutionContract =
|
||||
await _institutionContractRepository.GetIncludeWorkshopDetailsAsync(contractWorkshopInitial
|
||||
.InstitutionContractId);
|
||||
.WorkshopGroup.InstitutionContractId);
|
||||
if (institutionContract == null)
|
||||
{
|
||||
return operation.Failed("قرارداد مالی موسسه یافت نشد");
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Company.Domain.AdminMonthlyOverviewAgg;
|
||||
using Company.Domain.AndroidApkVersionAgg;
|
||||
using Company.Domain.AuthorizedBankDetailsAgg;
|
||||
using Company.Domain.BankAgg;
|
||||
using Company.Domain.BillAgg;
|
||||
using Company.Domain.Board;
|
||||
@@ -201,6 +202,9 @@ public class CompanyContext : DbContext
|
||||
|
||||
public DbSet<InstitutionContractContactInfoTemp> InstitutionContractContactInfoTemps { get; set; }
|
||||
|
||||
public DbSet<AuthorizedBankDetails> AuthorizedBankDetails { get; set; }
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Pooya
|
||||
@@ -309,7 +313,6 @@ public class CompanyContext : DbContext
|
||||
|
||||
public DbSet<Employer> Employers { get; set; }
|
||||
|
||||
|
||||
public CompanyContext(DbContextOptions<CompanyContext> options) :base(options)
|
||||
{
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
using Company.Domain.AuthorizedBankDetailsAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CompanyManagment.EFCore.Mapping
|
||||
{
|
||||
public class AuthorizedBankDetailsMapping : IEntityTypeConfiguration<AuthorizedBankDetails>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<AuthorizedBankDetails> builder)
|
||||
{
|
||||
builder.ToTable("AuthorizedBankDetails");
|
||||
builder.HasKey(x => x.id);
|
||||
|
||||
builder.Property(x => x.CardNumber).HasMaxLength(50);
|
||||
builder.Property(x => x.AccountNumber).HasMaxLength(50);
|
||||
builder.Property(x => x.IBan).HasMaxLength(50);
|
||||
builder.Property(x => x.BankName).HasMaxLength(100);
|
||||
|
||||
// Configure owners as owned entities (value objects)
|
||||
builder.OwnsMany(x => x.OwnersList, ownersBuilder =>
|
||||
{
|
||||
ownersBuilder.ToTable("AuthorizedBankDetailsOwners");
|
||||
ownersBuilder.WithOwner().HasForeignKey("AuthorizedBankDetailsId");
|
||||
ownersBuilder.Property<int>("Id").ValueGeneratedOnAdd();
|
||||
ownersBuilder.HasKey("Id");
|
||||
|
||||
ownersBuilder.Property(x => x.FName).HasMaxLength(100);
|
||||
ownersBuilder.Property(x => x.LName).HasMaxLength(100);
|
||||
ownersBuilder.Property(x => x.NationalIdentifier).HasMaxLength(20);
|
||||
ownersBuilder.Property(x => x.CustomerType).HasMaxLength(50);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
10971
CompanyManagment.EFCore/Migrations/20251014082438_add authenticate columns to employer.Designer.cs
generated
Normal file
10971
CompanyManagment.EFCore/Migrations/20251014082438_add authenticate columns to employer.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,49 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addauthenticatecolumnstoemployer : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "IdNumberSeri",
|
||||
table: "Employers",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "IdNumberSerial",
|
||||
table: "Employers",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsAuth",
|
||||
table: "Employers",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IdNumberSeri",
|
||||
table: "Employers");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IdNumberSerial",
|
||||
table: "Employers");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsAuth",
|
||||
table: "Employers");
|
||||
}
|
||||
}
|
||||
}
|
||||
11048
CompanyManagment.EFCore/Migrations/20251019092906_add authorized bank details.Designer.cs
generated
Normal file
11048
CompanyManagment.EFCore/Migrations/20251019092906_add authorized bank details.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addauthorizedbankdetails : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AuthorizedBankDetails",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
CardNumber = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
AccountNumber = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
IBan = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
BankName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table => { table.PrimaryKey("PK_AuthorizedBankDetails", x => x.id); });
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AuthorizedBankDetailsOwners",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "int", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
FName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
LName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
NationalIdentifier = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
|
||||
CustomerType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
AuthorizedBankDetailsId = table.Column<long>(type: "bigint", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AuthorizedBankDetailsOwners", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_AuthorizedBankDetailsOwners_AuthorizedBankDetails_AuthorizedBankDetailsId",
|
||||
column: x => x.AuthorizedBankDetailsId,
|
||||
principalTable: "AuthorizedBankDetails",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AuthorizedBankDetailsOwners_AuthorizedBankDetailsId",
|
||||
table: "AuthorizedBankDetailsOwners",
|
||||
column: "AuthorizedBankDetailsId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "AuthorizedBankDetailsOwners");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AuthorizedBankDetails");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -90,6 +90,38 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("AndroidApkVersions", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.AuthorizedBankDetailsAgg.AuthorizedBankDetails", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<string>("AccountNumber")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("BankName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("CardNumber")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("IBan")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("AuthorizedBankDetails", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.AuthorizedPersonAgg.AuthorizedPerson", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
@@ -3209,6 +3241,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<long>("InstitutionContractId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("LawId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<DateTime>("VerificationCreation")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
@@ -6779,9 +6814,18 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("IdNumberSeri")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("IdNumberSerial")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("IsAuth")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("IsLegal")
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
@@ -6861,6 +6905,48 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("EmployerWorkshop");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.AuthorizedBankDetailsAgg.AuthorizedBankDetails", b =>
|
||||
{
|
||||
b.OwnsMany("Company.Domain.AuthorizedBankDetailsAgg.AuthorizedBankDetailsOwner", "OwnersList", b1 =>
|
||||
{
|
||||
b1.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<int>("Id"));
|
||||
|
||||
b1.Property<long>("AuthorizedBankDetailsId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("CustomerType")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b1.Property<string>("FName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b1.Property<string>("LName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b1.Property<string>("NationalIdentifier")
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b1.HasKey("Id");
|
||||
|
||||
b1.HasIndex("AuthorizedBankDetailsId");
|
||||
|
||||
b1.ToTable("AuthorizedBankDetailsOwners", (string)null);
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("AuthorizedBankDetailsId");
|
||||
});
|
||||
|
||||
b.Navigation("OwnersList");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.Board.Board", b =>
|
||||
{
|
||||
b.HasOne("Company.Domain.BoardType.BoardType", "BoardType")
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework_b.InfraStructure;
|
||||
using Company.Application.Contracts.AuthorizedBankDetails;
|
||||
using Company.Domain.AuthorizedBankDetailsAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository
|
||||
{
|
||||
public class AuthorizedBankDetailsRepository : RepositoryBase<long, AuthorizedBankDetails>, IAuthorizedBankDetailsRepository
|
||||
{
|
||||
private readonly CompanyContext _context;
|
||||
|
||||
public AuthorizedBankDetailsRepository(CompanyContext context) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public EditAuthorizedBankDetails GetDetails(long id)
|
||||
{
|
||||
var authorizedBankDetails = _context.AuthorizedBankDetails
|
||||
.Include(x => x.OwnersList)
|
||||
.FirstOrDefault(x => x.id == id);
|
||||
|
||||
if (authorizedBankDetails == null)
|
||||
return new EditAuthorizedBankDetails();
|
||||
|
||||
var result = new EditAuthorizedBankDetails
|
||||
{
|
||||
Id = authorizedBankDetails.id,
|
||||
CardNumber = authorizedBankDetails.CardNumber,
|
||||
AccountNumber = authorizedBankDetails.AccountNumber,
|
||||
IBan = authorizedBankDetails.IBan,
|
||||
BankName = authorizedBankDetails.BankName,
|
||||
OwnersList = authorizedBankDetails.OwnersList.Select(o => new AuthorizedBankDetailsOwnerViewModel
|
||||
{
|
||||
FName = o.FName,
|
||||
LName = o.LName,
|
||||
NationalIdentifier = o.NationalIdentifier,
|
||||
CustomerType = o.CustomerType
|
||||
}).ToList()
|
||||
};
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<AuthorizedBankDetailsViewModel> Search(AuthorizedBankDetailsSearchModel searchModel)
|
||||
{
|
||||
var query = _context.AuthorizedBankDetails
|
||||
.Include(x => x.OwnersList)
|
||||
.Select(x => new AuthorizedBankDetailsViewModel
|
||||
{
|
||||
Id = x.id,
|
||||
CardNumber = x.CardNumber,
|
||||
AccountNumber = x.AccountNumber,
|
||||
IBan = x.IBan,
|
||||
});
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.CardNumber))
|
||||
query = query.Where(x => x.CardNumber.Contains(searchModel.CardNumber));
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.AccountNumber))
|
||||
query = query.Where(x => x.AccountNumber.Contains(searchModel.AccountNumber));
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.IBan))
|
||||
query = query.Where(x => x.IBan.Contains(searchModel.IBan));
|
||||
|
||||
// if (!string.IsNullOrWhiteSpace(searchModel.BankName))
|
||||
// query = query.Where(x => x.BankName.Contains(searchModel.BankName));
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.NationalIdentifier))
|
||||
query = query.Where(x =>
|
||||
_context.AuthorizedBankDetails
|
||||
.Include(a => a.OwnersList)
|
||||
.Any(a => a.id == x.Id &&
|
||||
a.OwnersList.Any(o => o.NationalIdentifier.Contains(searchModel.NationalIdentifier))));
|
||||
|
||||
return query.OrderByDescending(x => x.Id).ToList();
|
||||
}
|
||||
|
||||
public AuthorizedBankDetailsViewModel GetByIban(string iban)
|
||||
{
|
||||
return _context.AuthorizedBankDetails
|
||||
.Include(x => x.OwnersList)
|
||||
.Where(x => x.IBan == iban)
|
||||
.Select(x => new AuthorizedBankDetailsViewModel
|
||||
{
|
||||
Id = x.id,
|
||||
CardNumber = x.CardNumber,
|
||||
AccountNumber = x.AccountNumber,
|
||||
IBan = x.IBan,
|
||||
BankName = x.BankName,
|
||||
NationalIdentifier = x.OwnersList.FirstOrDefault().NationalIdentifier,
|
||||
Owners = x.OwnersList.Select(o=> new AuthorizedBankDetailsOwnerViewModel()
|
||||
{
|
||||
FName = o.FName,
|
||||
LName = o.LName,
|
||||
NationalIdentifier = o.NationalIdentifier,
|
||||
CustomerType = o.CustomerType
|
||||
}).ToList()
|
||||
})
|
||||
.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -10,6 +10,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using AccountManagement.Application.Contracts.SubAccount;
|
||||
using ZstdSharp.Unsafe;
|
||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
@@ -266,16 +267,26 @@ public class FinancialStatmentRepository : RepositoryBase<long, FinancialStatmen
|
||||
|
||||
public async Task<FinancialStatmentDetailsByContractingPartyViewModel> GetDetailsByContractingParty(long contractingPartyId,FinancialStatementSearchModel searchModel)
|
||||
{
|
||||
var contractingParty = await _context.PersonalContractingParties
|
||||
.FirstOrDefaultAsync(x=>x.id == contractingPartyId);
|
||||
|
||||
|
||||
if (contractingParty == null)
|
||||
throw new NotFoundException("طرف حساب یافت نشد");
|
||||
|
||||
var financialStatement = await _context.FinancialStatments
|
||||
.Include(x=>x.FinancialTransactionList)
|
||||
.FirstOrDefaultAsync(x=>x.ContractingPartyId == contractingPartyId);
|
||||
|
||||
|
||||
if (financialStatement == null)
|
||||
{
|
||||
throw new NotFoundException("وضعیت مالی مورد نظر یافت نشد");
|
||||
financialStatement = new FinancialStatment(contractingPartyId,contractingParty.FName+" "+contractingParty.LName);
|
||||
|
||||
await _context.AddAsync(financialStatement);
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool searched = false;
|
||||
#region Search
|
||||
|
||||
@@ -323,6 +334,71 @@ public class FinancialStatmentRepository : RepositoryBase<long, FinancialStatmen
|
||||
}
|
||||
#endregion
|
||||
double balance = 0;
|
||||
// var list = financialStatement.FinancialTransactionList.Select(t =>
|
||||
// {
|
||||
// if (!searched)
|
||||
// {
|
||||
// if (t.TypeOfTransaction == "debt")
|
||||
// {
|
||||
// balance += t.Deptor;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// balance -= t.Creditor;
|
||||
// }
|
||||
// }
|
||||
// return new FinancialTransactionDetailViewModel()
|
||||
// {
|
||||
// Id = t.id,
|
||||
// DateTimeGr = t.TdateGr,
|
||||
// DateFa = t.TdateGr.ToFarsi(),
|
||||
// TimeFa = $"{t.TdateGr:HH:mm}",
|
||||
// Description = t.DescriptionOption + " " + t.Description,
|
||||
// Debtor = t.Deptor,
|
||||
// Creditor = t.Creditor,
|
||||
// Balance = balance,
|
||||
// Type = t.TypeOfTransaction == "debt"
|
||||
// ? FinancialTransactionType.Debt
|
||||
// : FinancialTransactionType.Credit,
|
||||
// TypeStr = t.TypeOfTransaction == "debt" ? "ایجاد درآمد" : "دریافت درآمد"
|
||||
// };
|
||||
// }).OrderByDescending(t => t.DateTimeGr).ToList();
|
||||
|
||||
|
||||
var list = new List<FinancialTransactionDetailViewModel>();
|
||||
foreach (var financialTransaction in financialStatement.FinancialTransactionList.OrderBy(t=>t.TdateGr))
|
||||
{
|
||||
if (!searched)
|
||||
{
|
||||
if (financialTransaction.TypeOfTransaction == "debt")
|
||||
{
|
||||
balance += financialTransaction.Deptor;
|
||||
}
|
||||
else
|
||||
{
|
||||
balance -= financialTransaction.Creditor;
|
||||
}
|
||||
}
|
||||
var item = new FinancialTransactionDetailViewModel()
|
||||
{
|
||||
Id = financialTransaction.id,
|
||||
DateTimeGr = financialTransaction.TdateGr,
|
||||
DateFa = financialTransaction.TdateGr.ToFarsi(),
|
||||
TimeFa = $"{financialTransaction.TdateGr:HH:mm}",
|
||||
Description = financialTransaction.DescriptionOption + " " + financialTransaction.Description,
|
||||
Debtor = financialTransaction.Deptor,
|
||||
Creditor = financialTransaction.Creditor,
|
||||
Balance = balance,
|
||||
Type = financialTransaction.TypeOfTransaction == "debt"
|
||||
? FinancialTransactionType.Debt
|
||||
: FinancialTransactionType.Credit,
|
||||
TypeStr = financialTransaction.TypeOfTransaction == "debt" ? "ایجاد درآمد" : "دریافت درآمد"
|
||||
};
|
||||
list.Add(item);
|
||||
}
|
||||
|
||||
list.Reverse();
|
||||
|
||||
var res = new FinancialStatmentDetailsByContractingPartyViewModel()
|
||||
{
|
||||
Id = financialStatement.id,
|
||||
@@ -330,35 +406,7 @@ public class FinancialStatmentRepository : RepositoryBase<long, FinancialStatmen
|
||||
TotalCredit = financialStatement.FinancialTransactionList.Sum(x => x.Creditor),
|
||||
TotalDebt = financialStatement.FinancialTransactionList.Sum(x => x.Deptor),
|
||||
ContractingPartyName = financialStatement.ContractingPartyName,
|
||||
List = financialStatement.FinancialTransactionList.Select(t =>
|
||||
{
|
||||
if (!searched)
|
||||
{
|
||||
if (t.TypeOfTransaction == "debt")
|
||||
{
|
||||
balance += t.Deptor;
|
||||
}
|
||||
else
|
||||
{
|
||||
balance -= t.Creditor;
|
||||
}
|
||||
}
|
||||
return new FinancialTransactionDetailViewModel()
|
||||
{
|
||||
Id = t.id,
|
||||
DateTimeGr = t.TdateGr,
|
||||
DateFa = t.TdateGr.ToFarsi(),
|
||||
TimeFa = $"{t.TdateGr:HH:mm}",
|
||||
Description = t.DescriptionOption + " " + t.Description,
|
||||
Debtor = t.Deptor,
|
||||
Creditor = t.Creditor,
|
||||
Balance = balance,
|
||||
Type = t.TypeOfTransaction == "debt"
|
||||
? FinancialTransactionType.Debt
|
||||
: FinancialTransactionType.Credit,
|
||||
TypeStr = t.TypeOfTransaction == "debt" ? "ایجاد درآمد" : "دریافت درآمد"
|
||||
};
|
||||
}).OrderByDescending(t => t.DateTimeGr).ToList(),
|
||||
List = list,
|
||||
};
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ public class FineRepository : RepositoryBase<long, Fine>, IFineRepository
|
||||
}
|
||||
query = query.Where(x => x.EmployeeId == searchModel.EmployeeId);
|
||||
|
||||
var list = query.ToList().Select(x => new FineViewModel()
|
||||
var list = query.OrderByDescending(x=>x.FineDate).ToList().Select(x => new FineViewModel()
|
||||
{
|
||||
Amount = x.Amount.ToMoney(),
|
||||
AmountDouble = x.Amount,
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
@@ -16,8 +17,9 @@ using Company.Domain.empolyerAgg;
|
||||
using Company.Domain.FinancialStatmentAgg;
|
||||
using Company.Domain.FinancialTransactionAgg;
|
||||
using Company.Domain.InstitutionContractAgg;
|
||||
using Company.Domain.InstitutionContractAmendmentTempAgg;
|
||||
using Company.Domain.InstitutionContractContactInfoAgg;
|
||||
using Company.Domain.InstitutionContractInsertTempAgg;
|
||||
using Company.Domain.InstitutionContractExtensionTempAgg;
|
||||
using Company.Domain.InstitutionPlanAgg;
|
||||
using Company.Domain.WorkshopAgg;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
@@ -42,6 +44,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
private readonly IEmployerRepository _employerRepository;
|
||||
private readonly IWorkshopRepository _workshopRepository;
|
||||
private readonly IMongoCollection<InstitutionContractExtensionTemp> _institutionExtensionTemp;
|
||||
private readonly IMongoCollection<InstitutionContractAmendmentTemp> _institutionAmendmentTemp;
|
||||
private readonly IPlanPercentageRepository _planPercentageRepository;
|
||||
private readonly ISmsService _smsService;
|
||||
|
||||
@@ -56,6 +59,8 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
_smsService = smsService;
|
||||
_institutionExtensionTemp =
|
||||
database.GetCollection<InstitutionContractExtensionTemp>("InstitutionContractExtensionTemp");
|
||||
_institutionAmendmentTemp =
|
||||
database.GetCollection<InstitutionContractAmendmentTemp>("InstitutionContractAmendmentTemp");
|
||||
}
|
||||
|
||||
public EditInstitutionContract GetDetails(long id)
|
||||
@@ -1240,7 +1245,6 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
TotalCount = await joinedQuery.CountAsync(),
|
||||
List = list.Select(x =>
|
||||
{
|
||||
Console.WriteLine(x.contractingParty.id);
|
||||
var workshops = x.contractingParty.Employers
|
||||
.SelectMany(e => e.WorkshopEmployers.Select(we => we.Workshop)).DistinctBy(w => w.id).ToList();
|
||||
|
||||
@@ -1267,7 +1271,6 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
var workshopDetails = currentStateWorkshops?.Select(w =>
|
||||
{
|
||||
Workshop workshopSelected = null;
|
||||
Console.WriteLine(w.WorkshopId);
|
||||
if (w.WorkshopId != null && workshops.Select(ww => ww.id).Contains(w.WorkshopId.Value))
|
||||
{
|
||||
workshopSelected = workshops.First(ww => ww.id == w.WorkshopId.Value);
|
||||
@@ -1289,6 +1292,10 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
}
|
||||
};
|
||||
}).ToList() ?? [];
|
||||
|
||||
var employeesCount = _context.LeftWorkList
|
||||
.Where(l => workshops.Select(w => w.id).Contains(l.WorkshopId))
|
||||
.Count(l => l.StartWorkDate <= DateTime.Now && l.LeftWorkDate >= DateTime.Now);
|
||||
return new GetInstitutionContractListItemsViewModel()
|
||||
{
|
||||
ContractAmount = x.contract.ContractAmount,
|
||||
@@ -1303,14 +1310,17 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
Id = x.contract.id,
|
||||
ContractNo = x.contract.ContractNo,
|
||||
ArchiveNo = archiveCode.ToString(),
|
||||
EmployeesCount = _context.LeftWorkList
|
||||
.Where(l => workshops.Select(w => w.id).Contains(l.id))
|
||||
.Count(l => l.StartWorkDate <= DateTime.Now && l.LeftWorkDate >= DateTime.Now),
|
||||
EmployeesCount = employeesCount,
|
||||
EmployerNames = employers.Select(e => e.FullName).ToList(),
|
||||
ListStatus = status,
|
||||
IsExpired = x.contract.ContractEndGr <= endThisMontGr,
|
||||
ContractingPartyId = x.contractingParty.id,
|
||||
Workshops = workshopDetails
|
||||
Workshops = workshopDetails,
|
||||
IsInPersonContract = x.contract.WorkshopGroup?.CurrentWorkshops
|
||||
.Any(y=>y.Services.ContractInPerson)??true,
|
||||
IsOldContract = x.contract.WorkshopGroup?.CurrentWorkshops == null
|
||||
|| x.contract.WorkshopGroup.CurrentWorkshops.Count == 0
|
||||
|| x.contract.WorkshopGroup.CurrentWorkshops.Any(y => y.Price == 0)
|
||||
};
|
||||
}).ToList()
|
||||
};
|
||||
@@ -1476,6 +1486,11 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
case InstitutionContractListStatus.Deactive:
|
||||
joinedQuery = joinedQuery.Where(x => x.contract.ContractEndGr < now);
|
||||
break;
|
||||
|
||||
case InstitutionContractListStatus.PendingForVerify:
|
||||
joinedQuery = joinedQuery.Where(x =>
|
||||
x.contract.VerificationStatus == InstitutionContractVerificationStatus.PendingForVerify);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1820,9 +1835,11 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
|
||||
public async Task<InstitutionContract> GetByPublicIdAsync(Guid id)
|
||||
{
|
||||
return await _context.InstitutionContractSet.FirstOrDefaultAsync(x => x.PublicId == id);
|
||||
return await _context.InstitutionContractSet.Include(x=>x.ContactInfoList).FirstOrDefaultAsync(x => x.PublicId == id);
|
||||
}
|
||||
|
||||
#region Extension
|
||||
|
||||
public async Task<InstitutionContractExtensionInquiryResult> GetExtensionInquiry(long previousContractId)
|
||||
{
|
||||
var institutionContracts = await _context.InstitutionContractSet
|
||||
@@ -2035,7 +2052,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
res.ThreeMonths =
|
||||
CalculateInstitutionPlan(InstitutionContractDuration.ThreeMonths, amount, false, newContractStart);
|
||||
|
||||
res.SixMonths =
|
||||
res.SixMonths =
|
||||
CalculateInstitutionPlan(InstitutionContractDuration.SixMonths, amount, false, newContractStart);
|
||||
|
||||
res.TwelveMonths = CalculateInstitutionPlan(InstitutionContractDuration.TwelveMonths, amount, false,
|
||||
@@ -2046,7 +2063,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
.Select(x => new InstitutionContractExtensionTempWorkshop(x.WorkshopName, x.CountPerson,
|
||||
x.ContractAndCheckout, x.ContractAndCheckoutInPerson,
|
||||
x.Insurance, x.InsuranceInPerson, x.RollCall, x.RollCall,
|
||||
x.RollCallInPerson, x.WorkshopServicesAmount,x.WorkshopId)).ToList();
|
||||
x.RollCallInPerson, x.WorkshopServicesAmount, x.WorkshopId)).ToList();
|
||||
|
||||
institutionTemp.SetWorkshopsAndPlanAmounts(workshops, res.OneMonth, res.ThreeMonths, res.SixMonths,
|
||||
res.TwelveMonths, hasInPerson);
|
||||
@@ -2232,7 +2249,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
extensionNo, workshopsCount, employeeCount,
|
||||
previousInstitutionContract.Description,
|
||||
"NotOfficial", "JobRelation", hasValueAddedTax,
|
||||
payment.Tax.MoneyToDouble(),[],
|
||||
payment.Tax.MoneyToDouble(), [],
|
||||
request.LawId);
|
||||
|
||||
await CreateAsync(entity);
|
||||
@@ -2242,26 +2259,25 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
var workshopDetail = new InstitutionContractWorkshopInitial(
|
||||
workshop.WorkshopName, workshop.RollCall, workshop.RollCallInPerson,
|
||||
workshop.CustomizeCheckout, workshop.ContractAndCheckout,
|
||||
workshop.ContractAndCheckoutInPerson, workshop.Insurance,
|
||||
workshop.ContractAndCheckoutInPerson, workshop.Insurance,
|
||||
workshop.InsuranceInPerson, workshop.CountPerson, workshop.Price);
|
||||
|
||||
|
||||
workshopDetail.SetWorkshopGroup(entity.WorkshopGroup);
|
||||
|
||||
|
||||
if (workshop.WorkshopId != 0)
|
||||
{
|
||||
workshopDetail.SetWorkshopId(workshop.WorkshopId);
|
||||
}
|
||||
// Set parent reference
|
||||
|
||||
|
||||
// Add to the parent's collection
|
||||
entity.WorkshopGroup.InitialWorkshops.Add(workshopDetail);
|
||||
}
|
||||
|
||||
// Save the changes again
|
||||
await SaveChangesAsync();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
FinancialStatment financialStatement;
|
||||
if (_context.FinancialStatments.Any(x => x.ContractingPartyId == contractingParty.id))
|
||||
{
|
||||
@@ -2275,7 +2291,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
}
|
||||
|
||||
var today = DateTime.Today;
|
||||
if (request.IsInstallment && payment is InstitutionContractExtensionPaymentMonthly monthly)
|
||||
if (request.IsInstallment && payment is InstitutionContractPaymentMonthlyViewModel monthly)
|
||||
{
|
||||
var installments = monthly.Installments.Select(x =>
|
||||
new InstitutionContractInstallment(x.InstalmentDate.ToGeorgianDateTime(),
|
||||
@@ -2323,7 +2339,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
await SaveChangesAsync();
|
||||
|
||||
await _smsService.SendInstitutionVerificationLink(contractingParty.Phone, contractingPartyFullName,
|
||||
entity.PublicId);
|
||||
entity.PublicId, contractingParty.id, entity.id);
|
||||
|
||||
|
||||
await SaveChangesAsync();
|
||||
@@ -2331,6 +2347,260 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public async Task<InstitutionContractAmendmentWorkshopsResponse> GetAmendmentWorkshops(long institutionContractId)
|
||||
{
|
||||
var institutionContract = await _context.InstitutionContractSet
|
||||
.Include(x => x.WorkshopGroup)
|
||||
.ThenInclude(x => x.CurrentWorkshops)
|
||||
.FirstOrDefaultAsync(x => x.id == institutionContractId);
|
||||
|
||||
if (institutionContract.WorkshopGroup.CurrentWorkshops.Any(x => x.Price == 0))
|
||||
{
|
||||
throw new BadRequestException(
|
||||
"این قرارداد قابل ارتقا به صورت ظاهری نیست لطفا به صورت دیتابیسی اقدام به ویرایش کنید");
|
||||
}
|
||||
|
||||
var workshops = institutionContract.WorkshopGroup.CurrentWorkshops
|
||||
.Select(x => new InstitutionContractAmendmentTempPrevWorkshop(x.WorkshopName,x.PersonnelCount,
|
||||
x.Services.Contract,x.Services.ContractInPerson,x.Services.Insurance,
|
||||
x.Services.InsuranceInPerson,x.Services.RollCall,x.Services.RollCallInPerson,
|
||||
x.Services.CustomizeCheckout,x.Price,
|
||||
x.WorkshopId??0,x.id)).ToList();
|
||||
|
||||
|
||||
|
||||
var temp = new InstitutionContractAmendmentTemp(workshops, institutionContractId);
|
||||
|
||||
await _institutionAmendmentTemp.InsertOneAsync(temp);
|
||||
|
||||
var prevWorkshops = workshops.Select(x =>
|
||||
new InstitutionContractAmendmentTempWorkshopViewModel()
|
||||
{
|
||||
WorkshopName = x.WorkshopName,
|
||||
CountPerson = x.CountPerson,
|
||||
ContractAndCheckout = x.ContractAndCheckout,
|
||||
ContractAndCheckoutInPerson = x.ContractAndCheckoutInPerson,
|
||||
Insurance = x.Insurance,
|
||||
InsuranceInPerson = x.InsuranceInPerson,
|
||||
RollCall = x.RollCall,
|
||||
RollCallInPerson = x.RollCallInPerson,
|
||||
CustomizeCheckout = x.CustomizeCheckout,
|
||||
PriceStr = x.Price.ToMoney(),
|
||||
Price = x.Price,
|
||||
WorkshopId = x.WorkshopId,
|
||||
WorkshopTempId = x.Id,
|
||||
CurrentWorkshopId = x.CurrentWorkshopId,
|
||||
TempId =temp.Id
|
||||
})
|
||||
.ToList();
|
||||
var res = new InstitutionContractAmendmentWorkshopsResponse()
|
||||
{
|
||||
Workshops = prevWorkshops,
|
||||
TempId = temp.Id
|
||||
};
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
public async Task<InsitutionContractAmendmentPaymentResponse> GetAmendmentPaymentDetails(
|
||||
InsitutionContractAmendmentPaymentRequest request)
|
||||
{
|
||||
var institutionContractAmendmentTemp = await _institutionAmendmentTemp
|
||||
.Find(x=>x.Id == request.TempId)
|
||||
.FirstOrDefaultAsync();
|
||||
if (institutionContractAmendmentTemp == null)
|
||||
throw new NotFoundException("دیتای وارد شده نامعتبر است");
|
||||
|
||||
var amendmentStart = DateTime.Now;
|
||||
|
||||
var institutionContract = await _context.InstitutionContractSet
|
||||
.Include(x=>x.WorkshopGroup)
|
||||
.ThenInclude(x=>x.CurrentWorkshops)
|
||||
.FirstOrDefaultAsync(x => x.id == institutionContractAmendmentTemp.InstitutionContractId);
|
||||
|
||||
if (institutionContract == null)
|
||||
throw new NotFoundException("قرارداد مؤسسه یافت نشد");
|
||||
|
||||
var amendmentEnd = institutionContract.ContractEndGr;
|
||||
|
||||
var haContractInPerson = institutionContract.WorkshopGroup.CurrentWorkshops
|
||||
.Any(x => x.Services.ContractInPerson);
|
||||
if (!haContractInPerson)
|
||||
{
|
||||
if (institutionContractAmendmentTemp.NewWorkshops.Any(x => x.ContractAndCheckoutInPerson))
|
||||
{
|
||||
throw new BadRequestException("برای قرارداد آنلاین نمیتوان سرویس حضوری انتخاب کرد");
|
||||
}
|
||||
}
|
||||
|
||||
var pc = new PersianCalendar();
|
||||
|
||||
int startYear = pc.GetYear(amendmentStart);
|
||||
int startMonth = pc.GetMonth(amendmentStart);
|
||||
int startDay = pc.GetDayOfMonth(amendmentStart);
|
||||
|
||||
int endYear = pc.GetYear(amendmentEnd);
|
||||
int endMonth = pc.GetMonth(amendmentEnd);
|
||||
int endDay = pc.GetDayOfMonth(amendmentEnd);
|
||||
|
||||
// اختلاف خام ماهها
|
||||
int monthDiff = (endYear - startYear) * 12 + (endMonth - startMonth);
|
||||
|
||||
// اگر حتی چند روز از ماه بعدی هم گذشته بود → رند به بالا
|
||||
if (endDay > startDay)
|
||||
monthDiff++;
|
||||
|
||||
var sumOneMonth = institutionContractAmendmentTemp.NewWorkshops.Sum(x => x.PriceDifference);
|
||||
|
||||
var baseAmount = monthDiff * sumOneMonth;
|
||||
var tax = baseAmount*0.10;
|
||||
var totalPayment = tax+baseAmount;
|
||||
|
||||
|
||||
var res = new InsitutionContractAmendmentPaymentResponse()
|
||||
{
|
||||
ContractStart = amendmentStart.ToFarsi(),
|
||||
ContractEnd = amendmentEnd.ToFarsi(),
|
||||
OneMonthAmount = sumOneMonth.ToMoney(),
|
||||
TotalAmount = baseAmount.ToMoney(),
|
||||
};
|
||||
|
||||
res.OneTime = new InstitutionContractPaymentOneTimeViewModel()
|
||||
{
|
||||
TotalAmount = baseAmount.ToMoney(),
|
||||
PaymentAmount = totalPayment.ToMoney(),
|
||||
Tax = tax.ToMoney()
|
||||
};
|
||||
|
||||
if (haContractInPerson)
|
||||
{
|
||||
var installment = InstitutionMonthlyInstallmentCaculation(monthDiff,totalPayment, amendmentStart.ToFarsi());
|
||||
|
||||
var firstPrevInstallment = installment.First();
|
||||
var lastPrevInstallment = installment.Last();
|
||||
|
||||
var firstInstallment = new MonthlyInstallment()
|
||||
{
|
||||
InstallmentAmountStr = firstPrevInstallment.InstallmentAmountStr,
|
||||
InstallmentCounter = firstPrevInstallment.InstallmentCounter,
|
||||
InstalmentDate = amendmentStart.ToFarsi()
|
||||
};
|
||||
|
||||
var lastInstallment = new MonthlyInstallment()
|
||||
{
|
||||
InstallmentAmountStr = lastPrevInstallment.InstallmentAmountStr,
|
||||
InstallmentCounter = lastPrevInstallment.InstallmentCounter,
|
||||
InstalmentDate = lastPrevInstallment.InstalmentDate
|
||||
};
|
||||
|
||||
installment.Remove(firstPrevInstallment);
|
||||
installment.Remove(lastPrevInstallment);
|
||||
|
||||
installment.Insert(0, firstInstallment);
|
||||
installment.Add(lastInstallment);
|
||||
|
||||
res.Monthly = new InstitutionContractPaymentMonthlyViewModel()
|
||||
{
|
||||
Installments = installment,
|
||||
TotalAmount = baseAmount.ToMoney(),
|
||||
PaymentAmount = totalPayment.ToMoney(),
|
||||
Tax = tax.ToMoney()
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public async Task<InsertAmendmentTempWorkshopResponse> InsertAmendmentTempWorkshops(
|
||||
InstitutionContractAmendmentTempWorkshopViewModel request)
|
||||
{
|
||||
var amendmentTemp =await _institutionAmendmentTemp
|
||||
.Find(x=> x.Id == request.TempId).FirstOrDefaultAsync();
|
||||
|
||||
if (amendmentTemp == null)
|
||||
throw new BadRequestException("دیتای وارد شده نامعتبر است");
|
||||
|
||||
var workshopTemp = amendmentTemp.NewWorkshops
|
||||
.FirstOrDefault(x => x.Id == request.WorkshopTempId);
|
||||
|
||||
var planForWorkshop = new WorkshopTempViewModel()
|
||||
{
|
||||
WorkshopName = request.WorkshopName,
|
||||
CountPerson = request.CountPerson,
|
||||
ContractAndCheckout = request.ContractAndCheckout,
|
||||
ContractAndCheckoutInPerson = request.ContractAndCheckoutInPerson,
|
||||
Insurance = request.Insurance,
|
||||
InsuranceInPerson = request.InsuranceInPerson,
|
||||
RollCall = request.RollCall,
|
||||
RollCallInPerson = request.RollCallInPerson,
|
||||
CustomizeCheckout = request.CustomizeCheckout
|
||||
};
|
||||
var price = _planPercentageRepository.GetInstitutionPlanForWorkshop(planForWorkshop)
|
||||
.OnlineAndInPersonSumAmountDouble;
|
||||
|
||||
if (workshopTemp == null)
|
||||
{
|
||||
var newWorkshopTemp = new InstitutionContractAmendmentTempNewWorkshop(request.WorkshopName,
|
||||
request.CountPerson,
|
||||
request.ContractAndCheckout, request.ContractAndCheckoutInPerson,
|
||||
request.Insurance, request.InsuranceInPerson,
|
||||
request.RollCall, request.RollCallInPerson,
|
||||
request.CustomizeCheckout, price,
|
||||
request.WorkshopId,0,price);
|
||||
|
||||
workshopTemp = newWorkshopTemp;
|
||||
|
||||
|
||||
amendmentTemp.NewWorkshops.Add(newWorkshopTemp);
|
||||
|
||||
await _institutionAmendmentTemp
|
||||
.ReplaceOneAsync(x => x.Id == amendmentTemp.Id, amendmentTemp);
|
||||
}
|
||||
else
|
||||
{
|
||||
amendmentTemp.NewWorkshops.Remove(workshopTemp);
|
||||
|
||||
var differencePrice = price - workshopTemp.Price;
|
||||
workshopTemp.Edit(request.WorkshopName, request.CountPerson,
|
||||
request.ContractAndCheckout, request.ContractAndCheckoutInPerson,
|
||||
request.Insurance, request.InsuranceInPerson,
|
||||
request.RollCall,
|
||||
request.CustomizeCheckout, price,differencePrice);
|
||||
|
||||
amendmentTemp.NewWorkshops.Add(workshopTemp);
|
||||
|
||||
await _institutionAmendmentTemp
|
||||
.ReplaceOneAsync(x => x.Id == amendmentTemp.Id, amendmentTemp);
|
||||
}
|
||||
|
||||
return new InsertAmendmentTempWorkshopResponse()
|
||||
{
|
||||
WorkshopTempId = workshopTemp.Id,
|
||||
Amount = workshopTemp.PriceDifference.ToMoney()
|
||||
};
|
||||
}
|
||||
|
||||
public async Task RemoveAmendmentWorkshops(Guid workshopTempId)
|
||||
{
|
||||
var amendmentTemp = await _institutionAmendmentTemp.Find(x => x.NewWorkshops.Any(w => w.Id == workshopTempId))
|
||||
.FirstOrDefaultAsync();
|
||||
if (amendmentTemp == null)
|
||||
throw new BadRequestException("دیتای وارد شده نامعتبر است");
|
||||
var workshopTemp = amendmentTemp.NewWorkshops.FirstOrDefault(x => x.Id == workshopTempId);
|
||||
if (workshopTemp == null)
|
||||
throw new BadRequestException("دیتای وارد شده نامعتبر است");
|
||||
|
||||
if (workshopTemp.CurrentWorkshopId!=0)
|
||||
throw new BadRequestException("شما نمی توانید این کارگاه را حذف کنید زیرا در قرارداد اصلی وجود دارد");
|
||||
|
||||
amendmentTemp.NewWorkshops.Remove(workshopTemp);
|
||||
|
||||
await _institutionAmendmentTemp.ReplaceOneAsync(x => x.Id == amendmentTemp.Id, amendmentTemp);
|
||||
|
||||
}
|
||||
public async Task<List<InstitutionContractSelectListViewModel>> GetInstitutionContractSelectList(string search,
|
||||
string selected)
|
||||
{
|
||||
@@ -2408,7 +2678,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
// حالت پرداخت اقساطی
|
||||
var monthlyTax = baseAmount * 0.10;
|
||||
var monthlyTotal = baseAmount + monthlyTax;
|
||||
var installments = InstitutionMonthlyInstallmentCaculation(duration, monthlyTotal, selectedPlan.ContractStart);
|
||||
var installments = InstitutionMonthlyInstallmentCaculation((int)duration, monthlyTotal, selectedPlan.ContractStart);
|
||||
|
||||
res.Monthly = new()
|
||||
{
|
||||
@@ -2490,7 +2760,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
return result;
|
||||
}
|
||||
|
||||
public static List<MonthlyInstallment> InstitutionMonthlyInstallmentCaculation(InstitutionContractDuration duration,
|
||||
public static List<MonthlyInstallment> InstitutionMonthlyInstallmentCaculation(int duration,
|
||||
double monthlyTotalPaymentDouble,
|
||||
string installmentstart)
|
||||
{
|
||||
@@ -2498,7 +2768,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
var installmentList = new List<MonthlyInstallment>();
|
||||
|
||||
|
||||
int instalmentCount = (int)duration;
|
||||
int instalmentCount = duration;
|
||||
var instalmentAmount = monthlyTotalPaymentDouble / instalmentCount;
|
||||
int currentInstallmentStartDay = int.Parse(installmentstart.Substring(8, 2));
|
||||
bool endOfMonth = currentInstallmentStartDay == 31;
|
||||
@@ -2558,6 +2828,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region CustomViewModels
|
||||
|
||||
|
||||
@@ -1724,9 +1724,86 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
.Include(x => x.LeftWorkInsurances)
|
||||
.Where(x => x.LeftWorkInsurances.Any(l => l.StartWorkDate <= firstDayOfMonth &&
|
||||
(l.LeftWorkDate == null || l.LeftWorkDate >= firstDayOfMonth)));
|
||||
|
||||
|
||||
var query = notCreatedWorkshop.Select(result=>new InsuranceListViewModel
|
||||
{
|
||||
Year = searchModel.Year,
|
||||
Month = searchModel.Month,
|
||||
WorkShopId = result.id,
|
||||
WorkShopCode = result.InsuranceWorkshopInfo != null
|
||||
? result.InsuranceWorkshopInfo.InsuranceCode
|
||||
: result.InsuranceCode,
|
||||
WorkShopName = result.InsuranceWorkshopInfo != null
|
||||
? result.InsuranceWorkshopInfo.WorkshopName
|
||||
: result.WorkshopFullName,
|
||||
TypeOfInsuranceSend = result.TypeOfInsuranceSend == "NormalList" ? "عادی" :
|
||||
result.TypeOfInsuranceSend == "Govermentlist" ? "کمک دولت" :
|
||||
result.TypeOfInsuranceSend == "Familylist" ? "خانوادگی" : "",
|
||||
FixedSalary = result.FixedSalary,
|
||||
StrFixedSalary = result.FixedSalary ? "دارد" : "ندارد",
|
||||
EmployerName = result.InsuranceWorkshopInfo != null
|
||||
? result.InsuranceWorkshopInfo.EmployerName
|
||||
: result.WorkshopFullName,
|
||||
Branch = "",
|
||||
City = "",
|
||||
ArchiveCode = result.ArchiveCode,
|
||||
});
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.Month) && searchModel.Month != "0")
|
||||
query = query.Where(x => x.Month == searchModel.Month).OrderByDescending(x => x.WorkShopName)
|
||||
.ThenByDescending(x => x.EmployerName).ThenByDescending(x => x.Year);
|
||||
|
||||
var workshopList = await notCreatedWorkshop.Skip(searchModel.PageIndex).Take(30).ToListAsync();
|
||||
var workshopIds = workshopList.Select(x=>x.id);
|
||||
if (!string.IsNullOrEmpty(searchModel.Year) && searchModel.Year != "0")
|
||||
query = query.Where(x => x.Year == searchModel.Year).OrderByDescending(x => x.EmployerName)
|
||||
.ThenByDescending(x => x.WorkShopName).ThenByDescending(x => x.Month);
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.WorkShopCode))
|
||||
query = query.Where(x => x.WorkShopCode == searchModel.WorkShopCode).OrderByDescending(x => x.Year)
|
||||
.ThenByDescending(x => x.Month).ThenByDescending(x => x.EmployerName);
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.WorkShopName))
|
||||
query = query.Where(x => x.WorkShopName.Contains(searchModel.WorkShopName))
|
||||
.OrderByDescending(x => x.EmployerName).ThenByDescending(x => x.Year).OrderByDescending(x => x.Month);
|
||||
|
||||
|
||||
if (searchModel.WorkshopId > 0)
|
||||
{
|
||||
var workshopName = query.FirstOrDefault(u => u.WorkShopId == searchModel.WorkshopId)?.WorkShopName;
|
||||
|
||||
query = query.Where(x => x.WorkShopName.Contains(workshopName)).OrderByDescending(x => x.EmployerName)
|
||||
.ThenByDescending(x => x.Year).ThenByDescending(x => x.Month);
|
||||
}
|
||||
|
||||
if (searchModel.EmployerId > 0)
|
||||
{
|
||||
var employerName = query.FirstOrDefault(u => u.EmployerId == searchModel.EmployerId)?.EmployerName;
|
||||
query = query.Where(x => x.EmployerName.Contains(employerName)).OrderByDescending(x => x.EmployerName)
|
||||
.ThenByDescending(x => x.Year).ThenByDescending(x => x.Month);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.EmployerName))
|
||||
query = query.Where(x => x.EmployerName.Contains(searchModel.EmployerName))
|
||||
.OrderByDescending(x => x.EmployerName).ThenByDescending(x => x.Year).OrderByDescending(x => x.Month);
|
||||
|
||||
|
||||
if (searchModel.FixedSalary != null)
|
||||
query = query.Where(x => x.FixedSalary == searchModel.FixedSalary);
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.TypeOfInsuranceSend) && searchModel.TypeOfInsuranceSend != "0")
|
||||
query = query.Where(x => x.TypeOfInsuranceSend == searchModel.TypeOfInsuranceSend);
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.City) && searchModel.City != "0")
|
||||
query = query.Where(x => x.City == searchModel.City);
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.Branch))
|
||||
query = query.Where(x => x.Branch.Contains(searchModel.Branch));
|
||||
|
||||
|
||||
var workshopList = await query.Skip(searchModel.PageIndex).Take(30).ToListAsync();
|
||||
var workshopIds = workshopList.Select(x=>x.WorkShopId);
|
||||
|
||||
var employers =await _context.WorkshopEmployers
|
||||
.Where(x=>workshopIds.Contains(x.WorkshopId))
|
||||
@@ -1735,20 +1812,16 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
|
||||
var res = workshopList.Select(x =>
|
||||
{
|
||||
var employer = employers.FirstOrDefault(e => e.WorkshopId ==x.id)?.Employer;
|
||||
var employer = employers.FirstOrDefault(e => e.WorkshopId ==x.WorkShopId)?.Employer;
|
||||
|
||||
return new InsuranceListViewModel
|
||||
{
|
||||
WorkShopId = x.id,
|
||||
WorkShopCode = x.InsuranceCode,
|
||||
WorkShopName = x.InsuranceWorkshopInfo != null
|
||||
? x.InsuranceWorkshopInfo.WorkshopName
|
||||
: x.WorkshopFullName,
|
||||
WorkShopId = x.WorkShopId,
|
||||
WorkShopCode = x.WorkShopCode,
|
||||
WorkShopName = x.WorkShopName,
|
||||
EmployerName = employer != null
|
||||
? employer.FullName
|
||||
: (x.InsuranceWorkshopInfo != null
|
||||
? x.InsuranceWorkshopInfo.EmployerName
|
||||
: x.WorkshopFullName),
|
||||
: (x.EmployerName),
|
||||
Year = searchModel.Year,
|
||||
Month = searchModel.Month,
|
||||
TypeOfInsuranceSend = x.TypeOfInsuranceSend == "NormalList" ? "عادی" :
|
||||
|
||||
@@ -97,7 +97,7 @@ public class LoanRepository : RepositoryBase<long, Loan>, ILoanRepository
|
||||
query = query.Where(x => x.StartInstallmentPayment >= startDate && x.StartInstallmentPayment <= endDate);
|
||||
}
|
||||
query = query.Where(x => x.EmployeeId == searchModel.EmployeeId);
|
||||
var list = query.ToList().Select(x => new LoanViewModel()
|
||||
var list = query.OrderByDescending(x=>x.StartInstallmentPayment).ToList().Select(x => new LoanViewModel()
|
||||
{
|
||||
Amount = x.Amount.ToMoney(),
|
||||
AmountDouble = x.Amount,
|
||||
|
||||
@@ -6,6 +6,7 @@ using _0_Framework.InfraStructure;
|
||||
using Company.Domain.RewardAgg;
|
||||
using CompanyManagment.App.Contracts.Reward;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using SharpCompress.Compressors.Xz;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
@@ -119,12 +120,12 @@ public class RewardRepository : RepositoryBase<long, Reward>, IRewardRepository
|
||||
|
||||
query = query.Where(x => x.EmployeeId == searchModel.EmployeeId);
|
||||
|
||||
var list = query.ToList().Select(x => new RewardViewModel
|
||||
var list = query.ToList().OrderByDescending(x=>x.GrantDate).Select(x => new RewardViewModel
|
||||
{
|
||||
WorkshopId = x.WorkshopId,
|
||||
Amount = x.Amount.ToMoney(),
|
||||
AmountDouble = x.Amount,
|
||||
Description = x.Description,
|
||||
Description = x.Description ?? "",
|
||||
EmployeeFullName = employees.FirstOrDefault(e => e.id == x.EmployeeId).FullName,
|
||||
EmployeeId = x.EmployeeId,
|
||||
GrantDateFa = x.GrantDate.ToFarsi(),
|
||||
|
||||
@@ -1517,7 +1517,9 @@ public class RollCallRepository : RepositoryBase<long, RollCall>, IRollCallRepos
|
||||
StartDate = y.StartDate.Value.ToString("HH:mm"),
|
||||
EndDate = y.EndDate!.Value.ToString("HH:mm"),
|
||||
StartDateGr = y.StartDate.Value,
|
||||
EndDateGr = y.EndDate.Value
|
||||
EndDateGr = y.EndDate.Value,
|
||||
EntryTimeDifferences = CalculateEntryTimeDifferences( y.EarlyEntryDuration, y.LateEntryDuration),
|
||||
ExitTimeDifferences = CalculateExitTimeDifferences(y.EarlyExitDuration, y.LateExitDuration)
|
||||
}),
|
||||
TotalWorkingHoursSpan = new TimeSpan(rollCallsList.Where(y => x.Date == y.ShiftDate.Date)
|
||||
.Sum(y => (y.EndDate!.Value - y.StartDate.Value).Ticks)),
|
||||
|
||||
@@ -1181,6 +1181,33 @@ public class WorkshopRepository : RepositoryBase<long, Company.Domain.WorkshopAg
|
||||
return list.DistinctBy(x => x.Id).ToList();
|
||||
}
|
||||
|
||||
public int GetLastArchiveCode()
|
||||
{
|
||||
var archiveCodes = _context.Workshops
|
||||
.Where(x => !string.IsNullOrEmpty(x.ArchiveCode))
|
||||
.Select(x => x.ArchiveCode)
|
||||
.ToList();
|
||||
|
||||
int maxArchiveCode = 0;
|
||||
|
||||
foreach (var code in archiveCodes)
|
||||
{
|
||||
// Remove "b-" prefix if exists
|
||||
string cleanCode = code.StartsWith("b-") ? code.Substring(2) : code;
|
||||
|
||||
// Try to parse the clean code to an integer
|
||||
if (int.TryParse(cleanCode, out int codeValue))
|
||||
{
|
||||
if (codeValue > maxArchiveCode)
|
||||
{
|
||||
maxArchiveCode = codeValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return maxArchiveCode;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region NewByHeydari
|
||||
//public List<WorkshopViewModel> GetWorkshopByWorkshopIds(List<long> workshopIds)
|
||||
|
||||
@@ -1,28 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
using System.Security.AccessControl;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Sms;
|
||||
using Company.Domain.SmsResultAgg;
|
||||
using CompanyManagment.App.Contracts.SmsResult;
|
||||
using IPE.SmsIrClient;
|
||||
using IPE.SmsIrClient.Models.Requests;
|
||||
using IPE.SmsIrClient.Models.Results;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
|
||||
|
||||
namespace _0_Framework.Application.Sms;
|
||||
namespace CompanyManagment.EFCore.Services;
|
||||
|
||||
public class SmsService : ISmsService
|
||||
{
|
||||
private readonly IConfiguration _configuration;
|
||||
private readonly ISmsResultRepository _smsResultRepository;
|
||||
public SmsIr SmsIr { get; set; }
|
||||
|
||||
|
||||
public SmsService(IConfiguration configuration)
|
||||
public SmsService(IConfiguration configuration, ISmsResultRepository smsResultRepository)
|
||||
{
|
||||
_configuration = configuration;
|
||||
_smsResultRepository = smsResultRepository;
|
||||
SmsIr = new SmsIr("Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa");
|
||||
|
||||
}
|
||||
@@ -204,8 +206,7 @@ public class SmsService : ISmsService
|
||||
int pageSize = 100; // max: 100
|
||||
SmsIr smsIr = new SmsIr("Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa");
|
||||
var response = await smsIr.GetArchivedReportAsync(pageNumber, pageSize, unixTimestamp, unixTimestamp2);
|
||||
|
||||
|
||||
|
||||
MessageReportResult[] messages = response.Data;
|
||||
foreach (var message in messages)
|
||||
{
|
||||
@@ -331,7 +332,7 @@ public class SmsService : ISmsService
|
||||
}
|
||||
|
||||
}
|
||||
public async Task<bool> SendInstitutionVerificationLink(string number,string fullName, Guid institutionId)
|
||||
public async Task<bool> SendInstitutionVerificationLink(string number, string fullName, Guid institutionId, long contractingPartyId, long institutionContractId)
|
||||
{
|
||||
var guidStr=institutionId.ToString();
|
||||
var firstPart = guidStr.Substring(0, 15);
|
||||
@@ -342,15 +343,25 @@ public class SmsService : ISmsService
|
||||
new("CODE1",firstPart),
|
||||
new("CODE2",secondPart)
|
||||
});
|
||||
var smsResult = new SmsResult(verificationSendResult.Data.MessageId, verificationSendResult.Message, "لینک تاییدیه قرارداد مالی",
|
||||
fullName, number, contractingPartyId, institutionContractId);
|
||||
await _smsResultRepository.CreateAsync(smsResult);
|
||||
await _smsResultRepository.SaveChangesAsync();
|
||||
return verificationSendResult.Status == 0;
|
||||
}
|
||||
|
||||
public async Task<bool> SendInstitutionVerificationCode(string number, string code)
|
||||
public async Task<bool> SendInstitutionVerificationCode(string number, string code, string contractingPartyFullName,
|
||||
long contractingPartyId, long institutionContractId)
|
||||
{
|
||||
var verificationSendResult =await SmsIr.VerifySendAsync(number, 965348, new VerifySendParameter[]
|
||||
{
|
||||
new("VERIFYCODE", code)
|
||||
});
|
||||
|
||||
var smsResult = new SmsResult(verificationSendResult.Data.MessageId, verificationSendResult.Message, "کد تاییدیه قرارداد مالی",
|
||||
contractingPartyFullName, number, contractingPartyId, institutionContractId);
|
||||
await _smsResultRepository.CreateAsync(smsResult);
|
||||
await _smsResultRepository.SaveChangesAsync();
|
||||
return verificationSendResult.Status == 0;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Json;
|
||||
using System.Text;
|
||||
@@ -7,6 +9,7 @@ using Newtonsoft.Json;
|
||||
using CompanyManagment.App.Contracts.AuthorizedPerson;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.UID;
|
||||
using Company.Application.Contracts.AuthorizedBankDetails;
|
||||
|
||||
namespace CompanyManagment.EFCore.Services;
|
||||
|
||||
@@ -14,15 +17,21 @@ public class UidService : IUidService
|
||||
{
|
||||
private readonly HttpClient _httpClient;
|
||||
private readonly IAuthorizedPersonApplication _authorizedPersonApplication;
|
||||
private const string BaseUrl = "https://json-api.uid.ir/api/inquiry/";
|
||||
private readonly IAuthorizedBankDetailsApplication _authorizedBankDetailsApplication;
|
||||
private const string BaseUrl = "https://json-api.uid.ir/api/";
|
||||
|
||||
public const string BusinessToken = "5e03dd4e-999d-466f-92d8-7c0b1f66a8e9";
|
||||
public const string BusinessId = "98ed67ca-d441-4978-a748-e8bebce010eb";
|
||||
|
||||
|
||||
public UidService(IAuthorizedPersonApplication authorizedPersonApplication)
|
||||
public UidService(IAuthorizedPersonApplication authorizedPersonApplication, IAuthorizedBankDetailsApplication authorizedBankDetailsApplication)
|
||||
{
|
||||
_httpClient = new HttpClient()
|
||||
{
|
||||
BaseAddress = new Uri(BaseUrl)
|
||||
};
|
||||
_authorizedPersonApplication = authorizedPersonApplication;
|
||||
_authorizedBankDetailsApplication = authorizedBankDetailsApplication;
|
||||
}
|
||||
|
||||
public async Task<PersonalInfoResponse> GetPersonalInfo(string nationalCode, string birthDate)
|
||||
@@ -53,7 +62,7 @@ public class UidService : IUidService
|
||||
|
||||
try
|
||||
{
|
||||
var requestResult = await _httpClient.PostAsync("person/v2", contentType);
|
||||
var requestResult = await _httpClient.PostAsync("inquiry/person/v2", contentType);
|
||||
if (!requestResult.IsSuccessStatusCode)
|
||||
return null;
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<PersonalInfoResponse>();
|
||||
@@ -138,11 +147,134 @@ public class UidService : IUidService
|
||||
var json = JsonConvert.SerializeObject(request);
|
||||
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
|
||||
var requestResult = await _httpClient.PostAsync("mobile/owner/v2", contentType);
|
||||
var requestResult = await _httpClient.PostAsync("inquiry/mobile/owner/v2", contentType);
|
||||
if (!requestResult.IsSuccessStatusCode)
|
||||
return null;
|
||||
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<MatchMobileWithNationalCodeResponse>();
|
||||
return responseResult;
|
||||
}
|
||||
|
||||
public async Task<IbanInquiryResponse> IbanInquiry(string iban)
|
||||
{
|
||||
// First check if bank details exist in database
|
||||
var existingBankDetails = _authorizedBankDetailsApplication.GetByIban(iban);
|
||||
if (existingBankDetails != null)
|
||||
{
|
||||
// Return data from database instead of calling API
|
||||
return CreateIbanInquiryResponseFromDatabase(existingBankDetails);
|
||||
}
|
||||
|
||||
// If not found in database, call UID API
|
||||
var request = new
|
||||
{
|
||||
iban,
|
||||
requestContext = new UidRequestContext()
|
||||
};
|
||||
var json = JsonConvert.SerializeObject(request);
|
||||
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
|
||||
try
|
||||
{
|
||||
var requestResult = await _httpClient.PostAsync("inquiry/iban/v2", contentType);
|
||||
requestResult.EnsureSuccessStatusCode();
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<IbanInquiryResponse>();
|
||||
|
||||
if (responseResult.ResponseContext.Status.Code == 0)
|
||||
{
|
||||
var entity = new CreateAuthorizedBankDetails
|
||||
{
|
||||
IBan = iban,
|
||||
AccountNumber = responseResult?.AccountBasicInformation?.AccountNumber ?? "",
|
||||
BankName = responseResult?.AccountBasicInformation?.BankInformation?.BankName ?? "",
|
||||
OwnersList = responseResult?.Owners.Select(x=> new CreateAuthorizedBankDetailsOwner()
|
||||
{
|
||||
FName = x.FirstName,
|
||||
LName = x.LastName,
|
||||
NationalIdentifier = x.NationalIdentifier,
|
||||
CustomerType = x.CustomerType
|
||||
}).ToList() ?? []
|
||||
};
|
||||
_authorizedBankDetailsApplication.Create(entity);
|
||||
}
|
||||
|
||||
return responseResult;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new IbanInquiryResponse
|
||||
{
|
||||
ResponseContext = new ResponseContext(new UidStatus(14, "خطا در دریافت اطلاعات از سرویس"))
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private IbanInquiryResponse CreateIbanInquiryResponseFromDatabase(AuthorizedBankDetailsViewModel bankDetails)
|
||||
{
|
||||
var accountBasicInfo = new IbanInquiryAccountBasicInformation
|
||||
{
|
||||
Iban = bankDetails.IBan,
|
||||
AccountNumber = bankDetails.AccountNumber,
|
||||
BankInformation = new IbanInquiryBankInformation
|
||||
{
|
||||
BankName = bankDetails.BankName
|
||||
},
|
||||
AccountStatus = "Active"
|
||||
};
|
||||
|
||||
var owners = new List<IbanInquiryOwner>();
|
||||
|
||||
// Add owner information if available
|
||||
if (bankDetails.Owners.Any())
|
||||
{
|
||||
var owner = bankDetails.Owners.First();
|
||||
owners.Add(new IbanInquiryOwner
|
||||
{
|
||||
NationalIdentifier = owner.NationalIdentifier,
|
||||
FirstName = owner.FName,
|
||||
LastName = owner.LName,
|
||||
CustomerType = owner.CustomerType
|
||||
});
|
||||
}
|
||||
|
||||
var responseContext = new ResponseContext(new UidStatus(0, "Success - از دیتابیس"));
|
||||
|
||||
return new IbanInquiryResponse
|
||||
{
|
||||
AccountBasicInformation = accountBasicInfo,
|
||||
Owners = owners,
|
||||
ResponseContext = responseContext
|
||||
};
|
||||
}
|
||||
|
||||
public async Task<AccountToIbanResponse> AccountToIban(string accountNumber, UidBanks bank)
|
||||
{
|
||||
var request = new
|
||||
{
|
||||
accountNumber,
|
||||
bank,
|
||||
requestContext = new UidRequestContext()
|
||||
};
|
||||
var json = JsonConvert.SerializeObject(request);
|
||||
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
var requestResult = await _httpClient.PostAsync("account-to-iban", contentType);
|
||||
requestResult.EnsureSuccessStatusCode();
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<AccountToIbanResponse>();
|
||||
return responseResult;
|
||||
}
|
||||
|
||||
public async Task<CardToNumberResponse> CardToIban(string cardNumber)
|
||||
{
|
||||
var request = new
|
||||
{
|
||||
cardNumber,
|
||||
requestContext = new UidRequestContext()
|
||||
};
|
||||
var json = JsonConvert.SerializeObject(request);
|
||||
var contentType = new StringContent(json, Encoding.UTF8, "application/json");
|
||||
var requestResult = await _httpClient.PostAsync("inquiry/card", contentType);
|
||||
requestResult.EnsureSuccessStatusCode();
|
||||
var responseResult = await requestResult.Content.ReadFromJsonAsync<CardToNumberResponse>();
|
||||
return responseResult;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using _0_Framework.Application.UID;
|
||||
using Company.Application.Contracts.AuthorizedBankDetails;
|
||||
using Company.Domain.BillAgg;
|
||||
using Company.Domain.Board;
|
||||
using Company.Domain.ChapterAgg;
|
||||
@@ -209,6 +210,7 @@ using Company.Domain.ContactUsAgg;
|
||||
using CompanyManagment.App.Contracts.ContactUs;
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
using Company.Domain.AdminMonthlyOverviewAgg;
|
||||
using Company.Domain.AuthorizedBankDetailsAgg;
|
||||
using Company.Domain.ContractingPartyBankAccountsAgg;
|
||||
using Company.Domain.PaymentInstrumentAgg;
|
||||
using Company.Domain.PaymentTransactionAgg;
|
||||
@@ -218,7 +220,7 @@ using CompanyManagment.App.Contracts.PaymentInstrument;
|
||||
using CompanyManagment.App.Contracts.PaymentTransaction;
|
||||
using CompanyManagment.App.Contracts.AuthorizedPerson;
|
||||
using Company.Domain.AuthorizedPersonAgg;
|
||||
using Company.Domain.InstitutionContractInsertTempAgg;
|
||||
using Company.Domain.InstitutionContractExtensionTempAgg;
|
||||
using Company.Domain.LawAgg;
|
||||
using CompanyManagement.Infrastructure.Mongo.InstitutionContractInsertTempRepo;
|
||||
using CompanyManagment.App.Contracts.Law;
|
||||
@@ -472,6 +474,9 @@ public class PersonalBootstrapper
|
||||
services.AddTransient<ILawApplication,LawApplication>();
|
||||
services.AddTransient<ILawRepository,LawRepository>();
|
||||
|
||||
services.AddTransient<IAuthorizedBankDetailsRepository, AuthorizedBankDetailsRepository>();
|
||||
services.AddTransient<IAuthorizedBankDetailsApplication, AuthorizedBankDetailsApplication>();
|
||||
|
||||
services
|
||||
.AddTransient<IInstitutionContractExtenstionTempRepository, InstitutionContractExtenstionTempRepository>();
|
||||
#endregion
|
||||
|
||||
@@ -9,20 +9,20 @@ using WorkFlow.Application.Contracts.WorkFlow;
|
||||
|
||||
namespace Query.AdminReports.Handlers
|
||||
{
|
||||
public interface IGetWorkshopWithRollCallHandler
|
||||
{
|
||||
List<WorkshopWithRollCallServiceQueryModel> Handle(WorkshopWithRollCallServiceQueryParameters parameters);
|
||||
}
|
||||
public interface IGetWorkshopWithRollCallHandler
|
||||
{
|
||||
List<WorkshopWithRollCallServiceQueryModel> Handle(WorkshopWithRollCallServiceQueryParameters parameters);
|
||||
}
|
||||
|
||||
public class GetWorkshopWithRollCallHandler: IGetWorkshopWithRollCallHandler
|
||||
{
|
||||
public class GetWorkshopWithRollCallHandler : IGetWorkshopWithRollCallHandler
|
||||
{
|
||||
private readonly CompanyContext _companyContext;
|
||||
private readonly IWorkFlowApplication workFlowApplication;
|
||||
|
||||
public GetWorkshopWithRollCallHandler(CompanyContext companyContext, IWorkFlowApplication workFlowApplication)
|
||||
{
|
||||
_companyContext = companyContext;
|
||||
this.workFlowApplication = workFlowApplication;
|
||||
_companyContext = companyContext;
|
||||
this.workFlowApplication = workFlowApplication;
|
||||
}
|
||||
|
||||
public List<WorkshopWithRollCallServiceQueryModel> Handle(WorkshopWithRollCallServiceQueryParameters parameters)
|
||||
@@ -30,7 +30,6 @@ namespace Query.AdminReports.Handlers
|
||||
var now = DateTime.Now.Date;
|
||||
var lastWeek = now.AddDays(-7);
|
||||
|
||||
|
||||
//workshop filter by parameters
|
||||
var rollCallServiceQuery = _companyContext.RollCallServices.AsSplitQuery();
|
||||
|
||||
@@ -46,35 +45,49 @@ namespace Query.AdminReports.Handlers
|
||||
rollCallServiceQuery = rollCallServiceQuery.Where(x => x.ServiceType == parameters.RollCallServiceType);
|
||||
|
||||
if (parameters.FilterMode == FilterMode.Active)
|
||||
rollCallServiceQuery = rollCallServiceQuery.Where(x => x.StartService.Date <= now && x.EndService.Date >= now);
|
||||
else if (parameters.FilterMode == FilterMode.DeActive)
|
||||
rollCallServiceQuery = rollCallServiceQuery.Where(x => x.EndService.Date < now || x.StartService.Date > now);
|
||||
rollCallServiceQuery =
|
||||
rollCallServiceQuery.Where(x => x.StartService.Date <= now && x.EndService.Date >= now);
|
||||
|
||||
var workshopsWithService = rollCallServiceQuery.Join(allWorkshops, x => x.WorkshopId, y => y.id, (rcs, workshop) =>
|
||||
new WorkshopWithRollCallServiceQueryModel()
|
||||
{
|
||||
WorkshopId = workshop.id,
|
||||
RollCallServiceType = rcs.ServiceType,
|
||||
WorkshopName = workshop.WorkshopFullName,
|
||||
MaxPersonValid = rcs.MaxPersonValid,
|
||||
IsActive = rcs.StartService <= DateTime.Now && rcs.EndService >= DateTime.Now,
|
||||
ServiceStart = rcs.StartService,
|
||||
ServiceEnd = rcs.EndService
|
||||
});
|
||||
else if (parameters.FilterMode == FilterMode.DeActive)
|
||||
rollCallServiceQuery =
|
||||
rollCallServiceQuery.Where(x => x.EndService.Date < now || x.StartService.Date > now);
|
||||
|
||||
var workshopsWithService = rollCallServiceQuery.Join(allWorkshops, x => x.WorkshopId, y => y.id,
|
||||
(rcs, workshop) =>
|
||||
new WorkshopWithRollCallServiceQueryModel()
|
||||
{
|
||||
WorkshopId = workshop.id,
|
||||
RollCallServiceType = rcs.ServiceType,
|
||||
WorkshopName = workshop.WorkshopFullName,
|
||||
MaxPersonValid = rcs.MaxPersonValid,
|
||||
IsActive = rcs.StartService <= DateTime.Now && rcs.EndService >= DateTime.Now,
|
||||
ServiceStart = rcs.StartService,
|
||||
ServiceEnd = rcs.EndService
|
||||
});
|
||||
|
||||
|
||||
//workshop population
|
||||
var workshopLeftWorks = _companyContext.Workshops.AsSplitQuery().Where(x => workshopsWithService.Any(y => y.WorkshopId == x.id)).Include(x => x.LeftWorks).Include(x => x.LeftWorkInsurances)
|
||||
.Select(x => new
|
||||
{
|
||||
WorkshopId = x.id,
|
||||
LeftWorks = x.LeftWorks.Where(y => y.StartWorkDate <= lastWeek && y.LeftWorkDate > now).Select(y => y.EmployeeId),
|
||||
LeftWorkInsurances = x.LeftWorkInsurances.Where(y => y.StartWorkDate <= lastWeek && (y.LeftWorkDate > now || y.LeftWorkDate == null)).Select(y => y.EmployeeId)
|
||||
}).ToList();
|
||||
var workshopLeftWorks = _companyContext.Workshops.AsSplitQuery()
|
||||
.Where(x => workshopsWithService.Any(y => y.WorkshopId == x.id)).Include(x => x.LeftWorks)
|
||||
.Include(x => x.LeftWorkInsurances)
|
||||
.Select(x => new
|
||||
{
|
||||
WorkshopId = x.id,
|
||||
LeftWorks = x.LeftWorks.Where(y => y.StartWorkDate <= lastWeek && y.LeftWorkDate > now)
|
||||
.Select(y => y.EmployeeId),
|
||||
LeftWorkInsurances = x.LeftWorkInsurances
|
||||
.Where(y => y.StartWorkDate <= lastWeek && (y.LeftWorkDate > now || y.LeftWorkDate == null))
|
||||
.Select(y => y.EmployeeId)
|
||||
}).ToList();
|
||||
|
||||
var workshopsWorkingEmployeesList = workshopLeftWorks
|
||||
.Select(x => new { x.WorkshopId, TotalWorkingEmployeesCount = x.LeftWorks.Concat(x.LeftWorkInsurances).Distinct().Count(), EmployeeIds = x.LeftWorks.Concat(x.LeftWorkInsurances).Distinct() }).ToList();
|
||||
|
||||
.Select(x =>
|
||||
new
|
||||
{
|
||||
x.WorkshopId,
|
||||
TotalWorkingEmployeesCount = x.LeftWorks.Concat(x.LeftWorkInsurances).Distinct().Count(),
|
||||
EmployeeIds = x.LeftWorks.Concat(x.LeftWorkInsurances).Distinct()
|
||||
}).ToList();
|
||||
|
||||
|
||||
var activeEmployees = _companyContext.RollCallEmployees.AsSplitQuery()
|
||||
@@ -83,15 +96,25 @@ namespace Query.AdminReports.Handlers
|
||||
workshopsWithService.Any(y => y.WorkshopId == x.WorkshopId))
|
||||
.Select(x => new { x.WorkshopId, x.EmployeeId });
|
||||
|
||||
var lastWeekRollCalls = _companyContext.RollCalls.AsSplitQuery().Where(x => x.StartDate.HasValue && x.StartDate.Value >= lastWeek
|
||||
&& workshopsWithService.Any(y => y.WorkshopId == x.WorkshopId)).GroupBy(x => x.EmployeeId).Select(x => x.Key);
|
||||
var lastWeekRollCalls = _companyContext.RollCalls.AsSplitQuery()
|
||||
.Where(x => x.StartDate.HasValue &&
|
||||
x.StartDate.Value >= lastWeek
|
||||
&& workshopsWithService
|
||||
.Any(y => y.WorkshopId == x.WorkshopId))
|
||||
.GroupBy(x => x.EmployeeId)
|
||||
.Select(x => x.Key);
|
||||
|
||||
|
||||
var leaves = _companyContext.LeaveList.AsSplitQuery().Where(x => x.StartLeave <= lastWeek && x.EndLeave >= now && (x.LeaveType == "استعلاجی" || x.PaidLeaveType == "روزانه")
|
||||
&& workshopsWithService.Any(y => y.WorkshopId == x.WorkshopId)).Select(x => x.EmployeeId);
|
||||
var leaves = _companyContext.LeaveList.AsSplitQuery().Where(x =>
|
||||
x.StartLeave <= lastWeek && x.EndLeave >= now &&
|
||||
(x.LeaveType == "استعلاجی" || x.PaidLeaveType == "روزانه")
|
||||
&& workshopsWithService.Any(y => y.WorkshopId == x.WorkshopId))
|
||||
.Select(x => x.EmployeeId);
|
||||
|
||||
|
||||
var activeEmployeesList = activeEmployees.ToList().Where(x => workshopsWorkingEmployeesList.Any(w => w.WorkshopId == x.WorkshopId && w.EmployeeIds.Contains(x.EmployeeId)));
|
||||
var activeEmployeesList = activeEmployees.ToList().Where(x =>
|
||||
workshopsWorkingEmployeesList.Any(w =>
|
||||
w.WorkshopId == x.WorkshopId && w.EmployeeIds.Contains(x.EmployeeId)));
|
||||
var lastWeekRollCallsList = lastWeekRollCalls.ToList();
|
||||
var leavesList = leaves.ToList();
|
||||
var workshopsWithServiceList = workshopsWithService.ToList();
|
||||
@@ -107,12 +130,13 @@ namespace Query.AdminReports.Handlers
|
||||
MaxPersonValid = x.MaxPersonValid,
|
||||
WorkshopName = x.WorkshopName,
|
||||
ActiveEmployeesCount = activeEmployeesList.Count(y => y.WorkshopId == x.WorkshopId),
|
||||
ActiveEmployeesWithRollCallInLastWeekCount = activeEmployeesList.Count(y => y.WorkshopId == x.WorkshopId &&
|
||||
ActiveEmployeesWithRollCallInLastWeekCount = activeEmployeesList.Count(y =>
|
||||
y.WorkshopId == x.WorkshopId &&
|
||||
lastWeekRollCallsList.Contains(y.EmployeeId) && !leavesList.Contains(y.EmployeeId)),
|
||||
TotalEmployeesCount = workshopsWorkingEmployeesList.FirstOrDefault(y => y.WorkshopId == x.WorkshopId)?.TotalWorkingEmployeesCount ?? 0,
|
||||
TotalEmployeesCount = workshopsWorkingEmployeesList
|
||||
.FirstOrDefault(y => y.WorkshopId == x.WorkshopId)?.TotalWorkingEmployeesCount ?? 0,
|
||||
//UndoneWorkFlowsCount = workFlowApplication.GetAllWorkFlowCount(x.WorkshopId).Result
|
||||
}).OrderByDescending(x => x.IsActive).ToList();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,15 +13,8 @@
|
||||
public int ActiveEmployeesWithRollCallInLastWeekCount { get; set; }
|
||||
|
||||
public int UndoneWorkFlowsCount { get; set; }
|
||||
|
||||
|
||||
public float ActiveEmployeesWithRollCallPercentage
|
||||
{
|
||||
get
|
||||
{
|
||||
return ((float)ActiveEmployeesWithRollCallInLastWeekCount / ActiveEmployeesCount) * 100;
|
||||
}
|
||||
}
|
||||
|
||||
public float ActiveEmployeesWithRollCallPercentage => ActiveEmployeesCount == 0 ? 0f : ((float)ActiveEmployeesWithRollCallInLastWeekCount / ActiveEmployeesCount) * 100f;
|
||||
|
||||
public int MaxPersonValid { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.UID;
|
||||
using Bogus;
|
||||
using CompanyManagment.App.Contracts.ContractingPartyBankAccounts;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -43,4 +44,16 @@ public class ContractingPartyBankAccountController : AdminBaseController
|
||||
return operationResult;
|
||||
}
|
||||
|
||||
|
||||
[HttpGet("uid-banks")]
|
||||
public async Task<IActionResult> GetUidBanks()
|
||||
{
|
||||
var banks = Enum.GetValues(typeof(UidBanks)).Cast<UidBanks>().Select(x =>
|
||||
new {
|
||||
Lable = x.GetPersianName(),
|
||||
Value = x
|
||||
});
|
||||
return Ok(banks);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Sms;
|
||||
using _0_Framework.Application.UID;
|
||||
using AccountManagement.Application.Contracts.Task;
|
||||
using AccountManagement.Application.Contracts.Ticket;
|
||||
using CompanyManagment.App.Contracts.ClientDashboard;
|
||||
@@ -16,14 +17,16 @@ public class DashboardController : AdminBaseController
|
||||
private readonly IHolidayItemApplication _holidayItemApplication;
|
||||
private readonly ITaskApplication _taskApplication;
|
||||
private readonly ITicketApplication _ticketApplication;
|
||||
private readonly IUidService _uidService;
|
||||
private long UserId;
|
||||
|
||||
public DashboardController(ISmsService smsService, IHolidayItemApplication holidayItemApplication, ITaskApplication taskApplication,IAuthHelper authHelper, ITicketApplication ticketApplication)
|
||||
public DashboardController(ISmsService smsService, IHolidayItemApplication holidayItemApplication, ITaskApplication taskApplication,IAuthHelper authHelper, ITicketApplication ticketApplication, IUidService uidService)
|
||||
{
|
||||
_smsService = smsService;
|
||||
_holidayItemApplication = holidayItemApplication;
|
||||
_taskApplication = taskApplication;
|
||||
_ticketApplication = ticketApplication;
|
||||
_uidService = uidService;
|
||||
UserId = authHelper.CurrentAccountId();
|
||||
}
|
||||
[HttpGet]
|
||||
@@ -58,8 +61,9 @@ public class DashboardController : AdminBaseController
|
||||
var taskCount = await _taskApplication.RequestedAndOverdueTasksCount(UserId);
|
||||
var ticketCount = _ticketApplication.GetAdminTicketsCount();
|
||||
|
||||
|
||||
|
||||
return new AdminDashboardViewModel(calenderList, taskCount, ticketCount);
|
||||
return new AdminDashboardViewModel(calenderList, taskCount, ticketCount,todayPersian.Year,todayPersian.MonthOfYear,todayPersian.Day,todayPersian.DayOfWeek);
|
||||
}
|
||||
|
||||
[HttpGet("sms-remaining")]
|
||||
@@ -72,4 +76,4 @@ public class DashboardController : AdminBaseController
|
||||
|
||||
public record SmsRemainingResult(int Data);
|
||||
|
||||
public record AdminDashboardViewModel(List<CalenderViewModel> Calender, int TaskCount, int TicketCount);
|
||||
public record AdminDashboardViewModel(List<CalenderViewModel> Calender, int TaskCount, int TicketCount,int Year,string Month,int Day,string DayOfWeek);
|
||||
@@ -1,4 +1,5 @@
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ServiceHost.BaseControllers;
|
||||
@@ -115,9 +116,9 @@ public class EmployerController : AdminBaseController
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("select_list")]
|
||||
public async Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id)
|
||||
public async Task<List<EmployerSelectListViewModel>> GetSelectList(string search, long id,LegalType? legalType=null)
|
||||
{
|
||||
return await _employerApplication.GetSelectList(search, id);
|
||||
return await _employerApplication.GetSelectList(search, id,legalType);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -229,26 +229,9 @@ public class PaymentInstrumentController:AdminBaseController
|
||||
|
||||
|
||||
[HttpPost("bank-account-inquiry")]
|
||||
public async Task<ActionResult<OperationResult<BankInquiryResponse>>> GetBankInquiry([FromBody]BankInquiryRequest command)
|
||||
public async Task<ActionResult<ContractingPartyBankInquiryResponse>> GetBankInquiry([FromBody]InquiryContractingPartyBankDetailsRequest command)
|
||||
{
|
||||
if ((!string.IsNullOrWhiteSpace(command.AccountNumber) && command.AccountNumber.StartsWith("111111")) || (!string.IsNullOrWhiteSpace(command.CardNumber)&&command.CardNumber.StartsWith("111111")) || (!string.IsNullOrWhiteSpace(command.IBan)&&command.IBan.StartsWith("1111111")))
|
||||
{
|
||||
return new OperationResult<BankInquiryResponse>().Succcedded(new BankInquiryResponse()
|
||||
{
|
||||
AccountNumber = "1111111",
|
||||
IBan = "111111111111111111111111",
|
||||
CardNumber = "1111111111111111",
|
||||
AccountHolderName = "تست تستی",
|
||||
BankName = "تست بانک",
|
||||
});
|
||||
}else if ((!string.IsNullOrWhiteSpace(command.AccountNumber) && command.AccountNumber.StartsWith("222222")) || (!string.IsNullOrWhiteSpace(command.CardNumber)&&command.CardNumber.StartsWith("222222")) || (!string.IsNullOrWhiteSpace(command.CardNumber)&&command.CardNumber.StartsWith("222222")))
|
||||
{
|
||||
return new OperationResult<BankInquiryResponse>().Failed("دیتای وارد شده نامعتبر است");
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InternalServerException("ارور سمت سرور");
|
||||
}
|
||||
return await _contractingPartyBankAccountsApplication.InquiryContractingPartyBankDetails(command);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -79,6 +79,13 @@ namespace ServiceHost.Areas.Admin.Controllers
|
||||
return result;
|
||||
}
|
||||
[HttpGet("edit-employer/{employerId}/{institutionWorkshopDetailsId}")]
|
||||
|
||||
public async Task<ActionResult<EditEmployerWorkflowRegistration>> GetEmployerForEdit(long employerId, long institutionWorkshopDetailsId)
|
||||
{
|
||||
var result = await _employerApplication.GetWorkflowRegistrationForEdit(employerId, institutionWorkshopDetailsId);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// حذف کارفرما از گردش کار ثبت نام
|
||||
/// </summary>
|
||||
|
||||
49
ServiceHost/Areas/Admin/Controllers/RollCallController.cs
Normal file
49
ServiceHost/Areas/Admin/Controllers/RollCallController.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using _0_Framework.Application;
|
||||
using AccountManagement.Application.Contracts.Account;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Query.AdminReports.Handlers;
|
||||
using Query.AdminReports.Models;
|
||||
using ServiceHost.BaseControllers;
|
||||
using WorkFlow.Application.Contracts.WorkFlow;
|
||||
|
||||
namespace ServiceHost.Areas.Admin.Controllers;
|
||||
|
||||
public class RollCallController:AdminBaseController
|
||||
{
|
||||
private readonly IGetWorkshopWithRollCallHandler _workshopWithRollCallHandler;
|
||||
private readonly IWorkFlowApplication _workFlowApplication;
|
||||
private readonly long _currentAccountId;
|
||||
|
||||
public RollCallController(IGetWorkshopWithRollCallHandler workshopWithRollCallHandler,IAuthHelper _authHelper, IWorkFlowApplication workFlowApplication)
|
||||
{
|
||||
_workshopWithRollCallHandler = workshopWithRollCallHandler;
|
||||
_workFlowApplication = workFlowApplication;
|
||||
_currentAccountId = _authHelper.CurrentAccountId();
|
||||
}
|
||||
|
||||
[HttpGet("report")]
|
||||
public ActionResult<List<WorkshopWithRollCallServiceQueryModel>> GetRollCallReport([FromQuery] WorkshopWithRollCallServiceQueryParameters searchModel)
|
||||
{
|
||||
var result = _workshopWithRollCallHandler.Handle(searchModel);
|
||||
return result;
|
||||
}
|
||||
|
||||
[HttpGet("report/workshops-select-list")]
|
||||
public ActionResult<List<WorkshopSelectList>> GetWorkshopsSelectList()
|
||||
{
|
||||
var result = _workshopWithRollCallHandler.Handle(new WorkshopWithRollCallServiceQueryParameters())
|
||||
.Select(x => new WorkshopSelectList
|
||||
{
|
||||
Id = x.WorkshopId,
|
||||
WorkshopFullName = x.WorkshopName
|
||||
}).Distinct().ToList();
|
||||
return result;
|
||||
}
|
||||
|
||||
[HttpGet("repoert/workfloecount/{workshopId}")]
|
||||
public async Task<ActionResult<int>> GetWorkFlowCountByWorkshopId(long workshopId)
|
||||
{
|
||||
var result = await _workFlowApplication.GetAllWorkFlowCount(workshopId, _currentAccountId);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@@ -520,6 +520,230 @@ public class institutionContractController : AdminBaseController
|
||||
var res =await _institutionContractApplication.ExtensionComplete(request);
|
||||
return res;
|
||||
}
|
||||
|
||||
[HttpGet("amendment/workshops/{institutionContractId}")]
|
||||
public async Task<ActionResult<InstitutionContractAmendmentWorkshopsResponse>> GetAmendmentWorkshops(long institutionContractId)
|
||||
{
|
||||
var res =await _institutionContractApplication.GetAmendmentWorkshops(institutionContractId);
|
||||
return res;
|
||||
}
|
||||
|
||||
[HttpPost("resend-verify-link/{institutionContractId}")]
|
||||
public async Task<OperationResult> ResendVerifyLink(long institutionContractId)
|
||||
{
|
||||
var res = await _institutionContractApplication.ResendVerifyLink(institutionContractId);
|
||||
return res;
|
||||
}
|
||||
|
||||
[HttpPost("amendment/insert-temp-workshops")]
|
||||
public async Task<ActionResult<InsertAmendmentTempWorkshopResponse>> InsertAmendmentTempWorkshops([FromBody]InstitutionContractAmendmentTempWorkshopViewModel request)
|
||||
{
|
||||
var res =await _institutionContractApplication.InsertAmendmentTempWorkshops(request);
|
||||
return res;
|
||||
}
|
||||
[HttpDelete("amendment/remove-temp-workshops/{workshopTempId:guid}")]
|
||||
public async Task<ActionResult> RemoveAmendmentWorkshops(Guid workshopTempId)
|
||||
{
|
||||
await _institutionContractApplication.RemoveAmendmentWorkshops(workshopTempId);
|
||||
return Ok();
|
||||
}
|
||||
[HttpPost("amendment/payment-details")]
|
||||
public async Task<ActionResult<InsitutionContractAmendmentPaymentResponse>> GetAmendmentPaymentDetails([FromBody]InsitutionContractAmendmentPaymentRequest request)
|
||||
{
|
||||
var res =await _institutionContractApplication.GetAmendmentPaymentDetails(request);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
[HttpGet("edit-old/{id}")]
|
||||
public ActionResult<EditInstitutionContract> GetEditOldDetails(long id)
|
||||
{
|
||||
var representativList = new List<RepresentativeViewModel>();
|
||||
var contractingPartyList = new List<PersonalContractingPartyViewModel>();
|
||||
var res = _institutionContractApplication.GetDetails(id);
|
||||
|
||||
var representative = new RepresentativeViewModel
|
||||
{
|
||||
Id = res.RepresentativeId,
|
||||
FullName = res.RepresentativeName
|
||||
};
|
||||
representativList.Add(representative);
|
||||
var contractingParty = new PersonalContractingPartyViewModel
|
||||
{
|
||||
id = res.ContractingPartyId,
|
||||
FullName = _contractingPartyApplication.GetFullName(res.ContractingPartyId)
|
||||
};
|
||||
contractingPartyList.Add(contractingParty);
|
||||
res.RepresentativeSelectList =
|
||||
new SelectList(representativList, "Id", "FullName");
|
||||
res.ContractingPartiesSelectList =
|
||||
new SelectList(contractingPartyList, "id", "FullName");
|
||||
|
||||
var employer = _employerApplication.GetEmployerByContracrtingPartyID(res.ContractingPartyId);
|
||||
var emplId = employer.Select(x => x.Id).ToList();
|
||||
|
||||
var w = _workshopApplication.GetWorkshopsByEmployerId(emplId);
|
||||
var workshopIds = w.Select(x => x.Id).ToList();
|
||||
var workshopCount = Convert.ToString(w.Count);
|
||||
var pCount = 0;
|
||||
if (workshopIds.Count > 0)
|
||||
{
|
||||
foreach (var workshopId in workshopIds)
|
||||
{
|
||||
var p = _workshopApplication.PersonnelCount(workshopId);
|
||||
pCount += p;
|
||||
}
|
||||
|
||||
res.EmployeeCount = Convert.ToString(pCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
res.EmployeeCount = "0";
|
||||
}
|
||||
|
||||
res.WorkshopCount = workshopCount;
|
||||
|
||||
|
||||
var contactInfo = _contactInfoApplication.GetContactInfolist(id);
|
||||
if (contactInfo.Count > 0)
|
||||
{
|
||||
res.ContactInfoCounter = contactInfo.Count;
|
||||
res.ContactInformationList = contactInfo;
|
||||
}
|
||||
else
|
||||
{
|
||||
res.ContactInfoCounter = 0;
|
||||
}
|
||||
|
||||
if (res.HasValueAddedTax == "true")
|
||||
{
|
||||
res.ContractAmount -= res.ValueAddedTax;
|
||||
res.ContractAmountOAlone = res.ContractAmount.ToMoney();
|
||||
res.ValueAddedTaxStr = res.ValueAddedTax.ToMoney();
|
||||
}
|
||||
else
|
||||
{
|
||||
res.ContractAmountOAlone = res.ContractAmountString;
|
||||
res.ValueAddedTaxStr = "0";
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
[HttpPost("edit-old")]
|
||||
public ActionResult<OperationResult> EditOld([FromBody] EditInstitutionContract command)
|
||||
{
|
||||
var op = new OperationResult();
|
||||
var phoneNumber = command.ContactInformationList.FirstOrDefault(x =>
|
||||
x.SendSmsString == "true" && x.Position == "طرف قرارداد" && x.PhoneType == "شماره همراه");
|
||||
var conractingParty = _contractingPartyApplication.GetDetails(command.ContractingPartyId);
|
||||
|
||||
if (conractingParty.IsLegal == "حقیقی" && string.IsNullOrWhiteSpace(conractingParty.Nationalcode))
|
||||
return new JsonResult(op.Failed("کد ملی طرف حساب وجود ندارد"));
|
||||
if (conractingParty.IsLegal == "حقوقی" && string.IsNullOrWhiteSpace(conractingParty.NationalId))
|
||||
return new JsonResult(op.Failed("شناسه ملی طرف حساب وجود ندارد"));
|
||||
if (phoneNumber == null)
|
||||
return new JsonResult(op.Failed("تعیین شماره همراه با سمت طرف قرارداد اجباریست"));
|
||||
//if (string.IsNullOrWhiteSpace(command.HasValueAddedTax))
|
||||
// command.HasValueAddedTax = "false";
|
||||
var result = _institutionContractApplication.Edit(command);
|
||||
var contractingPartyId = _institutionContractApplication.GetDetails(result.SendId);
|
||||
var counter = command.ContactInformationList.Count;
|
||||
var getOldContarct = _institutionContractApplication.NewSearch(new InstitutionContractSearchModel()
|
||||
{ ContractingPartyId = contractingPartyId.ContractingPartyId, IsActiveString = "both" }).Where(x=>x.IsActiveString == "false" || x.IsActiveString == "blue").ToList();
|
||||
if (result.IsSuccedded && counter > 0)
|
||||
{
|
||||
|
||||
if (getOldContarct.Count > 0)
|
||||
{
|
||||
foreach (var item in getOldContarct)
|
||||
{
|
||||
_contactInfoApplication.RemoveContactInfo(item.Id);
|
||||
foreach (var phone in command.ContactInformationList)
|
||||
{
|
||||
if (phone.PhoneNumber != null)
|
||||
{
|
||||
var contactinfo = new CreateContactInfo
|
||||
{
|
||||
InstitutionContractId = item.Id,
|
||||
PhoneType = phone.PhoneType,
|
||||
Position = phone.Position,
|
||||
PhoneNumber = phone.PhoneNumber,
|
||||
FnameLname = phone.FnameLname,
|
||||
SendSms = phone.SendSmsString == "true" ? true : false
|
||||
};
|
||||
_contactInfoApplication.Create(contactinfo);
|
||||
}
|
||||
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
}
|
||||
}
|
||||
_contactInfoApplication.RemoveContactInfo(command.Id);
|
||||
foreach (var item in command.ContactInformationList)
|
||||
{
|
||||
if (item.PhoneNumber != null)
|
||||
{
|
||||
var contactinfo = new CreateContactInfo
|
||||
{
|
||||
InstitutionContractId = result.SendId,
|
||||
PhoneType = item.PhoneType,
|
||||
Position = item.Position,
|
||||
PhoneNumber = item.PhoneNumber,
|
||||
FnameLname = item.FnameLname,
|
||||
SendSms = item.SendSmsString == "true" ? true : false
|
||||
};
|
||||
_contactInfoApplication.Create(contactinfo);
|
||||
}
|
||||
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
|
||||
|
||||
//ساخت اکانت کلاینت
|
||||
var userPass = conractingParty.IsLegal == "حقیقی"
|
||||
? conractingParty.Nationalcode
|
||||
: conractingParty.NationalId;
|
||||
var checkExistAccount = _accountApplication.CheckExistClientAccount(userPass);
|
||||
if (!checkExistAccount)
|
||||
{
|
||||
|
||||
var createAcc = new RegisterAccount
|
||||
{
|
||||
Fullname = conractingParty.LName,
|
||||
Username = userPass,
|
||||
Password = userPass,
|
||||
Mobile = phoneNumber.PhoneNumber,
|
||||
NationalCode = userPass
|
||||
};
|
||||
var res = _accountApplication.RegisterClient(createAcc);
|
||||
if (res.IsSuccedded)
|
||||
_institutionContractApplication.CreateContractingPartyAccount(command.ContractingPartyId, res.SendId);
|
||||
}
|
||||
}
|
||||
//Thread.Sleep(500);
|
||||
//for (int i = 0; i <= counter - 1; i++)
|
||||
//{
|
||||
// if (command.ContactInformationList[i].PhoneNumber != null)
|
||||
// {
|
||||
|
||||
// var contactinfo = new CreateContactInfo()
|
||||
// {
|
||||
// InstitutionContractId = result.SendId,
|
||||
// PhoneType = command.ContactInformationList[i].PhoneType,
|
||||
// Position = command.ContactInformationList[i].Position,
|
||||
// PhoneNumber = command.ContactInformationList[i].PhoneNumber,
|
||||
// FnameLname = command.ContactInformationList[i].FnameLname,
|
||||
// SendSms = command.ContactInformationList[i].SendSmsString == "true" ? true : false
|
||||
// };
|
||||
// _contactInfoApplication.Create(contactinfo);
|
||||
|
||||
// }
|
||||
// Thread.Sleep(500);
|
||||
//}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -871,6 +871,14 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="child-check level2">
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn" />
|
||||
</label>
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="1004" class="check-btn"> <span style="bottom: 2px;position: relative"> قرارداد های مالی </span> </label>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@* بررسی مدارک پرسنل *@
|
||||
<div class="parent-check">
|
||||
|
||||
@@ -881,6 +881,15 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="child-check level2">
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn" />
|
||||
</label>
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="1004" class="check-btn"> <span style="bottom: 2px;position: relative"> قرارداد های مالی </span> </label>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@* بررسی مدارک پرسنل *@
|
||||
<div class="parent-check">
|
||||
|
||||
@@ -195,7 +195,7 @@
|
||||
<div class="rollcall-list Rtable Rtable--5cols Rtable--collapse px-1">
|
||||
|
||||
<div class="w-100 my-1">
|
||||
<div class="absenceHeadColorTop" style="border-radius: 10px 10px 0 0;">غیبت</div>
|
||||
<div class="absenceHeadColorTop" style="border-radius: 10px 10px 0 0;">عدم حضور</div>
|
||||
<div class="Rtable-row Rtable-row--head align-items-center d-flex table-rollcall-absent absenceHeadColor">
|
||||
<div class="Rtable-cell column-heading width1">ردیف</div>
|
||||
<div class="Rtable-cell column-heading width2">نام پرسنل</div>
|
||||
@@ -328,7 +328,7 @@
|
||||
<div class="btnsRollCallOnlline">
|
||||
<button class="btnRollCallStatus active" onclick="loadRollCallStatus('all')">آنلاین</button>
|
||||
<button class="btnRollCallStatus" onclick="loadRollCallStatus('leave')">مرخصی <span id="leaveCount"></span></button>
|
||||
<button class="btnRollCallStatus" onclick="loadRollCallStatus('absent')">غیبت <span id="absentCount"></span></button>
|
||||
<button class="btnRollCallStatus" onclick="loadRollCallStatus('absent')">عدم حضور <span id="absentCount"></span></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wrapper">
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
@page
|
||||
@using _0_Framework.Application
|
||||
@using Microsoft.Extensions.Options
|
||||
@model ServiceHost.Areas.AdminNew.Pages.Company.WorkFlow.IndexModel
|
||||
@inject IOptions<AppSettingConfiguration> AppSetting;
|
||||
|
||||
@{
|
||||
}
|
||||
|
||||
@@ -122,6 +126,22 @@
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="gwb-card" permission="1004">
|
||||
<a href="https://admin@(AppSetting.Value.Domain)/workflow/institution-contract" class="click loadingButton">
|
||||
<div class="d-flex align-items-center justify-content-between p-1 w-100">
|
||||
<div class="d-flex align-items-center">
|
||||
<img src="~/AssetsClient/images/insuranceList.png" alt="" class="img-fluid mx-1" width="50px" />
|
||||
<div class="text-start ms-1">
|
||||
<div class="card-title">قرارداد های مالی</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="spinner-loading loading" style="display: none;">
|
||||
<span class="spinner-border spinner-border-sm loading text-white" role="status" aria-hidden="true"></span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@* <div class="gwb-card">
|
||||
<a asp-page="/Company/WorkFlow/Insurance" class="click loadingButton">
|
||||
|
||||
@@ -231,7 +231,7 @@
|
||||
|
||||
<div class="day-off-parent">
|
||||
<div class="day-off-title mb-2">
|
||||
روزهای تعطیل هفته
|
||||
روزهای فعالیت مجموعه
|
||||
</div>
|
||||
|
||||
<div class="day-off-button-container mb-3">
|
||||
|
||||
@@ -382,7 +382,9 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
IsAbsent = x.IsAbsent,
|
||||
TotalWorkingHours = x.TotalWorkingHours,
|
||||
StartsItems = string.Join(Environment.NewLine, x.RollCallTimesList.Select(tr=>tr.StartDate)),
|
||||
EndsItems= string.Join(Environment.NewLine, x.RollCallTimesList.Select(tr=>tr.EndDate))
|
||||
EndsItems= string.Join(Environment.NewLine, x.RollCallTimesList.Select(tr=>tr.EndDate)),
|
||||
EnterTimeDifferences = string.Join(Environment.NewLine, x.RollCallTimesList.Select(tr=>tr.EntryTimeDifferences)),
|
||||
ExitTimeDifferences = string.Join(Environment.NewLine, x.RollCallTimesList.Select(tr=>tr.ExitTimeDifferences))
|
||||
}).ToList()
|
||||
|
||||
};
|
||||
|
||||
@@ -234,7 +234,7 @@
|
||||
<div class="rollcall-list Rtable Rtable--5cols Rtable--collapse px-1">
|
||||
|
||||
<div class="w-100 my-1">
|
||||
<div class="absenceHeadColorTop" style="border-radius: 10px 10px 0 0;">غیبت</div>
|
||||
<div class="absenceHeadColorTop" style="border-radius: 10px 10px 0 0;">عدم حضور</div>
|
||||
<div class="Rtable-row Rtable-row--head align-items-center d-flex table-rollcall-absent absenceHeadColor">
|
||||
<div class="Rtable-cell column-heading width1">ردیف</div>
|
||||
<div class="Rtable-cell column-heading width2">نام پرسنل</div>
|
||||
@@ -367,7 +367,7 @@
|
||||
<div class="btnsRollCallOnlline">
|
||||
<button class="btnRollCallStatus active" onclick="loadRollCallStatus('all')">آنلاین</button>
|
||||
<button class="btnRollCallStatus" onclick="loadRollCallStatus('leave')">مرخصی <span id="leaveCount"></span></button>
|
||||
<button class="btnRollCallStatus" onclick="loadRollCallStatus('absent')">غیبت <span id="absentCount"></span></button>
|
||||
<button class="btnRollCallStatus" onclick="loadRollCallStatus('absent')">عدم حضور <span id="absentCount"></span></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wrapper">
|
||||
|
||||
@@ -223,7 +223,7 @@
|
||||
|
||||
<div class="day-off-parent">
|
||||
<div class="day-off-title mb-2">
|
||||
روزهای تعطیل هفته
|
||||
روزهای فعالیت مجموعه
|
||||
</div>
|
||||
|
||||
<div class="day-off-button-container mb-3">
|
||||
|
||||
@@ -383,7 +383,7 @@
|
||||
|
||||
<div class="day-off-parent">
|
||||
<div class="day-off-title mb-2">
|
||||
روزهای تعطیل هفته
|
||||
روزهای فعالیت مجموعه
|
||||
</div>
|
||||
|
||||
<div class="day-off-button-container mb-3">
|
||||
|
||||
@@ -393,7 +393,7 @@
|
||||
|
||||
<div class="day-off-parent">
|
||||
<div class="day-off-title mb-2">
|
||||
روزهای تعطیل هفته
|
||||
روزهای فعالیت مجموعه
|
||||
</div>
|
||||
|
||||
<div class="day-off-button-container mb-3">
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<button type="button" class="btn-close position-absolute text-start" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
<h6 class="m-0">پرینت حضور و غیاب انفرادی @Model.PersianMonthName ماه @Model.PersianYear</h6>
|
||||
</div>
|
||||
|
||||
```````
|
||||
<div class="modal-body" id="divTablescrollbar">
|
||||
<div class="row main-table">
|
||||
|
||||
@@ -121,7 +121,17 @@
|
||||
<span class="m-0">@item.DateFa</span>
|
||||
</td>
|
||||
<td style="font-family: 'IranText' !important; font-size: 10px !important; text-align: center">
|
||||
-
|
||||
@if (item.RollCallTimesList.Any())
|
||||
{
|
||||
@foreach (var rollCallItem in item.RollCallTimesList)
|
||||
{
|
||||
<div>@(rollCallItem.EntryTimeDifferences ?? "-")</div>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>-</span>
|
||||
}
|
||||
</td>
|
||||
<td style="font-family: 'IranText' !important; font-size: 10px !important; text-align: center">
|
||||
@if (item.RollCallTimesList.Any())
|
||||
@@ -150,7 +160,17 @@
|
||||
}
|
||||
</td>
|
||||
<td style="font-family: 'IranText' !important; font-size: 10px !important; text-align: center">
|
||||
-
|
||||
@if (item.RollCallTimesList.Any())
|
||||
{
|
||||
@foreach (var rollCallItem in item.RollCallTimesList)
|
||||
{
|
||||
<div>@(rollCallItem.ExitTimeDifferences ?? "-")</div>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>-</span>
|
||||
}
|
||||
</td>
|
||||
<td style="font-family: 'IranText' !important; font-size: 10px !important; text-align: center">
|
||||
@item.TotalWorkingHours
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
|
||||
<div class="day-off-parent">
|
||||
<div class="day-off-title mb-2">
|
||||
روزهای تعطیل هفته
|
||||
روزهای فعالیت مجموعه
|
||||
</div>
|
||||
|
||||
<div class="day-off-button-container mb-3">
|
||||
|
||||
@@ -154,7 +154,7 @@
|
||||
|
||||
<div class="day-off-parent">
|
||||
<div class="day-off-title mb-2">
|
||||
روزهای تعطیل هفته
|
||||
روزهای فعالیت مجموعه
|
||||
</div>
|
||||
|
||||
<div class="day-off-button-container mb-3">
|
||||
|
||||
@@ -218,7 +218,7 @@
|
||||
|
||||
<div class="day-off-parent mb-4">
|
||||
<div class="day-off-title mb-2">
|
||||
روزهای تعطیل هفته
|
||||
روزهای فعالیت مجموعه
|
||||
</div>
|
||||
|
||||
<div class="day-off-button-container mb-3">
|
||||
|
||||
@@ -168,7 +168,7 @@
|
||||
|
||||
<div class="day-off-parent">
|
||||
<div class="day-off-title mb-2">
|
||||
روزهای تعطیل هفته
|
||||
روزهای فعالیت مجموعه
|
||||
</div>
|
||||
|
||||
<div class="day-off-button-container mb-3">
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
|
||||
<li class="active" data-menu="absent">
|
||||
<div class="d-flex align-items-center justify-content-between" id="clickAbsentTab">
|
||||
<a href="javascript:void(0);">غیبت</a>
|
||||
<a href="javascript:void(0);">عدم حضور</a>
|
||||
<div>
|
||||
<div id="CountAbsentLoading" class="spinner-grow text-danger" role="status" style="align-items: center;justify-content: center;display: flex;margin: 0 0 0 9px;">
|
||||
<span class="visually-hidden">Loading...</span>
|
||||
@@ -218,7 +218,7 @@
|
||||
<div class="Rtable-row SubAccountRowMobile align-items-center position-relative openAction">
|
||||
<div class="Rtable-cell d-md-block d-flex width2">
|
||||
<div class="Rtable-cell--content text-start">
|
||||
<div class="roleName">غیبت</div>
|
||||
<div class="roleName">عدم حضور</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
@@ -420,7 +420,7 @@ input:checked + .sliderEUP:before {
|
||||
background-color: #ffffff;
|
||||
background: rgba(209, 50, 50, 0.15);
|
||||
transition: ease .2s;
|
||||
width: 55px;
|
||||
/*width: 55px;*/
|
||||
}
|
||||
|
||||
.btn-workflow-rollcall-edit {
|
||||
|
||||
@@ -292,7 +292,7 @@ function loadEmployeeListByWorkFlowsAbsents(date) {
|
||||
</button>
|
||||
|
||||
<button type="button" class="btn-workflow-absent" onclick="confirmAbsentAlert(${rollCallItem.employeeId}, '${data.dateTimeFa}')">
|
||||
<span class="mx-1">غیبت</span>
|
||||
<span class="mx-1 text-nowrap">عدم حضور</span>
|
||||
</button>
|
||||
|
||||
<button class="btn-workflow-rollcall-edit position-relative" onclick="showModalEditRollCall(${rollCallItem.employeeId}, '${data.dateTimeFa}')">
|
||||
@@ -1028,7 +1028,7 @@ function showModalEditLeave(leaveId) {
|
||||
|
||||
function confirmAbsentAlert(employeeId, dateFa) {
|
||||
swal({
|
||||
title: "آیا از تایید این غیبت اطمینان دارید؟",
|
||||
title: "آیا از تایید این عدم حضور اطمینان دارید؟",
|
||||
text: "",
|
||||
type: "warning",
|
||||
showCancelButton: true,
|
||||
|
||||
Reference in New Issue
Block a user