mirror of
https://github.com/inventree/InvenTree.git
synced 2025-10-23 17:37:38 +00:00
@@ -1,4 +1,4 @@
|
|||||||
import { Progress, Stack, Text } from '@mantine/core';
|
import { Group, Progress, Stack, Text } from '@mantine/core';
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { formatDecimal } from '../functions/Formatting';
|
import { formatDecimal } from '../functions/Formatting';
|
||||||
|
|
||||||
@@ -9,6 +9,7 @@ export type ProgressBarProps = {
|
|||||||
progressLabel?: boolean;
|
progressLabel?: boolean;
|
||||||
animated?: boolean;
|
animated?: boolean;
|
||||||
size?: string;
|
size?: string;
|
||||||
|
units?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -30,9 +31,12 @@ export function ProgressBar(props: Readonly<ProgressBarProps>) {
|
|||||||
return (
|
return (
|
||||||
<Stack gap={2} style={{ flexGrow: 1, minWidth: '100px' }}>
|
<Stack gap={2} style={{ flexGrow: 1, minWidth: '100px' }}>
|
||||||
{props.progressLabel && (
|
{props.progressLabel && (
|
||||||
<Text ta='center' size='xs'>
|
<Group gap='xs' justify='center'>
|
||||||
{formatDecimal(props.value)} / {formatDecimal(props.maximum)}
|
<Text ta='center' size='xs'>
|
||||||
</Text>
|
{formatDecimal(props.value)} / {formatDecimal(props.maximum)}
|
||||||
|
</Text>
|
||||||
|
{props.units && <Text size='xs'>[{props.units}]</Text>}
|
||||||
|
</Group>
|
||||||
)}
|
)}
|
||||||
<Progress
|
<Progress
|
||||||
value={progress}
|
value={progress}
|
||||||
|
@@ -567,11 +567,15 @@ function BuildAllocateLineRow({
|
|||||||
<Table.Td>
|
<Table.Td>
|
||||||
<RenderPartColumn part={record.part_detail} />
|
<RenderPartColumn part={record.part_detail} />
|
||||||
</Table.Td>
|
</Table.Td>
|
||||||
|
<Table.Td>
|
||||||
|
<Text size='sm'>{record.part_detail?.IPN}</Text>
|
||||||
|
</Table.Td>
|
||||||
<Table.Td>
|
<Table.Td>
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
value={record.allocatedQuantity}
|
value={record.allocatedQuantity}
|
||||||
maximum={record.requiredQuantity - record.consumed}
|
maximum={record.requiredQuantity - record.consumed}
|
||||||
progressLabel
|
progressLabel
|
||||||
|
units={record.part_detail?.units}
|
||||||
/>
|
/>
|
||||||
</Table.Td>
|
</Table.Td>
|
||||||
<Table.Td>
|
<Table.Td>
|
||||||
@@ -624,6 +628,7 @@ export function useAllocateStockToBuildForm({
|
|||||||
value: [],
|
value: [],
|
||||||
headers: [
|
headers: [
|
||||||
{ title: t`Part`, style: { minWidth: '175px' } },
|
{ title: t`Part`, style: { minWidth: '175px' } },
|
||||||
|
{ title: t`IPN`, style: { minWidth: '50px' } },
|
||||||
{ title: t`Allocated`, style: { minWidth: '175px' } },
|
{ title: t`Allocated`, style: { minWidth: '175px' } },
|
||||||
{ title: t`Stock Item`, style: { width: '100%' } },
|
{ title: t`Stock Item`, style: { width: '100%' } },
|
||||||
{ title: t`Quantity`, style: { minWidth: '175px' } },
|
{ title: t`Quantity`, style: { minWidth: '175px' } },
|
||||||
|
Reference in New Issue
Block a user