{% extends BASE_TEMPLATE %}

{% load staticfiles %}

{% block head-title %}Add Sellerpart{% endblock %}

{% block title %}
<link rel="stylesheet" type="text/css" href="{% static 'bom/style.css' %}" />
Add Seller Part
{% endblock %}

{% block menu %}
<li><a href="{% url 'part-info' part_id=part.id %}">Cancel</a></li>
{% endblock%}

{% block content %}
<h5>{{ part.full_part_number }} {{ part.description }}</h5>

<div class="row">
    <form name="seller" action="{% url 'part-add-sellerpart' part_id=part.id %}" method="post" class="col s12">
        {% csrf_token %}
        {{ form.non_field_errors }}

        <div class="row">
            <div class="fieldWrapper col s6">
                <label for="{{ form.seller.id_for_label }}"><b>Seller:</b></label>
                {{ form.seller.errors }}
                {{ form.seller }}
            </div>
            <div class="fieldWrapper col s6">
                <label for="{{ form.new_seller.id_for_label }}"><b>-or- New Seller:</b></label>
                {{ form.new_seller.errors }}
                {{ form.new_seller }}
            </div>
        </div>
        <div class="row">
            <div class="fieldWrapper col s3">
                <label for="{{ form.unit_cost.id_for_label }}"><b>Unit Cost:</b></label>
                {{ form.unit_cost.errors }}
                {{ form.unit_cost }}
            </div>
            <div class="fieldWrapper col s3">
                <label for="{{ form.nre_cost.id_for_label }}">NRE Cost:</label>
                {{ form.nre_cost.errors }}
                {{ form.nre_cost }}
            </div>
        </div>
        <div class="row">
            <div class="fieldWrapper col s3">
                <label for="{{ form.minimum_order_quantity.id_for_label }}">Minimum Order Quantity:</label>
                {{ form.minimum_order_quantity.errors }}
                {{ form.minimum_order_quantity }}
            </div>
            <div class="fieldWrapper col s3">
                <label for="{{ form.minimum_pack_quantity.id_for_label }}">Minimum Pack Quantity:</label>
                {{ form.minimum_pack_quantity.errors }}
                {{ form.minimum_pack_quantity }}
            </div>
        </div>
        <div class="row">
            <div class="fieldWrapper col s3">
                <label for="{{ form.lead_time_days.id_for_label }}">Lead Time (Days):</label>
                {{ form.lead_time_days.errors }}
                {{ form.lead_time_days }}
            </div>
        </div>
        <div class="row">
            <div class="fieldWrapper col s3">
                {{ form.ncnr.errors }}
                {{ form.ncnr }}
                <label for="{{ form.ncnr.id_for_label }}">NCNR</label>
            </div>
        </div>

        <input class="waves-effect waves-light btn green lighten-1" type="submit" value="Save" />
        <a href="javascript:history.back()" class="waves-effect waves-light btn green lighten-1">Cancel</a>
    </form>
</div>
{% endblock %}