Commit 724f3d8d authored by Skia's avatar Skia

Templates and views

parent 28aa143f
Pipeline #61 failed with stage
in 1 minute and 13 seconds
......@@ -5,7 +5,12 @@
<a href="{{ url('accounting:bank_list') }}">{% trans %}Accounting{% endtrans %}</a> >
{{ object.name }}
</p>
<h2>{% trans %}View account{% endtrans %}</h2>
<h2>{% trans %}Bank account: {% endtrans %}{{ object.name }}</h2>
<h4>{% trans %}Infos{% endtrans %}</h4>
<ul>
<li><strong>{% trans %}IBAN: {% endtrans %}</strong>{{ object.iban }}</li>
<li><strong>{% trans %}Number: {% endtrans %}</strong>{{ object.number }}</li>
</ul>
<p><a href="{{ url('accounting:club_new') }}?parent={{ object.id }}">{% trans %}New club account{% endtrans %}</a></p>
<ul>
{% for c in object.club_accounts.all() %}
......
......@@ -5,12 +5,7 @@
<a href="{{ url('accounting:bank_list') }}">{% trans %}Accounting{% endtrans %}</a> >
<a href="{{ url('accounting:bank_details', b_account_id=object.bank_account.id) }}">{{object.bank_account }}</a> >
{{ object }}
<h2>{% trans %}View account:{% endtrans %} {{ object.name }}</h2>
<ul>
{% for k,v in object.__dict__.items() %}
<li>{{ k }} - {{ v }}</li>
{% endfor %}
</ul>
<h2>{% trans %}Club account:{% endtrans %} {{ object.name }}</h2>
{% if not object.has_open_journal() %}
<p><a href="{{ url('accounting:journal_new') }}?parent={{ object.id }}">{% trans %}New journal{% endtrans %}</a></p>
{% else %}
......
......@@ -65,7 +65,7 @@ class BankAccountCreateView(CanCreateMixin, CreateView):
Create a bank account (for the admins)
"""
model = BankAccount
fields = ['name', 'iban', 'number']
fields = ['name', 'club', 'iban', 'number']
template_name = 'core/create.jinja'
class BankAccountDeleteView(CanEditPropMixin, DeleteView): # TODO change Delete to Close
......@@ -163,9 +163,8 @@ class OperationCreateView(CanCreateMixin, CreateView):
Create an operation
"""
model = Operation
# fields = ['type', 'amount', 'label', 'remark', 'journal', 'date', 'cheque_number', 'accounting_type', 'done']
form_class = modelform_factory(Operation,
fields=['amount', 'label', 'remark', 'journal', 'date', 'cheque_number', 'accounting_type', 'done'],
fields=['amount', 'label', 'remark', 'journal', 'date', 'mode', 'cheque_number', 'accounting_type', 'done'],
widgets={'journal': HiddenInput})
template_name = 'core/create.jinja'
......@@ -183,6 +182,6 @@ class OperationEditView(CanEditMixin, UpdateView):
"""
model = Operation
pk_url_kwarg = "op_id"
fields = ['amount', 'label', 'remark', 'date', 'cheque_number', 'accounting_type', 'done']
fields = ['amount', 'label', 'remark', 'date', 'mode', 'cheque_number', 'accounting_type', 'done']
template_name = 'core/edit.jinja'
......@@ -7,6 +7,7 @@
{% block content %}
<h3>{% trans %}User Tools{% endtrans %}</h3>
<hr>
<h4>{% trans %}Sith management{% endtrans %}</h4>
<ul>
{% if user.is_in_group(settings.SITH_GROUPS['root']['name']) %}
......@@ -23,6 +24,7 @@
{% endif %}
</ul>
<hr>
<h4>{% trans %}Counters{% endtrans %}</h4>
<ul>
{% for b in settings.SITH_COUNTER_BARS %}
......@@ -33,7 +35,23 @@
{% endfor %}
</ul>
<h4>{% trans %}Clubs{% endtrans %}</h4>
<hr>
<h4>{% trans %}Accounting{% endtrans %}</h4>
<ul>
{% for m in user.membership.filter(end_date=None).filter(role__gte=7).all() %}
{% for b in m.club.bank_accounts.all() %}
<li><strong>{% trans %}Bank account: {% endtrans %}</strong>
<a href="{{ url('accounting:bank_details', b_account_id=b.id) }}">{{ b.club }}</a></li>
{% endfor %}
{% if m.club.club_account %}
<li><strong>{% trans %}Club account: {% endtrans %}</strong>
<a href="{{ url('accounting:club_details', c_account_id=m.club.club_account.id) }}">{{ m.club.club_account }}</a></li>
{% endif %}
{% endfor %}
</ul>
<hr>
<h4>{% trans %}Club tools{% endtrans %}</h4>
<ul>
{% for m in user.membership.filter(end_date=None).all() %}
<li><a href="{{ url('club:tools', club_id=m.club.id) }}">{{ m.club }}</a></li>
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment