# Outsourcing Result — receive Spray Out goods back from the spray vendor per plan: A + A- into the Spray In List, C recorded in Defect Records, Pending repair to Repair / Rework

> Fine Chemical (FC) · Module MES · v0.8 · 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/outsourcing-result

## 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
- Warehouse Staff
- Output

### Steps

| Code | Role | Type | Content | Platform · Screen | Goes to |
| --- | --- | --- | --- | --- | --- |
| B01 | Input | Data | Spray Out Plan SENT — LOTs at the spray vendor (Outsourcing Planning) |  | B03 |
| B02 | Warehouse Staff | Start | Start |  | B03 |
| B03 | Warehouse Staff | Task | Open Waiting to Return | Web · Outsourcing Result | B04 |
| B04 | Warehouse Staff | Task | Open the Spray Out Plan (Open Plan) | Web · Outsourcing Result | B05 |
| B05 | Warehouse Staff | Task | Pick the LOT to receive (Enter Output) | Web · Outsourcing Result | B06 |
| B06 | Warehouse Staff | Task | Enter A / A- / C / PR by size | Web · Outsourcing Result | B07 |
| B07 | Warehouse Staff | Decision | Any C entered? |  | B08 [Yes]; B09 [No] |
| B08 | Warehouse Staff | Task | Split C by defect reason | Web · Outsourcing Result | B09 |
| B09 | Warehouse Staff | Decision | Entry valid? |  | B10 [No]; B11 [Yes] |
| B10 | Output | Data | Record Result blocked — empty, over Remaining, C reason total mismatch |  | (end) |
| B11 | Warehouse Staff | Task | Record the receipt result | Web · Outsourcing Result | B12 |
| B12 | Warehouse Staff | Task | Create OSR receipt · add to plan Received | System (auto) · Outsourcing Result | B13 |
| B13 | Warehouse Staff | Task | Move A + A- into Spray In List | System (auto) · Outsourcing Result | B14; B15 |
| B14 | Output | Data | Spray In List (A + A-) → Packing Planning Spray |  | (end) |
| B15 | Warehouse Staff | Task | Record C in Defect Records by reason | System (auto) · Outsourcing Result | B16; B17 |
| B16 | Output | Data | Defect Records — Spray Out C by reason (scrap) |  | (end) |
| B17 | Warehouse Staff | Decision | Any Pending repair? |  | B18 [Yes]; B19 [No] |
| B18 | Warehouse Staff | Task | Open Repair / Rework records by size | System (auto) · Outsourcing Result | B20; B19 |
| B19 | Warehouse Staff | Decision | Every LOT has no Remaining? |  | B21 [No]; B22 [Yes] |
| B20 | Output | Data | New Repair / Rework record → once repaired into Packing Planning Spray Step 2 |  | (end) |
| B21 | Output | Data | Plan stays SENT — waits for next receipt, no short close |  | (end) |
| B22 | Warehouse Staff | Task | Set plan RECEIVED | System (auto) · Outsourcing Result | B23; B24 |
| B23 | Output | Data | Plan RECEIVED — "All quantity received" |  | (end) |
| B24 | Warehouse Staff | End | End |  |  |
| B25 | Warehouse Staff | Start | View received plan |  | B26 |
| B26 | Warehouse Staff | Task | View Output Entries (View) | Web · Outsourcing Result | B27; B28 |
| B27 | Output | Data | View only — no further entry when Remaining = 0 |  | (end) |
| B28 | Warehouse Staff | End | End |  |  |

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

#### B03 · Open Waiting to Return

- Warehouse Staff · Web · Outsourcing Result
- Comes from: B01, B02
- Goes to: B04 · Open the Spray Out Plan (Open Plan)

