Commit 5e392b2f4e10e6dd140328118207119c3bee2ce7

Authored by zichun
1 parent b11b40e1

docs: add known-issues page consolidating defects surfaced by routine narratives

Pass 4 of the routine-narrative job. While documenting xly's 1,861 stored
procedures and functions, the narrative-writing subagents incidentally
surfaced ~140 code-level defects, header/comment drift, sealed-but-still-
bound routines, tenant-baked GUIDs, dead code, debug leakage, and naming
inconsistencies — flagged in individual narrative pages but otherwise
scattered.

This new page (en/docs/reference/maintainer/known-issues-in-stored-procedures.md)
collects them in one navigable index, deep-linking back to each routine's
auto-catalog page where the per-routine evidence lives. Grouped by
category:

  - Real correctness / runtime bugs (~40)
  - Header / comment drift (~35)
  - Sealed-but-still-bound (~25 families)
  - Tenant-baked GUIDs / hardcoded magic values (~30)
  - Dead code / unimplemented stubs (~30)
  - Debug leakage left in production (~15)
  - Naming / structural inconsistencies (~10)
  - Security-adjacent (3)

Explicitly NOT a fix plan — flags are signals worth verifying, not
confirmed defect tickets. Several are operationally invisible; others are
likely intentional rollback-retained legacy. Methodology and "what this
page is and is not" framing are in the page header.

Also linked from reference/maintainer/index.md and added to mkdocs.yml nav.
en/docs/reference/maintainer/index.md
... ... @@ -15,3 +15,4 @@ metadata table to the `gds*` family, or wire in a new third-party integration.
15 15 - [Metadata-management services (`xlyManage`)](management-services.md) — the `Gds*ServiceImpl` family behind the BACK builder.
16 16 - [BI / KPI / Charts engine](bi-engine.md) — the homebrewed dashboard layer.
17 17 - [Activiti integration](activiti.md) — version skew, schemas, custom delegates.
  18 +- [Known issues in stored procedures and functions](known-issues-in-stored-procedures.md) — consolidated index of code-level defects, comment drift, sealed-but-still-bound routines, and other audit signals surfaced while documenting the 1,861 auto-catalog routines.
