# `Sp_Sales_NotDeliverGoodNotifyList` (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 | `bAll` | `bit(1)` |
| 5 | IN | `sState` | `varchar(10)` |
| 6 | IN | `sBrId` | `varchar(100)` |
| 7 | IN | `sSuId` | `varchar(100)` |
| 8 | IN | `bFilter` | `varchar(5000)` |
| 9 | IN | `sUnTaskFormId` | `varchar(100)` |
| 10 | IN | `pageNum` | `int` |
| 11 | IN | `pageSize` | `int` |
| 12 | OUT | `totalCount` | `int` |
| 13 | IN | `countCloumn` | `varchar(5000)` |
| 14 | OUT | `countMapJson` | `longtext` |
| 15 | IN | `sFilterOrderBy` | `varchar(5000)` |
| 16 | IN | `sGroupby_select_sql` | `varchar(5000)` |
| 17 | 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_NotDeliverGoodNotifyList`'`._

## Narrative

**Business context:** 销售管理 → 销售送货流程 → 3/5 销售订单->送货通知 — paged worklist of 销售订单 lines whose 送货通知单 has not yet been issued. Source of the dropdown grid in step 3/5 of the sales-delivery flow.

**What it does:** Builds temp `NotDeliverGoodNotifyList`, populates it from `viw_salsalesorder`/`Viw_MftWorkOrder` joined against `elecustomer`, `eleproduct`, `sisproductclassify`, `SisDeliver`, `sistax`, `salsalesordermaster`/`salsalesorderslave`, `mftworkordermaster`/`mftworkorderslave`, `opsoutsideinstoremaster`/`opsoutsideinstoreslave` and `sgdsemigoodsmatchbillmaster`/`sgdsemigoodsmatchbillslave`; folds in inspection (`qlyproducttestmaster`), stock (`eleproductstock`) and 销售退货 (`SalRejectGoodsSlave`). Filters by `sCustomerGuid`, `iCopeEvent`, `bAll`, `sState`, `bFilter`, `Fun_GetLookCustomer(sLoginId)` and `sUnTaskFormId`. `SysSystemSettings` toggles drive variant behaviour.

**Invocation:** Bound to `gdsconfigformmaster.sSqlStr` on form `15833199030002272611938056549000` (3/5 销售订单->送货通知, 销售送货流程). Also reachable through `Fun_getInitColumnByProName`. Install scripts: standard at `script/标版/30100101/`, optimised variant at `script/标版/optimize/Sp_Sales_NotDeliverGoodNotifyList.sql`.
