mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-25 05:03:13 +00:00
More code for #159 [skip ci]
This commit is contained in:
@@ -676,4 +676,29 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of transactions TO the given (asset) $account, but none from the
|
||||
* given list of accounts
|
||||
*
|
||||
* @param Account $account
|
||||
* @param Collection $accounts
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getIncomeByDestination(Account $account, Collection $accounts, Carbon $start, Carbon $end)
|
||||
{
|
||||
$ids = $accounts->pluck('id')->toArray();
|
||||
$journals = $this->user->transactionjournals()
|
||||
->expanded()
|
||||
->before($end)
|
||||
->where('source_account.id', $account->id)
|
||||
->whereIn('destination_account.id', $ids)
|
||||
->after($start)
|
||||
->get(TransactionJournal::QUERYFIELDS);
|
||||
|
||||
return $journals;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,19 +20,6 @@ use Illuminate\Support\Collection;
|
||||
interface AccountRepositoryInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* Returns a list of transactions TO the $account, not including transfers
|
||||
* and/or expenses in the $accounts list.
|
||||
*
|
||||
* @param Account $account
|
||||
* @param Collection $accounts
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getExpensesByDestination(Account $account, Collection $accounts, Carbon $start, Carbon $end);
|
||||
|
||||
/**
|
||||
* @param array $types
|
||||
*
|
||||
@@ -84,6 +71,19 @@ interface AccountRepositoryInterface
|
||||
*/
|
||||
public function getCreditCards(Carbon $date): Collection;
|
||||
|
||||
/**
|
||||
* Returns a list of transactions TO the given (expense) $account, all from the
|
||||
* given list of accounts
|
||||
*
|
||||
* @param Account $account
|
||||
* @param Collection $accounts
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getExpensesByDestination(Account $account, Collection $accounts, Carbon $start, Carbon $end);
|
||||
|
||||
/**
|
||||
* @param TransactionJournal $journal
|
||||
* @param Account $account
|
||||
@@ -108,6 +108,19 @@ interface AccountRepositoryInterface
|
||||
*/
|
||||
public function getFrontpageTransactions(Account $account, Carbon $start, Carbon $end): Collection;
|
||||
|
||||
/**
|
||||
* Returns a list of transactions TO the given (asset) $account, but none from the
|
||||
* given list of accounts
|
||||
*
|
||||
* @param Account $account
|
||||
* @param Collection $accounts
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getIncomeByDestination(Account $account, Collection $accounts, Carbon $start, Carbon $end);
|
||||
|
||||
/**
|
||||
* @param Account $account
|
||||
* @param $page
|
||||
|
||||
Reference in New Issue
Block a user