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>
|
||||
</tr>
|
||||
{% 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 required_build_order_quantity > 0 or allocated_build_order_quantity > 0 %}
|
||||
<tr>
|
||||
|
@ -19,6 +19,7 @@ import {
|
||||
IconCircleMinus,
|
||||
IconCirclePlus,
|
||||
IconCircleX,
|
||||
IconClipboardCheck,
|
||||
IconClipboardList,
|
||||
IconClipboardText,
|
||||
IconCopy,
|
||||
@ -212,6 +213,7 @@ const icons = {
|
||||
barLine: IconMinusVertical,
|
||||
batch: IconClipboardText,
|
||||
batch_code: IconClipboardText,
|
||||
tick_off: IconClipboardCheck,
|
||||
destination: IconFlag,
|
||||
repeat_destination: IconFlagShare,
|
||||
unlink: IconUnlink,
|
||||
|
@ -130,6 +130,10 @@ export default function PartDetail() {
|
||||
refetchOnMount: true
|
||||
});
|
||||
|
||||
part.required =
|
||||
(part?.required_for_build_orders ?? 0) +
|
||||
(part?.required_for_sales_orders ?? 0);
|
||||
|
||||
const detailsPanel = useMemo(() => {
|
||||
if (instanceQuery.isFetching) {
|
||||
return <Skeleton />;
|
||||
@ -258,6 +262,13 @@ export default function PartDetail() {
|
||||
unit: true,
|
||||
hidden: !part.purchaseable || part.ordering <= 0
|
||||
},
|
||||
{
|
||||
type: 'string',
|
||||
name: 'required',
|
||||
label: t`Required for Orders`,
|
||||
hidden: part.required <= 0,
|
||||
icon: 'tick_off'
|
||||
},
|
||||
{
|
||||
type: 'progressbar',
|
||||
name: 'allocated_to_build_orders',
|
||||
@ -285,7 +296,7 @@ export default function PartDetail() {
|
||||
type: 'string',
|
||||
name: 'building',
|
||||
unit: true,
|
||||
label: t`Building`,
|
||||
label: t`In Production`,
|
||||
hidden: !part.assembly || !part.building
|
||||
}
|
||||
];
|
||||
@ -838,6 +849,9 @@ export default function PartDetail() {
|
||||
return [];
|
||||
}
|
||||
|
||||
const required =
|
||||
part.required_for_build_orders + part.required_for_sales_orders;
|
||||
|
||||
return [
|
||||
<DetailsBadge
|
||||
label={t`In Stock` + `: ${part.total_in_stock}`}
|
||||
@ -857,6 +871,12 @@ export default function PartDetail() {
|
||||
visible={part.total_in_stock == 0}
|
||||
key="no_stock"
|
||||
/>,
|
||||
<DetailsBadge
|
||||
label={t`Required` + `: ${required}`}
|
||||
color="grape"
|
||||
visible={required > 0}
|
||||
key="required"
|
||||
/>,
|
||||
<DetailsBadge
|
||||
label={t`On Order` + `: ${part.ordering}`}
|
||||
color="blue"
|
||||
|
Loading…
Reference in New Issue
Block a user