/// <summary> /// Get group balance from start month to end month /// </summary> /// <param name="accountGroup"></param> /// <param name="startMonthId"></param> /// <param name="endMonthId"></param> /// <returns></returns> /// <exception cref="SystemException"></exception> public CurrencyAmount GetGroupBalance(GLAccountGroupENUM accountGroup, MonthIdentity startMonthId, MonthIdentity endMonthId) { CurrencyAmount ret = new CurrencyAmount(); MasterDataManagement mdMgmt = this._mdMgmt; foreach (var item in _items) { GLAccountMasterData glAccount; try { glAccount = (GLAccountMasterData)mdMgmt .GetMasterData(item.Key, MasterDataType.GL_ACCOUNT); } catch (Exception e) { _coreDriver.logDebugInfo(this.GetType(), 183, e.Message, MessageType.ERRO); throw new SystemException(e); } if (glAccount.Group.Identity == accountGroup) { ret.AddTo(item.Value.GetSumAmount(startMonthId, endMonthId)); } } return(ret); }
/// <summary> /// parse string to GLAccountGroup /// </summary> /// <param name="id"></param> /// <returns></returns> public static GLAccountGroup Parse(String id) { if (id == null) { return(null); } GLAccountGroupENUM e = ParseEnum(id); return(new GLAccountGroup(e)); }
/// <summary> /// Get GL Account based on G/L account group /// </summary> /// <param name="group"></param> /// <returns></returns> public List <MasterDataIdentity_GLAccount> GetGLAccountsBasedGroup( GLAccountGroupENUM group) { MasterDataFactoryBase factory = GetMasterDataFactory(MasterDataType.GL_ACCOUNT); List <MasterDataBase> datas = factory.AllEntities; List <MasterDataIdentity_GLAccount> array = new List <MasterDataIdentity_GLAccount>(); foreach (MasterDataBase data in datas) { GLAccountMasterData glAccount = (GLAccountMasterData)data; if (glAccount.Group.Identity == group) { array.Add(glAccount.GLIdentity); } } array.Sort(); return(array); }
/// <summary> /// Get GL Account based on G/L account group /// </summary> /// <param name="group"></param> /// <returns></returns> public List<MasterDataIdentity_GLAccount> GetGLAccountsBasedGroup( GLAccountGroupENUM group) { MasterDataFactoryBase factory = GetMasterDataFactory(MasterDataType.GL_ACCOUNT); List<MasterDataBase> datas = factory.AllEntities; List<MasterDataIdentity_GLAccount> array = new List<MasterDataIdentity_GLAccount>(); foreach (MasterDataBase data in datas) { GLAccountMasterData glAccount = (GLAccountMasterData)data; if (glAccount.Group.Identity == group) { array.Add(glAccount.GLIdentity); } } array.Sort(); return array; }
/// <summary> /// Get group balance from start month to end month /// </summary> /// <param name="accountGroup"></param> /// <param name="startMonthId"></param> /// <param name="endMonthId"></param> /// <returns></returns> /// <exception cref="SystemException"></exception> public CurrencyAmount GetGroupBalance(GLAccountGroupENUM accountGroup, MonthIdentity startMonthId, MonthIdentity endMonthId) { CurrencyAmount ret = new CurrencyAmount(); MasterDataManagement mdMgmt = this._mdMgmt; foreach (var item in _items) { GLAccountMasterData glAccount; try { glAccount = (GLAccountMasterData)mdMgmt .GetMasterData(item.Key, MasterDataType.GL_ACCOUNT); } catch (Exception e) { _coreDriver.logDebugInfo(this.GetType(), 183, e.Message, MessageType.ERRO); throw new SystemException(e); } if (glAccount.Group.Identity == accountGroup) { ret.AddTo(item.Value.GetSumAmount(startMonthId, endMonthId)); } } return ret; }
/// <summary> /// constructor /// </summary> /// <param name="str"></param> private GLAccountGroup(GLAccountGroupENUM str) { _id = str; }
/// <summary> /// get accounts based on the groups /// </summary> /// <param name="groups"></param> /// <returns></returns> public List<GLAccountMasterData> GetAccounts(GLAccountGroupENUM[] groups) { List<GLAccountMasterData> array = new List<GLAccountMasterData>(); foreach (var item in this._list) { GLAccountMasterData glAccount = (GLAccountMasterData)item.Value; for (int i = 0; i < groups.Length; ++i) { if (glAccount.Group.Identity == groups[i]) { array.Add(glAccount); break; } } } array.Sort(); return array; }