> The Warehouse Staff opens the list of Spray Out Plans whose goods are at the spray vendor and picks the plan to receive.  
> Action: Outsourcing Result › table "Waiting to Return · by Spray Out plan"; filter "All vendors" / vendor name, switch "Open only", search box "Search plan, P.O, LOT, model or color".  
> System: four cards "PLANS AT VENDOR" · "REMAIN AT VENDOR" · "A + A- RECEIVED" · "C + PENDING REPAIR"; one row per SENT plan with columns Action · Spray Out Plan · P.O · Out Date · LOTs · Model / Base Color · Vendor · Sent Qty · Received · Remaining · A + A- · C · Pending repair · Status; the "LOTs" column shows the number of LOT lines in the plan ("3 LOT(s)").  
> System: plan "Remaining" = "Sent Qty" − "Received", summed over every LOT line; Status shows "At vendor" (nothing received), "Partially received" (part received) or "Received" (all).  
> Test:  
> - Turn on "Open only" → fully received plans leave the list  
> - A SENT plan with 3 LOTs, 1,350 pairs, nothing received → "LOTs" 3 LOT(s), "Remaining" 1,350, Status "At vendor"  
> Source: Q-20260929-01 · Q-20260929-03 · Q-20261006-05 · prototype v0.78  

#### B04 · Open the Spray Out Plan (Open Plan)

- Warehouse Staff · Web · Outsourcing Result
- Comes from: B03
- Goes to: B05 · Pick the LOT to receive (Enter Output)

> The Warehouse Staff opens one Spray Out Plan to see its LOT lines.  
> When: the plan is SENT with "Remaining" > 0.  
> Action: plan row › "Open Plan" button, or click the plan number / the "LOTs" cell (a fully received plan shows "View").  
> System: the page "Outsourcing Result — <Plan No.>" has the block "Spray Out Plan" (SPRAY OUT PLAN NO. · P.O · LOTS · MODEL · BASE COLOR · VENDOR · OUT DATE · SENT QTY · RECEIVED · REMAINING), the block "LOTs in plan <Plan No.> (n)" and the block "Output Entries" of the whole plan with a "LOT No." column.  
> System: "LOTS" shows "<n> (<m> fully received)", m = number of LOT lines with no Remaining left.  
> Result: the plan page opens, nothing is saved yet; the arrow button returns to the "Waiting to Return" list.  
> Test:  
> - A plan with 3 LOTs → "LOTs in plan" has 3 rows, "LOTS" 3 (0 fully received)  
> Source: Q-20260929-12 · Q-20261006-05 · prototype v0.78  

#### B05 · Pick the LOT to receive (Enter Output)

- Warehouse Staff · Web · Outsourcing Result
- Comes from: B04
- Goes to: B06 · Enter A / A- / C / PR by size

> The Warehouse Staff picks one LOT line of the plan to record the goods received for exactly that LOT.  
> When: the LOT line has "Remaining" > 0.  
> Action: block "LOTs in plan <Plan No.> (n)" › the line's "Enter Output" button, or click its "LOT No."; a line with no Remaining left shows "View".  
> System: every line of the plan (one LOT, or one Repair line) is one table row with columns Action · LOT No. · WO No. · Grade · quantity sent by size · Sent Qty · Received · Remaining · Status.  
> System: line "Remaining" = line "Sent Qty" − line "Received"; line Status "At vendor" / "Partially received" / "Received".  
> Result: the entry page of the LOT opens; its arrow button returns to the LOT list of the plan.  
> Test:  
> - Plan with 3 LOTs, record 405 pairs for LOT-20260807-AB → only that line shows "Received" 405, the other two LOTs keep "Received" 0  
> Source: Q-20261006-05 · prototype v0.78  

#### B06 · Enter A / A- / C / PR by size

- Warehouse Staff · Web · Outsourcing Result
- Comes from: B05
- Goes to: B07 · Any C entered?

