kelvin.yau 3 weeks ago
parent
commit
3e1f20167e
3 changed files with 7 additions and 3 deletions
  1. +1
    -1
      src/app/(main)/production/page.tsx
  2. +1
    -0
      src/app/api/jo/index.ts
  3. +5
    -2
      src/components/JoSave/JoRelease.tsx

+ 1
- 1
src/app/(main)/production/page.tsx View File

@@ -38,7 +38,7 @@ const production: React.FC = async () => {
{t("Create Process")}
</Button> */}
</Stack>
<I18nProvider namespaces={["common", "production","purchaseOrder"]}>
<I18nProvider namespaces={["common", "production","purchaseOrder","jo"]}>
<ProductionProcessPage printerCombo={printerCombo} /> {/* Use new component */}
</I18nProvider>
</>


+ 1
- 0
src/app/api/jo/index.ts View File

@@ -62,6 +62,7 @@ export interface JoDetailPickLine {
id: number;
code: string;
name: string;
type: string;
pickedLotNo?: JoDetailPickedLotNo[];
reqQty: number;
uom: string;


+ 5
- 2
src/components/JoSave/JoRelease.tsx View File

@@ -68,8 +68,11 @@ const JoRelease: React.FC<Props> = ({

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,


Loading…
Cancel
Save