lingo/lingo/invoicing/templates/lingo/invoicing/manager_non_invoiced_line_l...

91 lines
3.1 KiB
HTML

{% extends "lingo/invoicing/manager_campaign_list.html" %}
{% load i18n %}
{% block breadcrumb %}
{{ block.super }}
<a href="{% url 'lingo-manager-invoicing-non-invoiced-line-list' %}">{% trans "Non invoiced lines" %}</a>
{% endblock %}
{% block appbar %}
<h2>{% trans "Non invoiced lines" %}</h2>
{% endblock %}
{% block content %}
<div>
<table class="main lines">
<thead>
<tr>
<th>{% trans "Event" %}</th>
<th>{% trans "Quantity" %}</th>
<th>{% trans "Unit amount" %}</th>
<th>{% trans "Total amount" %}</th>
<th>{% trans "User" %}</th>
<th>{% trans "Payer" %}</th>
<th>{% trans "Status" %}</th>
<th></th>
</tr>
</thead>
<tbody>
{% for line in object_list %}
<tr data-line-id="{% if line.status == 'injected' %}injected{% else %}line{% endif %}-{{ line.pk }}">
<td>
{{ line.event_date|date:"d/m/Y" }} - {{ line.label }}
<br />
{% if line.status == 'error'%}
<a href="{% url 'lingo-manager-invoicing-pool-journal' pk=line.campaign_id pool_pk=line.pool_id %}?pk={{ line.pk }}">({{ line.slug }})</a>
{% else %}
({{ line.slug }})
{% endif %}
</td>
<td>{{ line.quantity }}</td>
<td>{{ line.unit_amount }}</td>
<td>{{ line.total_amount }}</td>
<td>{{ line.user_name }} ({{ line.user_external_id }})</td>
<td>{{ line.payer_external_id }}</td>
<td class="status">
<span class="tag tag-{{ line.status }}">{% spaceless %}
{% if line.status == 'error'%}
{% trans "Error" %}
{% else %}
{% trans "Injected" %}
{% endif %}
{% endspaceless %}</span>
{% if line.status == 'error'%}
({{ line.error_display }})
{% endif %}
</td>
<td>{% if line.status != 'injected' %}<a class="details-toggle" href="#">{% trans "see details" %}</a>{% endif %}</td>
</tr>
{% if line.status != 'injected' %}
<tr data-details-for-line-id="line-{{ line.pk }}" style="display: none">
<td colspan="10">
{% trans "Pricing data:" %}
<pre>{{ line.pricing_data|pprint }}</pre>
{% trans "Event:" %}
<pre>{{ line.event|pprint }}</pre>
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
{% include "gadjo/pagination.html" %}
</div>
<script>
$(function() {
$(document).on('click', 'a.details-toggle', function(event) {
var line_id = $(this).parents('tr').data('line-id');
var $details = $('tr[data-details-for-line-id=' + line_id + ']');
if ($details.is(':visible')) {
$(this).text('{% trans "see details" %}');
$details.hide();
} else {
$(this).text('{% trans "hide details" %}');
$details.show();
}
event.preventDefault();
});
});
</script>
{% endblock %}