# `Sp_BtnEvent_OpsInstoreComfirm` (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_OpsInstoreComfirm`'`._

## Narrative

**Business context:** 仓库 / 成品外购入库 — button-click handler that toggles 确认 (`bConfirmComplete`) on selected `opsoutsideinstoremaster` rows (outsource-product in-store notes). Marks the in-store note as accepted so downstream invoicing and inventory postings can run.

**What it does:** Validates `sProInParam` length, parses `$.params[*].value[*].sId`, and per id `UPDATE opsoutsideinstoremaster 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_OpsInstoreComfirm` as the action. Sibling of `Sp_BtnEvent_LogisticsComfirm`, `Sp_BtnEvent_mitOutComfirm` (same toggle pattern, different master table).

Flag: default `sReturn='物流单确认成功！'` is copy-pasted from `Sp_BtnEvent_LogisticsComfirm` — should be `成品外购入库单确认成功`. No dedup guard either, so duplicated ids in the input would re-toggle.
