Committing bookkeeping integrity checks
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 913 B |
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
@@ -1,47 +0,0 @@
|
||||
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="LeanModal-Master.master.cs" Inherits="Tests_LeanModal_Master" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head id="Head1" runat="server">
|
||||
<!-- jQuery and plugins -->
|
||||
<script language="javascript" type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" ></script>
|
||||
<script language="javascript" type="text/javascript" src="/Scripts/jquery.leanModal.min.js" ></script>
|
||||
<!-- fonts -->
|
||||
<link href='https://fonts.googleapis.com/css?family=Permanent+Marker' rel='stylesheet' type='text/css' />
|
||||
<link href='https://fonts.googleapis.com/css?family=Ubuntu:light,regular,500,bold' rel='stylesheet' type='text/css' />
|
||||
<link href='https://fonts.googleapis.com/css?family=Arimo:regular,italic,bold,bolditalic' rel='stylesheet' type='text/css' />
|
||||
<!-- page title -->
|
||||
<title>Activizr - Pirate Edition</title>
|
||||
<!-- telerik style sheet manager, followed by style sheet -->
|
||||
<telerik:RadStyleSheetManager id="RadStyleSheetManager" runat="server" />
|
||||
<link href="/Style/style-v5.css" rel="stylesheet" type="text/css" />
|
||||
<!-- additional scripts etc from individual pages -->
|
||||
<asp:ContentPlaceHolder id="PlaceHolderHead" runat="server" />
|
||||
<asp:Literal ID="LiteralCrowdinScript" runat="server" Text="" />
|
||||
|
||||
<!-- initialize all modal popups -->
|
||||
<script language="javascript" type="text/javascript">
|
||||
$(function () {
|
||||
$("a[rel*=leanModal]").leanModal();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form2" runat="server">
|
||||
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
|
||||
<script type="text/javascript">
|
||||
//Put your JavaScript code here.
|
||||
</script>
|
||||
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
|
||||
</telerik:RadAjaxManager>
|
||||
|
||||
<telerik:RadSkinManager ID="RadSkinManager1" Runat="server" Skin="WebBlue">
|
||||
</telerik:RadSkinManager>
|
||||
|
||||
<asp:ContentPlaceHolder ID="PlaceHolderMain" runat="server" />
|
||||
<asp:ContentPlaceHolder ID="PlaceHolderSide" runat="server" />
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="LeanModal-NoMaster.aspx.cs" Inherits="Tests_LeanModal_NoMaster" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<script language="javascript" type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" ></script>
|
||||
<script language="javascript" type="text/javascript" src="/Scripts/jquery.leanModal.min.js" ></script>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<style type="text/css">
|
||||
|
||||
|
||||
#lean_overlay {
|
||||
position: fixed;
|
||||
z-index:100;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
height:100%;
|
||||
width:100%;
|
||||
background: #000;
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
|
||||
$(function () {
|
||||
$("#go").leanModal();
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<div>
|
||||
<a id="go" href="#overlay">Test!</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
<div id="overlay" style="opacity:0;display:none">Samuel Jackson Lorem Ipsum</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="LeanModal-Master.master" AutoEventWireup="true" CodeFile="LeanModal.aspx.cs" Inherits="Tests_LeanModal" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="PlaceHolderHead" Runat="Server">
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
|
||||
#lean_overlay {
|
||||
position: fixed;
|
||||
z-index:100;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
height:100%;
|
||||
width:100%;
|
||||
background: #000;
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
</asp:Content>
|
||||
|
||||
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderMain" Runat="Server">
|
||||
|
||||
<a id="go" rel="leanModal" href="#overlay">Test!</a>
|
||||
|
||||
<div id="overlay" style="opacity:0;display:none">Samuel Jackson Lorem Ipsum</div>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="PlaceHolderSide" Runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Master-v5.master" AutoEventWireup="true" CodeFile="TestBookkeepingIntegrity.aspx.cs" Inherits="Tests_TestBookkeepingIntegrity" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="PlaceHolderHead" Runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderMain" Runat="Server">
|
||||
<br/>
|
||||
<div class="entrylabels" style="width:150px">Organization<br/>Year<br/> <br/>EOY Balance<br/>EOLY Owncapital<br/>EOCY Owncapital<br/>Diff<br/>Actual OC Delta<br/>Results-all<br/>Results-noted</div>
|
||||
<div class="entryfields">
|
||||
<asp:Label ID="LabelThisOrganization" runat="server" /><br/>
|
||||
<asp:DropDownList runat="server" ID="DropYear" AutoPostBack="true" OnSelectedIndexChanged="DropYear_SelectedIndexChanged" /> <br/> <br/>
|
||||
<asp:Label ID="LabelEoyBalance" runat="server" /><br/>
|
||||
<asp:Label ID="LabelEolyOwnCapital" runat="server" /><br/>
|
||||
<asp:Label ID="LabelEocyOwnCapital" runat="server" /><br/>
|
||||
<asp:Label ID="LabelOwnCapitalDiff" runat="server" /><br/>
|
||||
<asp:Label ID="LabelOwnCapitalDelta" runat="server" /><br/>
|
||||
<asp:Label ID="LabelResultsAll" runat="server" /><br/>
|
||||
<asp:Label ID="LabelResultsNoted" runat="server" />
|
||||
</div>
|
||||
|
||||
<div style="clear:both"></div>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="PlaceHolderSide" Runat="Server">
|
||||
<h2 class="blue">INFO<span class="arrow"></span></h2>
|
||||
|
||||
<div class="box">
|
||||
<div class="content">
|
||||
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.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</asp:Content>
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user