frontend working
This commit is contained in:
parent
d0938dfae7
commit
fcc2ab8810
|
@ -646,7 +646,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']]);
|
articlesList.push([article['name'],article['id'],article['category_id'],article['price'], article['stock'],article['category__has_addcost']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getArticles() {
|
function getArticles() {
|
||||||
|
@ -830,7 +830,10 @@ $(document).ready(function() {
|
||||||
while (i<articlesList.length && id != articlesList[i][1]) i++;
|
while (i<articlesList.length && id != articlesList[i][1]) i++;
|
||||||
article_data = articlesList[i];
|
article_data = articlesList[i];
|
||||||
var amount_euro = - article_data[3] * nb ;
|
var amount_euro = - article_data[3] * nb ;
|
||||||
if (settings['addcost_for'] && settings['addcost_amount'] && account_data['trigramme'] != settings['addcost_for'])
|
if (settings['addcost_for']
|
||||||
|
&& settings['addcost_amount']
|
||||||
|
&& account_data['trigramme'] != settings['addcost_for']
|
||||||
|
&& 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'])
|
||||||
|
|
|
@ -1393,7 +1393,8 @@ def history_json(request):
|
||||||
def kpsul_articles_data(request):
|
def kpsul_articles_data(request):
|
||||||
articles = (
|
articles = (
|
||||||
Article.objects
|
Article.objects
|
||||||
.values('id', 'name', 'price', 'stock', 'category_id', 'category__name')
|
.values('id', 'name', 'price', 'stock', 'category_id',
|
||||||
|
'category__name', 'category__has_addcost')
|
||||||
.filter(is_sold=True))
|
.filter(is_sold=True))
|
||||||
return JsonResponse({ 'articles': list(articles) })
|
return JsonResponse({ 'articles': list(articles) })
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue