From 356d7aeba43cc0cb5b211a90d8ce057230005d0a Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 2 Jul 2022 11:59:40 +1000 Subject: [PATCH] Hide custom values that are empty --- app/Services/PdfMaker/Design.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Services/PdfMaker/Design.php b/app/Services/PdfMaker/Design.php index 85295f7d358d..46d232e29b45 100644 --- a/app/Services/PdfMaker/Design.php +++ b/app/Services/PdfMaker/Design.php @@ -332,7 +332,10 @@ class Design extends BaseDesign $_variable = explode('.', $variable)[1]; $_customs = ['custom1', 'custom2', 'custom3', 'custom4']; - if (in_array($_variable, $_customs)) { + /* 2/7/2022 don't show custom values if they are empty */ + $var = str_replace("custom", "custom_value", $_variable); + + if (in_array($_variable, $_customs) && !empty($this->entity->{$var})) { $elements[] = ['element' => 'tr', 'elements' => [ ['element' => 'th', 'content' => $variable . '_label', 'properties' => ['data-ref' => 'entity_details-' . substr($variable, 1) . '_label']], ['element' => 'th', 'content' => $variable, 'properties' => ['data-ref' => 'entity_details-' . substr($variable, 1)]],