EchoTex_Payroll/HRM.BO/Claim/ClaimRequisition.cs

317 lines
13 KiB
C#
Raw Permalink Normal View History

2024-10-14 10:01:49 +06:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Ease.CoreV35;
using Ease.CoreV35.DataAccess;
using System.Data;
using HRM.BO;
using Payroll.BO;
using Ease.Core.DataAccess;
namespace Payroll.BO
{
public class ClaimRequisition : BasicBaseObject, IworkflowInterface
{
#region Constructor
public ClaimRequisition()
{
this.RequsitionStatus = EnumClaimRequsitionStatus.Darft;
JVStatus = false;
PayrollTypeID = null;
BranchID = null;
BankID = null;
ClaimProcessDate = DateTime.MinValue;
}
#endregion
#region Properties
public bool JVStatus { get; set;}
public string RequisitionNo { get; set; }
public DateTime ClaimDate { get; set;}
public DateTime? ClaimProcessDate { get; set;}
public double ClaimAmount { get; set; }
public string Reason { get; set;}
public string Remarks { get; set;}
public int ClaimBasicID { get; set; }
public ClaimBasic Claim { get; set; }
public int ClaimRuleID { get; set; }
public EnumClaimRequsitionStatus RequsitionStatus { get; set; }
public int EmployeeID { get; set; }
public int CostCenterID { get; set; }
public string GLCode { get; set; }
public string GLSide { get; set; }
public string GLSideCode { get; set; }
public bool PaymentDone { get; set; }
public int ParentID { get; set; }
public int OnBehalfEmplID { get; set; }
public DateTime SalaryMonth { get; set; }
public DateTime? SalaryPaidMonth { get; set; }
public int? BankID { get; set; }
public int? BranchID { get; set; }
public int? PayrollTypeID { get; set; }
public List<ClaimRequisitionItem> ClaimRequisitionItems { get; set; }
public List<ClaimRequisitionAttachment> ClaimRequisitionAttachments { get; set; }
public List<ClaimRequisitionRelation> ClaimRequisitionRelations { get; set; }
public List<FileAttachment> IRFileAttacments { get; set; }
public Employee Employee { get; set;}
public string Description { get; set; }
public string InitiatorRemarks { get; set; }
public bool? IsOnBehalf { get; set; }
public bool? IsAdvance { get; set; }
public bool? IsExpense { get; set; }
public int? AdvanceItemId { get; set; }
public string Name { get; set; }
public string EmailAddress { get; set; }
public string EmployeeNo { get; set; }
public string Designation { get; set; }
public string ConnectionString { get; set; }
public string RequisitionString { get; set; }
public dynamic? Field1 { get; set; }
public dynamic? Field2 { get; set; }
public dynamic? Field3 { get; set; }
public dynamic? Field4 { get; set; }
public EnumClaimPaymentType? PaymentType { get; set; }
public bool? IsPayment { get; set; }
public string PaymentRemarks { get; set; }
public int PaidBy { get; set; }
//public dynamic Field1ConvertValue { get; set; }
//public dynamic Field2ConvertValue { get; set; }
//public dynamic Field3ConvertValue { get; set; }
//public dynamic Field4ConvertValue { get; set; }
public string tempFileTobase64
{
get; set;
}
public string ObjectDescription
{
get
{
string str = "";
//if (true)
//{
// str = this.Employee.Name + " has applied for monthly claim " + " on " + Convert.ToDateTime(this.ClaimDate).ToString("dd MMMM yyyy") + ". ";//"of "+ this.ClaimProcessDate.ToString("MMM yyyy")
//}
return str;
}
}
/// <summary>
/// this property is used for work flow, it's a constant value
/// </summary>
public int SetupID
{
get
{
return 4;
// int payrollTypeId = 0;// SystemInformation.CurrentSysInfo.PayrollTypeID.Integer;
////switch (ClaimBasicID){
//// case 1:
//// if (payrollTypeId == 1)
//// return ID.FromInteger(4);
//// else
//// return ID.FromInteger(20);
//// case 2:
// if (payrollTypeId == 1)
// return 3;
// else
// return 4;
// case 3:
//if (payrollTypeId == 1)
// return ID.FromInteger(5);
//else
// return ID.FromInteger(22);
//case 4:
// if (payrollTypeId == 1)
// return ID.FromInteger(6);
// else
// return ID.FromInteger(23);
//case 5:
// if (payrollTypeId == 1)
// return ID.FromInteger(7);
// else
// return ID.FromInteger(24);
//case 6:
// if (payrollTypeId == 1)
// return ID.FromInteger(8);
// else
// return ID.FromInteger(25);
//case 7:
// if (payrollTypeId == 1)
// return ID.FromInteger(9);
// else
// return ID.FromInteger(26);
//case 8:
// if (payrollTypeId == 1)
// return ID.FromInteger(10);
// else
// return ID.FromInteger(27);
//case 9:
// if (payrollTypeId == 1)
// return ID.FromInteger(11);
// else
// return ID.FromInteger(28);
//case 10:
// if (payrollTypeId == 1)
// return ID.FromInteger(12);
// else
// return ID.FromInteger(29);
//case 11:
// if (payrollTypeId == 1)
// return ID.FromInteger(13);
// else
// return ID.FromInteger(8);
//case 12:
// if (payrollTypeId == 1)
// return ID.FromInteger(14);
// else
// return ID.FromInteger(8);
//case 13:
// if (payrollTypeId == 1)
// return ID.FromInteger(15);
// else
// return ID.FromInteger(8);
//default:
// if (payrollTypeId == 1)
// return ID.FromInteger(16);
// else
// return ID.FromInteger(31);
}
}
// switch (ClaimBasicID)
//{
// case 1:
// get { return ID.FromInteger(7); }
// break;
// case 2:
// get { return ID.FromInteger(7); }
// break;
// default:
// get { return ID.FromInteger(7); }
//}
/// <summary>
/// this property is used for work flow, which return leave entry id
/// </summary>
public int ObjectID
{
get { return this.ID; }
}
}
#endregion
#region IClaimRequisitionService Service
public interface IClaimRequisitionService
{
ClaimRequisition Get(int id);
ClaimRequisition Get(int id, TransactionContext tc);
List<ClaimRequisition> GetByIds(string id);
DataSet GetClaimReqsByIds(string id);
List<ClaimRequisitionItem> GetClaimRequisitionItem(string id);
ClaimRequisition GetClaimReqById(int id);
DataSet GetFilteredClaimReqsByIds(string id, DateTime fromDate, DateTime toDate, string employeeNo, string employeeName);
DataTable GetClaimRequisitionItemsInGrid(string id);
DataTable GetSignatures(int objectId, int wftypeId);
DataTable GetSignaturesByUniqueNumber(int uniqueNumber, int wftypeId);
DataTable GetClaimRequisitionHistory(int id);
DataTable GetClaimAttachmentsInGrid(string id);
List<ClaimRequisition> Get();
List<ClaimRequisition> GetByClaimRequisitionID(int claimRequisitionID);
ClaimRequisition GetByClaimRequisitionID2(int claimRequisitionID);
int Save(ClaimRequisition item);
int SaveFromLineManager(ClaimRequisition item);
void Save(List<ClaimRequisition> _claimRequisitionItems);
void Delete(int id);
void DeleteByClaimRequisitionID(int id);
ClaimRequisitionItem GetClaimRequisitionItem(int id);
List<ClaimRequisitionItem> GetClaimRequisitionItems();
List<ClaimRequisitionItem> GetClaimRequisitionItemByClaimRequisitionID(TransactionContext tc,int claimBasicID);
int SaveClaimRequisitionItems(ClaimRequisitionItem item);
void SaveClaimRequisitionItems(List<ClaimRequisitionItem> _claimBasicItems);
void DeleteClaimRequisitionItems(int id);
void DeleteClaimRequisitionItemByClaimRequisitionID(int id);
ClaimRequisitionAttachment GetClaimRequisitionAttachment(int id);
List<ClaimRequisitionAttachment> GetClaimRequisitionAttachments();
List<ClaimRequisitionAttachment> GetClaimRequisitionAttachmentByClaimRequisitionID(int claimBasicID);
int SaveClaimRequisitionAttachments(ClaimRequisitionAttachment item);
void SaveClaimRequisitionAttachments(List<ClaimRequisitionAttachment> _claimBasicItems);
void DeleteClaimRequisitionAttachments(int id);
void DeleteClaimRequisitionAttachmentByClaimRequisitionID(int id);
ClaimRequisitionRelation GetClaimRequisitionRelation(int id);
List<ClaimRequisitionRelation> GetClaimRequisitionRelations();
List<ClaimRequisitionRelation> GetClaimRequisitionRelationsByItemId(int id);
List<ClaimRequisitionRelation> GetClaimRequisitionRelationByClaimRequisitionID(int claimBasicID);
int SaveClaimRequisitionRelations(ClaimRequisitionRelation item);
void SaveClaimRequisitionRelations(List<ClaimRequisitionRelation> _claimBasicItems);
void DeleteClaimRequisitionRelations(int id);
void DeleteClaimRequisitionRelationByClaimRequisitionID(int id);
DataSet ClaimForAdmin(DateTime frmDate, DateTime toDate, int claimBasicId, string status, int employeeId);
DataSet GetItemByClaimRquisitonId(string claimRequisitionIds);
DataSet GetClaimReqisitionRelationByClaimRquisitonId(string claimRequisitionIds);
List<ClaimRequisition> GetClaimRequistionByClIdAndMonth(int claimBasicId, DateTime salaryMonth, int wf);
List<ClaimRequisition> Get(int claimBasicId, int employeeId);
List<ClaimRequisition> GetClaimRequistionByClaimPaymentID(string claimBasicId, int wf);
void UpdateClaimRwquisitionStatus(string _claimRequisitionIDs);
DataSet GetEmpClaims(DateTime salaryMonth, string sEmpID);
ClaimRequisition GetClaimByprocessDate(EnumwfStatus enumwfStatus, int empID);
void SaveClaimRequisitionItems(TransactionContext tc, List<ClaimRequisitionItem> _claimBasicItems);
void DeleteClaimRequisitionItemByClaimRequisitionID(TransactionContext tc, int id);
void DeleteClaimRequisitionRelationByClaimRequisitionID(TransactionContext tc, int id);
void SaveClaimRequisitionRelations(TransactionContext tc, List<ClaimRequisitionRelation> _claimBasicItems);
DataSet GetClaimBalanceInfo(DateTime fromdate, DateTime toDate, string sSQL, int status);
List<FileAttachment> GetIRFileAttachments(int claimRequisitionID);
void ApproveClaimRequisition(WFMovementTran approver);
void claimRequisitionReject(WFMovementTran rejectTran);
List<ClaimRequisition> GetAllClaimRequisition(DateTime fromDate, DateTime toDate, int employeeId, EnumClaimRequsitionStatus? status);
DataTable GetPendingList(int approverid, string ids, DateTime fromDate, DateTime toDate);
List<ClaimRequisition> GetClaimReqsByEmployeeIds(DateTime fromDate, DateTime toDate, string employeeIds, int currentUserID, EnumClaimWFStatus? appstatus, EnumClaimPaymentType? paymentType);
void UpdateClaimPaymentType(ClaimRequisition item);
FileAttachment GetByRefChildId(int claimRequisitionId, int claimreqItemId);
void ApproveClaimRequisitions(List<WFMovementTran> approverList);
void claimRequisitionRejects(List<WFMovementTran> rejectTranList);
List<ClaimDisbursementReport> GetClaimDisbursementReport(string ids, DateTime fromDate, DateTime toDate, int currentUserID, EnumClaimWFStatus? appstatus, EnumClaimPaymentType? paymentType);
void UpdateClaimPaymentStatusByClaimId(string ids, EnumClaimPaymentType? claimPaymentType, string remarks, int currentUserID);
List<ClaimDisbursementReport> GetClaimReportEcport(DateTime fromDate, DateTime toDate, EnumClaimRequsitionStatus? status, int currentUserID);
double GetClearanceAmount(int empid);
List<ClaimRequisition> GetPrevAdavancedAmountbyEmployeeId(int employeeId);
ClaimRequisition GetByClaimId(int id, TransactionContext tc);
}
#endregion
}