Merge pull request #10053 from inietov/fixes/accepted_assets_still_showing_unaccepted_report

Fix Accepted Assets still showing on Unaccepted Asset Report
This commit is contained in:
snipe 2021-09-07 12:15:17 -07:00 committed by GitHub
commit bb5a04491d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -71,8 +71,15 @@ class CheckoutableListener
/** /**
* Send the appropriate notification * Send the appropriate notification
*/ */
$acceptances = CheckoutAcceptance::where('checkoutable_id', $event->checkoutable->id)
->where('assigned_to_id', $event->checkedOutTo->id)
->get();
foreach($acceptances as $acceptance){
if($acceptance->isPending()){
$acceptance->delete();
}
}
\Log::debug('checked out to a user'); \Log::debug('checked out to a user');
if(!$event->checkedOutTo->locale){ if(!$event->checkedOutTo->locale){
\Log::debug('Use default settings locale'); \Log::debug('Use default settings locale');