{% extends 'base.html' %} {% block content %}

Ledger - {{ farm.name }}

Record Payment
{% set running_balance = opening_balance or 0 %} {% if opening_balance_amount and opening_balance_amount > 0 %} {% endif %} {% for e in entries %} {% set running_balance = running_balance + (e.credit or 0) - (e.debit or 0) %} {% else %} {% if not opening_balance or opening_balance == 0 %} {% endif %} {% endfor %}
DateDescriptionCredit (Payable)Debit (Paid)BalanceActions
{{ farm.created_at.date() if farm.created_at else 'N/A' }} Opening Balance ({{ opening_balance_type|upper }}) {% if opening_balance_type == 'credit' %}{{ opening_balance_amount|currency }}{% else %}-{% endif %} {% if opening_balance_type == 'debit' %}{{ opening_balance_amount|currency }}{% else %}-{% endif %} {{ running_balance|currency }} -
{{ e.date }} {{ e.description }} {{ e.credit|currency }} {{ e.debit|currency }} {{ running_balance|currency }} {% if e.debit and e.debit > 0 and not e.purchase_id %}
✏️ Edit
{% elif e.credit and e.credit > 0 and e.purchase_id %} ✏️ Edit {% else %} - {% endif %}
No entries yet.
Payable Balance {{ balance|currency }}
{% endblock %}