... ...
en/docs/reference/maintainer/known-issues-in-stored-procedures.md 0 → 100644
  1 +# Known issues in stored procedures and functions
  2 +
  3 +A consolidated index of code-level defects, comment drift, sealed-but-still-bound
  4 +routines, and other audit signals that the
  5 +[auto-catalog narratives](../../auto-catalog/procedures/index.md) surfaced while
  6 +documenting xly's 1,684 stored procedures and 177 functions.
  7 +
  8 +## What this page is, and is not
  9 +
  10 +**Is:** an index. Each entry points at a routine whose per-routine
  11 +[auto-catalog page](../../auto-catalog/procedures/index.md) carries the full
  12 +evidence (proc body excerpt, calling-channel analysis, etc.). The categories below
  13 +are decision-support — they let a maintainer scan for what to triage first
  14 +without reading 1,861 pages.
  15 +
  16 +**Is not:** a fix plan. None of these defects have been fixed; the procedures
  17 +are still running in production. Several are operationally invisible (e.g., a
  18 +broken regex that always returns "yes" looks fine if the caller never relied on
  19 +the filter). Others are likely intentional (sealed legacy procs kept around for
  20 +rollback). **Audit each entry before acting on it** — a flag here is a signal
  21 +worth verifying, not a confirmed bug ticket.
  22 +
  23 +> **Methodology.** Items were captured by the narrative-writing subagents when
  24 +> they read the proc/function body to understand what each routine did. The
  25 +> agents weren't running a defect audit — they noticed mismatches and bugs as a
  26 +> side effect. Pass 3 spot-checked 10 randomly-selected flag claims and all 10
  27 +> verified against the live `SHOW CREATE` output. The list is high-signal but
  28 +> incomplete: routines whose body the agents didn't read in depth (huge bodies
  29 +> with body-summarization mode) may carry undocumented issues.
  30 +
  31 +---
  32 +
  33 +## Real correctness / runtime bugs
  34 +
  35 +These will produce wrong results, return wrong values, or fail at runtime under
  36 +the documented conditions. **Highest priority for audit.**
  37 +
  38 +- [`Fun_GetCh`](../../auto-catalog/functions/Fun_GetCh.md) — regex `'[u0391-uFFE5]'` is taken literally (matches `u`/`0`/`3`/…), not as the intended Unicode range `Α-¥`. The "non-Chinese filter" matches nothing; only `-`/`+` stripping survives. Used by `Sp_Create_sControlFaceNameTable*`.
  39 +- [`GetChineseChar`](../../auto-catalog/procedures/GetChineseChar.md) — same broken `[u0391-uFFE5]` literal regex; classifies every character as non-Chinese.
  40 +- [`GetDispatchUnit`](../../auto-catalog/procedures/GetDispatchUnit.md) — falls back to `eleproduct.sProductUnit` only for one hardcoded GUID; returns `NULL` on any other deployment.
  41 +- [`GetPriorProcess`](../../auto-catalog/procedures/GetPriorProcess.md) — one branch references session vars `@uGuid`/`@sCurProcessName` instead of proc-local `uGuid`/`p_sCurProcessName`; that branch always sees NULL.
  42 +- [`PRO_ERPMERGEBASEELECUSTOMER`](../../auto-catalog/procedures/PRO_ERPMERGEBASEELECUSTOMER.md) — SET clauses swap `sCustomerName = @sCustomerNo` and `sCustomerNo = @sCustomerName`; label columns are written to the wrong fields.
  43 +- [`PRO_ERPMERGEMFTWORKORDER`](../../auto-catalog/procedures/PRO_ERPMERGEMFTWORKORDER.md), [`PRO_ERPMERGEPRODUCTIONREPORT`](../../auto-catalog/procedures/PRO_ERPMERGEPRODUCTIONREPORT.md), [`PRO_ERPMERGESALSALESORDER`](../../auto-catalog/procedures/PRO_ERPMERGESALSALESORDER.md) — `DELETE FROM <table> WHERE sSlaveId = sSlaveId`. IN parameter name shadows the column → tautology → wipes the entire merge table on every call before the single-row re-INSERT.
  44 +- [`Sp_AdjustMoney_BtnRepair`](../../auto-catalog/procedures/Sp_AdjustMoney_BtnRepair.md) — empty-memo guard sets `sCode=-1` but does not `LEAVE top`; the empty-memo branch still applies the update.
  45 +- [`Sp_AfterPost_sQtt`](../../auto-catalog/procedures/Sp_AfterPost_sQtt.md) — cursor inside `iFlag=1` is bounded by `viw_mftworkorderprocess` count, but the inner SELECT reads from `viw_quoquotation × quoquotationprocess × quoquotationcontrol`; loop bound is wrong.
  46 +- [`Sp_addBtn_gdsmodle`](../../auto-catalog/procedures/Sp_addBtn_gdsmodle.md) — BtnExamine `NOT EXISTS` guard checks `sControlName='BtnBsOperation.BtnInvalid'` instead of `BtnExamine`.
  47 +- [`Sp_addSysbrands`](../../auto-catalog/procedures/Sp_addSysbrands.md) — `gdsconfigformslave` clone reuses seed `sId` values rather than generating new ones; cross-tenant collision risk.
  48 +- [`Sp_Apply_Flow_materialspd`](../../auto-catalog/procedures/Sp_Apply_Flow_materialspd.md), [`Sp_Apply_Flow_productpd`](../../auto-catalog/procedures/Sp_Apply_Flow_productpd.md) — `WHERE iPosition=32 AND (sEmployeeNo='00034' OR iPosition=7)` is malformed; the `iPosition=7` branch is unreachable.
  49 +- [`Sp_Apply_Flow_OpsProductMore`](../../auto-catalog/procedures/Sp_Apply_Flow_OpsProductMore.md) — `p_iCount2` calculated but `iOut2` set from `p_iCount4`; variable-name drift.
  50 +- [`Sp_Apply_Flow_OpsProductMorebecome`](../../auto-catalog/procedures/Sp_Apply_Flow_OpsProductMorebecome.md) — `p_ThreeFlow` set to 总经理 then immediately overwritten by 财务总鉴 → 总经理 tier never returned. `p_iCount3` assigned twice; `p_iCount4` referenced but never assigned, so `iOut2` is always 0.
  51 +- [`Sp_Apply_Flow_PurCheck`](../../auto-catalog/procedures/Sp_Apply_Flow_PurCheck.md) — variance formula multiplies new-price by new-price (`B.dMaterialsPrice*A.dMaterialsPrice`); likely should be `dAuxiliaryQty*dMaterialsPrice`.
  52 +- [`Sp_Apply_Flow_PurpurchaseOrder`](../../auto-catalog/procedures/Sp_Apply_Flow_PurpurchaseOrder.md) — `p_iOut1` count of guidance-priced lines lacks `WHERE sParentId=sGuId`; counts across all orders, not just this one. Threshold `30000` hardcoded but header says `20000`.
  53 +- [`Sp_Apply_Flow_SalSaleOrder`](../../auto-catalog/procedures/Sp_Apply_Flow_SalSaleOrder.md) — `p_ElevenFlow` and `p_TwelveFlow` both populate from `iPosition=34` (duplicate); `p_MoreFlow` = `p_ThreeFlow` so 会签 collapses to a single party.
  54 +- [`Sp_Apply_Flow_SalSalesNotify`](../../auto-catalog/procedures/Sp_Apply_Flow_SalSalesNotify.md) — 烟包 count lookup hits `salsalesinvoiceslave` instead of `saldelivernotifyslave`; `iOut2` is wrong for delivery-notify forms with no companion invoice.
  55 +- [`Sp_Apply_Flow_Ystz`](../../auto-catalog/procedures/Sp_Apply_Flow_Ystz.md) — emits `"EightFlow", p_SevenFlow` (assigns 总经理 value to 董事长 slot); `p_EightFlow` populated but never emitted.
  56 +- [`Sp_Bd_Root_allstatus26`](../../auto-catalog/procedures/Sp_Bd_Root_allstatus26.md) — temp-table seeding INSERTs/SELECTs column `sMachineNo` that the `CREATE TEMPORARY TABLE` doesn't define. Proc fails at every call.
  57 +- [`Sp_beforeSaveReturn_sQtt`](../../auto-catalog/procedures/Sp_beforeSaveReturn_sQtt.md) — body joins `pitproductrejectslave` in a quotation back-writer; copy-paste from `Sp_saveReturn_sPdt`.
  58 +- [`Sp_BtnEvent_AccProductUnFrozen`](../../auto-catalog/procedures/Sp_BtnEvent_AccProductUnFrozen.md) — `sFrozenPerson`/`tFrozenDate` overwritten with the unfreezing user/timestamp, losing original-freeze attribution.
  59 +- [`Sp_BtnEventCopyUserJurisdiction`](../../auto-catalog/procedures/Sp_BtnEventCopyUserJurisdiction.md), [`Sp_BtnEventCopyGroupJurisdiction`](../../auto-catalog/procedures/Sp_BtnEventCopyGroupJurisdiction.md) — loop-overwrite bug; only the last `(sUserId, sToUserId)` pair is acted on.
  60 +- [`Sp_BtnUpdate_OnOpsConfirm`](../../auto-catalog/procedures/Sp_BtnUpdate_OnOpsConfirm.md), [`Sp_BtnUpdate_OnOpsOrder`](../../auto-catalog/procedures/Sp_BtnUpdate_OnOpsOrder.md), [`Sp_BtnUpdate_OnPurOrder`](../../auto-catalog/procedures/Sp_BtnUpdate_OnPurOrder.md) — `WHERE bOutConfirm=0` guard means once a row is confirmed the CASE toggle can never run again; effectively one-way confirm.
  61 +- [`Sp_BtnUpdate_RevSupply`](../../auto-catalog/procedures/Sp_BtnUpdate_RevSupply.md) — WHERE/SET column mismatch: guards on `bCheck=0` but mutates `bSubCheck`. Copy-paste from sibling template.
  62 +- [`Sp_Calc_plateprocessing`](../../auto-catalog/procedures/Sp_Calc_plateprocessing.md) — `IF iCount > 0` reads an undefined session variable (local is `p_iCount`); "already checked" guard never fires.
  63 +- [`Sp_Calc_Product`](../../auto-catalog/procedures/Sp_Calc_Product.md), [`Sp_Calc_sAcod`](../../auto-catalog/procedures/Sp_Calc_sAcod.md) — uncheck branch reads `sNoCanCheckBybCheck` instead of `sNoCanCheckBybUnCheck`.
  64 +- [`Sp_Calc_about`](../../auto-catalog/procedures/Sp_Calc_about.md), [`Sp_Calc_borrow`](../../auto-catalog/procedures/Sp_Calc_borrow.md), [`Sp_Calc_Change`](../../auto-catalog/procedures/Sp_Calc_Change.md), [`Sp_Calc_clear`](../../auto-catalog/procedures/Sp_Calc_clear.md) — `sTmpReturn` declared but never assigned; trailing `IF sTmpReturn <> ''` branch dead across the family.
  65 +- [`Sp_Calc_pruOrderBgd`](../../auto-catalog/procedures/Sp_Calc_pruOrderBgd.md) — accepts `iFlag` parameter but never branches on it; uncheck path missing entirely.
  66 +- [`Sp_Calc_sExp`](../../auto-catalog/procedures/Sp_Calc_sExp.md) — missing `sStatus`-flip and missing already-checked/unchecked guards versus family norm; both branches idempotent.
  67 +- [`Sp_Calc_sMat`](../../auto-catalog/procedures/Sp_Calc_sMat.md) — embedded `Sp_System_CheckFlow` loop scans `SalSalesOrderSlave` instead of any `elematerials` slave; copy-paste from 销售订单 template applied to a material-master audit.
  68 +- [`Sp_Calc_sMcd`](../../auto-catalog/procedures/Sp_Calc_sMcd.md) — unqualified `sMaterialsId` in the UPDATE SET expression; affects 盘点 profit/loss columns on multi-line counts.
  69 +- [`Sp_Calc_sPrw`](../../auto-catalog/procedures/Sp_Calc_sPrw.md) — un-audit guard reads from `salsalesdevmaster` rather than the production-report table.
  70 +- [`Sp_Calc_tice`](../../auto-catalog/procedures/Sp_Calc_tice.md), [`Sp_Calc_tore`](../../auto-catalog/procedures/Sp_Calc_tore.md) — column name mis-cased as `sCheckPersON`; case-sensitive on case-sensitive collations.
  71 +- [`Sp_history_purpurchaseordermaster`](../../auto-catalog/procedures/Sp_history_purpurchaseordermaster.md) — cursor declares `Cur_OrderSlave_handle1 = 1` (not 0); first row silently skipped (off-by-one).
  72 +- [`Sp_MaterialHistoricalComparison`](../../auto-catalog/procedures/Sp_MaterialHistoricalComparison.md) — accepts `sBrId`/`sSuId` but never filters by tenant; every tenant's data mixes.
  73 +- [`Sp_PurpurchaseOrder_CheckUpdate`](../../auto-catalog/procedures/Sp_PurpurchaseOrder_CheckUpdate.md) — name+COMMENT say "保存校验" but body is `dOldPrice/Money` back-write, not validation.
  74 +- [`Sp_PurchasePriceChart`](../../auto-catalog/procedures/Sp_PurchasePriceChart.md) — opens cursor over `DT` but `DT` is never populated; loop runs zero times.
  75 +- [`Sp_Sales_SalesAnalysiseOfCustomerproperty`](../../auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfCustomerproperty.md) — receipts subquery groups by `EP.sParentId` instead of `EP.sCustomerPropertyId`; axis mismatch.
  76 +- [`Sp_Sales_SalesAnalysiseOfMonth`](../../auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfMonth.md), [`Sp_Sales_SalesAnalysiseProductOfMonth`](../../auto-catalog/procedures/Sp_Sales_SalesAnalysiseProductOfMonth.md) — `IFNULL(p_iStatisticsType, 0)` self-reference typo; input parameter `iStatisticsType` is ignored.
  77 +- [`Sp_Sales_SalesAnalysiseOfProfit`](../../auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfProfit.md), [`Sp_Sales_SalesAnalysiseOfProfit_Product`](../../auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfProfit_Product.md) — swapped-target rate columns: in-store rate writes to delivery's column and vice versa.
  78 +- [`Sp_SalOrder_BillForceComplete`](../../auto-catalog/procedures/Sp_SalOrder_BillForceComplete.md) — captured `p_sReason` parsed but never written.
  79 +- [`Stuff`](../../auto-catalog/procedures/Stuff.md) — right-slice uses `LOCATE(SUBSTR(str, startIndex, length), str)`; when the deleted substring also appears earlier in `str`, slices from the earlier occurrence.
  80 +- [`sp_cursor_test1`](../../auto-catalog/procedures/sp_cursor_test1.md) — `UPDATE eleteststandarditem SET iOrder=(@i:=@i+1)` has no `ORDER BY`; row numbering is non-deterministic.
  81 +
  82 +## Header / comment drift
  83 +
  84 +Cosmetic only — the routine works correctly but its `ROUTINE_COMMENT`, header
  85 +comment, or page title describes a different routine. Common after a routine
  86 +was renamed or cloned from a template without updating the header.
  87 +
  88 +- [`11`](../../auto-catalog/procedures/11.md) — header `现金日记帐` (cash journal), body is a product-class sales-revenue summary scratchpad.
  89 +- [`Fun_Cashier_GetProductPrice`](../../auto-catalog/functions/Fun_Cashier_GetProductPrice.md) — header `获取最近采购价(产品)`, body reads sales views.
  90 +- [`fun_get_jurisdiction`](../../auto-catalog/functions/fun_get_jurisdiction.md) — header `获取盒型图片`, body is a permission gate.
  91 +- [`Fun_getDhouM`](../../auto-catalog/functions/Fun_getDhouM.md), [`Fun_GetGb`](../../auto-catalog/functions/Fun_GetGb.md), [`Fun_GetTestCount`](../../auto-catalog/functions/Fun_GetTestCount.md), [`Fun_GetTestMaterialsCount`](../../auto-catalog/functions/Fun_GetTestMaterialsCount.md) — all carry the `获取字符串中数字` header copy-pasted from `Fun_GetNum`; bodies do different things.
  92 +- [`Fun_getMoneyFormart`](../../auto-catalog/functions/Fun_getMoneyFormart.md) — header `根据key值获取json字符串值`, body is amount-in-words digit splitter.
  93 +- [`Fun_getProductMaxStyle`](../../auto-catalog/functions/Fun_getProductMaxStyle.md) — header `根据首字母拼音查询`, unrelated to pinyin.
  94 +- [`NewId2`](../../auto-catalog/functions/NewId2.md) — header claims 27-char output; body produces 32 chars.
  95 +- [`Sp_addSysbrands`](../../auto-catalog/procedures/Sp_addSysbrands.md) — header `根据模块sId删除模块(包含子模块)`.
  96 +- [`Sp_afterSave_sOpkg`](../../auto-catalog/procedures/Sp_afterSave_sOpkg.md) — header references 发外发票, actual binding is 发外对账.
  97 +- [`Sp_afterSave_sOpp`](../../auto-catalog/procedures/Sp_afterSave_sOpp.md) — header `成品外购后反写数量`, actual module is 整单发外.
  98 +- [`Sp_afterSave_sPct`](../../auto-catalog/procedures/Sp_afterSave_sPct.md) — header references mobile, actual is 工序检验.
  99 +- [`Sp_afterSave_sPmt`](../../auto-catalog/procedures/Sp_afterSave_sPmt.md), [`Sp_afterSave_sWod`](../../auto-catalog/procedures/Sp_afterSave_sWod.md) — header says "保存前", routine is after-save.
  100 +- [`Sp_afterSave_sPtr`](../../auto-catalog/procedures/Sp_afterSave_sPtr.md) — header `报废单`, current bind is 成品领用.
  101 +- [`Sp_afterSave_sSmia`](../../auto-catalog/procedures/Sp_afterSave_sSmia.md), [`Sp_afterSave_sSmo`](../../auto-catalog/procedures/Sp_afterSave_sSmo.md), [`Sp_afterSave_sSmoa`](../../auto-catalog/procedures/Sp_afterSave_sSmoa.md) — headers reference 装配工单, bodies operate on `sgdsemigoods*-apply` tables.
  102 +- [`Sp_afterSave_tore`](../../auto-catalog/procedures/Sp_afterSave_tore.md) — header `回厂通知单保存后` copy-pasted from `tice` sibling.
  103 +- [`Sp_Apply_Flow_QualityaccidentsSupply_Proc1`](../../auto-catalog/procedures/Sp_Apply_Flow_QualityaccidentsSupply_Proc1.md) — header `供应商扣款单号 过程1` copy-pasted from `QualityaccidentMaterials_Proc1`.
  104 +- [`Sp_Apply_Flow_sCustomer`](../../auto-catalog/procedures/Sp_Apply_Flow_sCustomer.md) — `sParentName` JSON label says 供应商分类, body returns `siscustomerclassify.sName`.
  105 +- [`Sp_bd_Eqabnormal`](../../auto-catalog/procedures/Sp_bd_Eqabnormal.md) — COMMENT `调机时间分析` copy-pasted from `Sp_bd_EqAdjust`; body is 异常 idle analysis.
  106 +- [`Sp_Bd_bi20_hh`](../../auto-catalog/procedures/Sp_Bd_bi20_hh.md), [`Sp_Bd_bi20_ys`](../../auto-catalog/procedures/Sp_Bd_bi20_ys.md), [`Sp_Bd_bi20_2new`](../../auto-catalog/procedures/Sp_Bd_bi20_2new.md) — header `喷码+分切现场`, bodies target 糊盒/印刷/2new.
  107 +- [`Sp_Bd_cq_workshop_pj`](../../auto-catalog/procedures/Sp_Bd_cq_workshop_pj.md), [`_pm`](../../auto-catalog/procedures/Sp_Bd_cq_workshop_pm.md), [`_sy`](../../auto-catalog/procedures/Sp_Bd_cq_workshop_sy.md) — `-- call Sp_Bd_cq_workshop_mt(...)` header comment copy-pasted from family root.
  108 +- [`Sp_bd_MachineOee`](../../auto-catalog/procedures/Sp_bd_MachineOee.md) — header `设备OEE展示` overstates what the body delivers (4 hardcoded constants).
  109 +- [`Sp_beforeSave_sStl`](../../auto-catalog/procedures/Sp_beforeSave_sStl.md) — header is just `前反写数量` with no document name.
  110 +- [`Sp_beforeSaveReturn_sRct`](../../auto-catalog/procedures/Sp_beforeSaveReturn_sRct.md) — header `估价单保存前反写状态` mis-copied; body operates on receipt graph.
  111 +- [`Sp_BtnEvent_AccProductFrozen`](../../auto-catalog/procedures/Sp_BtnEvent_AccProductFrozen.md), [`_UnFrozen`](../../auto-catalog/procedures/Sp_BtnEvent_AccProductUnFrozen.md) — UnFrozen default `sReturn='送货未开票冻结成功!'` copy-pasted from Frozen.
  112 +- [`Sp_BtnEvent_MaterialsItestType`](../../auto-catalog/procedures/Sp_BtnEvent_MaterialsItestType.md) — default `sReturn='财务确认成功!'` wrong for this proc.
  113 +- [`Sp_BtnEvent_OpsInstoreComfirm`](../../auto-catalog/procedures/Sp_BtnEvent_OpsInstoreComfirm.md) — default `sReturn='物流单确认成功!'` copy-pasted from `LogisticsComfirm`.
  114 +- [`Sp_chart_MonthProfit`](../../auto-catalog/procedures/Sp_chart_MonthProfit.md) — `COMMENT 'PLC数据同步'` leftover; body is sales-vs-cost trend.
  115 +- [`Sp_format_column`](../../auto-catalog/procedures/Sp_format_column.md) — `COMMENT '根据模块sId删除模块(包含子模块)'`; body normalises grid-column widths.
  116 +- [`Sp_pur_purpurchaseorderOfSupply`](../../auto-catalog/procedures/Sp_pur_purpurchaseorderOfSupply.md) — `COMMENT '现金日记帐'` mislabel.
  117 +- [`Sp_PurpurchaseOrder_CheckUpdate`](../../auto-catalog/procedures/Sp_PurpurchaseOrder_CheckUpdate.md) — name+COMMENT say "保存校验", body is back-write.
  118 +- [`Sp_reportdata_WorkOrder`](../../auto-catalog/procedures/Sp_reportdata_WorkOrder.md), [`_WorkOrder1`](../../auto-catalog/procedures/Sp_reportdata_WorkOrder1.md), [`_WorkOrder3`](../../auto-catalog/procedures/Sp_reportdata_WorkOrder3.md) — `COMMENT '报价单数据源自定义'` leftover; bodies are 工单 Jasper data-sources.
  119 +- [`Sp_Sales_NotDeliverGoodList`](../../auto-catalog/procedures/Sp_Sales_NotDeliverGoodList.md), [`Sp_Sales_NotWorkOrderList`](../../auto-catalog/procedures/Sp_Sales_NotWorkOrderList.md), [`Sp_Sales_PurchaseAnalysiseOfMaterial`](../../auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfMaterial.md), [`_OfMaterialClass`](../../auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfMaterialClass.md), [`_OfSupply`](../../auto-catalog/procedures/Sp_Sales_PurchaseAnalysiseOfSupply.md) — `现金日记帐` copy-paste on procurement-analysis pivots.
  120 +- [`Sp_Sales_SalesAnalysiseOfSalesperson`](../../auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfSalesperson.md), [`Sp_Sales_SalesDelivergoodsAnalysiseOfCustomer`](../../auto-catalog/procedures/Sp_Sales_SalesDelivergoodsAnalysiseOfCustomer.md) — `COMMENT '现金日记帐'` mislabel.
  121 +- [`Sp_Sys_GetMenu`](../../auto-catalog/procedures/Sp_Sys_GetMenu.md) — auto-catalog header "根据模块sId删除模块" is misleading; body is read-only.
  122 +- [`Sp_UnConfirm_Zg`](../../auto-catalog/procedures/Sp_UnConfirm_Zg.md) — COMMENT says "通过", body messages "不通过".
  123 +- [`Sp_UndeliverIsRelated`](../../auto-catalog/procedures/Sp_UndeliverIsRelated.md) — COMMENT copy-pasted from `Sp_UnConfirm_Zg`, unrelated to behaviour.
  124 +
  125 +## Sealed-but-still-bound (`封存` markers retained alongside live bindings)
  126 +
  127 +These procs carry author-written `封存` (sealed/archived) markers in the body
  128 +header but still have live form-master or `gdsmodule` bindings. Either the
  129 +marker is informational only (the proc is the canonical one), or the binding
  130 +needs to be retired alongside the seal. **Verify per routine before changes.**
  131 +
  132 +- [`Sp_Bd_Cqzy_workshop5`](../../auto-catalog/procedures/Sp_Bd_Cqzy_workshop5.md), [`_6`](../../auto-catalog/procedures/Sp_Bd_Cqzy_workshop6.md) — 封存 2021-06-20.
  133 +- [`Sp_bd_MachinePlanTemplate_1`](../../auto-catalog/procedures/Sp_bd_MachinePlanTemplate_1.md) and 7 siblings — 封存 2021-06-21.
  134 +- [`Sp_bd_EqStatus`](../../auto-catalog/procedures/Sp_bd_EqStatus.md), [`_new`](../../auto-catalog/procedures/Sp_bd_EqStatus_new.md) — 封存 2021-06-20.
  135 +- [`Sp_CalcCost_BtnEventReCalcCost`](../../auto-catalog/procedures/Sp_CalcCost_BtnEventReCalcCost.md) — 封存 (杨恒林 2021-09-20).
  136 +- [`Sp_Calc_sPct1`](../../auto-catalog/procedures/Sp_Calc_sPct1.md), [`_2`](../../auto-catalog/procedures/Sp_Calc_sPct2.md), [`_3`](../../auto-catalog/procedures/Sp_Calc_sPct3.md), [`_OEE`](../../auto-catalog/procedures/Sp_Calc_sPctOEE.md) — `zhucx 2021.11.21 封存`.
  137 +- [`Sp_CommonList_BtnEventCheck`](../../auto-catalog/procedures/Sp_CommonList_BtnEventCheck.md), [`_UpdatedDoing`](../../auto-catalog/procedures/Sp_commonList_BtnEventUpdatedDoing.md), [`_UpdatePrice`](../../auto-catalog/procedures/Sp_commonList_BtnEventUpdatePrice.md) — 封存 2021-06-16.
  138 +- [`Sp_Customerlist_BtnEventCheck1`](../../auto-catalog/procedures/Sp_Customerlist_BtnEventCheck1.md), [`_UnCheck1`](../../auto-catalog/procedures/Sp_Customerlist_BtnEventUnCheck1.md) — 封存 2021-05-21.
  139 +- [`Sp_GetOrder_Process`](../../auto-catalog/procedures/Sp_GetOrder_Process.md) — `@date:20210714 封存` but form binding active.
  140 +- [`Sp_Inventory_ProductInOutStoreMoney`](../../auto-catalog/procedures/Sp_Inventory_ProductInOutStoreMoney.md), [`_Stock`](../../auto-catalog/procedures/Sp_Inventory_ProductInOutStoreStock.md) — 封存 2021-05-21.
  141 +- [`Sp_Manufacture_BillComplete`](../../auto-catalog/procedures/Sp_Manufacture_BillComplete.md) — 封存 2021-06-07.
  142 +- [`Sp_Manufacture_InsertMftPlan`](../../auto-catalog/procedures/Sp_Manufacture_InsertMftPlan.md), [`_Process`](../../auto-catalog/procedures/Sp_Manufacture_InsertMftPlanProcess.md), [`_ToErp`](../../auto-catalog/procedures/Sp_Manufacture_InsertMftPlanToErp.md) — 封存 2021-07-11.
  143 +- [`Sp_Manufacture_MftPlanPhase`](../../auto-catalog/procedures/Sp_Manufacture_MftPlanPhase.md), [`_BtnEventCalc`](../../auto-catalog/procedures/Sp_Manufacture_MftPlanPhase_BtnEventCalc.md), [`_product`](../../auto-catalog/procedures/Sp_MftPlanPhaseProduct_BtnEventConvertPlanA.md) (and 3 siblings) — 封存 2022-03.
  144 +- [`Sp_Manufacture_ProductionArrange2`](../../auto-catalog/procedures/Sp_Manufacture_ProductionArrange2.md) — 封存 2021-07.
  145 +- [`Sp_Manufacture_ReplaceContent`](../../auto-catalog/procedures/Sp_Manufacture_ReplaceContent.md) — 封存 2021-07-06.
  146 +- [`Sp_Manufacture_ReportQty_BtnEventCalc`](../../auto-catalog/procedures/Sp_Manufacture_ReportQty_BtnEventCalc.md) — 封存 2022-03-21.
  147 +- [`Sp_Manufacture_WorkOrderStatistics`](../../auto-catalog/procedures/Sp_Manufacture_WorkOrderStatistics.md) — 封存 2021-07-14.
  148 +- [`Sp_mes_TimeActivation_Machine`](../../auto-catalog/procedures/Sp_mes_TimeActivation_Machine.md) and 6 siblings — body marked 封存.
  149 +- [`sp_OEE_adjustmentend`](../../auto-catalog/procedures/sp_OEE_adjustmentend.md), [`_billstartWorking`](../../auto-catalog/procedures/sp_OEE_billstartWorking.md), [`_loading`](../../auto-catalog/procedures/sp_OEE_loading.md), [`_endWorked`](../../auto-catalog/procedures/sp_OEE_endWorked.md), [`_Exit`](../../auto-catalog/procedures/sp_OEE_Exit.md) — 封存 2021-09-08.
  150 +- [`Sp_OEE_ScanInsertToERP`](../../auto-catalog/procedures/Sp_OEE_ScanInsertToERP.md), [`_2013`](../../auto-catalog/procedures/Sp_OEE_ScanInsertToERP2013.md) — 封存 2021-08-17.
  151 +- [`Sp_PC_FirstInspection`](../../auto-catalog/procedures/Sp_PC_FirstInspection.md), [`Sp_PC_PatrolInspection`](../../auto-catalog/procedures/Sp_PC_PatrolInspection.md), [`Sp_Mobile_PatrolInspection`](../../auto-catalog/procedures/Sp_Mobile_PatrolInspection.md) — 封存 2021-11-08, form bindings still live.
  152 +- [`Sp_PLC_ScanInsertToERP`](../../auto-catalog/procedures/Sp_PLC_ScanInsertToERP.md) — 封存.
  153 +- [`Sp_Product_BtnEventCheck`](../../auto-catalog/procedures/Sp_Product_BtnEventCheck.md) — `@date:20210521 封存`.
  154 +- [`Sp_Quantity_PatrolDailyPaper`](../../auto-catalog/procedures/Sp_Quantity_PatrolDailyPaper.md) — DB COMMENT marks 封存 2021-05-23.
  155 +- [`Sp_Reachingrate_Machine`](../../auto-catalog/procedures/Sp_Reachingrate_Machine.md) — 封存 2021-06-21, form binding active.
  156 +- [`Sp_Sales_SalesAnalysiseOfProfit`](../../auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfProfit.md), [`_Product`](../../auto-catalog/procedures/Sp_Sales_SalesAnalysiseOfProfit_Product.md) — 封存 2021-06-16, still wired (and carry the swapped-column bug above).
  157 +- [`Sp_System_AccountSquareCheck`](../../auto-catalog/procedures/Sp_System_AccountSquareCheck.md), [`_New`](../../auto-catalog/procedures/Sp_System_AccountSquareCheck_New.md), [`_material`](../../auto-catalog/procedures/Sp_System_AccountSquareCheck_material.md) — 封存 2021-05-21.
  158 +- [`Sp_System_BatchNPriceMoney`](../../auto-catalog/procedures/Sp_System_BatchNPriceMoney.md), [`_quo`](../../auto-catalog/procedures/Sp_System_BatchNPriceMoney_quo.md), [`Sp_System_BatchPriceMoney`](../../auto-catalog/procedures/Sp_System_BatchPriceMoney.md) — 封存 2021-07-07.
  159 +
  160 +## Tenant-baked GUIDs and hardcoded magic values
  161 +
  162 +Routines that hardcode specific tenant/customer-specific sIds, dept GUIDs, PLC
  163 +numbers, or magic numerics. Cloning to a new deployment requires per-routine
  164 +re-mapping; these will silently produce empty/NULL/wrong output on a different
  165 +tenant.
  166 +
  167 +- [`Fun_getDhouM`](../../auto-catalog/functions/Fun_getDhouM.md) — hardcoded machine sIds (e.g. `16500802910009018024524290446000`).
  168 +- [`fun_GetPreProcessQty`](../../auto-catalog/functions/fun_GetPreProcessQty.md) — process sId `1691254111216986535515270`.
  169 +- [`Fun_getProductMaxStyle`](../../auto-catalog/functions/Fun_getProductMaxStyle.md) — eleprocess sIds tying function to one tenant.
  170 +- [`fun_getreportId_byArrMaterialsType`](../../auto-catalog/functions/fun_getreportId_byArrMaterialsType.md), [`_byMaterialsType`](../../auto-catalog/functions/fun_getreportId_byMaterialsType.md), [`Fun_GetReportId_byLogType`](../../auto-catalog/functions/Fun_GetReportId_byLogType.md), [`fun_getreportId_bycus`](../../auto-catalog/functions/fun_getreportId_bycus.md), [`fun_gettzreportId_bycus`](../../auto-catalog/functions/fun_gettzreportId_bycus.md) — encode tenant-specific customer + report sIds.
  171 +- [`Fun_GetTrunkQty`](../../auto-catalog/functions/Fun_GetTrunkQty.md) — paper-product-only conversion ratios; non-paper businesses see NULL.
  172 +- [`get_config_data_JSON`](../../auto-catalog/procedures/get_config_data_JSON.md) — hardcodes `iIncrement = 1509089`; `sConfigSlaveId` parameter ignored.
  173 +- [`Sp_addBtn_gdsmodle`](../../auto-catalog/procedures/Sp_addBtn_gdsmodle.md), [`Sp_Ai_AddCommonAfterNew`](../../auto-catalog/procedures/Sp_Ai_AddCommonAfterNew.md), [`Sp_init_plc_config`](../../auto-catalog/procedures/sp_init_plc_config.md) — hardcoded seed tenant `sBrandsId='1111111111'`.
  174 +- [`Sp_Apply_Flow_MachineFix`](../../auto-catalog/procedures/Sp_Apply_Flow_MachineFix.md) — hardcoded machine sId.
  175 +- [`Sp_Apply_Flow_OpsCheck`](../../auto-catalog/procedures/Sp_Apply_Flow_OpsCheck.md), [`_OpsProcess`](../../auto-catalog/procedures/Sp_Apply_Flow_OpsProcess.md) — 7 hardcoded exempt-process sIds.
  176 +- [`Sp_Apply_Flow_OpsProduct`](../../auto-catalog/procedures/Sp_Apply_Flow_OpsProduct.md), [`_OpsProductMore`](../../auto-catalog/procedures/Sp_Apply_Flow_OpsProductMore.md), [`_OpsProductMorebecome`](../../auto-catalog/procedures/Sp_Apply_Flow_OpsProductMorebecome.md) — dept-root GUIDs `20231120093814639059733069696942` (生产), `17344173190001090119214960551400` (供应链), 烟包 classify root.
  177 +- [`Sp_Apply_Flow_OrderChangeNew`](../../auto-catalog/procedures/Sp_Apply_Flow_OrderChangeNew.md) — multiple tenant dept/process/classify GUIDs.
  178 +- [`Sp_Apply_Flow_productpd`](../../auto-catalog/procedures/Sp_Apply_Flow_productpd.md), [`_materialspd`](../../auto-catalog/procedures/Sp_Apply_Flow_materialspd.md) — hardcoded 工号 `'00034'` / `'06376'`.
  179 +- [`Sp_Apply_Flow_PurOrder`](../../auto-catalog/procedures/Sp_Apply_Flow_PurOrder.md) — hardcoded user literal `"管广飞"`.
  180 +- [`Sp_Apply_Flow_salesreturnapply`](../../auto-catalog/procedures/Sp_Apply_Flow_salesreturnapply.md), [`_SalSaleOrder`](../../auto-catalog/procedures/Sp_Apply_Flow_SalSaleOrder.md), [`_sCustomer`](../../auto-catalog/procedures/Sp_Apply_Flow_sCustomer.md), [`_sCustomerAccord`](../../auto-catalog/procedures/Sp_Apply_Flow_sCustomerAccord.md), [`_Supply`](../../auto-catalog/procedures/Sp_Apply_Flow_Supply.md), [`_Ystz`](../../auto-catalog/procedures/Sp_Apply_Flow_Ystz.md), [`_Yzfy`](../../auto-catalog/procedures/Sp_Apply_Flow_Yzfy.md) — 营销一/二部 dept-root GUIDs, 烟包 classify root, supplier-classify GUIDs.
  181 +- [`Sp_Apply_Flow_salDesign`](../../auto-catalog/procedures/Sp_Apply_Flow_salDesign.md) — form-sId match filter hardcoded.
  182 +- [`Sp_Bd_*`](../../auto-catalog/procedures/) family — extensive PLC-to-slot maps tenant-deployment-specific (Sp_Bd_bi20_hh, _ys, _2new, _cq_workshop_mt/pj/pm/sy/ys_nomes, _workshop1, _Cqzy_workshop1, _Root_allstatus25/26).
  183 +- [`Sp_chart_sMachine_speed`](../../auto-catalog/procedures/Sp_chart_sMachine_speed.md) — hardcoded UUID `e748835a-…`.
  184 +- [`Sp_interface_login_before`](../../auto-catalog/procedures/Sp_interface_login_before.md) — hardcoded K3 Cloud credentials.
  185 +- [`Sp_System_ReCostStructure`](../../auto-catalog/procedures/Sp_System_ReCostStructure.md), [`sp_update_pricecolumn`](../../auto-catalog/procedures/sp_update_pricecolumn.md), [`sp_int_dbSet`](../../auto-catalog/procedures/sp_int_dbSet.md) — hardcoded schema literals (`xlyweberp`, `xlyweberp_jn`, `xlyweberp_saas`).
  186 +
  187 +## Dead code and unimplemented stubs
  188 +
  189 +Procs that exist as empty bodies, single-statement placeholders, or developer
  190 +scratch never wired in. Safe to delete from a documentation/lint perspective;
  191 +verify no customer override calls them before doing so.
  192 +
  193 +- [`Empty`](../../auto-catalog/procedures/Empty.md) — literal empty body.
  194 +- [`ss`](../../auto-catalog/procedures/ss.md) — `SET sReturn = '1111';`.
  195 +- [`test`](../../auto-catalog/procedures/test.md), [`test_copy`](../../auto-catalog/procedures/test_copy.md) — scratch.
  196 +- [`11`](../../auto-catalog/procedures/11.md), [`sp_cs1`](../../auto-catalog/procedures/sp_cs1.md) — scratch fragments.
  197 +- [`Sp_Bill_Used_Base`](../../auto-catalog/procedures/Sp_Bill_Used_Base.md) — stub returning `p_bUsed=0` (customer-override slot).
  198 +- [`Sp_Cashier_GetProductPrice`](../../auto-catalog/procedures/Sp_Cashier_GetProductPrice.md) — body entirely commented out, returns `0`.
  199 +- [`Sp_chart_home_13`](../../auto-catalog/procedures/Sp_chart_home_13.md) — body commented out, returns NULL.
  200 +- [`Sp_Check_sCio`](../../auto-catalog/procedures/Sp_Check_sCio.md), [`_sScd`](../../auto-catalog/procedures/Sp_Check_sScd.md), [`_sSdp`](../../auto-catalog/procedures/Sp_Check_sSdp.md), [`_sSfu`](../../auto-catalog/procedures/Sp_Check_sSfu.md), [`_sStl`](../../auto-catalog/procedures/Sp_Check_sStl.md), [`_sWare`](../../auto-catalog/procedures/Sp_Check_sWare.md) — placeholder stubs.
  201 +- [`Sp_Manufacture_PlanStatusSet`](../../auto-catalog/procedures/Sp_Manufacture_PlanStatusSet.md) — 97-char placeholder.
  202 +- [`Sp_productionPlanInfo_BtnEventUnChange`](../../auto-catalog/procedures/Sp_productionPlanInfo_BtnEventUnChange.md) — `sCode=-1` then `LEAVE top` immediately; effectively disabled.
  203 +- [`Sp_productionPlanInfo_BtnEventExamineDate`](../../auto-catalog/procedures/Sp_productionPlanInfo_BtnEventExamineDate.md) — cursor body empty.
  204 +- [`Sp_QlyProcessTestJudge`](../../auto-catalog/procedures/Sp_QlyProcessTestJudge.md) — every UPDATE commented out.
  205 +- [`Sp_System_CheckSave`](../../auto-catalog/procedures/Sp_System_CheckSave.md) — approval-routing logic commented out.
  206 +- [`Sp_System_CheckSaveFlow`](../../auto-catalog/procedures/Sp_System_CheckSaveFlow.md) — effectively `SET sCode=1; SET sReturn=''` only.
  207 +- [`Sp_System_CheckSaveOee`](../../auto-catalog/procedures/Sp_System_CheckSaveOee.md) — gutted to a hardcoded error string.
  208 +- [`Sp_System_MonThendCheckOut`](../../auto-catalog/procedures/Sp_System_MonThendCheckOut.md) — body literally `BEGIN END`.
  209 +- [`Sp_WorkOrder_CheckUpdateNew`](../../auto-catalog/procedures/Sp_WorkOrder_CheckUpdateNew.md), [`Sp_workorderSave`](../../auto-catalog/procedures/Sp_workorderSave.md) — orphan rewrites.
  210 +- [`Sp_WorkWeekReport`](../../auto-catalog/procedures/Sp_WorkWeekReport.md) — returns input date range, no data.
  211 +
  212 +## Debug leakage left in production
  213 +
  214 +Stray `SELECT … FROM bbbbb;` or commented-out `-- select aa from bb;` left
  215 +inside routine bodies. Mostly harmless (the commented-out forms emit nothing,
  216 +the live forms emit a stray result-set caller may ignore) but a maintainer
  217 +cleanup target.
  218 +
  219 +- [`Sp_Add_Flow`](../../auto-catalog/procedures/Sp_Add_Flow.md) — stray `SELECT ddd FROM bbbb;`.
  220 +- [`Sp_Apply_Flow_MaterialsBack`](../../auto-catalog/procedures/Sp_Apply_Flow_MaterialsBack.md) — `select p_OneFlow;`.
  221 +- [`Sp_beforeSave_sMpa`](../../auto-catalog/procedures/Sp_beforeSave_sMpa.md) — stray `SELECT @sSqlStmt;`.
  222 +- [`sp_btn_action`](../../auto-catalog/procedures/sp_btn_action.md) — dead `SELECT … FROM bbbbb / asadasda / adsadaqqqqqqq`.
  223 +- [`Sp_BtnEvent_DeliverGoodsFinanceSlave`](../../auto-catalog/procedures/Sp_BtnEvent_DeliverGoodsFinanceSlave.md) — `select p_iSCount;`.
  224 +- [`Sp_chart_EquipmentLoad1`](../../auto-catalog/procedures/Sp_chart_EquipmentLoad1.md) — debug `SELECT p_sData, p_sDay, p_sMachines`.
  225 +- [`Sp_GetlogisticsPrice`](../../auto-catalog/procedures/SP_GetlogisticsPrice.md), [`sp_getoutsideprocess`](../../auto-catalog/procedures/sp_getoutsideprocess.md), [`Sp_afterSave_sLos`](../../auto-catalog/procedures/Sp_afterSave_sLos.md) — `-- select aa from bb;`.
  226 +- [`Sp_ProductionDepartmentsReports`](../../auto-catalog/procedures/Sp_ProductionDepartmentsReports.md) — spurious `select * from xlyweberp.sisprocessclassify;` leaks cross-schema reference.
  227 +- [`Sp_QlyProduct_BtnCalculate`](../../auto-catalog/procedures/Sp_QlyProduct_BtnCalculate.md) — `SELECT p_sId, p_sSlaveId;`.
  228 +- [`Sp_saleschanceToSop_BtnEventDistribution`](../../auto-catalog/procedures/Sp_saleschanceToSop_BtnEventDistribution.md) — `select p_changeValue, p_sBussinessType;`.
  229 +- [`Sp_Supply_refilecheck`](../../auto-catalog/procedures/Sp_Supply_refilecheck.md), [`_setLevel`](../../auto-catalog/procedures/Sp_Supply_setLevel.md), [`_reLevel`](../../auto-catalog/procedures/Sp_Supply_reLevel.md) — stray `SELECT @sSqlStmt;` surfaces assembled SQL in response.
  230 +- [`zAddField_Proc`](../../auto-catalog/procedures/zAddField_Proc.md) — `INSERT into aaa(bb) VALUES (sTableName);` fails if table `aaa` is absent.
  231 +
  232 +## Naming and structural inconsistencies
  233 +
  234 +- [`Sp_urisdiction`](../../auto-catalog/procedures/Sp_urisdiction.md) — missing leading `j` in "jurisdiction".
  235 +- [`Sp_chart_EquipmentLod1`](../../auto-catalog/procedures/Sp_chart_EquipmentLod1.md) — `Lod` typo (vs `Load`); duplicate of `Sp_chart_EquipmentLoad1`.
  236 +- [`Sp_Calc_sRetunWork`](../../auto-catalog/procedures/Sp_Calc_sRetunWork.md) — `sRetunWork` missing `r` in 返工 (should be `sReturnWork`).
  237 +- [`Sp_Calc_spurded`](../../auto-catalog/procedures/Sp_Calc_spurded.md) — lowercase outlier; should likely be `sPurDed`.
  238 +- [`Sp_Procedure_Templet`](../../auto-catalog/procedures/Sp_Procedure_Templet.md) — "Templet" for "Template".
  239 +- [`Sp_BtnEvent_LogAheadComfirm`](../../auto-catalog/procedures/Sp_BtnEvent_LogAheadComfirm.md), [`_LogisticsComfirm`](../../auto-catalog/procedures/Sp_BtnEvent_LogisticsComfirm.md), [`_mitOutComfirm`](../../auto-catalog/procedures/Sp_BtnEvent_mitOutComfirm.md), [`_OpsInstoreComfirm`](../../auto-catalog/procedures/Sp_BtnEvent_OpsInstoreComfirm.md) — "Comfirm" misspelling consistent across family.
  240 +- [`Sp_Sis_GetMertialsInventoryFormGuid`](../../auto-catalog/procedures/Sp_Sis_GetMertialsInventoryFormGuid.md) — "Mertials" typo; same name exists as both FUNCTION and PROCEDURE.
  241 +- [`sp_get_sOppositeColor`](../../auto-catalog/procedures/sp_get_sOppositeColor.md), [`sp_btn_action`](../../auto-catalog/procedures/sp_btn_action.md), [`sp_init_sVersionFlowId`](../../auto-catalog/procedures/sp_init_sVersionFlowId.md), [`sp_cursor_test`](../../auto-catalog/procedures/sp_cursor_test.md), and ~15 more — lowercase `sp_` prefix outliers vs. majority `Sp_*`.
  242 +
  243 +## Security-adjacent
  244 +
  245 +- [`sp_btn_action`](../../auto-catalog/procedures/sp_btn_action.md) — dynamic UPDATE concatenates JSON-decoded `p_sId` without `QUOTE()`-escaping; SQL injection surface if `sProInParam` isn't validated upstream.
  246 +- [`Sp_interface_login_before`](../../auto-catalog/procedures/Sp_interface_login_before.md) — K3 Cloud credentials hardcoded in proc body (`username='Administrator'`, `password='Hamah@2022'`). Multi-tenant deployments must replace.
  247 +- [`Sp_afterSave_sDgda`](../../auto-catalog/procedures/Sp_afterSave_sDgda.md) — raw PREPARE/EXECUTE dynamic SQL, splits on `;` with no escaping.
  248 +
  249 +---
  250 +
  251 +## Cross-cutting observations
  252 +
  253 +A few patterns worth noting that aren't per-routine flags:
  254 +
  255 +- **`封存` (sealed) markers are not deletion markers.** Many sealed routines still have live form-master or `gdsmodule` bindings. The convention in this codebase is "keep the body but mark intent"; if you act on a 封存 marker, also unbind the form.
  256 +- **Customer overrides live at `xly-src/script/客户/<customer>/`.** Several routines that look like simple stubs in the standard ship (e.g. `Sp_Bill_Used_Base`) have substantive bodies in customer-override packs. Don't delete a stub before checking `script/客户/`.
  257 +- **`_new`/`_NEW`/`_Bak`/`_Test`/date-suffixed variants** are a recurring pattern: a parallel rewrite never promoted to production, kept alongside the wired version. The auto-catalog's [Backup / snapshot variant template](../../auto-catalog/procedures/Sp_Calc_sDgd_20250612.md) covers the basic `_copy1`/`_bak` family; the `_new`/`_NEW` siblings live here.
  258 +- **Naming-by-convention dispatchers are invisible to static analysis.** `BusinessBaseServiceImpl.checkUpdate(..., "sSaveProName")` reads the proc name out of `gdsmodule` at runtime; `GenericProcedureCallServiceImpl.doGenericProcedureCall()` reads it from the front-end button action descriptor. The auto-catalog narratives capture these where the agents found them, but the snapshot used here doesn't include front-end button config rows — some routines flagged as orphan in this list may be live via a button binding we couldn't observe.
... ...
en/mkdocs.yml
... ... @@ -115,6 +115,7 @@ nav:
115 115 - "Metadata-management services (xlyManage)": reference/maintainer/management-services.md
116 116 - "BI / KPI / Charts engine": reference/maintainer/bi-engine.md
117 117 - "Activiti integration": reference/maintainer/activiti.md
  118 + - "Known issues in stored procedures and functions": reference/maintainer/known-issues-in-stored-procedures.md
118 119 - 5. API Reference:
119 120 - api-reference/index.md
120 121 - "Internal API (xlyEntry)": api-reference/internal.md
... ...