Files
FOSSBilling/src/modules/Invoice/html_client/mod_invoice_index.html.twig
T
Adam Daley 9fb19e02d7 Improve date/datetime format handling and customisability (#948)
* Replace custom Twig bb_date/bb_datetime filters

Replace bb_date and bb_datetime Twig filters with format_date / format_datetime to better support i18n and customisability.

* Update templates to use format_date/format_datetime

Update all templates to use format_date/format_datetime (where appropriate and where not already used).

* Update locale configuration options

Update configuration options to include new locale settings, and ensure new options are used throughout.

* Add reset button to admin theme date picker

Add a reset button to the admin_default theme date picker to allow dates to be cleared, and fix an issue with Order module not allow blank dates. Resolves #938.
2023-03-24 23:16:07 +00:00

106 lines
4.7 KiB
Twig

{% extends request.ajax ? "layout_blank.html.twig" : "layout_default.html.twig" %}
{% block meta_title %}{{ 'Invoice management'|trans }}{% endblock %}
{% block page_header %}{{ 'Invoice management'|trans }}{% endblock %}
{% block body_class %}invoice-index{% endblock %}
{% block breadcrumb %}
<li class="active">{{ 'Invoices'|trans }}</li>
{% endblock %}
{% block content %}
{% set unpaid_invoices = client.invoice_get_list({"status":"unpaid", "per_page":100}) %}
{% set paid_invoices = client.invoice_get_list({"per_page":10, "page":request.page, "status":"paid"}) %}
<div class="row">
<article class="span12 data-block">
<div class="data-container">
<header>
<h1>{{ 'List of invoices'|trans }}</h1><br/>
{{ 'All of your invoices can be found here. You can choose to see either paid or unpaid invoices by clicking corresponding button.'|trans }}
<ul class="data-header-actions">
<li class="demoTabs active"><a href="#unpaid" class="btn btn-alt btn-inverse" data-toggle="tab">{{ 'Unpaid'|trans }}</a></li>
<li class="demoTabs" ><a href="#paid" class="btn btn-alt btn-inverse" data-toggle="tab">{{ 'Paid'|trans }}</a></li>
</ul>
</header>
<section class="tab-content">
<div class="tab-pane active" id="unpaid">
<h3>{{ 'Unpaid'|trans }}</h3>
<table class="table table-hover table-striped">
<thead>
<tr>
<th>{{ 'Title'|trans }}</th>
<th>{{ 'Invoice Date'|trans }}</th>
<th>{{ 'Due Date'|trans }}</th>
<th>{{ 'Total'|trans }}</th>
<th>&nbsp</th>
</tr>
</thead>
<tbody>
{% if unpaid_invoices.total > 0 %}
{% for i, invoice in unpaid_invoices.list %}
<tr class="{{ cycle(['odd', 'even'], i) }}">
<td>{{ "Proforma invoice #%05s"|format(invoice.id) }}</td>
<td>{{ invoice.created_at|format_date }}</td>
<td>{{ invoice.due_at|format_date }}</td>
<td>{{ invoice.total | money(invoice.currency) }}</td>
<td><a class="btn btn-small btn-primary" href="{{ 'invoice'|link }}/{{ invoice.hash }}">{{ 'Pay'|trans }}</a></td>
</tr>
{% endfor %}
{% else %}
<tr>
<td colspan="5" >{{ 'The list is empty'|trans }}</td>
</tr>
{% endif %}
</tbody>
</table>
</div>
<div class="tab-pane" id="paid">
<h3>{{ 'Paid'|trans }}</h3>
<table class="table table-hover table-striped">
<thead>
<tr>
<th>{{ 'Title'|trans }}</th>
<th>{{ 'Invoice Date'|trans }}</th>
<th>{{ 'Paid Date'|trans }}</th>
<th>{{ 'Total'|trans }}</th>
<th>&nbsp</th>
</tr>
</thead>
<tbody>
{% if paid_invoices.total > 0 %}
{% for i, invoice in paid_invoices.list %}
<tr class="{{ cycle(['odd', 'even'], i) }}">
<td>{{ "Proforma invoice #%05s"|format(invoice.id) }}</td>
<td>{{ invoice.created_at|format_date }}</td>
<td>{{ invoice.paid_at|format_date }}</td>
<td>{{ invoice.total | money(invoice.currency) }}</td>
<td><a href="{{ 'invoice'|link }}/{{ invoice.hash }}" class="btn btn-primary btn-small">{{ 'View'|trans }}</a></td>
</tr>
{% endfor %}
{% else %}
<tr>
<td colspan="7">{{ 'The list is empty'|trans }}</td>
</tr>
{% endif %}
</tbody>
</table>
</div>
</section>
<footer>
<p>{{ unpaid_invoices.total }} unpaid invoices and {{ paid_invoices.total }} paid invoices</p>
</footer>
</div>
</article>
</div>
{% endblock %}