From 91609f3606d0c89e43fdf9ceb5d4e8db172f43c1 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 17 Jul 2026 14:39:52 +0800 Subject: [PATCH] fix(accounting): billing query uses LEFT JOIN subject to avoid dropping rows with missing subject --- wwwroot/billing.dspy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wwwroot/billing.dspy b/wwwroot/billing.dspy index 89df46c..d9f426a 100644 --- a/wwwroot/billing.dspy +++ b/wwwroot/billing.dspy @@ -22,7 +22,7 @@ async with get_sor_context(request._run_ns, 'accounting') as sor: d.amount, d.balance, s.name as subject_name from acc_detail d join account a on d.accountid = a.id COLLATE utf8mb4_unicode_ci -join subject s on a.subjectid = s.id COLLATE utf8mb4_unicode_ci +left join subject s on a.subjectid = s.id COLLATE utf8mb4_unicode_ci where a.orgid = ${orgid}$ and d.acc_date >= ${start_date}$ and d.acc_date <= ${end_date}$"""