From 14406536f5d61684605a66bfc0ec7b2c45171e07 Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 7 Aug 2026 04:48:28 +0000 Subject: [PATCH] Modified by www.SourceFiles.app --- supabase/migrations/20260807000600_invoicing.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/supabase/migrations/20260807000600_invoicing.sql b/supabase/migrations/20260807000600_invoicing.sql index 7a704bf..45af6e5 100644 --- a/supabase/migrations/20260807000600_invoicing.sql +++ b/supabase/migrations/20260807000600_invoicing.sql @@ -423,10 +423,10 @@ BEGIN -- Step 5: scholarship funding, as a negative line. FOR sch IN - SELECT * FROM public.scholarships - WHERE student_id = _student AND status = 'active' - AND funding_period_start <= _to - AND (funding_period_end IS NULL OR funding_period_end >= _from) + SELECT s2.* FROM public.scholarships s2 + WHERE s2.student_id = _student AND s2.status = 'active' + AND s2.funding_period_start <= _to + AND (s2.funding_period_end IS NULL OR s2.funding_period_end >= _from) LOOP qty := CASE sch.frequency WHEN 'per_week' THEN period_weeks