# Repair / Rework + Defect Records — log defective goods to repair, record the repair result, return repaired goods to the next process

> Fine Chemical (FC) · Module MES · v0.6 · 13/10/2026 · Standard flow — for implementation, testing and development
>
> Generated from the diagram by `sync.js` — do not edit by hand. The diagram is authoritative: report any mismatch with the diagram page.
>
> Diagram page: /en/mes/repair-rework

## How to read

- Every box on the diagram has a code `Bxx`, numbered in flow order (from the start event, following the arrows).
- "Goes to" lists every arrow leaving the box; text in square brackets is that arrow's condition label.
- "Optional branch" = a dashed arrow on the diagram: may be done or skipped.
- "Data" boxes in the Input lane are incoming data; in the Output lane they are results / end points of the flow.

## Process Flow (swimlane)

### Roles (lanes)

- Input
- QC
- Operator (Repair team)
- Output

### Steps

| Code | Role | Type | Content | Platform · Screen | Goes to |
| --- | --- | --- | --- | --- | --- |
| B01 | Input | Data | Pending repair after Injection, each size with PR > 0 (Trimming · Stitching · Spray Out · Packing Logo · Packing Spray) |  | B04 |
| B02 | Input | Data | Master data: Root Cause · Defect Reason | Master data | B08 |
| B03 | Input | Data | Grade C (scrap) recorded at POP every process (Injection · Trimming · Stitching · Spray Out · Packing Logo · Packing Spray) |  | B27 |
| B04 | QC | Task | Create Repair / Rework record for each size with PR > 0 | System (auto) · Repair / Rework | B05 [hand to repair team] |
| B05 | Operator (Repair team) | Task | Repair defective goods | At repair area | B06 [repaired] |
| B06 | QC | Task | Open PENDING record | Web · Repair / Rework | B07 |
| B07 | QC | Task | Enter Repaired · A- · Scrap | Web · Repair / Rework | B08 |
| B08 | QC | Task | Select Root Cause | Web · Repair / Rework | B09 |
| B09 | QC | Decision | Scrap needing make-up? |  | B10 [Yes]; B11 [No] |
| B10 | QC | Task | Tick Re-plan WO | Web · Repair / Rework | B11 |
| B11 | QC | Task | Save repair result | Web · Repair / Rework | B12 |
| B12 | QC | Decision | Total = Qty and Root Cause set? |  | B13 [No]; B14 [Pass] |
| B13 | Output | Data | Save blocked — error shown on the Repair Result modal |  | (end) |
| B14 | QC | Task | Set record status | System (auto) · Repair / Rework | B15 |
| B15 | QC | Task | Move Repaired OK goods to Repair Inv List | System (auto) · Repair / Rework | B16 [Source "Spray Out · Pending repair" · "Packing Spray · Pending repair"]; B17 [Source "Trimming · Pending repair"]; B18 [Source "Stitching · Pending repair" · "Packing Logo · Pending repair"]; B19 |
| B16 | Output | Data | Repair Inv List of Packing Planning Spray Step 2 · Select Repair Inventory |  | (end) |
| B17 | Output | Data | Repair Inv List → Step 2 of Outsourcing Planning or Packing Planning Logo (by plan type) |  | (end) |
| B18 | Output | Data | Repair Inv List — next process not yet determined (Stitching · Packing Logo) |  | (end) |
| B19 | QC | Task | Book the A- part to Common Stock | System (auto) · Repair / Rework | B20 [Downgrade to A- > 0]; B21 |
| B20 | Output | Data | A- downgrade → Common Stock |  | (end) |
| B21 | QC | Task | Book the Scrap part as Loss | System (auto) · Repair / Rework | B22 [Scrap > 0]; B23 |
| B22 | Output | Data | Scrap → Loss |  | (end) |
| B23 | QC | Decision | Ticked Re-plan WO? |  | B24 [Yes]; B25 [No] |
| B24 | QC | Task | Create make-up demand for the WO | System (auto) · Repair / Rework | B26 |
| B25 | Output | Data | Closed record · view only |  | (end) |
| B26 | Output | Data | Make-up demand → Master Plan (re-plan WO) |  | (end) |
| B27 | QC | Task | Write Defect Records rows one row per reason | System (auto) · Defect Records | B28 |
| B28 | QC | Task | Filter Defect Records | Web · Defect Records | B29 |
| B29 | QC | Task | Export Defect Records | Web · Defect Records | B30 |
| B30 | Output | Data | File Excel Defect Records |  | (end) |

### Step details (hover content on the diagram)

