94 lines
5.7 KiB
HTML
94 lines
5.7 KiB
HTML
{% extends "base.html" %}
|
|
{% load i18n static %}
|
|
{% block title %}
|
|
{{ _("Invoices") }}
|
|
{% endblock title %}
|
|
{% block content %}
|
|
{% if invoices or request.GET.q %}
|
|
<div class="row mt-4">
|
|
<div class="row g-3 justify-content-between mb-4">
|
|
<div class="col-auto">
|
|
<div class="d-md-flex justify-content-between">
|
|
<h2 class="mb-3">
|
|
{% trans "Invoices" %}<i class="fa-solid fa-receipt ms-2 text-primary"></i>
|
|
</h2>
|
|
</div>
|
|
</div>
|
|
<div class="col-auto">
|
|
<div class="d-flex">{% include 'partials/search_box.html' %}</div>
|
|
</div>
|
|
</div>
|
|
<div class="table-responsive px-1 scrollbar">
|
|
<table class="table align-items-center table-flush">
|
|
<thead>
|
|
<tr class="bg-body-highlight">
|
|
<th class="sort white-space-nowrap align-middle" scope="col">{% trans "Invoice Number" %}</th>
|
|
<th class="sort white-space-nowrap align-middle" scope="col">{% trans "Customer" %}</th>
|
|
<th class="sort white-space-nowrap align-middle" scope="col">{% trans "Status" %}</th>
|
|
<th class="sort white-space-nowrap align-middle" scope="col">{% trans "Status Date" %}</th>
|
|
<th class="sort white-space-nowrap align-middle" scope="col">{% trans "Created" %}</th>
|
|
<th class="sort white-space-nowrap align-middle" scope="col">{% trans "Actions" %}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="list">
|
|
{% for invoice in invoices %}
|
|
<tr class="hover-actions-trigger btn-reveal-trigger position-static">
|
|
<td class="align-middle product white-space-nowrap py-0 px-1">{{ invoice.invoice_number }}</td>
|
|
<td class="align-middle product white-space-nowrap">{{ invoice.customer }}</td>
|
|
<td class="align-middle product white-space-nowrap text-success">
|
|
{% if invoice.is_past_due %}
|
|
<span class="badge badge-phoenix badge-phoenix-danger">{% trans "Past Due" %}</span>
|
|
{% elif invoice.is_approved %}
|
|
<span class="badge badge-phoenix badge-phoenix-success">{% trans "Approved" %}</span>
|
|
{% elif invoice.is_canceled %}
|
|
<span class="badge badge-phoenix badge-phoenix-secondary">{% trans "Canceled" %}</span>
|
|
{% elif invoice.is_draft %}
|
|
<span class="badge badge-phoenix badge-phoenix-warning">{% trans "Draft" %}</span>
|
|
{% elif invoice.is_review %}
|
|
<span class="badge badge-phoenix badge-phoenix-info">{% trans "In Review" %}</span>
|
|
{% elif invoice.is_paid %}
|
|
<span class="badge badge-phoenix badge-phoenix-success">{% trans "Paid" %}</span>
|
|
{% endif %}
|
|
</td>
|
|
<td class="align-middle product white-space-nowrap">
|
|
{% if invoice.invoice_status == "in_review" %}
|
|
{{ invoice.date_in_review }}
|
|
{% elif invoice.invoice_status == "approved" %}
|
|
{{ invoice.date_approved }}
|
|
{% elif invoice.invoice_status == "canceled" %}
|
|
{{ invoice.date_canceled }}
|
|
{% elif invoice.invoice_status == "draft" %}
|
|
{{ invoice.date_draft }}
|
|
{% elif invoice.invoice_status == "paid" %}
|
|
{{ invoice.date_paid }}
|
|
{% endif %}
|
|
</td>
|
|
<td class="align-middle product white-space-nowrap">{{ invoice.created }}</td>
|
|
<td class="align-middle product white-space-nowrap">
|
|
<a href="{% url 'invoice_detail' request.dealer.slug request.entity.slug invoice.pk %}"
|
|
class="btn btn-sm btn-phoenix-success">
|
|
<i class="fa-regular fa-eye me-1"></i>
|
|
{% trans "View" %}
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
{% empty %}
|
|
<tr>
|
|
<td colspan="6" class="text-center">{% trans "No Invoice Found" %}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% if page_obj.paginator.num_pages > 1 %}
|
|
<div class="d-flex justify-content-end mt-3">
|
|
<div class="d-flex">{% include 'partials/pagination.html' %}</div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
{% else %}
|
|
{% url 'estimate_create' request.dealer.slug as url %}
|
|
{% include "empty-illustration-page.html" with value=_("invoice") url=url %}
|
|
{% endif %}
|
|
{% endblock %}
|