diff --git a/wwwroot/billing.dspy b/wwwroot/billing.dspy index 72d25f3..0d6cfea 100644 --- a/wwwroot/billing.dspy +++ b/wwwroot/billing.dspy @@ -32,7 +32,8 @@ where a.orgid = ${orgid}$ stats_sql = """select count(*) as total_count, coalesce(sum(case when d.acc_dir = '1' then d.amount else 0 end), 0) as debit_sum, - coalesce(sum(case when d.acc_dir = '0' then d.amount else 0 end), 0) as credit_sum + coalesce(sum(case when d.acc_dir = '0' then d.amount else 0 end), 0) as credit_sum, + min(d.acc_date) as acc_date from acc_detail d join account a on d.accountid = a.id COLLATE utf8mb4_unicode_ci where a.orgid = ${orgid}$