#### B04 · Create Repair / Rework record for each size with PR > 0

- QC · System (auto) · Repair / Rework
- Comes from: B01
- Goes to [hand to repair team]: B05 · Repair defective goods

> The system automatically creates one Repair / Rework record for each size with Pending repair in the processes after Injection; QC does not create records by hand.  
> When: the user records output at Trimming Result, Process Worklist, Outsourcing Result, Packing Result Logo or Packing Result Spray and the "Pending repair" (PR) cell of that size is greater than 0.  
> System: each size with PR > 0 creates one RW-nnnn record carrying LOT No. · WO No. · SO No. · Item · Size, Qty = the PR of that size, Source = "<Process> · Pending repair" (five labels: "Trimming · Pending repair" · "Stitching · Pending repair" · "Spray Out · Pending repair" · "Packing Logo · Pending repair" · "Packing Spray · Pending repair").  
> Result: the record is PENDING; the "PENDING … pairs" KPI adds the pairs; the Defect column of the record shows "Pending repair".  
> Blocked when: grade C creates no record — C is scrap and is only written to Defect Records by reason; Daily Injection has no PR, so it creates no record either.  
> Test:  
> - Trimming Result PR = 40 (W7 30 + W8 10) → 2 records "Trimming · Pending repair": W7 qty 30, W8 qty 10  
> - The same entry has C = 20 → Repair / Rework gets no record, Defect Records gains 1 row  
> Source: Q-20261013-01 · prototype v0.91  

#### B05 · Repair defective goods

- Operator (Repair team) · At repair area
- Comes from: B04
- Goes to [repaired]: B06 · Open PENDING record

> The repair team reworks the goods according to the defect written on the record (e.g. "Cut edge rough", "Burr / flash").  
> System: a manual step, no screen action ("Operator/technician processes the fix/rework action").  
> Result: repaired goods go back to QC to record the result; the repairer and repair time are entered in "Repaired By" · "Repair Time (min)".  
> Source: BRD §6.5 · prototype v0.91  

#### B06 · Open PENDING record

- QC · Web · Repair / Rework
- Comes from: B05
- Goes to: B07 · Enter Repaired · A- · Scrap

> QC opens a waiting record to record the repair result.  
> When: the record is PENDING.  
> Action: screen subtitle "EXC-01 · Pending repair of every process after Injection, one record per size (created by the system) — repair result and WO re-plan"; filter "STATUS" (All · Pending · Repaired · Downgraded · Scrapped) / "SOURCE" (All · "Trimming · Pending repair" · "Stitching · Pending repair" · "Spray Out · Pending repair" · "Packing Logo · Pending repair" · "Packing Spray · Pending repair") / "SEARCH" › button "Record" on the row › box "Repair Result · RW-nnnn".  
> Test:  
> - A closed row → the button is "View", it reopens the saved numbers (e.g. 3 / 1 / 1) and cannot be recorded again  
> Source: Q-20261013-01 · prototype v0.91  

#### B07 · Enter Repaired · A- · Scrap

- QC · Web · Repair / Rework
- Comes from: B06
- Goes to: B08 · Select Root Cause

> QC splits the pairs of the record by repair result.  
> Action: cells "Repaired OK (A/A-)" (default = Qty) · "Downgrade to A-" · "Scrap" (default 0); enter "Repaired By" · "Repair Time (min)".  
> System: QC reviews the result and closes the quality decision ("QC reviews fix/rework result and closes the quality decision.").  
> Source: BRD §6.5 · prototype v0.91  

#### B08 · Select Root Cause

- QC · Web · Repair / Rework
- Comes from: B02, B07
- Goes to: B09 · Scrap needing make-up?

> QC selects the root cause of the defect.  
> Action: required cell "Root Cause" — Mold wear · Machine setting · Material lot · Operator handling · Tooling / blade · Color batch · Other.  
> Source: prototype v0.91  

#### B09 · Scrap needing make-up?

- QC
- Comes from: B08
- Goes to [Yes]: B10 · Tick Re-plan WO
- Goes to [No]: B11 · Save repair result

> Is make-up production needed for the Scrap part?  
> Yes: tick Re-plan WO.  
> No: just save the result.  
> Open: who decides (Planner or QC) is not decided.  
> Source: prototype v0.91  

#### B10 · Tick Re-plan WO

- QC · Web · Repair / Rework
- Comes from: B09
- Goes to: B11 · Save repair result

> QC requests make-up production for the Scrap part.  
> Action: tick "Re-plan <WO> for the scrapped quantity (creates a make-up demand on the master plan)".  
> Result: on save, the system records the make-up request for the WO (later step).  
> Source: prototype v0.91  

