Show the products grocycode as a (hidden by default) column on /products (closes #1820)

This commit is contained in:
Bernd Bestel 2022-03-14 22:39:35 +01:00
parent 7ea9984fd3
commit 0ba1a82e01
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
4 changed files with 9 additions and 0 deletions

View File

@ -10,6 +10,7 @@
- It's now possible to change a products stock QU, even after it was once added to stock - It's now possible to change a products stock QU, even after it was once added to stock
- When the product was once added to stock, there needs to exist a corresponding unit conversion for the new QU - When the product was once added to stock, there needs to exist a corresponding unit conversion for the new QU
- Added the product grocycode as a (hidden by default) column to the products list (master data)
### Shopping list ### Shopping list

View File

@ -1128,6 +1128,7 @@ $(document).on("click", ".change-table-columns-visibility-toggle", function()
var dataTable = $(dataTableSelector).DataTable(); var dataTable = $(dataTableSelector).DataTable();
dataTable.columns(columnIndex).visible(this.checked); dataTable.columns(columnIndex).visible(this.checked);
LoadImagesLazy();
}); });

View File

@ -4,11 +4,13 @@
{ 'orderable': false, 'targets': 0 }, { 'orderable': false, 'targets': 0 },
{ 'searchable': false, "targets": 0 }, { 'searchable': false, "targets": 0 },
{ 'visible': false, 'targets': 7 }, { 'visible': false, 'targets': 7 },
{ 'visible': false, 'targets': 8 },
{ "type": "html-num-fmt", "targets": 3 } { "type": "html-num-fmt", "targets": 3 }
].concat($.fn.dataTable.defaults.columnDefs) ].concat($.fn.dataTable.defaults.columnDefs)
}); });
$('#products-table tbody').removeClass("d-none"); $('#products-table tbody').removeClass("d-none");
productsTable.columns.adjust().draw(); productsTable.columns.adjust().draw();
LoadImagesLazy();
$("#search").on("keyup", Delay(function() $("#search").on("keyup", Delay(function()
{ {

View File

@ -124,6 +124,7 @@
<th class="allow-grouping">{{ $__t('Quantity unit stock') }}</th> <th class="allow-grouping">{{ $__t('Quantity unit stock') }}</th>
<th class="">{{ $__t('Product group') }}</th> <th class="">{{ $__t('Product group') }}</th>
<th class="@if(!GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) d-none @endif allow-grouping">{{ $__t('Default store') }}</th> <th class="@if(!GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) d-none @endif allow-grouping">{{ $__t('Default store') }}</th>
<th class="">{{ $__t('grocycode') }}</th>
@include('components.userfields_thead', array( @include('components.userfields_thead', array(
'userfields' => $userfields 'userfields' => $userfields
@ -206,6 +207,10 @@
{{ $store->name }} {{ $store->name }}
@endif @endif
</td> </td>
<td>
<img data-src="{{ $U('/product/' . $product->id . '/grocycode?size=25') }}"
class="lazy">
</td>
@include('components.userfields_tbody', array( @include('components.userfields_tbody', array(
'userfields' => $userfields, 'userfields' => $userfields,