{% extends "base.html" %} {% block title %}{% if invoice %}Edit Invoice{% else %}New Invoice{% endif %} - Vera Medical CMS{% endblock %} {% block content %}

{% if invoice %}Edit Invoice{% else %}New Invoice{% endif %}

{% if appointment %}Creating invoice from appointment{% else %}Manage billing and payment information{% endif %}

{% if appointment %}

Auto-populated from Appointment

Case: #{{ appointment['file_case_id'] }} - {{ appointment['claimant_first_name'] }} {{ appointment['claimant_last_name'] }}

Appointment: {{ appointment['appointment_date'] }} at {{ appointment['appointment_time'] }}

Doctor: {{ appointment['doctor_full_name'] }}

Service Code: {{ appointment['service_code'] }}

{% endif %}
{% if appointment %} {% endif %}
{% if invoice %}{{ invoice['invoice_number'] }}{% else %}Will be auto-generated on save...{% endif %}

Client & Specialist

Financial Details

${% if invoice %}{{ "%.2f"|format(invoice['total_amount']) }}{% else %}0.00{% endif %} CAD

Provider Fees & Markup

Auto-filled from doctor

Trial Details (if applicable)

Due Date

{% if invoice and invoice.get('due_date') %}{{ invoice['due_date'] }}{% else %}Will be calculated...{% endif %}

Delivery & Report Tracking

{% if invoice and invoice.get('report_deadline_date') %}

Report Deadline: {{ invoice['report_deadline_date'] }}

{% endif %}
{% if invoice %}
{% if line_items %}
{% for item in line_items %} {% endfor %}
Description Qty Price Total
{{ item['service_description'] or item['service_code'] or '-' }} {{ "%.2f"|format(item['quantity']) if item['quantity'] else '-' }} ${{ "%.2f"|format(item['unit_price']) if item['unit_price'] else '0.00' }} CAD ${{ "%.2f"|format(item['line_total']) }} CAD
{% else %}

No line items. Click "Manage Line Items" to add services or expenses.

{% endif %}
{% endif %}
Cancel
{% endblock %}