#### B11 · Save repair result

- QC · Web · Repair / Rework
- Comes from: B09, B10
- Goes to: B12 · Total = Qty and Root Cause set?

> QC saves the repair result.  
> Action: button "Save Result".  
> Result: the system checks the numbers (next step) and then closes the record.  
> Open: editing a record after saving (reversing entry) has no path yet.  
> Source: prototype v0.91 · convention Q3  

#### B12 · Total = Qty and Root Cause set?

- QC
- Comes from: B11
- Goes to [No]: B13 · Save blocked — error shown on the Repair Result modal
- Goes to [Pass]: B14 · Set record status

> The system checks the result before closing the record.  
> Pass: "Repaired OK" + "Downgrade to A-" + "Scrap" = the Qty of the record and "Root Cause" is selected.  
> No: not saved, an error shows on the "Repair Result" box.  
> Test:  
> - Qty 10: Repaired 7, A- 2, Scrap 1 → can be saved  
> - Qty 10: Repaired 7, A- 2, Scrap 0 → blocked  
> - Numbers complete but no Root Cause → blocked  
> Source: prototype v0.91  

#### B13 · Save blocked — error shown on the Repair Result modal

- Output
- Comes from: B12

> The record cannot be saved, the error shows on the "Repair Result" box.  
> System: message "Repaired + scrap + downgrade must equal <Qty> pairs." or "Enter the root cause before closing this record."  
> Source: prototype v0.91  

#### B14 · Set record status

- QC · System (auto) · Repair / Rework
- Comes from: B12
- Goes to: B15 · Move Repaired OK goods to Repair Inv List

> The system closes the record and sets its status by the result; from PENDING there are only three branches, no way back.  
> System: Scrap = Qty → SCRAPPED; Repaired OK > 0 → REPAIRED; otherwise → DOWNGRADED.  
> Result: fields lock, the "Record" button becomes "View", the REPAIRED · A- · SCRAP columns show the quantities; message "RW-nnnn closed — n repaired, n downgraded A-, n scrapped".  
> Test:  
> - Qty 5, Scrap 5 → SCRAPPED  
> - Qty 5, Repaired 0, A- 3, Scrap 2 → DOWNGRADED  
> Source: Q-20260918-29 · prototype v0.91  

#### B15 · Move Repaired OK goods to Repair Inv List

- QC · System (auto) · Repair / Rework
- Comes from: B14
- Goes to [Source "Spray Out · Pending repair" · "Packing Spray · Pending repair"]: B16 · Repair Inv List of Packing Planning Spray Step 2 · Select Repair Inventory
- Goes to [Source "Trimming · Pending repair"]: B17 · Repair Inv List → Step 2 of Outsourcing Planning or Packing Planning Logo (by plan type)
- Goes to [Source "Stitching · Pending repair" · "Packing Logo · Pending repair"]: B18 · Repair Inv List — next process not yet determined (Stitching · Packing Logo)
- Goes to: B19 · Book the A- part to Common Stock

> The system puts the Repaired OK part into the Repair Inv List so the next process can pick it up; the destination depends on the Source of the record.  
> When: "Repaired OK" > 0.  
> System: "Spray Out · Pending repair" and "Packing Spray · Pending repair" → Packing Planning Spray › Step 2 · Select Repair Inventory, not back to Step 2 of Outsourcing Planning; "Trimming · Pending repair" → Step 2 of Outsourcing Planning or Packing Planning Logo, by plan type; for "Stitching · Pending repair" and "Packing Logo · Pending repair" see Open.  
> Test:  
> - "Spray Out · Pending repair" W5 Repaired 10 → shows in Packing Planning Spray Step 2 (10 pairs), not in Outsourcing Planning Step 2  
> - "Trimming · Pending repair" W7 Repaired 20 → shows in Step 2 of Outsourcing Planning (W7 = 20)  
> Open: "Stitching · Pending repair" has no destination Repair Inv List because the process after Stitching is not determined (OQ-122); "Packing Logo · Pending repair" has no destination either (OQ-126).  
> Source: Q-20260918-29 · Q-20261013-01 · prototype v0.91  

#### B19 · Book the A- part to Common Stock

- QC · System (auto) · Repair / Rework
- Comes from: B15
- Goes to [Downgrade to A- > 0]: B20 · A- downgrade → Common Stock
- Goes to: B21 · Book the Scrap part as Loss

