diff --git a/public/viewjs/stockoverview.js b/public/viewjs/stockoverview.js index 48a9e50a..d9a3a946 100644 --- a/public/viewjs/stockoverview.js +++ b/public/viewjs/stockoverview.js @@ -115,9 +115,9 @@ $(document).on('click', '.product-consume-button', function(e) productRow.addClass("table-warning"); } - var oldAmount = parseInt($('#product-' + productId + '-amount').text()); + var oldAmount = parseFloat($('#product-' + productId + '-amount').text()); var newAmount = oldAmount - consumeAmount; - if (newAmount === 0) + if (newAmount <= 0) // When "consume all" of an amount < 1, the resulting amount here will be < 0, but the API newer books > current stock amount { $('#product-' + productId + '-row').fadeOut(500, function() { diff --git a/views/stockoverview.blade.php b/views/stockoverview.blade.php index bfb892f6..8a8a09b5 100644 --- a/views/stockoverview.blade.php +++ b/views/stockoverview.blade.php @@ -83,7 +83,7 @@ @foreach($currentStock as $currentStockEntry) amount > 0) table-warning @elseif (FindObjectInArrayByPropertyValue($missingProducts, 'id', $currentStockEntry->product_id) !== null) table-info @endif"> - {{ $L('All') }} -