From 860764a436052f443caec9a59e1dae79d034f662 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 26 Apr 2024 19:12:21 +0100 Subject: [PATCH] Use totals for sidebar Signed-off-by: snipe --- app/Http/Middleware/AssetCountForSidebar.php | 3 +++ resources/views/layouts/default.blade.php | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Http/Middleware/AssetCountForSidebar.php b/app/Http/Middleware/AssetCountForSidebar.php index a0b14f8a0b..f55b72e0dd 100644 --- a/app/Http/Middleware/AssetCountForSidebar.php +++ b/app/Http/Middleware/AssetCountForSidebar.php @@ -102,6 +102,9 @@ class AssetCountForSidebar \Log::debug($e); } + view()->share('total_due_and_overdue_for_checkin', ($total_due_for_checkin + $total_overdue_for_checkin)); + view()->share('total_due_and_overdue_for_audit', ($total_due_for_audit + $total_overdue_for_audit)); + return $next($request); } } diff --git a/resources/views/layouts/default.blade.php b/resources/views/layouts/default.blade.php index f7b610881f..25f45cbd0d 100644 --- a/resources/views/layouts/default.blade.php +++ b/resources/views/layouts/default.blade.php @@ -509,7 +509,7 @@ {{ trans('general.audit_due') }} - {{ (isset($total_due_for_audit)) ? $total_due_for_audit : '' }} + {{ (isset($total_due_and_overdue_for_audit)) ? $total_due_and_overdue_for_audit : '' }} @endcan @@ -518,7 +518,7 @@ {{ trans('general.checkin_due') }} - {{ (isset($total_overdue_for_checkin)) ? $total_overdue_for_checkin : '' }} + {{ (isset($total_due_and_overdue_for_checkin)) ? $total_due_and_overdue_for_checkin : '' }} @endcan