# `Sp_afterSave_sRgd` (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 PROCEDURE `Sp_afterSave_sRgd`'`._ ## Narrative **Business context:** 2/4 新增销售退货 → 销售送货流程 → KPI流程操作菜单 — header says 退货单保存后反写数量. Thin save-phase 反写 wrapper in the `Sp_afterSave_s` family that delegates the actual qty back-write to `Sp_saveReturn_sRgd`. **What it does:** Declares unused locals `p_sMasterSql`/`sDeliverSrc`, wraps `sGuid` in double-quotes if not already quoted, then unconditionally calls `Sp_saveReturn_sRgd(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)` (iFlag=2 = "after save" phase). Does not propagate the inner `@sCode`/`@sReturn` back to its own OUT params. **Invocation:** Called by `Sp_Check_sRgd` (the save-commit dispatch proc bound via `gdsmodule.sSaveProName` on 2/4 新增销售退货 `11811781131121915179924871530`, with `sSaveProNameBefore='Sp_beforeSave_sRgd'`) near the tail of a successful save. `Sp_Invalid_backwriting` has no dispatch entry for this form.