# `Sp_Calc_sPrice` (procedure)

> 价格审批


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

## Parameters

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

## Body

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

## Narrative

**Business context:** Pricing — price-approval (价格审批) audit on `eleproductpricemaster`. A finished-product price-card lifecycle: the row is editable until audited; once `bCheck=1, sStatus=1` it becomes the active reference price for downstream sales-order pricing lookups.

**What it does:** Guards on `sGuid`. On `iFlag=1` refuses when the row is already `bCheck=1`, then `Update eleproductpricemaster` to set `bCheck=1, sStatus=1, sCheckPerson, tCheckDate=NOW()`. `iFlag=0` symmetrically clears (and on uncheck also blanks `sCheckPerson=''`, `tCheckDate=null`). No KPI write, no downstream propagation — minimal check/uncheck.

**Invocation:** Status: appears orphaned. No `gdsmodule.sProcName` binding, no `gdsconfigformmaster` reference, no callers in `information_schema.ROUTINES`, no xly-src hits across any extension (not even an install script). The procedure exists in the DB but the 价格审批 module has no form wired to it — candidate for maintainer audit. Likely a stub kept for a planned price-approval workflow that was never deployed.
