kfet.kpsul -- Make the low-stock indicator appear…

…if ordered quantity is greater than the current stock.

Also fix the focus after a reset of the selected account.
This commit is contained in:
Aurélien Delobelle 2018-01-13 02:04:42 +01:00
parent 367b5899fc
commit 5aa2d3cbac
2 changed files with 3 additions and 4 deletions

View file

@ -2070,7 +2070,7 @@ class PurchaseBasketFormatter extends ItemBasketFormatter {
static attr_low_stock(o) {
let stock = o.article.stock;
return -5 <= stock && stock <= 5;
return (-5 <= stock) && (stock <= 5 || stock < o.article_nb);
}
}

View file

@ -399,9 +399,8 @@ $(document).ready(function() {
case 113:
if (e.shiftKey) {
// Shift+F2 - Account reset
kpsul.account_manager
.reset()
.focus();
kpsul.account_manager.reset();
kpsul.account_manager.focus();
} else {
// F2 - Basket reset
kpsul.basket.reset();