# `Sp_beforeSaveReturn_tice` (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_tice`'`._

## Narrative

**Business context:** 设备管理 / 回厂通知单 — parallel-fork variant of the return-to-factory notice save-hook for fixed-asset machines. Comment header: `回厂通知单保存前`. The active before-save chain would be `Sp_beforeSave_tice` → `Sp_saveReturn_tice`; this `*Return` proc operates on `eptmachinefixednoticeslave` ↔ -`master` (`tice` = noTICE).

**What it does:** Parses CSV `sGuid` into `p_t_sId`, joins `eptmachinefixednoticeslave` ↔ `eptmachinefixednoticemaster` and related `MftWorkOrderSlave`, builds `p_MftworkOrderSlave_tmp`, then in each `iTag` branch updates `eptmachinefixedorderslave` (the upstream fix-order's notified-quantity counter) plus `salsalesorderslave` and `developorderslave`.

**Invocation:** Status: appears orphaned. No caller found in any channel. Candidate for maintainer audit — superseded by `Sp_saveReturn_tice`.
