mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
fixes for delivery note generation
This commit is contained in:
parent
22c47b63dd
commit
f1f8201683
@ -795,7 +795,7 @@ class InvoiceController extends BaseController
|
||||
|
||||
$file_path = $invoice->service()->getInvoicePdf($contact);
|
||||
|
||||
nlog($file_path);
|
||||
nlog($file_path);
|
||||
|
||||
return response()->download($file_path, basename($file_path));
|
||||
}
|
||||
|
@ -17,7 +17,9 @@ use App\Models\Design;
|
||||
use App\Models\Invoice;
|
||||
use App\Services\PdfMaker\Design as PdfMakerDesign;
|
||||
use App\Services\PdfMaker\PdfMaker as PdfMakerService;
|
||||
use App\Utils\HostedPDF\NinjaPdf;
|
||||
use App\Utils\HtmlEngine;
|
||||
use App\Utils\PhantomJS\Phantom;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use App\Utils\Traits\Pdf\PdfMaker;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
@ -58,6 +60,10 @@ class GenerateDeliveryNote
|
||||
|
||||
$file_path = sprintf('%s%s_delivery_note.pdf', $this->invoice->client->invoice_filepath(), $this->invoice->number);
|
||||
|
||||
if (config('ninja.phantomjs_pdf_generation')) {
|
||||
return (new Phantom)->generate($this->invoice->invitations->first());
|
||||
}
|
||||
|
||||
$design = Design::find($design_id);
|
||||
$html = new HtmlEngine($this->invoice->invitations->first());
|
||||
|
||||
@ -86,7 +92,12 @@ class GenerateDeliveryNote
|
||||
|
||||
// Storage::makeDirectory($this->invoice->client->invoice_filepath(), 0775);
|
||||
|
||||
$pdf = $this->makePdf(null, null, $maker->getCompiledHTML());
|
||||
if(config('ninja.invoiceninja_hosted_pdf_generation')){
|
||||
$pdf = (new NinjaPdf())->build($maker->getCompiledHTML(true));
|
||||
}
|
||||
else {
|
||||
$pdf = $this->makePdf(null, null, $maker->getCompiledHTML());
|
||||
}
|
||||
|
||||
if (config('ninja.log_pdf_html')) {
|
||||
info($maker->getCompiledHTML());
|
||||
|
@ -263,7 +263,7 @@ class InvoiceService
|
||||
{
|
||||
if ((int)$this->invoice->balance == 0) {
|
||||
|
||||
InvoiceWorkflowSettings::dispatch($this->invoice);
|
||||
InvoiceWorkflowSettings::dispatchNow($this->invoice);
|
||||
|
||||
$this->setStatus(Invoice::STATUS_PAID);
|
||||
}
|
||||
|
@ -12,6 +12,7 @@
|
||||
namespace App\Services\Payment;
|
||||
|
||||
use App\Events\Invoice\InvoiceWasUpdated;
|
||||
use App\Jobs\Invoice\InvoiceWorkflowSettings;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\Payment;
|
||||
use App\Models\PaymentHash;
|
||||
@ -83,6 +84,8 @@ class UpdateInvoicePayment
|
||||
->updateStatus()
|
||||
->save();
|
||||
|
||||
InvoiceWorkflowSettings::dispatchNow($invoice);
|
||||
|
||||
event(new InvoiceWasUpdated($invoice, $invoice->company, Ninja::eventVars()));
|
||||
});
|
||||
|
||||
|
@ -142,7 +142,7 @@ return [
|
||||
'expanded_logging' => env('EXPANDED_LOGGING', false),
|
||||
'snappdf_chromium_path' => env('SNAPPDF_CHROMIUM_PATH', false),
|
||||
'v4_migration_version' => '4.5.35',
|
||||
'flutter_canvas_kit' => env('FLUTTER_CANVAS_KIT', 'selfhosted-html'),
|
||||
'flutter_renderer' => env('FLUTTER_RENDERER', 'selfhosted-html'),
|
||||
'webcron_secret' => env('WEBCRON_SECRET', false),
|
||||
'disable_auto_update' => env('DISABLE_AUTO_UPDATE', false),
|
||||
'invoiceninja_hosted_pdf_generation' => env('NINJA_HOSTED_PDF', false),
|
||||
|
@ -146,9 +146,9 @@
|
||||
|
||||
</script>
|
||||
|
||||
@if(config('ninja.flutter_canvas_kit') == 'hosted')
|
||||
@if(config('ninja.flutter_renderer') == 'hosted')
|
||||
<script defer src="main.dart.js?v={{ config('ninja.app_version') }}" type="application/javascript"></script>
|
||||
@elseif(config('ninja.flutter_canvas_kit') == 'selfhosted-canvaskit')
|
||||
@elseif(config('ninja.flutter_renderer') == 'selfhosted-canvaskit')
|
||||
<script defer src="main.wasm.dart.js?v={{ config('ninja.app_version') }}" type="application/javascript"></script>
|
||||
@else
|
||||
<script defer src="main.foss.dart.js?v={{ config('ninja.app_version') }}" type="application/javascript"></script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user