From 69f8c237ff894920aa525b2742b215fe47e28102 Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Mon, 28 Jun 2021 19:14:15 +0200 Subject: [PATCH] Fixed /stockentries group by purchased_date (fixes #1419) --- public/js/grocy.js | 6 ++++++ views/stockentries.blade.php | 29 ++++++++++++----------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/public/js/grocy.js b/public/js/grocy.js index d5180f07..7b0607a0 100644 --- a/public/js/grocy.js +++ b/public/js/grocy.js @@ -965,6 +965,12 @@ $(".change-table-columns-visibility-button").on("click", function(e) return; } + var shadowColumnIndex = $(this.header()).attr("data-shodow-rowgroup-column"); + if (shadowColumnIndex) + { + index = shadowColumnIndex; + } + var checked = "checked"; if (!visible) { diff --git a/views/stockentries.blade.php b/views/stockentries.blade.php index f3be05fd..95ff26e5 100644 --- a/views/stockentries.blade.php +++ b/views/stockentries.blade.php @@ -62,18 +62,15 @@ data-table-selector="#stockentries-table" href="#"> - product_id + Hidden product_id {{ $__t('Product') }} {{ $__t('Amount') }} - @if (GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING) - {{ $__t('Due date') }} - @endif - @if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING){{ $__t('Location') }}@endif - @if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) - {{ $__t('Store') }} - {{ $__t('Price') }} - @endif - {{ $__t('Purchased date') }} + {{ $__t('Due date') }} + {{ $__t('Location') }} + {{ $__t('Store') }} + {{ $__t('Price') }} + {{ $__t('Purchased date') }} + Hidden purchased_date @include('components.userfields_thead', array( 'userfields' => $userfields @@ -237,39 +234,37 @@ @if($stockEntry->open == 1){{ $__t('Opened') }}@endif - @if (GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING) - + {{ $stockEntry->best_before_date }} - @endif - @if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING) {{ FindObjectInArrayByPropertyValue($locations, 'id', $stockEntry->location_id)->name }} - @endif - @if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) @if (FindObjectInArrayByPropertyValue($shoppinglocations, 'id', $stockEntry->shopping_location_id) !== null) {{ FindObjectInArrayByPropertyValue($shoppinglocations, 'id', $stockEntry->shopping_location_id)->name }} @endif {{ $stockEntry->price }} - @endif {{ $stockEntry->purchased_date }} + {{ $stockEntry->purchased_date }} @include('components.userfields_tbody', array( 'userfields' => $userfields,