> The Warehouse Staff enters the quantities received in this delivery for the chosen LOT, by grade and size.  
> Action: block "Spray Out Plan · LOT" (SPRAY OUT PLAN NO. · P.O · LOT NO. · WO NO. · GRADE · …) › "Output Matrix (Item / Size)" › number cells of rows "A" ("First grade → Spray In"), "A-" ("First grade, minor → Spray In"), "C" ("Reject → Defect Records"), "PR" ("Pending repair"); field "Receipt Date"; buttons "Fill A = Remaining", "Clear".  
> System: "This Entry" = A + A- + C + Pending repair; "Remaining" = LOT "Sent Qty" − LOT "Already Received" − "This Entry", recomputed per size while typing; cells of sizes the LOT did not send are locked.  
> Test:  
> - LOT sent 80 at M5/W7, enter A 70, PR 5 → "This Entry" 75, "Remaining" 5  
> - Press "Fill A = Remaining" with LOT "Already Received" 30 → A of each size equals what is left of the LOT, "Remaining" 0  
> Source: Q-20261001-10 (OQ-93) · Q-20261006-05 · Q-20261013-01 · prototype v0.91  

#### B07 · Any C entered?

- Warehouse Staff
- Comes from: B06
- Goes to [Yes]: B08 · Split C by defect reason
- Goes to [No]: B09 · Entry valid?

> Does this receipt contain grade C?  
> Yes: total "C" > 0 → the C quantity must be split by defect reason before saving.  
> No: C = 0 → check the entry.  
> Source: Q-20261005-01 (4)  

#### B08 · Split C by defect reason

- Warehouse Staff · Web · Outsourcing Result
- Comes from: B07
- Goes to: B09 · Entry valid?

> The Warehouse Staff splits the whole grade C quantity by defect reason, because grade C received from the spray vendor is scrap.  
> When: the receipt has C > 0.  
> Action: the "Defect Reason Breakdown (grade C)" block shows inside "Output Matrix (Item / Size)", right above the "Record Result" button, once the C cells hold a quantity › one line per reason "Defect Reason" · "Qty" · "Defect Detail"; "Add Defect Line" button (same entry as Trimming Result).  
> System: the "Defect Reason" list is "Color mismatch" · "Peeling" · "Spray overflow" · "Stain / dirt" · "Other"; the summary shows "Grade C" · "Mapped" · "Balanced" / "Unmapped: n"; the sum of "Qty" over the lines must equal the total C of the receipt.  
> Blocked when: "Grade C quantity recorded — map the defect quantity to a defect reason." · "A defect line has a quantity but no defect reason." · "A defect reason has no quantity." · "Defect reason breakdown (n) must equal the grade C quantity (m)."  
> Test:  
> - C = 5, no line yet, press "Record Result" → "Grade C quantity recorded — map the defect quantity to a defect reason."  
> - C = 5, line Peeling 3 → "Defect reason breakdown (3) must equal the grade C quantity (5)."  
> - Add line Stain / dirt 2 → "Balanced", the confirmation dialog opens  
> Source: Q-20261005-01 (4) · Q-20261002-02 (3) · Q-20260929-11 · Q-20261007-01 · prototype v0.81  

#### B09 · Entry valid?

- Warehouse Staff
- Comes from: B08, B07
- Goes to [No]: B10 · Record Result blocked — empty, over Remaining, C reason total mismatch
- Goes to [Yes]: B11 · Record the receipt result

> The system checks the entry before opening the confirmation dialog.  
> Yes: "This Entry" > 0, no size has "This Entry" above "Remaining", C fully split by reason → the dialog opens.  
> No: error on the page, no dialog: "Enter A / A- / C / Pending repair before recording the result." · "This Entry is more than Remaining at <size>." · C reason split error (step T4).  
> Test:  
> - Remaining M3/W5 = 60, enter A 61 → "This Entry is more than Remaining at M3/W5."  
> - Enter A 60 → allowed  
> Source: prototype v0.81 · Q-20261005-01 (4)  

#### B11 · Record the receipt result

- Warehouse Staff · Web · Outsourcing Result
- Comes from: B09
- Goes to: B12 · Create OSR receipt · add to plan Received

