mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	Build table now also shows availability of substitute stock
This commit is contained in:
		| @@ -808,13 +808,12 @@ function loadBomTable(table, options={}) { | ||||
|  | ||||
|             // Calculate total "available" (unallocated) quantity | ||||
|             var total = row.available_stock + row.available_substitute_stock; | ||||
|             // var text = row.available_substitute_stock + row.available_stock; | ||||
|  | ||||
|             var text = `${total}`; | ||||
|  | ||||
|             if (total <= 0) { | ||||
|                 text = `<span class='badge rounded-pill bg-danger'>{% trans "No Stock Available" %}</span>`; | ||||
|             } else { | ||||
|                 text = `${total}`; | ||||
|  | ||||
|                 if (row.available_substitute_stock > 0) { | ||||
|                     text += `<span title='{% trans "Includes substitute stock" %}' class='fas fa-info-circle float-right icon-blue'></span>`; | ||||
|                 } | ||||
|   | ||||
| @@ -1421,9 +1421,24 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) { | ||||
|                 sortable: true, | ||||
|             }, | ||||
|             { | ||||
|                 field: 'sub_part_detail.stock', | ||||
|                 field: 'available_stock', | ||||
|                 title: '{% trans "Available" %}', | ||||
|                 sortable: true, | ||||
|                 formatter: function(value, row) { | ||||
|                     var total = row.available_stock + row.available_substitute_stock; | ||||
|  | ||||
|                     var text = `${total}`; | ||||
|  | ||||
|                     if (total <= 0) { | ||||
|                         text = `<span class='badge rounded-pill bg-danger'>{% trans "No Stock Available" %}</span>`; | ||||
|                     } else { | ||||
|                         if (row.available_substitute_stock > 0) { | ||||
|                             text += `<span title='{% trans "Includes substitute stock" %}' class='fas fa-info-circle float-right icon-blue'></span>`; | ||||
|                         } | ||||
|                     } | ||||
|  | ||||
|                     return text; | ||||
|                 } | ||||
|             }, | ||||
|             { | ||||
|                 field: 'allocated', | ||||
|   | ||||
		Reference in New Issue
	
	Block a user