# `Sp_BtnEvent_mitOutComfirm` (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 | `sUserId` | `varchar(100)` |
| 4 | IN | `sBrId` | `varchar(100)` |
| 5 | IN | `sSuId` | `varchar(100)` |
| 6 | OUT | `sReturn` | `varchar(1000)` |
| 7 | OUT | `sCode` | `int` |

## Body

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

## Narrative

**Business context:** 生产 / 材料出库单 — button-click handler that toggles 确认 (`bConfirmComplete`) on selected `mitproductionmaterialsmaster` (material out-bound note) rows. Marks the issue ticket as accepted by production so downstream cost / consumption postings can run.

**What it does:** Validates `sProInParam` length, parses `$.params[*].value[*].sId`, deduplicates against a running `p_sAllId` via `LOCATE`, and per unique id `UPDATE mitproductionmaterialsmaster SET bConfirmComplete=(CASE WHEN bConfirmComplete=1 THEN 0 ELSE 1 END), tConfirmDate=NOW(), sConfirmPerson=sMakePerson` — toggles.

**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — 材料出库单 grid's 确认 toolbar button names `Sp_BtnEvent_mitOutComfirm` as the action. Sibling of `Sp_BtnEvent_LogisticsComfirm`, `Sp_BtnEvent_OpsInstoreComfirm` (same toggle pattern, different master table).
