# `sp_getsalesoutsideprocess` (procedure)

> 发外工序获取


- **Type:** PROCEDURE
- **Deterministic:** NO
- **SQL data access:** CONTAINS SQL

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sSlaveId` | `longtext` |
| 2 | IN | `sBrandsId` | `varchar(255)` |
| 3 | IN | `sSubsidiaryId` | `varchar(255)` |

## Body

_Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `sp_getsalesoutsideprocess`'`._

## Narrative

**Business context:** Sales-order-source variant of `sp_getoutsideprocess` — fetches 发外工序 candidates from `salsalesorderprocess` (not `viw_mftworkorderprocessextral`) for a comma-joined list of slave ids, so the outsourcing flow can be built directly off the sales order before any work order exists.

**What it does:** Same temp-table shape as the sibling (`sp_getoutsideprocess`, `sp_getoutsideprocess_product`, `sp_getoutsideprocess_product_part`); dynamic-SQL INSERTs from `salsalesorderprocess` filtered by `sId IN (...)`, then fans `sType=3` rows whose `sCombinePartsName` is empty across each `salsalesorderslave.sId` of the parent order to expand part-keyed process rows.

**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep across all extensions). Both this and `sp_getoutsideprocess` are dormant helpers — the live 整单发外 / 工序发外 flow uses the `Sp_btn_OpsProduct*` / `Sp_btn_OpsProcess*` button procs.
