diff --git a/app/Http/Controllers/Assets/AssetsController.php b/app/Http/Controllers/Assets/AssetsController.php index 59b22b386d..2a15747d33 100755 --- a/app/Http/Controllers/Assets/AssetsController.php +++ b/app/Http/Controllers/Assets/AssetsController.php @@ -508,7 +508,7 @@ class AssetsController extends Controller if ($settings->qr_code == '1') { $asset = Asset::withTrashed()->find($assetId); if ($asset) { - $size = Helper::barcodeDimensions($settings->barcode_type); + $size = Helper::barcodeDimensions($settings->label2_2d_type); $qr_file = public_path().'/uploads/barcodes/qr-'.str_slug($asset->asset_tag).'-'.str_slug($asset->id).'.png'; if (isset($asset->id, $asset->asset_tag)) { @@ -518,7 +518,7 @@ class AssetsController extends Controller return response()->file($qr_file, $header); } else { $barcode = new \Com\Tecnick\Barcode\Barcode(); - $barcode_obj = $barcode->getBarcodeObj($settings->barcode_type, route('hardware.show', $asset->id), $size['height'], $size['width'], 'black', [-2, -2, -2, -2]); + $barcode_obj = $barcode->getBarcodeObj($settings->label2_2d_type, route('hardware.show', $asset->id), $size['height'], $size['width'], 'black', [-2, -2, -2, -2]); file_put_contents($qr_file, $barcode_obj->getPngData()); return response($barcode_obj->getPngData())->header('Content-type', 'image/png'); diff --git a/app/Http/Controllers/SettingsController.php b/app/Http/Controllers/SettingsController.php index a39e65b3af..3000ec7f14 100755 --- a/app/Http/Controllers/SettingsController.php +++ b/app/Http/Controllers/SettingsController.php @@ -730,11 +730,7 @@ class SettingsController extends Controller return redirect()->to('admin')->with('error', trans('admin/settings/message.update.error')); } - $setting->qr_code = $request->input('qr_code', '0'); - $setting->alt_barcode = $request->input('alt_barcode'); - $setting->alt_barcode_enabled = $request->input('alt_barcode_enabled', '0'); - $setting->barcode_type = $request->input('barcode_type'); - $setting->qr_text = $request->input('qr_text'); + if ($setting->save()) { return redirect()->route('settings.index') @@ -810,6 +806,12 @@ class SettingsController extends Controller $setting->labels_pageheight = $request->input('labels_pageheight'); $setting->labels_display_company_name = $request->input('labels_display_company_name', '0'); + //Barcodes + $setting->qr_code = $request->input('qr_code', '0'); + //1D-Barcode + $setting->alt_barcode_enabled = $request->input('alt_barcode_enabled', '0'); + //QR-Code + $setting->qr_text = $request->input('qr_text'); diff --git a/resources/views/hardware/labels.blade.php b/resources/views/hardware/labels.blade.php index ab4cb5e339..0d675d3beb 100644 --- a/resources/views/hardware/labels.blade.php +++ b/resources/views/hardware/labels.blade.php @@ -11,7 +11,7 @@ $settings->labels_width = $settings->labels_width - $settings->labels_display_sgutter; $settings->labels_height = $settings->labels_height - $settings->labels_display_bgutter; // Leave space on bottom for 1D barcode if necessary -$qr_size = ($settings->alt_barcode_enabled=='1') && ($settings->alt_barcode!='') ? $settings->labels_height - .3 : $settings->labels_height - 0.1; +$qr_size = ($settings->alt_barcode_enabled=='1') && ($settings->label2_1d_type!='') ? $settings->labels_height - .3 : $settings->labels_height - 0.1; ?>