From a0972d99fbb2b836a5c86ab989cf96f95be5076b Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 11 Dec 2015 18:49:07 +0100 Subject: [PATCH] Made a negative amount a positive as per #129 --- app/Helpers/Report/ReportQuery.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/Helpers/Report/ReportQuery.php b/app/Helpers/Report/ReportQuery.php index 29240c06bc..34db15cdb0 100644 --- a/app/Helpers/Report/ReportQuery.php +++ b/app/Helpers/Report/ReportQuery.php @@ -190,10 +190,7 @@ class ReportQuery implements ReportQueryInterface public function spentInBudgetCorrected(Account $account, Budget $budget, Carbon $start, Carbon $end) { - bcscale(2); - - return bcmul( - Auth::user()->transactionjournals() + return Auth::user()->transactionjournals() ->leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') ->leftJoin('budget_transaction_journal', 'budget_transaction_journal.transaction_journal_id', '=', 'transaction_journals.id') ->transactionTypes([TransactionType::WITHDRAWAL]) @@ -201,8 +198,7 @@ class ReportQuery implements ReportQueryInterface ->before($end) ->after($start) ->where('budget_transaction_journal.budget_id', $budget->id) - ->get(['transaction_journals.*'])->sum('amount'), -1 - ); + ->get(['transaction_journals.*'])->sum('amount'); } /**