A free open source IT asset/license management system
Add filter to only get Assets for the unaccepted assets report
Ivan Nieto Vivanco1453b3648485
diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.phpindex 3c27f386c8..bcd43e51b9 100644--- a/app/Http/Controllers/ReportsController.php+++ b/app/Http/Controllers/ReportsController.php@@ -939,9 +939,9 @@ class ReportsController extends Controller* Get all assets with pending checkout acceptances*/if($showDeleted) {- $acceptances = CheckoutAcceptance::pending()->withTrashed()->with(['assignedTo' , 'checkoutable.assignedTo', 'checkoutable.model'])->get();+ $acceptances = CheckoutAcceptance::pending()->where('checkoutable_type', 'App\Models\Asset')->withTrashed()->with(['assignedTo' , 'checkoutable.assignedTo', 'checkoutable.model'])->get();} else {- $acceptances = CheckoutAcceptance::pending()->with(['assignedTo' => function ($query) {+ $acceptances = CheckoutAcceptance::pending()->where('checkoutable_type', 'App\Models\Asset')->with(['assignedTo' => function ($query) {$query->withTrashed();}, 'checkoutable.assignedTo', 'checkoutable.model'])->get();}