From e1f58b00c11bb1f2204c24f51f3f4c36e732ebb1 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Sat, 16 Feb 2019 07:10:57 +0100 Subject: [PATCH] Fix for VAT report due detection --- Logic/Financial/VatReport.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Logic/Financial/VatReport.cs b/Logic/Financial/VatReport.cs index b5264499..8ddc6141 100644 --- a/Logic/Financial/VatReport.cs +++ b/Logic/Financial/VatReport.cs @@ -132,6 +132,13 @@ namespace Swarmops.Logic.Financial return ReportRequirement.Required; } + // If the next report was due earlier this year, it's definitely required + + if (nextReportDue.Year == nowUtc.Year && nextReportDue.Month < nowUtc.Month) + { + return ReportRequirement.Required; // if there was a "VeryRequired" option it would be appropriate here + } + // Otherwise not required return ReportRequirement.NotRequired;