> The Warehouse Staff confirms recording this receipt for the chosen LOT.  
> Action: "Record Result" button → dialog "Record Spray Out result for <LOT> · <plan>?" (SPRAY OUT PLAN · P.O · LOT NO. · RECEIPT DATE · THIS ENTRY · A + A- → SPRAY IN LIST · C → DEFECT RECORDS (quantity + reasons) · PENDING REPAIR → REPAIR / REWORK · REMAINING AFTER ENTRY, table by size) › "Record Result"; "Cancel" closes the dialog without saving.  
> System: the "entry #n" number in the dialog counts per LOT, not per plan.  
> Result: the system creates the receipt and moves the goods by grade in the next steps.  
> Test:  
> - Press "Cancel" in the dialog → no receipt, the typed quantities stay on the page  
> - The LOT has 1 receipt and the plan has 3 → the dialog shows "entry #2"  
> Source: Q-20261001-10 (OQ-93) · Q-20261006-05 · prototype v0.78  

#### B12 · Create OSR receipt · add to plan Received

- Warehouse Staff · System (auto) · Outsourcing Result
- Comes from: B11
- Goes to: B13 · Move A + A- into Spray In List

> The system creates one receipt for the LOT's delivery and adds the quantity to that LOT line only.  
> System: receipt number OSR-YYYYMMDD-NN holds only the chosen LOT's line; LOT "Received" += "This Entry"; plan "Received" = sum of the LOT lines' "Received".  
> Result: "Output Entries" on the LOT entry page gets one more row (#, Receipt No., Receipt Date, A, A-, C, Pending repair, Total, By); "Output Entries" on the plan page shows the same receipt with its "LOT No."; "Receipt history" in Outsourcing Planning shows it too.  
> Test:  
> - Plan with 3 LOTs, record 405 for LOT-20260807-AB → OSR-20260811-01 with one LOT-20260807-AB line; plan "Received" 405, "Remaining" 945  
> - A LOT receives 30 then 380 → two receipts, LOT "Received" 410  
> Open: one delivery covering several LOTs becomes several OSR receipts (one per LOT) — to confirm with the warehouse (OQ-103); a recorded OSR receipt has no edit / cancel action.  
> Source: Q-20261006-05 · prototype v0.78  

#### B13 · Move A + A- into Spray In List

- Warehouse Staff · System (auto) · Outsourcing Result
- Comes from: B12
- Goes to: B14 · Spray In List (A + A-) → Packing Planning Spray
- Goes to: B15 · Record C in Defect Records by reason

> The system puts the grade A and A- goods of this receipt into the Spray In List for packing.  
> When: A + A- of the receipt > 0.  
> System: the A line and the A- line are kept apart to keep the Grade; each line carries LOT No., P.O and the OSR number.  
> Result: the new lines appear in "Step 1 · Select Spray IN" of Packing Planning Spray.  
> Test:  
> - Receive A 20, A- 5 → Packing Planning Spray Step 1 shows two OSR-… lines (20 grade A, 5 grade A-)  
> Source: Q-20261001-10 (OQ-93) · prototype v0.69  

#### B15 · Record C in Defect Records by reason

- Warehouse Staff · System (auto) · Outsourcing Result
- Comes from: B13
- Goes to: B16 · Defect Records — Spray Out C by reason (scrap)
- Goes to: B17 · Any Pending repair?

> The system records the grade C goods of this receipt in Defect Records by defect reason; grade C does not return to production.  
> When: C of the receipt > 0.  
> System: one Defect Records line per reason, Process "Spray Out", carrying LOT No., WO, P.O (SO column), quantity and reason; the Detail column holds the entered detail + Vendor + OSR receipt number + Spray Out Plan number. Grade C by size stays on the OSR receipt and is not split by reason.  
> Result: grade C does not go to the Repair Spray In List, is not re-sprayed and does not go to Packing Spray (it does not appear in Step 2 of Packing Planning Spray); the Defect Records "Process" filter has "Spray Out".  
> Test:  
> - Receive C 2 with reason Peeling → Defect Records gets one Spray Out line of 2 pairs Peeling  
> - Receive C 5 = Peeling 3 + Stain / dirt 2 → filter Process "Spray Out" shows 2 lines with the same OSR number  
> Source: Q-20261002-02 (3) · Q-20261005-01 (4) · Q-20261007-01 · Q-20261013-01 · prototype v0.91  

#### B17 · Any Pending repair?

- Warehouse Staff
- Comes from: B15
- Goes to [Yes]: B18 · Open Repair / Rework records by size
- Goes to [No]: B19 · Every LOT has no Remaining?

> Does this receipt contain Pending repair?  
> Yes: total "PR" > 0 → open Repair / Rework records.  
> No: PR = 0 → check the plan Remaining.  
> Source: Q-20261001-11 (OQ-96) · Q-20261013-01  

#### B18 · Open Repair / Rework records by size

- Warehouse Staff · System (auto) · Outsourcing Result
- Comes from: B17
- Goes to: B20 · New Repair / Rework record → once repaired into Packing Planning Spray Step 2
- Goes to: B19 · Every LOT has no Remaining?

> The system opens Repair / Rework records for the Pending repair goods to be repaired; once repaired the goods go straight to Packing Planning Spray.  
> System: one RW-… record per size with PR > 0, status Pending, source "Spray Out · Pending repair", reason "Pending repair", carrying the LOT No. of the chosen LOT line, WO, P.O; PR is not written to Defect Records.  
> Result: once marked Repaired on the Repair / Rework screen, the goods appear in Packing Planning Spray › "Step 2 · Select Repair Inventory" (next process = Packing Spray) and do not appear in Step 2 of Outsourcing Planning; message "Result recorded · C n pairs → Defect Records · Pending repair n pairs → n Repair / Rework record(s)".  
> Test:  
> - Receive PR 10 at W5 for LOT-20260806-AB → one RW-… record of 10 pairs, Pending, LOT No. LOT-20260806-AB  
> - Mark that record Repaired → Packing Planning Spray Step 2 shows a selectable 10-pair row and Outsourcing Planning Step 2 does not  
> Open: differs from Q-20261001-11 (OQ-96) "make a new Spray Out plan again" — the prototype sends the goods straight to Packing Spray.  
> Source: Q-20261001-11 (OQ-96) · Q-20261012-04 (destination Packing Planning Spray) · Q-20261013-01 · prototype v0.91  

#### B19 · Every LOT has no Remaining?

- Warehouse Staff
- Comes from: B18, B17
- Goes to [No]: B21 · Plan stays SENT — waits for next receipt, no short close
- Goes to [Yes]: B22 · Set plan RECEIVED

> Has every LOT line of the plan been fully received?  
> Yes: every LOT line has "Remaining" = 0 for every size → plan RECEIVED.  
> No: some LOT line still has "Remaining" > 0 → the plan stays SENT, Status "Partially received"; the Warehouse Staff goes back to the LOT list to receive another LOT or waits for the next delivery.  
> Test:  
> - Plan with 3 LOTs, LOT-20260807-AB has 5 left, the other two not received → the plan stays SENT, "Remaining" 945  
> - The last LOT reaches no Remaining → plan RECEIVED  
> Source: Q-20261006-05 · prototype v0.78  

#### B22 · Set plan RECEIVED

- Warehouse Staff · System (auto) · Outsourcing Result
- Comes from: B19
- Goes to: B23 · Plan RECEIVED — "All quantity received"
- Goes to: B24 · End

> The system moves the plan to RECEIVED once every LOT line has been fully received.  
> Result: plan → RECEIVED on both Outsourcing Result and the SPRAY OUT List; every LOT line shows "View"; on a LOT entry page the record button becomes "All quantity received" and is disabled, "Fill A = Remaining", "Clear" are disabled.  
> Test:  
> - The last receipt clears the last LOT → the SPRAY OUT List shows RECEIVED  
> Source: Q-20261006-05 · prototype v0.78  

#### B26 · View Output Entries (View)

- Warehouse Staff · Web · Outsourcing Result
- Comes from: B25
- Goes to: B27 · View only — no further entry when Remaining = 0
- Goes to: B28 · End

> The Warehouse Staff reopens a fully received plan to review its receipts.  
> When: plan RECEIVED (turn off "Open only" to see the row).  
> Action: plan row › "View" button → plan page; LOT row › "View" to look at one LOT.  
> Result: the plan page shows the "Output Entries" of every LOT (with a "LOT No." column); the LOT page shows the LOT's "Output Entries" and the totals "First quality (A + A-) … · C … · Pending repair … · entries …"; no more entry is possible.  
> Open: goods the vendor never returns have no short-close action — the plan waits until every LOT has no Remaining, and the gap is handled outside the system.  
> Source: Q-20261005-01 (3) · Q-20261006-05 · prototype v0.78  

## Status lifecycle

#### Spray Out Plan (receiving in Outsourcing Result)

`SENT` → `RECEIVED`

Transitions:

- `SENT` -- Record Result · no Remaining on any LOT --> `RECEIVED`

Notes on the diagram:

- A LOT still has Remaining > 0 → plan stays SENT

## Input

| # | Input | Type | Used in step |
| --- | --- | --- | --- |
| I-1 | Spray Out Plan `SENT` — LOTs shipped to the spray vendor, with Sent Qty by size (Outsourcing Planning) | Document — spray-out flow | Open Waiting to Return |

## Step ↔ screen

| Step | Role | Screen · UI button |
| --- | --- | --- |
| Open Waiting to Return · Open the plan to receive | Warehouse Staff | Outsourcing Result · `Waiting to Return · by Spray Out plan` (`Open only`, `Record Result`, `View`) |
| Enter A / A- / C / PR by size · Split C by defect reason · Record the receipt result | Warehouse Staff | Outsourcing Result · `Output Matrix (Item / Size)` (`Fill A = Remaining`, `Clear`, `Receipt Date`, `Defect Reason Breakdown`, `Record Result`) |
| Create OSR receipt · Move A + A- into Spray In List · Record C in Defect Records · Open Repair / Rework records · Set plan RECEIVED | System (auto) | Outsourcing Result · on `Record Result`; table `Output Entries` |
| View Output Entries | Warehouse Staff | Outsourcing Result · `View` |

## Output

| # | Output | Produced when |
| --- | --- | --- |
| O-1 | Record Result blocked — empty, over Remaining, C reason total mismatch | This Entry = 0, This Entry > Remaining at a size, or the sum by reason ≠ C |
| O-2 | Spray In List (A + A-) — Step 1 source of Packing Planning Spray | The receipt has A + A- > 0 |
| O-3 | Defect Records — Spray Out C by reason (scrap, does not return to the flow) | The receipt has C > 0 |
| O-4 | New Repair / Rework record (Pending) per size, Source `Spray Out · Pending repair` — once repaired into Packing Planning Spray, Step 2 · Select Repair Inventory | The receipt has Pending repair > 0 |
| O-5 | Plan stays `SENT` — waits for the next receipt, no short-close action | After the receipt some size still has Remaining > 0 |
| O-6 | Plan `RECEIVED` — button "All quantity received" | After the receipt Remaining = 0 for every size |
| O-7 | View only — no further entry when Remaining = 0 | Open plan `RECEIVED` with `View` |

## Glossary

| Glossary | Meaning in this flow |
| --- | --- |
| `Spray Out Plan` | Plan sending SPRAY goods to the spray vendor, made in Outsourcing Planning; number SPO-… |
| `Sent Qty` | Pairs sent to the vendor by size (the plan Stock Out slip is approved) |
| `Received / Already Received` | Total received for the plan in earlier receipts |
| `This Entry` | Quantity of this receipt = A + A- + C + Pending repair |
| `Remaining` | Quantity still at the vendor = Sent Qty − Already Received − This Entry |
| `A / A-` | Good grade (A) and good with minor defects (A-); go into the Spray In List |
| `C` | Scrap received from the spray vendor; recorded in Defect Records by reason, not repaired, not re-sprayed |
| `PR` | Pending repair — repairable goods; opens a Repair / Rework record, once repaired they go to Packing Planning Spray Step 2 |
| `OSR` | Spray Out goods receipt, number OSR-YYYYMMDD-NN, one receipt per Record Result |
| `Spray In List` | Sprayed A + A- goods received back, Step 1 source of Packing Planning Spray |
| `Repair Inventory` | Stock of repaired goods (Repaired), the source of Step 2 in Outsourcing Planning, Packing Planning Logo and Packing Planning Spray depending on the record Source |
