diff --git a/public/viewjs/stockdetail.js b/public/viewjs/stockdetail.js index f8952df5..2ee665c2 100644 --- a/public/viewjs/stockdetail.js +++ b/public/viewjs/stockdetail.js @@ -68,7 +68,7 @@ $(document).on('click', '.stock-consume-button', function(e) var stockRowId = $(e.currentTarget).attr('data-stockrow-id'); var consumeAmount = $(e.currentTarget).attr('data-consume-amount'); - var wasSpoiled = $(e.currentTarget).hasClass("product-consume-button-spoiled"); + var wasSpoiled = $(e.currentTarget).hasClass("stock-consume-button-spoiled"); Grocy.Api.Post('stock/products/' + productId + '/consume', { 'amount': consumeAmount, 'spoiled': wasSpoiled, 'location_id': locationId, 'stock_entry_id': specificStockEntryId}, function(bookingResponse) diff --git a/views/stockdetail.blade.php b/views/stockdetail.blade.php index 344bbec4..53b6a146 100644 --- a/views/stockdetail.blade.php +++ b/views/stockdetail.blade.php @@ -127,10 +127,13 @@ {{ $__t('Edit product') }}
- {{ $__t('Consume %1$s of %2$s as spoiled', '1 ' . FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->qu_id_stock)->name, FindObjectInArrayByPropertyValue($products, 'id', $currentStockEntry->product_id)->name) }}