From 33da06b8935889ff0a05fb0730dcf658bc7255c7 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Tue, 3 Oct 2017 14:21:49 +0200 Subject: [PATCH] Work on balancing positive mismatches in bank account --- .../Pages/v5/Ledgers/BalanceTransactions.aspx | 98 +++++++++++++------ .../v5/Ledgers/BalanceTransactions.aspx.cs | 60 +++++++++++- .../BalanceTransactions.aspx.designer.cs | 27 +++++ 3 files changed, 154 insertions(+), 31 deletions(-) diff --git a/Site/Pages/v5/Ledgers/BalanceTransactions.aspx b/Site/Pages/v5/Ledgers/BalanceTransactions.aspx index 20d36ef8..a01a208a 100644 --- a/Site/Pages/v5/Ledgers/BalanceTransactions.aspx +++ b/Site/Pages/v5/Ledgers/BalanceTransactions.aspx @@ -55,20 +55,44 @@ $('#spanTransactionUnbalancedBy').text(data.DifferingAmount); $('span#spanModalTransactionDate').text(data.TransactionDate); - if (data.OpenPayoutData.ExactMatches.length > 0) { - <%=this.DropOpenPayouts.ClientID%>_loadData(data.OpenPayoutData.ExactMatches); - <%=this.DropOpenPayouts.ClientID%>_text("<%=Resources.Global.Global_SelectOne%>"); - } else { - <%=this.DropOpenPayouts.ClientID%>_loadData({}); - <%=this.DropOpenPayouts.ClientID%>_text("<%=Resources.Global.Global_NoMatch%>"); - } + if (data.OpenPayoutData == null) // amount is positive + { + $('#divPositiveDifference').show(); + $('#divNegativeDifference').hide(); + + if (data.OpenInvoiceData != null) { + if (data.OpenInvoiceData.ExactMatches.length > 0) { + <%=this.DropOpenOutboundInvoices.ClientID%>_loadData(data.OpenInvoiceData.ExactMatches); + <%=this.DropOpenOutboundInvoices.ClientID%>_text("<%=Resources.Global.Global_SelectOne%>"); + } else { + <%=this.DropOpenOutboundInvoices.ClientID%>_loadData({}); + <%=this.DropOpenOutboundInvoices.ClientID%>_text("<%=Resources.Global.Global_NoMatch%>"); + } + } + + } else { // amount is negative + $('#divPositiveDifference').hide(); + $('#divNegativeDifference').show(); + + if (data.OpenPayoutData != null) { + if (data.OpenPayoutData.ExactMatches.length > 0) { + <%=this.DropOpenPayouts.ClientID%>_loadData(data.OpenPayoutData.ExactMatches); + <%=this.DropOpenPayouts.ClientID%>_text("<%=Resources.Global.Global_SelectOne%>"); + } else { + <%=this.DropOpenPayouts.ClientID%>_loadData({}); + <%=this.DropOpenPayouts.ClientID%>_text("<%=Resources.Global.Global_NoMatch%>"); + } + + if (data.OpenPayoutData.TolerantMatches.length > 0) { + <%=this.DropOpenPayoutsForeign.ClientID%>_loadData(data.OpenPayoutData.TolerantMatches); + <%=this.DropOpenPayoutsForeign.ClientID%>_text("<%=Resources.Global.Global_SelectOne%>"); + } else { + <%=this.DropOpenPayoutsForeign.ClientID%>_loadData({}); + <%=this.DropOpenPayoutsForeign.ClientID%>_text("<%=Resources.Global.Global_NoMatch%>"); + } + + } - if (data.OpenPayoutData.TolerantMatches.length > 0) { - <%=this.DropOpenPayoutsForeign.ClientID%>_loadData(data.OpenPayoutData.TolerantMatches); - <%=this.DropOpenPayoutsForeign.ClientID%>_text("<%=Resources.Global.Global_SelectOne%>"); - } else { - <%=this.DropOpenPayoutsForeign.ClientID%>_loadData({}); - <%=this.DropOpenPayoutsForeign.ClientID%>_text("<%=Resources.Global.Global_NoMatch%>"); } }); @@ -174,7 +198,7 @@

-

+

​
@@ -185,27 +209,41 @@
-

-
-
- ​
- +
+

+
+
+ ​
+ +
+
- -

-
-
- ​
- -
-