139 lines
6.6 KiB
HTML
139 lines
6.6 KiB
HTML
{% extends "base.html" %}
|
|
{% load i18n %}
|
|
|
|
{% block title %}{{ page_title }}{% endblock title %}
|
|
|
|
{% block content %}
|
|
<!-- Delete Modal -->
|
|
<div class="modal fade" id="deleteModal"
|
|
data-bs-backdrop="static"
|
|
data-bs-keyboard="false"
|
|
tabindex="-1"
|
|
aria-labelledby="deleteModalLabel"
|
|
aria-hidden="true">
|
|
<div class="modal-dialog modal-sm ">
|
|
<div class="modal-content rounded">
|
|
<div class="modal-body d-flex justify-content-center">
|
|
<h1 class="text-danger me-2"><i class="bi bi-exclamation-diamond-fill"></i></h1>
|
|
<span class="text-danger">
|
|
{% trans "Are you sure you want to delete this account?" %}
|
|
</span>
|
|
</div>
|
|
<div class="btn-group">
|
|
<button type="button"
|
|
class="btn btn-sm btn-secondary"
|
|
data-bs-dismiss="modal">
|
|
{% trans 'No' %}
|
|
</button>
|
|
<div class="btn btn-sm btn-danger">
|
|
<form action="{% url 'account_delete' account.pk %}" method="post">
|
|
{% csrf_token %}
|
|
<button type="submit" class="btn btn-sm btn-danger">
|
|
{% trans 'Yes' %}
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row my-5">
|
|
<div class="card rounded ">
|
|
<div class="card-header ">
|
|
<p class="mb-0">{{ header_title|upper }}</p>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<p><strong>{{ _("Account Name") }}:</strong> {{ account.name }}</p>
|
|
<p><strong>{{ _("Account Code") }}:</strong> {{ account.code }}</p>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<p><strong>{{ _("Balance Type") }}:</strong> {{ account.balance_type }}</p>
|
|
<p><strong>{{ _("Active") }}:</strong> {{ account.active }}</p>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col">
|
|
<table class="table is-fullwidth is-narrow is-striped is-bordered django-ledger-table-bottom-margin-75">
|
|
<tr>
|
|
<th class="has-text-centered">{{ _("JE Number")}}</th>
|
|
<th class="has-text-centered">{{ _("Date") }}</th>
|
|
<th class="has-text-centered">{{ _("Debit") }}</th>
|
|
<th class="has-text-centered">{{ _("Credit") }}</th>
|
|
<th class="has-text-centered">{{ _("Description") }}</th>
|
|
<th class="has-text-centered">{{ _("Unit") }}</th>
|
|
<th class="has-text-centered">{{ _("Actions") }}</th>
|
|
</tr>
|
|
|
|
{% for tx in account.transactionmodel_set.all %}
|
|
<tr class="has-text-centered">
|
|
<td>{{ tx.journal_entry.je_number }}</td>
|
|
<td>{{ tx.journal_entry.timestamp }}</td>
|
|
<td>{% if tx.tx_type == 'debit' %}${{ tx.amount }}{% endif %}</td>
|
|
<td>{% if tx.tx_type == 'credit' %}${{ tx.amount }}{% endif %}</td>
|
|
<td>{{ tx.description }}</td>
|
|
<td>{{ tx.journal_entry.entity_unit.name }}</td>
|
|
<td>
|
|
<div class="dropdown is-right is-hoverable" id="tx-action-{{ tx.uuid }}">
|
|
<div class="dropdown-trigger">
|
|
<button class="button is-small is-rounded is-outlined"
|
|
aria-haspopup="true"
|
|
aria-controls="dropdown-menu">
|
|
<span>{% trans 'Actions' %}</span>
|
|
<span class="icon is-small fas fa-arrow-down"></span>
|
|
</button>
|
|
</div>
|
|
<div class="dropdown-menu" id="dropdown-menu-{{ tx.uuid }}" role="menu">
|
|
{% comment %} <div class="dropdown-content">
|
|
{# TODO: These URLs need to be replaced with the future mode method that generates it. #}
|
|
<a href="{% url 'django_ledger:je-detail' entity_slug=entity_slug ledger_pk=tx.journal_entry.ledger.uuid je_pk=tx.journal_entry.uuid %}"
|
|
class="dropdown-item has-text-success">View JE</a>
|
|
{% if tx.journal_entry.ledger.billmodel %}
|
|
<a href="{% url 'django_ledger:bill-detail' entity_slug=entity_slug bill_pk=tx.journal_entry.ledger.billmodel.uuid %}"
|
|
class="dropdown-item has-text-primary">View Bill</a>
|
|
{% elif tx.journal_entry.ledger.invoicemodel %}
|
|
<a href="{% url 'django_ledger:invoice-detail' entity_slug=entity_slug invoice_pk=tx.journal_entry.ledger.invoicemodel.uuid %}"
|
|
class="dropdown-item has-text-info">View Invoice</a>
|
|
{% endif %}
|
|
</div> {% endcomment %}
|
|
</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
<tr class="has-text-weight-bold">
|
|
<td></td>
|
|
<td class="has-text-right">Total</td>
|
|
<td class="has-text-centered">${{ total_debits }}</td>
|
|
<td class="has-text-centered">${{ total_credits }}</td>
|
|
<td></td>
|
|
<td></td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="card-footer d-flex ">
|
|
<a class="btn btn-sm btn-primary me-1" href="{% url 'account_update' account.pk %}">
|
|
<!--<i class="bi bi-pencil-square"></i> -->
|
|
{{ _("Edit") }}
|
|
</a>
|
|
<a class="btn btn-sm btn-danger me-1"
|
|
data-bs-toggle="modal"
|
|
data-bs-target="#deleteModal">
|
|
<!--<i class="bi bi-trash-fill"></i>-->
|
|
{{ _("Delete") }}
|
|
</a>
|
|
<a class="btn btn-sm btn-secondary"
|
|
href="{% url 'account_list' %}">
|
|
<!--<i class="bi bi-arrow-left-square-fill"></i>-->
|
|
{% trans "Back to List" %}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|