# Packing Planning Spray — the Planner builds a Packing Plan in 3 steps (pick Spray IN → pick Repair Inventory → allocate to Customer P.Os), one plan per P.O; Release Plan → RELEASED and the packing material MOR is created automatically; RELEASED plans go to Packing Result Spray

> Fine Chemical (FC) · MES module · v0.6 · 14/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/packing-planning-spray

## 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
- Planner
- Output

### Steps

| Code | Role | Type | Content | Platform · Screen | Goes to |
| --- | --- | --- | --- | --- | --- |
| B01 | Input | Data | Spray IN List (A + A-) — received at Outsourcing Result |  | B09 |
| B02 | Input | Data | Repair Inventory — Repaired goods (Spray Out · Pending repair, Packing Spray · Pending repair) |  | B10 |
| B03 | Input | Data | Remaining not yet recorded returned — Packing Result Spray |  | B11 |
| B04 | Input | Data | Customer P.O · ETD · P.O Month (Sales Order) |  | B11 |
| B05 | Input | Data | Source P.O Remaining returned — Exchange Customer PO |  | B11 |
| B06 | Input | Data | Master data: Packing BOM (Model · Size · Destination) | Master data | B16 |
| B07 | Planner | Start | Start |  | B08 |
| B08 | Planner | Task | Create Packing Plan | Web · Packing Planning Spray | B09 |
| B09 | Planner | Task | Step 1 · Pick Spray IN | Web · Packing Planning Spray | B10 |
| B10 | Planner | Task | Step 2 · Pick Repair Inventory | Web · Packing Planning Spray | B11 |
| B11 | Planner | Task | Step 3 · Allocate to Detail P.O | Web · Packing Planning Spray | B12 |
| B12 | Planner | Decision | Allocation valid? |  | B11 [No — fix quantities]; B13 [Yes] |
| B13 | Planner | Task | Release Packing Plan | Web · Packing Planning Spray | B14 |
| B14 | Planner | Task | Split plan per P.O · hold sources | System (auto) · Packing Planning Spray | B15; B16 |
| B15 | Output | Data | Plan RELEASED (Waiting) → Packing Result Spray · source of Exchange Customer PO |  | (end) |
| B16 | Planner | Task | Create a material MOR MOR (one / plan) | System (auto) · Packing Planning Spray | B17; B18 |
| B17 | Output | Data | Packing material MOR (auto created on Release) → WMS |  | (end) |
| B18 | Planner | End | End |  |  |
| B19 | Planner | Start | Revision needed |  | B20 |
| B20 | Planner | Decision | Plan has Record Output? |  | B21 [Yes]; B22 [Not yet] |
| B21 | Output | Data | Revision locked — plan already has output |  | (end) |
| B22 | Planner | Task | Create Revision Packing Plan | Web · Packing Planning Spray | B23; B24 |
| B23 | Output | Data | Plan NEW · opens Step 3 to edit quantities |  | (end) |
| B24 | Planner | Task | Release again Packing Plan | Web · Packing Planning Spray | B25; B26 |
| B25 | Output | Data | Plan RELEASED again · keeps the existing MOR |  | (end) |
| B26 | Planner | End | End |  |  |

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

#### B08 · Create Packing Plan

- Planner · Web · Packing Planning Spray
- Comes from: B07
- Goes to: B09 · Step 1 · Pick Spray IN

> The Planner opens the Packing Plan page for sprayed SPRAY goods waiting for packing.  
> When: any time goods are waiting for packing; WO release does not pre-create a Packing Plan.  
> Action: Packing Planning Spray › "Create Spray Plan" button → "Add Packing Spray Plan" page.  
> System: only goods whose WO Model attribute is Spray; Logo / OOMG goods are planned in Packing Planning Logo.  
> System: the "Plan Details" card has "Plan No." (Auto-generated), "P.O (Month) *" defaulting to the first month, "Plan Date"; a 3-step bar and the footer "Reset" · "Back" · "Next".  
> Result: Step 1 opens; nothing is saved yet.  
> Blocked when: "P.O (Month) *" is empty and "Next" is pressed in Step 1 → "Select P.O (Month) first."  
> Test:  
> - Leave "P.O (Month) *" empty and press "Next" → "Select P.O (Month) first." shows, still on Step 1  
> Source: Q-20261001-10 (OQ-93) · Q-20260929-13 · CHANGELOG v0.66 · prototype v0.70  

