From c21f7c2ceee04daeb4dce25a8bea49d9ec2022ab Mon Sep 17 00:00:00 2001 From: jason Date: Sat, 14 Mar 2026 23:23:43 -0500 Subject: [PATCH] cost and price --- client/src/modules/inventory/InventoryDetailPage.tsx | 4 ++++ client/src/modules/inventory/InventoryFormPage.tsx | 12 ++++++++++++ client/src/modules/inventory/config.ts | 1 + client/src/modules/sales/SalesFormPage.tsx | 1 + .../migration.sql | 1 + server/prisma/schema.prisma | 1 + server/src/lib/bootstrap.ts | 3 +++ server/src/modules/inventory/router.ts | 1 + server/src/modules/inventory/service.ts | 6 ++++++ shared/src/inventory/types.ts | 3 +++ 10 files changed, 33 insertions(+) create mode 100644 server/prisma/migrations/20260315004500_inventory_default_price/migration.sql diff --git a/client/src/modules/inventory/InventoryDetailPage.tsx b/client/src/modules/inventory/InventoryDetailPage.tsx index ce4557e..fe23e41 100644 --- a/client/src/modules/inventory/InventoryDetailPage.tsx +++ b/client/src/modules/inventory/InventoryDetailPage.tsx @@ -156,6 +156,10 @@ export function InventoryDetailPage() {
Default cost
{item.defaultCost == null ? "Not set" : `$${item.defaultCost.toFixed(2)}`}
+
+
Default price
+
{item.defaultPrice == null ? "Not set" : `$${item.defaultPrice.toFixed(2)}`}
+
Flags
diff --git a/client/src/modules/inventory/InventoryFormPage.tsx b/client/src/modules/inventory/InventoryFormPage.tsx index d17d417..228817f 100644 --- a/client/src/modules/inventory/InventoryFormPage.tsx +++ b/client/src/modules/inventory/InventoryFormPage.tsx @@ -71,6 +71,7 @@ export function InventoryFormPage({ mode }: InventoryFormPageProps) { isSellable: item.isSellable, isPurchasable: item.isPurchasable, defaultCost: item.defaultCost, + defaultPrice: item.defaultPrice, notes: item.notes, bomLines: item.bomLines.map((line) => ({ componentItemId: line.componentItemId, @@ -199,6 +200,17 @@ export function InventoryFormPage({ mode }: InventoryFormPageProps) { className="w-full rounded-2xl border border-line/70 bg-page px-2 py-2 text-text outline-none transition focus:border-brand" /> +