diff --git a/app/Utils/PhantomJS/Phantom.php b/app/Utils/PhantomJS/Phantom.php index 50796ab5d381..4757e2decce0 100644 --- a/app/Utils/PhantomJS/Phantom.php +++ b/app/Utils/PhantomJS/Phantom.php @@ -16,6 +16,7 @@ use App\Models\CreditInvitation; use App\Models\Design; use App\Models\InvoiceInvitation; use App\Models\QuoteInvitation; +use App\Models\RecurringInvoiceInvitation; use App\Models\SystemLog; use App\Services\PdfMaker\Design as PdfDesignModel; use App\Services\PdfMaker\Design as PdfMakerDesign; @@ -52,6 +53,9 @@ class Phantom } elseif ($invitation instanceof QuoteInvitation) { $entity = 'quote'; $entity_design_id = 'quote_design_id'; + } elseif ($inviation instanceof RecurringInvoiceInvitation) { + $entity = 'recurring_invoice'; + $entity_design_id = 'invoice_design_id'; } $entity_obj = $invitation->{$entity}; @@ -68,6 +72,10 @@ class Phantom $path = $entity_obj->client->credit_filepath(); } + if ($entity == 'recurring_invoice') { + $path = $entity_obj->client->recurring_invoice_filepath(); + } + $file_path = $path.$entity_obj->number.'.pdf'; $url = config('ninja.app_url').'/phantom/'.$entity.'/'.$invitation->key.'?phantomjs_secret='.config('ninja.phantomjs_secret');