{% comment %}
Send forms, deliberately siblings of #document-form rather than children.
Nesting a
is a parse error: the HTML5 parser drops the inner tag,
its submit button silently becomes a submit control for the OUTER form,
and "Email" POSTs to the edit URL and just saves the document. Verified in
Chrome: the nested form does not exist in the DOM at all.
Buttons reach these via form="...".
{% endcomment %}
{% if is_edit and doc_type_label == "Sales Order" and existing_invoice %}
{% csrf_token %}{% once_field %}
{% endif %}
{% if is_edit and people_url %}
{% csrf_token %}
{% endif %}
{% if is_edit and doc_type_label == "Quote" and object.status != "cancelled" %}
{% csrf_token %}{% once_field %}
{% csrf_token %}{% once_field %}
{% endif %}
{# ===== RESEND EMAIL MODAL ===== #}
{% if is_edit and doc_type_label == "Sales Order" %}
Resend Order Confirmation
{% if last_email_log %}
Last sent: {{ last_email_log.created_at|date:"M j, Y g:i A" }} to {{ last_email_log.recipient_email }}
{% if last_email_log.status == "failed" %}(failed){% endif %}
{% endif %}
{% endif %}
{# ===== ADDRESS MODAL ===== #}
Add New Address
{# ===== CUSTOMER MODAL ===== #}
Add New Customer
{# ===== CONTACT MODAL ===== #}
Add New Contact
{# ===== SHIPPING RATES MODAL ===== #}
Shipping Rates
Fetching live shipping rates...
Carrier
Service
Rate
Transit
{# ===== TOAST CONTAINER ===== #}
{% endblock %}
{% block javascripts %}
{% if show_shipment_groups %}
{% endif %}
{% if sub_orders_tracking %}
{% include "erp/_tracking_section_js.html" %}
{% endif %}
{% if po_sub_order_tracking %}
{% include "erp/_tracking_section_js.html" %}
{% endif %}
{% if pt_sub_order_tracking %}
{% include "erp/_tracking_section_js.html" %}
{% endif %}
{% if is_edit and people_url %}
{% endif %}
{% endblock %}