From 0ed08c36a4eb86c0a555f7ffce6c0dc3ac3d01c3 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Tue, 14 Nov 2017 23:02:24 +0100 Subject: [PATCH] Ajax Dropdown seems functional; added VAT Frequency --- Common/Enums/ObjectOptionalDataType.cs | 1 + Logic/Financial/VatReports.cs | 2 +- Logic/Structure/Organization.cs | 17 ++++++ Site/Controls/v5/Base/DropDown.ascx | 70 +++++++++++++++++++++++-- Site/Pages/v5/Admin/OrgSettings.aspx | 2 - Site/Pages/v5/Admin/OrgSettings.aspx.cs | 9 +++- 6 files changed, 94 insertions(+), 7 deletions(-) diff --git a/Common/Enums/ObjectOptionalDataType.cs b/Common/Enums/ObjectOptionalDataType.cs index 29747628..4e204892 100644 --- a/Common/Enums/ObjectOptionalDataType.cs +++ b/Common/Enums/ObjectOptionalDataType.cs @@ -200,6 +200,7 @@ namespace Swarmops.Common.Enums /// True if the organization declares inbound/outbound Value Added Tax /// OrgValueAddedTaxEnabled, + OrgValueAddedTaxFrequency, OrgFinancialMailName, OrgFinancialMailAddress, diff --git a/Logic/Financial/VatReports.cs b/Logic/Financial/VatReports.cs index bfcd56af..35ff3eb6 100644 --- a/Logic/Financial/VatReports.cs +++ b/Logic/Financial/VatReports.cs @@ -24,7 +24,7 @@ namespace Swarmops.Logic.Financial // foreach organization, if organization is VAT enabled Organization organization = Organization.FromIdentity(8); // HACK TEMPORARY HACK - int reportMonthInterval = 1; // TODO: READ FROM ORG PARAMETERS + int reportMonthInterval = organization.VatReportFrequencyMonths; // Get the list of previous VAT reports diff --git a/Logic/Structure/Organization.cs b/Logic/Structure/Organization.cs index 4a994340..004b571b 100644 --- a/Logic/Structure/Organization.cs +++ b/Logic/Structure/Organization.cs @@ -1091,6 +1091,23 @@ namespace Swarmops.Logic.Structure } } + public int VatReportFrequencyMonths + { + get + { + int frequency = OptionalData.GetOptionalDataInt(ObjectOptionalDataType.OrgValueAddedTaxFrequency); + if (frequency == 0) + { + return 12; // default to annual (the frequency is in months) + } + return frequency; + } + set + { + OptionalData.SetOptionalDataInt(ObjectOptionalDataType.OrgValueAddedTaxFrequency, value); + } + } + public Document LogoLandscape { get diff --git a/Site/Controls/v5/Base/DropDown.ascx b/Site/Controls/v5/Base/DropDown.ascx index 077499c4..c54f7e81 100644 --- a/Site/Controls/v5/Base/DropDown.ascx +++ b/Site/Controls/v5/Base/DropDown.ascx @@ -2,6 +2,7 @@ <%@ Import Namespace="System.Threading" %> <%@ Import Namespace="Swarmops.Common.Enums" %> +