91 lines
4.1 KiB
HTML
91 lines
4.1 KiB
HTML
{% extends "lingo/invoicing/manager_campaign_detail.html" %}
|
|
{% load i18n %}
|
|
|
|
{% block breadcrumb %}
|
|
{{ block.super }}
|
|
<a href="{% url 'lingo-manager-invoicing-pool-detail' pk=object.pk pool_pk=pool.pk %}">{% trans "Pool" %}</a>
|
|
{% endblock %}
|
|
|
|
{% block appbar %}
|
|
<h2 id="pool-title">
|
|
{% if pool.success_count %}<span class="tag tag-success">{{ pool.success_count }}</span>{% endif %}
|
|
{% if pool.warning_count %}<span class="tag tag-warning">{{ pool.warning_count }}</span>{% endif %}
|
|
{% if pool.error_count %}<span class="tag tag-error">{{ pool.error_count }}</span>{% endif %}
|
|
{{ pool.created_at|date:"DATETIME_FORMAT" }}
|
|
</h2>
|
|
<span class="actions">
|
|
<a href="{% url 'lingo-manager-invoicing-pool-journal' pk=object.pk pool_pk=pool.pk %}">{% trans "Journal" %}</a>
|
|
{% if pool.draft and pool.status != 'registered' and pool.status != 'running' %}
|
|
<a href="{% url 'lingo-manager-invoicing-pool-delete' pk=object.pk pool_pk=pool.pk %}" rel="popup">{% trans "Delete" %}</a>
|
|
{% endif %}
|
|
{% if pool.draft and pool.status == 'completed' and pool.is_last %}
|
|
<a href="{% url 'lingo-manager-invoicing-pool-promote' pk=object.pk pool_pk=pool.pk %}" rel="popup">{% trans "Promote" %}</a>
|
|
{% endif %}
|
|
</span>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="section">
|
|
<div>
|
|
<form class="invoice-filters">
|
|
<fieldset class="gadjo-foldable gadjo-folded" id="filters">
|
|
<legend class="gadjo-foldable-widget">{% trans "Invoice Filtering" %}</legend>
|
|
<div class="gadjo-folding">
|
|
{{ filterset.form.as_p }}
|
|
</div>
|
|
</fieldset>
|
|
<script>
|
|
$(function() {
|
|
$('form.invoice-filters input,select').on('change',
|
|
function() {
|
|
$(this).parents('form').submit();
|
|
});
|
|
});
|
|
</script>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{% url 'lingo-manager-invoicing-pool-journal' pk=object.pk pool_pk=pool.pk as journal_url %}
|
|
<div>
|
|
<ul class="objects-list">
|
|
{% for invoice in object_list %}
|
|
<li class="invoice untoggled" data-invoice-id="{{ invoice.pk }}" data-invoice-lines-url="{% url 'lingo-manager-invoicing-invoice-line-list' pk=object.pk pool_pk=pool.pk invoice_pk=invoice.pk %}">
|
|
{% if pool.draft %}
|
|
{% blocktrans with number=invoice.pk payer=invoice.payer amount=invoice.total_amount %}Invoice <a href="{{ journal_url }}?invoice_id={{ number }}">TMP-{{ number }}</a> addressed to <a href="{{ journal_url }}?payer_external_id={{ payer }}">{{ payer }}</a>, amount {{ amount }}€{% endblocktrans %}
|
|
{% else %}
|
|
{% blocktrans with invoice_number=invoice.formatted_number payer=invoice.payer amount=invoice.total_amount number=invoice.number regie_id=invoice.regie_id %}Invoice <a href="{{ journal_url }}?invoice_number={{ number }}®ie={{ regie_id }}">{{ invoice_number }}</a> addressed to <a href="{{ journal_url }}?payer_external_id={{ payer }}">{{ payer }}</a>, amount {{ amount }}€{% endblocktrans %}
|
|
{% endif %}
|
|
<span class="togglable"></span>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% include "gadjo/pagination.html" %}
|
|
</div>
|
|
<script>
|
|
$(function() {
|
|
$(document).on('click', '.togglable', function(event) {
|
|
event.preventDefault();
|
|
var $toggle = $(this);
|
|
var $li = $toggle.parents('li');
|
|
var invoice_id = $li.data('invoice-id');
|
|
if ($('li.line[data-invoice-id="' + invoice_id + '"]').length == 0) {
|
|
$.ajax({
|
|
url: $li.data('invoice-lines-url')
|
|
}).done(function(html) {
|
|
$li.toggleClass('toggled').toggleClass('untoggled');
|
|
$(html).insertAfter($li);
|
|
});
|
|
} else {
|
|
if ($li.hasClass('toggled')) {
|
|
$li.toggleClass('toggled').toggleClass('untoggled');
|
|
$('li.line[data-invoice-id="' + invoice_id + '"]').hide();
|
|
} else {
|
|
$li.toggleClass('toggled').toggleClass('untoggled');
|
|
$('li.line[data-invoice-id="' + invoice_id + '"]').show();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
{% endblock %}
|