# `sp_refreshJurBill` (procedure)


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

## Parameters

_No parameters._

## Body

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

## Narrative

**Business context:** Platform-admin helper — rebuilds the per-module permission catalog (`gdsjurisdiction`) for every *billing/document* module (the inverse filter to `sp_refreshJur`: `gdsmodule.sName NOT LIKE '%indexPage/commonList%' AND gdsconfigformmaster.iOrder=1`). Ensures the permission UI lists the current toolbar buttons of each 单据 form.

**What it does:** Cursors through every billing-form module/form pair, deletes `gdsjurisdiction` rows whose `sName` no longer matches a visible toolbar button on the form, then re-iterates the visible top-level `Btn*` controls (excluding `BtnCopyTo`) from `gdsconfigformslave` and upserts a matching `gdsjurisdiction(sId, sParentId=sModuleId, sName=sControlName, sChinese, iOrder)` per button. Inner commented-out block hints at a follow-on `sysjurisdiction` populate that is currently skipped.

**Invocation:** No bindings found. Not referenced by `gdsconfigformmaster.sSqlStr`, no `gdsmodule` hook, no other routine calls it, no xly-src match. Status: appears orphaned — admin-only utility invoked manually after form-master/permission edits to resync the jurisdiction catalog. Candidate for maintainer audit.
