mirror of https://gitlab.crans.org/bde/nk20
Cards for all treasury
This commit is contained in:
parent
5ba18a2d89
commit
bca301700d
|
@ -3,7 +3,7 @@
|
||||||
{% load crispy_forms_tags %}
|
{% load crispy_forms_tags %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="card bg-light shadow">
|
<div class="card bg-light">
|
||||||
<div class="card-header text-center">
|
<div class="card-header text-center">
|
||||||
<h4>{% trans "Delete invoice" %}</h4>
|
<h4>{% trans "Delete invoice" %}</h4>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,44 +1,55 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% load static %}
|
{% comment %}
|
||||||
{% load i18n %}
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
{% load crispy_forms_tags %}
|
{% endcomment %}
|
||||||
{% block content %}
|
{% load i18n crispy_forms_tags %}
|
||||||
<p><a class="btn btn-default" href="{% url 'treasury:invoice_list' %}">{% trans "Invoices list" %}</a></p>
|
{% block contenttitle %}{% endblock %}
|
||||||
|
|
||||||
{% if object.pk and not object.locked %}
|
{% block content %}
|
||||||
|
<div class="card bg-white mb-3">
|
||||||
|
<h3 class="card-header text-center">
|
||||||
|
{{ title }}
|
||||||
|
</h3>
|
||||||
|
<div class="card-body">
|
||||||
|
{% if object.pk and not object.locked %}
|
||||||
<div class="alert alert-info">
|
<div class="alert alert-info">
|
||||||
{% blocktrans trimmed %}
|
{% blocktrans trimmed %}
|
||||||
Warning: the LaTeX template is saved with this object. Updating the invoice implies regenerate it.
|
Warning: the LaTeX template is saved with this object. Updating the invoice implies regenerate it.
|
||||||
Be careful if you manipulate old invoices.
|
Be careful if you manipulate old invoices.
|
||||||
{% endblocktrans %}
|
{% endblocktrans %}
|
||||||
</div>
|
</div>
|
||||||
{% elif object.locked %}
|
{% elif object.locked %}
|
||||||
<div class="alert alert-info">
|
<div class="alert alert-info">
|
||||||
{% blocktrans trimmed %}
|
{% blocktrans trimmed %}
|
||||||
This invoice is locked and can no longer be edited.
|
This invoice is locked and can no longer be edited.
|
||||||
{% endblocktrans %}
|
{% endblocktrans %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
<form method="post" action="">
|
<form method="post" action="">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|
||||||
{# Render the invoice form #}
|
{# Render the invoice form #}
|
||||||
{% crispy form %}
|
<div class="card-body">
|
||||||
|
{% crispy form %}
|
||||||
|
</div>
|
||||||
|
|
||||||
{# The next part concerns the product formset #}
|
{# The next part concerns the product formset #}
|
||||||
{# Generate some hidden fields that manage the number of products, and make easier the parsing #}
|
{# Generate some hidden fields that manage the number of products, and make easier the parsing #}
|
||||||
{{ formset.management_form }}
|
{{ formset.management_form }}
|
||||||
<table class="table table-condensed table-striped">
|
<table class="table table-condensed table-striped">
|
||||||
{# Fill initial data #}
|
{# Fill initial data #}
|
||||||
{% for form in formset %}
|
{% for form in formset %}
|
||||||
{% if forloop.first %}
|
{% if forloop.first %}
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{{ form.designation.label }}<span class="asteriskField">*</span></th>
|
<th>{{ form.designation.label }}<span class="asteriskField">*</span></th>
|
||||||
<th>{{ form.quantity.label }}<span class="asteriskField">*</span></th>
|
<th>{{ form.quantity.label }}<span class="asteriskField">*</span></th>
|
||||||
<th>{{ form.amount.label }}<span class="asteriskField">*</span></th>
|
<th>{{ form.amount.label }}<span class="asteriskField">*</span></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="form_body">
|
<tbody id="form_body">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<tr class="row-formset">
|
<tr class="row-formset">
|
||||||
<td>{{ form.designation }}</td>
|
<td>{{ form.designation }}</td>
|
||||||
|
@ -48,27 +59,28 @@
|
||||||
{{ form.invoice }}
|
{{ form.invoice }}
|
||||||
{{ form.id }}
|
{{ form.id }}
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
{# Display buttons to add and remove products #}
|
{# Display buttons to add and remove products #}
|
||||||
{% if not object.locked %}
|
<div class="card-body">
|
||||||
|
{% if not object.locked %}
|
||||||
<div class="btn-group btn-block" role="group">
|
<div class="btn-group btn-block" role="group">
|
||||||
<button type="button" id="add_more" class="btn btn-primary">{% trans "Add product" %}</button>
|
<button type="button" id="add_more" class="btn btn-success">{% trans "Add product" %}</button>
|
||||||
<button type="button" id="remove_one" class="btn btn-danger">{% trans "Remove product" %}</button>
|
<button type="button" id="remove_one" class="btn btn-danger">{% trans "Remove product" %}</button>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="btn-block">
|
|
||||||
<button type="submit" class="btn btn-block btn-primary">{% trans "Submit" %}</button>
|
<button type="submit" class="btn btn-block btn-primary">{% trans "Submit" %}</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="empty_form" style="display: none;">
|
{# Hidden div that store an empty product form, to be copied into new forms #}
|
||||||
{# Hidden div that store an empty product form, to be copied into new forms #}
|
<div id="empty_form" style="display: none;">
|
||||||
<table class='no_error'>
|
<table class='no_error'>
|
||||||
<tbody id="for_real">
|
<tbody id="for_real">
|
||||||
<tr class="row-formset">
|
<tr class="row-formset">
|
||||||
<td>{{ formset.empty_form.designation }}</td>
|
<td>{{ formset.empty_form.designation }}</td>
|
||||||
<td>{{ formset.empty_form.quantity }} </td>
|
<td>{{ formset.empty_form.quantity }} </td>
|
||||||
|
@ -76,32 +88,32 @@
|
||||||
{{ formset.empty_form.invoice }}
|
{{ formset.empty_form.invoice }}
|
||||||
{{ formset.empty_form.id }}
|
{{ formset.empty_form.id }}
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block extrajavascript %}
|
{% block extrajavascript %}
|
||||||
<script>
|
<script>
|
||||||
{# Script that handles add and remove lines #}
|
/* script that handles add and remove lines */
|
||||||
IDS = {};
|
IDS = {};
|
||||||
|
|
||||||
$("#id_products-TOTAL_FORMS").val($(".row-formset").length - 1);
|
$("#id_products-TOTAL_FORMS").val($(".row-formset").length - 1);
|
||||||
|
|
||||||
$('#add_more').click(function () {
|
$('#add_more').click(function () {
|
||||||
let form_idx = $('#id_products-TOTAL_FORMS').val();
|
let form_idx = $('#id_products-TOTAL_FORMS').val();
|
||||||
$('#form_body').append($('#for_real').html().replace(/__prefix__/g, form_idx));
|
$('#form_body').append($('#for_real').html().replace(/__prefix__/g, form_idx));
|
||||||
$('#id_products-TOTAL_FORMS').val(parseInt(form_idx) + 1);
|
$('#id_products-TOTAL_FORMS').val(parseInt(form_idx) + 1);
|
||||||
$('#id_products-' + parseInt(form_idx) + '-id').val(IDS[parseInt(form_idx)]);
|
$('#id_products-' + parseInt(form_idx) + '-id').val(IDS[parseInt(form_idx)]);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#remove_one').click(function () {
|
$('#remove_one').click(function () {
|
||||||
let form_idx = $('#id_products-TOTAL_FORMS').val();
|
let form_idx = $('#id_products-TOTAL_FORMS').val();
|
||||||
if (form_idx > 0) {
|
if (form_idx > 0) {
|
||||||
IDS[parseInt(form_idx) - 1] = $('#id_products-' + (parseInt(form_idx) - 1) + '-id').val();
|
IDS[parseInt(form_idx) - 1] = $('#id_products-' + (parseInt(form_idx) - 1) + '-id').val();
|
||||||
$('#form_body tr:last-child').remove();
|
$('#form_body tr:last-child').remove();
|
||||||
$('#id_products-TOTAL_FORMS').val(parseInt(form_idx) - 1);
|
$('#id_products-TOTAL_FORMS').val(parseInt(form_idx) - 1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -1,26 +1,35 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
{% comment %}
|
||||||
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
{% endcomment %}
|
||||||
{% load render_table from django_tables2 %}
|
{% load render_table from django_tables2 %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% block content %}
|
{% block contenttitle %}{% endblock %}
|
||||||
|
|
||||||
<div class="row">
|
{% block content %}
|
||||||
<div class="col-xl-12">
|
<div class="row">
|
||||||
<div class="btn-group btn-group-toggle" style="width: 100%; padding: 0 0 2em 0" data-toggle="buttons">
|
<div class="col-xl-12">
|
||||||
<a href="#" class="btn btn-sm btn-outline-primary active">
|
<div class="btn-group btn-group-toggle" style="width: 100%; padding: 0 0 2em 0" data-toggle="buttons">
|
||||||
{% trans "Invoice" %}s
|
<a href="#" class="btn btn-sm btn-outline-primary active">
|
||||||
</a>
|
{% trans "Invoice" %}s
|
||||||
<a href="{% url "treasury:remittance_list" %}" class="btn btn-sm btn-outline-primary">
|
</a>
|
||||||
{% trans "Remittance" %}s
|
<a href="{% url "treasury:remittance_list" %}" class="btn btn-sm btn-outline-primary">
|
||||||
</a>
|
{% trans "Remittance" %}s
|
||||||
<a href="{% url "treasury:soge_credits" %}" class="btn btn-sm btn-outline-primary">
|
</a>
|
||||||
{% trans "Société générale credits" %}
|
<a href="{% url "treasury:soge_credits" %}" class="btn btn-sm btn-outline-primary">
|
||||||
</a>
|
{% trans "Société générale credits" %}
|
||||||
</div>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{% render_table table %}
|
<div class="card bg-white mb-3">
|
||||||
|
<h3 class="card-header text-center">
|
||||||
<a class="btn btn-primary" href="{% url 'treasury:invoice_create' %}">{% trans "New invoice" %}</a>
|
{{ title }}
|
||||||
|
</h3>
|
||||||
|
{% render_table table %}
|
||||||
|
<div class="card-footer">
|
||||||
|
<a class="btn btn-sm btn-success" href="{% url 'treasury:invoice_create' %}">{% trans "New invoice" %}</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -1,37 +1,47 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% load static %}
|
{% comment %}
|
||||||
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
{% endcomment %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load crispy_forms_tags pretty_money %}
|
{% load crispy_forms_tags pretty_money %}
|
||||||
{% load render_table from django_tables2 %}
|
{% load render_table from django_tables2 %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>{% trans "Remittance #" %}{{ object.pk }}</h1>
|
<div class="card bg-white mb-3">
|
||||||
|
<h3 class="card-header text-center">
|
||||||
<p><a class="btn btn-default" href="{% url 'treasury:remittance_list' %}">{% trans "Remittances list" %}</a></p>
|
{% trans "Remittance #" %}{{ object.pk }}
|
||||||
|
</h3>
|
||||||
{% if object.pk %}
|
<div class="card-body">
|
||||||
<div id="div_id_type" class="form-group"><label for="id_count" class="col-form-label">{% trans "Count" %}</label>
|
{% if object.pk %}
|
||||||
<div class="">
|
<div id="div_id_type">
|
||||||
<input type="text" name="count" value="{{ object.count }}" class="textinput textInput form-control" id="id_count" disabled>
|
<label for="id_count" class="col-form-label">{% trans "Count" %}</label>
|
||||||
</div>
|
<input type="text" name="count" value="{{ object.count }}" class="textinput textInput form-control"
|
||||||
|
id="id_count" disabled>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="div_id_type" class="form-group"><label for="id_amount" class="col-form-label">{% trans "Amount" %}</label>
|
<div id="div_id_type">
|
||||||
<div class="">
|
<label for="id_amount" class="col-form-label">{% trans "Amount" %}</label>
|
||||||
<input class="textinput textInput form-control" type="text" value="{{ object.amount|pretty_money }}" id="id_amount" disabled>
|
<input class="textinput textInput form-control" type="text" value="{{ object.amount|pretty_money }}"
|
||||||
</div>
|
id="id_amount" disabled>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% crispy form %}
|
{% crispy form %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<hr>
|
<div class="card bg-white mb-3">
|
||||||
|
<h3 class="card-header text-center">
|
||||||
<h2>{% trans "Linked transactions" %}</h2>
|
{% trans "Linked transactions" %}
|
||||||
|
</h3>
|
||||||
{% if special_transactions.data %}
|
{% if special_transactions.data %}
|
||||||
{% render_table special_transactions %}
|
{% render_table special_transactions %}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
<div class="card-body">
|
||||||
<div class="alert alert-warning">
|
<div class="alert alert-warning">
|
||||||
{% trans "There is no transaction linked with this remittance." %}
|
{% trans "There is no transaction linked with this remittance." %}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -1,65 +1,88 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
{% comment %}
|
||||||
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
{% endcomment %}
|
||||||
{% load render_table from django_tables2 %}
|
{% load render_table from django_tables2 %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% block content %}
|
{% block contenttitle %}{% endblock %}
|
||||||
|
|
||||||
<div class="row">
|
{% block content %}
|
||||||
<div class="col-xl-12">
|
<div class="row">
|
||||||
<div class="btn-group btn-group-toggle" style="width: 100%; padding: 0 0 2em 0" data-toggle="buttons">
|
<div class="col-xl-12">
|
||||||
<a href="{% url "treasury:invoice_list" %}" class="btn btn-sm btn-outline-primary">
|
<div class="btn-group btn-group-toggle" style="width: 100%; padding: 0 0 2em 0" data-toggle="buttons">
|
||||||
{% trans "Invoice" %}s
|
<a href="{% url "treasury:invoice_list" %}" class="btn btn-sm btn-outline-primary">
|
||||||
</a>
|
{% trans "Invoice" %}s
|
||||||
<a href="#" class="btn btn-sm btn-outline-primary active">
|
</a>
|
||||||
{% trans "Remittance" %}s
|
<a href="#" class="btn btn-sm btn-outline-primary active">
|
||||||
</a>
|
{% trans "Remittance" %}s
|
||||||
<a href="{% url "treasury:soge_credits" %}" class="btn btn-sm btn-outline-primary">
|
</a>
|
||||||
{% trans "Société générale credits" %}
|
<a href="{% url "treasury:soge_credits" %}" class="btn btn-sm btn-outline-primary">
|
||||||
</a>
|
{% trans "Société générale credits" %}
|
||||||
</div>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<h2>{% trans "Opened remittances" %}</h2>
|
<div class="card bg-white mb-3">
|
||||||
|
<h3 class="card-header text-center">
|
||||||
|
{% trans "Opened remittances" %}
|
||||||
|
</h3>
|
||||||
{% if opened_remittances.data %}
|
{% if opened_remittances.data %}
|
||||||
{% render_table opened_remittances %}
|
{% render_table opened_remittances %}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
<div class="card-body">
|
||||||
<div class="alert alert-warning">
|
<div class="alert alert-warning">
|
||||||
{% trans "There is no opened remittance." %}
|
{% trans "There is no opened remittance." %}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<div class="card-footer">
|
||||||
|
<a class="btn btn-sm btn-success" href="{% url 'treasury:remittance_create' %}">{% trans "New remittance" %}</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<a class="btn btn-primary" href="{% url 'treasury:remittance_create' %}">{% trans "New remittance" %}</a>
|
<div class="card bg-white mb-3">
|
||||||
|
<h3 class="card-header text-center">
|
||||||
<hr>
|
{% trans "Transfers without remittances" %}
|
||||||
|
</h3>
|
||||||
<h2>{% trans "Transfers without remittances" %}</h2>
|
|
||||||
{% if special_transactions_no_remittance.data %}
|
{% if special_transactions_no_remittance.data %}
|
||||||
{% render_table special_transactions_no_remittance %}
|
{% render_table special_transactions_no_remittance %}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
<div class="card-body">
|
||||||
<div class="alert alert-warning">
|
<div class="alert alert-warning">
|
||||||
{% trans "There is no transaction without any linked remittance." %}
|
{% trans "There is no transaction without any linked remittance." %}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
<hr>
|
<div class="card bg-white mb-3">
|
||||||
|
<h3 class="card-header text-center">
|
||||||
<h2>{% trans "Transfers with opened remittances" %}</h2>
|
{% trans "Transfers with opened remittances" %}
|
||||||
|
</h3>
|
||||||
{% if special_transactions_with_remittance.data %}
|
{% if special_transactions_with_remittance.data %}
|
||||||
{% render_table special_transactions_with_remittance %}
|
{% render_table special_transactions_with_remittance %}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
<div class="card-body">
|
||||||
<div class="alert alert-warning">
|
<div class="alert alert-warning">
|
||||||
{% trans "There is no transaction with an opened linked remittance." %}
|
{% trans "There is no transaction with an opened linked remittance." %}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
<hr>
|
<div class="card bg-white mb-3">
|
||||||
|
<h3 class="card-header text-center">
|
||||||
<h2>{% trans "Closed remittances" %}</h2>
|
{% trans "Closed remittances" %}
|
||||||
|
</h3>
|
||||||
{% if closed_remittances.data %}
|
{% if closed_remittances.data %}
|
||||||
{% render_table closed_remittances %}
|
{% render_table closed_remittances %}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
<div class="card-body">
|
||||||
<div class="alert alert-warning">
|
<div class="alert alert-warning">
|
||||||
{% trans "There is no closed remittance yet." %}
|
{% trans "There is no closed remittance yet." %}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -1,67 +1,69 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% load static %}
|
{% comment %}
|
||||||
{% load i18n %}
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
{% load pretty_money %}
|
{% endcomment %}
|
||||||
{% load perms %}
|
{% load i18n pretty_money perms %}
|
||||||
|
{% block contenttitle %}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="card bg-light shadow">
|
<div class="card bg-light">
|
||||||
<div class="card-header text-center">
|
<div class="card-header text-center">
|
||||||
<h4>{% trans "Credit from the Société générale" %}</h4>
|
<h4>{% trans "Credit from the Société générale" %}</h4>
|
||||||
</div>
|
|
||||||
<div class="card-body">
|
|
||||||
<dl class="row">
|
|
||||||
<dt class="col-xl-6 text-right">{% trans 'user'|capfirst %}</dt>
|
|
||||||
<dd class="col-xl-6"><a href="{% url 'member:user_detail' pk=object.user.pk %}">{{ object.user }}</a></dd>
|
|
||||||
|
|
||||||
{% if "note.view_note_balance"|has_perm:object.user.note %}
|
|
||||||
<dt class="col-xl-6 text-right">{% trans 'balance'|capfirst %}</dt>
|
|
||||||
<dd class="col-xl-6">{{ object.user.note.balance|pretty_money }}</dd>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<dt class="col-xl-6 text-right">{% trans 'transactions'|capfirst %}</dt>
|
|
||||||
<dd class="col-xl-6">
|
|
||||||
{% for transaction in object.transactions.all %}
|
|
||||||
{{ transaction.membership.club }} ({{ transaction.amount|pretty_money }})<br>
|
|
||||||
{% endfor %}
|
|
||||||
</dd>
|
|
||||||
|
|
||||||
<dt class="col-xl-6 text-right">{% trans 'total amount'|capfirst %}</dt>
|
|
||||||
<dd class="col-xl-6">{{ object.amount|pretty_money }}</dd>
|
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="alert alert-warning">
|
|
||||||
{% 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".' %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="card-footer text-center" id="buttons_footer">
|
|
||||||
{% if object.valid %}
|
|
||||||
<div class="alert alert-danger">
|
|
||||||
{% trans "This credit is already validated." %}
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
{% if object.user.note.balance < object.amount %}
|
|
||||||
<div class="alert alert-warning">
|
|
||||||
{% trans "Warning: if you don't validate this credit, the note of the user doesn't have enough money to pay its memberships." %}
|
|
||||||
{% trans "Please ask the user to credit its note before deleting this credit." %}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<form method="post">
|
|
||||||
{% csrf_token %}
|
|
||||||
<div class="btn-group btn-block">
|
|
||||||
<button name="validate" class="btn btn-success">{% trans "Validate" %}</button>
|
|
||||||
{% if object.user.note.balance >= object.amount %}
|
|
||||||
<button name="delete" class="btn btn-danger">{% trans "Delete" %}</button>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
{% endif %}
|
|
||||||
<a href="{% url 'treasury:soge_credits' %}"><button class="btn btn-primary btn-block">{% trans "Return to credit list" %}</button></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<dl class="row">
|
||||||
|
<dt class="col-xl-6 text-right">{% trans 'user'|capfirst %}</dt>
|
||||||
|
<dd class="col-xl-6"><a href="{% url 'member:user_detail' pk=object.user.pk %}">{{ object.user }}</a></dd>
|
||||||
|
|
||||||
|
{% if "note.view_note_balance"|has_perm:object.user.note %}
|
||||||
|
<dt class="col-xl-6 text-right">{% trans 'balance'|capfirst %}</dt>
|
||||||
|
<dd class="col-xl-6">{{ object.user.note.balance|pretty_money }}</dd>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<dt class="col-xl-6 text-right">{% trans 'transactions'|capfirst %}</dt>
|
||||||
|
<dd class="col-xl-6">
|
||||||
|
{% for transaction in object.transactions.all %}
|
||||||
|
{{ transaction.membership.club }} ({{ transaction.amount|pretty_money }})<br>
|
||||||
|
{% endfor %}
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
<dt class="col-xl-6 text-right">{% trans 'total amount'|capfirst %}</dt>
|
||||||
|
<dd class="col-xl-6">{{ object.amount|pretty_money }}</dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="alert alert-warning">
|
||||||
|
{% 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".' %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card-footer text-center" id="buttons_footer">
|
||||||
|
{% if object.valid %}
|
||||||
|
<div class="alert alert-danger">
|
||||||
|
{% trans "This credit is already validated." %}
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
{% if object.user.note.balance < object.amount %}
|
||||||
|
<div class="alert alert-warning">
|
||||||
|
{% trans "Warning: if you don't validate this credit, the note of the user doesn't have enough money to pay its memberships." %}
|
||||||
|
{% trans "Please ask the user to credit its note before deleting this credit." %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<form method="post">
|
||||||
|
{% csrf_token %}
|
||||||
|
<div class="btn-group btn-block">
|
||||||
|
<button name="validate" class="btn btn-success">{% trans "Validate" %}</button>
|
||||||
|
{% if object.user.note.balance >= object.amount %}
|
||||||
|
<button name="delete" class="btn btn-danger">{% trans "Delete" %}</button>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
{% endif %}
|
||||||
|
<a href="{% url 'treasury:soge_credits' %}"><button
|
||||||
|
class="btn btn-primary btn-block">{% trans "Return to credit list" %}</button></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -1,47 +1,58 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
{% comment %}
|
||||||
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
{% endcomment %}
|
||||||
{% load render_table from django_tables2 %}
|
{% load render_table from django_tables2 %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% block content %}
|
{% block contenttitle %}{% endblock %}
|
||||||
|
|
||||||
<div class="row">
|
{% block content %}
|
||||||
<div class="col-xl-12">
|
<div class="row">
|
||||||
<div class="btn-group btn-group-toggle" style="width: 100%; padding: 0 0 2em 0" data-toggle="buttons">
|
<div class="col-xl-12">
|
||||||
<a href="{% url "treasury:invoice_list" %}" class="btn btn-sm btn-outline-primary">
|
<div class="btn-group btn-group-toggle" style="width: 100%; padding: 0 0 2em 0" data-toggle="buttons">
|
||||||
{% trans "Invoice" %}s
|
<a href="{% url "treasury:invoice_list" %}" class="btn btn-sm btn-outline-primary">
|
||||||
</a>
|
{% trans "Invoice" %}s
|
||||||
<a href="{% url "treasury:remittance_list" %}" class="btn btn-sm btn-outline-primary">
|
</a>
|
||||||
{% trans "Remittance" %}s
|
<a href="{% url "treasury:remittance_list" %}" class="btn btn-sm btn-outline-primary">
|
||||||
</a>
|
{% trans "Remittance" %}s
|
||||||
<a href="#" class="btn btn-sm btn-outline-primary active">
|
</a>
|
||||||
{% trans "Société générale credits" %}
|
<a href="#" class="btn btn-sm btn-outline-primary active">
|
||||||
</a>
|
{% trans "Société générale credits" %}
|
||||||
</div>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<input id="searchbar" type="text" class="form-control" placeholder="Nom/prénom/note ...">
|
<div class="card bg-white mb-3">
|
||||||
<div class="form-check">
|
<h3 class="card-header text-center">
|
||||||
<label for="invalid_only" class="form-check-label">
|
{{ title }}
|
||||||
<input id="invalid_only" name="invalid_only" type="checkbox" class="checkboxinput form-check-input">
|
</h3>
|
||||||
{% trans "Filter with unvalidated credits only" %}
|
<div class="card-body">
|
||||||
</label>
|
<input id="searchbar" type="text" class="form-control" placeholder="Nom/prénom/note ...">
|
||||||
|
<div class="form-check">
|
||||||
|
<label for="invalid_only" class="form-check-label">
|
||||||
|
<input id="invalid_only" name="invalid_only" type="checkbox" class="checkboxinput form-check-input">
|
||||||
|
{% trans "Filter with unvalidated credits only" %}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
|
||||||
|
|
||||||
<div id="credits_table">
|
<div id="credits_table">
|
||||||
{% if table.data %}
|
{% if table.data %}
|
||||||
{% render_table table %}
|
{% render_table table %}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
<div class="card-body">
|
||||||
<div class="alert alert-warning">
|
<div class="alert alert-warning">
|
||||||
{% trans "There is no matched user that have asked for a Société générale credit." %}
|
{% trans "There is no matched user that have asked for a Société générale credit." %}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block extrajavascript %}
|
{% block extrajavascript %}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function() {
|
$(document).ready(function () {
|
||||||
let old_pattern = null;
|
let old_pattern = null;
|
||||||
let searchbar_obj = $("#searchbar");
|
let searchbar_obj = $("#searchbar");
|
||||||
let invalid_only_obj = $("#invalid_only");
|
let invalid_only_obj = $("#invalid_only");
|
||||||
|
@ -52,9 +63,10 @@
|
||||||
if (pattern === old_pattern || pattern === "")
|
if (pattern === old_pattern || pattern === "")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$("#credits_table").load(location.pathname + "?search=" + pattern.replace(" ", "%20") + (invalid_only_obj.is(':checked') ? "&valid=false" : "") + " #credits_table");
|
$("#credits_table").load(location.pathname + "?search=" + pattern.replace(" ", "%20") + (
|
||||||
|
invalid_only_obj.is(':checked') ? "&valid=false" : "") + " #credits_table");
|
||||||
|
|
||||||
$(".table-row").click(function() {
|
$(".table-row").click(function () {
|
||||||
window.document.location = $(this).data("href");
|
window.document.location = $(this).data("href");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,17 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% load static %}
|
{% comment %}
|
||||||
{% load i18n %}
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
{% load crispy_forms_tags pretty_money %}
|
{% endcomment %}
|
||||||
{% load render_table from django_tables2 %}
|
{% load crispy_forms_tags %}
|
||||||
|
{% block contenttitle %}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<p><a class="btn btn-default" href="{% url 'treasury:remittance_list' %}">{% trans "Remittances list" %}</a></p>
|
<div class="card bg-white mb-3">
|
||||||
{% crispy form %}
|
<h3 class="card-header text-center">
|
||||||
|
{{ title }}
|
||||||
|
</h3>
|
||||||
|
<div class="card-body">
|
||||||
|
{% crispy form %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
Loading…
Reference in New Issue