Fixes for direct-debit purchases on VAT reports

This commit is contained in:
Rick Falkvinge
2018-01-01 17:06:30 +01:00
parent 3aabbd7844
commit e3b20d95df
4 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -39,7 +39,7 @@ namespace Swarmops.Frontend
// BEGIN TEST CODE
// ExchangeRateSnapshot.Create();
// VatReports.CreateNewReports();
// END TEST CODE
@@ -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);
+2 -1
View File
@@ -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