mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-14 15:13:29 +01:00
80 lines
2.0 KiB
PHP
80 lines
2.0 KiB
PHP
<?php
|
|
/**
|
|
* Entity Ninja (https://entityninja.com).
|
|
*
|
|
* @link https://github.com/entityninja/entityninja source repository
|
|
*
|
|
* @copyright Copyright (c) 2022. Entity Ninja LLC (https://entityninja.com)
|
|
*
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
|
*/
|
|
|
|
namespace App\Jobs\Entity;
|
|
|
|
use App\Exceptions\FilePermissionsFailure;
|
|
use App\Libraries\MultiDB;
|
|
use App\Models\Account;
|
|
use App\Models\Credit;
|
|
use App\Models\CreditInvitation;
|
|
use App\Models\Design;
|
|
use App\Models\Invoice;
|
|
use App\Models\InvoiceInvitation;
|
|
use App\Models\Quote;
|
|
use App\Models\QuoteInvitation;
|
|
use App\Models\RecurringInvoice;
|
|
use App\Models\RecurringInvoiceInvitation;
|
|
use App\Services\PdfMaker\Design as PdfDesignModel;
|
|
use App\Services\PdfMaker\Design as PdfMakerDesign;
|
|
use App\Services\PdfMaker\PdfMaker as PdfMakerService;
|
|
use App\Services\Pdf\PdfService;
|
|
use App\Utils\HostedPDF\NinjaPdf;
|
|
use App\Utils\HtmlEngine;
|
|
use App\Utils\Ninja;
|
|
use App\Utils\PhantomJS\Phantom;
|
|
use App\Utils\Traits\MakesHash;
|
|
use App\Utils\Traits\MakesInvoiceHtml;
|
|
use App\Utils\Traits\NumberFormatter;
|
|
use App\Utils\Traits\Pdf\PageNumbering;
|
|
use App\Utils\Traits\Pdf\PdfMaker;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
use Illuminate\Queue\SerializesModels;
|
|
use Illuminate\Support\Facades\App;
|
|
use Illuminate\Support\Facades\Lang;
|
|
use Illuminate\Support\Facades\Storage;
|
|
|
|
class CreateRawPdf implements ShouldQueue
|
|
{
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
public $invitation;
|
|
|
|
/**
|
|
* Create a new job instance.
|
|
*
|
|
* @param $invitation
|
|
*/
|
|
public function __construct($invitation, $db)
|
|
{
|
|
MultiDB::setDb($db);
|
|
|
|
$this->invitation = $invitation;
|
|
|
|
}
|
|
|
|
public function handle()
|
|
{
|
|
|
|
$pdf = (new PdfService($this->invitation))->getPdf();
|
|
|
|
return $pdf;
|
|
|
|
}
|
|
|
|
public function failed($e)
|
|
{
|
|
}
|
|
}
|