Keep selected date range when navigating through different group by variants of the stockreport/spendings (closes #2532)

This commit is contained in:
Bernd Bestel 2025-01-13 23:13:24 +01:00
parent 645f9e2599
commit c99dd46007
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
3 changed files with 18 additions and 6 deletions

View File

@ -21,6 +21,7 @@
- Optimized that when moving a product to a freezer location (so when freezing it) the due date will no longer be replaced when the product option "Default due days after freezing" is set to `0`
- Product barcode matching is now case-insensitive
- Added a new column "Product picture" on the products list (master data) page (hidden by default)
- Optimized that when navigation between the different "Group by"-variants on the stock report "Spendings", the selected date range now remains persistent
- Fixed that a once set quantity unit on a product barcode could not be removed on edit
- Fixed that when consuming a specific stock entry which is opened, and which originated from a before partly opened stock entry, the unopened one was wrongly consume instead

View File

@ -143,3 +143,11 @@ $("#product-group-filter").on("change", function()
UpdateUriParam("product-group", $(this).val());
window.location.reload();
});
$(".group-by-button").on("click", function(e)
{
e.preventDefault();
UpdateUriParam("group-by", $(this).attr("data-group-by"));
window.location.reload();
});

View File

@ -31,16 +31,19 @@
href="#">
{{ $__t('Group by') }}:
</a>
<a class="btn btn-outline-dark responsive-button m-1 mt-md-0 mb-md-0 float-right @if($groupBy == 'product') active @endif"
href="{{ $U('/stockreports/spendings?group-by=product') }}">
<a class="btn btn-outline-dark responsive-button m-1 mt-md-0 mb-md-0 float-right group-by-button @if($groupBy == 'product') active @endif"
href="#"
data-group-by="product">
{{ $__t('Product') }}
</a>
<a class="btn btn-outline-dark responsive-button m-1 mt-md-0 mb-md-0 float-right @if($groupBy == 'productgroup') active @endif"
href="{{ $U('/stockreports/spendings?group-by=productgroup') }}">
<a class="btn btn-outline-dark responsive-button m-1 mt-md-0 mb-md-0 float-right group-by-button @if($groupBy == 'productgroup') active @endif"
href="#"
data-group-by="productgroup">
{{ $__t('Product group') }}
</a>
<a class="btn btn-outline-dark responsive-button m-1 mt-md-0 mb-md-0 float-right @if($groupBy == 'store') active @endif"
href="{{ $U('/stockreports/spendings?group-by=store') }}">
<a class="btn btn-outline-dark responsive-button m-1 mt-md-0 mb-md-0 float-right group-by-button @if($groupBy == 'store') active @endif"
href="#"
data-group-by="store">
{{ $__t('Store') }}
</a>
</div>