mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-30 20:55:42 +00:00 
			
		
		
		
	Merge pull request #1691 from matmair/purchase-price-zero
Purchase price zero
This commit is contained in:
		| @@ -137,7 +137,7 @@ | ||||
|     <hr> | ||||
|     <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> | ||||
|     {% if price_history|length > 1 %} | ||||
|     {% if price_history|length > 0 %} | ||||
|         <div style="max-width: 99%; min-height: 300px"> | ||||
|             <canvas id="StockPriceChart"></canvas> | ||||
|         </div> | ||||
|   | ||||
| @@ -814,7 +814,7 @@ class PartPricingView(PartDetail): | ||||
|         part = self.get_part() | ||||
|         # Stock history | ||||
|         if part.total_stock > 1: | ||||
|             ret = [] | ||||
|             price_history = [] | ||||
|             stock = part.stock_entries(include_variants=False, in_stock=True)  # .order_by('purchase_order__date') | ||||
|             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') | ||||
|                 else: | ||||
|                     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 | ||||
|         if part.has_bom: | ||||
|   | ||||
| @@ -325,7 +325,7 @@ | ||||
|         <td><a href="{% url 'po-detail' item.purchase_order.id %}">{{ item.purchase_order }}</a></td> | ||||
|     </tr> | ||||
|     {% endif %} | ||||
|     {% if item.purchase_price %} | ||||
|     {% if item.purchase_price != None %} | ||||
|     <tr> | ||||
|         <td><span class='fas fa-dollar-sign'></span></td> | ||||
|         <td>{% trans "Purchase Price" %}</td> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user