# `Sp_Supply_BtnEventInvalid` (procedure)

> 供应商作废


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sProInParam` | `varchar(10000)` |
| 2 | IN | `sMakePerson` | `varchar(100)` |
| 3 | IN | `sBrId` | `varchar(100)` |
| 4 | IN | `sSuId` | `varchar(100)` |
| 5 | OUT | `sReturn` | `varchar(1000)` |
| 6 | OUT | `sCode` | `int` |

## Body

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

## Narrative

**Business context:** 基础资料 → 供应商与外协加工商 → 供应商信息 — 作废 (invalidate) toolbar action for the supplier-master grid (`elesupply`). Soft-deletes supplier records so they no longer appear in purchase pickers, while preserving the audit trail.

**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam` (supports `-`-joined multi-id strings). For each `sIdOne`: looks up `elesupply.sSupplyName`, then `UPDATE elesupply SET bInvalid=1 WHERE sId=… AND sBrandsId/sSubsidiaryId` and writes an audit row to `syslog` with `sOperationType='作废供应商'`, `sFormId='11811781131121915163429350260'` (the 供应商信息 form sId), `sLog='作废供应商：<sSupplyName>'`. Errors out with localised `Fun_Sis_GetConst('chooseData', …)` when `sProInParam` is empty.

**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — the 作废 button on the 供应商信息 grid (form sId `11811781131121915163429350260`) names `Sp_Supply_BtnEventInvalid` as its action. Inverse: [`Sp_Supply_BtnEventCancelInvalid`](Sp_Supply_BtnEventCancelInvalid.md). Install script: `script/标版/30100101/Sp_Supply_BtnEventInvalid.sql`.
