mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-11 12:29:24 +00:00
Make sellings for clubs
This commit is contained in:
@ -1,65 +0,0 @@
|
||||
{% extends "core/base.jinja" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="tool-bar">
|
||||
<div>{{ club.name }}</div>
|
||||
<div class="tools">
|
||||
<a href="{{ url('club:club_view', club_id=club.id) }}"
|
||||
{%- if tab == "infos" -%}
|
||||
class="selected_tab"
|
||||
{%- endif -%}
|
||||
>{% trans %}Infos{% endtrans %}</a>
|
||||
|
||||
{% if can_view(club, user) %}
|
||||
<a href="{{ url('club:club_members', club_id=club.pk) }}"
|
||||
{%- if tab == "members" -%}
|
||||
class="selected_tab"
|
||||
{%- endif -%}
|
||||
>{% trans %}Members{% endtrans %}</a>
|
||||
{% endif %}
|
||||
|
||||
{% if can_view(club, user) %}
|
||||
<a href="{{ url('club:club_old_members', club_id=club.pk) }}"
|
||||
{%- if tab == "elderlies" -%}
|
||||
class="selected_tab"
|
||||
{%- endif -%}
|
||||
>{% trans %}Old members{% endtrans %}</a>
|
||||
{% endif %}
|
||||
|
||||
{% if can_view(club, user) %}
|
||||
<a href="{{ url('club:tools', club_id=club.id) }}"
|
||||
{%- if tab == "tools" -%}
|
||||
class="selected_tab"
|
||||
{%- endif -%}
|
||||
>{% trans %}Tools{% endtrans %}</a>
|
||||
{% endif %}
|
||||
|
||||
{% if can_edit(club, request.user) %}
|
||||
<a href="{{ url('club:club_edit', club_id=club.id) }}"
|
||||
{%- if tab == "edit" -%}
|
||||
class="selected_tab"
|
||||
{%- endif -%}
|
||||
>{% trans %}Edit{% endtrans %}</a>
|
||||
{% endif %}
|
||||
|
||||
{% if can_edit_prop(club, request.user) %}
|
||||
<a href="{{ url('club:club_prop', club_id=club.id) }}"
|
||||
{%- if tab == "props" -%}
|
||||
class="selected_tab"
|
||||
{%- endif -%}
|
||||
>{% trans %}Props{% endtrans %}</a>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{% block club %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
<td>{% trans %}To{% endtrans %}</td>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for m in club.members.exclude(end_date=None).order_by('-role', '-end_date').all() %}
|
||||
{% for m in club.members.exclude(end_date=None).order_by('-role', 'description', '-end_date').all() %}
|
||||
<tr>
|
||||
<td>{{ user_profile_link(m.user) }}</td>
|
||||
<td>{{ settings.SITH_CLUB_ROLES[m.role] }}</td>
|
||||
|
46
club/templates/club/club_sellings.jinja
Normal file
46
club/templates/club/club_sellings.jinja
Normal file
@ -0,0 +1,46 @@
|
||||
{% extends "core/base.jinja" %}
|
||||
{% from 'core/macros.jinja' import user_profile_link %}
|
||||
|
||||
{% block content %}
|
||||
<h3>{% trans %}Sellings{% endtrans %}</h3>
|
||||
<form action="" method="get">
|
||||
{% csrf_token %}
|
||||
{{ form }}
|
||||
<p><input type="submit" value="{% trans %}Show{% endtrans %}" /></p>
|
||||
</form>
|
||||
<p>
|
||||
{% trans %}Quantity: {% endtrans %}{{ result.count() }} {% trans %}units{% endtrans %}<br/>
|
||||
{% trans %}Total: {% endtrans %}{{ total }} €
|
||||
</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td>{% trans %}Date{% endtrans %}</td>
|
||||
<td>{% trans %}Counter{% endtrans %}</td>
|
||||
<td>{% trans %}Barman{% endtrans %}</td>
|
||||
<td>{% trans %}Customer{% endtrans %}</td>
|
||||
<td>{% trans %}Label{% endtrans %}</td>
|
||||
<td>{% trans %}Quantity{% endtrans %}</td>
|
||||
<td>{% trans %}Total{% endtrans %}</td>
|
||||
<td>{% trans %}Payment method{% endtrans %}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for s in result %}
|
||||
<tr>
|
||||
<td>{{ s.date|localtime|date(DATETIME_FORMAT) }} {{ s.date|localtime|time(DATETIME_FORMAT) }}</td>
|
||||
<td>{{ s.counter }}</td>
|
||||
<td><a href="{{ s.seller.get_absolute_url() }}">{{ s.seller.get_display_name() }}</a></td>
|
||||
<td><a href="{{ s.customer.user.get_absolute_url() }}">{{ s.customer.user.get_display_name() }}</a></td>
|
||||
<td>{{ s.label }}</td>
|
||||
<td>{{ s.quantity }}</td>
|
||||
<td>{{ s.quantity * s.unit_price }} €</td>
|
||||
<td>{{ s.get_payment_method_display() }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user