# `Sp_afterSave_sSiv` (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_sSiv`'`._ ## Narrative **Business context:** 销售发票单据 → 销售送货流程 → KPI流程操作菜单 — header says 销售发票保存后反写. Thin save-phase 反写 wrapper in the `Sp_afterSave_s` family that delegates the actual qty back-write to `Sp_saveReturn_sSiv`. **What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sSiv(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_sSiv` (the save-commit dispatch proc bound via `gdsmodule.sSaveProName` on 销售发票单据 `15780358080007074056281633539000`, with the same module also recording `sSaveProName='Sp_afterSave_sSiv'` directly) near the tail of a successful save. `Sp_Invalid_backwriting` has no dispatch entry for this form.