Fixes for custom quote columns

This commit is contained in:
David Bomba 2023-05-17 20:46:12 +10:00
parent b47253ba45
commit 58cb6ec874
2 changed files with 11 additions and 3 deletions

View File

@ -874,6 +874,8 @@ class Design extends BaseDesign
// $task.cost => $task.rate // $task.cost => $task.rate
// $task.quantity => $task.hours // $task.quantity => $task.hours
nlog("{$key} => {$cell}");
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->company->enable_product_discount) { } elseif ($cell == '$product.discount' && !$this->company->enable_product_discount) {

View File

@ -151,15 +151,21 @@ trait DesignHelpers
public function processTaxColumns(string $type): void public function processTaxColumns(string $type): void
{ {
$column_type = $type; $column_type = $type;
if ($type == 'product' || $type == 'product_quote') {
if ($type == 'product') {
$type_id = 1; $type_id = 1;
$column_type = 'product_quote';
$type = 'product';
} }
if ($type == 'task') { if ($type == 'task') {
$type_id = 2; $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. // At the moment we pass "task" or "product" as type.
// However, "pdf_variables" contains "$task.tax" or "$product.tax" <-- Notice the dollar sign. // However, "pdf_variables" contains "$task.tax" or "$product.tax" <-- Notice the dollar sign.