Templates and views

This commit is contained in:
Skia
2016-07-21 12:09:57 +02:00
parent 28aa143f39
commit 724f3d8d6f
6 changed files with 159 additions and 105 deletions

View File

@@ -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() %}

View File

@@ -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 %}

View File

@@ -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'