# `Sp_Sis_GetProductInventoryFormGuid` (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_GetProductInventoryFormGuid`'`._

## Narrative

**Business context:** 库存管理 — product-inventory IN/OUT form-ID classifier. Product-side counterpart of `Sp_Sis_GetMertialsInventoryFormGuid`. Returns the two comma-separated form-ID lists that decide which 印品 bills add to `pitproductstore` (入库: 产品入库主表, 配料单主表, 印品调拨入库, …) vs subtract (出库: 印品销售出库, 调拨出库, 发外退货, 印品报废, …).

**What it does:** Hard-codes both lists into `OUT sReturnIn` and `OUT sReturnOut`; callers `INSTR(@sInSql, A.sFormId) > 0` / `INSTR(@sOutSql, A.sFormId) > 0` to sign the `dProductQty` when aggregating `pitproductstore` snapshots and to refuse audits that would push stock negative.

**Invocation:** Called via `CALL Sp_Sis_GetProductInventoryFormGuid(@sInSql, @sOutSql)` from 10+ product-stock procs including `Sp_Calc_sPst` (印品入库审核), `Sp_Calc_sOpi1`, `SP_Inventory_ProductCalcQty`, `Sp_Inventory_ProductInOutStore*`, `Sp_calc_productstoreLimit`, `Sp_check_productstoreLimitNew`. Install scripts: `script/标版/30100101/Sp_Sis_GetProductInventoryFormGuid.sql`. Same maintenance hazard as the materials twin — new product-flow forms must be appended here.
