# `Sp_chart_home_13` (procedure)

> 今日KPI指数


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

## Parameters

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

## Body

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

## Narrative

**Business context:** 仪表盘 — 今日KPI指数 (today's KPI index) home-screen tile. Was meant to render a gauge-style KPI summary for the logged-in user (or all employees, when sysadmin) by reading `kpimaster` reward/punishment totals and a ratio of standard vs total tasks.

**What it does:** Currently a stub — the entire computation body is commented out and the proc only assigns the (uninitialised, NULL) `p_sReturn` to OUT `sReturn`. The dead code (preserved as a comment block) was the planned logic: read login type from `sftlogininfo`, aggregate `kpimaster.drewardMoney - dpunishmentMoney` and `10000 * iTodayStandard / iTodayTotal`, scope to the employee group via `sftlogininfopersongroup` for non-sysadmin users, normalise negative reward-money to `+10000`, and emit `{"data":<kpi>, "xUnit":"累计奖励:<money>元"}`.

**Invocation:** Status: appears orphaned. No form-master, gdsmodule hook, other-routine caller, or Java caller — only the install script `script/标版/30100101/Sp_chart_home_13.sql`. Returns an uninitialised value; the disabled body indicates the KPI tile was retired. Candidate for maintainer audit — either drop the proc or restore the body.
