# `Sp_afterSave_sPaj` (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_sPaj`'`._

## Narrative

**Business context:** Header says 成品调拨保存后反写报价数量 ("Finished-Goods Transfer - after-save back-write quoted qty"). Thin save-phase wrapper in the `Sp_afterSave_s<Code>` family — and notable for being mis-coded: the body delegates to `Sp_saveReturn_sOsa` (the 采购到货 worker) rather than to a `_sPaj` worker. Copy-paste artefact from the `_sOsa` template that was never specialised.

**What it does:** Wraps `sGuid` in double-quotes if not already quoted and, when `sGuid` is non-empty, calls `Sp_saveReturn_sOsa(sGuid, sBrId, sSuId, 2, @sCode, @sReturn)`. Does not propagate the inner `@sCode`/`@sReturn` to its own OUT params. A `-- set sCode = 1;` debug comment sits below the inner BEGIN.

**Invocation:** Status: appears orphaned. No caller found in any channel — `Sp_Check_sPaj` has no `gdsmodule` binding, not present in the `Sp_Invalid_backwriting` form-id dispatch table, no xly-src refs. Candidate for maintainer audit — the proc both lacks a caller and would back-write to the wrong worker if it were invoked.
