# `Sp_Materials_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_Materials_BtnEventInvalid`'`._ ## Narrative **Business context:** 基础资料 → 物料档案 — bulk-invalidate handler for the 物料档案 (`elematerials`) grid's 作废 toolbar button. Soft-deletes the selected material rows by flagging `bInvalid=1` while keeping the record for historical references. **What it does:** Parses `$.params[*].value[*].sId` from `sProInParam`, splits the hyphen-joined id list one segment at a time, reads each material's `sMaterialsName` from `elematerials`, sets `bInvalid=1` on the row (scoped by `sBrandsId=sBrId` / `sSubsidiaryId=sSuId`), and writes one `syslog` audit row per material with `sLog=CONCAT('作废物料:', sMaterialsName)` tagging the operation. Short-circuits with the localised 请选择数据 message from `Fun_Sis_GetConst` when `sProInParam` is empty. **Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — wired to the 物料档案 grid's 作废 toolbar button via `gdsmodule.sBtnContent` carrying `{"sproName":"Sp_Materials_BtnEventInvalid",...}`. No `gdsmodule`/`gdsconfigformmaster` row references the name explicitly and no xly-src install script ships it — candidate for maintainer audit.