# `Sp_mftworkordermaster_AccountSubmit` (procedure)


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sProInParam` | `varchar(10000)` |
| 2 | IN | `sMakePerson` | `varchar(100)` |
| 3 | IN | `sBrId` | `varchar(100)` |
| 4 | IN | `sSuId` | `varchar(100)` |
| 5 | OUT | `sReturn` | `varchar(1000)` |
| 6 | OUT | `sCode` | `int` |

## Body

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

## Narrative

**Business context:** 生产管理 → 生产工单 — toolbar 对账完成 / 对账提交 (account-reconciled) toggle on the 生产工单 master. Flips `mftworkordermaster.bAccountComplete` so accountants can mark a work-order as fully reconciled with customer billing, or undo that mark. Toggle semantics — every click inverts the flag.

**What it does:** Parses `$.params[*].value[*].sId` from `sProInParam`. For each master id, `UPDATE mftworkordermaster SET bAccountComplete = (CASE WHEN bAccountComplete=1 THEN 0 ELSE 1 END), sAccountPerson = sMakePerson, tAccountDate = NOW() WHERE sId = p_sId AND sBrandsId = sBrId AND sSubsidiaryId = sSuId`. No slave-side write, no validation — the click is unconditional.

**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` (POST `/procedureCall/doGenericProcedureCall`) — the 对账完成 toolbar button on the 生产工单 (`gdsmodule.sId 101251240115016002469445380`) names `Sp_mftworkordermaster_AccountSubmit` as the action.
