# `Sp_System_BatchWorkListPriceMoney` (procedure)

> @author:       qmj
		     @date:         20210707 封存
			 @describe:     工单价格批量更新，按产品金额


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sSrcGuid` | `text` |
| 2 | IN | `dNProductPrice` | `decimal(18,6)` |
| 3 | IN | `dFloatRate` | `decimal(18,6)` |
| 4 | IN | `sLoginId` | `varchar(100)` |
| 5 | IN | `sBrId` | `varchar(100)` |
| 6 | IN | `sSuId` | `varchar(100)` |
| 7 | OUT | `sCode` | `int` |
| 8 | OUT | `sReturn` | `varchar(4000)` |

## Body

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

## Narrative

**Business context:** 生产管理 → 印刷工单 / 改价 — work-order side of the batch re-price family. Re-prices a comma-separated list of `MftWorkOrderSlave` rows by either an absolute new `dNProductPrice` or a `dFloatRate` percentage adjustment, then refreshes the line tax/total from `sistax`. Header `封存` (qmj, 2021-07-07): "工单价格批量更新，按产品金额".

**What it does:** Reads `NetMoney` / `NetPrice` decimal settings from `SysSystemSettings`. Strips `[`/`]` from `sSrcGuid`, then walks the comma-separated slave-id list with a `WHILE p_index <= p_count` loop. For each id: if `dNProductPrice<>0` sets `A.dNProductPrice = Round(p_dNProductPrice, p_dNetPrice)`; else if `dFloatRate<>0` applies `A.dNProductPrice = Round(A.dNProductPrice * (1 + dFloatRate/100), p_dNetPrice)`. Re-derives the slave's `sParentId` and currency/tax (`dCurrencyRate`, `sistax.dRate`) for the corresponding `MftWorkOrderMaster` totals refresh.

**Invocation:** Status: appears orphaned at this snapshot. No `gdsmodule.sProcName` hook, no `gdsconfigformmaster` binding, no other-routine caller in `information_schema.ROUTINES`, no Java/MyBatis reference in xly-src. Install / customer copies live under `script/标版/30100101/Sp_System_BatchWorkListPriceMoney.sql` and `script/客户/千彩/Sp_System_BatchWorkListPriceMoney.sql`. The 工单 改价 button likely calls a successor proc (Java `updatePriceBatch` recognises only the order-side names) — verify before relying on this body.
