diff --git a/Logic/Financial/VatReports.cs b/Logic/Financial/VatReports.cs index 7926de22..25c0b8f9 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(3); // Make the report on the 4yh after the period has ended + DateTime nextReportGenerationTime = nextReport.AddMonths(reportMonthInterval).AddDays(0); // 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 521b958b..6e3a5a4c 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 diff --git a/Site/Pages/v5/Ledgers/Json-VatReportData.aspx.cs b/Site/Pages/v5/Ledgers/Json-VatReportData.aspx.cs index 0359f160..7112e349 100644 --- a/Site/Pages/v5/Ledgers/Json-VatReportData.aspx.cs +++ b/Site/Pages/v5/Ledgers/Json-VatReportData.aspx.cs @@ -5,6 +5,7 @@ using System.Text; using Swarmops.Common.Enums; using Swarmops.Database; using Swarmops.Logic.Financial; +using Swarmops.Logic.Support; namespace Swarmops.Frontend.Pages.v5.Ledgers { @@ -88,7 +89,7 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers include = true; } - if (transaction.Dependency != null) + if (transaction.Dependency != null || Documents.ForObject(transaction).Count > 0) { element += String.Format(",\"dox\":\"" + hasDoxString + "\"", transaction.Identity); diff --git a/Site/Pages/v5/Ledgers/ViewVatReports.aspx.cs b/Site/Pages/v5/Ledgers/ViewVatReports.aspx.cs index d692a1bc..6a3fd921 100644 --- a/Site/Pages/v5/Ledgers/ViewVatReports.aspx.cs +++ b/Site/Pages/v5/Ledgers/ViewVatReports.aspx.cs @@ -114,7 +114,8 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers { FinancialTransaction tx = item.Transaction; - Documents documents = Documents.ForObject(tx.Dependency); + Documents documents = Documents.ForObject(tx.Dependency ?? tx); // tx.Dependency if not null, else tx + foreach (Document doc in documents) { VatReportDocuments.Add(new RepeatedDocument