added button to add expired products to shoppinglist (#1026)

* added button to add expired products to shoppinglist

* Localizations are managed via Transifex

Revert "added button to add expired products to shoppinglist"

This reverts commit ad1ab5d6a0.

* Revert unnecessary change

* Reuse existing function (GetExpiringProducts) to get expired products

Co-authored-by: Mario Klug <mario.klug@sourcefactory.at>
Co-authored-by: Bernd Bestel <bernd@berrnd.de>
This commit is contained in:
SourceFactory.at
2020-10-04 15:20:34 +02:00
committed by GitHub
parent 49588508bb
commit 617b25bda8
7 changed files with 116 additions and 0 deletions

View File

@@ -155,6 +155,20 @@ $(document).on('click', '#add-products-below-min-stock-amount', function(e)
);
});
$(document).on('click', '#add-expired-products', function(e)
{
Grocy.Api.Post('stock/shoppinglist/add-expired-products', { "list_id": $("#selected-shopping-list").val() },
function(result)
{
window.location.href = U('/shoppinglist?list=' + $("#selected-shopping-list").val());
},
function(xhr)
{
console.error(xhr);
}
);
});
$(document).on('click', '#clear-shopping-list', function(e)
{
bootbox.confirm({