Work on VAT reports

This commit is contained in:
Rick Falkvinge
2017-10-09 13:43:40 +02:00
parent 37606a0f9f
commit cf83c24135
3 changed files with 16 additions and 9 deletions
+2 -2
View File
@@ -206,8 +206,8 @@ namespace Swarmops.Logic.Financial
// Create a corresponding financial transaction with rows
FinancialTransaction transaction =
FinancialTransaction.Create (organization.Identity, DateTime.Now,
"Invoice #" + newInvoice.Identity + " from " + supplier);
FinancialTransaction.Create (organization.Identity, DateTime.UtcNow,
"Invoice #" + newInvoice.OrganizationSequenceId + " from " + supplier);
transaction.AddRow (organization.FinancialAccounts.DebtsInboundInvoices, -amountCents, creatingPerson);
if (vatCents > 0)
+13 -6
View File
@@ -91,12 +91,19 @@ namespace Swarmops.Logic.Financial
{
// if there's anything to report
FinancialTransaction vatReportTransaction = FinancialTransaction.Create(organization, DateTime.UtcNow,
FinancialTransaction vatReportTransaction = FinancialTransaction.Create(organization, endDate.AddDays(4).AddHours(9),
transactionComment);
vatReportTransaction.AddRow(organization.FinancialAccounts.AssetsVatInboundUnreported,
-newReport.VatInboundCents, null);
vatReportTransaction.AddRow(organization.FinancialAccounts.DebtsVatOutboundUnreported,
newReport.VatOutboundCents, null); // not negative, because our number is sign-different from the bookkeeping's
if (newReport.VatInboundCents > 0)
{
vatReportTransaction.AddRow(organization.FinancialAccounts.AssetsVatInboundUnreported,
-newReport.VatInboundCents, null);
}
if (newReport.VatOutboundCents > 0)
{
vatReportTransaction.AddRow(organization.FinancialAccounts.DebtsVatOutboundUnreported,
newReport.VatOutboundCents, null);
// not negative, because our number is sign-different from the bookkeeping's
}
if (differenceCents < 0) // outbound > inbound
{
@@ -163,7 +170,7 @@ namespace Swarmops.Logic.Financial
}
else if (turnoverAccountLookup.ContainsKey(txRow.FinancialAccountId))
{
turnOver += txRow.AmountCents;
turnOver -= txRow.AmountCents; // turnover accounts are sign reversed, so convert to positive
}
}
+1 -1
View File
@@ -39,7 +39,7 @@ namespace Swarmops.Frontend
// BEGIN TEST CODE
//VatReports.CreateNewReports();
// VatReports.CreateNewReports();
// END TEST CODE