# `Sp_costFrame_BtnEventWorkCenterInto` (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_costFrame_BtnEventWorkCenterInto`'`._

## Narrative

**Business context:** 成本管理 → 部门费用分摊到工作中心单据 — "导入" (import) button-event handler, work-centre side. Pulls allocated work-centre amounts into the current bill so the user can finalise the work-centre level of the department-to-work-centre allocation chain. Shares its inherited COMMENT with `Sp_costFrame_BtnEventDepartInto` but the body deletes the previous selection before re-importing.

**What it does:** Validates `sProInParam` (refuses with `paramsErro`), parses the selected slave-ids, then for each row `DELETE FROM` the work-centre cost-frame slave matching `sId` and re-imports it from the canonical allocation source — same JSON envelope + freeze/check flag guards as the depart-into variant, but with the destructive `DELETE` step instead of an additive insert.

**Invocation:** Status: appears orphaned. No `gdsmodule` hook, `gdsconfigformmaster` reference, other-routine caller, or xly-src hit. Sibling of `Sp_costFrame_BtnEventDepartInto`; both name match the `sp_btn_action*` dispatcher pattern but neither binding row exists. Candidate for maintainer audit.
