diff --git a/DjangoFiles/QrcodeCashless/templates/html5up-dimension/index.html b/DjangoFiles/QrcodeCashless/templates/html5up-dimension/index.html index 68f19d4..7d46ce2 100644 --- a/DjangoFiles/QrcodeCashless/templates/html5up-dimension/index.html +++ b/DjangoFiles/QrcodeCashless/templates/html5up-dimension/index.html @@ -294,8 +294,8 @@
@@ -399,7 +399,7 @@ {% for tarif in tarifs_adhesion %} document.getElementById('{{ tarif.name | slugify }}').onclick = function () { console.log('{{ tarif.name | slugify }}') - document.getElementById("montant_adhesion").value = "{{ tarif.prix }}"; + {#document.getElementById("montant_adhesion").value = "{{ tarif.prix }}";#} document.getElementById("pk_adhesion").value = "{{ tarif.pk }}"; document.getElementById("text_name_adhesion").textContent = "{{ tarif.name }}"; document.getElementById("text_tarif_adhesion").textContent = "{{ tarif.prix }}€"; diff --git a/DjangoFiles/QrcodeCashless/views.py b/DjangoFiles/QrcodeCashless/views.py index 73b676a..2031916 100644 --- a/DjangoFiles/QrcodeCashless/views.py +++ b/DjangoFiles/QrcodeCashless/views.py @@ -152,11 +152,12 @@ class index_scan(View): data = request.POST print(data) - montant_adhesion = data.get('montant_adhesion') + # montant_adhesion = data.get('montant_adhesion') + pk_adhesion = data.get('pk_adhesion') montant_recharge = data.get('montant_recharge') # c'est un paiement - if (montant_adhesion or montant_recharge) and data.get('email'): + if ( pk_adhesion or montant_recharge ) and data.get('email'): # montant_recharge = data.get('montant_recharge') ligne_articles = [] metadata = {} @@ -178,7 +179,7 @@ class index_scan(View): metadata['recharge_carte_montant'] = str(montant_recharge) - if montant_adhesion: + if pk_adhesion: art_adhesion = Article.objects.get(pk=data.get('pk_adhesion')) ligne_article_recharge = LigneArticle.objects.create( article=art_adhesion,