# `Sp_Check_mftProductionReportValue` (procedure)


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sGuid` | `varchar(100)` |
| 2 | IN | `sBrId` | `varchar(100)` |
| 3 | IN | `sSuId` | `varchar(100)` |

## Body

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

## Narrative

**Business context:** 产量上报 → 订单生产流程 (also 功能操作 → 内部报工 (mobile单据) on 移动端管理) — tenant-specific output-value (产值) calculator for a printing-press 产量上报 (production-quantity report) document. Computes a press's billable charge from reported quantity, side count (正/反), regular and spot colours, full-plate (专满版 / 两色座) flags, and per-machine pricing rules.

**What it does:** Cursors slave rows of the report document; per row, looks up the press (1/3/8/9 号机) configuration, derives an effective colour count (specials × 1.5 or × 2 depending on press), counts presses (色令), looks up unit price and base/overage 开机费, and computes `dTotalColorMoney` and `dTotalMoney`, writing back to the slave rows.

**Invocation:** Called from `Sp_Calc_sPpr` (the save procedure for 产量上报 / 内部报工 mobile) during checked-save. Tenant-specific: hard-coded press numbers and pricing semantics make this routine non-portable to other deployments.
