From f9ade5af77932280af4bf045625ed02f172e39d6 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 10 Jun 2022 12:23:46 +1000 Subject: [PATCH] Hide surcharges on PDF if the value is blank --- app/Services/PdfMaker/Design.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Services/PdfMaker/Design.php b/app/Services/PdfMaker/Design.php index 9e4b5efeec6b..dcbc8f39bff4 100644 --- a/app/Services/PdfMaker/Design.php +++ b/app/Services/PdfMaker/Design.php @@ -799,7 +799,7 @@ class Design extends BaseDesign } elseif (Str::startsWith($variable, '$custom_surcharge')) { $_variable = ltrim($variable, '$'); // $custom_surcharge1 -> custom_surcharge1 - $visible = $this->entity->{$_variable} != 0 || $this->entity->{$_variable} != '0'; + $visible = (int)$this->entity->{$_variable} != 0 || $this->entity->{$_variable} != '0' || !$this->entity->{$_variable}; $elements[1]['elements'][] = ['element' => 'div', 'elements' => [ ['element' => 'span', 'content' => $variable . '_label', 'properties' => ['hidden' => !$visible, 'data-ref' => 'totals_table-' . substr($variable, 1) . '-label']],