# `Sp_SalSalesCheck_YanBao` (procedure) - **Type:** PROCEDURE - **Deterministic:** NO - **SQL data access:** CONTAINS SQL ## Parameters | # | Mode | Name | Type | |---|---|---|---| | 1 | IN | `p_sSlaveId` | `text` | | 2 | IN | `sLoginId` | `varchar(100)` | | 3 | IN | `sCustomerId` | `varchar(100)` | | 4 | IN | `iSumQty` | `int` | | 5 | IN | `sBrId` | `varchar(100)` | | 6 | IN | `sSuId` | `varchar(100)` | | 7 | IN | `bFilter` | `text` | | 8 | IN | `sUnTaskFormId` | `varchar(100)` | | 9 | IN | `pageNum` | `int` | | 10 | IN | `pageSize` | `int` | | 11 | OUT | `totalCount` | `int` | | 12 | IN | `countCloumn` | `text` | | 13 | OUT | `countMapJson` | `longtext` | | 14 | IN | `sFilterOrderBy` | `text` | | 15 | IN | `sGroupby_select_sql` | `text` | | 16 | IN | `sGroupby_group_sql` | `text` | ## Body _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `Sp_SalSalesCheck_YanBao`'`._ ## Narrative **Business context:** 销售管理 → 销售送货流程 → 3/4 送货单->销售对帐 — 延保 ("warranty / aged-receivable") variant of `Sp_SalSalesCheck` keyed by an explicit slave-row list. Takes the user's already-selected 送货 / 退货 lines (`p_sSlaveId` CSV) plus `iSumQty` and returns the paged 对账 candidate set with master-level aging buckets (1-30天 / 31-60天 / ... / 361天以上 — see `Sp_SalSalesCheck_YM`'s sibling buckets) ready to roll into a 销售对账单. **What it does:** Stages a `TmpSalSalesCheck` slave table + a `TmpSalSalesCheckMaster` aggregate; pulls the same view family (`Viw_SalDeliverGoods`, `Viw_SalRejectGoods`, `viw_salsalesorder`, `viw_sgdsemigoodsmatch`, `Viw_SalQualityAbnormal`) but pre-restricts to `FIND_IN_SET(sId, p_sSlaveId)`; applies `Fun_GetLookCustomer` scoping; bucketises aging on `DATEDIFF(NOW(), tCreateDate)`; calls `Sp_Do_UpdateByPageSizeBefore` for paged update of the master totals. Output goes back to the calling form via the standard `pageNum/pageSize/totalCount/countMapJson` contract. **Invocation:** Not bound to any `gdsconfigformmaster` row, no `gdsmodule` hook, no other-routine caller in the live DB. Install script ships in `script/标版/30100101/Sp_SalSalesCheck_YanBao.sql`. Status: ships in the standard install but appears unwired in this tenant — candidate for maintainer audit (likely activated by re-pointing the 设定单据->销售对账 form's `sTbName` for sites that use the warranty/aging layout).