From 0628de768bfe0d4dcdbe0603d893ee4cdcd6128f Mon Sep 17 00:00:00 2001 From: kelvinsuen Date: Mon, 27 Oct 2025 19:10:10 +0800 Subject: [PATCH] update po --- src/components/PoDetail/PoDetail.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/PoDetail/PoDetail.tsx b/src/components/PoDetail/PoDetail.tsx index 867f04d..c06ff86 100644 --- a/src/components/PoDetail/PoDetail.tsx +++ b/src/components/PoDetail/PoDetail.tsx @@ -63,7 +63,6 @@ import { useRouter, useSearchParams, usePathname } from "next/navigation"; import { WarehouseResult } from "@/app/api/warehouse"; import { calculateWeight, dateStringToDayjs, dayjsToDateString, OUTPUT_DATE_FORMAT, outputDateStringToInputDateString, returnWeightUnit } from "@/app/utils/formatUtil"; import { CameraContext } from "../Cameras/CameraProvider"; -import PoQcStockInModal from "./PoQcStockInModal"; import QrModal from "./QrModal"; import { PlayArrow } from "@mui/icons-material"; import DoneIcon from "@mui/icons-material/Done"; @@ -480,6 +479,8 @@ const PoDetail: React.FC = ({ po, warehouse, printerCombo }) => { // const [focusField, setFocusField] = useState(); const purchaseToStockRatio = (row.stockUom.purchaseRatioN ?? 1) / (row.stockUom.purchaseRatioD ?? 1) * (row.stockUom.stockRatioD ?? 1) / (row.stockUom.stockRatioN ?? 1) + const receivedTotal = decimalFormatter.format(row.stockInLine.filter((sil) => sil.purchaseOrderLineId === row.id).reduce((acc, cur) => acc + (cur.acceptedQty ?? 0),0) * purchaseToStockRatio); + const highlightColor = (Number(receivedTotal.replace(/,/g, '')) <= 0) ? "red" : "inherit"; return ( <> = ({ po, warehouse, printerCombo }) => { {integerFormatter.format(row.processed)} {row.uom?.udfudesc} {/* {decimalFormatter.format(row.stockUom.stockQty)} */} - {decimalFormatter.format(row.stockInLine.filter((sil) => sil.purchaseOrderLineId === row.id).reduce((acc, cur) => acc + (cur.acceptedQty ?? 0),0) * purchaseToStockRatio)} - {row.stockUom.stockUomDesc} + {receivedTotal} + {row.stockUom.stockUomDesc} {/* {decimalFormatter.format(totalWeight)} {weightUnit} */} {/* {weightUnit} */} {/* {decimalFormatter.format(row.price)} */} {/* {row.expiryDate} */} - {t(`${currStatus.toLowerCase()}`)} + {t(`${row.status.toLowerCase()}`)} + {/* {t(`${currStatus.toLowerCase()}`)} */} {/* {integerFormatter.format(row.receivedQty)} */}