diff --git a/app/Http/Controllers/Banking/Transactions.php b/app/Http/Controllers/Banking/Transactions.php index 420703f4d..fe9801524 100644 --- a/app/Http/Controllers/Banking/Transactions.php +++ b/app/Http/Controllers/Banking/Transactions.php @@ -48,7 +48,9 @@ class Transactions extends Controller return; } - $totals[$transaction->type] += $transaction->getAmountConvertedToDefault(); + $type = $transaction->isIncome() ? 'income' : 'expense'; + + $totals[$type] += $transaction->getAmountConvertedToDefault(); }); $totals['profit'] = $totals['income'] - $totals['expense'];