Expenses only [skip ci]

This commit is contained in:
James Cole 2015-05-16 10:18:32 +02:00
parent 512ce15973
commit f64616748c
2 changed files with 4 additions and 2 deletions

View File

@ -122,6 +122,8 @@ class CategoryController extends Controller
} }
/** /**
* This chart will only show expenses.
*
* @param GChart $chart * @param GChart $chart
* @param CategoryRepositoryInterface $repository * @param CategoryRepositoryInterface $repository
* @param $year * @param $year

View File

@ -177,7 +177,7 @@ class CategoryRepository implements CategoryRepositoryInterface
// always ignore transfers between accounts! // always ignore transfers between accounts!
$sum = floatval( $sum = floatval(
$category->transactionjournals() $category->transactionjournals()
->transactionTypes(['Withdrawal', 'Deposit']) ->transactionTypes(['Withdrawal'])
->before($end)->after($start)->lessThan(0)->sum('amount') ->before($end)->after($start)->lessThan(0)->sum('amount')
) * -1; ) * -1;
@ -187,7 +187,7 @@ class CategoryRepository implements CategoryRepositoryInterface
$sum = $category->transactionjournals() $sum = $category->transactionjournals()
->before($end) ->before($end)
->after($start) ->after($start)
->transactionTypes(['Withdrawal', 'Deposit']) ->transactionTypes(['Withdrawal'])
->lessThan(0) ->lessThan(0)
->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id') ->leftJoin('accounts', 'accounts.id', '=', 'transactions.account_id')
->leftJoin( ->leftJoin(