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:
@@ -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);
|
||||
|
||||
@@ -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`,
|
||||
|
||||
Reference in New Issue
Block a user