Added simplified balance sheet; some cosmetics to other annual reports
This commit is contained in:
@@ -361,6 +361,7 @@ namespace Swarmops.Logic.Financial
|
||||
public AnnualReportNode AccountValues;
|
||||
|
||||
public List<AnnualReportLine> Children;
|
||||
public bool DefaultExpand;
|
||||
|
||||
public AnnualReportLine()
|
||||
{
|
||||
|
||||
+28
-1
@@ -19,7 +19,7 @@ namespace Resources.Pages {
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option or rebuild the Visual Studio project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "11.0.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "14.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Ledgers {
|
||||
@@ -339,6 +339,15 @@ namespace Resources.Pages {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Assets XXXX.
|
||||
/// </summary>
|
||||
internal static string BalanceSheet_Assets {
|
||||
get {
|
||||
return ResourceManager.GetString("BalanceSheet_Assets", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Balance Sheet for {0},.
|
||||
/// </summary>
|
||||
@@ -357,6 +366,15 @@ namespace Resources.Pages {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to (change).
|
||||
/// </summary>
|
||||
internal static string BalanceSheet_Delta {
|
||||
get {
|
||||
return ResourceManager.GetString("BalanceSheet_Delta", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to BalanceSheet.
|
||||
/// </summary>
|
||||
@@ -384,6 +402,15 @@ namespace Resources.Pages {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Liabilities XXXX.
|
||||
/// </summary>
|
||||
internal static string BalanceSheet_Liabilities {
|
||||
get {
|
||||
return ResourceManager.GetString("BalanceSheet_Liabilities", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Balance Sheet.
|
||||
/// </summary>
|
||||
|
||||
@@ -785,4 +785,16 @@
|
||||
<value>Unspent TxOut</value>
|
||||
<comment>The local translation of a bitcoin UTXO (Unspent Transaction Output).</comment>
|
||||
</data>
|
||||
<data name="BalanceSheet_Assets" xml:space="preserve">
|
||||
<value>Assets XXXX</value>
|
||||
<comment>For the simplified view - XXXX is replaced with year</comment>
|
||||
</data>
|
||||
<data name="BalanceSheet_Delta" xml:space="preserve">
|
||||
<value>(change)</value>
|
||||
<comment>Change from previous year's close, which is same as from start of this year</comment>
|
||||
</data>
|
||||
<data name="BalanceSheet_Liabilities" xml:space="preserve">
|
||||
<value>Liabilities XXXX</value>
|
||||
<comment>For the simplified view - XXXX is replaced with year</comment>
|
||||
</data>
|
||||
</root>
|
||||
@@ -70,6 +70,7 @@
|
||||
"{0}.aspx", // for dev.swarmops.com/Security/Login
|
||||
"/Pages/v5/Public{0}.aspx", // for dev.swarmops.com/Signup (and others under Public)
|
||||
"/Pages/v5/Public{0}", // for dev.swarmops.com/WizardStyle.css (linked from pages in Public)
|
||||
"/Pages/v5/{0}SheetSimplified.aspx", // for dev.swarmops.com/Ledgers/Balance -- one-page substitution
|
||||
"/Pages/v5{0}.aspx", // for dev.swarmops.com/User/SelectLanguage
|
||||
"/Pages/v5{0}" // for dev.swarmops.com/Ledgers/Json-SomethingData.aspx
|
||||
};
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Master-v5.master" AutoEventWireup="true" Inherits="Swarmops.Frontend.Pages.Ledgers.BalanceSheetSimplified" CodeFile="BalanceSheetSimplified.aspx.cs" Codebehind="BalanceSheetSimplified.aspx.cs" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="PlaceHolderHead" Runat="Server">
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
$('#tableProfitLoss').treegrid(
|
||||
{
|
||||
onBeforeExpand: function (foo) {
|
||||
$('span.profitlossdata-collapsed-' + foo.id).fadeOut('fast', function () {
|
||||
$('span.profitlossdata-expanded-' + foo.id).fadeIn('slow');
|
||||
});
|
||||
},
|
||||
|
||||
onBeforeCollapse: function (foo) {
|
||||
$('span.profitlossdata-expanded-' + foo.id).fadeOut('fast', function () {
|
||||
$('span.profitlossdata-collapsed-' + foo.id).fadeIn('slow');
|
||||
});
|
||||
},
|
||||
|
||||
onLoadSuccess: function () {
|
||||
$('div.datagrid').css('opacity', 1);
|
||||
$('#imageLoadIndicator').hide();
|
||||
$('span.loadingHeader').hide();
|
||||
|
||||
var selectedYear = $('#<%=DropYears.ClientID %>').val();
|
||||
|
||||
$('div#linkDownloadReport').attr("onclick", "document.location='Csv-BalanceData.aspx?Year=" + selectedYear + "';");
|
||||
$('#spanDownloadText').text(SwarmopsJS.unescape('<%= this.Localized_DownloadFileName %>') + selectedYear + "-<%=DateTime.Today.ToString("yyyyMMdd") %>.csv");
|
||||
$('#headerStartYear').text(SwarmopsJS.unescape('<%= this.Localized_Assets %>'.replace('XXXX',selectedYear)));
|
||||
|
||||
if (selectedYear == currentYear)
|
||||
{
|
||||
$('span.previousYearsHeader').hide();
|
||||
$('span.currentYearHeader').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#previousYtd').text(SwarmopsJS.unescape('<%= this.Localized_Liabilities %>'.replace('XXXX', selectedYear)));
|
||||
|
||||
$('span.currentYearHeader').hide();
|
||||
$('span.previousYearsHeader').show();
|
||||
}
|
||||
|
||||
$('span.commonHeader').show();
|
||||
}
|
||||
});
|
||||
|
||||
$('#<%=DropYears.ClientID %>').change(function () {
|
||||
var selectedYear = $('#<%=DropYears.ClientID %>').val();
|
||||
|
||||
$('#tableProfitLoss').treegrid({ url: 'Json-BalanceSheetData.aspx?Year=' + selectedYear });
|
||||
$('#imageLoadIndicator').show();
|
||||
$('div.datagrid').css('opacity', 0.4);
|
||||
|
||||
$('#tableProfitLoss').treegid('reload');
|
||||
});
|
||||
|
||||
|
||||
$('div.datagrid').css('opacity', 0.4);
|
||||
});
|
||||
|
||||
var currentYear = <%=DateTime.Today.Year %>;
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.content h2 select {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #1C397E;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
</style>
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderMain" Runat="Server">
|
||||
|
||||
<h2><div class="elementFloatFar"><%= CurrentOrganization.Currency.DisplayCode %></div><asp:Label ID="LabelContentHeader" runat="server" /> <asp:DropDownList runat="server" ID="DropYears"/> <img alt="Loading" src="/Images/Abstract/ajaxloader-blackcircle.gif" ID="imageLoadIndicator" /></h2>
|
||||
<table id="tableProfitLoss" title="" class="easyui-treegrid" style="width:680px;height:600px"
|
||||
url="Json-BalanceSheetData.aspx"
|
||||
rownumbers="false"
|
||||
animate="true"
|
||||
fitColumns="true"
|
||||
idField="id" treeField="name">
|
||||
<thead>
|
||||
<tr>
|
||||
<th field="name" width="178"><asp:Literal ID="LiteralHeaderAccountName" runat="server"/></th>
|
||||
<th field="assets" width="120" align="right"><span class="commonHeader" id="headerStartYear" style="display:none"><asp:Literal ID="LiteralAssets" runat="server" /></span><span class="loadingHeader">—</span></th>
|
||||
<th field="assetdelta" width="120" align="right"><span class="commonHeader" id="headerQ1" style="display:none"><asp:Literal ID="LiteralAssetsDelta" runat="server" /></span><span class="loadingHeader">—</span></th>
|
||||
<th field="liabilities" width="120" align="right"><span class="commonHeader" id="headerQ2" style="display:none"><asp:Literal ID="LiteralLiabilities" runat="server" /></span><span class="loadingHeader">—</span></th>
|
||||
<th field="liabilitydelta" width="120" align="right"><span class="commonHeader" id="headerQ3" style="display:none"><asp:Literal ID="LiteralLiabilitiesDelta" runat="server" /></span><span class="loadingHeader">—</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="PlaceHolderSide" Runat="Server">
|
||||
<h2 class="blue"><asp:Label ID="LabelSidebarDownload" Text="Download This" runat="server" /><span class="arrow"></span></h2>
|
||||
|
||||
<div class="box">
|
||||
<div class="content">
|
||||
<div class="link-row-encaps" id="linkDownloadReport" onclick="document.location='placeholder';" >
|
||||
<div class="link-row-icon" style="background-image:url('/Images/Icons/iconshock-downarrow-16px.png');background-position:-1px -1px"></div>
|
||||
<span id="spanDownloadText">Balancexxxx-yyyymmdd.csv</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using Swarmops.Logic.Security;
|
||||
|
||||
namespace Swarmops.Frontend.Pages.Ledgers
|
||||
{
|
||||
/// <summary>
|
||||
/// This is a simplified display for economists.
|
||||
/// </summary>
|
||||
public partial class BalanceSheetSimplified : PageV5Base
|
||||
{
|
||||
protected void Page_Load (object sender, EventArgs e)
|
||||
{
|
||||
if (!CurrentOrganization.IsEconomyEnabled)
|
||||
{
|
||||
Response.Redirect ("/Financial/EconomyNotEnabled", true);
|
||||
return;
|
||||
}
|
||||
|
||||
PageIcon = "iconshock-treasure";
|
||||
PageTitle = Resources.Pages.Ledgers.BalanceSheet_PageTitle;
|
||||
InfoBoxLiteral = Resources.Pages.Ledgers.BalanceSheet_Info;
|
||||
|
||||
// Security: If the org has open ledgers, then anyone may read. Otherwise, Financials.Read.
|
||||
|
||||
if (!String.IsNullOrEmpty (CurrentOrganization.OpenLedgersDomain))
|
||||
{
|
||||
PageAccessRequired = new Access (AccessAspect.Null, AccessType.Read);
|
||||
}
|
||||
else
|
||||
{
|
||||
PageAccessRequired = new Access (CurrentOrganization, AccessAspect.Financials, AccessType.Read);
|
||||
}
|
||||
|
||||
|
||||
if (!Page.IsPostBack)
|
||||
{
|
||||
int year = DateTime.Today.Year;
|
||||
int firstFiscalYear = CurrentOrganization.FirstFiscalYear;
|
||||
|
||||
while (year >= firstFiscalYear)
|
||||
{
|
||||
this.DropYears.Items.Add (year.ToString (CultureInfo.InvariantCulture));
|
||||
year--;
|
||||
}
|
||||
|
||||
Localize();
|
||||
}
|
||||
|
||||
RegisterControl (EasyUIControl.DataGrid | EasyUIControl.Tree);
|
||||
}
|
||||
|
||||
|
||||
private void Localize()
|
||||
{
|
||||
this.LabelContentHeader.Text = string.Format (Resources.Pages.Ledgers.BalanceSheet_ContentHeader,
|
||||
CurrentOrganization.Name);
|
||||
/*
|
||||
this.LiteralHeaderQ1.Text = Resources.Pages.Ledgers.BalanceSheet_Q1;
|
||||
this.LiteralHeaderQ2.Text = Resources.Pages.Ledgers.BalanceSheet_Q2;
|
||||
this.LiteralHeaderQ3.Text = Resources.Pages.Ledgers.BalanceSheet_Q3;
|
||||
this.LiteralHeaderQ4.Text = Resources.Pages.Ledgers.BalanceSheet_Q4;
|
||||
this.LiteralHeaderYtd.Text = Resources.Pages.Ledgers.BalanceSheet_Current;*/
|
||||
this.LiteralHeaderAccountName.Text = Resources.Pages.Ledgers.BalanceSheet_AccountName;
|
||||
}
|
||||
|
||||
// Localized strings for direct access from ASPX
|
||||
|
||||
// ReSharper disable InconsistentNaming
|
||||
public string Localized_Assets
|
||||
{
|
||||
get { return JavascriptEscape(Resources.Pages.Ledgers.BalanceSheet_Assets); }
|
||||
}
|
||||
|
||||
public string Localized_Liabilities
|
||||
{
|
||||
get { return JavascriptEscape(Resources.Pages.Ledgers.BalanceSheet_Liabilities); }
|
||||
}
|
||||
|
||||
public string Localized_DownloadFileName
|
||||
{
|
||||
get { return JavascriptEscape(Resources.Pages.Ledgers.BalanceSheet_DownloadFileName); }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Swarmops.Frontend.Pages.Ledgers {
|
||||
|
||||
|
||||
public partial class BalanceSheetSimplified {
|
||||
|
||||
/// <summary>
|
||||
/// LabelContentHeader control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label LabelContentHeader;
|
||||
|
||||
/// <summary>
|
||||
/// DropYears control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.DropDownList DropYears;
|
||||
|
||||
/// <summary>
|
||||
/// LiteralHeaderAccountName control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal LiteralHeaderAccountName;
|
||||
|
||||
/// <summary>
|
||||
/// LiteralAssets control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal LiteralAssets;
|
||||
|
||||
/// <summary>
|
||||
/// LiteralAssetsDelta control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal LiteralAssetsDelta;
|
||||
|
||||
/// <summary>
|
||||
/// LiteralLiabilities control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal LiteralLiabilities;
|
||||
|
||||
/// <summary>
|
||||
/// LiteralLiabilitiesDelta control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal LiteralLiabilitiesDelta;
|
||||
|
||||
/// <summary>
|
||||
/// LabelSidebarDownload control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label LabelSidebarDownload;
|
||||
}
|
||||
}
|
||||
@@ -55,6 +55,7 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
|
||||
if (localizeMap.ContainsKey (line.AccountName))
|
||||
{
|
||||
line.AccountName = localizeMap[line.AccountName];
|
||||
line.DefaultExpand = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -87,7 +88,7 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
|
||||
line.AccountValues.ThisYear);
|
||||
|
||||
|
||||
element += ",\"state\":\"closed\",\"children\":" + RecurseReport (line.Children);
|
||||
element += ",\"state\":\"" + (line.DefaultExpand ? "open" : "closed") + "\",\"children\":" + RecurseReport(line.Children);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -116,11 +117,11 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
|
||||
if (treeValue != 0 && singleValue == 0)
|
||||
{
|
||||
return string.Format (CultureInfo.CurrentCulture,
|
||||
"\"<span class=\\\"profitlossdata-collapsed-{0}\\\"><strong>Σ</strong> {1:N0}</span><span class=\\\"profitlossdata-expanded-{0}\\\" style=\\\"display:none\\\"> </span>\"",
|
||||
"\"<span class=\\\"annualreportdata-collapsed-{0}\\\"><strong>Σ</strong> {1:N0}</span><span class=\\\"annualreportdata-expanded-{0}\\\" style=\\\"display:none\\\"> </span>\"",
|
||||
accountId, treeValue/100.00);
|
||||
}
|
||||
return string.Format (CultureInfo.CurrentCulture,
|
||||
"\"<span class=\\\"profitlossdata-collapsed-{0}\\\"><strong>Σ</strong> {1:N0}</span><span class=\\\"profitlossdata-expanded-{0}\\\" style=\\\"display:none\\\">{2:N0}</span>\"",
|
||||
"\"<span class=\\\"annualreportdata-collapsed-{0}\\\"><strong>Σ</strong> {1:N0}</span><span class=\\\"annualreportdata-expanded-{0}\\\" style=\\\"display:none\\\">{2:N0}</span>\"",
|
||||
accountId, treeValue/100.0, singleValue/100.0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" Inherits="Swarmops.Frontend.Pages.v5.Ledgers.BalanceSheetDataSimplified" Codebehind="Json-BalanceSheetDataSimplified.aspx.cs" %>
|
||||
@@ -0,0 +1,126 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using Swarmops.Common.Enums;
|
||||
using Swarmops.Logic.Financial;
|
||||
|
||||
namespace Swarmops.Frontend.Pages.v5.Ledgers
|
||||
{
|
||||
public partial class BalanceSheetDataSimplified : DataV5Base
|
||||
{
|
||||
private AuthenticationData _authenticationData;
|
||||
|
||||
|
||||
private int _year = 2012;
|
||||
|
||||
protected void Page_Load (object sender, EventArgs e)
|
||||
{
|
||||
// Get auth data
|
||||
|
||||
this._authenticationData = GetAuthenticationDataAndCulture();
|
||||
|
||||
// Get current year
|
||||
|
||||
this._year = DateTime.Today.Year;
|
||||
|
||||
string yearParameter = Request.QueryString["Year"];
|
||||
|
||||
if (!string.IsNullOrEmpty (yearParameter))
|
||||
{
|
||||
this._year = Int32.Parse (yearParameter); // will throw if non-numeric - don't matter for app
|
||||
}
|
||||
|
||||
AnnualReport report = AnnualReport.Create (this._authenticationData.CurrentOrganization, this._year,
|
||||
FinancialAccountType.Balance);
|
||||
LocalizeRoot (report.ReportLines);
|
||||
|
||||
Response.ContentType = "application/json";
|
||||
|
||||
Response.Output.WriteLine (RecurseReport (report.ReportLines));
|
||||
|
||||
Response.End();
|
||||
}
|
||||
|
||||
private void LocalizeRoot (List<AnnualReportLine> lines)
|
||||
{
|
||||
Dictionary<string, string> localizeMap = new Dictionary<string, string>();
|
||||
|
||||
localizeMap["%ASSET_ACCOUNTGROUP%"] = Resources.Global.Financial_Asset;
|
||||
localizeMap["%DEBT_ACCOUNTGROUP%"] = Resources.Global.Financial_Debt;
|
||||
localizeMap["%INCOME_ACCOUNTGROUP%"] = Resources.Global.Financial_Income;
|
||||
localizeMap["%COST_ACCOUNTGROUP%"] = Resources.Global.Financial_Cost;
|
||||
|
||||
foreach (AnnualReportLine line in lines)
|
||||
{
|
||||
if (localizeMap.ContainsKey (line.AccountName))
|
||||
{
|
||||
line.AccountName = localizeMap[line.AccountName];
|
||||
line.DefaultExpand = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private string RecurseReport (List<AnnualReportLine> reportLines)
|
||||
{
|
||||
List<string> elements = new List<string>();
|
||||
|
||||
foreach (AnnualReportLine line in reportLines)
|
||||
{
|
||||
string columnCardinal = "assets";
|
||||
string columnDelta = "assetdelta";
|
||||
int signReverser = 1;
|
||||
|
||||
if (line.AccountType == FinancialAccountType.Debt)
|
||||
{
|
||||
columnCardinal = "liabilities";
|
||||
columnDelta = "liabilitydelta";
|
||||
signReverser = -1;
|
||||
}
|
||||
|
||||
string element = string.Format ("\"id\":\"{0}\",\"name\":\"{1}\"", line.AccountId,
|
||||
JsonSanitize (line.AccountName));
|
||||
|
||||
if (line.Children.Count > 0)
|
||||
{
|
||||
element += ",\"" + columnCardinal + "\":" +
|
||||
JsonDualString (line.AccountId, line.AccountTreeValues.ThisYear * signReverser,
|
||||
line.AccountValues.ThisYear * signReverser);
|
||||
|
||||
element += ",\"" + columnDelta + "\":" +
|
||||
JsonDualString (line.AccountId, (line.AccountTreeValues.ThisYear-line.AccountTreeValues.PreviousYear) * signReverser,
|
||||
(line.AccountValues.ThisYear-line.AccountValues.PreviousYear) * signReverser);
|
||||
|
||||
|
||||
element += ",\"state\":\"" + (line.DefaultExpand? "open":"closed") + "\",\"children\":" + RecurseReport (line.Children);
|
||||
}
|
||||
else
|
||||
{
|
||||
element += string.Format (CultureInfo.CurrentCulture, ",\"" + columnCardinal + "\":\"{0:N2}\"",
|
||||
(double) line.AccountValues.PreviousYear/100.0*signReverser);
|
||||
|
||||
element += string.Format (CultureInfo.CurrentCulture, ",\"" + columnDelta + "\":\"({0:+#,#;-#,#;0})\"",
|
||||
(double) line.AccountValues.ThisYear/100.0*signReverser).Replace("-", "−");
|
||||
}
|
||||
|
||||
elements.Add ("{" + element + "}");
|
||||
}
|
||||
|
||||
return "[" + String.Join (",", elements.ToArray()) + "]";
|
||||
}
|
||||
|
||||
|
||||
private string JsonDualString (int accountId, Int64 treeValue, Int64 singleValue)
|
||||
{
|
||||
if (treeValue != 0 && singleValue == 0)
|
||||
{
|
||||
return string.Format (CultureInfo.CurrentCulture,
|
||||
"\"<span class=\\\"annualreportdata-collapsed-{0}\\\"><strong>Σ</strong> {1:N0}</span><span class=\\\"annualreportdata-expanded-{0}\\\" style=\\\"display:none\\\"> </span>\"",
|
||||
accountId, treeValue/100.00);
|
||||
}
|
||||
return string.Format (CultureInfo.CurrentCulture,
|
||||
"\"<span class=\\\"annualreportdata-collapsed-{0}\\\"><strong>Σ</strong> {1:N0}</span><span class=\\\"annualreportdata-expanded-{0}\\\" style=\\\"display:none\\\">{2:N0}</span>\"",
|
||||
accountId, treeValue/100.0, singleValue/100.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Swarmops.Frontend.Pages.v5.Ledgers {
|
||||
|
||||
|
||||
public partial class BalanceSheetDataSimplified {
|
||||
}
|
||||
}
|
||||
@@ -57,6 +57,7 @@ public partial class Pages_v5_Ledgers_Json_BudgetActualData : DataV5Base
|
||||
if (localizeMap.ContainsKey (line.AccountName))
|
||||
{
|
||||
line.AccountName = localizeMap[line.AccountName];
|
||||
line.DefaultExpand = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -105,7 +106,7 @@ public partial class Pages_v5_Ledgers_Json_BudgetActualData : DataV5Base
|
||||
|
||||
|
||||
|
||||
element += ",\"state\":\"closed\",\"children\":" + RecurseReport (line.Children);
|
||||
element += ",\"state\":\"" + (line.DefaultExpand ? "open" : "closed") + "\",\"children\":" + RecurseReport(line.Children);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -54,6 +54,7 @@ public partial class Pages_v5_Ledgers_Json_ProfitLossData : DataV5Base
|
||||
if (localizeMap.ContainsKey (line.AccountName))
|
||||
{
|
||||
line.AccountName = localizeMap[line.AccountName];
|
||||
line.DefaultExpand = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -104,7 +105,7 @@ public partial class Pages_v5_Ledgers_Json_ProfitLossData : DataV5Base
|
||||
JsonDualString (line.AccountId, line.AccountTreeValues.ThisYear, line.AccountValues.ThisYear);
|
||||
|
||||
|
||||
element += ",\"state\":\"closed\",\"children\":" + RecurseReport (line.Children);
|
||||
element += ",\"state\":\"" + (line.DefaultExpand ? "open" : "closed") + "\",\"children\":" + RecurseReport(line.Children);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -285,6 +285,13 @@
|
||||
<Compile Include="Pages\v5\Ledgers\AccountPlan.aspx.designer.cs">
|
||||
<DependentUpon>AccountPlan.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Pages\v5\Ledgers\BalanceSheetSimplified.aspx.cs">
|
||||
<DependentUpon>BalanceSheetSimplified.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Pages\v5\Ledgers\BalanceSheetSimplified.aspx.designer.cs">
|
||||
<DependentUpon>BalanceSheetSimplified.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Pages\v5\Ledgers\BalanceSheet.aspx.cs">
|
||||
<DependentUpon>BalanceSheet.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
@@ -355,6 +362,13 @@
|
||||
<Compile Include="Pages\v5\Ledgers\Json-AccountPlanData.aspx.designer.cs">
|
||||
<DependentUpon>Json-AccountPlanData.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Pages\v5\Ledgers\Json-BalanceSheetDataSimplified.aspx.cs">
|
||||
<DependentUpon>Json-BalanceSheetDataSimplified.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Pages\v5\Ledgers\Json-BalanceSheetDataSimplified.aspx.designer.cs">
|
||||
<DependentUpon>Json-BalanceSheetDataSimplified.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Pages\v5\Ledgers\Json-BalanceSheetData.aspx.cs">
|
||||
<DependentUpon>Json-BalanceSheetData.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
@@ -1013,6 +1027,7 @@
|
||||
<Content Include="Pages\v5\Financial\RequestCashAdvance.aspx" />
|
||||
<Content Include="Pages\v5\Financial\ValidateReceipts.aspx" />
|
||||
<Content Include="Pages\v5\Ledgers\AccountPlan.aspx" />
|
||||
<Content Include="Pages\v5\Ledgers\BalanceSheetSimplified.aspx" />
|
||||
<Content Include="Pages\v5\Ledgers\BalanceSheet.aspx" />
|
||||
<Content Include="Pages\v5\Ledgers\BalanceTransactions.aspx" />
|
||||
<Content Include="Pages\v5\Ledgers\BitcoinHotwallet.aspx" />
|
||||
@@ -1023,6 +1038,7 @@
|
||||
<Content Include="Pages\v5\Ledgers\DebugLedgers.aspx" />
|
||||
<Content Include="Pages\v5\Ledgers\InspectLedgers.aspx" />
|
||||
<Content Include="Pages\v5\Ledgers\Json-AccountPlanData.aspx" />
|
||||
<Content Include="Pages\v5\Ledgers\Json-BalanceSheetDataSimplified.aspx" />
|
||||
<Content Include="Pages\v5\Ledgers\Json-BalanceSheetData.aspx" />
|
||||
<Content Include="Pages\v5\Ledgers\Json-BitcoinHotwalletData.aspx" />
|
||||
<Content Include="Pages\v5\Ledgers\Json-BudgetActualData.aspx" />
|
||||
|
||||
Reference in New Issue
Block a user