diff --git a/app/DataMapper/CompanySettings.php b/app/DataMapper/CompanySettings.php index d82edd304b..4a1f43fb2c 100644 --- a/app/DataMapper/CompanySettings.php +++ b/app/DataMapper/CompanySettings.php @@ -628,7 +628,7 @@ class CompanySettings extends BaseSettings '$credit.total', ], 'product_columns' => [ - '$product.product_key', + '$product.item', '$product.description', '$product.unit_cost', '$product.quantity', diff --git a/app/Utils/HtmlEngine.php b/app/Utils/HtmlEngine.php index 5d733fbe90..955e41936f 100644 --- a/app/Utils/HtmlEngine.php +++ b/app/Utils/HtmlEngine.php @@ -294,6 +294,7 @@ class HtmlEngine $data['$custom_surcharge3'] = ['value' => $this->entity->custom_surcharge3 ?: ' ', 'label' => $this->makeCustomField('custom_surcharge3')]; $data['$custom_surcharge4'] = ['value' => $this->entity->custom_surcharge4 ?: ' ', 'label' => $this->makeCustomField('custom_surcharge4')]; + $data['$product.item'] = ['value' => '', 'label' => ctrans('texts.item')]; $data['$product.date'] = ['value' => '', 'label' => ctrans('texts.date')]; $data['$product.discount'] = ['value' => '', 'label' => ctrans('texts.discount')]; $data['$product.product_key'] = ['value' => '', 'label' => ctrans('texts.product_key')]; diff --git a/app/Utils/Traits/MakesInvoiceValues.php b/app/Utils/Traits/MakesInvoiceValues.php index 5ad73c6622..ab8ab6ae0f 100644 --- a/app/Utils/Traits/MakesInvoiceValues.php +++ b/app/Utils/Traits/MakesInvoiceValues.php @@ -624,7 +624,7 @@ trait MakesInvoiceValues $_table_type = ltrim($table_type, '$'); // From $product -> product. - $data[$key][$table_type.'.product_key'] = $item->product_key; + $data[$key][$table_type.'.item'] = is_null(optional($item)->item) ? $item->product_key : $item->item; $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; @@ -632,11 +632,8 @@ trait MakesInvoiceValues $data[$key][$table_type . ".{$_table_type}1"] = $helpers->formatCustomFieldValue($this->client->company->custom_fields, "{$_table_type}1", $item->custom_value1, $this->client); $data[$key][$table_type . ".{$_table_type}2"] = $helpers->formatCustomFieldValue($this->client->company->custom_fields, "{$_table_type}2", $item->custom_value2, $this->client); - ; $data[$key][$table_type . ".{$_table_type}3"] = $helpers->formatCustomFieldValue($this->client->company->custom_fields, "{$_table_type}3", $item->custom_value3, $this->client); - ; $data[$key][$table_type . ".{$_table_type}4"] = $helpers->formatCustomFieldValue($this->client->company->custom_fields, "{$_table_type}4", $item->custom_value4, $this->client); - ; $data[$key][$table_type.'.quantity'] = $item->quantity;