mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-03 22:55:43 +00:00 
			
		
		
		
	Pre-fill the form with the remaining allocation quantity
This commit is contained in:
		@@ -1641,6 +1641,13 @@ function loadSalesOrderLineItemTable(table, options={}) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            var line_item = $(table).bootstrapTable('getRowByUniqueId', pk);
 | 
					            var line_item = $(table).bootstrapTable('getRowByUniqueId', pk);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            // Quantity remaining to be allocated
 | 
				
			||||||
 | 
					            var remaining = (line_item.quantity || 0) - (line_item.allocated || 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            if (remaining < 0) {
 | 
				
			||||||
 | 
					                remaining = 0;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            var fields = {
 | 
					            var fields = {
 | 
				
			||||||
                // SalesOrderLineItem reference
 | 
					                // SalesOrderLineItem reference
 | 
				
			||||||
                line: {
 | 
					                line: {
 | 
				
			||||||
@@ -1657,6 +1664,7 @@ function loadSalesOrderLineItemTable(table, options={}) {
 | 
				
			|||||||
                    } 
 | 
					                    } 
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
                quantity: {
 | 
					                quantity: {
 | 
				
			||||||
 | 
					                    value: remaining,
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user