Some fixes to VAT report generation
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace Swarmops.Frontend
|
||||
|
||||
// BEGIN TEST CODE
|
||||
|
||||
// ExchangeRateSnapshot.Create();
|
||||
// VatReports.CreateNewReports();
|
||||
|
||||
// END TEST CODE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user