From bca301700d0825d4462b8f084382bfc3afa7269b Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Tue, 25 Aug 2020 18:10:21 +0200 Subject: [PATCH] Cards for all treasury --- .../treasury/invoice_confirm_delete.html | 2 +- .../templates/treasury/invoice_form.html | 118 ++++++++-------- .../templates/treasury/invoice_list.html | 47 ++++--- .../templates/treasury/remittance_form.html | 52 ++++--- .../templates/treasury/remittance_list.html | 85 +++++++----- .../templates/treasury/sogecredit_detail.html | 128 +++++++++--------- .../templates/treasury/sogecredit_list.html | 66 +++++---- .../specialtransactionproxy_form.html | 22 ++- 8 files changed, 298 insertions(+), 222 deletions(-) diff --git a/apps/treasury/templates/treasury/invoice_confirm_delete.html b/apps/treasury/templates/treasury/invoice_confirm_delete.html index 1de30e0f..2ab0b954 100644 --- a/apps/treasury/templates/treasury/invoice_confirm_delete.html +++ b/apps/treasury/templates/treasury/invoice_confirm_delete.html @@ -3,7 +3,7 @@ {% load crispy_forms_tags %} {% block content %} -
+

{% trans "Delete invoice" %}

diff --git a/apps/treasury/templates/treasury/invoice_form.html b/apps/treasury/templates/treasury/invoice_form.html index 7ebcdb26..29481216 100644 --- a/apps/treasury/templates/treasury/invoice_form.html +++ b/apps/treasury/templates/treasury/invoice_form.html @@ -1,44 +1,55 @@ {% extends "base.html" %} -{% load static %} -{% load i18n %} -{% load crispy_forms_tags %} -{% block content %} -

{% trans "Invoices list" %}

+{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} +{% load i18n crispy_forms_tags %} +{% block contenttitle %}{% endblock %} - {% if object.pk and not object.locked %} +{% block content %} +
+

+ {{ title }} +

