Sp_Cashier_SumJournal.md 2.15 KB

Sp_Cashier_SumJournal (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 PROCEDURESpCashier_SumJournal'._

Narrative

Business context: 财务管理 → 出纳 → 日记账查询 — one-row-per-account journal summary across every bank settlement plus the special cash bucket. Gives cashiers a single-screen view of opening balance, period in/out, and closing balance for the chosen date window.

What it does: Reads SysAccountPeriod.tCashierDate as the cashier cutoff (leaves the result empty if unset). Seeds a temp Cash table with one row per non-invalid sisbank entry (linked to form 15782950790001381104094341598500 银行日记账) plus the synthetic cash row (linked to form 15782952160006452847376994410000 现金日记账). Joins CahWasteBook grouped by IF(sSettlementId='cash','cash',sBankId) to fill dInMoney/dOutMoney for the window, layers in CahCashierInit.dMoney as opening balance, then adds the prior-period in/out delta. Renames the cash row label to "现金" and computes dBalanceMoney = dInitMoney + dInMoney - dOutMoney. Pages via Sp_Do_UpdateByPageSizeBefore and selects.

Invocation: Bound as the data-source of the 日记账查询 form (sId 19211681019715708481355840, 财务管理 → 出纳) via gdsconfigformmaster.sSqlStr. Also re-used by Sp_Task_TodayMoneySmallai for the AI assistant's daily cash-position briefing.