From 6559581bad95dcea6e5148afc21aa35b9f0d13e8 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 6 Mar 2024 15:10:42 -0800 Subject: [PATCH 1/3] conditions 1dbarcode to populate based on settings --- app/View/Label.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/app/View/Label.php b/app/View/Label.php index 21c839fa11..21a8b15cae 100644 --- a/app/View/Label.php +++ b/app/View/Label.php @@ -106,15 +106,17 @@ class Label implements View } if ($template->getSupport1DBarcode()) { - $barcode1DType = $settings->label2_1d_type; - $barcode1DType = ($barcode1DType == 'default') ? - (($settings->alt_barcode_enabled) ? $settings->alt_barcode : null) : - $barcode1DType; - if ($barcode1DType != 'none') { - $assetData->put('barcode1d', (object)[ - 'type' => $barcode1DType, - 'content' => $asset->asset_tag, - ]); + if ($settings->alt_barcode_enabled) { + $barcode1DType = $settings->label2_1d_type; + $barcode1DType = ($barcode1DType == 'default') ? + (($settings->alt_barcode_enabled) ? $settings->alt_barcode : null) : + $barcode1DType; + if ($barcode1DType != 'none') { + $assetData->put('barcode1d', (object)[ + 'type' => $barcode1DType, + 'content' => $asset->asset_tag, + ]); + } } } From 5f0b7f328c82e24a95b8275806aaadd05d9c351c Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 6 Mar 2024 15:24:03 -0800 Subject: [PATCH 2/3] if statement order change --- app/View/Label.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/View/Label.php b/app/View/Label.php index 21a8b15cae..133c99d26d 100644 --- a/app/View/Label.php +++ b/app/View/Label.php @@ -105,8 +105,8 @@ class Label implements View } } - if ($template->getSupport1DBarcode()) { - if ($settings->alt_barcode_enabled) { + if ($settings->alt_barcode_enabled) { + if ($template->getSupport1DBarcode()) { $barcode1DType = $settings->label2_1d_type; $barcode1DType = ($barcode1DType == 'default') ? (($settings->alt_barcode_enabled) ? $settings->alt_barcode : null) : From ff7d25c0f2f0780ebe6dee8f283c7f1931b4822a Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 6 Mar 2024 15:30:53 -0800 Subject: [PATCH 3/3] simplified 1dbarcode logic --- app/View/Label.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/View/Label.php b/app/View/Label.php index 133c99d26d..eb030bc8b6 100644 --- a/app/View/Label.php +++ b/app/View/Label.php @@ -107,10 +107,7 @@ class Label implements View if ($settings->alt_barcode_enabled) { if ($template->getSupport1DBarcode()) { - $barcode1DType = $settings->label2_1d_type; - $barcode1DType = ($barcode1DType == 'default') ? - (($settings->alt_barcode_enabled) ? $settings->alt_barcode : null) : - $barcode1DType; + $barcode1DType = $settings->alt_barcode; if ($barcode1DType != 'none') { $assetData->put('barcode1d', (object)[ 'type' => $barcode1DType,