# `Sp_Calc_sRev` (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_sRev`'`._

## Narrative

**Business context:** 供应商评审 — audit / un-audit of a 供应商评审 (supplier review / scoring) bill on `revsupplymaster`/`revsupplyslave`. The review aggregates per-department scores (iScoreOne … iScoreFour) for a supplier; on approval the supplier's master record (`elesupply.iLevel`) would have been re-graded (A/B/C/D based on total score).

**What it does:** Validates `sGuid`, refuses when `bInvalid=1`. On `iFlag=1` guards on already-checked, calls `Sp_Bill_Used('salsaleschancemaster', …, 'SaleTrial', …)` — a hold-over reference to the sales-chance "SaleTrial" used-bill check, looks like copy-paste; then would flip `revsupplymaster.bCheck`/`sStatus`/`sCheckPerson`/`tCheckDate`. Most of the per-department-score validation and `elesupply.iLevel` write-back is commented out — current path is a minimal flag flip. `iFlag=0` un-checks.

**Invocation:** No `gdsmodule.sProcName='Sp_Calc_sRev'` binding in this snapshot, no callers in any channel, no xly-src grep hits. **Status: appears orphaned.** Either dispatched only from a customer overlay or staging / preview code that never made it into a live 供应商评审 module — candidate for maintainer audit. The disabled grading logic is the substantive part of the proc; reactivate before relying on it.
