From 9bcea0cf58c5857424ddd844c03e7594cc129ed1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Tue, 20 Oct 2020 12:46:08 +0200 Subject: [PATCH] Fix for invoice custom fields --- app/Services/PdfMaker/Design.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/app/Services/PdfMaker/Design.php b/app/Services/PdfMaker/Design.php index 267c3555e75f..53ffbb89e8eb 100644 --- a/app/Services/PdfMaker/Design.php +++ b/app/Services/PdfMaker/Design.php @@ -168,10 +168,19 @@ class Design extends BaseDesign $elements = []; foreach ($variables as $variable) { - $elements[] = ['element' => 'tr', 'properties' => ['hidden' => $this->entityVariableCheck($variable)], 'elements' => [ - ['element' => 'th', 'content' => $variable . '_label'], - ['element' => 'th', 'content' => $variable], - ]]; + $_variable = explode('.', $variable)[1]; + + if ($_variable == 'custom1' || $_variable == 'custom2') { + $elements[] = ['element' => 'tr', 'elements' => [ + ['element' => 'th', 'content' => $variable . '_label'], + ['element' => 'th', 'content' => $variable], + ]]; + } else { + $elements[] = ['element' => 'tr', 'properties' => ['hidden' => $this->entityVariableCheck($variable)], 'elements' => [ + ['element' => 'th', 'content' => $variable . '_label'], + ['element' => 'th', 'content' => $variable], + ]]; + } } return $elements;