diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php index 3136edf3ae..a9b76e97b7 100644 --- a/app/Http/Controllers/CategoryController.php +++ b/app/Http/Controllers/CategoryController.php @@ -9,7 +9,7 @@ * See the LICENSE file for details. */ -declare(strict_types = 1); +declare(strict_types=1); namespace FireflyIII\Http\Controllers; @@ -493,6 +493,7 @@ class CategoryController extends Controller 'name' => $dateName, 'spent' => $spent, 'earned' => $earned, + 'sum' => bcadd($earned, $spent), 'transferred' => $transferred, 'date' => clone $end, ] diff --git a/resources/views/categories/show.twig b/resources/views/categories/show.twig index 4f02a75416..9fa172096b 100644 --- a/resources/views/categories/show.twig +++ b/resources/views/categories/show.twig @@ -109,6 +109,12 @@ {{ 'earned'|_ }} {{ period.earned|formatAmount }} + {% if period.earned != 0 and period.spent != 0 %} + + {{ 'sum'|_ }} + {{ period.sum|formatAmount }} + + {% endif %} {{ 'transferred'|_ }} {{ period.transferred|formatAmountPlain }}