# `Sp_ProductReceipt` (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_ProductReceipt`'`._

## Narrative

**Business context:** 销售管理 / 备货流程 — marks a sales-order master (`Salsalesordermaster`) as 已发货 (or "出厂受理") and stamps the dispatcher's name and timestamp. The "shipment received by dispatcher" gate on the sales-order: typically clicked when the stockup is complete and the goods are handed off to logistics.

**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam`. For each master id: `UPDATE Salsalesordermaster SET sStockup = '3', sSend = sMakePerson, tSend = SYSDATE()`. No back-write to the slave rows or notification chain — purely a master-row state flip.

**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — bound to a "发出/确认收货" button on the sales-order 备货 grid. Install script ships at `script/标版/30100101/Sp_ProductReceipt.sql`.
