From 07086034bebb9cd31a1b22c7923265f92920aba3 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 17 Jul 2026 15:35:03 +0800 Subject: [PATCH] =?UTF-8?q?perf(accounting):=20remove=20summary=20from=20b?= =?UTF-8?q?illing,=20fix=20acc=5Fdir=200=3D=E5=80=9F/1=3D=E8=B4=B7,=20add?= =?UTF-8?q?=20DB=20index?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/billing.dspy | 8 ++++---- wwwroot/billing.ui | 12 +----------- wwwroot/billing_download.dspy | 2 +- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/wwwroot/billing.dspy b/wwwroot/billing.dspy index 88df67b..2e3b78b 100644 --- a/wwwroot/billing.dspy +++ b/wwwroot/billing.dspy @@ -18,12 +18,12 @@ ns = { } async with get_sor_context(request._run_ns, 'accounting') as sor: - sql = """select d.acc_date, d.acc_timestamp, d.acc_dir, -concat('#', substring_index(d.summary, ':', 1)) as summary, + sql = """select d.acc_date, d.acc_timestamp, +case when d.acc_dir = '0' then '借' else '贷' end as acc_dir, d.amount, d.balance, s.name as subject_name, count(*) over() as _total, -coalesce(sum(case when d.acc_dir = '1' then d.amount else 0 end) over(), 0) as _debit, -coalesce(sum(case when d.acc_dir = '0' then d.amount else 0 end) over(), 0) as _credit +coalesce(sum(case when d.acc_dir = '0' then d.amount else 0 end) over(), 0) as _debit, +coalesce(sum(case when d.acc_dir = '1' then d.amount else 0 end) over(), 0) as _credit from acc_detail d join account a on d.accountid = a.id COLLATE utf8mb4_unicode_ci left join subject s on a.subjectid = s.id COLLATE utf8mb4_unicode_ci diff --git a/wwwroot/billing.ui b/wwwroot/billing.ui index 331c13e..7c2c1e4 100644 --- a/wwwroot/billing.ui +++ b/wwwroot/billing.ui @@ -128,17 +128,7 @@ "uitype": "str", "datatype": "str", "label": "方向", - "cwidth": 8 - }, - { - "name": "summary", - "title": "摘要", - "type": "str", - "length": 100, - "uitype": "str", - "datatype": "str", - "label": "摘要", - "cwidth": 30 + "cwidth": 6 }, { "name": "amount", diff --git a/wwwroot/billing_download.dspy b/wwwroot/billing_download.dspy index b509921..95a6bd9 100644 --- a/wwwroot/billing_download.dspy +++ b/wwwroot/billing_download.dspy @@ -46,7 +46,7 @@ order by d.acc_date desc""" # 数据 for rec in recs: - direction = '借' if rec.acc_dir == '1' else '贷' + direction = '借' if rec.acc_dir == '0' else '贷' ws.append([ str(rec.acc_date), str(rec.acc_timestamp),