# `Sp_Sales_NotDeliverGoodMaterialsNotifyList` (procedure)


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sCustomerGuid` | `varchar(100)` |
| 2 | IN | `iCopeEvent` | `int` |
| 3 | IN | `sLoginId` | `varchar(100)` |
| 4 | IN | `sState` | `varchar(10)` |
| 5 | IN | `sBrId` | `varchar(100)` |
| 6 | IN | `sSuId` | `varchar(100)` |
| 7 | IN | `bFilter` | `varchar(5000)` |
| 8 | IN | `sUnTaskFormId` | `varchar(100)` |
| 9 | IN | `pageNum` | `int` |
| 10 | IN | `pageSize` | `int` |
| 11 | OUT | `totalCount` | `int` |
| 12 | IN | `countCloumn` | `varchar(5000)` |
| 13 | OUT | `countMapJson` | `longtext` |
| 14 | IN | `sFilterOrderBy` | `varchar(5000)` |
| 15 | IN | `sGroupby_select_sql` | `varchar(5000)` |
| 16 | IN | `sGroupby_group_sql` | `varchar(5000)` |

## Body

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

## Narrative

**Business context:** 材料销售管理 → 未开材料送货通知任务列表 — paged worklist of material-side 销售订单 lines whose 材料送货通知单 has not yet been issued. Mirrors the product-side `Sp_Sales_NotDeliverGoodNotifyList` for the materials line.

**What it does:** Builds temp `NotDeliverGoodNotifyList`, populates it from `Viw_SalSalesOrder`/`Viw_MftWorkOrder` joined against `elecustomer`, `elematerials`, `SisDeliver`, `sgdsemigoodsmatchbillmaster`, `viw_product_materials`; folds in 销售退货 deductions (`SalRejectGoodsSlave`) and `SysSystemSettings` config flags. Filters by `sCustomerGuid`, `iCopeEvent`, `sState`, `bFilter`, `Fun_GetLookCustomer(sLoginId)` and `sUnTaskFormId`. Final paging via `Sp_Outstanding_Query`.

**Invocation:** Bound to `gdsconfigformmaster.sSqlStr` on form `101251240115016140462416230` (未开材料送货通知任务列表) under 材料销售管理 → 销售管理. Install script: `script/标版/30100101/Sp_Sales_NotDeliverGoodMaterialsNotifyList.sql`; also re-issued by the `script/标版/20210323/gdsconfigformmaster.sql` form-master refresh.
