diff --git a/Logic/Financial/OrganizationFinancialAccounts.cs b/Logic/Financial/OrganizationFinancialAccounts.cs index 361860cd..a01a853e 100644 --- a/Logic/Financial/OrganizationFinancialAccounts.cs +++ b/Logic/Financial/OrganizationFinancialAccounts.cs @@ -29,6 +29,7 @@ namespace Activizr.Logic.Financial organizationAccounts[OrganizationFinancialAccountType.AssetsOutboundInvoices] = 28; organizationAccounts[OrganizationFinancialAccountType.DebtsCapital] = 96; organizationAccounts[OrganizationFinancialAccountType.AssetsPaypal] = 2; + organizationAccounts[OrganizationFinancialAccountType.CostsYearResult] = 97; } public OrganizationFinancialAccounts (int organizationId) @@ -120,6 +121,15 @@ namespace Activizr.Logic.Financial organizationAccounts[OrganizationFinancialAccountType.CostsLocalDonationTransfers]); } } + public FinancialAccount CostsYearResult + { + get + { + return + FinancialAccount.FromIdentity(organizationAccounts[OrganizationFinancialAccountType.CostsYearResult]); + } + } + public FinancialAccounts CostsConferences { get @@ -153,6 +163,7 @@ namespace Activizr.Logic.Financial CostsInfrastructure, CostsLocalDonationTransfers, CostsAllocatedFunds, - CostsConferences // multi-account type + CostsConferences, + CostsYearResult // multi-account type } } diff --git a/Site5/Images/PageIcons/iconshock-tester-16px.png b/Site5/Images/PageIcons/iconshock-tester-16px.png new file mode 100644 index 00000000..7c730f3f Binary files /dev/null and b/Site5/Images/PageIcons/iconshock-tester-16px.png differ diff --git a/Site5/Images/PageIcons/iconshock-tester-40px.png b/Site5/Images/PageIcons/iconshock-tester-40px.png new file mode 100644 index 00000000..5b260210 Binary files /dev/null and b/Site5/Images/PageIcons/iconshock-tester-40px.png differ diff --git a/Site5/Tests/LeanModal-Master.master b/Site5/Tests/LeanModal-Master.master deleted file mode 100644 index 3bbad8a6..00000000 --- a/Site5/Tests/LeanModal-Master.master +++ /dev/null @@ -1,47 +0,0 @@ -<%@ Master Language="C#" AutoEventWireup="true" CodeFile="LeanModal-Master.master.cs" Inherits="Tests_LeanModal_Master" %> - - - - - - - - - - - - - - Activizr - Pirate Edition - - - - - - - - - - - -
- - - - - - - - - - - - - - diff --git a/Site5/Tests/LeanModal-Master.master.cs b/Site5/Tests/LeanModal-Master.master.cs deleted file mode 100644 index 6cf4749d..00000000 --- a/Site5/Tests/LeanModal-Master.master.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; - -public partial class Tests_LeanModal_Master : System.Web.UI.MasterPage -{ - protected void Page_Load(object sender, EventArgs e) - { - - } -} diff --git a/Site5/Tests/LeanModal-NoMaster.aspx b/Site5/Tests/LeanModal-NoMaster.aspx deleted file mode 100644 index 9beaa566..00000000 --- a/Site5/Tests/LeanModal-NoMaster.aspx +++ /dev/null @@ -1,47 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeFile="LeanModal-NoMaster.aspx.cs" Inherits="Tests_LeanModal_NoMaster" %> - - - - - - - - - - - - - - -
-
- Test! -
-
- - - - - - diff --git a/Site5/Tests/LeanModal-NoMaster.aspx.cs b/Site5/Tests/LeanModal-NoMaster.aspx.cs deleted file mode 100644 index aa98400a..00000000 --- a/Site5/Tests/LeanModal-NoMaster.aspx.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; - -public partial class Tests_LeanModal_NoMaster : System.Web.UI.Page -{ - protected void Page_Load(object sender, EventArgs e) - { - - } -} \ No newline at end of file diff --git a/Site5/Tests/LeanModal.aspx b/Site5/Tests/LeanModal.aspx deleted file mode 100644 index e162c034..00000000 --- a/Site5/Tests/LeanModal.aspx +++ /dev/null @@ -1,34 +0,0 @@ -<%@ Page Title="" Language="C#" MasterPageFile="LeanModal-Master.master" AutoEventWireup="true" CodeFile="LeanModal.aspx.cs" Inherits="Tests_LeanModal" %> - - - - - - - - - - Test! - - - - - - - - diff --git a/Site5/Tests/LeanModal.aspx.cs b/Site5/Tests/LeanModal.aspx.cs deleted file mode 100644 index 670973e4..00000000 --- a/Site5/Tests/LeanModal.aspx.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; - -public partial class Tests_LeanModal : System.Web.UI.Page -{ - protected void Page_Load(object sender, EventArgs e) - { - - } -} \ No newline at end of file diff --git a/Site5/Tests/TestBookkeepingIntegrity.aspx b/Site5/Tests/TestBookkeepingIntegrity.aspx new file mode 100644 index 00000000..99a815c2 --- /dev/null +++ b/Site5/Tests/TestBookkeepingIntegrity.aspx @@ -0,0 +1,33 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Master-v5.master" AutoEventWireup="true" CodeFile="TestBookkeepingIntegrity.aspx.cs" Inherits="Tests_TestBookkeepingIntegrity" %> + + + + +
+ +
+
+  
 
+
+
+
+
+
+
+ +
+ +
+ +
+ +

INFO

+ +
+
+ This page is for diagnostic tests of the integrity of the Activizr system. It is not intended for everyday use and is not accessible from the menu. +
+
+ +
+ diff --git a/Site5/Tests/TestBookkeepingIntegrity.aspx.cs b/Site5/Tests/TestBookkeepingIntegrity.aspx.cs new file mode 100644 index 00000000..53585873 --- /dev/null +++ b/Site5/Tests/TestBookkeepingIntegrity.aspx.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Activizr.Basic.Enums; +using Activizr.Logic.Financial; + +public partial class Tests_TestBookkeepingIntegrity : PageV5Base +{ + protected void Page_Load(object sender, EventArgs e) + { + this.PageTitle = "Test Bookkeeping Integrity"; + this.PageIcon = "iconshock-tester"; + + if (!Page.IsPostBack) + { + this.DropYear.Items.Add(new ListItem("--Select--", "0")); + this.DropYear.Items.Add(new ListItem("2008", "2008")); + this.DropYear.Items.Add(new ListItem("2009", "2009")); + this.DropYear.Items.Add(new ListItem("2010", "2010")); + this.DropYear.Items.Add(new ListItem("2011", "2011")); + } + + this.LabelThisOrganization.Text = _currentOrganization.Name; + } + + protected void DropYear_SelectedIndexChanged(object sender, EventArgs e) + { + int year = Int32.Parse(this.DropYear.SelectedValue); + + if (year < 2000) return; + + FinancialAccounts balanceAccounts = FinancialAccounts.ForOrganization(_currentOrganization, + FinancialAccountType.Balance); + + FinancialAccounts resultAccounts = FinancialAccounts.ForOrganization(_currentOrganization, + FinancialAccountType.Result); + + FinancialAccount ownCapital = _currentOrganization.FinancialAccounts.DebtsCapital; + FinancialAccount resultAsNoted = _currentOrganization.FinancialAccounts.CostsYearResult; + + FinancialAccounts balancesWithoutCapital = + FinancialAccounts.ForOrganization(_currentOrganization, FinancialAccountType.Balance); + balancesWithoutCapital.Remove(ownCapital); + + FinancialAccounts resultAccountsWithoutNotedResult = FinancialAccounts.ForOrganization(_currentOrganization, + FinancialAccountType.Result); + resultAccountsWithoutNotedResult.Remove(_currentOrganization.FinancialAccounts.CostsYearResult); + + Currency currency = _currentOrganization.DefaultCountry.Currency; + + this.LabelResultsAll.Text = String.Format("{0} {1:N2}", currency.Code, + resultAccounts.GetDeltaCents(new DateTime(year, 1, 1), + new DateTime(year + 1, 1, 1)) / 100.0); + + this.LabelResultsNoted.Text = String.Format("{0} {1:N2}", currency.Code, + resultAsNoted.GetDeltaCents(new DateTime(year, 1, 1), + new DateTime(year + 1, 1, 1))/100.0); + + this.LabelEoyBalance.Text = String.Format("{0} {1:N2}", currency.Code, + balanceAccounts.GetDeltaCents(new DateTime(1900, 1, 1), + new DateTime(year + 1, 1, 1)) / 100.0); + + Int64 endOfLastYearCapital = ownCapital.GetDeltaCents(new DateTime(1900, 1, 1), + new DateTime(year, 1, 1)); + + Int64 endOfSelectedYearCapital = ownCapital.GetDeltaCents(new DateTime(1900, 1, 1), + new DateTime(year + 1, 1, 1)); + + this.LabelEolyOwnCapital.Text = String.Format("{0} {1:N2}", currency.Code, endOfLastYearCapital / 100.0); + + this.LabelEocyOwnCapital.Text = String.Format("{0} {1:N2}", currency.Code, + endOfSelectedYearCapital / 100.0); + + this.LabelOwnCapitalDiff.Text = String.Format("{0} {1:N2}", currency.Code, + (endOfSelectedYearCapital - endOfLastYearCapital) / 100.0); + + this.LabelOwnCapitalDelta.Text = String.Format("{0} {1:N2}", currency.Code, + ownCapital.GetDeltaCents(new DateTime(year, 1, 1), + new DateTime(year + 1, 1, 1)) / 100.0); + + } +} \ No newline at end of file