> The system writes the downgraded A- part into Common Stock.  
> When: "Downgrade to A-" > 0.  
> Result: the A- goods are split from the SO and go into Common Stock.  
> Open: prototype v0.91 has no Common Stock figures for this step; whether A- into Common Stock goes through FG Receipt.  
> Source: Q-20260918-29  

#### B21 · Book the Scrap part as Loss

- QC · System (auto) · Repair / Rework
- Comes from: B19
- Goes to [Scrap > 0]: B22 · Scrap → Loss
- Goes to: B23 · Ticked Re-plan WO?

> The system writes the Scrap part as loss (Loss).  
> When: "Scrap" > 0.  
> Result: the Scrap quantity is written as Loss.  
> Open: prototype v0.91 only shows the number in the SCRAP column, it does not write Loss.  
> Source: Q-20260918-29 · Q-20261012-04  

#### B23 · Ticked Re-plan WO?

- QC
- Comes from: B21
- Goes to [Yes]: B24 · Create make-up demand for the WO
- Goes to [No]: B25 · Closed record · view only

> Did QC tick Re-plan WO when saving?  
> Yes: create make-up demand for the WO.  
> No: the record is closed, view only.  
> Source: prototype v0.91  

#### B24 · Create make-up demand for the WO

- QC · System (auto) · Repair / Rework
- Comes from: B23
- Goes to: B26 · Make-up demand → Master Plan (re-plan WO)

> The system creates the make-up production demand for the WO on the Master Plan.  
> Result: make-up demand is sent to the Master Plan; the record row carries the chip "Re-plan requested" and the message "· re-plan requested for <WO>".  
> Test:  
> - Tick Re-plan, Scrap 3 → the Master Plan has a make-up demand of 3 pairs for the WO  
> Open: prototype v0.91 only shows the chip "Re-plan requested", it does not create the make-up demand on the Master Plan.  
> Source: prototype v0.91  

#### B27 · Write Defect Records rows one row per reason

- QC · System (auto) · Defect Records
- Comes from: B03
- Goes to: B28 · Filter Defect Records

> The system writes each defect reason of grade C as one Defect Records row, by process, WO and SO.  
> When: the user records output with C > 0 at Daily Injection (Process "Injection"), Trimming Result ("Trimming"), Process Worklist ("Stitching"), Outsourcing Result ("Spray Out"), Packing Result Logo ("Packing Logo") or Packing Result Spray ("Packing Spray").  
> System: C must be fully split across reasons before writing; Packing Result with missing or mismatched reasons → "Grade C quantity recorded — map the defect quantity to a defect reason." and nothing is written. Pending repair is not written to Defect Records.  
> Result: each row has Date · Shift · Process · WO No. · SO No. · Customer · LOT No. · Item · Defect Qty · Defect Reason · Detail · Operator; C is scrap, so it creates no Repair / Rework record in any process.  
> Test:  
> - Daily Injection C = 12, reason "Air bubble / porosity" → one row added, Process "Injection", qty 12, Repair / Rework gets no new record  
> - Trimming Result C = 20, PR = 40 → Defect Records gains one row of qty 20 and Repair / Rework gains records for 40  
> Open: WO No. on Defect Records uses an alias (e.g. "WO-2608-02") while Repair / Rework uses the real WO code (e.g. "WO-20260803").  
> Source: Q-20261013-01 · prototype v0.91  

#### B28 · Filter Defect Records

- QC · Web · Defect Records
- Comes from: B27
- Goes to: B29 · Export Defect Records

> The user filters the defect list by time, shift and process.  
> Action: filters "FROM" · "TO" · "SHIFT" (All · Shift A · Shift B) · "PROCESS" (All · Injection · Trimming · Stitching · Spray Out · Packing Logo · Packing Spray) · "SEARCH".  
> Result: the KPI "Total defect … pairs" and the total per Process are recalculated by the filter; the screen is read-only, rows cannot be edited; the same data shows on the "Defects" tab of Work Order Detail.  
> Source: Q-20261013-01 · prototype v0.91  

#### B29 · Export Defect Records

- QC · Web · Defect Records
- Comes from: B28
- Goes to: B30 · File Excel Defect Records

> The user exports the defect list to Excel.  
> Action: button "Export".  
> Result: an Excel file by the current filter; message "Defect list exported to Excel."  
> Source: prototype v0.91  

## Status lifecycle

#### Repair / Rework record

`PENDING` → `REPAIRED` → `DOWNGRADED` → `SCRAPPED`

Transitions:

- `PENDING` -- Repaired OK > 0 --> `REPAIRED`
- `PENDING` -- Repaired OK = 0, with A- --> `DOWNGRADED`
- `PENDING` -- Scrap = Qty --> `SCRAPPED`