#### B09 · Step 1 · Pick Spray IN

- Planner · Web · Packing Planning Spray
- Comes from: B01, B08
- Goes to: B10 · Step 2 · Pick Repair Inventory

> The Planner ticks sprayed SPRAY goods as the plan source.  
> Action: Step 1 · "Select Spray IN" › tick each row.  
> System: the table holds A + A- received at Outsourcing Result, each row carrying LOT No., Grade and the P.O assigned at Outsourcing Planning; Step 1 only selects, it does not allocate.  
> Result: ticked rows add to "Selected Stock (by size)" in Step 3; Step 3 shows only the P.O written on the Spray IN row.  
> Test:  
> - Tick a Spray IN row for P.O 260811-07 → Step 3 shows only P.O 260811-07  
> Source: Q-20261001-10 (OQ-93) · Q-20261002-02 (3) · CHANGELOG v0.66 · prototype v0.70  

#### B10 · Step 2 · Pick Repair Inventory

- Planner · Web · Packing Planning Spray
- Comes from: B02, B09
- Goes to: B11 · Step 3 · Allocate to Detail P.O

> The Planner optionally adds repaired goods from Repair Inventory to the plan; this step is not mandatory.  
> Action: Step 2 · "Select Repair Inventory" › tick repaired rows; "Back" to Step 1, "Next" to Step 3.  
> System: only Repaired rows can be ticked, taken from Repair / Rework slips with Source "Spray Out · Pending repair" or "Packing Spray · Pending repair"; Step 2 only selects, it does not allocate.  
> Result: ticked rows add to "Selected Stock (by size)"; allocation uses Repair goods first.  
> Test:  
> - Tick nothing and press "Next" → Step 3 opens with sources from Step 1 only  
> - RW slip "Spray Out · Pending repair" set to Repaired with 10 pairs → Step 2 shows a 10-pair row that can be ticked  
> System: "Spray Out · Pending repair" goods go straight into this Step 2 once repaired, not back to Step 2 of Outsourcing Planning; grade C received at Outsourcing Result is scrap, written to Defect Records, and does not enter Step 2.  
> Source: Q-20261013-01 · Q-20261007-01 · Q-20260929-06 · prototype v0.91  

#### B11 · Step 3 · Allocate to Detail P.O

- Planner · Web · Packing Planning Spray
- Comes from: B03, B04, B05, B10, B12
- Goes to: B12 · Allocation valid?

> The Planner splits the selected goods over Customer P.Os by size; this is the only allocation step.  
> Action: Step 3 · "Allocate to Detail P.O" › "Allocate" / "Remove" buttons in the "Action" column per P.O · "Auto Allocate" button · type into the "Allocated" row.  
> System: P.Os match Model, Base Color, Upper Color, AL / INT and the same "P.O (Month)", only the P.O written on the Spray IN row; "Remaining" = P.O order quantity − quantity held by other Packing Plans, plus the Remaining not yet recorded that Packing Result Spray returns (Pending repair is not returned; it goes to Repair / Rework) and the balance returned by Exchange Customer PO.  
> System: "Auto Allocate" fills the earliest-ETD P.O first, Repair goods first; "Selected Stock (by size)" updates "Allocated to P.O" and "Not Allocated".  
> Result: a "Packing Plan summary" per P.O appears below; the footer has the "Release Plan" button.  
> Test:  
> - A P.O that just got 30 pairs of W5 back from Exchange Customer PO → its W5 "Remaining" rises by 30  
> Source: Q-20261013-01 · Q-20261001-06 · Q-20261002-03 · Q-20260929-06, -08 · CHANGELOG v0.58 · prototype v0.91  

