{% extends "base.html" %} {% from "components/ui.html" import page_header %} {% block content %} {% set breadcrumbs = [ {'text': 'Expenses', 'url': url_for('expenses.list_expenses')}, {'text': expense.title} ] %} {{ page_header( icon_class='fas fa-receipt', title_text=expense.title, subtitle_text='Expense Details', breadcrumbs=breadcrumbs, actions_html='
' + ('Edit' if current_user.is_admin or expense.user_id == current_user.id else '') + '
' ) }}

Expense Information

Date
{{ expense.expense_date.strftime('%Y-%m-%d') }}
Category
{{ expense.category|title }}
Amount
{{ expense.currency_code }} {{ '%.2f'|format(expense.amount) }}
Tax Amount
{{ expense.currency_code }} {{ '%.2f'|format(expense.tax_amount or 0) }}
Total Amount (incl. tax)
{{ expense.currency_code }} {{ '%.2f'|format(expense.total_amount) }}
{% if expense.description %}
Description
{{ expense.description }}
{% endif %}
{% if expense.payment_method or expense.payment_date or expense.vendor or expense.receipt_number %}

Payment Details

{% if expense.vendor %}
Vendor
{{ expense.vendor }}
{% endif %} {% if expense.payment_method %}
Payment Method
{{ expense.payment_method.replace('_', ' ')|title }}
{% endif %} {% if expense.payment_date %}
Payment Date
{{ expense.payment_date.strftime('%Y-%m-%d') }}
{% endif %} {% if expense.receipt_number %}
Receipt Number
{{ expense.receipt_number }}
{% endif %}
{% endif %} {% if expense.receipt_path %} {% endif %} {% if expense.notes %}

Notes

{{ expense.notes }}

{% endif %} {% if current_user.is_admin and expense.status == 'pending' %}

Pending Approval

{% endif %} {% if current_user.is_admin and expense.status == 'approved' and expense.reimbursable and not expense.reimbursed %}

Reimbursement Pending

{% endif %}

Status

Approval Status {% if expense.status == 'pending' %} Pending {% elif expense.status == 'approved' %} Approved {% elif expense.status == 'rejected' %} Rejected {% elif expense.status == 'reimbursed' %} Reimbursed {% endif %}
Billable {% if expense.billable %} Yes {% else %} No {% endif %}
Reimbursable {% if expense.reimbursable %} Yes {% else %} No {% endif %}
{% if expense.invoiced %}
Invoiced Yes
{% endif %}
{% if expense.rejection_reason %}

Rejection Reason:

{{ expense.rejection_reason }}

{% endif %}

{{ _('Associated With') }}

User {{ expense.user.username if expense.user else '-' }}
{% if expense.project %}
Project {{ expense.project.name }}
{% endif %} {% if expense.client %}
Client {{ expense.client.name }}
{% endif %} {% if expense.approved_by %}
Approved By {{ expense.approver.username if expense.approver else '-' }} {% if expense.approved_at %}
{{ expense.approved_at|user_datetime('%Y-%m-%d %H:%M') }}
{% endif %}
{% endif %}
{% if expense.tags %}

Tags

{% for tag in expense.tag_list %} {{ tag }} {% endfor %}
{% endif %}

Metadata

Created: {{ expense.created_at|user_datetime('%Y-%m-%d %H:%M') }}
Updated: {{ expense.updated_at|user_datetime('%Y-%m-%d %H:%M') }}
{% if current_user.is_admin or expense.user_id == current_user.id %}

Actions

Edit Expense {% if current_user.is_admin or (expense.user_id == current_user.id and expense.status == 'pending') %}
{% endif %}
{% endif %}
{% endblock %}