Notes on the diagram:

- On Save Result the record takes exactly one of three branches from PENDING; Save Result happens once, there is no way back.

## Input

| # | Input | Type | Used in step |
| --- | --- | --- | --- |
| I-1 | Pending repair (PR) of the processes after Injection, each size with PR > 0 — Trimming Result (`Trimming`) · Process Worklist (`Stitching`) · Outsourcing Result (`Spray Out`) · Packing Result Logo (`Packing Logo`) · Packing Result Spray (`Packing Spray`) | Production result — MES | Create a Repair / Rework record for each size with PR > 0 |
| I-2 | Root Cause · Defect Reason | Master data | Select Root Cause |
| I-3 | Grade C (scrap) recorded at POP in every process, including Daily Injection (Process `Injection`), with Defect Reason; Pending repair does not go to Defect Records | Production result — MES | Write Defect Records rows, one row per reason |

## Step ↔ screen

| Step | Role | Screen · UI button |
| --- | --- | --- |
| Open PENDING record · Enter Repaired · A- · Scrap · Select Root Cause · Tick Re-plan WO · Save repair result | QC | Repair / Rework · Rework Records table (`Record`) · modal Repair Result (`Save Result`) |
| Create a Repair / Rework record for each size with PR > 0 · Set record status · Move Repaired OK goods to Repair Inv List · Write the A- part to Common Stock · Write the Scrap part as Loss · Create make-up demand for the WO | System (auto) | Repair / Rework |
| Repair defective goods | Operator (Repair team) | At the repair area — no action on screen |
| Write Defect Records rows, one row per reason | System (auto) | Defect Records · Grade C Records table; tab `Defects` of Work Order Detail |
| Filter Defect Records · Export Defect Records | QC | Defect Records (`Export`) |

## Output

| # | Output | Produced when |
| --- | --- | --- |
| O-1 | Save blocked — error on the Repair Result modal: "Repaired + scrap + downgrade must equal <Qty> pairs." / "Enter the root cause before closing this record." | Repaired OK + Downgrade to A- + Scrap differs from Qty, or no Root Cause selected |
| O-2 | Repair Inv List of Packing Planning Spray — Step 2 · Select Repair Inventory | Valid Save Result, Repaired OK > 0, Source `Spray Out · Pending repair` or `Packing Spray · Pending repair` |
| O-3 | Repair Inv List → Step 2 of Outsourcing Planning or Packing Planning Logo (by plan type) | Valid Save Result, Repaired OK > 0, Source `Trimming · Pending repair` |
| O-4 | Repair Inv List — next process not yet determined | Valid Save Result, Repaired OK > 0, Source `Stitching · Pending repair` or `Packing Logo · Pending repair` |
| O-5 | A- downgrade → Common Stock | Valid Save Result, Downgrade to A- > 0 |
| O-6 | Scrap → Loss | Valid Save Result, Scrap > 0 |
| O-7 | Make-up demand → Master Plan (re-plan WO for the Scrap quantity) | Re-plan WO ticked before Save Result |
| O-8 | Closed record · view only (button `View`) | Valid Save Result, Re-plan WO not ticked |
| O-9 | File Excel Defect Records | QC presses Export on the Defect Records screen |

## Glossary

| Glossary | Meaning in this flow |
| --- | --- |
| `WO` | Work Order — production order created on Release in Master Plan; each WO brings its process plans |
| `POP` | Point of Production — output reported at the process, per shift and per size |
| `Grade C` | "Reject" goods are scrap — only written to Defect Records by reason, no Repair / Rework record in any process |
| `Pending repair` (PR) | Repairable goods in the processes after Injection — when PR is entered the system creates a Repair / Rework record per size automatically; not written to Defect Records; Daily Injection has no PR |
| `Source` | Origin of a Repair / Rework record, in the form "<Process> · Pending repair" (five values) |
| `Defect Records` | Read-only report: one row per grade C defect reason by Process, WO, SO |
| `Rework Records` | List of RW-nnnn repair records, one record per size with Pending repair |
| `Repaired OK` | Pairs repaired to first quality (A / A-), returned to the next process |
| `Downgrade to A-` | Pairs downgraded to A-, released from the SO into Common Stock |
| `Scrap` | Pairs scrapped, recorded as Loss |
| `Repair Inv List` | List of repaired goods waiting for the next process; only that process's Plan sees them |
| `Common Stock` | Shared stock not tied to a P.O, re-allocated later |
| `Make-up demand` | Make-up production need for the scrapped part, sent to Master Plan |
