mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Method no longer used.
This commit is contained in:
parent
94810e371a
commit
2f131dc170
@ -280,43 +280,6 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array with the following key:value pairs:
|
||||
*
|
||||
* yyyy-mm-dd:<amount>
|
||||
*
|
||||
* Where yyyy-mm-dd is the date and <amount> 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
|
||||
*/
|
||||
|
@ -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:<amount>
|
||||
*
|
||||
* Where yyyy-mm-dd is the date and <amount> 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:
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user