diff --git a/docs/PHASES.md b/docs/PHASES.md index dbdfcf4..2b92016 100644 --- a/docs/PHASES.md +++ b/docs/PHASES.md @@ -52,4 +52,6 @@ Customer and administration screens are implemented, with recovery, pricing, sto - B2B UAT should use distinct submitting and reviewing accounts. Verify self-review is blocked, rejection allows correction and resubmission, and a verified profile is read-only. - B2B price lists support draft variant prices and minimum quantities, activation, archiving, and active-list merchandise previews. - Price-list UAT should verify that unverified accounts and competing active lists cannot activate a draft, archived terms stay read-only, and price checks reject quantities below the variant minimum. -- Quotes, credit policies, samples, artwork, partner orders and payments, custom requests and reporting remain open. +- Staff can issue B2B quotations from account-specific price lists, review saved profile and pricing snapshots, and record acceptance, decline, or withdrawal before expiry. +- Quotation UAT should verify minimum quantities, expiry, immutable snapshots after archiving a price list, and exact retries for issuance and responses. +- Credit policies, samples, artwork, partner orders and payments, custom requests and reporting remain open. diff --git a/src/App.tsx b/src/App.tsx index b95fd96..88367be 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -31,6 +31,7 @@ const InventoryPage = lazy(() => import("@/pages/InventoryPage")); const MaterialStockPage = lazy(() => import("@/pages/MaterialStockPage")); const BusinessAccountsPage = lazy(() => import("@/pages/BusinessAccountsPage")); const PriceListsPage = lazy(() => import("@/pages/PriceListsPage")); +const QuotesPage = lazy(() => import("@/pages/QuotesPage")); const MaterialCostRatesPage = lazy(() => import("@/pages/MaterialCostRatesPage")); const ProcurementPage = lazy(() => import("@/pages/ProcurementPage")); const BomPage = lazy(() => import("@/pages/BomPage")); @@ -81,6 +82,17 @@ function Router() { {(params) => } + {() => } + {() => } + + {(params) => } + + + {(params) => } + + + {(params) => } + {() => } {(params) => } diff --git a/src/components/VariantQuantityFields.tsx b/src/components/VariantQuantityFields.tsx new file mode 100644 index 0000000..4a2f9e7 --- /dev/null +++ b/src/components/VariantQuantityFields.tsx @@ -0,0 +1,30 @@ +import { useRef, useState } from "react"; +import Button from "@mui/material/Button"; +import { Field } from "./WorkspaceTools"; + +export function readVariantQuantities(form: FormData) { + const quantities = form.getAll("quantity"); + return form.getAll("variantId").map((id, index) => ({ + variantId: String(id).trim(), + quantity: Number(quantities[index]), + })); +} + +export function VariantQuantityFields({ options }: { options?: { value: string; label: string }[] }) { + const next = useRef(1); + const [rows, setRows] = useState([0]); + const limit = Math.min(100, options?.length ?? 100); + return <> + {rows.map((key, index) =>
+ Line {index + 1} + + + +
)} + + ; +} diff --git a/src/components/WorkspaceShell.tsx b/src/components/WorkspaceShell.tsx index b8fc0bd..67e9846 100644 --- a/src/components/WorkspaceShell.tsx +++ b/src/components/WorkspaceShell.tsx @@ -72,6 +72,7 @@ export function WorkspaceNavigation() { { label: "Audit", path: "/admin/audit", permission: "audit.read" }, { label: "Business accounts", path: "/admin/business-accounts", permission: "b2b.read" }, { label: "B2B price lists", path: "/admin/b2b-price-lists", permission: "b2b.price.read" }, + { label: "B2B quotations", path: "/admin/b2b-quotes", permission: "b2b.quote.read" }, ]; return (