From 2f131dc1708422c2e63c2d14315247fb37aeb86a Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 1 Jan 2016 19:55:00 +0100 Subject: [PATCH] Method no longer used. --- app/Repositories/Budget/BudgetRepository.php | 37 ------------------- .../Budget/BudgetRepositoryInterface.php | 19 ---------- 2 files changed, 56 deletions(-) diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index fa0db398ba..71886abeca 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -280,43 +280,6 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn return $return; } - /** - * Returns an array with the following key:value pairs: - * - * yyyy-mm-dd: - * - * Where yyyy-mm-dd is the date and is the money spent using DEPOSITS in the $budget - * from all the users accounts. - * - * @param Budget $budget - * @param Collection $accounts - * @param Carbon $start - * @param Carbon $end - * - * @return array - */ - public function spentPerDayForAccounts(Budget $budget, Collection $accounts, Carbon $start, Carbon $end) - { - $ids = $accounts->pluck('id')->toArray(); - /** @var Collection $query */ - $query = $budget->transactionJournals() - ->transactionTypes([TransactionType::WITHDRAWAL]) - ->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') - ->whereIn('transactions.account_id', $ids) - ->where('transactions.amount', '<', 0) - ->before($end) - ->after($start) - ->groupBy('dateFormatted')->get(['transaction_journals.date as dateFormatted', DB::Raw('SUM(`transactions`.`amount`) AS `sum`')]); - - $return = []; - foreach ($query->toArray() as $entry) { - $return[$entry['dateFormatted']] = $entry['sum']; - } - - return $return; - } - - /** * @return Collection */ diff --git a/app/Repositories/Budget/BudgetRepositoryInterface.php b/app/Repositories/Budget/BudgetRepositoryInterface.php index 3ba1b8c1d8..890ebf785a 100644 --- a/app/Repositories/Budget/BudgetRepositoryInterface.php +++ b/app/Repositories/Budget/BudgetRepositoryInterface.php @@ -84,25 +84,6 @@ interface BudgetRepositoryInterface */ public function spentPerDay(Budget $budget, Carbon $start, Carbon $end); - /** - * Returns an array with the following key:value pairs: - * - * yyyy-mm-dd: - * - * Where yyyy-mm-dd is the date and is the money spent using WITHDRAWALS in the $budget - * from the given users accounts.. - * - * @param Budget $budget - * @param Collection $accounts - * @param Carbon $start - * @param Carbon $end - * - * @return array - */ - public function spentPerDayForAccounts(Budget $budget, Collection $accounts, Carbon $start, Carbon $end); - - - /** * Returns an array with the following key:value pairs: *