haikal/templates/ledger/bills/bill_list.html
2025-06-15 20:10:42 +03:00

112 lines
5.4 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 %}
<div class="row mt-4">
<div class="d-flex justify-content-between mb-2">
<h3 class="">{% trans "Bills" %}</h3>
<a href="{% url 'bill-create' entity.slug %}" class="btn btn-md btn-phoenix-primary"><i class="fa fa-plus me-2"></i>{% trans 'New Bill' %}</a>
</div>
<div class="col-12">
<form method="get" class=" mb-4">
<div class="input-group input-group-sm">
<button class="btn btn-sm btn-phoenix-secondary rounded-start" type="submit">
{% trans "search" %}
</button>
<input type="text"
name="q"
class="form-control form-control-sm rounded-end"
value="{{ request.GET.q }}"
placeholder="{% trans 'Search bills...' %}" />
{% if request.GET.q %}
<a href="{% url request.resolver_match.view_name %}"
class="btn btn-sm btn-phoenix-danger ms-1 rounded">
<i class="bi bi-x-lg"></i>
</a>
{% endif %}
</div>
</form>
</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">
{{ 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">
{% 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">
<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' entity_slug=entity.slug bill_pk=bill.pk %}" class="dropdown-item text-success-dark">{% trans 'View' %}</a>
</div>
</div>
</td>
</tr>
{% empty %}
<tr>
<td colspan="5" class="text-center text-muted">
{% trans 'No bill found.' %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="d-flex justify-content-between mt-3"><span class="d-none d-sm-inline-block" data-list-info="data-list-info">{{ page_obj.start_index }} {{ _("to") }} {{ page_obj.end_index }}<span class="text-body-tertiary"> {{ _("Items of")}} </span>{{ page_obj.paginator.count }}</span>
<div class="d-flex">
{% if is_paginated %}
{% include 'partials/pagination.html' %}
{% endif %}
</div>
</div>
</div>
{% endblock %}