Merge branch 'k-fet' of git.eleves.ens.fr:cof-geek/gestioCOF into Aufinal/visibilite_stock

This commit is contained in:
Ludovic Stephan 2017-02-13 10:51:24 -02:00
commit 43aab26530
4 changed files with 13 additions and 12 deletions

View file

@ -222,7 +222,7 @@ $(document).ready(function() {
function displayAccountData() {
var balance = account_data['trigramme'] != 'LIQ' ? account_data['balance'] : '';
if (balance != '')
balance = amountToUKF(account_data['balance'], account_data['is_cof']);
balance = amountToUKF(account_data['balance'], account_data['is_cof'], true);
var is_cof = account_data['trigramme'] ? account_data['is_cof'] : '';
if (is_cof !== '')
is_cof = is_cof ? '<b>COF</b>' : '<b>Non-COF</b>';
@ -620,7 +620,7 @@ $(document).ready(function() {
if (-5 <= article['stock'] && article['stock'] <= 5) {
article_html.addClass('low-stock');
}
article_html.find('.price').text(amountToUKF(article['price'], false)+' UKF');
article_html.find('.price').text(amountToUKF(article['price'], false, false)+' UKF');
var category_html = articles_container
.find('#data-category-'+article['category_id']);
if (category_html.length == 0) {
@ -856,7 +856,7 @@ $(document).ready(function() {
.attr('data-opeindex', index)
.find('.number').text('('+nb+'/'+article_data[4]+')').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']), false);
basket_container.prepend(article_basket_html);
if (is_low_stock(id, nb))
article_basket_html.find('.lowstock')
@ -883,7 +883,7 @@ $(document).ready(function() {
.attr('data-opeindex', index)
.find('.number').text(amount+"€").end()
.find('.name').text(text).end()
.find('.amount').text(amountToUKF(amount, account_data['is_cof']));
.find('.amount').text(amountToUKF(amount, account_data['is_cof'], false));
basket_container.prepend(deposit_basket_html);
updateBasketRel();
}
@ -896,7 +896,7 @@ $(document).ready(function() {
.attr('data-opeindex', index)
.find('.number').text(amount+"€").end()
.find('.name').text('Retrait').end()
.find('.amount').text(amountToUKF(amount, account_data['is_cof']));
.find('.amount').text(amountToUKF(amount, account_data['is_cof'], false));
basket_container.prepend(withdraw_basket_html);
updateBasketRel();
}
@ -952,7 +952,7 @@ $(document).ready(function() {
var amount = $(this).find('#id_form-'+opeindex+'-amount');
if (!deleted && type == "purchase")
amount.val(amountEuroPurchase(article_id, article_nb));
basket_container.find('[data-opeindex='+opeindex+'] .amount').text(amountToUKF(amount.val(), account_data['is_cof']));
basket_container.find('[data-opeindex='+opeindex+'] .amount').text(amountToUKF(amount.val(), account_data['is_cof'], false));
});
}
@ -971,9 +971,9 @@ $(document).ready(function() {
basketrel_html += '<div>Sur 20€: '+ (20-amount).toFixed(2) +' €</div>';
} else if (account_data['trigramme'] != '' && !isBasketEmpty()) {
var amount = getAmountBasket();
var amountUKF = amountToUKF(amount, account_data['is_cof']);
var amountUKF = amountToUKF(amount, account_data['is_cof'], false);
var newBalance = account_data['balance'] + amount;
var newBalanceUKF = amountToUKF(newBalance, account_data['is_cof']);
var newBalanceUKF = amountToUKF(newBalance, account_data['is_cof'], true);
basketrel_html += '<div>Total: '+amountUKF+'</div>';
basketrel_html += '<div>Nouveau solde: '+newBalanceUKF+'</div>';
if (newBalance < 0)