mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
Merge pull request #5600 from turbo124/v5-develop
Fixes for Historical PDF generation
This commit is contained in:
commit
3e0c306d57
@ -14,12 +14,14 @@ namespace App\Http\Controllers;
|
||||
use App\Http\Requests\Activity\DownloadHistoricalEntityRequest;
|
||||
use App\Models\Activity;
|
||||
use App\Transformers\ActivityTransformer;
|
||||
use App\Utils\HostedPDF\NinjaPdf;
|
||||
use App\Utils\PhantomJS\Phantom;
|
||||
use App\Utils\Traits\Pdf\PdfMaker;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use stdClass;
|
||||
use Symfony\Component\HttpFoundation\StreamedResponse;
|
||||
use stdClass;
|
||||
|
||||
class ActivityController extends BaseController
|
||||
{
|
||||
@ -139,7 +141,15 @@ class ActivityController extends BaseController
|
||||
return response()->json(['message'=> ctrans('texts.no_backup_exists'), 'errors' => new stdClass], 404);
|
||||
}
|
||||
|
||||
if (config('ninja.phantomjs_pdf_generation')) {
|
||||
$pdf = (new Phantom)->convertHtmlToPdf($backup->html_backup);
|
||||
}
|
||||
elseif(config('ninja.invoiceninja_hosted_pdf_generation')){
|
||||
$pdf = (new NinjaPdf())->build($backup->html_backup);
|
||||
}
|
||||
else {
|
||||
$pdf = $this->makePdf(null, null, $backup->html_backup);
|
||||
}
|
||||
|
||||
if (isset($activity->invoice_id)) {
|
||||
$filename = $activity->invoice->numberFormatter().'.pdf';
|
||||
|
Loading…
Reference in New Issue
Block a user