diff --git a/app/Services/PdfMaker/Design.php b/app/Services/PdfMaker/Design.php index a539ad4365..056ce679a8 100644 --- a/app/Services/PdfMaker/Design.php +++ b/app/Services/PdfMaker/Design.php @@ -310,6 +310,10 @@ class Design extends BaseDesign foreach ($this->context['pdf_variables']["{$type}_columns"] as $column) { if (array_key_exists($column, $aliases)) { $elements[] = ['element' => 'th', 'content' => $aliases[$column] . '_label']; + } elseif ($column == '$product.discount' && !$this->client->company->enable_product_discount) { + $elements[] = ['element' => 'th', 'content' => $column . '_label', 'properties' => ['data-ref' => "{$type}_table-" . substr($column, 1) . '-th', 'style' => 'display: none;']]; + } elseif ($column == '$product.quantity' && !$this->client->company->enable_product_quantity) { + $elements[] = ['element' => 'th', 'content' => $column . '_label', 'properties' => ['data-ref' => "{$type}_table-" . substr($column, 1) . '-th', 'style' => 'display: none;']]; } else { $elements[] = ['element' => 'th', 'content' => $column . '_label', 'properties' => ['data-ref' => "{$type}_table-" . substr($column, 1) . '-th']]; } @@ -384,6 +388,10 @@ class Design extends BaseDesign 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->client->company->enable_product_discount) { + $element['elements'][] = ['element' => 'td', 'content' => $row['$product.discount'], 'properties' => ['data-ref' => 'product_table-product.discount-td', 'style' => 'display: none;']]; + } elseif ($cell == '$product.quantity' && !$this->client->company->enable_product_quantity) { + $element['elements'][] = ['element' => 'td', 'content' => $row['$product.quantity'], 'properties' => ['data-ref' => 'product_table-product.quantity-td', 'style' => 'display: none;']]; } elseif ($cell == '$task.hours') { $element['elements'][] = ['element' => 'td', 'content' => $row['$task.quantity'], 'properties' => ['data-ref' => 'task_table-task.hours-td']]; } elseif ($cell == '$task.description') {