From 7bf2f6d13def8466ca6159e07ad8aed433005c3f Mon Sep 17 00:00:00 2001 From: Michael Volo Date: Mon, 21 Oct 2024 15:33:05 -0500 Subject: [PATCH] fix base_year calculation --- salesforce/management/commands/update_opportunities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salesforce/management/commands/update_opportunities.py b/salesforce/management/commands/update_opportunities.py index 016a5a9e..ceb8f678 100644 --- a/salesforce/management/commands/update_opportunities.py +++ b/salesforce/management/commands/update_opportunities.py @@ -12,7 +12,7 @@ def handle(self, *args, **options): now = datetime.datetime.now() base_year = now.year - if now.month >= 7: # Salesforce needs the school base year, this is how they calculate it + if now.month < 7: # if it's before July, the base year is the previous year (4/1/2024 = base_year 2023) base_year -= 1 # truncate the table