#### B12 · Allocation valid?

- Planner
- Comes from: B11
- Goes to [No — fix quantities]: B11 · Step 3 · Allocate to Detail P.O
- Goes to [Yes]: B13 · Release Packing Plan

> The system checks the allocation before saving or releasing.  
> Yes: for every P.O, "Allocated" by size ≤ selected goods and ≤ the P.O "Remaining", total > 0 and a "Plan Date" is set → "Release Plan" allowed.  
> No: an error shows and the quantities must be fixed — "P.O … / <size>: n pairs more than the selected stock" · "<size>: total Packing quantity exceeds the current P.O balance." · "Allocate at least one pair to a Detail P.O." · "Enter a Plan Date."  
> Test:  
> - Type a W5 "Allocated" one pair above the W5 "Remaining" → the P.O balance error shows and the plan cannot be released  
> Source: prototype v0.70  

#### B13 · Release Packing Plan

- Planner · Web · Packing Planning Spray
- Comes from: B12
- Goes to: B14 · Split plan per P.O · hold sources

> The Planner releases the plans just allocated; there is no draft save and no approver.  
> When: Step 3 of the plan page, once the allocation is valid.  
> Action: Step 3 › "Release Plan" button → popup "Release n Packing Plan(s)?" listing "PKP-… → P.O …" and a "P.O · Source" table by size → "Confirm & Release".  
> Result: the plan → RELEASED and shows in "Packing List" with status "Released".  
> Test:  
> - Press "Cancel" in the popup → no plan is created  
> - Step 3 has no "Save Draft" button  
> Source: Q-20261012-06 · Q-20261007-03 · prototype v0.90  

#### B14 · Split plan per P.O · hold sources

- Planner · System (auto) · Packing Planning Spray
- Comes from: B13
- Goes to: B15 · Plan RELEASED (Waiting) → Packing Result Spray · source of Exchange Customer PO
- Goes to: B16 · Create a material MOR MOR (one / plan)

> The system creates one plan per allocated P.O and reserves the source for it.  
> System: one Packing Plan per P.O, numbered "PKP-<YYYYMMDD>-NN" by plan date; plan lines carry LOT / Repair No., WO and Grade by size.  
> Result: the RELEASED plan shows in Packing Result Spray with status "Waiting"; the allocated source is reserved, and fully used rows no longer appear on other plan pages.  
> Test:  
> - Release a plan that uses up a source row → a new "Create Spray Plan" page no longer lists that row in Step 1  
> Source: Q-20261012-06 · Q-20261007-03 · prototype v0.90  

#### B16 · Create a material MOR MOR (one / plan)

- Planner · System (auto) · Packing Planning Spray
- Comes from: B14, B06
- Goes to: B17 · Packing material MOR (auto created on Release) → WMS
- Goes to: B18 · End

> The system creates one packing material MOR for the plan just released; the Planner does not create MORs by hand.  
> System: materials come from the Packing BOM by Model + Size + Destination; need per material by size = ⌈plan pairs × line Qty ÷ Quantity (pairs / carton)⌉; Issue From "WH-PK-01 / Packing Store".  
> Result: MOR "MOR-PK-…" with status "Requested", By "System (on Release)" → WMS issues the material; the "MOR" column of "Packing List" shows the MOR number, a plan without MOR shows "—".  
> Not covered: a plan created by Exchange Customer PO gets no new MOR — it carries the MOR number of its source plan.  
> Test:  
> - Size W5 360 pairs, Quantity 12 pairs / carton, "F2 Carton box" Qty 1 → 30 cartons  
> - Neither the "MOR" column nor the plan detail page has a "Create MOR" button  
> Source: Q-20261012-06 · Q-20261007-03 · Q-20261001-08 · BRD §6.2 · prototype v0.90 · Q-20261014-02  

