From 5e4ea78f13dc540c86c3ae6a7bbb45a46ddcc581 Mon Sep 17 00:00:00 2001 From: Uddeshya Singh Date: Sun, 18 Aug 2019 11:16:50 +0530 Subject: [PATCH] feat: update event invoice follow ups --- app/__init__.py | 2 +- app/api/helpers/scheduled_jobs.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index 814827f43f..54b2828573 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -247,7 +247,7 @@ def update_sent_state(sender=None, headers=None, **kwargs): scheduler.add_job(send_after_event_mail, 'cron', hour=5, minute=30) scheduler.add_job(send_event_fee_notification, 'cron', day=1) -scheduler.add_job(send_event_fee_notification_followup, 'cron', day=15) +scheduler.add_job(send_event_fee_notification_followup, 'cron', day=1, month='1-12') scheduler.add_job(change_session_state_on_event_completion, 'cron', hour=5, minute=30) scheduler.add_job(expire_pending_tickets, 'cron', minute=45) scheduler.add_job(send_monthly_event_invoice, 'cron', day=1, month='1-12') diff --git a/app/api/helpers/scheduled_jobs.py b/app/api/helpers/scheduled_jobs.py index a8c04e0cff..4c1dfa1628 100644 --- a/app/api/helpers/scheduled_jobs.py +++ b/app/api/helpers/scheduled_jobs.py @@ -128,14 +128,14 @@ def send_event_fee_notification(): def send_event_fee_notification_followup(): from app import current_app as app with app.app_context(): - incomplete_invoices = EventInvoice.query.filter(EventInvoice.status != 'completed').all() + incomplete_invoices = EventInvoice.query.filter(EventInvoice.status != 'paid').all() for incomplete_invoice in incomplete_invoices: if incomplete_invoice.amount > 0: prev_month = monthdelta(incomplete_invoice.created_at, 1).strftime( "%b %Y") # Displayed as Aug 2016 app_name = get_settings()['app_name'] frontend_url = get_settings()['frontend_url'] - link = '{}/invoices/{}'.format(frontend_url, + link = '{}/event-invoice/{}/review'.format(frontend_url, incomplete_invoice.identifier) send_followup_email_for_monthly_fee_payment(incomplete_invoice.user.email, incomplete_invoice.event.name,