Exemple #1
0
        public List <GlAccount> GetCapitalAccounts()
        {
            var allCapitals = glactRepo.GetByMainCategory(MainGlCategory.Capital);
            //adding the "Reserves" capitals--> Profit or loss expressed as (Income - Expense)
            GlAccount reserveCapital = new Core.Models.GlAccount();

            reserveCapital.AccountName = "Reserves";
            decimal incomeSum  = glactRepo.GetByMainCategory(MainGlCategory.Income).Sum(a => a.AccountBalance);
            decimal expenseSum = glactRepo.GetByMainCategory(MainGlCategory.Expenses).Sum(a => a.AccountBalance);

            reserveCapital.AccountBalance = incomeSum - expenseSum;
            allCapitals.Add(reserveCapital);

            return(allCapitals);
        }
Exemple #2
0
        public List <GlAccount> GetAssetAccounts()
        {
            var allAssets = glactRepo.GetByMainCategory(MainGlCategory.Asset);// db.GlAccounts.Where(g => g.GlCategory.MainCategory == Core.Models.MainGlCategory.Asset).ToList();

            GlAccount loanAsset = new Core.Models.GlAccount();

            loanAsset.AccountName = "Loan Accounts";
            var loanAccounts = new CustomerAccountRepository().GetByType(AccountType.Loan);

            foreach (var act in loanAccounts)
            {
                loanAsset.AccountBalance += act.AccountBalance;
            }
            allAssets.Add(loanAsset);
            return(allAssets);
        }