Implement advance payment schedule for quarterly payments
BREAKING CHANGE: Payment due dates now follow advance payment schedule: - Q1 payments: Due December 15 of previous year - Q2 payments: Due March 15 of same year - Q3 payments: Due June 15 of same year - Q4 payments: Due September 15 of same year Changes: - Updated create_quarterly_support_payment() to use advance schedule - Enhanced diagnostic commands to check advance payment dates - Added fix_advance_payment_dates command for comprehensive fixes - Updated fix_q4_payment_dates to correct Q4 from 31.12 to 15.09 This aligns with semester-based document submissions while maintaining the advance payment system where payments are made before each quarter.
This commit is contained in:
@@ -20,7 +20,7 @@ class Command(BaseCommand):
|
||||
if dry_run:
|
||||
self.stdout.write(self.style.WARNING('DRY RUN MODE - No changes will be made'))
|
||||
|
||||
# Find all Q4/2025 payments with wrong due date (Dec 31 instead of Dec 15)
|
||||
# Find all Q4/2025 payments with wrong due date (Dec 31 instead of Sep 15)
|
||||
wrong_payments = DestinataerUnterstuetzung.objects.filter(
|
||||
faellig_am='2025-12-31',
|
||||
beschreibung__icontains='Q4/2025'
|
||||
@@ -34,7 +34,7 @@ class Command(BaseCommand):
|
||||
return
|
||||
|
||||
updated_count = 0
|
||||
correct_date = date(2025, 12, 15) # December 15, 2025
|
||||
correct_date = date(2025, 9, 15) # September 15, 2025 (advance payment for Q4)
|
||||
|
||||
with transaction.atomic():
|
||||
for payment in wrong_payments:
|
||||
@@ -57,13 +57,13 @@ class Command(BaseCommand):
|
||||
if dry_run:
|
||||
self.stdout.write(
|
||||
self.style.SUCCESS(
|
||||
f'DRY RUN: Would update {updated_count} payment due dates from 31.12.2025 to 15.12.2025'
|
||||
f'DRY RUN: Would update {updated_count} payment due dates from 31.12.2025 to 15.09.2025'
|
||||
)
|
||||
)
|
||||
else:
|
||||
self.stdout.write(
|
||||
self.style.SUCCESS(
|
||||
f'Successfully updated {updated_count} payment due dates to December 15, 2025'
|
||||
f'Successfully updated {updated_count} payment due dates to September 15, 2025'
|
||||
)
|
||||
)
|
||||
|
||||
@@ -86,8 +86,8 @@ class Command(BaseCommand):
|
||||
self.stdout.write(f' ⚠️ {quarter_desc}: {old_date_payments} payments still use old date {old_expected}')
|
||||
self.stdout.write(f' Should be: {new_expected}')
|
||||
|
||||
self.stdout.write('\nSemester-based payment schedule:')
|
||||
self.stdout.write(' Q1: March 15 (Spring semester)')
|
||||
self.stdout.write(' Q2: June 15 (Auto-approved with Q1)')
|
||||
self.stdout.write(' Q3: September 15 (Fall semester)')
|
||||
self.stdout.write(' Q4: December 15 (Auto-approved with Q3)')
|
||||
self.stdout.write('\nAdvance payment schedule (payments made in advance):')
|
||||
self.stdout.write(' Q1 payments: Due December 15 of previous year')
|
||||
self.stdout.write(' Q2 payments: Due March 15 of same year')
|
||||
self.stdout.write(' Q3 payments: Due June 15 of same year')
|
||||
self.stdout.write(' Q4 payments: Due September 15 of same year')
|
||||
Reference in New Issue
Block a user