haikal/templates/ledger/bills/bill_list.html
2025-09-24 11:07:31 +03:00

98 lines
5.6 KiB
HTML

{% extends 'base.html' %}
{% load i18n %}
{% block title %}
{% trans 'Bills' %}
{% endblock %}
{% block bills %}
<a class="nav-link active fw-bold">
{% trans 'Bills'|capfirst %}
<span class="visually-hidden">(current)</span>
</a>
{% endblock %}
{% block content %}
{% if bills or request.GET.q %}
<div class="row mt-4">
<div class="d-flex justify-content-between mb-2">
<h3 class="">
{% trans "Bills" %}<span class="fas fa-money-bills ms-2 text-primary"></span>
</h3>
{% if perms.django_ledger.add_billmodel %}
<a href="{% url 'bill-create' request.dealer.slug entity.slug %}"
class="btn btn-md btn-phoenix-primary"><i class="fa fa-plus me-2"></i>{% trans 'New Bill' %}</a>
{% endif %}
</div>
<div class="col-auto">
<div class="d-flex">{% include 'partials/search_box.html' %}</div>
</div>
<div class="table-responsive px-1 scrollbar mt-3">
<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 'Bill Number' %}</th>
<th class="sort white-space-nowrap align-middle" scope="col">{% trans 'Bill Status' %}</th>
<th class="sort white-space-nowrap align-middle" scope="col">{% trans 'Vendor' %}</th>
<th class="sort white-space-nowrap align-middle" scope="col">{% trans 'Action' %}</th>
</tr>
</thead>
<tbody class="list">
{% for bill in bills %}
<tr class="hover-actions-trigger btn-reveal-trigger position-static">
<td class="align-middle product white-space-nowrap px-1">{{ bill.bill_number }}</td>
<td class="align-middle product white-space-nowrap">
{% if bill.is_draft %}
<span class="badge badge-phoenix badge-phoenix-warning">
{% elif bill.is_review %}
<span class="badge badge-phoenix badge-phoenix-info">
{% elif bill.is_approved %}
<span class="badge badge-phoenix badge-phoenix-success">
{% elif bill.is_paid %}
<span class="badge badge-phoenix badge-phoenix-success">
{% elif bill.is_canceled %}
<span class="badge badge-phoenix badge-phoenix-danger">
{% elif bill.is_void %}
<span class="badge badge-phoenix badge-phoenix-secondary">
{% endif %}
{{ bill.bill_status }}
</span>
</td>
<td class="align-middle product white-space-nowrap">{{ bill.vendor.vendor_name }}</td>
<td class="align-middle product white-space-nowrap">
{% if perms.django_ledger.view_billmodel %}
<div class="btn-reveal-trigger position-static">
<button class="btn btn-sm dropdown-toggle dropdown-caret-none transition-none btn-reveal fs-10"
type="button"
data-bs-toggle="dropdown"
data-boundary="window"
aria-haspopup="true"
aria-expanded="false"
data-bs-reference="parent">
<span class="fas fa-ellipsis-h fs-10"></span>
</button>
<div class="dropdown-menu dropdown-menu-end py-2">
<a href="{% url 'bill-detail' dealer_slug=request.dealer.slug entity_slug=entity.slug bill_pk=bill.pk %}"
class="dropdown-item text-success-dark">{% trans 'View' %}</a>
</div>
</div>
{% endif %}
</td>
</tr>
{% empty %}
<tr>
<td colspan="5" class="text-center text-muted">{% trans 'No bill 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 "bill-create" request.dealer.slug request.entity.slug as create_bill_url %}
{% include "empty-illustration-page.html" with value="bill" url=create_bill_url %}
{% endif %}
{% endblock %}