Fixes for direct-debit purchases on VAT reports
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user