{% extends 'base.html' %} {% load humanize %} {% block title %}Journal Entry: {{ entry.reference_number }} - Haven Grazuri{% endblock %} {% block extra_css %} {% endblock %} {% block content %}
{{ entry.reference_number }} {{ entry.status|upper }}
{% if balanced %} ✓ BALANCED {% else %} ⚠ UNBALANCED {% endif %}
Transaction Date
{{ entry.transaction_date|date:"d M Y" }}
{% if entry.branch %}
Branch
{{ entry.branch.name }}
{% endif %} {% if entry.loan %} {% endif %} {% if entry.expense %}
Related Expense
Expense #{{ entry.expense.id }}
{% endif %}
Created
{{ entry.created_at|date:"d M Y H:i" }}
{% if entry.posted_at %}
Posted
{{ entry.posted_at|date:"d M Y H:i" }}
{% endif %}
{% if entry.description %}
📝 Description

{{ entry.description }}

{% endif %}
📒 Journal Entry Lines
{% for line in lines %} {% endfor %}
# Account Code Account Name Description Debit Credit
{{ line.line_number }} {{ line.account.name }} {{ line.description|truncatewords:15 }} {% if line.debit_amount > 0 %} KES {{ line.debit_amount|floatformat:2|intcomma }} {% else %} — {% endif %} {% if line.credit_amount > 0 %} KES {{ line.credit_amount|floatformat:2|intcomma }} {% else %} — {% endif %}
TOTALS KES {{ total_debits|floatformat:2|intcomma }} KES {{ total_credits|floatformat:2|intcomma }}
{% if not balanced %}
⚠ Warning: This journal entry is not balanced. Total debits (KES {{ total_debits|floatformat:2|intcomma }}) do not equal total credits (KES {{ total_credits|floatformat:2|intcomma }}). Difference: KES {{ total_debits|add:"-1"|multiply:total_credits|floatformat:2|intcomma }}
{% endif %} {% if entry.status == 'reversed' and entry.reversed_by %}
⚠ Reversed: This journal entry has been reversed by {{ entry.reversed_by.reference_number }}.
{% endif %} {% if entry.reverses %}
ℹ Reversal: This entry reverses {{ entry.reverses.reference_number }}.
{% endif %}
← Back Reports Dashboard
{% endblock %}