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