From c68fa19584589053cecb679c0ac10f2f65aad8e3 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sat, 22 Apr 2017 17:09:22 +0100 Subject: [PATCH] Made print company name in receipts optional (#925) --- application/controllers/Config.php | 1 + application/language/en/config_lang.php | 3 +- application/views/configs/receipt_config.php | 75 +++++++++++--------- application/views/receivings/receipt.php | 20 +++--- application/views/sales/invoice.php | 12 +++- application/views/sales/quote.php | 16 +++-- application/views/sales/receipt_default.php | 16 +++-- application/views/sales/receipt_email.php | 14 +++- application/views/sales/receipt_short.php | 14 +++- database/3.0.2_to_3.1.0.sql | 6 +- database/database.sql | 3 +- database/migrate_phppos_dist.sql | 3 +- database/tables.sql | 3 +- 13 files changed, 125 insertions(+), 61 deletions(-) diff --git a/application/controllers/Config.php b/application/controllers/Config.php index 74e3329de..2544010b6 100644 --- a/application/controllers/Config.php +++ b/application/controllers/Config.php @@ -671,6 +671,7 @@ class Config extends Secure_Controller { $batch_save_data = array ( 'receipt_template' => $this->input->post('receipt_template'), + 'receipt_show_company_name' => $this->input->post('receipt_show_company_name') != NULL, 'receipt_show_taxes' => $this->input->post('receipt_show_taxes') != NULL, 'receipt_show_total_discount' => $this->input->post('receipt_show_total_discount') != NULL, 'receipt_show_description' => $this->input->post('receipt_show_description') != NULL, diff --git a/application/language/en/config_lang.php b/application/language/en/config_lang.php index ef621b3f8..d5e7a152e 100644 --- a/application/language/en/config_lang.php +++ b/application/language/en/config_lang.php @@ -194,6 +194,7 @@ $lang["config_receipt_default"] = "Default"; $lang["config_receipt_info"] = "Receipt Configuration Information"; $lang["config_receipt_printer"] = "Ticket Printer"; $lang["config_receipt_short"] = "Short"; +$lang["config_receipt_show_company_name"] = "Show Company Name"; $lang["config_receipt_show_description"] = "Show Description"; $lang["config_receipt_show_serialnumber"] = "Show Serial Number"; $lang["config_receipt_show_taxes"] = "Show Taxes"; @@ -228,4 +229,4 @@ $lang["config_top"] = "Top"; $lang["config_website"] = "Website"; $lang["config_giftcard_number"] = "Gift Card Number"; $lang["config_giftcard_series"] = "Generate in Series"; -$lang["config_giftcard_random"] = "Generate Random"; \ No newline at end of file +$lang["config_giftcard_random"] = "Generate Random"; diff --git a/application/views/configs/receipt_config.php b/application/views/configs/receipt_config.php index 3fbf04b47..d4e0235b4 100644 --- a/application/views/configs/receipt_config.php +++ b/application/views/configs/receipt_config.php @@ -16,6 +16,17 @@ +
+ lang->line('config_receipt_show_company_name'), 'receipt_show_company_name', array('class' => 'control-label col-xs-2')); ?> +
+ 'receipt_show_company_name', + 'value' => 'receipt_show_company_name', + 'id' => 'receipt_show_company_name', + 'checked'=>$this->config->item('receipt_show_company_name'))); ?> +
+
+
lang->line('config_receipt_show_taxes'), 'receipt_show_taxes', array('class' => 'control-label col-xs-2')); ?>
@@ -114,7 +125,7 @@
-
+
lang->line('config_print_top_margin'), 'print_top_margin', array('class' => 'control-label col-xs-2 required')); ?>
@@ -131,7 +142,7 @@
-
+
lang->line('config_print_left_margin'), 'print_left_margin', array('class' => 'control-label col-xs-2 required')); ?>
@@ -148,7 +159,7 @@
-
+
lang->line('config_print_bottom_margin'), 'print_bottom_margin', array('class' => 'control-label col-xs-2 required')); ?>
@@ -165,7 +176,7 @@
-
+
lang->line('config_print_right_margin'), 'print_right_margin', array('class' => 'control-label col-xs-2 required')); ?>
@@ -203,7 +214,7 @@ $(document).ready(function() var $this = $(this) $(printers).each(function(key, value) { - $this.append($('
diff --git a/application/views/sales/receipt_default.php b/application/views/sales/receipt_default.php index 2a76cfc50..75536c04d 100644 --- a/application/views/sales/receipt_default.php +++ b/application/views/sales/receipt_default.php @@ -2,14 +2,22 @@
config->item('company_logo') != '') - { - ?> + { + ?>
company_logo
-
config->item('company'); ?>
+ config->item('receipt_show_company_name')) + { + ?> +
config->item('company'); ?>
+ +
config->item('address')); ?>
config->item('phone'); ?>
@@ -188,4 +196,4 @@
-
\ No newline at end of file +
diff --git a/application/views/sales/receipt_email.php b/application/views/sales/receipt_email.php index a79ed342b..fd4ffe89d 100644 --- a/application/views/sales/receipt_email.php +++ b/application/views/sales/receipt_email.php @@ -2,14 +2,22 @@
config->item('company_logo') != '') - { - ?> + { + ?>
company_logo
-
config->item('company'); ?>
+ config->item('receipt_show_company_name')) + { + ?> +
config->item('company'); ?>
+ +
config->item('address')); ?>
config->item('phone'); ?>

diff --git a/application/views/sales/receipt_short.php b/application/views/sales/receipt_short.php index ba9634cb5..3efec7095 100644 --- a/application/views/sales/receipt_short.php +++ b/application/views/sales/receipt_short.php @@ -2,14 +2,22 @@
config->item('company_logo') != '') - { - ?> + { + ?>
company_logo
-
config->item('company'); ?>
+ config->item('receipt_show_company_name')) + { + ?> +
config->item('company'); ?>
+ +
config->item('address')); ?>
config->item('phone'); ?>
diff --git a/database/3.0.2_to_3.1.0.sql b/database/3.0.2_to_3.1.0.sql index fc07c4509..d9d6cebfa 100644 --- a/database/3.0.2_to_3.1.0.sql +++ b/database/3.0.2_to_3.1.0.sql @@ -223,4 +223,8 @@ ALTER TABLE `ospos_giftcards` CHANGE `giftcard_number` `giftcard_number` VARCHAR -- add support for select between gitcard number series or random -INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('giftcard_number', 'series'); \ No newline at end of file +INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('giftcard_number', 'series'); + +-- add option to print company name in receipt + +INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('receipt_show_company_name', '1'); diff --git a/database/database.sql b/database/database.sql index f0564e9e5..116f52a1b 100644 --- a/database/database.sql +++ b/database/database.sql @@ -41,6 +41,7 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('barcode_page_width', '100'), ('barcode_page_cellspacing', '20'), ('barcode_generate_if_empty', '0'), +('receipt_show_company_name', '1'), ('receipt_show_taxes', '0'), ('receipt_show_total_discount', '1'), ('receipt_show_description', '1'), @@ -94,7 +95,7 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('customer_reward_enable',''), ('default_origin_tax_code', ''), ('cash_decimals', '2'), -('financial_year','1'), +('financial_year', '1'), ('giftcard_number', 'series'); diff --git a/database/migrate_phppos_dist.sql b/database/migrate_phppos_dist.sql index 8ace78db8..59563a919 100644 --- a/database/migrate_phppos_dist.sql +++ b/database/migrate_phppos_dist.sql @@ -41,6 +41,7 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('barcode_page_width', '100'), ('barcode_page_cellspacing', '20'), ('barcode_generate_if_empty', '0'), +('receipt_show_company_name', '1'), ('receipt_show_taxes', '0'), ('receipt_show_total_discount', '1'), ('receipt_show_description', '1'), @@ -94,7 +95,7 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('customer_reward_enable',''), ('default_origin_tax_code', ''), ('cash_decimals', '2'), -('financial_year','1'), +('financial_year', '1'), ('giftcard_number', 'series'); diff --git a/database/tables.sql b/database/tables.sql index 0f007fe9a..43fecdf00 100644 --- a/database/tables.sql +++ b/database/tables.sql @@ -41,6 +41,7 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('barcode_page_width', '100'), ('barcode_page_cellspacing', '20'), ('barcode_generate_if_empty', '0'), +('receipt_show_company_name', '1'), ('receipt_show_taxes', '0'), ('receipt_show_total_discount', '1'), ('receipt_show_description', '1'), @@ -94,7 +95,7 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES ('customer_reward_enable',''), ('default_origin_tax_code', ''), ('cash_decimals', '2'), -('financial_year','1'), +('financial_year', '1'), ('giftcard_number', 'series');