# `Sp_beforeSaveReturn_tore` (procedure)

> 固定资产入库保存前


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sGuid` | `longtext` |
| 2 | IN | `sBrId` | `varchar(100)` |
| 3 | IN | `sSuId` | `varchar(100)` |
| 4 | IN | `iTag` | `int` |
| 5 | OUT | `sCode` | `int` |
| 6 | OUT | `sReturn` | `longtext` |

## Body

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

## Narrative

**Business context:** 设备管理 / 固定资产入库 — parallel-fork variant of the fixed-asset inbound-receipt save-hook. Comment header: `固定资产入库保存前`. The active before-save chain is `Sp_beforeSave_tore` → `Sp_saveReturn_tore` (`tore` = inSTORE for fixed-asset). This `*Return` proc operates on `eptmachinefixedinstoreslave` ↔ -`master`.

**What it does:** Parses CSV `sGuid` into `p_t_sId`, joins `eptmachinefixedinstoreslave` ↔ `eptmachinefixedinstoremaster` and the related `MftWorkOrderSlave`, builds `p_MftworkOrderSlave_tmp` of received quantities, then in each `iTag` branch updates `eptmachinefixednoticeslave` (the originating return-to-factory notice) plus `salsalesorderslave` and `developorderslave` so the inbound is reflected upstream.

**Invocation:** Status: appears orphaned. No caller found in any channel. Candidate for maintainer audit.
