# `Sp_Calc_sQtt_hm` (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` | `text` |
| 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_sQtt_hm`'`._

## Narrative

**Business context:** Variant of [`Sp_Calc_sQtt`](Sp_Calc_sQtt.md) — audit / un-audit of a 报价单 (sales quotation) on `quoquotationmaster`/`quoquotationslave`. The `_hm` suffix marks a tenant/site-specific fork that adds a quotation-price recalc step (`Sp_System_BatchNPriceMoney_quo`) and back-writes the linked sales-order's price columns from the approved quote.

**What it does:** Same skeleton as `Sp_Calc_sQtt` — `CALL Sp_Bill_Used`, flip `bCheck`/`sStatus`/`sCheckPerson`/`tCheckDate` on `quoquotationmaster`, log via `syslog`/`syslogdetail`, post the customer-product price snapshot to `eleproductcustomer`, and `Sp_System_CheckFlow` to kick off any configured approval workflow. Additional vs. the base: `CALL Sp_System_BatchNPriceMoney_quo` to batch-recompute quote prices, plus `UPDATE quoquotationslave` and back-writes into `salsalesordermaster`/`salsalesorderslave` so an approved quote re-prices any already-linked order. `CALL Sp_System_DelMsgCheckFlow` cleans up workflow messages on un-audit. Also touches `salsaleschanceproduct` to update opportunity prices.

**Invocation:** No `gdsmodule.sProcName='Sp_Calc_sQtt_hm'` binding in this snapshot, no callers found in any channel. **Status: appears orphaned.** Likely a per-customer overlay routine that gets activated by overwriting `gdsmodule.sProcName` on the relevant 报价单 module rows during install at customer sites. `_hm` plausibly = customer code (e.g. 浩宇 or similar) — verify against deployment scripts before relying on it.
