mirror of
https://github.com/grocy/grocy.git
synced 2025-08-16 18:54:35 +00:00
Fixed display errors when consuming partial amounts from stock overview page (fixes #170)
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
Reference in New Issue
Block a user