{% extends "layouts/authenticated.html" %} {% import 'components/macros.html' as ui %} {% block title %}Past Transactions - {{ brand_name }}{% endblock %} {% block head_extra %} {% endblock %} {% block content %} {{ ui.page_header( 'Past Transactions', 'Review completed sales, returns, and payment details.' ) }}
{{ ui.button('Admin Dashboard', '/admin', 'secondary') }} {{ ui.button('Help Center', '/help-center', 'secondary') }} {{ ui.button('Back to Sales', '/sales', 'secondary') }} {{ ui.button('Logout', '/logout', 'danger') }}
{% call ui.table_shell('Transaction History') %} {% if sales %} {% for sale in sales %} {% endfor %}
Receipt # Date Total Payment Cash Received Change Returned Net Status Action
{{ sale[4] or 'RCP-' ~ '%06d'|format(sale[0]) }} {{ sale[2] }} {{ currency_symbol }} {{ "%.2f"|format(sale[1]) }} {{ sale[5]|title if sale[5] else 'Unknown' }} {% if sale[5] == 'cash' and sale[6] is not none %} {{ currency_symbol }} {{ "%.2f"|format(sale[6]) }} {% else %} - {% endif %} {% if sale[5] == 'cash' and sale[7] is not none %} {{ currency_symbol }} {{ "%.2f"|format(sale[7]) }} {% else %} - {% endif %} {{ currency_symbol }} {{ "%.2f"|format(sale[3] or 0) }} {{ currency_symbol }} {{ "%.2f"|format(sale[1] - (sale[3] or 0)) }} {% if sale[3] and sale[3] > 0 %} {{ ui.status_pill('Partially Returned', 'warning') }} {% else %} {{ ui.status_pill('Paid', 'success') }} {% endif %} {{ ui.button('View', '/receipt/' ~ sale[0], 'secondary', 'sm') }} {{ ui.button('Return', '/return-goods?search=' ~ sale[0], 'secondary', 'sm') }}
{% else %} {{ ui.empty_state('No transactions found.', 'There are no transaction records to display yet.') }} {% endif %} {% endcall %} {{ ui.pagination(page, total_pages, '/transactions') }} {% endblock %}