2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-04-04 10:31:03 +00:00

Patch Sales Order line items progress bar to count fully allocated line items (#11102)

* Added "allocated_lines" to the backend and frontend tables

* Remove incorrectly added UI panels from Sales Order Detail

* bump api version

---------

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
Tom Murray
2026-01-30 01:42:30 +02:00
committed by GitHub
parent e554cf2a58
commit d00d472d35
4 changed files with 46 additions and 1 deletions

View File

@@ -351,6 +351,25 @@ export function LineItemsProgressColumn(props: TableColumnProps): TableColumn {
};
}
export function AllocatedLinesProgressColumn(
props: TableColumnProps
): TableColumn {
return {
accessor: 'allocated_lines',
sortable: true,
title: t`Allocated Lines`,
minWidth: 125,
render: (record: any) => (
<ProgressBar
progressLabel={true}
value={record.allocated_lines}
maximum={record.line_items}
/>
),
...props
};
}
export function ProjectCodeColumn(props: TableColumnProps): TableColumn {
const globalSettings = useGlobalSettingsState.getState();
const enabled = globalSettings.isSet('PROJECT_CODES_ENABLED', true);

View File

@@ -14,6 +14,7 @@ import { useCreateApiFormModal } from '../../hooks/UseForm';
import { useTable } from '../../hooks/UseTable';
import { useUserState } from '../../states/UserState';
import {
AllocatedLinesProgressColumn,
CompanyColumn,
CreatedByColumn,
CreationDateColumn,
@@ -142,6 +143,9 @@ export function SalesOrderTable({
},
DescriptionColumn({}),
LineItemsProgressColumn({}),
AllocatedLinesProgressColumn({
defaultVisible: false
}),
{
accessor: 'shipments_count',
title: t`Shipments`,