Make budget report actually more useful.

This commit is contained in:
James Cole
2016-12-23 17:50:26 +01:00
parent 08c044fe52
commit e15932fe4a
3 changed files with 84 additions and 9 deletions

View File

@@ -163,7 +163,9 @@ class TransactionJournalSupport extends Model
if ($cache->has()) {
return $cache->get();
}
$transactions = $journal->transactions()->where('amount', '>', 0)->orderBy('transactions.account_id')->with('account')->get();
$transactions = $journal->transactions()
->whereNull('transactions.deleted_at')
->where('transactions.amount', '>', 0)->orderBy('transactions.account_id')->with('account')->get();
$list = new Collection;
/** @var Transaction $t */
foreach ($transactions as $t) {
@@ -255,7 +257,10 @@ class TransactionJournalSupport extends Model
if ($cache->has()) {
return $cache->get();
}
$transactions = $journal->transactions()->where('amount', '<', 0)->orderBy('transactions.account_id')->with('account')->get();
$transactions = $journal->transactions()
->whereNull('transactions.deleted_at')
->where('transactions.amount', '<', 0)
->orderBy('transactions.account_id')->with('account')->get();
$list = new Collection;
/** @var Transaction $t */
foreach ($transactions as $t) {