mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 21:25:42 +00:00 
			
		
		
		
	Display batch code for stock items in forms
This commit is contained in:
		| @@ -99,14 +99,22 @@ function renderStockItem(name, data, parameters={}, options={}) { | ||||
|  | ||||
|     var stock_detail = ''; | ||||
|  | ||||
|     if (data.serial && data.quantity == 1) { | ||||
|         stock_detail = `{% trans "Serial Number" %}: ${data.serial}`; | ||||
|     } else if (data.quantity == 0) { | ||||
|     if (data.quantity == 0) { | ||||
|         stock_detail = `<span class='badge rounded-pill bg-danger'>{% trans "No Stock"% }</span>`; | ||||
|     } else { | ||||
|         stock_detail = `{% trans "Quantity" %}: ${data.quantity}`; | ||||
|         if (data.serial && data.quantity == 1) { | ||||
|             stock_detail = `{% trans "Serial Number" %}: ${data.serial}`; | ||||
|         } else { | ||||
|             stock_detail = `{% trans "Quantity" %}: ${data.quantity}`; | ||||
|         } | ||||
|  | ||||
|         if (data.batch != null) { | ||||
|             stock_detail += ` - <small>{% trans "Batch" %}: ${data.batch}</small>`; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|  | ||||
|  | ||||
|     var html = ` | ||||
|     <span> | ||||
|         ${part_detail} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user