Rename bilan to statement

This commit is contained in:
Skia 2016-12-21 05:18:02 +01:00
parent bdcc0bf6e9
commit e6e4929eff
5 changed files with 39 additions and 39 deletions

View File

@ -6,7 +6,7 @@
{% block content %} {% block content %}
<h3>{% trans %}Accounting bilan: {% endtrans %} {{ object.name }}</h3> <h3>{% trans %}Accounting statement: {% endtrans %} {{ object.name }}</h3>
<table> <table>
<thead> <thead>
@ -16,7 +16,7 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for k,v in bilan.items() %} {% for k,v in statement.items() %}
<tr> <tr>
<td>{{ k }}</td> <td>{{ k }}</td>
<td>{{ v }}</td> <td>{{ v }}</td>

View File

@ -5,7 +5,7 @@
{% endblock %} {% endblock %}
{% macro display_tables(dict) %} {% macro display_tables(dict) %}
<h4>{% trans %}Credit{% endtrans %}</h4> <h5>{% trans %}Credit{% endtrans %}</h5>
<table> <table>
<thead> <thead>
<tr> <tr>
@ -24,7 +24,7 @@
</table> </table>
{% trans %}Total: {% endtrans %}{{ dict['CREDIT_sum'] }} {% trans %}Total: {% endtrans %}{{ dict['CREDIT_sum'] }}
<h4>{% trans %}Debit{% endtrans %}</h4> <h5>{% trans %}Debit{% endtrans %}</h5>
<table> <table>
<thead> <thead>
<tr> <tr>
@ -45,10 +45,10 @@
{% endmacro %} {% endmacro %}
{% block content %} {% block content %}
<h2>{% trans %}Statement by nature: {% endtrans %} {{ object.name }}</h2> <h3>{% trans %}Statement by nature: {% endtrans %} {{ object.name }}</h3>
{% for k,v in statement.items() %} {% for k,v in statement.items() %}
<h3>{{ k }}</h3> <h4>{{ k }}</h4>
{{ display_tables(v) }} {{ display_tables(v) }}
<hr> <hr>
{% endfor %} {% endfor %}

View File

@ -6,9 +6,9 @@
{% block content %} {% block content %}
<h2>{% trans %}Person bilan: {% endtrans %} {{ object.name }}</h2> <h3>{% trans %}Statement by person: {% endtrans %} {{ object.name }}</h3>
<h3>{% trans %}Credit{% endtrans %}</h3> <h4>{% trans %}Credit{% endtrans %}</h4>
<table> <table>
<thead> <thead>
@ -18,14 +18,14 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for key in bilan_credit.keys() %} {% for key in credit_statement.keys() %}
<tr> <tr>
{% if key.target_type == "OTHER" %} {% if key.target_type == "OTHER" %}
<td>{{ o.target_label }}</td> <td>{{ o.target_label }}</td>
{% else %} {% else %}
<td><a href="{{ key.get_absolute_url() }}">{{ key.get_display_name() }}</a></td> <td><a href="{{ key.get_absolute_url() }}">{{ key.get_display_name() }}</a></td>
{% endif %} {% endif %}
<td>{{bilan_credit[key]}}</td> <td>{{credit_statement[key]}}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
@ -34,8 +34,8 @@
<p>Total : {{total_credit}}</p> <p>Total : {{total_credit}}</p>
<h3>{% trans %}Debit{% endtrans %}</h3> <h4>{% trans %}Debit{% endtrans %}</h4>
<table> <table>
<thead> <thead>
<tr> <tr>
@ -44,14 +44,14 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for key in bilan_debit.keys() %} {% for key in debit_statement.keys() %}
<tr> <tr>
{% if key.target_type == "OTHER" %} {% if key.target_type == "OTHER" %}
<td>{{ o.target_label }}</td> <td>{{ o.target_label }}</td>
{% else %} {% else %}
<td><a href="{{ key.get_absolute_url() }}">{{ key.get_display_name() }}</a></td> <td><a href="{{ key.get_absolute_url() }}">{{ key.get_display_name() }}</a></td>
{% endif %} {% endif %}
<td>{{bilan_debit[key]}}</td> <td>{{debit_statement[key]}}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
@ -60,4 +60,4 @@
<p>Total : {{total_debit}}</p> <p>Total : {{total_debit}}</p>
{% endblock %} {% endblock %}

View File

