From ddcd5a7ae4326093aa4f4cae980ed0b8439a0e8e Mon Sep 17 00:00:00 2001 From: Steve Ireland Date: Sun, 21 Apr 2019 11:25:14 -0400 Subject: [PATCH] Fix Send Invoice PDF --- application/controllers/Sales.php | 6 +++--- application/helpers/dompdf_helper.php | 2 +- application/views/sales/invoice.php | 6 +++--- application/views/sales/invoice_email.php | 10 ++++++---- public/css/invoice_email.css | 5 +++-- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/application/controllers/Sales.php b/application/controllers/Sales.php index 3568659be..b789139a2 100644 --- a/application/controllers/Sales.php +++ b/application/controllers/Sales.php @@ -518,7 +518,7 @@ class Sales extends Secure_Controller $employee_info = $this->Employee->get_info($employee_id); $data['employee'] = $employee_info->first_name . ' ' . mb_substr($employee_info->last_name, 0, 1); - $data['company_info'] = implode("\n", array( + $data['company_info'] = implode("
", array( $this->config->item('address'), $this->config->item('phone') )); @@ -896,7 +896,7 @@ class Sales extends Secure_Controller $data['customer_total'] = empty($cust_stats) ? 0 : $cust_stats->total; } - $data['customer_info'] = implode("\n", array( + $data['customer_info'] = implode("
", array( $data['customer'], $data['customer_address'], $data['customer_location'] @@ -971,7 +971,7 @@ class Sales extends Secure_Controller $data['quote_number'] = $sale_info['quote_number']; $data['sale_status'] = $sale_info['sale_status']; - $data['company_info'] = implode("\n", array( + $data['company_info'] = implode("
", array( $this->config->item('address'), $this->config->item('phone') )); diff --git a/application/helpers/dompdf_helper.php b/application/helpers/dompdf_helper.php index ab8112602..3ae9a00c3 100644 --- a/application/helpers/dompdf_helper.php +++ b/application/helpers/dompdf_helper.php @@ -15,7 +15,7 @@ function pdf_create($html, $filename = '') } $dompdf = new Dompdf\Dompdf(); - $dompdf->loadHtml($html); + $dompdf->loadHtml(str_replace(array("\n", "\r"), '', $html)); $dompdf->render(); if(!$magic_quotes_enabled) diff --git a/application/views/sales/invoice.php b/application/views/sales/invoice.php index ea06a41d8..80d616b8a 100755 --- a/application/views/sales/invoice.php +++ b/application/views/sales/invoice.php @@ -14,7 +14,7 @@ $(document).ready(function() { var send_email = function() { - $.get('', + $.get('', function(response) { $.notify(response.message, { type: response.success ? 'success' : 'danger'} ); @@ -51,7 +51,7 @@ $(document).ready(function() if(isset($customer)) { ?> - +
@@ -79,7 +79,7 @@ $(document).ready(function()
- +
diff --git a/application/views/sales/invoice_email.php b/application/views/sales/invoice_email.php index 927f37237..f5d308506 100644 --- a/application/views/sales/invoice_email.php +++ b/application/views/sales/invoice_email.php @@ -28,16 +28,18 @@ ?>
lang->line('sales_invoice_number');?> -
+
-
config->item('company'); ?>
-
+
+ config->item('company'); ?>
+ +
- +
diff --git a/public/css/invoice_email.css b/public/css/invoice_email.css index befa3f31d..b013d32d4 100644 --- a/public/css/invoice_email.css +++ b/public/css/invoice_email.css @@ -27,14 +27,15 @@ pre { font-family: Helvetica; font-size: 13px; } .edit #logohelp { display: block; } .edit #save-logo, .edit #cancel-logo { display: inline; } .edit #image, #save-logo, #cancel-logo, .edit #change-logo, .edit #delete-logo { display: none; } -#customer-title { text-align: right; } +#customer-title { text-align: right; height: 100px; width: 50%;} +#customer { float:right; width:300px; text-align: left; } #terms div { width: 100%; text-align: center; margin-bottom: 10px;} /* second row */ #company-title { width: 50%; padding-left: 20px; } #meta td { text-align: right; } #meta td.meta-head { text-align: left; background: #eee; } - +#meta-content { width: 300px; } #items { width: 100%; border: 1px solid black; } #items th { background: #eee; } #items tr.item-row td { border: 0; vertical-align: top; }
lang->line('sales_invoice_number');?>