# `Sp_Check_sOpn1` (procedure)

> 发外送货单据保存之前数据校验


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sTableName` | `varchar(100)` |
| 2 | IN | `sGuid` | `varchar(100)` |
| 3 | IN | `sFormGuid` | `varchar(100)` |
| 4 | IN | `sLoginId` | `varchar(100)` |
| 5 | IN | `sBrId` | `varchar(100)` |
| 6 | IN | `sSuId` | `varchar(100)` |
| 7 | IN | `iFlag` | `int` |
| 8 | OUT | `sCode` | `int` |
| 9 | OUT | `sReturn` | `varchar(4000)` |

## Body

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

## Narrative

**Business context:** Post-save validator nominally for 发外送货单据 (per procedure summary), targeting `opsoutsidearriveshslave`. Near-identical to `Sp_Check_sOpn` — reads `NetMoney`/`NetPrice` precision from `SysSystemSettings`, opens a cursor over `opsoutsidearriveshslave` joined to `elematerials`/`sistax`, and recomputes per-row money/tax/qty fields against the material's 正算/反算 formula and tax rate.

**What it does:** Gates on `IFNULL(sFormGuid,'') <> ''`. Per slave row pulls `(sId, sMaterialsId, sMaterialsStyle, dMaterialsQty, dAuxiliaryQty, dMaterialsPrice, dMaterialsMoney, dRate, sSrcSlaveId, sMaterialsName, bInverse, sReComputeId, sComputeId, …)` and re-derives the money fields rounded to `p_NetMoney`/`p_NetPrice`.

**Invocation:** Status: appears orphaned. No `gdsmodule.sSaveProName`/`sSaveProNameBefore`/`sProcName`/`sDeleteProName` row references it; no form-master `sSqlStr` ref; no other DB routine calls it; xly-src grep yields no hit (no install script under `script/标版/`). Looks like a `_1` variant of `Sp_Check_sOpn` that was forked but never wired up — candidate for maintainer audit.
