From 1662e0467171904090296c97b017561c237d2285 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 15 Nov 2023 08:53:07 +1100 Subject: [PATCH] Fixes for column types in designer --- app/Services/Pdf/PdfBuilder.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Services/Pdf/PdfBuilder.php b/app/Services/Pdf/PdfBuilder.php index dd453097e073..9b19192e1bcf 100644 --- a/app/Services/Pdf/PdfBuilder.php +++ b/app/Services/Pdf/PdfBuilder.php @@ -844,10 +844,12 @@ class PdfBuilder public function processTaxColumns(string $type): void { if ($type == 'product') { + $column_type = 'product'; $type_id = 1; } if ($type == 'task') { + $column_type = 'task'; $type_id = 2; } @@ -886,10 +888,10 @@ class PdfBuilder array_push($taxes, sprintf('%s%s.tax_rate3', '$', $type)); } - $key = array_search(sprintf('%s%s.tax', '$', $type), $this->service->config->pdf_variables["{$type}_columns"], true); + $key = array_search(sprintf('%s%s.tax', '$', $type), $this->service->config->pdf_variables["{$column_type}_columns"], true); if ($key !== false) { - array_splice($this->service->config->pdf_variables["{$type}_columns"], $key, 1, $taxes); + array_splice($this->service->config->pdf_variables["{$column_type}_columns"], $key, 1, $taxes); } } }