From 7ee67ff5377bb5a858d4ea1facd123ce312ee80c Mon Sep 17 00:00:00 2001 From: DevSoftTech Server Date: Sun, 22 Mar 2026 04:07:16 +0530 Subject: [PATCH] Fix collection total query for ONLY_FULL_GROUP_BY --- app/Controllers/Report.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Controllers/Report.php b/app/Controllers/Report.php index bf70775..307231b 100644 --- a/app/Controllers/Report.php +++ b/app/Controllers/Report.php @@ -154,7 +154,7 @@ class Report extends BaseController $builder = $this->db->table('payment_history p'); $builder->select('p.update_by_id as user_id') - ->select('COALESCE(u.username, p.update_by) as user_name', false) + ->select('COALESCE(u.username, MAX(p.update_by)) as user_name', false) ->select('SUM(CASE WHEN p.credit_debit = 0 AND p.payof_type = 1 THEN p.amount ELSE 0 END) as opd_amount', false) ->select('SUM(CASE WHEN p.credit_debit = 0 AND p.payof_type = 2 THEN p.amount ELSE 0 END) as charge_amount', false) ->select('SUM(CASE WHEN p.credit_debit = 0 AND p.payof_type = 4 THEN p.amount ELSE 0 END) as ipd_amount', false)