forked from DGNum/gestioCOF
Display in kfet js
This commit is contained in:
parent
affdf43e0b
commit
ac3bfbe368
2 changed files with 4 additions and 3 deletions
|
@ -661,7 +661,7 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
$after.after(article_html);
|
$after.after(article_html);
|
||||||
// Pour l'autocomplétion
|
// Pour l'autocomplétion
|
||||||
articlesList.push([article['name'],article['id'],article['category_id'],article['price'], article['stock'],article['category__has_addcost']]);
|
articlesList.push([article['name'],article['id'],article['category_id'],article['price'], article['stock'],article['category__has_addcost'],article['category__has_reduction']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getArticles() {
|
function getArticles() {
|
||||||
|
@ -851,7 +851,7 @@ $(document).ready(function() {
|
||||||
&& article_data[5])
|
&& article_data[5])
|
||||||
amount_euro -= settings['addcost_amount'] * nb;
|
amount_euro -= settings['addcost_amount'] * nb;
|
||||||
var reduc_divisor = 1;
|
var reduc_divisor = 1;
|
||||||
if (account_data['is_cof'])
|
if (account_data['is_cof'] && article_data[6])
|
||||||
reduc_divisor = 1 + settings['subvention_cof'] / 100;
|
reduc_divisor = 1 + settings['subvention_cof'] / 100;
|
||||||
return (amount_euro / reduc_divisor).toFixed(2);
|
return (amount_euro / reduc_divisor).toFixed(2);
|
||||||
}
|
}
|
||||||
|
@ -874,7 +874,7 @@ $(document).ready(function() {
|
||||||
.attr('data-opeindex', index)
|
.attr('data-opeindex', index)
|
||||||
.find('.number').text('('+nb+'/'+article_data[4]+')').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']), false);
|
.find('.amount').text(amountToUKF(amount_euro, account_data['is_cof'], false);
|
||||||
basket_container.prepend(article_basket_html);
|
basket_container.prepend(article_basket_html);
|
||||||
if (is_low_stock(id, nb))
|
if (is_low_stock(id, nb))
|
||||||
article_basket_html.find('.lowstock')
|
article_basket_html.find('.lowstock')
|
||||||
|
|
|
@ -1490,6 +1490,7 @@ def kpsul_articles_data(request):
|
||||||
"category_id",
|
"category_id",
|
||||||
"category__name",
|
"category__name",
|
||||||
"category__has_addcost",
|
"category__has_addcost",
|
||||||
|
"category__has_reduction",
|
||||||
).filter(is_sold=True)
|
).filter(is_sold=True)
|
||||||
return JsonResponse({"articles": list(articles)})
|
return JsonResponse({"articles": list(articles)})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue