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.

style: fix order drawer reorder policy

Brad Barbin9a6d44f58622
diff --git a/apps/erp/app/modules/production/ui/Planning/PlanningTable.tsx b/apps/erp/app/modules/production/ui/Planning/PlanningTable.tsx
index 2107834e6e..fdacf3d4d1 100644
--- a/apps/erp/app/modules/production/ui/Planning/PlanningTable.tsx
+++ b/apps/erp/app/modules/production/ui/Planning/PlanningTable.tsx
@@ -301,96 +301,88 @@ const OrderDrawer = memo(
</DrawerHeader>
<DrawerBody>
<div className="flex flex-col gap-4 w-full">
- {(row.lotSize ||
- row.minimumOrderQuantity ||
- row.maximumOrderQuantity) && (
- <VStack spacing={2} className="text-sm border rounded-lg p-4">
- <HStack className="justify-between w-full">
- <span className="text-muted-foreground">
- Reorder Policy:
- </span>
- <ItemReorderPolicy
- reorderingPolicy={row.reorderingPolicy}
- />
- </HStack>
- <Separator />
- {row.reorderingPolicy === "Maximum Quantity" && (
- <>
- <HStack className="justify-between w-full">
- <span className="text-muted-foreground">
- Reorder Point:
- </span>
- <span>{row.reorderPoint}</span>
- </HStack>
- <HStack className="justify-between w-full">
- <span className="text-muted-foreground">
- Maximum Inventory:
- </span>
- <span>{row.maximumInventoryQuantity}</span>
- </HStack>
- </>
- )}
-
- {row.reorderingPolicy === "Demand-Based Reorder" && (
- <>
- <HStack className="justify-between w-full">
- <span className="text-muted-foreground">
- Accumulation Period:
- </span>
- <span>{row.demandAccumulationPeriod} weeks</span>
- </HStack>
- <HStack className="justify-between w-full">
- <span className="text-muted-foreground">
- Safety Stock:
- </span>
- <span>{row.demandAccumulationSafetyStock}</span>
- </HStack>
- </>
- )}
+ <VStack spacing={2} className="text-sm border rounded-lg p-4">
+ <HStack className="justify-between w-full">
+ <span className="text-muted-foreground">Reorder Policy:</span>
+ <ItemReorderPolicy reorderingPolicy={row.reorderingPolicy} />
+ </HStack>
+ <Separator />
+ {row.reorderingPolicy === "Maximum Quantity" && (
+ <>
+ <HStack className="justify-between w-full">
+ <span className="text-muted-foreground">
+ Reorder Point:
+ </span>
+ <span>{row.reorderPoint}</span>
+ </HStack>
+ <HStack className="justify-between w-full">
+ <span className="text-muted-foreground">
+ Maximum Inventory:
+ </span>
+ <span>{row.maximumInventoryQuantity}</span>
+ </HStack>
+ </>
+ )}
- {row.reorderingPolicy === "Fixed Reorder Quantity" && (
- <>
- <HStack className="justify-between w-full">
- <span className="text-muted-foreground">
- Reorder Point:
- </span>
- <span>{row.reorderPoint}</span>
- </HStack>
- <HStack className="justify-between w-full">
- <span className="text-muted-foreground">
- Reorder Quantity:
- </span>
- <span>{row.reorderQuantity}</span>
- </HStack>
- </>
- )}
- {(row.lotSize > 0 ||
- row.minimumOrderQuantity > 0 ||
- row.maximumOrderQuantity > 0) && <Separator />}
- {row.lotSize > 0 && (
+ {row.reorderingPolicy === "Demand-Based Reorder" && (
+ <>
<HStack className="justify-between w-full">
- <span className="text-muted-foreground">Lot Size:</span>
- <span>{row.lotSize}</span>
+ <span className="text-muted-foreground">
+ Accumulation Period:
+ </span>
+ <span>{row.demandAccumulationPeriod} weeks</span>
</HStack>
- )}
- {row.minimumOrderQuantity > 0 && (
<HStack className="justify-between w-full">
<span className="text-muted-foreground">
- Minimum Order:
+ Safety Stock:
</span>
- <span>{row.minimumOrderQuantity}</span>
+ <span>{row.demandAccumulationSafetyStock}</span>
</HStack>
- )}
- {row.maximumOrderQuantity > 0 && (
+ </>
+ )}
+
+ {row.reorderingPolicy === "Fixed Reorder Quantity" && (
+ <>
<HStack className="justify-between w-full">
<span className="text-muted-foreground">
- Maximum Order:
+ Reorder Point:
</span>
- <span>{row.maximumOrderQuantity}</span>
+ <span>{row.reorderPoint}</span>
</HStack>
- )}
- </VStack>
- )}
+ <HStack className="justify-between w-full">
+ <span className="text-muted-foreground">
+ Reorder Quantity:
+ </span>
+ <span>{row.reorderQuantity}</span>
+ </HStack>
+ </>
+ )}
+ {(row.lotSize > 0 ||
+ row.minimumOrderQuantity > 0 ||
+ row.maximumOrderQuantity > 0) && <Separator />}
+ {row.lotSize > 0 && (
+ <HStack className="justify-between w-full">
+ <span className="text-muted-foreground">Lot Size:</span>
+ <span>{row.lotSize}</span>
+ </HStack>
+ )}
+ {row.minimumOrderQuantity > 0 && (
+ <HStack className="justify-between w-full">
+ <span className="text-muted-foreground">
+ Minimum Order:
+ </span>
+ <span>{row.minimumOrderQuantity}</span>
+ </HStack>
+ )}
+ {row.maximumOrderQuantity > 0 && (
+ <HStack className="justify-between w-full">
+ <span className="text-muted-foreground">
+ Maximum Order:
+ </span>
+ <span>{row.maximumOrderQuantity}</span>
+ </HStack>
+ )}
+ </VStack>
<TableBase full>
<Thead>