{% extends "company/company_base.html" %}
{% load static %}
{% load i18n %}

{% block details %}

{% include 'company/tabs.html' with tab='co' %}

<h4>{% trans "Sales Orders" %}</h4>
<hr>

<div id='button-bar'>
    <div class='button-toolbar container-fluid' style='float: right;'>
        <button class='btn btn-primary' type='button' id='new-sales-order' title='{% trans "Create new sales order" %}'>{% trans "New Sales Order" %}</button>
        <div class='filter-list' id='filter-list-salesorder'>
            <!-- Empty div -->
        </div>
    </div>
</div>

<table class='table table-striped table-condensed po-table' id='sales-order-table' data-toolbar='#button-bar'>
</table>

{% endblock %}

{% block js_ready %}
{{ block.super }}

    loadSalesOrderTable("#sales-order-table", {
        url: "{% url 'api-so-list' %}",
        params: {
            customer: {{ company.id }},
        }
    });


    $("#new-sales-order").click(function() {
        // TODO - Create a new sales order
    });

{% endblock %}
{% extends "company/company_base.html" %}
{% load static %}
{% load i18n %}

{% block details %}

{% include 'company/tabs.html' with tab='co' %}

<h4>{% trans "Sales Orders" %}</h4>
<hr>

<div id='button-bar'>
    <div class='button-toolbar container-fluid' style='float: right;'>
        <button class='btn btn-primary' type='button' id='new-sales-order' title='{% trans "Create new sales order" %}'>{% trans "New Sales Order" %}</button>
        <div class='filter-list' id='filter-list-salesorder'>
            <!-- Empty div -->
        </div>
    </div>
</div>

<table class='table table-striped table-condensed po-table' id='sales-order-table' data-toolbar='#button-bar'>
</table>

{% endblock %}

{% block js_ready %}
{{ block.super }}

    loadSalesOrderTable("#sales-order-table", {
        url: "{% url 'api-so-list' %}",
        params: {
            customer: {{ company.id }},
        }
    });

    $("#new-sales-order").click(function() {
        launchModalForm(
            "{% url 'so-create' %}",
            {
                data: {
                    customer: {{ company.id }},
                },
                follow: true,
            },
        );
    });

{% endblock %}
Fix "New Sales Order" button in Customer detail view
Fix "New Sales Order" button in Customer detail view
