Sp_Cost_OrderCostAnalysis (procedure)
订单成本分析
- Type: PROCEDURE
- Deterministic: NO
- SQL data access: CONTAINS SQL
Parameters
| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | sProInParam |
varchar(10000) |
| 2 | IN | sMakePerson |
varchar(100) |
| 3 | IN | sBrId |
varchar(100) |
| 4 | IN | sSuId |
varchar(100) |
| 5 | OUT | sReturn |
varchar(1000) |
| 6 | OUT | sCode |
int |
Body
Body is not pre-cached. To inspect: mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURESpCost_OrderCostAnalysis'._
Narrative
Business context: 成本管理 → 订单成本分析 — order-level cost-analysis report builder. Aggregates a chosen period's product money totals and the cost-centre × expense-item matrix into a single dynamic SQL that feeds the 订单成本分析 dataset, including the prior-period snapshot when the current period is frozen.
What it does: Reads the period sId out of sProInParam, resolves tStartDate/tEndDate/bFrozen from sysaccountperiod, accumulates the comma-joined cost-centre list and expense-item list, sums product money across the period, then assembles p_sSql/p_sSumSql/p_sSumSqlBl*/p_sSetSql dynamic SQL fragments that pivot expense rows into columns and write totals back into the order-cost-analysis tables. Uses Sp_Sis_GetConst-sourced material memos when materials cost cannot be confirmed.
Invocation: Status: appears orphaned. No gdsmodule hook, gdsconfigformmaster reference, or other-routine caller; xly-src only ships the install script script/标版/30100101/cost/Sp_Cost_OrderCostAnalysis.sql. Naming and signature match the sp_btn_action* dispatcher contract — likely intended as the "刷新/重算" button handler for the 订单成本分析 screen but the binding row is absent. Candidate for maintainer audit.