# `Sp_System_ProductMoneyAllReSure` (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(4000)` |
| 6 | OUT | `sCode` | `int` |

## Body

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

## Narrative

**Business context:** 成本管理 → 产品存货核算 — batch un-confirm (批量反确认) of every product-inventory line in one or more 会计期间. Inverse of `Sp_System_ProductMoneyAllSure`. Used to unwind a month's product-inventory confirmation across the whole period in a single click.

**What it does:** Parses `$.params[*].value[*].sId` to period ids, refuses if `sysaccountperiod.bCalProducts=1` ("数据已核算不能批量操作"). For each `p_sPeriodId` clears `bConfirm=0, sConfirmMonth=''` on `accproductstore` for each product-inventory source bucket: 盘盈入库 (`sFormId='192116810113315264733417750'`), 装配入库 (rows whose `sBillSlaveId` ties via `pitproductinstoreslave`→`sgdsemigoodsmatchbillmaster`), 出库业务 (forms `101251240115015920999005840` / `11811781131121915179924491520` / `101801153119616626885036940` / `11811781131121915179924871530`), 签收扣数 (`101801153119616654889797200`), 发货运费 (`15839936170002427227633635401000`), 销售发票 (`11811781131121915184849572550`).

**Invocation:** No `gdsmodule` binding, no form-master, no other-proc, no xly-src match beyond the install script — dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from the 产品存货核算 period grid's 批量反确认 toolbar button. Forward pair: `Sp_System_ProductMoneyAllSure`.
