2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-14 15:41:10 +00:00

Add pop-up pricing window for part

- Cost to purchase from suppliers
- Cost to build from BOM
This commit is contained in:
Oliver Walters
2019-05-18 22:58:11 +10:00
parent 54ccf6c7b3
commit dcf79338c1
6 changed files with 132 additions and 2 deletions

View File

@@ -32,10 +32,13 @@
<p><i>{{ part.description }}</i></p>
<p>
<div class='btn-group'>
{% include "qr_button.html" %}
<button type='button' class='btn btn-default btn-glyph' id='toggle-starred' title='Star this part'>
<span id='part-star-icon' class='starred-part glyphicon {% if starred %}glyphicon-star{% else %}glyphicon-star-empty{% endif %}'/>
</button>
{% include "qr_button.html" %}
<button type='button' class='btn btn-default btn-glyph' id='price-button' title='Show pricing information'>
<span id='part-price-icon' class='part-price glyphicon glyphicon-usd'/>
</button>
</div>
</p>
<table class='table table-condensed'>
@@ -141,6 +144,15 @@
);
});
$("#price-button").click(function() {
launchModalForm(
"{% url 'part-pricing' part.id %}",
{
submit_text: 'Calculate',
}
);
});
$("#toggle-starred").click(function() {
toggleStar({
part: {{ part.id }},

View File

@@ -0,0 +1,41 @@
{% extends "modal_form.html" %}
{% block pre_form_content %}
<div class='alert alert-info alert-block'>
Calculate pricing information for {{ part }}.
</div>
<table class='table table-striped table-condensed'>
<tr>
<td><b>Part</b></td>
<td>{{ part }}</td>
</tr>
<tr>
<td><b>Quantity</b></td>
<td>{{ quantity }}</td>
</tr>
{% if buy_price %}
<tr>
<td><b>Buy Cost</b></td>
<td>{{ buy_price }}</td>
</tr>
{% endif %}
{% if bom_price %}
<tr>
<td><b>BOM Cost</b></td>
<td>{{ bom_price }}</td>
</tr>
{% if part.has_complete_bom_pricing == false %}
<tr>
<td colspan='2'>
<span class='warning-msg'><i>BOM pricing is incomplete</i></span>
</td>
</tr>
{% endif %}
{% endif %}
</table>
<hr>
{% endblock %}