diff --git a/src/app/(main)/settings/items/edit/page.tsx b/src/app/(main)/settings/items/edit/page.tsx index 9e2f936..ee32d7f 100644 --- a/src/app/(main)/settings/items/edit/page.tsx +++ b/src/app/(main)/settings/items/edit/page.tsx @@ -1,3 +1,4 @@ +import { fetchQcCategoryCombo } from "@/app/api/settings/qcCategory"; import { SearchParams } from "@/app/utils/fetchUtil"; import { TypeEnum } from "@/app/utils/typeEnum"; import CreateProductMaterial from "@/components/CreateItem"; @@ -17,6 +18,9 @@ const productSetting: React.FC = async ({ searchParams }) => { if (!id) { notFound(); } + + fetchQcCategoryCombo() + return ( <> {/* {t("Create Material")} */} diff --git a/src/app/api/settings/item/actions.ts b/src/app/api/settings/item/actions.ts index 522b376..8012d3f 100644 --- a/src/app/api/settings/item/actions.ts +++ b/src/app/api/settings/item/actions.ts @@ -35,6 +35,7 @@ export type CreateItemInputs = { type: string; qcChecks: QcChecksInputs[]; qcChecks_active: number[]; + qcCategoryId: number | undefined; }; export const saveItem = async (data: CreateItemInputs) => { diff --git a/src/app/api/settings/item/index.ts b/src/app/api/settings/item/index.ts index 5d224c2..bee66f1 100644 --- a/src/app/api/settings/item/index.ts +++ b/src/app/api/settings/item/index.ts @@ -4,6 +4,7 @@ import "server-only"; // import { BASE_API_URL } from "@/config/api"; import { serverFetchJson } from "../../../utils/fetchUtil"; import { BASE_API_URL } from "../../../../config/api"; +import { QcCategoryResult } from "../qcCategory"; // import { TypeInputs, UomInputs, WeightUnitInputs } from "./actions"; @@ -37,6 +38,7 @@ export type ItemsResult = { action?: any; fgName?: string; excludeDate?: string; + qcCategory?: QcCategoryResult; }; export type Result = { diff --git a/src/components/PoDetail/PoDetail.tsx b/src/components/PoDetail/PoDetail.tsx index e8d7bf7..b67d6e9 100644 --- a/src/components/PoDetail/PoDetail.tsx +++ b/src/components/PoDetail/PoDetail.tsx @@ -406,9 +406,9 @@ const PoDetail: React.FC = ({ po, qc, warehouse }) => { {integerFormatter.format(row.qty)} {integerFormatter.format(processedQty)} {row.uom?.code} - + {/* {decimalFormatter.format(totalWeight)} {weightUnit} - + */} {/* {weightUnit} */} {decimalFormatter.format(row.price)} {/* {row.expiryDate} */} @@ -651,7 +651,7 @@ const PoDetail: React.FC = ({ po, qc, warehouse }) => { {t("qty")} {t("processed")} {t("uom")} - {t("total weight")} + {/* {t("total weight")} */} {`${t("price")} (HKD)`} {t("status")} {renderFieldCondition(FIRST_IN_FIELD) ? {t("receivedQty")} : undefined} diff --git a/src/components/PoDetail/PoInputGrid.tsx b/src/components/PoDetail/PoInputGrid.tsx index e16affc..c278f97 100644 --- a/src/components/PoDetail/PoInputGrid.tsx +++ b/src/components/PoDetail/PoInputGrid.tsx @@ -480,20 +480,20 @@ const closeNewModal = useCallback(() => { return params.row.uom.code; }, }, - { - field: "weight", - headerName: t("weight"), - width: 120, - // flex: 0.5, - renderCell: (params) => { - const weight = calculateWeight( - params.row.acceptedQty, - params.row.uom, - ); - const weightUnit = returnWeightUnit(params.row.uom); - return `${decimalFormatter.format(weight)} ${weightUnit}`; - }, - }, + // { + // field: "weight", + // headerName: t("weight"), + // width: 120, + // // flex: 0.5, + // renderCell: (params) => { + // const weight = calculateWeight( + // params.row.acceptedQty, + // params.row.uom, + // ); + // const weightUnit = returnWeightUnit(params.row.uom); + // return `${decimalFormatter.format(weight)} ${weightUnit}`; + // }, + // }, { field: "status", headerName: t("status"),