{% extends "base.html" %} {% load static %} {% block title %}Orders — {{ vendor.store_name }}{% endblock %} {% block extra_css %} {% endblock %} {% block body %}

Orders

Manage and deliver your orders — funds held securely until confirmed

{% if not has_payout_account %} ⚠ Set Up Payout Account {% endif %}
{% if not has_payout_account %}
You haven't set up a payout account yet. Your earnings cannot be released until you do. Set it up now →
{% endif %} {% if orders %}
{% for vo in orders %}
{{ vo.order.order_number }}
{{ vo.created_at|date:"M d, Y H:i" }}
{{ vo.order.items.first.currency|default:"GHS" }} {{ vo.total_amount }}
{% if vo.escrow %}
Payout: GHS {{ vo.escrow.seller_payout }}
{% endif %}
{% if vo.escrow %}
{% if vo.escrow.status == 'held' %}🔒 Funds Held {% elif vo.escrow.status == 'delivery_uploaded' %}🕑 Awaiting Buyer Confirmation {% elif vo.escrow.status == 'buyer_confirmed' %}✓ Buyer Confirmed {% elif vo.escrow.status == 'released' or vo.escrow.status == 'auto_released' %}💰 Paid Out {% elif vo.escrow.status == 'disputed' %}⚠ Disputed {% elif vo.escrow.status == 'payment_pending' %}⏱ Payment Pending {% else %}{{ vo.escrow.get_status_display }} {% endif %}
{% endif %} {% if vo.escrow and vo.escrow.status == 'held' %}
✓ Paid Processing Shipped Delivered
{% endif %}
Customer: {{ vo.order.customer_name }}
Phone: {{ vo.order.customer_phone|default:"—" }}
Address: {{ vo.order.delivery_address|truncatechars:60 }}
{% for item in vo.order.items.all %} {% if item.vendor_id == vo.vendor_id %}
{{ item.product_name }} x{{ item.quantity }} {{ item.currency }} {{ item.subtotal }}
{% endif %} {% endfor %}
{% if vo.escrow %} {% if vo.escrow.status == 'held' %} {# Step 1: confirmed → processing #} {% if vo.status == 'confirmed' %}
{% csrf_token %}
{# Step 2: processing → shipped #} {% elif vo.status == 'processing' %}
{% csrf_token %}
{# Step 3: shipped → deliver (uploads proof) #} {% elif vo.status == 'shipped' %} ✓ Mark Delivered {# Also allow skipping straight to deliver from confirmed/processing #} {% else %} ✓ Mark Delivered {% endif %} {% elif vo.escrow.status == 'delivery_uploaded' %} Awaiting buyer confirmation by {{ vo.escrow.auto_release_after|date:"M d H:i" }} {% elif vo.escrow.status in 'released,auto_released,buyer_confirmed' %} ✓ Payment released {% endif %} {% else %} {# Legacy status update for non-secure-payment orders #}
{% csrf_token %}
{% endif %}
{% endfor %}
{% else %}

No orders yet

When customers order your products, they'll appear here.

{% endif %}
{% endblock %}