174 lines
6.4 KiB
C#
174 lines
6.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
|
|
namespace HRM.BO
|
|
{
|
|
#region LFAPayment
|
|
|
|
/// <summary>One Leave Fare Assistance payment batch (dbo.LFAPayment), as SalaryProcess is for the salary.</summary>
|
|
public class LFAPayment : AuditTrailBase, IworkflowInterface
|
|
{
|
|
public LFAPayment()
|
|
{
|
|
BatchNumber = string.Empty;
|
|
Details = new List<LFAPaymentDetail>();
|
|
}
|
|
|
|
public string BatchNumber { get; set; }
|
|
public int PayrollTypeID { get; set; }
|
|
|
|
/// <summary>The last date of the month of PAYROLLTYPE.NEXTPAYPROCESSDATE.</summary>
|
|
public DateTime SalaryMonth { get; set; }
|
|
|
|
/// <summary>The last date of the calendar year the LFA is for.</summary>
|
|
public DateTime LFAYear { get; set; }
|
|
|
|
public DateTime PaymentDate { get; set; }
|
|
public string Remarks { get; set; }
|
|
public bool IsTaxUpdated { get; set; }
|
|
|
|
/// <summary>Null = not submitted yet, as SalaryProcess.WFStatus.</summary>
|
|
public enumwfStatus? WFStatus { get; set; }
|
|
|
|
public int? ApprovedBy { get; set; }
|
|
public DateTime? ApprovedDate { get; set; }
|
|
|
|
public List<LFAPaymentDetail> Details { get; set; }
|
|
|
|
#region IworkflowInterface Members
|
|
|
|
public string ObjectDescription
|
|
{
|
|
get { return "LFA payment batch " + BatchNumber; }
|
|
}
|
|
|
|
/// <summary>The workflow type (WFTYPE 33), as SalaryProcess returns 30.</summary>
|
|
public int SetupID
|
|
{
|
|
get { return LFAPaymentApproval.WFTypeID; }
|
|
}
|
|
|
|
public int ObjectID
|
|
{
|
|
get { return this.ID; }
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region LFAPaymentDetail
|
|
|
|
/// <summary>One employee of a batch (dbo.LFAPaymentDetail): a snapshot of the employee and of the calculation.</summary>
|
|
public class LFAPaymentDetail : AuditTrailBase
|
|
{
|
|
public int LFAPaymentID { get; set; }
|
|
public int EmployeeID { get; set; }
|
|
public DateTime LFAYear { get; set; }
|
|
|
|
public DateTime JoiningDate { get; set; }
|
|
public DateTime? ConfirmationDate { get; set; }
|
|
public int? GradeID { get; set; }
|
|
public int? DesignationID { get; set; }
|
|
public int? DepartmentID { get; set; }
|
|
public int? CostCenterID { get; set; }
|
|
public int? BranchID { get; set; }
|
|
public string AccountNo { get; set; }
|
|
|
|
public double? JoiningBasic { get; set; }
|
|
|
|
/// <summary>Basic as of 31 December of the preceding year; null when the employee joined in the LFA year.</summary>
|
|
public double? LastDecBasic { get; set; }
|
|
|
|
/// <summary>The basic the LFA was calculated on.</summary>
|
|
public double BasicSalary { get; set; }
|
|
|
|
/// <summary>What the policy gives, before rounding to whole taka.</summary>
|
|
public double CalculatedAmount { get; set; }
|
|
|
|
/// <summary>The LFA amount to pay.</summary>
|
|
public double Amount { get; set; }
|
|
|
|
public string Remarks { get; set; }
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region LFAEmployee
|
|
|
|
/// <summary>What the LFA calculation needs to know of one employee (not a table).</summary>
|
|
public class LFAEmployee
|
|
{
|
|
public int EmployeeID { get; set; }
|
|
public string EmployeeNo { get; set; }
|
|
public string Name { get; set; }
|
|
public int PayrollTypeID { get; set; }
|
|
public EnumEmployeeStatus Status { get; set; }
|
|
public bool IsConfirmed { get; set; }
|
|
public DateTime JoiningDate { get; set; }
|
|
public DateTime? ConfirmationDate { get; set; }
|
|
|
|
public int? GradeID { get; set; }
|
|
public string GradeName { get; set; }
|
|
public int? DesignationID { get; set; }
|
|
public string DesignationName { get; set; }
|
|
public int? DepartmentID { get; set; }
|
|
public string DepartmentName { get; set; }
|
|
|
|
/// <summary>The parent of the employee's department.</summary>
|
|
public string DivisionName { get; set; }
|
|
|
|
public int? CostCenterID { get; set; }
|
|
public int? BranchID { get; set; }
|
|
public string AccountNo { get; set; }
|
|
|
|
public double JoiningBasic { get; set; }
|
|
public double LastDecBasic { get; set; }
|
|
|
|
/// <summary>The batch that already has this employee's LFA of the year; empty = none.</summary>
|
|
public string PaidBatchNumber { get; set; }
|
|
|
|
/// <summary>The employee already has an LFA payment for the preceding year.</summary>
|
|
public bool IsPaidLastYear { get; set; }
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ILFAPaymentService
|
|
|
|
public interface ILFAPaymentService
|
|
{
|
|
LFAPayment Get(int id);
|
|
LFAPaymentInfo GetInfo(int payrollTypeID);
|
|
byte[] GetUploadTemplate();
|
|
LFAPaymentReadResult ReadUpload(Stream stream, string fileName, long fileLength, DateTime paymentDate,
|
|
int payrollTypeID);
|
|
LFAPaymentReadResult Calculate(LFAPaymentRequest request, int payrollTypeID);
|
|
LFAPaymentProcessResult Process(LFAPaymentRequest request, int payrollTypeID, int userID);
|
|
List<LFAPaymentHistory> GetHistory(DateTime fromDate, DateTime toDate, int payrollTypeID);
|
|
|
|
// LFA Payment Undo
|
|
List<LFAPaymentBatch> GetUndoBatches(int payrollTypeID);
|
|
List<LFAPaymentBatchEmployee> GetBatchEmployees(int lfaPaymentID, int payrollTypeID);
|
|
LFAPaymentUndoResult Undo(LFAPaymentUndoRequest request, int payrollTypeID, int userID);
|
|
|
|
// LFA Payment Approval (as Salary Approval)
|
|
LFAApprovalInfo GetApprovalInfo(int? employeeID);
|
|
List<LFAPaymentBatch> GetApprovalBatches(int payrollTypeID);
|
|
List<WFFlowHistory> GetFlowHistory(int lfaPaymentID, int payrollTypeID);
|
|
LFAApprovalResult ApproveDirect(LFAApprovalRequest request, int payrollTypeID, int userID);
|
|
LFAApprovalResult SubmitForApproval(LFAApprovalRequest request, int payrollTypeID, int? employeeID, int userID);
|
|
LFAApproverBatch GetApproverBatch(int wfMovementTranID, int? employeeID);
|
|
LFAApprovalResult ApproveFromApprover(LFAApproverActionRequest request, int? employeeID, int userID);
|
|
LFAApprovalResult RevertFromApprover(LFAApproverActionRequest request, int? employeeID);
|
|
|
|
// LFA Bank Advice (report viewer, EnumReportType.LFABankAdvice)
|
|
List<LFAPaymentBatch> GetBankAdviceBatches(int payrollTypeID);
|
|
System.Data.DataSet GetBankAdvice(int lfaPaymentID, string sEmpIDs, int bankID, int payrollTypeID);
|
|
}
|
|
|
|
#endregion
|
|
}
|