Fixed row highlighting after product actions on the stock overview page

This commit is contained in:
Bernd Bestel 2019-09-27 08:12:37 +02:00
parent 654d00dd67
commit cc2bf68f31
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
2 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,7 @@
### Stock improvements/fixes
- Fixed that barcode lookups now compare the whole barcode, not parts of it (e. g. when you have two products with the barcodes `$1` and `$10` and scan `$1` maybe the product of `$10` was found till now)
- Fixed that the "X products are already expired" count on the stock overview page was wrong
- Fixed that after product actions (consume/purchase/etc.) on the stock overview page the highlighting of the row was maybe wrong
- It's now possible to accumulate min. stock amounts on parent product level (new option per product, means the sub product will never be "missing" then, only the parent product)
- When adding a product to the shopping list from the new context/more menu from the stock overview page and if the product is already on the shopping list, the amount of that entry will be updated acccordingly instead of adding a new (double) shopping list item

View File

@ -313,7 +313,7 @@ function RefreshProductRow(productId)
function(result)
{
var productRow = $('#product-' + productId + '-row');
var expiringThreshold = moment().add("-" + $("#info-expiring-products").data("next-x-days"), "days");
var expiringThreshold = moment().add($("#info-expiring-products").data("next-x-days"), "days");
var now = moment();
var nextBestBeforeDate = moment(result.next_best_before_date);
@ -326,7 +326,7 @@ function RefreshProductRow(productId)
{
productRow.addClass("table-danger");
}
else if (nextBestBeforeDate.isAfter(expiringThreshold))
else if (nextBestBeforeDate.isBefore(expiringThreshold))
{
productRow.addClass("table-warning");
}