diff --git a/Logic/Financial/VatReport.cs b/Logic/Financial/VatReport.cs index e955b1ad..5f2973b7 100644 --- a/Logic/Financial/VatReport.cs +++ b/Logic/Financial/VatReport.cs @@ -245,8 +245,9 @@ namespace Swarmops.Logic.Financial { // Check if this row _closes_ an _existing_ VAT report, in which case it should _not_ be included - int vatReportId = dbRead.GetVatReportIdFromCloseTransaction(row.FinancialTransactionId); - if (vatReportId == 0) + int vatReportOpenId = dbRead.GetVatReportIdFromCloseTransaction(row.FinancialTransactionId); + int vatReportCloseId = dbRead.GetVatReportIdFromOpenTransaction(row.FinancialTransactionId); + if (vatReportOpenId == 0 && vatReportCloseId == 0) { // This particular transaction doesn't close an existing VAT report rowsFinal.Add(row); diff --git a/Logic/Financial/VatReports.cs b/Logic/Financial/VatReports.cs index 35ff3eb6..7926de22 100644 --- a/Logic/Financial/VatReports.cs +++ b/Logic/Financial/VatReports.cs @@ -48,7 +48,7 @@ namespace Swarmops.Logic.Financial 1); DateTime nextReport = lastReport.AddMonths(reportMonthInterval); - DateTime nextReportGenerationTime = nextReport.AddMonths(reportMonthInterval).AddDays(4); // Make the report on the 4th after the period has ended + DateTime nextReportGenerationTime = nextReport.AddMonths(reportMonthInterval).AddDays(3); // Make the report on the 4yh after the period has ended if (nowUtc > nextReportGenerationTime) { // Create a new report diff --git a/Site/Master-v5.master.cs b/Site/Master-v5.master.cs index 3e655eab..d3fda71f 100644 --- a/Site/Master-v5.master.cs +++ b/Site/Master-v5.master.cs @@ -39,7 +39,7 @@ namespace Swarmops.Frontend // BEGIN TEST CODE - // ExchangeRateSnapshot.Create(); + // VatReports.CreateNewReports(); // END TEST CODE