diff --git a/src/app/(main)/production/page.tsx b/src/app/(main)/production/page.tsx index 2386750..d8253ac 100644 --- a/src/app/(main)/production/page.tsx +++ b/src/app/(main)/production/page.tsx @@ -38,7 +38,7 @@ const production: React.FC = async () => { {t("Create Process")} */} - + {/* Use new component */} diff --git a/src/app/api/jo/index.ts b/src/app/api/jo/index.ts index 568783b..239b6b7 100644 --- a/src/app/api/jo/index.ts +++ b/src/app/api/jo/index.ts @@ -62,6 +62,7 @@ export interface JoDetailPickLine { id: number; code: string; name: string; + type: string; pickedLotNo?: JoDetailPickedLotNo[]; reqQty: number; uom: string; diff --git a/src/components/JoSave/JoRelease.tsx b/src/components/JoSave/JoRelease.tsx index 1d9813f..fb70434 100644 --- a/src/components/JoSave/JoRelease.tsx +++ b/src/components/JoSave/JoRelease.tsx @@ -68,8 +68,11 @@ const JoRelease: React.FC = ({ const stockCounts = useMemo(() => { const totalLines = pickLines.length; - const sufficientLines = pickLines.filter(pickLine => isStockSufficient(pickLine)).length; - const insufficientLines = totalLines - sufficientLines; + const nonMatAndNonItemLines = pickLines.filter(pickLine => + pickLine.type !== 'mat' && pickLine.type !== 'item' + ); + const sufficientLines = nonMatAndNonItemLines.filter(pickLine => isStockSufficient(pickLine)).length; + const insufficientLines = nonMatAndNonItemLines.length - sufficientLines; return { total: totalLines,