# `Sp_Calc_sFybx` (procedure)

> 费用报销


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `iFlag` | `int` |
| 2 | IN | `iTmpCheck` | `int` |
| 3 | IN | `sFormGuid` | `varchar(100)` |
| 4 | IN | `sGuid` | `varchar(100)` |
| 5 | IN | `sLoginId` | `varchar(100)` |
| 6 | OUT | `sReturn` | `varchar(4000)` |
| 7 | IN | `sBrId` | `varchar(100)` |
| 8 | IN | `sSuId` | `varchar(100)` |
| 9 | OUT | `sCode` | `int` |

## Body

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

## Narrative

**Business context:** 财务管理 → 财务单据 — expense-reimbursement check / uncheck on `expensereimbursementmaster` (COMMENT `'费用报销'`). Approves a 费用报销 (employee expense-reimbursement claim) so the reimbursed amount feeds back into the matched advance-cost record (差旅借支 / 备用金).

**What it does:** Byte-identical to `Sp_Calc_sFksq` apart from the procedure name and the COMMENT — same `expensereimbursementmaster` master flip, same slave flip on `expensereimbursementslave`, same `Update advanceCostCheckMaster` back-write of the reimbursed amount against the prior advance. Validates `sGuid`, refuses `bInvalid=1`, checks `sysaccountperiod.bFrozen` per `SysSystemSettings.CkxIntervalMonthModifyBill`. Uncheck reverses the master/slave flags but does not unwind the `advanceCostCheckMaster` back-write — flag for audit if reversibility matters.

**Invocation:** Status: appears orphaned. No live `gdsmodule.sProcName` binding, no `sSaveProName` hook, no other-routine CALLs, no xly-src reference (no install script, no Java caller) — candidate for maintainer audit. The production 费用报销 form likely uses a customer-override or has been renamed; verify which proc the live 费用报销单 module currently binds.
