Merge pull request #13025 from Godmartinz/archived_clears_assigned_to
removes assigned_to if archived
This commit is contained in:
commit
71234228b4
1 changed files with 7 additions and 0 deletions
|
@ -12,6 +12,7 @@ use App\Models\CheckoutRequest;
|
||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
use App\Models\Location;
|
use App\Models\Location;
|
||||||
use App\Models\Setting;
|
use App\Models\Setting;
|
||||||
|
use App\Models\Statuslabel;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Auth;
|
use Auth;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
@ -324,6 +325,12 @@ class AssetsController extends Controller
|
||||||
$asset->rtd_location_id = $request->input('rtd_location_id', null);
|
$asset->rtd_location_id = $request->input('rtd_location_id', null);
|
||||||
$asset->byod = $request->input('byod', 0);
|
$asset->byod = $request->input('byod', 0);
|
||||||
|
|
||||||
|
$status = Statuslabel::find($asset->status_id);
|
||||||
|
|
||||||
|
if($status->archived){
|
||||||
|
$asset->assigned_to = null;
|
||||||
|
}
|
||||||
|
|
||||||
if ($asset->assigned_to == '') {
|
if ($asset->assigned_to == '') {
|
||||||
$asset->location_id = $request->input('rtd_location_id', null);
|
$asset->location_id = $request->input('rtd_location_id', null);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue