From d69f3dd0d09cf5df5a834b4afcf63ecc996799d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Mon, 28 Jun 2021 12:11:57 +0200 Subject: [PATCH] Show correct variables for credits PDF --- app/Services/PdfMaker/Design.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Services/PdfMaker/Design.php b/app/Services/PdfMaker/Design.php index 7155c42688..7d41c6aeb1 100644 --- a/app/Services/PdfMaker/Design.php +++ b/app/Services/PdfMaker/Design.php @@ -12,6 +12,7 @@ namespace App\Services\PdfMaker; +use App\Models\Credit; use App\Models\Quote; use App\Services\PdfMaker\Designs\Utilities\BaseDesign; use App\Services\PdfMaker\Designs\Utilities\DesignHelpers; @@ -194,6 +195,10 @@ class Design extends BaseDesign $variables = $this->context['pdf_variables']['quote_details']; } + if ($this->entity instanceof Credit) { + $variables = $this->context['pdf_variables']['credit_details']; + } + $elements = []; // We don't want to show account balance or invoice total on PDF.. or any amount with currency.