Added a "Clear filter" button on the stock overview page (closes #879)

This commit is contained in:
Bernd Bestel 2020-08-25 20:20:51 +02:00
parent 0417b73cb5
commit f28697e5b4
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
4 changed files with 30 additions and 3 deletions

View File

@ -19,6 +19,7 @@
- Products can now be hidden instead of deleted to prevent problems / missing information on existing references (new checkbox on the product edit page) (thanks @kriddles) - Products can now be hidden instead of deleted to prevent problems / missing information on existing references (new checkbox on the product edit page) (thanks @kriddles)
- Improved/fixed that changing the products "Factor purchase to stock quantity unit" not longer messes up historical prices (which results for example in wrong recipe costs) (thanks @kriddles) - Improved/fixed that changing the products "Factor purchase to stock quantity unit" not longer messes up historical prices (which results for example in wrong recipe costs) (thanks @kriddles)
- On the stock journal page, it's now visible if a consume-booking was spoiled - On the stock journal page, it's now visible if a consume-booking was spoiled
- Added a "Clear filter"-button on the stock overview page to quickly reset applied filters
- Fixed that it was not possible to leave the "Barcode(s)" on the product edit page by `TAB` - Fixed that it was not possible to leave the "Barcode(s)" on the product edit page by `TAB`
- Fixed that when adding products through a product picker workflow and when the created products contains special characters, the product was not preselected on the previous page (thanks @Forceu) - Fixed that when adding products through a product picker workflow and when the created products contains special characters, the product was not preselected on the previous page (thanks @Forceu)
- Fixed that when editing a product the default store was not visible / always empty regardless if the product had one set (thanks @kriddles) - Fixed that when editing a product the default store was not visible / always empty regardless if the product had one set (thanks @kriddles)

View File

@ -1846,3 +1846,6 @@ msgstr ""
msgid "Quantity unit stock cannot be changed after first purchase" msgid "Quantity unit stock cannot be changed after first purchase"
msgstr "" msgstr ""
msgid "Clear filter"
msgstr ""

View File

@ -20,8 +20,12 @@ $("#location-filter").on("change", function()
{ {
value = ""; value = "";
} }
else
{
value = "xx" + value + "xx";
}
stockOverviewTable.column(5).search("xx" + value + "xx", true, false, true).draw(); stockOverviewTable.column(5).search(value).draw();
}); });
$("#product-group-filter").on("change", function() $("#product-group-filter").on("change", function()
@ -31,8 +35,12 @@ $("#product-group-filter").on("change", function()
{ {
value = ""; value = "";
} }
else
{
value = "xx" + value + "xx";
}
stockOverviewTable.column(7).search("xx" + value + "xx").draw(); stockOverviewTable.column(7).search(value).draw();
}); });
$("#status-filter").on("change", function() $("#status-filter").on("change", function()
@ -56,6 +64,18 @@ $(".status-filter-message").on("click", function()
$("#status-filter").trigger("change"); $("#status-filter").trigger("change");
}); });
$("#clear-filter-button").on("click", function()
{
$("#search").val("");
$("#status-filter").val("all");
$("#product-group-filter").val("all");
$("#location-filter").val("all");
stockOverviewTable.column(5).search("").draw();
stockOverviewTable.column(6).search("").draw();
stockOverviewTable.column(7).search("").draw();
stockOverviewTable.search("").draw();
});
$("#search").on("keyup", Delay(function() $("#search").on("keyup", Delay(function()
{ {
var value = $(this).val(); var value = $(this).val();

View File

@ -38,10 +38,13 @@
<p id="info-expired-products" data-status-filter="expired" class="error-message status-filter-message responsive-button mr-2"></p> <p id="info-expired-products" data-status-filter="expired" class="error-message status-filter-message responsive-button mr-2"></p>
@endif @endif
<p id="info-missing-products" data-status-filter="belowminstockamount" class="normal-message status-filter-message responsive-button"></p> <p id="info-missing-products" data-status-filter="belowminstockamount" class="normal-message status-filter-message responsive-button"></p>
<a id="clear-filter-button" class="btn btn-sm btn-outline-info float-right" href="#">
{{ $__t('Clear filter') }}
</a>
</div> </div>
</div> </div>
<div class="row mt-3"> <div class="row mt-3">
<div class="col-xs-12 col-md-6 col-xl-3 d-flex align-items-end"> <div class="col-xs-12 col-md-6 col-xl-3">
<div class="input-group mb-3"> <div class="input-group mb-3">
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text"><i class="fas fa-search"></i></span> <span class="input-group-text"><i class="fas fa-search"></i></span>