Sp_SalSalesCheck (procedure)
- Type: PROCEDURE
- Deterministic: NO
- SQL data access: CONTAINS SQL
Parameters
| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | sLoginId |
varchar(100) |
| 2 | IN | sCustomerId |
varchar(100) |
| 3 | IN | sBrId |
varchar(100) |
| 4 | IN | sSuId |
varchar(100) |
| 5 | IN | bFilter |
longtext |
| 6 | IN | sUnTaskFormId |
varchar(100) |
| 7 | IN | pageNum |
int |
| 8 | IN | pageSize |
int |
| 9 | OUT | totalCount |
int |
| 10 | IN | countCloumn |
text |
| 11 | OUT | countMapJson |
longtext |
| 12 | IN | sFilterOrderBy |
text |
| 13 | IN | sGroupby_select_sql |
text |
| 14 | IN | sGroupby_group_sql |
text |
Body
Body is not pre-cached. To inspect: mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURESpSalSalesCheck'._
Narrative
Business context: 销售管理 → 销售送货流程 → 3/4 送货单->销售对帐 → 设定单据->销售对账 — paged "to-be-reconciled" delivery / reject list shown when finance picks lines to bundle into a 销售对账单. Reads the unmatched portion of 送货单 (saldelivergoodsmaster/slave) and 销售退货单 (salrejectgoodsmaster) and projects the per-line/per-bill totals that the user drags onto a new 对账单.
What it does: Reads SysSystemSettings for NetMoney/NetPrice rounding and CbxSrcNoCheck / CkxWebNotInFinance policy switches; builds TmpSalSalesCheck (master+slave columns with currency, salesman, gross/tax/foreign-money buckets); fills it from Viw_SalDeliverGoods, viw_saldelivergoodsded, Viw_SalRejectGoods and viw_Accproductinit filtered by Fun_GetLookCustomer, bCheck=1, optional sCustomerId, the saved bFilter, and the B1 exclusion (rows already linked through sMinusSrcId). Hands the final SELECT * FROM TmpSalSalesCheck ... to Sp_Outstanding_Query for paging, count, and bFilter-splicing.
Invocation: Bound as the data-source of the 设定单据->销售对账 form gfm.sId=11811781131121915181734332700 (parent module 3/4 送货单->销售对帐 / sId 11811781131121915179925472440 → 销售送货流程 → KPI流程操作菜单) via gdsconfigformmaster.sTbName='Sp_SalSalesCheck', sType='proc'. Install scripts ship in script/标版/30100101/Sp_SalSalesCheck.sql, an optimised variant in script/标版/optimize/, and a customer override in script/客户/重庆展印/. Also referenced inside Fun_getInitColumnByProName, Sp_ProductCarryforward, Sp_Receivables_AR_copy1.