forked from DGNum/gestioCOF
change stock warning CSS for basket
This commit is contained in:
parent
4db55efb67
commit
5784b4d20a
2 changed files with 15 additions and 7 deletions
|
@ -392,8 +392,10 @@ input[type=number]::-webkit-outer-spin-button {
|
||||||
text-align:right;
|
text-align:right;
|
||||||
}
|
}
|
||||||
|
|
||||||
#basket tr.low-stock {
|
#basket tr .lowstock {
|
||||||
background-color:rgba(236,100,0,0.3);
|
visibility:hidden;
|
||||||
|
width:20px;
|
||||||
|
padding-right:15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#basket tr.ui-selected, #basket tr.ui-selecting {
|
#basket tr.ui-selected, #basket tr.ui-selecting {
|
||||||
|
|
|
@ -767,7 +767,7 @@ $(document).ready(function() {
|
||||||
// Basket
|
// Basket
|
||||||
// -----
|
// -----
|
||||||
|
|
||||||
var item_basket_default_html = '<tr><td class="amount"></td><td class="number"></td><td class="name"></td></tr>';
|
var item_basket_default_html = '<tr><td class="amount"></td><td class="number"></td><td class="lowstock"><span class="glyphicon glyphicon-alert"></span></td><td class="name"></td></tr>';
|
||||||
var basket_container = $('#basket table');
|
var basket_container = $('#basket table');
|
||||||
var arrowKeys = /^(37|38|39|40)$/;
|
var arrowKeys = /^(37|38|39|40)$/;
|
||||||
|
|
||||||
|
@ -800,11 +800,12 @@ $(document).ready(function() {
|
||||||
article_basket_html = $(item_basket_default_html);
|
article_basket_html = $(item_basket_default_html);
|
||||||
article_basket_html
|
article_basket_html
|
||||||
.attr('data-opeindex', index)
|
.attr('data-opeindex', index)
|
||||||
.find('.number').text(nb).end()
|
.find('.number').text('('+nb+'/'+article_data[4]+')').end()
|
||||||
.find('.name').text(article_data[0]).end()
|
.find('.name').text(article_data[0]).end()
|
||||||
.find('.amount').text(amountToUKF(amount_euro, account_data['is_cof']));
|
.find('.amount').text(amountToUKF(amount_euro, account_data['is_cof']));
|
||||||
if (is_low_stock(id, nb))
|
if (is_low_stock(id, nb))
|
||||||
article_basket_html.addClass('low-stock');
|
article_basket_html.find('.lowstock')
|
||||||
|
.css('visibility', 'visible');
|
||||||
basket_container.prepend(article_basket_html);
|
basket_container.prepend(article_basket_html);
|
||||||
updateBasketRel();
|
updateBasketRel();
|
||||||
}
|
}
|
||||||
|
@ -946,10 +947,15 @@ $(document).ready(function() {
|
||||||
amountUKF_after = amountToUKF(amountEuro_after, account_data['is_cof']);
|
amountUKF_after = amountToUKF(amountEuro_after, account_data['is_cof']);
|
||||||
var article_html = basket_container.find('[data-opeindex='+opeindex+']');
|
var article_html = basket_container.find('[data-opeindex='+opeindex+']');
|
||||||
article_html.find('.amount').text(amountUKF_after).end()
|
article_html.find('.amount').text(amountUKF_after).end()
|
||||||
.find('.number').text(nb_after).end() ;
|
.find('.number').text(nb_after+'/'+article_data[4]).end() ;
|
||||||
|
|
||||||
if (is_low_stock(id, nb_after))
|
if (is_low_stock(id, nb_after))
|
||||||
article_html.addClass('low-stock');
|
article_html.find('.lowstock')
|
||||||
|
.css('visibility', 'visible');
|
||||||
|
else
|
||||||
|
article_html.find('.lowstock')
|
||||||
|
.css('visibility', 'hidden');
|
||||||
|
|
||||||
updateExistingFormset(opeindex, nb_after, amountEuro_after);
|
updateExistingFormset(opeindex, nb_after, amountEuro_after);
|
||||||
updateBasketRel();
|
updateBasketRel();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue