Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

feat: format inventory table

Brad Barbin2c207c778daa
diff --git a/apps/erp/app/modules/inventory/ui/Inventory/InventoryTable.tsx b/apps/erp/app/modules/inventory/ui/Inventory/InventoryTable.tsx
index c7cb585915..ebada744e8 100644
--- a/apps/erp/app/modules/inventory/ui/Inventory/InventoryTable.tsx
+++ b/apps/erp/app/modules/inventory/ui/Inventory/InventoryTable.tsx
@@ -8,6 +8,7 @@ import {
TooltipTrigger,
VStack,
} from "@carbon/react";
+import { useNumberFormatter } from "@react-aria/i18n";
import { useFetcher } from "@remix-run/react";
import type { ColumnDef } from "@tanstack/react-table";
import { memo, useMemo } from "react";
@@ -32,6 +33,7 @@ import {
ItemThumbnail,
MethodItemTypeIcon,
Table,
+ TrackingTypeIcon,
} from "~/components";
import { Enumerable } from "~/components/Enumerable";
import { useLocations } from "~/components/Form/Location";
@@ -62,6 +64,7 @@ const InventoryTable = memo(
const filters = useFilters();
const materialSubstanceId = filters.getFilter("materialSubstanceId")?.[0];
const materialFormId = filters.getFilter("materialFormId")?.[0];
+ const numberFormatter = useNumberFormatter();
const columns = useMemo<ColumnDef<InventoryItem>[]>(() => {
return [
@@ -97,7 +100,12 @@ const InventoryTable = memo(
{
accessorKey: "quantityOnHand",
header: "On Hand",
- cell: ({ row }) => row.original.quantityOnHand,
+ cell: ({ row }) =>
+ row.original.itemTrackingType === "Non-Inventory" ? (
+ <TrackingTypeIcon type="Non-Inventory" />
+ ) : (
+ numberFormatter.format(row.original.quantityOnHand)
+ ),
meta: {
icon: <LuPackage />,
},
@@ -106,7 +114,8 @@ const InventoryTable = memo(
{
accessorKey: "quantityOnPurchaseOrder",
header: "On Purchase Order",
- cell: ({ row }) => row.original.quantityOnPurchaseOrder,
+ cell: ({ row }) =>
+ numberFormatter.format(row.original.quantityOnPurchaseOrder),
meta: {
icon: <LuMoveUp className="text-emerald-500" />,
},
@@ -114,7 +123,8 @@ const InventoryTable = memo(
{
accessorKey: "quantityOnProductionOrder",
header: "On Jobs",
- cell: ({ row }) => row.original.quantityOnProductionOrder,
+ cell: ({ row }) =>
+ numberFormatter.format(row.original.quantityOnProductionOrder),
meta: {
icon: <LuMoveUp className="text-emerald-500" />,
},
@@ -122,7 +132,8 @@ const InventoryTable = memo(
{
accessorKey: "quantityOnProductionDemand",
header: "On Jobs",
- cell: ({ row }) => row.original.quantityOnProductionDemand,
+ cell: ({ row }) =>
+ numberFormatter.format(row.original.quantityOnProductionDemand),
meta: {
icon: <LuMoveDown className="text-red-500" />,
},
@@ -130,7 +141,8 @@ const InventoryTable = memo(
{
accessorKey: "quantityOnSalesOrder",
header: "On Sales Order",
- cell: ({ row }) => row.original.quantityOnSalesOrder,
+ cell: ({ row }) =>
+ numberFormatter.format(row.original.quantityOnSalesOrder),
meta: {
icon: <LuMoveDown className="text-red-500" />,
},
@@ -310,6 +322,7 @@ const InventoryTable = memo(
forms,
materialFormId,
materialSubstanceId,
+ numberFormatter,
params,
substances,
unitOfMeasures,
diff --git a/apps/university/app/config.tsx b/apps/university/app/config.tsx
index 17e9071ce6..86650ad316 100644
--- a/apps/university/app/config.tsx
+++ b/apps/university/app/config.tsx
@@ -584,11 +584,12 @@ export const modules: Config = [
},
{
id: "reorder-policy",
- loomUrl: "",
+ loomUrl:
+ "https://www.loom.com/share/3f80467543934dc3b0fe8978abf09825?sid=32db62c3-bbb7-43f8-a66b-8b8d726c3667",
name: "Reorder Policies",
description:
"Learn how different reorder-policies affect planning",
- duration: 0,
+ duration: 236,
},
],
},