mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
Feature snipe#9378 update
This commit is contained in:
parent
cd4b1d8acb
commit
f43413bdc3
|
@ -12,6 +12,7 @@ use App\Models\Depreciation;
|
|||
use App\Models\License;
|
||||
use App\Models\Setting;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Auth\Access\AuthorizationException;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Response;
|
||||
use Illuminate\Support\Facades\View;
|
||||
|
@ -929,6 +930,7 @@ class ReportsController extends Controller
|
|||
* getAssetAcceptanceReport
|
||||
*
|
||||
* @return mixed
|
||||
* @throws AuthorizationException
|
||||
* @author Vincent Sposato <vincent.sposato@gmail.com>
|
||||
* @version v1.0
|
||||
*/
|
||||
|
@ -940,11 +942,11 @@ class ReportsController extends Controller
|
|||
* Get all assets with pending checkout acceptances
|
||||
*/
|
||||
|
||||
$acceptances = CheckoutAcceptance::pending()->get();
|
||||
$acceptances = CheckoutAcceptance::pending()->with('assignedTo')->get();
|
||||
|
||||
$assetsForReport = $acceptances
|
||||
->filter(function($acceptance) {
|
||||
return $acceptance->checkoutable_type == 'App\Models\Asset';
|
||||
return $acceptance->checkoutable_type == 'App\Models\Asset' && !is_null($acceptance->assignedTo);
|
||||
})
|
||||
->map(function($acceptance) {
|
||||
return $acceptance->checkoutable;
|
||||
|
|
Loading…
Reference in a new issue