# `Sp_saveReturn_sPaj` (procedure)

> 成品调拨反写报价数量


- **Type:** PROCEDURE
- **Deterministic:** NO
- **SQL data access:** CONTAINS SQL

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sGuid` | `longtext` |
| 2 | IN | `sBrId` | `varchar(100)` |
| 3 | IN | `sSuId` | `varchar(100)` |
| 4 | IN | `iTag` | `int` |
| 5 | OUT | `sCode` | `int` |
| 6 | OUT | `sReturn` | `longtext` |

## Body

_Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `Sp_saveReturn_sPaj`'`._

## Narrative

**Business context:** 成品调拨 — intended to back-write the offered qty for 成品调拨 (`mftproductadjustmaster`) onto the upstream 工序发外 slave (`opsoutsideprocessslave`), mirroring `Sp_saveReturn_sOsa`.

**What it does:** Same shape as `Sp_saveReturn_sOsa` — splits `sGuid` into `p_t_sId`, collects `sSrcSlaveId` into `p_sSrcSlaveId_tmp`, sums offered qty into `p_data_tmp` (zeroing the in-flight batch when `iTag=1`), then `update opsoutsideprocessslave`.

**Invocation:** Status: appears orphaned. No `information_schema.ROUTINES` row references it; `Sp_afterSave_sPaj` (the 成品调拨 save-after wrapper) actually calls `Sp_saveReturn_sOsa` instead — i.e. the 成品调拨 form re-uses the 采购到货 back-write logic. No `gdsmodule` / `gdsconfigformmaster` reference, no xly-src hit. Likely a copy-paste / rename leftover that has since been superseded by the call to `Sp_saveReturn_sOsa`. Candidate for maintainer audit and removal.
