diff --git a/kfet/templates/kfet/kpsul.html b/kfet/templates/kfet/kpsul.html
index ff24fcb4..c520aa30 100644
--- a/kfet/templates/kfet/kpsul.html
+++ b/kfet/templates/kfet/kpsul.html
@@ -661,7 +661,7 @@ $(document).ready(function() {
});
$after.after(article_html);
// 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() {
@@ -851,7 +851,7 @@ $(document).ready(function() {
&& article_data[5])
amount_euro -= settings['addcost_amount'] * nb;
var reduc_divisor = 1;
- if (account_data['is_cof'])
+ if (account_data['is_cof'] && article_data[6])
reduc_divisor = 1 + settings['subvention_cof'] / 100;
return (amount_euro / reduc_divisor).toFixed(2);
}
@@ -874,7 +874,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']), false);
+ .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')
diff --git a/kfet/views.py b/kfet/views.py
index 7ae1de82..ef124c92 100644
--- a/kfet/views.py
+++ b/kfet/views.py
@@ -1490,6 +1490,7 @@ def kpsul_articles_data(request):
"category_id",
"category__name",
"category__has_addcost",
+ "category__has_reduction",
).filter(is_sold=True)
return JsonResponse({"articles": list(articles)})