# `SP_Inventory_InOutWarehouse_220709` (procedure)


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sMaterialsGuid` | `varchar(100)` |
| 2 | IN | `sMaterialsStyleS` | `varchar(100)` |
| 3 | IN | `sDefineNoS` | `varchar(100)` |
| 4 | IN | `sDefineNoS2` | `varchar(100)` |
| 5 | IN | `sWareHouseGuid` | `varchar(100)` |
| 6 | IN | `tStartDate` | `datetime` |
| 7 | IN | `tEndDate` | `datetime` |
| 8 | IN | `bUpdate` | `int` |
| 9 | IN | `bFlag` | `int` |
| 10 | IN | `sLocationGuid` | `varchar(100)` |
| 11 | IN | `sWarehouseLocationGuid` | `varchar(100)` |
| 12 | IN | `bUpdateAll` | `int` |
| 13 | IN | `sLoginId` | `varchar(100)` |
| 14 | IN | `sBrId` | `varchar(100)` |
| 15 | IN | `sSuId` | `varchar(100)` |
| 16 | IN | `bFilter` | `varchar(5000)` |
| 17 | IN | `pageNum` | `int` |
| 18 | IN | `pageSize` | `int` |
| 19 | OUT | `totalCount` | `int` |
| 20 | IN | `countCloumn` | `varchar(5000)` |
| 21 | OUT | `countMapJson` | `longtext` |
| 22 | IN | `sFilterOrderBy` | `varchar(5000)` |
| 23 | IN | `sGroupby_select_sql` | `varchar(5000)` |
| 24 | IN | `sGroupby_group_sql` | `varchar(5000)` |
| 25 | OUT | `sCode` | `int` |
| 26 | OUT | `sReturn` | `varchar(5000)` |

## Body

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

## Narrative

**Business context:** Backup variant of `SP_Inventory_InOutWarehouse` (`_220709` date-stamp suffix — 2022-07-09). Per wiki convention, backup objects are not narrated.

**What it does:** Same as `SP_Inventory_InOutWarehouse` at the time of copy — drives the 材料库存台账 (material in/out warehouse ledger) report, building `InOutWarehouse` working set against `MitMaterialsStore`, `EleMaterialsStock`, `Viw_MitMaterialsCheck`, `MitMaterialsCutMaster/Slave` (paper-reel cut slips), then paginating via `Sp_Outstanding_Query`.

**Invocation:** Not expected to be called from production; verify before relying on it. No form binding, no module hook, no other-routine reference, no `xly-src` reference for this date-stamped name. The live form 材料库存台账 (sId `19211681019715754498436890`) calls the un-suffixed `SP_Inventory_InOutWarehouse`.
