mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #1691 from matmair/purchase-price-zero
Purchase price zero
This commit is contained in:
commit
b7a5a7f524
@ -137,7 +137,7 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<h4>{% trans 'Stock Pricing' %}<i class="fas fa-info-circle" title="Shows the purchase prices of stock for this part.
|
<h4>{% trans 'Stock Pricing' %}<i class="fas fa-info-circle" title="Shows the purchase prices of stock for this part.
|
||||||
The part single price is the current purchase price for that supplier part."></i></h4>
|
The part single price is the current purchase price for that supplier part."></i></h4>
|
||||||
{% if price_history|length > 1 %}
|
{% if price_history|length > 0 %}
|
||||||
<div style="max-width: 99%; min-height: 300px">
|
<div style="max-width: 99%; min-height: 300px">
|
||||||
<canvas id="StockPriceChart"></canvas>
|
<canvas id="StockPriceChart"></canvas>
|
||||||
</div>
|
</div>
|
||||||
|
@ -814,7 +814,7 @@ class PartPricingView(PartDetail):
|
|||||||
part = self.get_part()
|
part = self.get_part()
|
||||||
# Stock history
|
# Stock history
|
||||||
if part.total_stock > 1:
|
if part.total_stock > 1:
|
||||||
ret = []
|
price_history = []
|
||||||
stock = part.stock_entries(include_variants=False, in_stock=True) # .order_by('purchase_order__date')
|
stock = part.stock_entries(include_variants=False, in_stock=True) # .order_by('purchase_order__date')
|
||||||
stock = stock.prefetch_related('purchase_order', 'supplier_part')
|
stock = stock.prefetch_related('purchase_order', 'supplier_part')
|
||||||
|
|
||||||
@ -841,9 +841,9 @@ class PartPricingView(PartDetail):
|
|||||||
line['date'] = stock_item.purchase_order.issue_date.strftime('%d.%m.%Y')
|
line['date'] = stock_item.purchase_order.issue_date.strftime('%d.%m.%Y')
|
||||||
else:
|
else:
|
||||||
line['date'] = stock_item.tracking_info.first().date.strftime('%d.%m.%Y')
|
line['date'] = stock_item.tracking_info.first().date.strftime('%d.%m.%Y')
|
||||||
ret.append(line)
|
price_history.append(line)
|
||||||
|
|
||||||
ctx['price_history'] = ret
|
ctx['price_history'] = price_history
|
||||||
|
|
||||||
# BOM Information for Pie-Chart
|
# BOM Information for Pie-Chart
|
||||||
if part.has_bom:
|
if part.has_bom:
|
||||||
|
@ -325,7 +325,7 @@
|
|||||||
<td><a href="{% url 'po-detail' item.purchase_order.id %}">{{ item.purchase_order }}</a></td>
|
<td><a href="{% url 'po-detail' item.purchase_order.id %}">{{ item.purchase_order }}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if item.purchase_price %}
|
{% if item.purchase_price != None %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><span class='fas fa-dollar-sign'></span></td>
|
<td><span class='fas fa-dollar-sign'></span></td>
|
||||||
<td>{% trans "Purchase Price" %}</td>
|
<td>{% trans "Purchase Price" %}</td>
|
||||||
|
Loading…
Reference in New Issue
Block a user