{% extends "base.html" %} {% block content %}
{# display just the playlists #} {% if results|length > 1 %} {% for customer, invoices_total in results %} {% endfor %}
Customers
Customer Name Email Total Value Of Orders
{{ customer.full_name }} {{ customer.email }} {{ '%.2f'|format(invoices_total) }}
{# display the playlist name and the tracks #} {% else %} {% set customer, invoices_total = results[0] %}
Customer

Name: {{ customer.full_name }}

Address: {{ customer.address }}

City: {{ customer.city }}, {{ customer.state }}  {{ customer.postal_code }}

Phone: {{ customer.phone }}

Email: {{ customer.email }}

Support Rep:  {{ customer.support_rep.full_name }}

{% set invoices = customer.invoices %} {% for invoice in invoices %} {% endfor %}
Invoices
Invoice Id Invoice Date Total
{{ invoice.invoice_id}} {{ invoice.invoice_date }} {{ invoice.total }}
Total {{ invoices_total }}
{% endif %}
{% endblock %}