diff --git a/Site/Pages/v5/Ledgers/BalanceTransactions.aspx b/Site/Pages/v5/Ledgers/BalanceTransactions.aspx index b67f363f..d6715b53 100644 --- a/Site/Pages/v5/Ledgers/BalanceTransactions.aspx +++ b/Site/Pages/v5/Ledgers/BalanceTransactions.aspx @@ -78,10 +78,9 @@ $('#divNegativeDifference').hide(); if (data.OpenOutboundInvoiceData != null) { - if (data.OpenOutboundInvoiceData.ExactMatches.length > 0 || data.OpenOutboundInvoiceData.TolerantMatches.length > 0) { + if (data.OpenOutboundInvoiceData.length > 0) { $('#divOutboundInvoice').show(); - <%=this.DropOpenOutboundInvoices.ClientID%>_loadData(data.OpenOutboundInvoiceData.ExactMatches); - <%=this.DropOpenOutboundInvoices.ClientID%>_loadData(data.OpenOutboundInvoiceData.TolerantMatches); + <%=this.DropOpenOutboundInvoices.ClientID%>_loadData(data.OpenOutboundInvoiceData); <%=this.DropOpenOutboundInvoices.ClientID%>_text("<%=Resources.Global.Global_SelectOne%>"); } else { $('#divOutboundInvoice').hide(); @@ -95,9 +94,8 @@ $('#divNegativeDifference').show(); if (data.OpenPayoutData != null) { - if (data.OpenPayoutData.ExactMatches.length > 0 || data.OpenPayoutData.TolerantMatches.length > 0) { - <%=this.DropOpenPayouts.ClientID%>_loadData(data.OpenPayoutData.ExactMatches); - <%=this.DropOpenPayouts.ClientID%>_loadData(data.OpenPayoutData.TolerantMatches); + if (data.OpenPayoutData.length > 0) { + <%=this.DropOpenPayouts.ClientID%>_loadData(data.OpenPayoutData); <%=this.DropOpenPayouts.ClientID%>_text("<%=Resources.Global.Global_SelectOne%>"); } else { <%=this.DropOpenPayouts.ClientID%>_loadData({}); diff --git a/Site/Pages/v5/Ledgers/BalanceTransactions.aspx.cs b/Site/Pages/v5/Ledgers/BalanceTransactions.aspx.cs index 86eb5d44..ee21e238 100644 --- a/Site/Pages/v5/Ledgers/BalanceTransactions.aspx.cs +++ b/Site/Pages/v5/Ledgers/BalanceTransactions.aspx.cs @@ -82,16 +82,15 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers public string DifferingAmount { get; set; } public string AmountAsPurchase { get; set; } public string TransactionDescription { get; set; } - public DropdownOptions OpenPayoutData { get; set; } - public DropdownOptions OpenOutboundInvoiceData { get; set; } + public DropdownOption[] OpenPayoutData { get; set; } + public DropdownOption[] OpenOutboundInvoiceData { get; set; } public DropdownOption[] OpenVatReportData { get; set; } } [Serializable] public class DropdownOptions { - public DropdownOption[] ExactMatches { get; set; } - public DropdownOption[] TolerantMatches { get; set; } + public DropdownOption[] Matches { get; set; } } [Serializable] @@ -151,7 +150,7 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers return result; } - private static DropdownOptions GetOpenPayoutData(FinancialTransaction transaction) + private static DropdownOption[] GetOpenPayoutData(FinancialTransaction transaction) { DateTime transactionDateTime = transaction.DateTime; Int64 matchAmount = transaction.Rows.AmountCentsTotal; @@ -193,14 +192,15 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers } } - result.ExactMatches = listExact.ToArray(); - result.TolerantMatches = listTolerant.ToArray(); + List listCombined = new List(); + listCombined.AddRange(listExact); + listCombined.AddRange(listTolerant); - return result; + return listCombined.ToArray(); } - private static DropdownOptions GetOpenOutboundInvoiceData(FinancialTransaction transaction) + private static DropdownOption[] GetOpenOutboundInvoiceData(FinancialTransaction transaction) { DateTime txDateTime = transaction.DateTime; Int64 matchAmount = transaction.Rows.AmountCentsTotal; @@ -250,10 +250,11 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers } } - result.ExactMatches = listExact.ToArray(); - result.TolerantMatches = listTolerant.ToArray(); + List listCombined = new List(); + listCombined.AddRange(listExact); + listCombined.AddRange(listTolerant); - return result; + return listCombined.ToArray(); } private static bool DescriptionContainsInvoiceReference(string ourReference, string theirReference, string description)