mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 04:12:59 +00:00
Squashed commit
Fixed number input min/max amount handling Only (auto) save valid user inputs More filters on the stock journal pages Save the last price per used barcode and preselect that as a total price on purchase if not empty (closes #1131) Don't apply conversions for only_check_single_unit_in_stock ingredients (fixes #1120) Render shopping list userfields (closes #1052) Fixed Focus when adding included recipes (closes #1019) Order all base objects with NOCASE (closes #1086)
This commit is contained in:
@@ -1,8 +1,71 @@
|
||||
var journalSummaryTable = $('#journal-summary-table').DataTable({
|
||||
var journalSummaryTable = $('#stock-journal-summary-table').DataTable({
|
||||
'paginate': true,
|
||||
'order': [[0, 'desc']]
|
||||
'order': [[1, 'asc']],
|
||||
'columnDefs': [
|
||||
{ 'orderable': false, 'targets': 0 },
|
||||
{ 'searchable': false, "targets": 0 }
|
||||
]
|
||||
});
|
||||
$('#journal-summary-table tbody').removeClass("d-none");
|
||||
$('#stock-journal-summary-table tbody').removeClass("d-none");
|
||||
journalSummaryTable.columns.adjust().draw();
|
||||
$('.dataTables_scrollBody').addClass("dragscroll");
|
||||
dragscroll.reset();
|
||||
|
||||
$("#product-filter").on("change", function()
|
||||
{
|
||||
var value = $(this).val();
|
||||
var text = $("#product-filter option:selected").text();
|
||||
if (value === "all")
|
||||
{
|
||||
text = "";
|
||||
}
|
||||
|
||||
journalSummaryTable.column(1).search(text).draw();
|
||||
});
|
||||
|
||||
$("#transaction-type-filter").on("change", function()
|
||||
{
|
||||
var value = $(this).val();
|
||||
var text = $("#transaction-type-filter option:selected").text();
|
||||
if (value === "all")
|
||||
{
|
||||
text = "";
|
||||
}
|
||||
|
||||
journalSummaryTable.column(2).search(text).draw();
|
||||
});
|
||||
|
||||
$("#user-filter").on("change", function()
|
||||
{
|
||||
var value = $(this).val();
|
||||
var text = $("#user-filter option:selected").text();
|
||||
if (value === "all")
|
||||
{
|
||||
text = "";
|
||||
}
|
||||
|
||||
journalSummaryTable.column(3).search(text).draw();
|
||||
});
|
||||
|
||||
$("#search").on("keyup", Delay(function()
|
||||
{
|
||||
var value = $(this).val();
|
||||
if (value === "all")
|
||||
{
|
||||
value = "";
|
||||
}
|
||||
|
||||
journalSummaryTable.search(value).draw();
|
||||
}, 200));
|
||||
|
||||
$("#clear-filter-button").on("click", function()
|
||||
{
|
||||
$("#search").val("");
|
||||
$("#transaction-type-filter").val("all");
|
||||
$("#location-filter").val("all");
|
||||
$("#user-filter").val("all");
|
||||
journalSummaryTable.column(1).search("").draw();
|
||||
journalSummaryTable.column(2).search("").draw();
|
||||
journalSummaryTable.column(3).search("").draw();
|
||||
journalSummaryTable.search("").draw();
|
||||
});
|
||||
|
Reference in New Issue
Block a user