+
+ {% if object.pk and not object.locked %}
{% blocktrans trimmed %} - Warning: the LaTeX template is saved with this object. Updating the invoice implies regenerate it. - Be careful if you manipulate old invoices. + Warning: the LaTeX template is saved with this object. Updating the invoice implies regenerate it. + Be careful if you manipulate old invoices. {% endblocktrans %}
- {% elif object.locked %} + {% elif object.locked %}
{% blocktrans trimmed %} - This invoice is locked and can no longer be edited. + This invoice is locked and can no longer be edited. {% endblocktrans %}
- {% endif %} + {% endif %} +
{% csrf_token %} + {# Render the invoice form #} - {% crispy form %} +
+ {% crispy form %} +
+ {# The next part concerns the product formset #} {# Generate some hidden fields that manage the number of products, and make easier the parsing #} {{ formset.management_form }} {# Fill initial data #} {% for form in formset %} - {% if forloop.first %} - - - - - - - - + {% if forloop.first %} + + + + + + + + {% endif %} @@ -48,27 +59,28 @@ {{ form.invoice }} {{ form.id }} - {% endfor %} + {% endfor %}
{{ form.designation.label }}*{{ form.quantity.label }}*{{ form.amount.label }}*
{{ form.designation.label }}*{{ form.quantity.label }}*{{ form.amount.label }}*
{{ form.designation }}
{# Display buttons to add and remove products #} - {% if not object.locked %} +
+ {% if not object.locked %}
- +
- {% endif %} + {% endif %} -
+
- + + +
{% endblock %} {% block extrajavascript %} - -{% endblock %} + $('#remove_one').click(function () { + let form_idx = $('#id_products-TOTAL_FORMS').val(); + if (form_idx > 0) { + IDS[parseInt(form_idx) - 1] = $('#id_products-' + (parseInt(form_idx) - 1) + '-id').val(); + $('#form_body tr:last-child').remove(); + $('#id_products-TOTAL_FORMS').val(parseInt(form_idx) - 1); + } + }); + +{% endblock %} \ No newline at end of file diff --git a/apps/treasury/templates/treasury/invoice_list.html b/apps/treasury/templates/treasury/invoice_list.html index 4e95816e..7dba4fa8 100644 --- a/apps/treasury/templates/treasury/invoice_list.html +++ b/apps/treasury/templates/treasury/invoice_list.html @@ -1,26 +1,35 @@ {% extends "base.html" %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} {% load render_table from django_tables2 %} {% load i18n %} -{% block content %} +{% block contenttitle %}{% endblock %} -
-
- +{% block content %} + -{% render_table table %} - -{% trans "New invoice" %} - -{% endblock %} +
+

+ {{ title }} +

+ {% render_table table %} + +
+{% endblock %} \ No newline at end of file diff --git a/apps/treasury/templates/treasury/remittance_form.html b/apps/treasury/templates/treasury/remittance_form.html index af4170f4..9d9baf27 100644 --- a/apps/treasury/templates/treasury/remittance_form.html +++ b/apps/treasury/templates/treasury/remittance_form.html @@ -1,37 +1,47 @@ {% extends "base.html" %} -{% load static %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} {% load i18n %} {% load crispy_forms_tags pretty_money %} {% load render_table from django_tables2 %} + {% block content %} -

{% trans "Remittance #" %}{{ object.pk }}

- -

{% trans "Remittances list" %}

- - {% if object.pk %} -
-
- -
+
+

+ {% trans "Remittance #" %}{{ object.pk }} +

+
+ {% if object.pk %} +
+ +
-
-
- -
+
+ +
- {% endif %} + {% endif %} - {% crispy form %} + {% crispy form %} +
+
-
- -

{% trans "Linked transactions" %}

+
+

+ {% trans "Linked transactions" %} +

{% if special_transactions.data %} - {% render_table special_transactions %} + {% render_table special_transactions %} {% else %} +
{% trans "There is no transaction linked with this remittance." %}
+
{% endif %} -{% endblock %} +
+{% endblock %} \ No newline at end of file diff --git a/apps/treasury/templates/treasury/remittance_list.html b/apps/treasury/templates/treasury/remittance_list.html index be8e806e..bf25803c 100644 --- a/apps/treasury/templates/treasury/remittance_list.html +++ b/apps/treasury/templates/treasury/remittance_list.html @@ -1,65 +1,88 @@ {% extends "base.html" %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} {% load render_table from django_tables2 %} {% load i18n %} -{% block content %} +{% block contenttitle %}{% endblock %} -
-
- +{% block content %} + -

{% trans "Opened remittances" %}

+
+

+ {% trans "Opened remittances" %} +

{% if opened_remittances.data %} - {% render_table opened_remittances %} + {% render_table opened_remittances %} {% else %} +
{% trans "There is no opened remittance." %}
+
{% endif %} + +
- {% trans "New remittance" %} - -
- -

{% trans "Transfers without remittances" %}

+
+

+ {% trans "Transfers without remittances" %} +

{% if special_transactions_no_remittance.data %} - {% render_table special_transactions_no_remittance %} + {% render_table special_transactions_no_remittance %} {% else %} +
{% trans "There is no transaction without any linked remittance." %}
+
{% endif %} +
-
- -

{% trans "Transfers with opened remittances" %}

+
+

+ {% trans "Transfers with opened remittances" %} +

{% if special_transactions_with_remittance.data %} - {% render_table special_transactions_with_remittance %} + {% render_table special_transactions_with_remittance %} {% else %} +
{% trans "There is no transaction with an opened linked remittance." %}
+
{% endif %} +
-
- -

{% trans "Closed remittances" %}

+
+

+ {% trans "Closed remittances" %} +

{% if closed_remittances.data %} - {% render_table closed_remittances %} + {% render_table closed_remittances %} {% else %} +
{% trans "There is no closed remittance yet." %}
+
{% endif %} -{% endblock %} +
+{% endblock %} \ No newline at end of file diff --git a/apps/treasury/templates/treasury/sogecredit_detail.html b/apps/treasury/templates/treasury/sogecredit_detail.html index eafece53..6d304f32 100644 --- a/apps/treasury/templates/treasury/sogecredit_detail.html +++ b/apps/treasury/templates/treasury/sogecredit_detail.html @@ -1,67 +1,69 @@ {% extends "base.html" %} -{% load static %} -{% load i18n %} -{% load pretty_money %} -{% load perms %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} +{% load i18n pretty_money perms %} +{% block contenttitle %}{% endblock %} {% block content %} -
-
-

{% trans "Credit from the Société générale" %}

-
-
-
-
{% trans 'user'|capfirst %}
-
{{ object.user }}
- - {% if "note.view_note_balance"|has_perm:object.user.note %} -
{% trans 'balance'|capfirst %}
-
{{ object.user.note.balance|pretty_money }}
- {% endif %} - -
{% trans 'transactions'|capfirst %}
-
- {% for transaction in object.transactions.all %} - {{ transaction.membership.club }} ({{ transaction.amount|pretty_money }})
- {% endfor %} -
- -
{% trans 'total amount'|capfirst %}
-
{{ object.amount|pretty_money }}
-
-
- -
- {% trans 'Warning: Validating this credit implies that all membership transactions will be validated.' %} - {% trans 'If you delete this credit, there all membership transactions will be also validated, but no credit will be operated.' %} - {% trans "If this credit is validated, then the user won't be able to ask for a credit from the Société générale." %} - {% trans 'If you think there is an error, please contact the "respos info".' %} -
- - +
+
+

{% trans "Credit from the Société générale" %}

-{% endblock %} +
+
+
{% trans 'user'|capfirst %}
+
{{ object.user }}
+ + {% if "note.view_note_balance"|has_perm:object.user.note %} +
{% trans 'balance'|capfirst %}
+
{{ object.user.note.balance|pretty_money }}
+ {% endif %} + +
{% trans 'transactions'|capfirst %}
+
+ {% for transaction in object.transactions.all %} + {{ transaction.membership.club }} ({{ transaction.amount|pretty_money }})
+ {% endfor %} +
+ +
{% trans 'total amount'|capfirst %}
+
{{ object.amount|pretty_money }}
+
+
+ +
+ {% trans 'Warning: Validating this credit implies that all membership transactions will be validated.' %} + {% trans 'If you delete this credit, there all membership transactions will be also validated, but no credit will be operated.' %} + {% trans "If this credit is validated, then the user won't be able to ask for a credit from the Société générale." %} + {% trans 'If you think there is an error, please contact the "respos info".' %} +
+ + +
+{% endblock %} \ No newline at end of file diff --git a/apps/treasury/templates/treasury/sogecredit_list.html b/apps/treasury/templates/treasury/sogecredit_list.html index c8a9207b..a33b1c0d 100644 --- a/apps/treasury/templates/treasury/sogecredit_list.html +++ b/apps/treasury/templates/treasury/sogecredit_list.html @@ -1,47 +1,58 @@ {% extends "base.html" %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} {% load render_table from django_tables2 %} {% load i18n %} -{% block content %} +{% block contenttitle %}{% endblock %} -
-
- +{% block content %} + - -
- +
+

+ {{ title }} +

+
+ +
+ +
-
-
{% if table.data %} - {% render_table table %} + {% render_table table %} {% else %} +
{% trans "There is no matched user that have asked for a Société générale credit." %}
+
{% endif %}
+
{% endblock %} {% block extrajavascript %} -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/apps/treasury/templates/treasury/specialtransactionproxy_form.html b/apps/treasury/templates/treasury/specialtransactionproxy_form.html index 4e7758ae..6cbbcd78 100644 --- a/apps/treasury/templates/treasury/specialtransactionproxy_form.html +++ b/apps/treasury/templates/treasury/specialtransactionproxy_form.html @@ -1,9 +1,17 @@ {% extends "base.html" %} -{% load static %} -{% load i18n %} -{% load crispy_forms_tags pretty_money %} -{% load render_table from django_tables2 %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} +{% load crispy_forms_tags %} +{% block contenttitle %}{% endblock %} + {% block content %} -

{% trans "Remittances list" %}

- {% crispy form %} -{% endblock %} +
+

+ {{ title }} +

+
+ {% crispy form %} +
+
+{% endblock %} \ No newline at end of file