fixed summary calculation #30j1u0f

This commit is contained in:
Denis Duliçi 2022-06-05 03:48:31 +03:00
parent 2cdeaad00d
commit 598072e1de

View File

@ -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'];