{% extends "base.html" %} {% block content %}
{# display just the invoices #} {% if invoices|length > 1 %} {% for invoice in invoices %} {% endfor %}
Invoices
Invoice Id Customer Name Invoice Date Billing Address Total
{{ invoice.invoice_id }} {{ invoice.customer.full_name }} {{ invoice.invoice_date }} {{ invoice.billing_address }}  {{ invoice.billing_city }},  {{ invoice.billing_state }}   {{ invoice.billing_postal_code }}  {{ invoice.billing_country }} {{ '%.2f'|format(invoice.total) }}
{# display the invoice items #} {% else %} {% set invoice = invoices[0] %} {% set invoice_items = invoices[0].invoice_items %}
Invoice

Customer Name: {{ invoice.customer.full_name }}

Date: {{ invoice.invoice_date }}

Billing Address: {{ invoice.billing_address }}

Billing City: {{ invoice.billing_city }}

Billing State: {{ invoice.billing_state }}

Billing Postal Code: {{ invoice.billing_postal_code }}

Billing Country: {{ invoice.billing_country }}

{% for invoice_item in invoice_items %} {% endfor %}
Invoice Items
ID Track Id Quantity Unit Price
{{ invoice_item.track_id }} {{ invoice_item.invoice_id }} {{ invoice_item.quantity }} {{ invoice_item.unit_price }}
Total {{ invoice.total }}
{% endif %}
{% endblock %}