Sp_afterSave_sWXKK (procedure)
外协商扣款反写
- Type: PROCEDURE
- Deterministic: NO
- SQL data access: CONTAINS SQL
Parameters
| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | sGuid |
varchar(2000) |
| 2 | IN | sBrId |
varchar(100) |
| 3 | IN | sSuId |
varchar(100) |
| 4 | OUT | sCode |
int |
| 5 | OUT | sReturn |
varchar(4000) |
Body
Body is not pre-cached. To inspect: mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURESpafterSave_sWXKK'._
Narrative
Business context: 外协入库扣款单据 (operates on opsoutsideinstorededmaster/opsoutsideinstorededslave) — header says 外协商扣款反写. Carries real save-phase logic: validates that every deduction line has a negative dMaterialsPrice, then rolls up the master dOKMaterialsMoney total before delegating downstream qty back-write to Sp_saveReturn_sWXKK.
What it does: When sGuid is non-empty: (1) counts slave rows where dMaterialsPrice > 0; if any exist, sets sCode = -1, fetches the localized error via Fun_Sis_GetConstNew('sGykkNagativeNum', ...), and LEAVE top. (2) Updates the master's dOKMaterialsMoney = 0 - SUM(dMaterialsMoney) over the slaves. (3) Calls Sp_saveReturn_sWXKK(sGuid, sBrId, sSuId, 2, @sCode, @sReturn). The further mftqualityaccidentmaster.dBackDeductionSupplyMoney denorm UPDATE chain is fully commented out.
Invocation: Status: appears dormant. No gdsmodule.sSaveProName/sDeleteProName slot in this database points at this proc, no Sp_Check_sWXKK exists, Sp_Invalid_backwriting has no dispatch entry for any 外协扣款 form, and no other routine references it. Candidate for maintainer audit.