@ -26,9 +26,9 @@ urlpatterns = [
url(r'^journal/create$', JournalCreateView.as_view(), name='journal_new'), url(r'^journal/create$', JournalCreateView.as_view(), name='journal_new'),
url(r'^journal/(?P<j_id>[0-9]+)$', JournalDetailView.as_view(), name='journal_details'), url(r'^journal/(?P<j_id>[0-9]+)$', JournalDetailView.as_view(), name='journal_details'),
url(r'^journal/(?P<j_id>[0-9]+)/edit$', JournalEditView.as_view(), name='journal_edit'), url(r'^journal/(?P<j_id>[0-9]+)/edit$', JournalEditView.as_view(), name='journal_edit'),
url(r'^journal/(?P<j_id>[0-9]+)/bilan/nature$', JournalBilanNatureView.as_view(), name='journal_bilan_nature'), url(r'^journal/(?P<j_id>[0-9]+)/statement/nature$', JournalNatureStatementView.as_view(), name='journal_nature_statement'),
url(r'^journal/(?P<j_id>[0-9]+)/bilan/person$', JournalBilanPersonView.as_view(), name='journal_bilan_person'), url(r'^journal/(?P<j_id>[0-9]+)/statement/person$', JournalPersonStatementView.as_view(), name='journal_person_statement'),
url(r'^journal/(?P<j_id>[0-9]+)/bilan/accounting$', JournalBilanAccountingView.as_view(), name='journal_bilan_accounting'), url(r'^journal/(?P<j_id>[0-9]+)/statement/accounting$', JournalAccountingStatementView.as_view(), name='journal_accounting_statement'),
# Operations # Operations
url(r'^operation/create/(?P<j_id>[0-9]+)$', OperationCreateView.as_view(), name='op_new'), url(r'^operation/create/(?P<j_id>[0-9]+)$', OperationCreateView.as_view(), name='op_new'),

View File

@ -179,19 +179,19 @@ class JournalTabsMixin(TabedViewMixin):
'name': _("Journal"), 'name': _("Journal"),
}) })
tab_list.append({ tab_list.append({
'url': reverse('accounting:journal_bilan_nature', kwargs={'j_id': self.object.id}), 'url': reverse('accounting:journal_nature_statement', kwargs={'j_id': self.object.id}),
'slug': 'bilan_nature', 'slug': 'nature_statement',
'name': _("Bilan nature"), 'name': _("Statement by nature"),
}) })
tab_list.append({ tab_list.append({
'url': reverse('accounting:journal_bilan_person', kwargs={'j_id': self.object.id}), 'url': reverse('accounting:journal_person_statement', kwargs={'j_id': self.object.id}),
'slug': 'bilan_person', 'slug': 'person_statement',
'name': _("Bilan person"), 'name': _("Statement by person"),
}) })
tab_list.append({ tab_list.append({
'url': reverse('accounting:journal_bilan_accounting', kwargs={'j_id': self.object.id}), 'url': reverse('accounting:journal_accounting_statement', kwargs={'j_id': self.object.id}),
'slug': 'bilan_accounting', 'slug': 'accounting_statement',
'name': _("Bilan accounting"), 'name': _("Accounting statement"),
}) })
return tab_list return tab_list
@ -470,14 +470,14 @@ class OperationPDFView(CanViewMixin, DetailView):
p.save() p.save()
return response return response
class JournalBilanNatureView(JournalTabsMixin, CanViewMixin, DetailView): class JournalNatureStatementView(JournalTabsMixin, CanViewMixin, DetailView):
""" """
Display a statement sorted by labels Display a statement sorted by labels
""" """
model = GeneralJournal model = GeneralJournal
pk_url_kwarg = "j_id" pk_url_kwarg = "j_id"
template_name='accounting/journal_bilan_nature.jinja' template_name='accounting/journal_statement_nature.jinja'
current_tab='bilan_nature' current_tab='nature_statement'
def statement(self, queryset, movement_type): def statement(self, queryset, movement_type):
ret = collections.OrderedDict() ret = collections.OrderedDict()
@ -514,18 +514,18 @@ class JournalBilanNatureView(JournalTabsMixin, CanViewMixin, DetailView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
""" Add infos to the context """ """ Add infos to the context """
kwargs = super(JournalBilanNatureView, self).get_context_data(**kwargs) kwargs = super(JournalNatureStatementView, self).get_context_data(**kwargs)
kwargs['statement'] = self.big_statement() kwargs['statement'] = self.big_statement()
return kwargs return kwargs
class JournalBilanPersonView(JournalTabsMixin, CanViewMixin, DetailView): class JournalPersonStatementView(JournalTabsMixin, CanViewMixin, DetailView):
""" """
Calculate a dictionary with operation target and sum of operations Calculate a dictionary with operation target and sum of operations
""" """
model = GeneralJournal model = GeneralJournal
pk_url_kwarg = "j_id" pk_url_kwarg = "j_id"
template_name='accounting/journal_bilan_person.jinja' template_name='accounting/journal_statement_person.jinja'
current_tab='bilan_person' current_tab='person_statement'
def sum_by_target(self, target_id): def sum_by_target(self, target_id):
from decimal import Decimal from decimal import Decimal
@ -553,21 +553,21 @@ class JournalBilanPersonView(JournalTabsMixin, CanViewMixin, DetailView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
""" Add journal to the context """ """ Add journal to the context """
kwargs = super(JournalBilanPersonView, self).get_context_data(**kwargs) kwargs = super(JournalPersonStatementView, self).get_context_data(**kwargs)
kwargs['credit_statement'] = self.credit_statement() kwargs['credit_statement'] = self.credit_statement()
kwargs['debit_statement'] = self.debit_statement() kwargs['debit_statement'] = self.debit_statement()
kwargs['total_credit'] = self.total_credit() kwargs['total_credit'] = self.total_credit()
kwargs['total_debit'] = self.total_debit() kwargs['total_debit'] = self.total_debit()
return kwargs return kwargs
class JournalBilanAccountingView(JournalTabsMixin, CanViewMixin, DetailView): class JournalAccountingStatementView(JournalTabsMixin, CanViewMixin, DetailView):
""" """
Calculate a dictionary with operation type and sum of operations Calculate a dictionary with operation type and sum of operations
""" """
model = GeneralJournal model = GeneralJournal
pk_url_kwarg = "j_id" pk_url_kwarg = "j_id"
template_name='accounting/journal_bilan_accounting.jinja' template_name='accounting/journal_statement_accounting.jinja'
current_tab = "bilan_accounting" current_tab = "accounting_statement"
def statement(self): def statement(self):
statement = collections.OrderedDict() statement = collections.OrderedDict()
@ -580,7 +580,7 @@ class JournalBilanAccountingView(JournalTabsMixin, CanViewMixin, DetailView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
""" Add journal to the context """ """ Add journal to the context """
kwargs = super(JournalBilanAccountingView, self).get_context_data(**kwargs) kwargs = super(JournalAccountingStatementView, self).get_context_data(**kwargs)
kwargs['statement'] = self.statement() kwargs['statement'] = self.statement()
return kwargs return kwargs