2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 11:10:54 +00:00

Add list of pending shipment to home page, with corresponding settings for user (#4775)

This commit is contained in:
miggland
2023-05-07 16:25:51 +02:00
committed by GitHub
parent 89dfb6186f
commit 84f8e33269
4 changed files with 39 additions and 1 deletions

View File

@ -836,6 +836,9 @@ function loadSalesOrderShipmentTable(table, options={}) {
// Add callbacks for expand / collapse buttons
var prefix = options.shipped ? 'completed' : 'pending';
// Add option to show SO reference also
var show_so_reference = options.show_so_reference || false;
$(`#${prefix}-shipments-expand`).click(function() {
$(table).bootstrapTable('expandAllRows');
});
@ -931,6 +934,21 @@ function loadSalesOrderShipmentTable(table, options={}) {
checkbox: true,
switchable: false,
},
{
visible: show_so_reference,
field: 'order_detail',
title: '{% trans "Sales Order" %}',
switchable: false,
formatter: function(value, row) {
var html = renderLink(row.order_detail.reference, `/order/sales-order/${row.order}/`);
if (row.overdue) {
html += makeIconBadge('fa-calendar-times icon-red', '{% trans "Order is overdue" %}');
}
return html;
},
},
{
field: 'reference',
title: '{% trans "Shipment Reference" %}',