Skip to content

Commit

Permalink
Incorporated changes from FOSSBilling#1992 into mod_invoice_index.htm…
Browse files Browse the repository at this point in the history
…l.twig and mod_invoice_invoice.html.twig
  • Loading branch information
Anuril committed Jun 20, 2024
1 parent d411e90 commit 21e0378
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 26 deletions.
25 changes: 8 additions & 17 deletions src/modules/Invoice/html_admin/mod_invoice_index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -69,25 +69,14 @@
</div>
</div>
</div>
{# <div class="mb-3 row">
<label class="form-label col-3 col-form-label">{{ 'Approved'|trans }}</label>
<div class="col">
<input type="radio" name="approved" value=""{% if not request.approved %} checked{% endif %}>
<label>All</label>
<input type="radio" name="approved" value="0"{% if request.approved == "1"%} checked{% endif %}>
<label>Pending approval</label>
<input type="radio" name="approved" value="1"{% if request.approved == "0" %} checked{% endif %}>
<label>Approved</label>
</div>
</div> #}
<div class="mb-3 row">
<label class="form-label col-3 col-form-label" for="issue_date">{{ 'Issue date'|trans }}</label>
<label class="form-label col-3 col-form-label" for="issue_date">{{ 'Invoice date'|trans }}</label>
<div class="col">
<div class="input-group">
<div class="input-icon w-100">
<input class="form-control datepicker"
id="issue_date"
value="{% if request.date_from %}{{ request.date_from|date('Y-m-d') }}{% endif %}{% if request.date_to %} to {{ request.date_to|date('Y-m-d') }}{% endif %}"
value="{% if request.date_from %}{{ request.date_from|format_date }}{% endif %}{% if request.date_to %} to {{ request.date_to|format_date }}{% endif %}"
data-name-from="date_from"
data-name-to="date_to"
>
Expand Down Expand Up @@ -209,8 +198,9 @@
<th class="w-1"></th>
<th>{{ 'Name'|trans }}</th>
<th class="text-center">{{ 'Amount'|trans }}</th>
<th class="text-center">{{ 'Issued at'|trans }}</th>
<th class="text-center">{{ 'Paid at'|trans }}</th>
<th class="text-center">{{ 'Invoice Date'|trans }}</th>
<th class="text-center">{{ 'Due Date'|trans }}</th>
<th class="text-center">{{ 'Paid Date'|trans }}</th>
<th>{{ 'Status'|trans }}</th>
<th class="w-1"></th>
</tr>
Expand All @@ -234,8 +224,9 @@
<a href="{{ 'client'|alink }}/manage/{{ invoice.client.id }}">{{ invoice.buyer.first_name }} {{ invoice.buyer.last_name }}</a>
</td>
<td class="text-center">{{ mf.currency_format(invoice.total, invoice.currency) }}</td>
<td class="text-center">{{ invoice.created_at|date('Y-m-d') }}</td>
<td class="text-center">{% if invoice.paid_at %}{{ invoice.paid_at|date('Y-m-d') }}{% else %}-{% endif %}</td>
<td class="text-center">{{ invoice.created_at|format_date }}</td>
<td class="text-center">{{ invoice.due_at|format_date }}</td>
<td class="text-center">{% if invoice.paid_at %}{{ invoice.paid_at|format_date }}{% else %}-{% endif %}</td>
<td>
{% if invoice.status == 'paid' %}
<span class="badge bg-success me-1"></span>
Expand Down
18 changes: 9 additions & 9 deletions src/modules/Invoice/html_admin/mod_invoice_invoice.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,19 @@
<td>{{ invoice.buyer.company_vat }} / {{ invoice.buyer.company_number }}</td>
</tr>
<tr>
<td class="text-start">{{ 'Date Created'|trans }}:</td>
<td class="text-start">{{ 'Invoice Date'|trans }}:</td>
<td>{{ invoice.created_at|format_datetime }}</td>
<td class="w-15 text-start">{{ 'Address'|trans }}:</td>
<td>{{ invoice.buyer.address }}</td>
</tr>
<tr>
<td class="text-start">{{ 'Date Due'|trans }}:</td>
<td class="text-start">{{ 'Due Date'|trans }}:</td>
<td>{{ invoice.due_at|format_datetime }}</td>
<td class="w-15 text-start">{{ 'Zip'|trans }}, {{ 'City'|trans }}:</td>
<td>{{ invoice.buyer.zip }}, {{ invoice.buyer.city }}</td>
</tr>
<tr>
<td class="text-start">{{ 'Date Paid'|trans }}:</td>
<td class="text-start">{{ 'Paid Date'|trans }}:</td>
<td>{% if invoice.paid_at %}{{ invoice.paid_at|format_datetime }}{% else %}-{% endif %}</td>
<td class="w-15 text-start">{{ 'State'|trans }}:</td>
<td>{{ invoice.buyer.state }}</td>
Expand Down Expand Up @@ -253,10 +253,10 @@
</div>
<div class="mb-3 row">
<div class="col">
<label class="form-label col-3 col-form-label" for="created_at">{{ 'Created at'|trans }}:</label>
<label class="form-label col-3 col-form-label" for="created_at">{{ 'Invoice Date'|trans }}:</label>
<div class="input-group">
<div class="input-icon w-100">
<input class="form-control datepicker" id="created_at" value="{{ invoice.created_at|date('Y-m-d') }}" name="created_at">
<input class="form-control datepicker" id="created_at" value="{{ invoice.created_at|format_date }}" name="created_at">
<span class="input-icon-addon">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
Expand All @@ -275,10 +275,10 @@
</div>
<div class="mb-3 row">
<div class="col">
<label class="form-label col-3 col-form-label" for="due_at">{{ 'Due at'|trans }}:</label>
<label class="form-label col-3 col-form-label" for="due_at">{{ 'Due Date'|trans }}:</label>
<div class="input-group">
<div class="input-icon w-100">
<input class="form-control datepicker" id="due_at" value="{% if invoice.due_at %}{{ invoice.due_at|date('Y-m-d') }}{% endif %}" name="due_at">
<input class="form-control datepicker" id="due_at" value="{% if invoice.due_at %}{{ invoice.due_at|format_date }}{% endif %}" name="due_at">
<span class="input-icon-addon">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
Expand All @@ -296,10 +296,10 @@
</div>
<div class="mb-3 row">
<div class="col">
<label class="form-label col-3 col-form-label" for="paid_at">{{ 'Paid at'|trans }}:</label>
<label class="form-label col-3 col-form-label" for="paid_at">{{ 'Paid Date'|trans }}:</label>
<div class="input-group">
<div class="input-icon w-100">
<input class="form-control datepicker" id="paid_at" value="{% if invoice.paid_at %}{{ invoice.paid_at|date('Y-m-d') }}{% endif %}" name="paid_at">
<input class="form-control datepicker" id="paid_at" value="{% if invoice.paid_at %}{{ invoice.paid_at|format_date }}{% endif %}" name="paid_at">
<span class="input-icon-addon">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
Expand Down

0 comments on commit 21e0378

Please sign in to comment.