# `Sp_Calc_sUdft` (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(5000)` | | 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_sUdft`'`._ ## Narrative **Business context:** 业财一体化 → 单据 → 凭证模板单据 — audit/un-audit handler for the accounting-voucher template (`udfvouchertemplatemaster`). The template lets finance preconfigure standard postings (e.g. "depreciation of fixed assets") that the voucher form clones; auditing the template marks it as ready-to-use. **What it does:** Validates `sGuid`. With `iFlag=1`, refuses when the template is already `bCheck=1`, then `Update udfvouchertemplatemaster SET bCheck=1, sStatus='1'` for the given id. With `iFlag=0` symmetric un-audit. Simpler than `Sp_Calc_sUdf` — no expense-category guard, no slave validation. **Invocation:** Bound to `gdsmodule.sProcName` on 凭证模板单据 (sId `101251240115016274437635530`) — 业财一体化 → 单据. Dispatched by Java `BusinessBaseServiceImpl.getPrcName(sFormGuid, ...)` on the 审核/反审核 button. xly-src ships `script/标版/30100101/Sp_Calc_sUdft.sql` (install) and `script/标版/optimize/Sp_Calc_sUdft.sql` (patch). Sibling of `Sp_Calc_sUdf`.