mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-17 20:45:44 +00:00
Display build pricing information
This commit is contained in:
@ -36,6 +36,19 @@ InvenTree | Build - {{ build }}
|
||||
<td>Quantity</td>
|
||||
<td>{{ build.quantity }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>BOM Price</td>
|
||||
<td>
|
||||
{% if bom_price %}
|
||||
{{ bom_price }}
|
||||
{% if build.part.has_complete_bom_pricing == False %}
|
||||
<span class='warning-msg'><i>BOM pricing is incomplete</i></span>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<span class='warning-msg'><i>No pricing information</i></span>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -265,6 +265,16 @@ class BuildDetail(DetailView):
|
||||
template_name = 'build/detail.html'
|
||||
context_object_name = 'build'
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
|
||||
ctx = super(DetailView, self).get_context_data(**kwargs)
|
||||
|
||||
build = self.get_object()
|
||||
|
||||
ctx['bom_price'] = build.part.get_price_info(build.quantity, buy=False)
|
||||
|
||||
return ctx
|
||||
|
||||
|
||||
class BuildAllocate(DetailView):
|
||||
""" View for allocating parts to a Build """
|
||||
|
Reference in New Issue
Block a user