mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Show $product.quantity & product.discount based on settings
This commit is contained in:
parent
2963824924
commit
b43b52519f
@ -310,6 +310,10 @@ class Design extends BaseDesign
|
|||||||
foreach ($this->context['pdf_variables']["{$type}_columns"] as $column) {
|
foreach ($this->context['pdf_variables']["{$type}_columns"] as $column) {
|
||||||
if (array_key_exists($column, $aliases)) {
|
if (array_key_exists($column, $aliases)) {
|
||||||
$elements[] = ['element' => 'th', 'content' => $aliases[$column] . '_label'];
|
$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 {
|
} else {
|
||||||
$elements[] = ['element' => 'th', 'content' => $column . '_label', 'properties' => ['data-ref' => "{$type}_table-" . substr($column, 1) . '-th']];
|
$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') {
|
if ($cell == '$task.rate') {
|
||||||
$element['elements'][] = ['element' => 'td', 'content' => $row['$task.cost'], 'properties' => ['data-ref' => 'task_table-task.cost-td']];
|
$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') {
|
} elseif ($cell == '$task.hours') {
|
||||||
$element['elements'][] = ['element' => 'td', 'content' => $row['$task.quantity'], 'properties' => ['data-ref' => 'task_table-task.hours-td']];
|
$element['elements'][] = ['element' => 'td', 'content' => $row['$task.quantity'], 'properties' => ['data-ref' => 'task_table-task.hours-td']];
|
||||||
} elseif ($cell == '$task.description') {
|
} elseif ($cell == '$task.description') {
|
||||||
|
Loading…
Reference in New Issue
Block a user