More work done for the transaction controller.

This commit is contained in:
Sander Dorigo
2014-11-12 15:22:01 +01:00
parent d34cc65984
commit 0a627f6f9e
6 changed files with 184 additions and 36 deletions

View File

@@ -327,6 +327,38 @@ class TransactionJournal implements TransactionJournalInterface, CUD, CommonData
return $this->getUser()->transactionjournals()->get();
}
/**
* Some objects.
*
* @return Collection
*/
public function getTransfers()
{
return $this->getUser()->transactionjournals()->withRelevantData()->transactionTypes(['Transfer'])->get(['transaction_journals.*']);
}
/**
* Some objects.
*
* @return Collection
*/
public function getDeposits()
{
return $this->getUser()->transactionjournals()->withRelevantData()->transactionTypes(['Deposit'])->get(['transaction_journals.*']);
}
/**
* Some objects.
*
* @return Collection
*/
public function getWithdrawals()
{
return $this->getUser()->transactionjournals()->withRelevantData()->transactionTypes(['Withdrawal'])->get(['transaction_journals.*']);
}
/**
* Finds an account type using one of the "$what"'s: expense, asset, revenue, opening, etc.
*