Add support for subscription typed products in eboutic

This commit is contained in:
Skia
2016-08-29 03:02:13 +02:00
parent dfb13c37f2
commit 325da79e45
9 changed files with 175 additions and 133 deletions

View File

@ -55,6 +55,7 @@ class Command(BaseCommand):
unix_name=settings.SITH_LAUNDERETTE_MANAGER['unix_name'],
address=settings.SITH_LAUNDERETTE_MANAGER['address'])
launderette_club.save()
self.reset_index("club")
for b in settings.SITH_COUNTER_BARS:
g = Group(name=b[1]+" admin")
g.save()
@ -271,10 +272,10 @@ Cette page vise à documenter la syntaxe *Markdown* utilisée sur le site.
credit.save()
debit = AccountingType(code=607, label="Had to pay a beer", movement_type='debit')
debit.save()
Operation(journal=gj, date=date.today(), amount=666.42, label="Satanic answer",
Operation(journal=gj, date=date.today(), amount=666.42,
remark="An answer to life...", mode="CASH", done=True, accounting_type=credit, target_type="USER",
target_id=skia.id).save()
Operation(journal=gj, date=date.today(), amount=42, label="Answer",
Operation(journal=gj, date=date.today(), amount=42,
remark="An answer to life...", mode="CASH", done=False, accounting_type=debit, target_type="CLUB",
target_id=bar_club.id).save()
woenzco = Company(name="Woenzel & co")

View File

@ -41,13 +41,13 @@
</div>
</div>
{% if user.membership.filter(end_date=None).exists() or user.is_in_group(settings.SITH_MAIN_BOARD_GROUP) %}
{% if user.membership.filter(end_date=None).exists() or user.is_in_group(settings.SITH_MAIN_BOARD_GROUP) or user == profile %}
{# if the user is member of a club, he can view the subscription state #}
<p>
{% if get_subscriber(profile).is_subscribed() %}
{% trans subscription_end=get_subscriber(profile).subscriptions.last().subscription_end %}User is subscriber until {{ subscription_end }}{% endtrans %}
{% trans subscription_end=get_subscriber(profile).subscriptions.last().subscription_end %}Subscribed until {{ subscription_end }}{% endtrans %}
{% else %}
{% trans %}User is not subscribed. {% endtrans %}
{% trans %}Not subscribed{% endtrans %}
<a href="{{ url('subscription:subscription') }}?member={{ profile.id }}">{% trans %}New subscription{% endtrans %}</a>
{% endif %}
</p>