using System; using System.Collections.Generic; using System.Text; using System.Data; using Ease.Core; using Ease.CoreV35; using Ease.Core.Utility; using Ease.Core.DataAccess; namespace HRM.BO { #region GLTran [Serializable] public class GLTran : BasicBaseObject { #region Constructor public GLTran() { GLTranID = 0; EntryMethod = EnumEntryMethod.None; VoucherDate = DateTime.Now; VoucherNo = string.Empty; FundTypeID = 0; Description = string.Empty; ChequeDate = DateTime.Now; ChequeNo = string.Empty; DebitAmount = 0; CreditAmount = 0; GLTranType = EnumGLTranType.None; ReconciledState = EnumReconciledState.None; CreatedBy = 0; CreatedDate = DateTime.Now; ModifiedBy = 0; ModifiedDate = DateTime.Now; GlTranDetails = null; GLTranUserRecords = null; ChequeNo = ""; ChequeDate = DateTime.Now; } #endregion #region Properties #region GLTranID public int GLTranID { get; set; } #endregion #region Property EntryMethod : EnumEntryMethod public EnumEntryMethod EntryMethod { get; set; } #endregion #region VoucherDate public DateTime VoucherDate { get; set; } #endregion #region VoucherNo public string VoucherNo { get; set; } #endregion #region Property MasterParam : MasterParam public int? FundTypeID { get; set; } #endregion #region Description public string? Description { get; set; } #endregion #region Property ChequeDate : DateTime public DateTime? ChequeDate { get; set; } #endregion #region Property ChequeNo : string public string? ChequeNo { get; set; } #endregion #region DebitAmount public double DebitAmount { get; set; } #endregion #region CreditAmount public double CreditAmount { get; set; } #endregion #region GLTranType public EnumGLTranType GLTranType { get; set; } #endregion #region ReconciledState public EnumReconciledState ReconciledState { get; set; } #endregion #region GLTranDetails public List GlTranDetails { get; set; } #endregion #region GLTranUserRecords public List GLTranUserRecords { get; set; } #endregion #endregion public double GetTotalDebitAmount() { double drAmount = 0; if (this.GlTranDetails != null) { foreach (GLTranDetail glTranDetail in this.GlTranDetails) { if (glTranDetail.Transide == EnumTranSide.Debit) { //string am = glTranDetail.Amount.ToString(".##"); drAmount += glTranDetail.Amount; } } } return Math.Round(drAmount, 2); } public double GetTotalCreditAmount() { double crAmount = 0; if (this.GlTranDetails != null) { foreach (GLTranDetail glTranDetail in this.GlTranDetails) { if (glTranDetail.Transide == EnumTranSide.Credit) { //string am = glTranDetail.Amount.ToString(".##"); crAmount += glTranDetail.Amount; } } } return Math.Round(crAmount, 2); } } #endregion #region IGLTran Service public interface IGLTranService { GLTran Get(int id); int Save(GLTran gLTranUI); List GetGLTransOrderByDate(DateTime startDate, DateTime endDate, GL gL); List GetGlTransForSearch(DateTime startDate, DateTime endDate, int glID, int fundTypeID); double GetOpeningBalance(int nGLID, DateTime dTranDate); double GetTranSideBalance(int nGLID, EnumTranSide tranSide, DateTime fromTranDate, DateTime toTranDate); double GetOpeningBalanceOnSide(int nGLID, DateTime dTranDate, EnumTranSide side); bool GetProcessMonthForInterfaceWithPayroll(int fundTypeID, DateTime month, bool loanDeduction, bool contribution); List GetYearEndGlTrans(int fundTypeID); void DistributeProfit(int userId, int fundtypeid, double distributableAmount, double distributePercentOnBal, int plGlTranID); } #endregion }