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

Merge pull request #4564 from beganovich/v5-product-product-key

(v5) Fixes for product.product_key
This commit is contained in:
Benjamin Beganović 2020-12-23 15:53:07 +01:00 committed by GitHub
commit 348a762557
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -303,7 +303,9 @@ class Design extends BaseDesign
$elements = [];
// Some of column can be aliased. This is simple workaround for these.
$aliases = [];
$aliases = [
'$product.product_key' => '$product.item',
];
foreach ($this->context['pdf_variables']["{$type}_columns"] as $column) {
if (array_key_exists($column, $aliases)) {

View File

@ -624,6 +624,7 @@ trait MakesInvoiceValues
$_table_type = ltrim($table_type, '$'); // From $product -> product.
$data[$key][$table_type.'.product_key'] = is_null(optional($item)->product_key) ? $item->item : $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;