Transpose product column index when searching in it (fixes #2688)

This commit is contained in:
Bernd Bestel 2025-02-27 17:07:30 +01:00
parent 27b79841fc
commit 72453eac0a
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
3 changed files with 3 additions and 2 deletions

View File

@ -11,6 +11,7 @@
### Stock
- Optimized that the built-in Open Food Facts external barcode lookup plugin now uses the localized product name (if provided by the Open Food Facts API, based on the set Grocy language of the current user)
- Fixed that the product filter on the stock entires page didn't work when the product column was reordered / not the second one
### Shopping list

View File

@ -19,7 +19,7 @@ $.fn.dataTable.ext.search.push(function(settings, data, dataIndex)
{
var productId = Grocy.Components.ProductPicker.GetValue();
if (!productId || Number.isNaN(productId) || productId == data[1])
if (!productId || Number.isNaN(productId) || productId == data[stockEntriesTable.colReorder.transpose(1)])
{
return true;
}

View File

@ -75,7 +75,7 @@
data-table-selector="#stockentries-table"
href="#"><i class="fa-solid fa-eye"></i></a>
</th>
<th class="d-none">Hidden product_id</th> <!-- This must be in the first column for searching -->
<th class="d-none">Hidden product_id</th>
<th class="allow-grouping">{{ $__t('Product') }}</th>
<th>{{ $__t('Amount') }}</th>
<th class="@if(!GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING) d-none @endif allow-grouping">{{ $__t('Due date') }}</th>