diff --git a/app/Services/PdfMaker/Design.php b/app/Services/PdfMaker/Design.php index 71b83284438f..9bb0e91f9bbb 100644 --- a/app/Services/PdfMaker/Design.php +++ b/app/Services/PdfMaker/Design.php @@ -874,6 +874,8 @@ class Design extends BaseDesign // $task.cost => $task.rate // $task.quantity => $task.hours + nlog("{$key} => {$cell}"); + if ($cell == '$task.rate') { $element['elements'][] = ['element' => 'td', 'content' => $row['$task.cost'], 'properties' => ['data-ref' => 'task_table-task.cost-td']]; } elseif ($cell == '$product.discount' && !$this->company->enable_product_discount) { diff --git a/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php b/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php index 183c4de8df35..4a2d287ef5bb 100644 --- a/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php +++ b/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php @@ -151,15 +151,21 @@ trait DesignHelpers public function processTaxColumns(string $type): void { $column_type = $type; - if ($type == 'product' || $type == 'product_quote') { + + if ($type == 'product') { $type_id = 1; - $column_type = 'product_quote'; - $type = 'product'; } if ($type == 'task') { $type_id = 2; } + + if ($type == 'product_quote') { + $type_id = 1; + $column_type = 'product_quote'; + $type = 'product'; + } + // At the moment we pass "task" or "product" as type. // However, "pdf_variables" contains "$task.tax" or "$product.tax" <-- Notice the dollar sign.