#### B20 · Plan has Record Output?

- Planner
- Comes from: B19
- Goes to [Yes]: B21 · Revision locked — plan already has output
- Goes to [Not yet]: B22 · Create Revision Packing Plan

> The system checks whether a released plan can still be changed.  
> Not yet: a RELEASED plan without Record Output in Packing Result Spray → the "Revision" button shows.  
> Yes: the plan has Record Output → no "Revision" button; the command is still blocked with "Packing has started or this plan is not Released. Revision is unavailable."  
> Source: Q-20261012-06 · Q-20261007-03 · prototype v0.90  

#### B22 · Create Revision Packing Plan

- Planner · Web · Packing Planning Spray
- Comes from: B20
- Goes to: B23 · Plan NEW · opens Step 3 to edit quantities
- Goes to: B24 · Release again Packing Plan

> The Planner reopens a released plan to change quantities before packing starts.  
> When: the plan is RELEASED and has no Record Output.  
> Action: plan detail page › "Revision" button.  
> Result: the plan → NEW and the previous version is kept in history; opening a NEW plan goes straight to Step 3 of the edit page.  
> Test:  
> - A NEW plan has no "Reject", "Delete" or "Save Draft" button  
> Source: Q-20261012-06 · Q-20261007-03 · prototype v0.90  

#### B24 · Release again Packing Plan

- Planner · Web · Packing Planning Spray
- Comes from: B22
- Goes to: B25 · Plan RELEASED again · keeps the existing MOR
- Goes to: B26 · End

> The Planner edits the quantities and releases the NEW plan again.  
> Action: Step 3 of the edit page › change "Allocated" → "Release Plan" → "Confirm & Release"; or detail page › "Edit quantities" → "Release Packing Plan".  
> Result: the plan → RELEASED; the existing MOR is kept, no new MOR is created.  
> Test:  
> - Revise a plan that has MOR-PK-2602 and release it again → the "MOR" column still shows MOR-PK-2602  
> Open: whether the MOR quantities follow the edited plan (OQ-90).  
> Source: Q-20261012-06 · Q-20261007-03 · prototype v0.90  

## Status lifecycle

#### Packing Plan

`NEW` → `RELEASED` → `COMPLETED`

Transitions:

- `NEW` -- Release Packing Plan --> `RELEASED`
- `RELEASED` -- Packing Result Spray meets ORDER --> `COMPLETED`
- `RELEASED` -- Revision — no Record Output yet --> `NEW` (back)

Notes on the diagram:

- New plan: Release Plan in Step 3 goes straight to RELEASED

## Input

| # | Input | Type | Used in step |
| --- | --- | --- | --- |
| I-1 | Spray IN List — A + A- goods received at Outsourcing Result, each row carrying the LOT No. and the P.O assigned at Outsourcing Planning | Process stock pool — Spray Out / Outsourcing flow | Step 1 · Pick Spray IN |
| I-2 | Repair Inventory — goods repaired (Repaired) at Repair / Rework, each row carrying the LOT No. where the defect arose | Process inventory — Repair / Rework flow | Step 2 · Pick Repair Inventory |
| I-3 | Remaining not yet recorded on the plan in Packing Result Spray, returned to the P.O balance (Pending repair is not returned — it goes to Repair / Rework) | Document — flow Packing Result Spray | Step 3 · Allocate to Detail P.O |
| I-4 | Customer P.O by size — Model, Base Color, Upper Color, AL / INT, Destination, ETD, P.O Month | Document — Sales Order | Step 3 · Allocate to Detail P.O |
| I-5 | Remaining (balance) of the source P.O returned when the Exchange Customer PO ticket is `CONFIRMED` | Document — Exchange Customer PO flow | Step 3 · Allocate to Detail P.O |
| I-6 | Packing BOM — key Model + Size + Destination; header Quantity = pairs / carton; line Qty is per carton | Master data | Create packing material MOR (one / plan) |

