mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	part variant table now displays information about variant stock quantities
This commit is contained in:
		| @@ -672,7 +672,20 @@ function loadPartVariantTable(table, partId, options={}) { | ||||
|             field: 'in_stock', | ||||
|             title: '{% trans "Stock" %}', | ||||
|             formatter: function(value, row) { | ||||
|                 return renderLink(value, `/part/${row.pk}/?display=part-stock`); | ||||
|  | ||||
|                 var base_stock = row.in_stock; | ||||
|                 var variant_stock = row.variant_stock || 0; | ||||
|  | ||||
|                 var total = base_stock + variant_stock; | ||||
|  | ||||
|                 var text = `${total}`; | ||||
|  | ||||
|                 if (variant_stock > 0) { | ||||
|                     text = `<em>${text}</em>`; | ||||
|                     text += `<span title='{% trans "Includes variant stock" %}' class='fas fa-info-circle float-right icon-blue'></span>`; | ||||
|                 } | ||||
|  | ||||
|                 return renderLink(text, `/part/${row.pk}/?display=part-stock`); | ||||
|             } | ||||
|         } | ||||
|     ]; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user