{% extends "base.html" %} {% load static erp_tags labels %} {% block title %}{{ customer }} — {% label "customers.customer" %}{% endblock %} {% block chat_context %} {% endblock %} {% block content %} {# Header Card #}
{{ customer.full_name }}
{% if customer.is_erased %}

This {% label "customers.customer" case="lower" %}'s personal data was erased; the account stays for its documents.

{% else %}

{% if customer.email %}{{ customer.email }}{% endif %} {% if customer.phone %} · {{ customer.phone }}{% endif %}

{% endif %}
{{ customer.get_customer_type_display }} {{ customer.get_pricing_tier_display }} {% if customer.is_active %} Active {% else %} Inactive {% endif %}
{# Tabs #}
{# Profile Tab #}
Basic Information

First Name

{{ customer.first_name }}

Last Name

{{ customer.last_name }}

Email

{{ customer.display_email|default:"—" }}

Phone

{{ customer.phone|default:"—" }}

Company

{{ customer.company_name|default:"—" }}

Job Title

{{ customer.job_title|default:"—" }}

Classification

Customer Type

{{ customer.get_customer_type_display }}

Pricing Tier

{{ customer.get_pricing_tier_display }}

{% if customer.is_tax_exempt %}
Tax Exemption

Reason

{{ customer.get_tax_exempt_reason_display|default:"—" }}

Certificate #

{{ customer.tax_exempt_certificate_number|default:"—" }}

Expiration

{{ customer.tax_exempt_expiration|default:"—" }}

Document

{% if customer.tax_exempt_document_url %} View Document {% else %}

—

{% endif %}
{% endif %}
Preferences

Active

{% if customer.is_active %}Yes{% else %}No{% endif %}

Accepts Marketing

{% if customer.accepts_marketing %}Yes{% else %}No{% endif %}

{% if customer.notes %}
Notes

{{ customer.notes|linebreaksbr }}

{% endif %}
{# Relationships of the customer's party (parties.erp_views.party_relationships) #} {% if party %} {% label "parties.party" case="lower" as party_noun %}

Relationships

Of the {{ party_noun }} {{ party.display_name }} this account belongs to.

Open {{ party_noun }} {% if party_editable %} Add relationship {% endif %}
{% for label_text, rels in relationship_groups %}

{{ label_text }}

    {% for rel in rels %}
  • {{ rel.other.display_name }} {% if rel.title %} · {{ rel.title }}{% endif %} {% if rel.is_primary %}Primary{% endif %} {% if rel.valid_from %} · since {{ rel.valid_from|date:"M j, Y" }}{% endif %} {% if not rel.system and party_editable %}Edit{% endif %}
  • {% endfor %}
{% empty %}

No current relationships.

{% endfor %} {% if past_relationships %}
Past relationships ({{ past_relationships|length }})
{% endif %}
{% endif %}
{# Addresses Tab #}
Addresses
Add Address
{% for addr in addresses %}
{% if addr.label %}{{ addr.label }}{% endif %} {{ addr.get_address_type_display }} {% if addr.is_default %}Default{% endif %}

{% if addr.first_name or addr.last_name %}{{ addr.first_name }} {{ addr.last_name }}
{% endif %} {% if addr.company_name %}{{ addr.company_name }}
{% endif %} {{ addr.address_line_1 }}
{% if addr.address_line_2 %}{{ addr.address_line_2 }}
{% endif %} {{ addr.city }}, {{ addr.state_province }} {{ addr.postal_code }} {{ addr.country }}

{% if addr.phone %}

{{ addr.phone }}

{% endif %}
{% if addr.is_residential %}Residential{% else %}Commercial{% endif %} {% if addr.has_loading_dock %}Loading Dock{% endif %} {% if addr.has_forklift %}Forklift{% endif %} {% if addr.requires_liftgate %}Liftgate Required{% endif %}
{% if addr.delivery_instructions %}

{{ addr.delivery_instructions }}

{% endif %}
{% csrf_token %}
{% empty %}

No addresses yet.

{% endfor %}
{# More Info Tab #}
Sales Defaults
{% csrf_token %}
{% for field in more_info_form %}
{% if field.field.widget.input_type == "checkbox" %}
{{ field }}
{% else %} {{ field|add_class:"form-control form-control-sm" }} {% endif %} {% if field.errors %}
{{ field.errors.0 }}
{% endif %}
{% endfor %}
{# History Tab #}
{# Recent Quotes #}
Recent {% label "orders.quote" plural=True %}
{% for q in recent_quotes %} {% empty %} {% endfor %}
Quote # Date Status Total
{{ q.quote_number }} {{ q.created_at|date:"M d, Y" }} {{ q.get_status_display }} {{ q.grand_total|money }}
No {% label "orders.quote" plural=True case="lower" %} yet.
{# Recent Orders #}
Recent Orders
{% for o in recent_orders %} {% empty %} {% endfor %}
Order # Date Status Payment Total
{{ o.order_number }} {{ o.created_at|date:"M d, Y" }} {{ o.get_status_display }} {{ o.get_payment_status_display }} {{ o.grand_total|money }}
No orders yet.
{# Activate hash-based tab on page load #} {% endblock %}