trytond-nereid_account_invoice/templates/invoices.jinja

48 lines
2.3 KiB
Django/Jinja

{% extends 'base.jinja' %}
{% from '_helpers.jinja' import render_pagination with context %}
{% block head %}<link href="{{ STATIC }}{{ config['TEMPLATE'] }}/css/state.css" rel="stylesheet" type="text/css">{% endblock %}
{% block title %}{{ _('Invoices') }}. {{ _('Page') }} {{ invoices.page }}{% endblock %}
{% block metadescription %}{{ _('Invoices') }} - {{ config['TITLE'] }}. {{ _('Page') }} {{ invoices.page }}{% endblock %}
{% block main %}
{% set bread_crumbs = [(url_for('nereid.website.home'), _('Home')), (url_for('account.invoice.render_list'), _('Invoices'))] %}
{% set invoice_state = {'draft': _('Draft'), 'validated': _('Validated'), 'posted': _('Posted'), 'paid': _('Paid'), 'cancel': _('Canceled')} %}
{% set invoice_type = {'out_invoice': _('Invoice'), 'out_credit_note': _('Credit Note')} %}
{% include 'nav.jinja' %}
<div class="row">
<div class="span12 page-header">
<h1>{{ _('Invoices') }}</h1>
</div>
<div class="span12">
{% if invoices %}
<table class="table table-striped">
<tbody>
<tr class="blacky">
<th>{{ _('Number') }}</th>
<th>{{ _('Date') }}</th>
<th>{{ _('Type') }}</th>
<th>{{ _('State') }}</th>
<th>{{ _('Price') }}</th>
<th>{{ _('Details') }}</th>
</tr>
{% for invoice in invoices %}
<tr>
<td>{% if invoice.number %}<a href="{{ url_for('account.invoice.render', uri=invoice.id) }}">{{ invoice.number }}</a>{% endif %}</td>
<td>{{ invoice.invoice_date|dateformat }}</td>
<td>{{ invoice_type[invoice.type] }}</td>
<td><span class="state state-small state-{{ invoice.state }}">{{ invoice_state[invoice.state] }}</span></td>
<td>{{ invoice.total_amount|currencyformat(invoice.currency.code) }}</td>
<td><a href="{{ url_for('account.invoice.render', uri=invoice.id) }}">{{ _('View Details') }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
{% if invoices.pages > 1 %}{{ render_pagination(invoices, None, 'invoice.invoice.render_list') }}{% endif %}
{% else %}
<div class="alert">{{ _('Not invoices are available') }}.</div>
{% endif %}
</div>
</div>
{% endblock %}