removes assigned_to if archived

This commit is contained in:
Godfrey M 2023-05-15 11:52:57 -07:00
parent 869d195b35
commit 8e3cbdad90

View file

@ -12,6 +12,7 @@ use App\Models\CheckoutRequest;
use App\Models\Company;
use App\Models\Location;
use App\Models\Setting;
use App\Models\Statuslabel;
use App\Models\User;
use Auth;
use Carbon\Carbon;
@ -324,6 +325,12 @@ class AssetsController extends Controller
$asset->rtd_location_id = $request->input('rtd_location_id', null);
$asset->byod = $request->input('byod', 0);
$status = Statuslabel::find($asset->status_id);
if($status->archived){
$asset->assigned_to = null;
}
if ($asset->assigned_to == '') {
$asset->location_id = $request->input('rtd_location_id', null);
}