1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-12-22 15:32:22 +00:00

When an user is registering to the WEI, it doesn't pay the membership + the credit amount. The credit amount is deducted instead

This commit is contained in:
Yohann D'ANELLO 2020-08-10 19:59:01 +02:00
parent 999cc0a6b2
commit 6567d2f8cc
4 changed files with 19 additions and 17 deletions

View File

@ -160,7 +160,8 @@
<div class="alert alert-danger">
{% with pretty_fee=fee|pretty_money %}
{% blocktrans trimmed with balance=registration.user.note.balance|pretty_money %}
The note don't have enough money ({{ balance }}, {{ pretty_fee }} required). The registration may fail.
The note don't have enough money ({{ balance }}, {{ pretty_fee }} required).
The registration may fail if you don't credit the note now.
{% endblocktrans %}
{% endwith %}
</div>

View File

@ -855,7 +855,7 @@ class WEIValidateRegistrationView(ProtectQuerysetMixin, LoginRequiredMixin, Crea
form.add_error('bus', _("This user didn't give her/his caution check."))
return super().form_invalid(form)
if not registration.soge_credit and user.note.balance < fee + credit_amount:
if not registration.soge_credit and user.note.balance + credit_amount < fee:
# Users must have money before registering to the WEI.
form.add_error('bus',
_("This user don't have enough money to join this club, and can't have a negative balance."))

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-10 18:08+0200\n"
"POT-Creation-Date: 2020-08-10 19:56+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -1570,7 +1570,7 @@ msgstr ""
#: apps/registration/templates/registration/future_profile_detail.html:64
#: apps/wei/templates/wei/weimembership_form.html:140
#: apps/wei/templates/wei/weimembership_form.html:198
#: apps/wei/templates/wei/weimembership_form.html:199
msgid "Validate registration"
msgstr ""
@ -2441,21 +2441,21 @@ msgstr ""
#, python-format
msgid ""
"The note don't have enough money (%(balance)s, %(pretty_fee)s required). The "
"registration may fail."
"registration may fail if you don't credit the note now."
msgstr ""
#: apps/wei/templates/wei/weimembership_form.html:169
#: apps/wei/templates/wei/weimembership_form.html:170
#, python-format
msgid ""
"The note has enough money (%(pretty_fee)s required), the registration is "
"possible."
msgstr ""
#: apps/wei/templates/wei/weimembership_form.html:178
#: apps/wei/templates/wei/weimembership_form.html:179
msgid "The user didn't give her/his caution check."
msgstr ""
#: apps/wei/templates/wei/weimembership_form.html:186
#: apps/wei/templates/wei/weimembership_form.html:187
msgid ""
"This user is not a member of the Kfet club for the coming year. The "
"membership will be processed automatically, the WEI registration includes "

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-10 18:08+0200\n"
"POT-Creation-Date: 2020-08-10 19:56+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -1609,7 +1609,7 @@ msgstr "Valider le compte"
#: apps/registration/templates/registration/future_profile_detail.html:64
#: apps/wei/templates/wei/weimembership_form.html:140
#: apps/wei/templates/wei/weimembership_form.html:198
#: apps/wei/templates/wei/weimembership_form.html:199
msgid "Validate registration"
msgstr "Valider l'inscription"
@ -2528,12 +2528,12 @@ msgstr ""
#, python-format
msgid ""
"The note don't have enough money (%(balance)s, %(pretty_fee)s required). The "
"registration may fail."
"registration may fail if you don't credit the note now."
msgstr ""
"La note n'a pas assez d'argent (%(balance)s, %(pretty_fee)s requis). "
"L'inscription va échouer."
"L'inscription peut échouer si vous ne rechargez pas la note dès maintenant."
#: apps/wei/templates/wei/weimembership_form.html:169
#: apps/wei/templates/wei/weimembership_form.html:170
#, python-format
msgid ""
"The note has enough money (%(pretty_fee)s required), the registration is "
@ -2541,18 +2541,19 @@ msgid ""
msgstr ""
"La note a assez d'argent (%(pretty_fee) requis), l'inscription est possible."
#: apps/wei/templates/wei/weimembership_form.html:178
#: apps/wei/templates/wei/weimembership_form.html:179
msgid "The user didn't give her/his caution check."
msgstr "L'utilisateur n'a pas donné son chèque de caution."
#: apps/wei/templates/wei/weimembership_form.html:186
#: apps/wei/templates/wei/weimembership_form.html:187
msgid ""
"This user is not a member of the Kfet club for the coming year. The "
"membership will be processed automatically, the WEI registration includes "
"the membership fee."
msgstr ""
"Vous devrez également vous rendre à la Kfet pour payer votre adhésion pour "
"l'année à venir. L'inscription au WEI inclut l'adhésion au BDE."
"Cet utilisateur n'est pas membre du club Kfet pour l'année à venir. "
"L'adhésion va être faite automatiquement, l'inscription au WEI inclut le "
"coût d'adhésion."
#: apps/wei/templates/wei/weimembership_list.html:24
msgid "View unvalidated registrations..."