From 37fed5c883d2e5a9c4259a8f46b3b36c2addebfd Mon Sep 17 00:00:00 2001 From: "cyril.tsui" Date: Fri, 8 Aug 2025 16:40:18 +0800 Subject: [PATCH] quick update --- src/components/PoDetail/PoDetail.tsx | 24 ++++++++---------------- src/components/PoDetail/PoInputGrid.tsx | 6 +++++- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/components/PoDetail/PoDetail.tsx b/src/components/PoDetail/PoDetail.tsx index 3da787d..48e1280 100644 --- a/src/components/PoDetail/PoDetail.tsx +++ b/src/components/PoDetail/PoDetail.tsx @@ -63,6 +63,7 @@ import { PlayArrow } from "@mui/icons-material"; import DoneIcon from "@mui/icons-material/Done"; import { getCustomWidth } from "@/app/utils/commonUtil"; import PoInfoCard from "./PoInfoCard"; +import { decimalFormatter, integerFormatter } from "@/app/utils/formatUtil"; type Props = { po: PoResult; @@ -114,7 +115,7 @@ const PoDetail: React.FC = ({ po, qc, warehouse }) => { }, [purchaseOrder]); function Row(props: { row: PurchaseOrderLine }) { - const { row } = props; + const { row } = props; const [firstReceiveQty, setFirstReceiveQty] = useState() const [secondReceiveQty, setSecondReceiveQty] = useState() const [open, setOpen] = useState(false); @@ -155,14 +156,14 @@ const PoDetail: React.FC = ({ po, qc, warehouse }) => { {row.itemNo} {row.itemName} - {row.qty} - {processedQty} + {integerFormatter.format(row.qty)} + {integerFormatter.format(processedQty)} {row.uom?.code} - {totalWeight} {weightUnit} + {decimalFormatter.format(totalWeight)} {weightUnit} {/* {weightUnit} */} - {row.price} + {decimalFormatter.format(row.price)} {/* {row.expiryDate} */} {t(`${currStatus.toLowerCase()}`)} {/* @@ -371,16 +372,7 @@ const PoDetail: React.FC = ({ po, qc, warehouse }) => { ) : undefined} - - - {/* */} - {/* */} - - + {/* */} {/* scanner */} {/* */} @@ -419,7 +411,7 @@ const PoDetail: React.FC = ({ po, qc, warehouse }) => { {t("uom")} {t("total weight")} {/* {t("weight unit")} */} - {t("price")} + {`${t("price")} (HKD)`} {/* {t("expiryDate")} */} {t("status")} {/* start == true && firstInQty == null ? no hide : hide*/} diff --git a/src/components/PoDetail/PoInputGrid.tsx b/src/components/PoDetail/PoInputGrid.tsx index 261e13c..980598c 100644 --- a/src/components/PoDetail/PoInputGrid.tsx +++ b/src/components/PoDetail/PoInputGrid.tsx @@ -58,6 +58,7 @@ import PoQcStockInModal from "./PoQcStockInModal"; import DoDisturbIcon from "@mui/icons-material/DoDisturb"; import { useSession } from "next-auth/react"; import PoQcStockInModalVer2 from "./QcStockInModalVer2"; +import { decimalFormatter, integerFormatter } from "@/app/utils/formatUtil"; interface ResultWithId { id: number; @@ -443,6 +444,9 @@ function PoInputGrid({ type: "number", // editable: true, // replace with tooltip + content + renderCell: (params) => { + return integerFormatter.format(params.value) + } }, { field: "uom", @@ -464,7 +468,7 @@ function PoInputGrid({ params.row.uom, ); const weightUnit = returnWeightUnit(params.row.uom); - return `${weight} ${weightUnit}`; + return `${decimalFormatter.format(weight)} ${weightUnit}`; }, }, {