diff --git a/Site5/App_GlobalResources/Menu5.resx b/Site5/App_GlobalResources/Menu5.resx index 0dc80e05..01cc385c 100644 --- a/Site5/App_GlobalResources/Menu5.resx +++ b/Site5/App_GlobalResources/Menu5.resx @@ -405,4 +405,7 @@ Payroll Tax Forms + + Balance & Match Transactions + \ No newline at end of file diff --git a/Site5/App_GlobalResources/Pages.Ledgers.resx b/Site5/App_GlobalResources/Pages.Ledgers.resx index 9d49a14c..673ce1b7 100644 --- a/Site5/App_GlobalResources/Pages.Ledgers.resx +++ b/Site5/App_GlobalResources/Pages.Ledgers.resx @@ -674,6 +674,26 @@ (detailed description withheld) - Unbalanced Transactions (Must Fix) + Unbalanced Transactions (Must Match Or Fix) + + + Account + Usually the account name. Can also be "several". + + + Amount + + + Description + + + Tx# + Keep VERY short. + + + Some auto-imported financial transactions can't be automatically matched to the ongoing accounting. This is where you manually match such transactions to "balance" them (if a transaction only has one part completed, like the money sent to the organization with no record of what the money is for, the transaction is said to be "unbalanced"). + + + Balance & Match Transactions \ No newline at end of file diff --git a/Site5/Controls/v5/Base/ModalDialog.ascx b/Site5/Controls/v5/Base/ModalDialog.ascx new file mode 100644 index 00000000..c542896a --- /dev/null +++ b/Site5/Controls/v5/Base/ModalDialog.ascx @@ -0,0 +1,38 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ModalDialog.ascx.cs" Inherits="Swarmops.Frontend.Controls.v5.Base.ModalDialog" %> + + + +
+
+ +
+
+
\ No newline at end of file diff --git a/Site5/Controls/v5/Base/ModalDialog.ascx.cs b/Site5/Controls/v5/Base/ModalDialog.ascx.cs new file mode 100644 index 00000000..0a5c3094 --- /dev/null +++ b/Site5/Controls/v5/Base/ModalDialog.ascx.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.ComponentModel; + +namespace Swarmops.Frontend.Controls.v5.Base +{ + public partial class ModalDialog : ControlV5Base, INamingContainer + { + protected void Page_Init() + { + if (this.DialogCode != null) + { + ModalDialog dialog = new ModalDialog(); + this.DialogCode.InstantiateIn (dialog); + this.PlaceHolderDialog.Controls.Add (dialog); + } + } + + protected void Page_Load (object sender, EventArgs e) + { + + } + + [TemplateInstance(TemplateInstance.Single)] + [TemplateContainer(typeof(ModalDialog))] + [PersistenceMode(PersistenceMode.InnerProperty)] + public ITemplate DialogCode { get; set; } + + public string OnClientClose { get; set; } + } +} \ No newline at end of file diff --git a/Site5/Controls/v5/Financial/ComboBudgets.ascx b/Site5/Controls/v5/Financial/ComboBudgets.ascx index 8ebe00ec..29a6da2b 100644 --- a/Site5/Controls/v5/Financial/ComboBudgets.ascx +++ b/Site5/Controls/v5/Financial/ComboBudgets.ascx @@ -4,11 +4,16 @@ $(document).ready(function () { $('#<%=this.ClientID %>_DropBudgets').combotree({ animate: true, - height: 30 <% - if (!String.IsNullOrEmpty(this.OnClientLoaded)) - { - Response.Write(", onLoadSuccess: function() { " + this.OnClientLoaded + "(); }"); - } + height: 30, + onLoadSuccess: function() { + $("#<%= this.ClientID%>_SpanBudgets span.combo input.combo-text").val("<%=Resources.Global.Global_DropInits_SelectFinancialAccount%>"); + <% + if (!String.IsNullOrEmpty(this.OnClientLoaded)) + { + Response.Write(this.OnClientLoaded + "();"); + }%> + } + <% if (!String.IsNullOrEmpty(this.OnClientSelect)) { Response.Write(", onSelect: function(account) { " + this.OnClientSelect + "(account.id); }"); diff --git a/Site5/Images/PageIcons/iconshock-balance-40px.png b/Site5/Images/PageIcons/iconshock-balance-40px.png new file mode 100644 index 00000000..a97c05cc Binary files /dev/null and b/Site5/Images/PageIcons/iconshock-balance-40px.png differ diff --git a/Site5/Images/PageIcons/iconshock-balance-96px.png b/Site5/Images/PageIcons/iconshock-balance-96px.png new file mode 100644 index 00000000..b200b5fc Binary files /dev/null and b/Site5/Images/PageIcons/iconshock-balance-96px.png differ diff --git a/Site5/MainMenu-v5.xml b/Site5/MainMenu-v5.xml index 88c6a381..e6fdee7f 100644 --- a/Site5/MainMenu-v5.xml +++ b/Site5/MainMenu-v5.xml @@ -345,30 +345,47 @@ Link - - - 3 - Separator - - - Ledgers_TaxForms 3 - iconshock-invoice + Separator + + + + + Ledgers_BalanceTransactions + 3 - Submenu - - - Ledgers_TaxForms_Payroll - 3 - - iconshock-invoice - /Pages/v5/Ledgers/TaxForms/PayrollForms.aspx - Link - - - + iconshock-balance + /Pages/v5/Ledgers/BalanceTransactions.aspx + Link + + + + + + 3 + Separator + + + + + Ledgers_TaxForms + 3 + iconshock-invoice + + Submenu + + + Ledgers_TaxForms_Payroll + 3 + + iconshock-invoice + /Pages/v5/Ledgers/TaxForms/PayrollForms.aspx + Link + + + diff --git a/Site5/Pages/v5/Ledgers/BalanceTransactions.aspx b/Site5/Pages/v5/Ledgers/BalanceTransactions.aspx new file mode 100644 index 00000000..2ba859b1 --- /dev/null +++ b/Site5/Pages/v5/Ledgers/BalanceTransactions.aspx @@ -0,0 +1,93 @@ +<%@ Page Title="" Language="C#" MasterPageFile="~/Master-v5.master" AutoEventWireup="true" CodeFile="BalanceTransactions.aspx.cs" Inherits="Swarmops.Frontend.Pages.v5.Ledgers.BalanceTransactions" %> +<%@ Register TagPrefix="Swarmops5" TagName="ComboBudgets" Src="~/Controls/v5/Financial/ComboBudgets.ascx" %> +<%@ Register TagPrefix="Swarmops5" TagName="CurrencyTextBox" Src="~/Controls/v5/Financial/CurrencyTextBox.ascx" %> +<%@ Register TagPrefix="Swarmops5" TagName="ModalDialog" Src="~/Controls/v5/Base/ModalDialog.ascx" %> + + + + + + + + + + + +

+ + + + + + + + + + + + + +
+ + + + +

+ + + + + + + + + + +
+ +
+

+

,

+ +
+
+

+
+
+ + +
+
+ + + + +
+ + + + + diff --git a/Site5/Pages/v5/Ledgers/BalanceTransactions.aspx.cs b/Site5/Pages/v5/Ledgers/BalanceTransactions.aspx.cs new file mode 100644 index 00000000..dcdb6e20 --- /dev/null +++ b/Site5/Pages/v5/Ledgers/BalanceTransactions.aspx.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using Swarmops.Logic.Security; + +namespace Swarmops.Frontend.Pages.v5.Ledgers +{ + public partial class BalanceTransactions : PageV5Base + { + protected void Page_Load (object sender, EventArgs e) + { + PageAccessRequired = new Access (CurrentOrganization, AccessAspect.BookkeepingDetails, AccessType.Read); + + RegisterControl (EasyUIControl.DataGrid); + Localize(); + } + + private void Localize() + { + this.PageTitle = Resources.Pages.Ledgers.BalanceTransactions_PageTitle; + this.InfoBoxLiteral = Resources.Pages.Ledgers.BalanceTransactions_Info; + this.LabelHeaderUnbalancedTransactions.Text = + Resources.Pages.Ledgers.BalanceTransactions_HeaderUnbalancedTransactions; + + this.LabelGridHeaderAccountName.Text = Resources.Pages.Ledgers.BalanceTransactions_GridHeader_AccountName; + this.LabelGridHeaderAction.Text = Resources.Global.Global_Action; + this.LabelGridHeaderDateTime.Text = Resources.Global.Global_Timestamp; + this.LabelGridHeaderDelta.Text = Resources.Pages.Ledgers.BalanceTransactions_GridHeader_Amount; + this.LabelGridHeaderId.Text = Resources.Pages.Ledgers.BalanceTransactions_GridHeader_TransactionId; + this.LabelGridHeaderDescription.Text = Resources.Pages.Ledgers.BalanceTransactions_GridHeader_Description; + } + } +} \ No newline at end of file diff --git a/Site5/Pages/v5/Ledgers/InspectLedgers.aspx b/Site5/Pages/v5/Ledgers/InspectLedgers.aspx index 42213043..f7e8ded6 100644 --- a/Site5/Pages/v5/Ledgers/InspectLedgers.aspx +++ b/Site5/Pages/v5/Ledgers/InspectLedgers.aspx @@ -2,6 +2,7 @@ <%@ Import Namespace="Resources" %> <%@ Register TagPrefix="Swarmops5" TagName="ComboBudgets" Src="~/Controls/v5/Financial/ComboBudgets.ascx" %> <%@ Register TagPrefix="Swarmops5" TagName="CurrencyTextBox" Src="~/Controls/v5/Financial/CurrencyTextBox.ascx" %> +<%@ Register TagPrefix="Swarmops5" TagName="ModalDialog" Src="~/Controls/v5/Base/ModalDialog.ascx" %> @@ -57,14 +58,14 @@ // Dynamic reloading screws up resizing for some reason, so we'll have to resize the tx grid manually. - var heightBody = $('div#divModalCover table.datagrid-btable').height(); - $('div#divModalCover div.datagrid-body').height(heightBody); + var heightBody = $('div#<%=this.DialogEditTx.ClientID%>_divModalCover table.datagrid-btable').height(); + $('div#<%=this.DialogEditTx.ClientID%>_divModalCover div.datagrid-body').height(heightBody); - var heightHeaders = $('div#divModalCover div.datagrid-header').height(); - $('div#divModalCover div.datagrid-view').height(heightBody + heightHeaders + 20); // +20 adds some margin on the bottom. It's an arbitrary number. - $('div#divModalCover div.datagrid-wrap').height(heightBody + heightHeaders + 20); + var heightHeaders = $('div#<%=this.DialogEditTx.ClientID%>_divModalCover div.datagrid-header').height(); + $('div#<%=this.DialogEditTx.ClientID%>_divModalCover div.datagrid-view').height(heightBody + heightHeaders + 20); // +20 adds some margin on the bottom. It's an arbitrary number. + $('div#<%=this.DialogEditTx.ClientID%>_divModalCover div.datagrid-wrap').height(heightBody + heightHeaders + 20); - $('div#divModalBox').height($('div#divModalBox div.content').height() + 20); + $('div#<%=this.DialogEditTx.ClientID%>_divModalBox').height($('div#<%=this.DialogEditTx.ClientID%>_divModalBox div.content').height() + 20); } }); @@ -77,15 +78,6 @@ reloadData(); }); - $("#IconCloseEdit").click(function() { - $('#divModalCover').fadeOut(); - - if (transactionDirty) { - $('#gridLedgers').datagrid('reload'); - transactionDirty = false; - } - }); - $('#ButtonAddTransactionRow').click(function() { addTransactionRow(); }); @@ -99,8 +91,11 @@ var transactionId = 0; var transactionDirty = false; - function onAccountSelectorLoaded() { - $("#<%= DropBudgets.ClientID%>_SpanBudgets span.combo input.combo-text").val("<%=Resources.Global.Global_DropInits_SelectFinancialAccount%>"); + function onModalClose() { + if (transactionDirty) { + $('#gridLedgers').datagrid('reload'); + transactionDirty = false; + } } function onAccountSelected(newAccountId) { @@ -190,7 +185,7 @@ function onInspectTransaction(transactionId) { window.scrollTo(0, 0); $('body').css('overflow-y', 'hidden'); - $('#divModalCover').fadeIn(); + $('#<%=this.DialogEditTx.ClientID%>_divModalCover').fadeIn(); $('span#spanModalTransactionId').text(transactionId); $('#gridTransaction').datagrid({ url: 'Json-InspectLedgerTxData.aspx?TxId=' + transactionId }); @@ -302,7 +297,7 @@ -

+

- -
- + + diff --git a/Site5/Pages/v5/Ledgers/InspectLedgers.aspx.cs b/Site5/Pages/v5/Ledgers/InspectLedgers.aspx.cs index 68a401c2..383887f2 100644 --- a/Site5/Pages/v5/Ledgers/InspectLedgers.aspx.cs +++ b/Site5/Pages/v5/Ledgers/InspectLedgers.aspx.cs @@ -75,6 +75,7 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers this.LabelGridHeaderDescription.Text = Global.Global_Description; this.LabelGridHeaderId.Text = Resources.Pages.Ledgers.InspectLedgers_TransactionId; + this.LabelGridHeaderAccountName.Text = Resources.Pages.Ledgers.InspectLedgers_AccountName; this.LabelGridHeaderDateTimeEntered.Text = Resources.Pages.Ledgers.InspectLedgers_LoggedDate; this.LabelGridHeaderDeltaNegative2.Text = Global.Ledgers_Credit; @@ -83,6 +84,7 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers this.LabelFlagNotAvailable.Text = Resources.Pages.Ledgers.InspectLedgers_FlaggingNotAvailable; + this.LabelAddTransactionRowsHeader.Text = Resources.Pages.Ledgers.InspectLedgers_HeaderAddTransactionRow; this.LabelTrackedTransactionHeader.Text = Resources.Pages.Ledgers.InspectLedgers_HeaderAutoTransactionTracking; @@ -93,7 +95,8 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers CurrentUser.HasAccess (new Access (CurrentOrganization, AccessAspect.BookkeepingDetails, AccessType.Write))) { - this.LiteralEditHeader.Text = Resources.Pages.Ledgers.InspectLedgers_EditingTransactionX; + LiteralEditHeader.Text = Resources.Pages.Ledgers.InspectLedgers_EditingTransactionX; + this.LabelAddRowAccount.Text = Global.Financial_Account; this.LabelAddRowAmount.Text = Global.Financial_Amount; this.LiteralErrorAddRowSelectAccount.Text = @@ -102,7 +105,7 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers } else // read access, at a minimum of AccessAspect.Bookkeeping { - this.LiteralEditHeader.Text = Resources.Pages.Ledgers.InspectLedgers_InspectingTransactionX; + LiteralEditHeader.Text = Resources.Pages.Ledgers.InspectLedgers_InspectingTransactionX; } // Access helpers to JavaScript (these don't actually determine access, but help in UI prettiness) diff --git a/Site5/Pages/v5/Ledgers/Json-UnbalancedTransactions.aspx b/Site5/Pages/v5/Ledgers/Json-UnbalancedTransactions.aspx new file mode 100644 index 00000000..4a26b223 --- /dev/null +++ b/Site5/Pages/v5/Ledgers/Json-UnbalancedTransactions.aspx @@ -0,0 +1 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Json-UnbalancedTransactions.aspx.cs" Inherits="Swarmops.Frontend.Pages.v5.Ledgers.Json_UnbalancedTransactions" %> diff --git a/Site5/Pages/v5/Ledgers/Json-UnbalancedTransactions.aspx.cs b/Site5/Pages/v5/Ledgers/Json-UnbalancedTransactions.aspx.cs new file mode 100644 index 00000000..e3e135d2 --- /dev/null +++ b/Site5/Pages/v5/Ledgers/Json-UnbalancedTransactions.aspx.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using Swarmops.Logic.Financial; +using Swarmops.Logic.Security; + +namespace Swarmops.Frontend.Pages.v5.Ledgers +{ + public partial class Json_UnbalancedTransactions : DataV5Base + { + protected void Page_Load (object sender, EventArgs e) + { + Response.ContentType = "application/json"; + + FinancialTransactions unbalancedTransactions = FinancialTransactions.GetUnbalanced (CurrentOrganization); + List rows = new List(); + + if ( + CurrentUser.HasAccess (new Access (CurrentOrganization, AccessAspect.BookkeepingDetails, AccessType.Read))) + { + foreach (FinancialTransaction transaction in unbalancedTransactions) + { + string accountName = string.Empty; + + FinancialTransactionRows txRows = transaction.Rows; + if (txRows.Count > 1) + { + accountName = Resources.Global.Global_Several_Display; + } + else + { + // one transaction row (we know there's not zero rows, because the transaction is unbalanced, which requires at least one nonzero row) + accountName = txRows[0].AccountName; + } + + string row = + String.Format ( + "\"id\":\"{0:N0}\",\"description\":\"{1}\",\"accountName\":\"{2}\",\"delta\":\"{3:+#,#.00;-#,#.00}\",\"dateTime\":\"{4:yyyy-MMM-dd HH:mm}\"", + transaction.Identity, JsonSanitize (transaction.Description), JsonSanitize (accountName), txRows.AmountCentsTotal / 100.0, transaction.DateTime); + + row += + String.Format ( + ",\"action\":\"\"", + transaction.Identity); + + rows.Add ("{" + row + "}"); + } + } + + Response.Output.WriteLine("[" + String.Join (",", rows) + "]"); + + Response.End(); + } + } +} \ No newline at end of file diff --git a/Site5/Style/style-v5.css b/Site5/Style/style-v5.css index 40260502..d8ab13b4 100644 --- a/Site5/Style/style-v5.css +++ b/Site5/Style/style-v5.css @@ -344,7 +344,7 @@ body.rtl .sidebar { -.modalcover { +.modalCover { position: absolute; top: 0px; left: 0px; @@ -353,23 +353,47 @@ body.rtl .sidebar { z-index: 9001; display: none; background-color: rgba(0, 0, 0, 0.25); - } -.modal -{ +.modalWrap { position: absolute; - height: 80%; - width: 950px; - box-shadow: black 0px 0px 30px 2px; + height: 70%; + width: 980px; left: 0; right: 0; top: 0; bottom: 0; margin: auto auto; + background: transparent; +} + +.modal +{ + box-shadow: black 0px 0px 30px 2px; overflow-y: auto; } +.modal.box { + margin-top: inherit; +} + +.modalIconClose { /* copies the close button from Fancybox */ + position: absolute; + top: -15px; + right: -15px; + width: 30px; + height: 30px; + background: url("/Scripts/fancybox/fancybox.png") repeat scroll -40px 0px transparent; + cursor: pointer; + z-index: 9103; +} + +body.rtl .modalIconClose, body.rtl #fancybox-close { + right: inherit !important; + left: -15px !important; +} + + .divIconCloseModal { float:right;