haikal/templates/ledger/ledger/ledger_list.html
2025-03-18 00:24:27 +03:00

91 lines
5.0 KiB
HTML

{% extends "base.html" %}
{% load i18n static %}
{% block title %}{{ _("Ledger") }}{% endblock title %}
{% block content %}
<div class="row mt-4">
<div class="d-flex justify-content-between mb-2">
<h3 class="">{% trans "Ledger" %}</h3>
</div>
<div class="table-responsive px-1 scrollbar">
<table class="table fs-9 mb-0 border-top border-translucent">
<thead>
<tr>
<th class="sort white-space-nowrap align-middle" scope="col">{% trans "Ledger Name" %}</th>
<th class="sort white-space-nowrap align-middle" scope="col">{% trans "Journal Entries" %}</th>
<th class="sort white-space-nowrap align-middle" scope="col">{% trans "Earliest Date" %}</th>
<th class="sort white-space-nowrap align-middle" scope="col">{% trans "Posted" %}</th>
<th class="sort white-space-nowrap align-middle" scope="col">{% trans "Locked" %}</th>
<th class="sort white-space-nowrap align-middle" scope="col">{% trans "Action" %}</th>
</tr>
</thead>
<tbody class="list">
{% for ledger in ledgers %}
<tr class="hover-actions-trigger btn-reveal-trigger position-static">
<td class="align-middle product white-space-nowrap">
{% if ledger.invoicemodel %}
<a href="{% url 'invoice_detail' ledger.invoicemodel.pk %}">{{ ledger.get_wrapped_model_instance }}</a>
<br>
<small>
{% if ledger.invoicemodel.is_past_due %}
<span class="badge badge-phoenix badge-phoenix-danger">{% trans "Past Due" %}</span>
{% elif ledger.invoicemodel.is_approved %}
<span class="badge badge-phoenix badge-phoenix-success">{% trans "Approved" %}</span>
{% elif ledger.invoicemodel.is_canceled %}
<span class="badge badge-phoenix badge-phoenix-secondary">{% trans "Canceled" %}</span>
{% elif ledger.invoicemodel.is_draft %}
<span class="badge badge-phoenix badge-phoenix-warning">{% trans "Draft" %}</span>
{% elif ledger.invoicemodel.is_review %}
<span class="badge badge-phoenix badge-phoenix-info">{% trans "In Review" %}</span>
{% elif ledger.invoicemodel.is_paid %}
<span class="badge badge-phoenix badge-phoenix-success">{% trans "Paid" %}</span>
{% endif %}
{% elif ledger.billmodel %}
<a href="{% url 'bill_detail' ledger.billmodel.pk %}">{{ ledger.get_wrapped_model_instance }}</a>
{% endif %}
</small>
</td>
<td class="align-middle product white-space-nowrap">
<a class="btn btn-sm btn-primary"
href="{% url 'journalentry_list' ledger.pk %}">
<i class="fa-solid fa-right-left"></i>
<span>
<span class="has-text-weight-bold">{{ ledger.journal_entries__count }}</span>
<span>{{ _('Journal Entries') }}</span>
</span>
</a>
</td>
<td class="align-middle product white-space-nowrap">
{% if ledger.earliest_timestamp %}{{ ledger.earliest_timestamp | date }}{% endif %}
</td>
<td class="align-middle product white-space-nowrap">
{% if ledger.is_posted %}
<i class="fa-solid fa-square-check text-success"></i>
{% else %}
<i class="fa-solid fa-circle-xmark text-danger"></i>
{% endif %}
</td>
<td class="align-middle product white-space-nowrap">
{% if ledger.is_locked %}
<i class="fa-solid fa-lock text-success"></i>
{% else %}
<i class="fa-solid fa-unlock text-danger"></i>
{% endif %}
</td>
<td></td>
</tr>
{% empty %}
<tr>
<td colspan="6" class="text-center">{% trans "No Bank Accounts Found" %}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="d-flex justify-content-center">
</div>
</div>
{% endblock %}