mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Required quantity display (#7938)
* Add "required" badge to PUI part detail page * Add "required for orders" to CUI
This commit is contained in:
parent
8c6275b845
commit
9239c82113
@ -211,6 +211,13 @@
|
|||||||
<td>{% decimal on_order %} {% include "part/part_units.html" %}</td>
|
<td>{% decimal on_order %} {% include "part/part_units.html" %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if required > 0 %}
|
||||||
|
<tr>
|
||||||
|
<td><span class='fas fa-clipboard-check'></span></td>
|
||||||
|
<td>{% trans "Required for Orders" %}</td>
|
||||||
|
<td>{% decimal required %}</td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
{% if part.component %}
|
{% if part.component %}
|
||||||
{% if required_build_order_quantity > 0 or allocated_build_order_quantity > 0 %}
|
{% if required_build_order_quantity > 0 or allocated_build_order_quantity > 0 %}
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -19,6 +19,7 @@ import {
|
|||||||
IconCircleMinus,
|
IconCircleMinus,
|
||||||
IconCirclePlus,
|
IconCirclePlus,
|
||||||
IconCircleX,
|
IconCircleX,
|
||||||
|
IconClipboardCheck,
|
||||||
IconClipboardList,
|
IconClipboardList,
|
||||||
IconClipboardText,
|
IconClipboardText,
|
||||||
IconCopy,
|
IconCopy,
|
||||||
@ -212,6 +213,7 @@ const icons = {
|
|||||||
barLine: IconMinusVertical,
|
barLine: IconMinusVertical,
|
||||||
batch: IconClipboardText,
|
batch: IconClipboardText,
|
||||||
batch_code: IconClipboardText,
|
batch_code: IconClipboardText,
|
||||||
|
tick_off: IconClipboardCheck,
|
||||||
destination: IconFlag,
|
destination: IconFlag,
|
||||||
repeat_destination: IconFlagShare,
|
repeat_destination: IconFlagShare,
|
||||||
unlink: IconUnlink,
|
unlink: IconUnlink,
|
||||||
|
@ -130,6 +130,10 @@ export default function PartDetail() {
|
|||||||
refetchOnMount: true
|
refetchOnMount: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
part.required =
|
||||||
|
(part?.required_for_build_orders ?? 0) +
|
||||||
|
(part?.required_for_sales_orders ?? 0);
|
||||||
|
|
||||||
const detailsPanel = useMemo(() => {
|
const detailsPanel = useMemo(() => {
|
||||||
if (instanceQuery.isFetching) {
|
if (instanceQuery.isFetching) {
|
||||||
return <Skeleton />;
|
return <Skeleton />;
|
||||||
@ -258,6 +262,13 @@ export default function PartDetail() {
|
|||||||
unit: true,
|
unit: true,
|
||||||
hidden: !part.purchaseable || part.ordering <= 0
|
hidden: !part.purchaseable || part.ordering <= 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
type: 'string',
|
||||||
|
name: 'required',
|
||||||
|
label: t`Required for Orders`,
|
||||||
|
hidden: part.required <= 0,
|
||||||
|
icon: 'tick_off'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: 'progressbar',
|
type: 'progressbar',
|
||||||
name: 'allocated_to_build_orders',
|
name: 'allocated_to_build_orders',
|
||||||
@ -285,7 +296,7 @@ export default function PartDetail() {
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
name: 'building',
|
name: 'building',
|
||||||
unit: true,
|
unit: true,
|
||||||
label: t`Building`,
|
label: t`In Production`,
|
||||||
hidden: !part.assembly || !part.building
|
hidden: !part.assembly || !part.building
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
@ -838,6 +849,9 @@ export default function PartDetail() {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const required =
|
||||||
|
part.required_for_build_orders + part.required_for_sales_orders;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
<DetailsBadge
|
<DetailsBadge
|
||||||
label={t`In Stock` + `: ${part.total_in_stock}`}
|
label={t`In Stock` + `: ${part.total_in_stock}`}
|
||||||
@ -857,6 +871,12 @@ export default function PartDetail() {
|
|||||||
visible={part.total_in_stock == 0}
|
visible={part.total_in_stock == 0}
|
||||||
key="no_stock"
|
key="no_stock"
|
||||||
/>,
|
/>,
|
||||||
|
<DetailsBadge
|
||||||
|
label={t`Required` + `: ${required}`}
|
||||||
|
color="grape"
|
||||||
|
visible={required > 0}
|
||||||
|
key="required"
|
||||||
|
/>,
|
||||||
<DetailsBadge
|
<DetailsBadge
|
||||||
label={t`On Order` + `: ${part.ordering}`}
|
label={t`On Order` + `: ${part.ordering}`}
|
||||||
color="blue"
|
color="blue"
|
||||||
|
Loading…
Reference in New Issue
Block a user