From eb6b4c1386a68267f71b87232604236cb4c9fad4 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 25 Jan 2015 23:28:49 +0200 Subject: [PATCH] Fixes to invoice history --- app/controllers/InvoiceController.php | 3 +-- app/views/invoices/history.blade.php | 2 ++ app/views/invoices/pdf.blade.php | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/controllers/InvoiceController.php b/app/controllers/InvoiceController.php index 3eb487d4ce19..76227683bdfc 100755 --- a/app/controllers/InvoiceController.php +++ b/app/controllers/InvoiceController.php @@ -519,6 +519,7 @@ class InvoiceController extends \BaseController $backup->due_date = Utils::fromSqlDate($backup->due_date); $backup->is_pro = Auth::user()->isPro(); $backup->is_quote = intval($backup->is_quote); + $backup->account = $invoice->account->toArray(); $versionsJson[$activity->id] = $backup; @@ -528,8 +529,6 @@ class InvoiceController extends \BaseController } $versionsSelect[$lastId] = Utils::timestampToDateTimeString(strtotime($invoice->created_at)) . ' - ' . $invoice->user->getDisplayName(); - //dd($versionsSelect); - //dd($activities); $data = [ 'invoice' => $invoice, diff --git a/app/views/invoices/history.blade.php b/app/views/invoices/history.blade.php index 6f2c34568b4e..8c490072b24c 100644 --- a/app/views/invoices/history.blade.php +++ b/app/views/invoices/history.blade.php @@ -24,6 +24,8 @@ invoice = currentInvoice; } + invoice.image = window.accountLogo; + var invoiceDesignId = parseInt(invoice.invoice_design_id); var invoiceDesign = _.findWhere(invoiceDesigns, {id: invoiceDesignId}); if (!invoiceDesign) { diff --git a/app/views/invoices/pdf.blade.php b/app/views/invoices/pdf.blade.php index 2d39e29d30a4..22f4ab44f73b 100644 --- a/app/views/invoices/pdf.blade.php +++ b/app/views/invoices/pdf.blade.php @@ -65,7 +65,9 @@ if (window.invoice) { invoice.image = "{{ HTML::image_data($account->getLogoPath()) }}"; invoice.imageWidth = {{ $account->getLogoWidth() }}; - invoice.imageHeight = {{ $account->getLogoHeight() }}; + invoice.imageHeight = {{ $account->getLogoHeight() }}; + } else { + window.accountLogo = "{{ HTML::image_data($account->getLogoPath()) }}"; } @endif