# `Sp_Sis_GetMertialsInventoryFormGuid` (procedure)

> 库存获取sFromId


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | OUT | `sReturnIn` | `varchar(2000)` |
| 2 | OUT | `sReturnOut` | `varchar(2000)` |

## Body

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

## Narrative

**Business context:** 库存管理 — material-inventory IN/OUT form-ID classifier. Returns two hard-coded comma-separated lists that tell callers which sales/purchase/production bill forms add to `mitmaterialsstore` (入库) vs which remove from it (出库). The same name exists as a `FUNCTION` returning a single flag (0/1); this procedure variant returns both lists in a single call.

**What it does:** Hard-codes two long string literals into `OUT` parameters — `sReturnIn` (the form-IDs whose audit increases material stock: 采购入库, 调拨入库, 退料, 期初入库, 委外退货入库, etc.) and `sReturnOut` (form-IDs that decrease stock: 领料, 调拨出库, 报废, 委外发料, 期初出库, etc.). Some slots are placeholders `'后续增加'` reserved for forms not yet wired in. Callers then `INSTR(@sInSql, sFormId)` / `INSTR(@sOutSql, sFormId)` to decide the sign when summing `mitmaterialsstore`.

**Invocation:** Called via `CALL Sp_Sis_GetMertialsInventoryFormGuid(@sInSql, @sOutSql)` from at least 10 inventory-flow procs: `Sp_Inventory_InOutStore`, `Sp_Inventory_InOutStoreNew*`, `SP_Inventory_InOutWarehouse*`, `Sp_calc_materialsstoreLimit`, `Sp_check_MaterialsStockLimitNew`. Not reachable from a form-master or `gdsmodule` hook directly. Install script: `script/标版/30100101/Sp_Sis_GetMertialsInventoryFormGuid.sql`. Caveat: any new material form-ID must be appended here manually — drift between this list and the actual form set is a known maintenance hazard.
