# `Sp_Inventory_MaterialsInventoryV56Price` (procedure)


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sMaterialsGuid` | `varchar(4000)` |
| 2 | IN | `sMaterialsClassifyGuid` | `varchar(100)` |
| 3 | IN | `sWarehouseGuid` | `varchar(100)` |
| 4 | IN | `iHasZero` | `int` |
| 5 | IN | `sMaterialsStyle` | `varchar(100)` |
| 6 | IN | `iGetQty` | `int` |
| 7 | IN | `sDefine_no` | `varchar(100)` |
| 8 | IN | `sDefine_no2` | `varchar(100)` |
| 9 | OUT | `dAuxiliaryQty` | `decimal(18,6)` |
| 10 | OUT | `dMaterialsQty` | `decimal(18,6)` |
| 11 | OUT | `dMaterialsPrice` | `decimal(18,6)` |
| 12 | IN | `iSumQty` | `int` |
| 13 | IN | `iSales` | `int` |
| 14 | IN | `iDetailStock` | `int` |
| 15 | IN | `iAdditionalMaterialInfo` | `int` |
| 16 | IN | `sLocationalGuid` | `varchar(100)` |
| 17 | IN | `sWarehouseLocationGuid` | `varchar(100)` |
| 18 | IN | `iMaterialsType` | `int` |
| 19 | IN | `sBrId` | `varchar(100)` |
| 20 | IN | `sSuId` | `varchar(100)` |
| 21 | IN | `bFilter` | `varchar(5000)` |
| 22 | IN | `pageNum` | `int` |
| 23 | IN | `pageSize` | `int` |
| 24 | OUT | `totalCount` | `int` |
| 25 | IN | `countCloumn` | `varchar(5000)` |
| 26 | OUT | `countMapJson` | `longtext` |
| 27 | IN | `sFilterOrderBy` | `varchar(5000)` |
| 28 | IN | `sGroupby_select_sql` | `varchar(5000)` |
| 29 | IN | `sGroupby_group_sql` | `varchar(5000)` |

## Body

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

## Narrative

**Business context:** Price-detail variant of `Sp_Inventory_MaterialsInventoryV56` — the available-stock query with extra cost/price columns surfaced. Sibling of `_Line` (per-lot) and `_Total` (aggregated) in the V56 family.

**What it does:** Same `p_TmpMaterialsStoreList` + `p_TmpMaterialsStoreList_sMaterial` build over `MitMaterialsStore`, `MitMaterialsStoreVirtual`, `EleMaterialsStock`, `EleMaterials`. Reads decimal precision from `SysSystemSettings` and paginates via `Sp_Outstanding_Query`, with the projection extended to include per-lot `dMaterialsPrice`-derived columns.

**Invocation:** Status: appears orphaned in the live DB — no `gdsconfigformmaster` binding, no `gdsmodule` hook, no other-routine reference. xly-src ships it under `script/标版/optimize/Sp_Inventory_MaterialsInventoryV56Price.sql` (the `optimize/` directory holds performance/lock-tuning patches), suggesting it was developed as an opt-in price-aware variant. Candidate for maintainer audit.
