{% extends "django_program/manage/base.html" %} {% block title %}{{ purchase_order.reference }}{% endblock %} {% block breadcrumb %} {% endblock %} {% block page_title %}

{{ purchase_order.reference }} {% if purchase_order.status == "draft" %} Draft {% elif purchase_order.status == "sent" %} Sent {% elif purchase_order.status == "partially_paid" %} Partially Paid {% elif purchase_order.status == "paid" %} Paid {% elif purchase_order.status == "overpaid" %} Overpaid {% elif purchase_order.status == "cancelled" %} Cancelled {% endif %}

{{ purchase_order.organization_name }}

{% endblock %} {% block content %} {# ── Contact & Billing Info ── #}
Organization
{{ purchase_order.organization_name }}
Contact Name
{% if purchase_order.contact_name %}{{ purchase_order.contact_name }}{% else %}--{% endif %}
Contact Email
Billing Address
{% if purchase_order.billing_address %}{{ purchase_order.billing_address|linebreaksbr }}{% else %}--{% endif %}
Created By
{% if purchase_order.created_by %}{{ purchase_order.created_by.get_full_name|default:purchase_order.created_by.username }}{% else %}--{% endif %}
Created
{{ purchase_order.created_at|date:"N j, Y, P" }}
Updated
{{ purchase_order.updated_at|date:"N j, Y, P" }}
{% if purchase_order.notes %}
Notes
{{ purchase_order.notes|linebreaksbr }}
{% endif %}
{# ── Line Items ── #}

Line Items

{% if line_items %} {% for item in line_items %} {% endfor %} {% if purchase_order.total_credited %} {% endif %}
Description Qty Unit Price Line Total
{{ item.description }} {{ item.quantity }} ${{ item.unit_price }} ${{ item.line_total }}
Subtotal ${{ purchase_order.subtotal }}
Total ${{ purchase_order.total }}
Total Paid ${{ purchase_order.total_paid }}
Total Credits ${{ purchase_order.total_credited }}
Balance Due ${{ purchase_order.balance_due }}
{% else %}

No line items.

{% endif %} {# ── Payments ── #}

Payments

{% if payments %} {% for payment in payments %} {% endfor %}
Date Amount Method Reference Entered By Note
{{ payment.payment_date|date:"M j, Y" }} ${{ payment.amount }} {{ payment.get_method_display }} {% if payment.reference %}{{ payment.reference }}{% else %}--{% endif %} {% if payment.entered_by %}{{ payment.entered_by.get_full_name|default:payment.entered_by.username }}{% else %}--{% endif %} {% if payment.note %}{{ payment.note|truncatewords:10 }}{% else %}--{% endif %}
{% else %}

No payments recorded yet.

{% endif %} {% if purchase_order.status != "cancelled" and purchase_order.status != "paid" %}

Record Payment

{% csrf_token %}
{% endif %} {# ── Credit Notes ── #}

Credit Notes

{% if credit_notes %} {% for cn in credit_notes %} {% endfor %}
Date Amount Reason Issued By
{{ cn.created_at|date:"M j, Y" }} ${{ cn.amount }} {{ cn.reason|truncatewords:20 }} {% if cn.issued_by %}{{ cn.issued_by.get_full_name|default:cn.issued_by.username }}{% else %}--{% endif %}
{% else %}

No credit notes issued.

{% endif %} {% if purchase_order.status != "cancelled" %}

Issue Credit Note

{% csrf_token %}
{% endif %} {# ── Actions ── #}
Download Invoice PDF {% if purchase_order.status == "draft" %}
{% csrf_token %}
{% endif %} {% if purchase_order.status == "draft" or purchase_order.status == "sent" %} {% if conference.stripe_secret_key and not purchase_order.stripe_invoice_id %}
{% csrf_token %}
{% endif %} {% endif %} {% if purchase_order.stripe_invoice_url %} View Stripe Invoice {% endif %} {% if purchase_order.status == "draft" or purchase_order.status == "sent" %} {% if conference.qbo_realm_id and not purchase_order.qbo_invoice_id %}
{% csrf_token %}
{% endif %} {% endif %} {% if purchase_order.qbo_invoice_url %} View QBO Invoice {% endif %} {% if purchase_order.status != "cancelled" and purchase_order.status != "paid" %}
{% csrf_token %}
{% endif %} Back to List
{% endblock %}