Sp_Sales_SalesAnalysiseOfCustomer1old001 (procedure)
客户销售分析表
- Type: PROCEDURE
- Deterministic: NO
- SQL data access: CONTAINS SQL
Parameters
| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | tStartDate |
datetime |
| 2 | IN | tEndDate |
datetime |
| 3 | IN | sBrId |
varchar(100) |
| 4 | IN | sSuId |
varchar(100) |
| 5 | IN | sLoginId |
varchar(100) |
| 6 | IN | bFilter |
varchar(5000) |
| 7 | IN | pageNum |
int |
| 8 | IN | pageSize |
int |
| 9 | OUT | totalCount |
int |
| 10 | IN | countCloumn |
varchar(5000) |
| 11 | OUT | countMapJson |
longtext |
| 12 | IN | sFilterOrderBy |
varchar(5000) |
| 13 | IN | sGroupby_select_sql |
varchar(5000) |
| 14 | IN | sGroupby_group_sql |
varchar(5000) |
Body
Body is not pre-cached. To inspect: mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURESpSales_SalesAnalysiseOfCustomer1old001'._
Narrative
Business context: Predecessor of Sp_Sales_SalesAnalysiseOfCustomer (the 1old001 suffix marks it as an archived earlier revision). Same 客户销售分析表 intent — paged ordered / instored / delivered / reconciled / invoiced / collected money pivoted by 客户 — but works in tax-inclusive dProductMoney only (no dProductNoTaxMoney columns, no max/min price tracking, no sSrcCustomerName rollup, no order-line count column for tempInStore).
What it does: Seeds SAS from eleCustomer, then progressively UPDATE ... JOINs ordered totals from viw_salSalesOrder (seven sFormId whitelist), collected money from cahreceiptmaster, instored money from viw_pitproductinstore + viw_opsoutsideinstore (excluding 余数库 and 备品), delivered money from Viw_SalDeliverGoods minus Viw_SalRejectGoods, reconciled from viw_salsaleschecking, invoiced from SalSalesInvoiceMaster. Computes averages, 占比 and the "not yet…" delta columns (dNoInstoreMoney/dNoDeliverMoney/dNoCheckMoney/dNoInvoiceMoney), then pages via Sp_Do_UpdateByPageSizeBefore.
Invocation: Status: appears orphaned. No gdsconfigformmaster.sSqlStr / sConfigSqlStr / sSqlCondition binding, no gdsmodule hook, no caller in other routines, no xly-src reference outside the install scripts. The current production form (gfm.sId=101251240115015848397842351) points at Sp_Sales_SalesAnalysiseOfCustomer (no-tax-money variant) instead. Candidate for maintainer audit / removal.