Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug where checkout to location would throw an error if FMCS was enabled #13655

Merged
merged 2 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/Http/Controllers/Assets/AssetCheckoutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ public function store(AssetCheckoutRequest $request, $assetId)

$settings = \App\Models\Setting::getSettings();

if ($settings->full_multiple_companies_support){
// We have to check whether $target->company_id is null here since locations don't have a company yet
if (($settings->full_multiple_companies_support) && ((!is_null($target->company_id)) && (!is_null($asset->company_id)))) {
if ($target->company_id != $asset->company_id){
return redirect()->to("hardware/$assetId/checkout")->with('error', trans('general.error_user_company'));
}
Expand Down
2 changes: 1 addition & 1 deletion resources/lang/en/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@
'serial_number' => 'Serial Number',
'item_notes' => ':item Notes',
'item_name_var' => ':item Name',
'error_user_company' => 'User and Asset companies missmatch',
'error_user_company' => 'Checkout target company and asset company do not match',
'error_user_company_accept_view' => 'An Asset assigned to you belongs to a different company so you can\'t accept nor deny it, please check with your manager',
'importer' => [
'checked_out_to_fullname' => 'Checked Out to: Full Name',
Expand Down