mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-30 20:55:42 +00:00 
			
		
		
		
	Calculate how many items to assign to sales order
- Do not over-allocate by default
This commit is contained in:
		| @@ -1658,7 +1658,7 @@ function allocateStockToSalesOrder(order_id, line_items, options={}) { | ||||
|                             var available = Math.max((data.quantity || 0) - (data.allocated || 0), 0); | ||||
|  | ||||
|                             // Remaining quantity to be allocated? | ||||
|                             var remaining = opts.quantity || available; | ||||
|                             var remaining = Math.max(line_item.quantity - line_item.shipped - line_item.allocated, 0); | ||||
|  | ||||
|                             // Maximum amount that we need | ||||
|                             var desired = Math.min(available, remaining); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user