From 9158cd8c8293fbc6a482520eb0bafe162126a24a Mon Sep 17 00:00:00 2001 From: ImanThiyanga Date: Tue, 21 Jul 2026 11:55:40 +0530 Subject: [PATCH] ui fixes --- .../procurement/purchase-orders/new/page.tsx | 40 +--- .../components/Layouts/AppSidebar.tsx | 177 ++++++++++++------ 2 files changed, 125 insertions(+), 92 deletions(-) diff --git a/Frontend/erp-system/app/dashboard/procurement/purchase-orders/new/page.tsx b/Frontend/erp-system/app/dashboard/procurement/purchase-orders/new/page.tsx index ae5672e..411799d 100644 --- a/Frontend/erp-system/app/dashboard/procurement/purchase-orders/new/page.tsx +++ b/Frontend/erp-system/app/dashboard/procurement/purchase-orders/new/page.tsx @@ -43,8 +43,12 @@ function newKey() { return `poline-${keySeq}` } +// Unit price and tax are no longer entered at PO creation — pricing is captured at GRN +// receipt (with discount/VAT there). They default to 0 here and stay off the form, but +// remain on the payload because the backend line DTO still requires them; a PO prefilled +// from an RFQ keeps its negotiated price (below). function emptyLine(): DraftLine { - return { key: newKey(), itemId: null, uomId: null, warehouseId: null, qty: "", unitPrice: "", tax: "0.18" } + return { key: newKey(), itemId: null, uomId: null, warehouseId: null, qty: "", unitPrice: "0", tax: "0" } } function NewPurchaseOrderContent() { @@ -98,8 +102,8 @@ function NewPurchaseOrderContent() { uomId: null, warehouseId: null, qty: String(l.qty), - unitPrice: "", - tax: "0.18", + unitPrice: "0", + tax: "0", }) ) ) @@ -124,8 +128,8 @@ function NewPurchaseOrderContent() { uomId: null, warehouseId: null, qty: String(l.qty), - unitPrice: cell ? String(cell.unitPrice) : "", - tax: "0.18", + unitPrice: cell ? String(cell.unitPrice) : "0", + tax: "0", } }) ) @@ -278,8 +282,6 @@ function NewPurchaseOrderContent() { UOM Warehouse Qty - Unit price - Tax @@ -352,30 +354,6 @@ function NewPurchaseOrderContent() { /> - - updateLine(line.key, { unitPrice: e.target.value })} - className="h-11 text-base" - /> - - - - updateLine(line.key, { tax: e.target.value })} - className="h-11 text-base" - /> - - - {/* Nav items */} -
    + {/* Nav items — scrolls internally when it overflows, without a visible + scrollbar so the rounded panel stays clean. */} +
      {items.map((item) => { const isActive = item.href === "/dashboard" ? pathname === item.href : pathname.startsWith(item.href) + const hasChildren = !!item.children?.length && !iconOnly + const isOpen = !!expanded[item.code] return (
    • - - - {(!collapsed || isMobile) && ( - <> - {item.title} - {item.chevron && !item.children && !isActive && ( - - )} - - )} - + + + {!iconOnly && ( + <> + {item.title} + {item.chevron && !hasChildren && ( + + )} + + )} + - {item.children && (!collapsed || isMobile) && ( -
        - {(() => { - // Longest-matching href wins so a shared prefix (e.g. "Item" and - // "Category" both live under /dashboard/products) doesn't light up - // more than one sub-item at once. - const activeChild = [...item.children] - .filter((c) => pathname === c.href || pathname.startsWith(`${c.href}/`)) - .sort((a, b) => b.href.length - a.href.length)[0] - return item.children.map((child) => { - const childActive = child.href === activeChild?.href - return ( -
      • - - - {child.title} - -
      • - ) - }) - })()} -
      + {hasChildren && ( + + )} + + + {hasChildren && ( +
      +
      +
        + {(() => { + // Longest-matching href wins so a shared prefix (e.g. "Item" and + // "Category" both live under /dashboard/products) doesn't light up + // more than one sub-item at once. + const activeChild = [...item.children!] + .filter((c) => pathname === c.href || pathname.startsWith(`${c.href}/`)) + .sort((a, b) => b.href.length - a.href.length)[0] + return item.children!.map((child) => { + const childActive = child.href === activeChild?.href + return ( +
      • + + + {child.title} + +
      • + ) + }) + })()} +
      +
      +
      )}
    • ) })}
    -
    +