# `Sp_Apply_Flow_QualityaccidentsSupply_Proc1` (procedure)

> 供应商扣款单号 过程1


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sData` | `longtext` |
| 2 | IN | `sGuid` | `varchar(100)` |
| 3 | IN | `sInstanceId` | `varchar(100)` |
| 4 | IN | `sTaskParentId` | `varchar(100)` |
| 5 | IN | `sTaskIdNow` | `varchar(100)` |
| 6 | IN | `sComment` | `varchar(100)` |
| 7 | IN | `iPproved` | `varchar(100)` |
| 8 | IN | `sLoginId` | `varchar(100)` |
| 9 | OUT | `sReturn` | `varchar(4000)` |
| 10 | IN | `sBrId` | `varchar(100)` |
| 11 | IN | `sSuId` | `varchar(100)` |
| 12 | OUT | `sCode` | `int` |

## Body

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

## Narrative

**Business context:** 外协商扣款单 (供应商扣款单号 过程1 — catalog header is mis-copied from the `QualityaccidentMaterials_Proc1` sibling) — in-flow updater companion to `Sp_Apply_Flow_QualityaccidentsSupply`. Writes the approver-entered confirmed deduction amount back to the master on the relevant approval step.

**What it does:** Reads `dOKMaterialsMoney` from the `sData` JSON payload (stripped of quotes), flips sign to negative if positive (with `IFNULL(...,0)` guard), and `UPDATE opsoutsideinstorededmaster SET dOKMaterialsMoney = ... WHERE sId = sGuid`.

**Invocation:** Dispatched dynamically by Java `CheckExamineFlowDataServiceImpl.doSendCheckFolwData()` via `doProByNameFlow(..., sProName, ...)` keyed off `gdsmoduleflowdetail` (the per-task overrides table linked to `gdsmoduleflow`). Reached only when the outsource-supplier deduction flow's Proc1-bound task fires.

Flag: catalog header `供应商扣款单号 过程1` is copy-pasted from `Sp_Apply_Flow_QualityaccidentMaterials_Proc1`; this proc operates on `opsoutsideinstorededmaster`, not the materials master.
