From 377284f491c1f5bc1adf12ebe1505802bfe60ac7 Mon Sep 17 00:00:00 2001 From: jekkos-t520 Date: Sun, 8 Feb 2015 18:05:29 +0100 Subject: [PATCH] Add company name to barcode layout options --- application/libraries/Barcode_lib.php | 16 ++++++++++++---- application/views/configs/barcode_config.php | 9 ++++++--- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/application/libraries/Barcode_lib.php b/application/libraries/Barcode_lib.php index 5f1f6383b..718fa8e8d 100644 --- a/application/libraries/Barcode_lib.php +++ b/application/libraries/Barcode_lib.php @@ -54,18 +54,26 @@ class Barcode_lib "&type=".$this->CI->Appconfig->get('barcode_type'). "' onerror=\"(function(pThis){pThis.onerror = null; pThis.src = pThis.src;})(this)\" />"; } - else if($layout_type == 'name'){ + else if($layout_type == 'name') + { $result = $this->CI->lang->line('items_name') . " " . $item['name']; } - else if($layout_type == 'category'){ + else if($layout_type == 'category') + { $result = $this->CI->lang->line('items_category') . " " . $item['category']; } - else if($layout_type == 'cost_price'){ + else if($layout_type == 'cost_price') + { $result = $this->CI->lang->line('items_cost_price') . " " . to_currency($item['cost_price']); } - else if($layout_type == 'unit_price'){ + else if($layout_type == 'unit_price') + { $result = $this->CI->lang->line('items_unit_price') . " " . to_currency($item['unit_price']); } + else if($layout_type == 'company_name') + { + $result = $this->CI->Appconfig->get('company'); + } return $result; } diff --git a/application/views/configs/barcode_config.php b/application/views/configs/barcode_config.php index 16c23b9e3..f45186eb0 100644 --- a/application/views/configs/barcode_config.php +++ b/application/views/configs/barcode_config.php @@ -99,7 +99,8 @@ echo form_open('config/save_barcode/',array('id'=>'barcode_config_form')); 'category' => 'Category', 'item_code' => 'Item code', 'cost_price' => 'Cost price', - 'unit_price' => 'Unit price' + 'unit_price' => 'Unit price', + 'company_name' => 'Company Name' ), $this->config->item('barcode_first_row')); ?> @@ -110,7 +111,8 @@ echo form_open('config/save_barcode/',array('id'=>'barcode_config_form')); 'category' => 'Category', 'item_code' => 'Item code', 'cost_price' => 'Cost price', - 'unit_price' => 'Unit price' + 'unit_price' => 'Unit price', + 'company_name' => 'Company Name' ), $this->config->item('barcode_second_row')); ?> @@ -121,7 +123,8 @@ echo form_open('config/save_barcode/',array('id'=>'barcode_config_form')); 'category' => 'Category', 'item_code' => 'Item code', 'cost_price' => 'Cost price', - 'unit_price' => 'Unit price' + 'unit_price' => 'Unit price', + 'company_name' => 'Company Name' ), $this->config->item('barcode_third_row')); ?>