# `fun_getreportId_byArrMaterialsType` (function)

> 根据物料分类获取报表id,到货


- **Type:** FUNCTION
- **Returns:** `varchar(255)`
- **Deterministic:** NO
- **SQL data access:** CONTAINS SQL

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `p_sMaterialsType` | `varchar(255)` |

## Body

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

## Narrative

**Business context:** Customer-specific report-id dispatch — the `到货` (goods-arrival / 到货单) variant of `fun_getreportId_byMaterialsType`. Maps a materials-class flag (`paper` vs everything-else) onto one of two hard-coded `report.sId` GUIDs so a workflow can pick the right Jasper/print template per material class.

**What it does:** `IF p_sMaterialsType='paper' RETURN '17049...'` (纸张 report) else `RETURN '17047...'` (辅料 report).

**Invocation:** no form-master sSqlStr, gdsmodule hook, other routine, or xly-src reference uses this function. Status: appears orphaned. No caller found in any channel — candidate for maintainer audit. The hard-coded report `sId`s are tenant-specific and would silently break if reused elsewhere.
