mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 21:25:42 +00:00 
			
		
		
		
	More stuff:
- Pass tracking number through when completing a shipment - Reload tables automatically when certain actions are performed - Limit stock items to only those with available stock
This commit is contained in:
		| @@ -67,7 +67,10 @@ function completeShipment(shipment_id) { | ||||
|         confirm: true, | ||||
|         confirmMessage: '{% trans "Confirm Shipment" %}', | ||||
|         onSuccess: function(data) { | ||||
|             // TODO | ||||
|             // Reload tables | ||||
|             $('#so-lines-table').bootstrapTable('refresh'); | ||||
|             $('#pending-shipments-table').bootstrapTable('refresh'); | ||||
|             $('#completed-shipments-table').bootstrapTable('refresh'); | ||||
|         } | ||||
|     }); | ||||
| } | ||||
| @@ -1249,7 +1252,9 @@ function loadSalesOrderShipmentTable(table, options={}) { | ||||
|  | ||||
|         html += makeIconButton('fa-edit icon-blue', 'button-shipment-edit', pk, '{% trans "Edit shipment" %}'); | ||||
|  | ||||
|         html += makeIconButton('fa-truck icon-green', 'button-shipment-ship', pk, '{% trans "Complete shipment" %}'); | ||||
|         if (!options.shipped) { | ||||
|             html += makeIconButton('fa-truck icon-green', 'button-shipment-ship', pk, '{% trans "Complete shipment" %}'); | ||||
|         } | ||||
|  | ||||
|         html += `</div>`; | ||||
|  | ||||
| @@ -1300,7 +1305,10 @@ function loadSalesOrderShipmentTable(table, options={}) { | ||||
|         onPostBody: function() { | ||||
|             setupShipmentCallbacks(); | ||||
|  | ||||
|             $(table).bootstrapTable('expandAllRows'); | ||||
|             // Auto-expand rows on the "pending" table | ||||
|             if (!options.shipped) { | ||||
|                 $(table).bootstrapTable('expandAllRows'); | ||||
|             } | ||||
|         }, | ||||
|         formatNoMatches: function() { | ||||
|             return '{% trans "No matching shipments found" %}'; | ||||
| @@ -1557,6 +1565,7 @@ function allocateStockToSalesOrder(order_id, line_items, options={}) { | ||||
|                             in_stock: true, | ||||
|                             part_detail: true, | ||||
|                             location_detail: true, | ||||
|                             available: true, | ||||
|                         }, | ||||
|                         model: 'stockitem', | ||||
|                         required: true, | ||||
| @@ -2296,7 +2305,11 @@ function loadSalesOrderLineItemTable(table, options={}) { | ||||
|                 ], | ||||
|                 { | ||||
|                     success: function() { | ||||
|                         // Reload this table | ||||
|                         $(table).bootstrapTable('refresh'); | ||||
|  | ||||
|                         // Reload the pending shipment table | ||||
|                         $('#pending-shipments-table').bootstrapTable('refresh'); | ||||
|                     } | ||||
|                 } | ||||
|             ); | ||||
|   | ||||
| @@ -1282,7 +1282,7 @@ function loadStockTable(table, options) { | ||||
|                 if (row.serial != null && row.quantity == 1) { | ||||
|                     html += makeIconBadge('fa-bookmark icon-yellow', '{% trans "Serialized stock item has been allocated" %}'); | ||||
|                 } else if (row.allocated >= row.quantity) { | ||||
|                     html += makeIconBadge('fa-bookmark icon-red', '{% trans "Stock item has been fully allocated" %}'); | ||||
|                     html += makeIconBadge('fa-bookmark icon-yellow', '{% trans "Stock item has been fully allocated" %}'); | ||||
|                 } else { | ||||
|                     html += makeIconBadge('fa-bookmark', '{% trans "Stock item has been partially allocated" %}'); | ||||
|                 } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user