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),