From f7dc57355139b8e96a84b9a1a45430248a289226 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 10 Sep 2020 15:20:13 +1000 Subject: [PATCH] Fixes for invoices --- app/Jobs/Invoice/CreateInvoicePdf.php | 3 +-- app/Services/Payment/UpdateInvoicePayment.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/Jobs/Invoice/CreateInvoicePdf.php b/app/Jobs/Invoice/CreateInvoicePdf.php index acc644594a98..f7632d322c95 100644 --- a/app/Jobs/Invoice/CreateInvoicePdf.php +++ b/app/Jobs/Invoice/CreateInvoicePdf.php @@ -71,6 +71,7 @@ class CreateInvoicePdf implements ShouldQueue public function handle() { + if (config('ninja.phantomjs_key')) { return (new Phantom)->generate($this->invitation); } @@ -111,8 +112,6 @@ class CreateInvoicePdf implements ShouldQueue //todo - move this to the client creation stage so we don't keep hitting this unnecessarily Storage::makeDirectory($path, 0775); - //info($maker->getCompiledHTML(true)); - $pdf = $this->makePdf(null, null, $maker->getCompiledHTML(true)); $instance = Storage::disk($this->disk)->put($file_path, $pdf); diff --git a/app/Services/Payment/UpdateInvoicePayment.php b/app/Services/Payment/UpdateInvoicePayment.php index 60eaeb686c8c..41bfb41e3ee6 100644 --- a/app/Services/Payment/UpdateInvoicePayment.php +++ b/app/Services/Payment/UpdateInvoicePayment.php @@ -75,9 +75,8 @@ class UpdateInvoicePayment ->updateBalance($paid_amount * -1) ->save(); - info("firing invoice was updated event"); event(new InvoiceWasUpdated($invoice, $invoice->company, Ninja::eventVars())); - info("fired invoice was updated event"); + }); return $this->payment;