mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 21:25:42 +00:00 
			
		
		
		
	Update PO line item table
This commit is contained in:
		| @@ -930,6 +930,7 @@ function loadPurchaseOrderLineItemTable(table, options={}) { | ||||
|                         reference: {}, | ||||
|                         purchase_price: {}, | ||||
|                         purchase_price_currency: {}, | ||||
|                         target_date: {}, | ||||
|                         destination: {}, | ||||
|                         notes: {}, | ||||
|                     }, | ||||
| @@ -971,7 +972,11 @@ function loadPurchaseOrderLineItemTable(table, options={}) { | ||||
|                     ], | ||||
|                     { | ||||
|                         success: function() { | ||||
|                             // Reload the line item table | ||||
|                             $(table).bootstrapTable('refresh'); | ||||
|  | ||||
|                             // Reload the "received stock" table | ||||
|                             $('#stock-table').bootstrapTable('refresh'); | ||||
|                         } | ||||
|                     } | ||||
|                 ); | ||||
| @@ -1111,6 +1116,28 @@ function loadPurchaseOrderLineItemTable(table, options={}) { | ||||
|                     return formatter.format(total); | ||||
|                 } | ||||
|             }, | ||||
|             { | ||||
|                 sortable: true, | ||||
|                 field: 'target_date', | ||||
|                 switchable: true, | ||||
|                 title: '{% trans "Target Date" %}', | ||||
|                 formatter: function(value, row) { | ||||
|                     if (row.target_date) { | ||||
|                         var html = row.target_date; | ||||
|  | ||||
|                         if (row.overdue) { | ||||
|                             html += `<span class='fas fa-calendar-alt icon-red float-right' title='{% trans "This line item is overdue" %}'></span>`; | ||||
|                         } | ||||
|  | ||||
|                         return html; | ||||
|  | ||||
|                     } else if (row.order_detail && row.order_detail.target_date) { | ||||
|                         return `<em>${row.order_detail.target_date}</em>`; | ||||
|                     } else { | ||||
|                         return '-'; | ||||
|                     } | ||||
|                 } | ||||
|             }, | ||||
|             { | ||||
|                 sortable: false, | ||||
|                 field: 'received', | ||||
| @@ -1157,15 +1184,15 @@ function loadPurchaseOrderLineItemTable(table, options={}) { | ||||
|      | ||||
|                     var pk = row.pk; | ||||
|      | ||||
|                     if (options.allow_receive && row.received < row.quantity) { | ||||
|                         html += makeIconButton('fa-sign-in-alt icon-green', 'button-line-receive', pk, '{% trans "Receive line item" %}'); | ||||
|                     } | ||||
|  | ||||
|                     if (options.allow_edit) { | ||||
|                         html += makeIconButton('fa-edit icon-blue', 'button-line-edit', pk, '{% trans "Edit line item" %}'); | ||||
|                         html += makeIconButton('fa-trash-alt icon-red', 'button-line-delete', pk, '{% trans "Delete line item" %}'); | ||||
|                     } | ||||
|  | ||||
|                     if (options.allow_receive && row.received < row.quantity) { | ||||
|                         html += makeIconButton('fa-sign-in-alt', 'button-line-receive', pk, '{% trans "Receive line item" %}'); | ||||
|                     } | ||||
|          | ||||
|                     html += `</div>`; | ||||
|      | ||||
|                     return html; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user