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

{% block details %}

{% include "company/supplier_part_tabs.html" with tab='orders' %}

<h4>{% trans "Supplier Part Orders" %}</h4>

<hr>

{% if roles.purchase_order.add %}
<div id='button-bar'>
    <div class='btn-group'>
        <button class='btn btn-primary' type='button' id='order-part2' title='Order part'>
            <span class='fas fa-shopping-cart'></span> {% trans "Order Part" %}</button>
    </div>
</div>
{% endif %}
    
<table class='table table-striped table-condensed po-table' id='purchase-order-table' data-toolbar='#button-bar'>
</table>

{% endblock %}

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

loadPurchaseOrderTable($("#purchase-order-table"), {
    url: "{% url 'api-po-list' %}?supplier_part={{ part.id }}",
});

{% endblock %}