## Step ↔ screen

| Step | Role | Screen · UI button |
| --- | --- | --- |
| Create Packing Plan · Step 1 · Pick Spray IN · Step 2 · Pick Repair Inventory · Step 3 · Allocate to Detail P.O | Planner | Packing Planning Spray · `Create Spray Plan` → `Add Packing Spray Plan` (`Select Spray IN` · `Select Repair Inventory` · `Allocate to Detail P.O`) |
| Release Packing Plan | Planner | Packing Planning Spray · Step 3 · `Release Plan` → `Confirm & Release` |
| Create Packing Plan Revision · Release Packing Plan again | Planner | Packing Planning Spray · plan detail page · `Revision`; plan NEW · Step 3 · `Release Plan` → `Confirm & Release`, or `Edit quantities` → `Release Packing Plan` |
| Split the plan by P.O · hold the source · Create the packing material MOR (one per plan) | System (auto) | Packing Planning Spray |

## Output

| # | Output | Produced when |
| --- | --- | --- |
| O-1 | Plan `RELEASED` in Waiting status → Packing Result Spray for the Packing Operator to record packing output; a plan not fully packed is the source of Exchange Customer PO | Planner clicks Release Plan → Confirm & Release in Step 3 |
| O-2 | Packing material MOR (MOR-PK-…, Requested, Issue From WH-PK-01) — one MOR per plan, created automatically on Release → WMS issues the material. A plan created by Exchange Customer PO gets no new MOR and uses the MOR of its source plan | Release of a plan without a MOR |
| O-3 | Revision locked — the plan already has output | Planner views a plan that already has Record Output |
| O-4 | Plan back to `NEW`, opens straight at Step 3 to edit quantities | Planner presses Revision on a plan `RELEASED` without Record Output |
| O-5 | Plan `RELEASED` again — the existing MOR is kept, no new MOR | Planner releases the plan again `NEW` |

## Glossary

| Glossary | Meaning in this flow |
| --- | --- |
| `P.O` | Customer P.O — the customer order; each Packing Plan belongs to exactly one P.O |
| `P.O Month` | Month of the P.O; mandatory in Plan Details; Trimming Result LOTs can only be allocated to P.Os of the same P.O Month |
| `ETD` | Estimated shipping date of the P.O — Auto Allocate fills the earliest-ETD P.O first |
| `LOT` | Production lot per shift (suffix AB day shift, CD night shift), carried from Curing through Trimming |
| `Logo / SPRAY · OOMG` | Goods type from the WO Model attribute; Logo and SPRAY are mutually exclusive, OOMG goods follow the Logo flow |
| `AL / INT` | Market of the P.O (column name as on the prototype) — one condition for matching sources to a P.O |
| `Spray IN List` | A + A- goods back from spraying, received at Outsourcing Result, already carrying a P.O |
| `Repair Inventory` | Goods repaired (Repaired) at Repair / Rework, waiting to be reused |
| `Selected Stock (by size)` | Total goods picked in Step 1 and Step 2 by size: Selected · Allocated to P.O · Not Allocated |
| `Detail P.O · Remaining · Allocated` | Step 3 table of matching P.Os: Remaining = P.O order quantity − quantity held by other Packing Plans; Allocated is the quantity given to the P.O in the plan being built |
| `Plan Qty` | Total Allocated of the plan by size (Daily Packing Q'ty) — basis for Remaining in Packing Result and for the MOR material |
| `Packing BOM` | Packing material standard by Model + Size + Destination; Quantity = pairs / carton; line Qty is per carton |
| `MOR` | Material Out Request — asks warehouse WH-PK-01 to issue packing material; one MOR per plan, created automatically on Release; a plan created by Exchange Customer PO carries the MOR number of its source plan |
| `Exchange Customer PO (EXC)` | Separate function to move goods between Customer P.Os — see the Exchange Customer PO flow |
