From d9b007c1af0bc4e2ca3b47270283e4cd82ee6e78 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Sun, 10 Apr 2016 18:15:59 +0100 Subject: [PATCH] Improve emailed receipt layout and make it look like the printed one (now added logo + company name) (#442) --- application/views/sales/receipt.php | 35 ++--- application/views/sales/receipt_email.php | 179 ++++++++++++++++------ css/receipt.css | 3 +- 3 files changed, 150 insertions(+), 67 deletions(-) diff --git a/application/views/sales/receipt.php b/application/views/sales/receipt.php index 955d45854..bf3816e81 100644 --- a/application/views/sales/receipt.php +++ b/application/views/sales/receipt.php @@ -20,24 +20,21 @@ if (isset($error_message))
Appconfig->get('company_logo') == '') + if ($this->Appconfig->get('company_logo') != '') { ?> -
config->item('company'); ?>
-
company_logo
+ +
config->item('company'); ?>
config->item('address')); ?>
config->item('phone'); ?>
+
- + -
Appconfig->get('show_total_discount') ? 'total' : 'discounted_total')]); ?>
+ Appconfig->get('show_total_discount') ? 'total' : 'discounted_total')]); ?> @@ -142,8 +139,8 @@ if (isset($error_message)) Appconfig->get('receipt_show_taxes') && !($this->Appconfig->get('show_total_discount') && $discount > 0)); ?> - text-align:right;'>lang->line('sales_total'); ?> - text-align:right'> + lang->line('sales_total'); ?> + @@ -161,28 +158,30 @@ if (isset($error_message)) ?> -
+ -   + +   + - lang->line('sales_giftcard_balance'); ?> - + lang->line('sales_giftcard_balance'); ?> + - lang->line($amount_change >= 0 ? ($only_sale_check ? 'sales_check_balance' : 'sales_change_due') : 'sales_amount_due') ; ?> - + lang->line($amount_change >= 0 ? ($only_sale_check ? 'sales_check_balance' : 'sales_change_due') : 'sales_amount_due') ; ?> + @@ -190,7 +189,7 @@ if (isset($error_message)) config->item('return_policy')); ?>
-
+

diff --git a/application/views/sales/receipt_email.php b/application/views/sales/receipt_email.php index 5e81d263b..bea3ebc77 100644 --- a/application/views/sales/receipt_email.php +++ b/application/views/sales/receipt_email.php @@ -1,95 +1,178 @@ -
-
-
config->item('company'); ?>
+
+
+ Appconfig->get('company_logo') != '') + { + ?> +
company_logo
+ + +
config->item('company'); ?>
config->item('address')); ?>
config->item('phone'); ?>
+
+ +
-
- +
lang->line('customers_customer').": ".$customer; ?>
+
lang->line('sales_id').": ".$sale_id; ?>
lang->line('employees_employee').": ".$employee; ?>
+ +
- +
- - - - - - + + + + $item) { ?> - - + - - - + + - - - - + + - + 0) + { + ?> + + + + + - - - - - - $value) { ?> + + Appconfig->get('show_total_discount') && $discount > 0) + { + ?> - - + + - - - - - - - - + + + + + Appconfig->get('receipt_show_taxes')) + { + ?> + + + + + $value) + { + ?> + + + + + + + + + + + Appconfig->get('receipt_show_taxes') && !($this->Appconfig->get('show_total_discount') && $discount > 0)); ?> + + + + + + + + + + $payment) - { ?> + { + $only_sale_check &= $payment['payment_type'] == $this->lang->line('sales_check'); + $splitpayment=explode(':',$payment['payment_type']); + $show_giftcard_remainder |= $splitpayment[0] == $this->lang->line('sales_giftcard'); + ?> - - - + + - - - - + + + + + + + + + + + + + + + +
lang->line('sales_item_number'); ?>lang->line('items_item'); ?>lang->line('common_price'); ?>lang->line('sales_quantity'); ?>lang->line('sales_discount'); ?>lang->line('sales_total'); ?>lang->line('sales_description_abbrv'); ?>lang->line('sales_price'); ?>lang->line('sales_quantity'); ?>lang->line('sales_total'); ?>
Appconfig->get('show_total_discount') ? 'total' : 'discounted_total')]); ?>
lang->line("sales_discount_included")?>
lang->line('sales_sub_total'); ?>
:lang->line('sales_sub_total'); ?>
lang->line('sales_total'); ?>
 
lang->line('sales_discount'); ?>:
lang->line('sales_sub_total'); ?>config->item('tax_included') ? $tax_exclusive_subtotal : $discounted_subtotal); ?>
:
lang->line('sales_total'); ?>
 
lang->line('sales_payment'); ?>
 
lang->line('sales_change_due'); ?> 
lang->line('sales_giftcard_balance'); ?>
lang->line($amount_change >= 0 ? ($only_sale_check ? 'sales_check_balance' : 'sales_change_due') : 'sales_amount_due') ; ?>
 
-
- config->item('return_policy')); ?> +
+ config->item('return_policy')); ?> +
+ +
+ +
+
+
\ No newline at end of file diff --git a/css/receipt.css b/css/receipt.css index 505dddc7c..7df92cafb 100644 --- a/css/receipt.css +++ b/css/receipt.css @@ -47,7 +47,8 @@ } -#receipt_items tr { +#receipt_items tr +{ margin-bottom:5px; }