Some fixes to VAT report generation

This commit is contained in:
Rick Falkvinge
2017-12-02 13:03:13 +01:00
parent a13d8222c7
commit b07d4ab77b
3 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -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);
+1 -1
View File
@@ -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
+1 -1
View File
@@ -39,7 +39,7 @@ namespace Swarmops.Frontend
// BEGIN TEST CODE
// ExchangeRateSnapshot.Create();
// VatReports.CreateNewReports();
// END TEST CODE