From 33e7d5ea0b82835a1a0f072ce41738a066a7b904 Mon Sep 17 00:00:00 2001 From: kelvinsuen Date: Thu, 2 Oct 2025 02:35:27 +0800 Subject: [PATCH] update stock in --- src/components/JoSearch/JoSearch.tsx | 9 ++++++--- src/components/PoDetail/PutAwayForm.tsx | 7 ++----- src/components/PoDetail/QcStockInModal.tsx | 3 +-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/components/JoSearch/JoSearch.tsx b/src/components/JoSearch/JoSearch.tsx index be7308b..ca95d2b 100644 --- a/src/components/JoSearch/JoSearch.tsx +++ b/src/components/JoSearch/JoSearch.tsx @@ -89,8 +89,10 @@ const JoSearch: React.FC = ({ defaultInputs, bomCombo }) => { { name: "status", label: t("Status"), - renderCell: (row) => { - return t(upperFirst(row.status)) + renderCell: (row) => { // TODO improve + return + {t(upperFirst(row.status))} + } }, { @@ -195,7 +197,7 @@ const JoSearch: React.FC = ({ defaultInputs, bomCombo }) => { // case "storing": btnSx = {label: t("view putaway"), color:"secondary.main"}; break; case "storing": switch (silStatus) { - case "pending": btnSx = {label: t("process epqc"), color:"primary.main"}; break; + case "pending": btnSx = {label: t("process epqc"), color:"success.main"}; break; case "received": btnSx = {label: t("view putaway"), color:"secondary.main"}; break; case "escalated": if (sessionToken?.id == jo.silHandlerId) { @@ -225,6 +227,7 @@ const JoSearch: React.FC = ({ defaultInputs, bomCombo }) => { if (record.stockInLineId != null) { const data = { id: record.stockInLineId, + expiryDate: arrayToDateString(dayjs().add(1, "month"), "input"), } setModalInfo(data); setOpenModal(true); diff --git a/src/components/PoDetail/PutAwayForm.tsx b/src/components/PoDetail/PutAwayForm.tsx index 646d59a..64c2441 100644 --- a/src/components/PoDetail/PutAwayForm.tsx +++ b/src/components/PoDetail/PutAwayForm.tsx @@ -39,6 +39,7 @@ import { GridEditInputCell } from "@mui/x-data-grid"; import { StockInLine } from "@/app/api/stockIn"; import { WarehouseResult } from "@/app/api/warehouse"; import { + arrayToDateString, arrayToDateTimeString, OUTPUT_DATE_FORMAT, stockInLineStatusMap, @@ -382,11 +383,7 @@ const PutAwayForm: React.FC = ({ itemDetail, warehouse=[], disabled, setR diff --git a/src/components/PoDetail/QcStockInModal.tsx b/src/components/PoDetail/QcStockInModal.tsx index f647434..ec83d2c 100644 --- a/src/components/PoDetail/QcStockInModal.tsx +++ b/src/components/PoDetail/QcStockInModal.tsx @@ -21,7 +21,6 @@ import { StockInLineRow } from "./PoInputGrid"; import { useTranslation } from "react-i18next"; import StockInForm from "./StockInForm"; import QcComponent from "./QcComponent"; -import { dummyPutAwayLine, dummyQCData } from "./dummyQcTemplate"; import PutAwayForm from "./PutAwayForm"; import { GridRowModes, GridRowSelectionModel, useGridApiRef } from "@mui/x-data-grid"; import {msg, submitDialogWithWarning} from "../Swal/CustomAlerts"; @@ -108,7 +107,7 @@ const PoQcStockInModalVer2: React.FC = ({ const res = await fetchStockInLineInfo(stockInLineId); if (res) { console.log("%c Fetched Stock In Line: ", "color:orange", res); - setStockInLineInfo({...inputDetail, ...res}); + setStockInLineInfo({...inputDetail, ...res, expiryDate: inputDetail?.expiryDate}); // TODO review to overwrite res with inputDetail instead (revise PO fetching data) fetchQcResultData(stockInLineId); } else throw("Result is undefined");