Commit db0d81f9 authored by Mahmoud Aglan's avatar Mahmoud Aglan

Fix: show current-month renewals in collect payment wizard

The wizard only generated renewal invoices when next_billing_date had
already passed. Now it generates them for any billing date within the
current month, so participants can renew as soon as the month starts
rather than waiting for the exact billing day.
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 69783682
......@@ -188,7 +188,7 @@ private function generatePendingRenewals(): void
$enrollments = Enrollment::where('participant_id', $this->selected_participant_id)
->where('status', EnrollmentStatus::Active)
->whereNotNull('next_billing_date')
->where('next_billing_date', '<=', now()->toDateString())
->where('next_billing_date', '<=', now()->endOfMonth()->toDateString())
->whereHas('program', function ($q) {
$q->whereIn('renewal_policy', [
RenewalPolicy::AutoRenew->value,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment