1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-05 18:52:44 +01:00

rename task.service to task.product key

This commit is contained in:
Benjamin Beganović 2020-12-08 16:10:29 +01:00
parent 1d611f3bc6
commit 53525dc93f
5 changed files with 7 additions and 6 deletions

View File

@ -636,7 +636,7 @@ class CompanySettings extends BaseSettings
'$product.line_total',
],
'task_columns' =>[
'$task.product_key',
'$task.service',
'$task.description',
'$task.rate',
'$task.hours',

View File

@ -300,9 +300,7 @@ class Design extends BaseDesign
$elements = [];
// Some of column can be aliased. This is simple workaround for these.
$aliases = [
'$task.product_key' => '$task.service',
];
$aliases = [];
foreach ($this->context['pdf_variables']["{$type}_columns"] as $column) {
if (array_key_exists($column, $aliases)) {
@ -379,6 +377,8 @@ class Design extends BaseDesign
// $task.cost => $task.rate
// $task.quantity => $task.hours
info($row);
if ($cell == '$task.rate') {
$element['elements'][] = ['element' => 'td', 'content' => $row['$task.cost']];
} elseif ($cell == '$task.hours') {

View File

@ -307,7 +307,7 @@ class HtmlEngine
$data['$task.date'] = ['value' => '', 'label' => ctrans('texts.date')];
$data['$task.discount'] = ['value' => '', 'label' => ctrans('texts.discount')];
$data['$task.product_key'] = ['value' => '', 'label' => ctrans('texts.product_key')];
$data['$task.service'] = ['value' => '', 'label' => ctrans('texts.service')];
$data['$task.description'] = ['value' => '', 'label' => ctrans('texts.description')];
$data['$task.rate'] = ['value' => '', 'label' => ctrans('texts.rate')];
$data['$task.hours'] = ['value' => '', 'label' => ctrans('texts.hours')];

View File

@ -617,6 +617,7 @@ trait MakesInvoiceValues
}
$data[$key][$table_type.'.product_key'] = $item->product_key;
$data[$key][$table_type.'.service'] = is_null(optional($item)->service) ? $item->product_key : $item->service;
$data[$key][$table_type.'.notes'] = $item->notes;
$data[$key][$table_type.'.description'] = $item->notes;
$data[$key][$table_type.'.custom_value1'] = $item->custom_value1;

View File

@ -191,7 +191,7 @@ trait MakesTemplateData
$data['$product.line_total'] = ['value' => '$20.00', 'label' => ctrans('texts.line_total')];
$data['$task.date'] = ['value' => '2010-02-03', 'label' => ctrans('texts.date')];
$data['$task.discount'] = ['value' => '5%', 'label' => ctrans('texts.discount')];
$data['$task.product_key'] = ['value' => 'key', 'label' => ctrans('texts.product_key')];
$data['$task.service'] = ['value' => 'key', 'label' => ctrans('texts.service')];
$data['$task.notes'] = ['value' => 'Note for Tasks', 'label' => ctrans('texts.notes')];
$data['$task.rate'] = ['value' => '$100.00', 'label' => ctrans('texts.rate')];
$data['$task.hours'] = ['value' => '1', 'label' => ctrans('texts.hours')];