2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 13:05:42 +00:00

Form for creating a new price break for a supplier part

This commit is contained in:
Oliver Walters
2019-05-18 16:42:57 +10:00
parent 1163f60b23
commit fc3072a459
6 changed files with 112 additions and 10 deletions

View File

@ -10,7 +10,7 @@ InvenTree | {{ company.name }} - Parts
<div class='row'>
<div class='col-sm-6'>
<h3>Supplier Part</h3>
<p>{{ part.SKU }} - <a href="{% url 'company-detail-parts' part.supplier.id %}">{{ part.supplier.name }}</a></p>
<p><a href="{% url 'company-detail-parts' part.supplier.id %}">{{ part.supplier.name }}</a> - {{ part.SKU }}</p>
</div>
<div class='col-sm-6'>
<h3>
@ -59,29 +59,41 @@ InvenTree | {{ company.name }} - Parts
<div class='col-sm-6'>
<table class="table table-striped table-condensed">
<tr><th colspan='2'>Pricing</th></tr>
<tr><td>Single Price</td><td>{{ part.single_price }}</td></tr>
{% if part.multiple > 1 %}
<tr>
<th colspan='2'>Pricing</th>
</tr>
<tr><td>Order Multiple</td><td>{{ part.multiple }}</td></tr>
{% endif %}
{% if part.base_cost > 0 %}
<tr><td>Base Price (Flat Fee)</td><td>{{ part.base_cost }}</td></tr>
{% endif %}
{% if part.minimum > 1 %}
<tr><td>Minimum Order Quantity</td><td>{{ part.minimum }}</td></tr>
{% endif %}
{% if part.price_breaks.all %}
<tr><th colspan='2'>Price Breaks</th></tr>
<tr>
<th>Price Breaks</th>
<th>
<div style='float: right;'>
<button class='btn btn-primary' id='new-price-break' type='button'>New Price Break</button>
</div>
</th>
</tr>
<tr>
<th>Quantity</th>
<th>Price</th>
</tr>
{% if part.price_breaks.all %}
{% for pb in part.price_breaks.all %}
<tr>
<td>{{ pb.quantity }}</td>
<td>{{ pb.cost }}</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td colspan='2'>
<span class='warning-msg'><i>No price breaks have been added for this part</i></span>
</td>
</tr>
{% endif %}
</table>
</div>
@ -89,9 +101,7 @@ InvenTree | {{ company.name }} - Parts
<br>
<div>
<button class='btn btn-primary' type='button'>New Price Break</button>
</div>
{% include 'modals.html' %}
@ -116,4 +126,16 @@ InvenTree | {{ company.name }} - Parts
}
);
});
$('#new-price-break').click(function() {
launchModalForm("{% url 'price-break-create' %}",
{
reload: true,
data: {
part: {{ part.id }},
}
}
);
});
{% endblock %}