Merge pull request #13574 from inietov/fixes/unaccepted_assets_report_incorrect

Fixed Unaccepted Assets report has incorrect people [freshdesk-37808]
This commit is contained in:
snipe 2023-09-07 20:49:40 +01:00 committed by GitHub
commit 7f892bf5ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1021,7 +1021,7 @@ class ReportsController extends Controller
$assetsForReport = $acceptances
->filter(function ($acceptance) {
return $acceptance->checkoutable_type == 'App\Models\Asset';
return $acceptance->checkoutable_type == 'App\Models\Asset' && $acceptance->checkoutable->checkedOutToUser();
})
->map(function($acceptance) {
return ['assetItem' => $acceptance->checkoutable, 'acceptance' => $acceptance];