mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 17:45:39 +00:00
Improve journal pages loading time (new date range filter) Various small style adjustments (meal plan page and others) Pulled German translations from Transifex Show the shopping list total value (closes #1309) Make it possible to copy recipes (closes #714) Implemented optional "auto decimal separator for price inputs" (closes #1345) Removed table grouped column fixed order restriction (closes #1402) Don't filter out style, class, id attributes of html text (closes #1298) Added product picture as column on the stock overview page (closes #1283) Added grocycodes also for chores and batteries (+ camera barcode scanning for /choretracking and /batterytracking, this now closes #221)
72 lines
1.7 KiB
JavaScript
72 lines
1.7 KiB
JavaScript
var journalSummaryTable = $('#stock-journal-summary-table').DataTable({
|
|
'order': [[1, 'asc']],
|
|
'columnDefs': [
|
|
{ 'orderable': false, 'targets': 0 },
|
|
{ 'searchable': false, "targets": 0 }
|
|
].concat($.fn.dataTable.defaults.columnDefs)
|
|
});
|
|
$('#stock-journal-summary-table tbody').removeClass("d-none");
|
|
journalSummaryTable.columns.adjust().draw();
|
|
|
|
$("#product-filter").on("change", function()
|
|
{
|
|
var value = $(this).val();
|
|
var text = $("#product-filter option:selected").text();
|
|
if (value === "all")
|
|
{
|
|
journalSummaryTable.column(1).search("").draw();
|
|
}
|
|
else
|
|
{
|
|
journalSummaryTable.column(1).search("^" + text + "$", true, false).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");
|
|
$("#product-filter").val("all");
|
|
journalSummaryTable.column(1).search("").draw();
|
|
journalSummaryTable.column(2).search("").draw();
|
|
journalSummaryTable.column(3).search("").draw();
|
|
journalSummaryTable.search("").draw();
|
|
});
|