mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 09:39:57 +00:00
Fixed some localization strings Reviewed/optimized product deletion handling Add option to hide products from the stock overview page (closes #906) Prefill default_due_days also on the inventory page (closes #591) Added DataTables accent chinese-string plugin (closes #872) Show costs and calories per recipe ingredient (closes #1072) Fixed user permission saving (fixes #1099) User permissions should not have an effect for demo mode (closes #972) Handle QU conversion when consuming a substituation (child) product (fixes #1118) Consume/open any child product when the parent product is not in stock (closes #899) Added a retry camera barcode scanning button to product picker workflow (closes #736)
70 lines
1.6 KiB
JavaScript
70 lines
1.6 KiB
JavaScript
var journalSummaryTable = $('#stock-journal-summary-table').DataTable({
|
|
'paginate': true,
|
|
'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")
|
|
{
|
|
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();
|
|
});
|