{% extends "pos/base.html" %} {% load static %} {% block title %}Ticket Customer Ledger{% endblock %} {% block stylesheets %} {% endblock %} {% block heading %} Ticket Customer Ledger {% endblock %} {% block content %}
{% if customer_obj %} All Time {% endif %}
{% if customer_obj %}
PDF
{% endif %}
{% if customer_obj %}

{{ customer_obj.name|title }} [{{ customer_obj.t_id }}]

{% if show_all %}Complete ledger — all time {% else %}{{ start_date|default:"—" }} → {{ end_date|default:"—" }} {% if svc_type %}  ·  {{ svc_type|upper }}{% endif %} {% endif %}

Account Balance

{{ customer_obj.balance|floatformat:2 }}

Invoice Amount
{{ total_receivable|floatformat:2 }}
Total Received
{{ total_received|floatformat:2 }}
Closing Balance
{{ closing_balance|floatformat:2 }}
Air Tickets
{{ svc_counts.ticket|default:0 }}
Other Services
{{ other_svc_count }}
Total Invoices
{{ total_inv_count }}
{% for row in ledger_rows %} {# ── Opening Balance Row ── #} {% if row.row_type == 'opening' %} {# ── Invoice Row ── #} {% elif row.row_type == 'invoice' %} {# ── Service Detail Sub-rows ── #} {% for sr in row.sub_rows %} {% endfor %} {# ── Payment / Cash Row ── #} {% elif row.row_type == 'payment' %} {% endif %} {% empty %} {% endfor %}
# Date Ref # Type Description / Pax PNR / Ref Ticket # Airline / Vendor Inv Amount Received Balance
— {{ row.date }} — Opening Balance {{ row.balance|floatformat:2 }}
{{ row.row_no }} {{ row.date }} #{{ row.folder_no }} {{ row.svc_flags }} {{ row.inv_category }} {% if row.status == 'REFUNDED' %} REFUNDED {% endif %} {% if row.inv_title %}
{{ row.inv_title }} {% endif %}
— — — {{ row.inv_amount|floatformat:2 }} {% if row.received %}{{ row.received|floatformat:2 }}{% else %}—{% endif %} {{ row.balance|floatformat:2 }}
{{ sr.svc|upper|slice:":4" }}
{{ sr.pax_name }}
{% if sr.passport and sr.passport != '—' %}
PP: {{ sr.passport }}
{% endif %} {% if sr.detail %}
{{ sr.detail }}
{% endif %}
{{ sr.pnr|default:"—" }} {{ sr.ticket_no|default:"—" }} {{ sr.vendor|default:"—" }} {% if sr.amount %}{{ sr.amount|floatformat:2 }}{% else %}—{% endif %}
— {{ row.date }} {{ row.ref }} PMT
{{ row.cat_label }}
{% if row.description and row.description != row.cat_label %}
{{ row.description }}
{% endif %}
— — — {% if row.total_amount and row.total_amount != 0 %} {{ row.total_amount|floatformat:2 }} {% else %}—{% endif %} {% if row.received %}{{ row.received|floatformat:2 }}{% else %}—{% endif %} {{ row.balance|floatformat:2 }}
No transactions found for this period.
PERIOD TOTALS {{ total_receivable|floatformat:2 }} {{ total_received|floatformat:2 }} {{ closing_balance|floatformat:2 }}
Quick Search
No matching records
{% if cat_breakdown %}
Service Breakdown
{% for cat in cat_breakdown %} {% endfor %}
Service Inv Amount Balance
{{ cat.svc_type|upper|slice:":4" }} {{ cat.label }} {{ cat.count }} {{ cat.total_amount|floatformat:0 }} {{ cat.balance|floatformat:0 }}
Grand Total {{ total_inv_count }} {{ total_receivable|floatformat:0 }} {{ closing_balance|floatformat:0 }}
{% endif %}
{% else %}

Select a customer and click Search to view their ledger.

Use All Time to view the complete transaction history.

{% endif %} {% endblock %} {% block javascripts %} {% endblock %}