mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 06:21:44 +01:00
Fix paid invoice filter
Fixes #3434 by reverting the filter changes done [here](ec68d2a0e6 (diff-b7a89b0b45f062f004cdfe6ca8484f6ca519044f63485fd15986af5f7dd5ec76L219)
).
The new labels are only used in the UI — when filtering one needs to use the old labels, as the filter docs in the view already suggest.
This commit is contained in:
parent
1c1f69fa50
commit
4ca152da7c
2 changed files with 22 additions and 6 deletions
|
@ -651,7 +651,25 @@ namespace BTCPayServer.Services.Invoices
|
|||
|
||||
if (queryObject.Status != null && queryObject.Status.Length > 0)
|
||||
{
|
||||
var statusSet = queryObject.Status.ToHashSet().ToArray();
|
||||
HashSet<string> statusSet = new HashSet<string>();
|
||||
// We make sure here that the old filters still work
|
||||
foreach (var status in queryObject.Status.Select(s => s.ToLowerInvariant()))
|
||||
{
|
||||
if (status == "paid")
|
||||
statusSet.Add("processing");
|
||||
if (status == "processing")
|
||||
statusSet.Add("paid");
|
||||
if (status == "confirmed")
|
||||
{
|
||||
statusSet.Add("complete");
|
||||
statusSet.Add("settled");
|
||||
}
|
||||
if (status == "settled")
|
||||
{
|
||||
statusSet.Add("complete");
|
||||
statusSet.Add("confirmed");
|
||||
}
|
||||
}
|
||||
query = query.Where(i => statusSet.Contains(i.Status));
|
||||
}
|
||||
|
||||
|
|
|
@ -327,10 +327,9 @@
|
|||
</div>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div style="clear:both"></div>
|
||||
@if (Model.Total > 0)
|
||||
{
|
||||
<div style="clear:both"></div>
|
||||
<div class="table-responsive">
|
||||
<table id="invoices" class="table table-hover">
|
||||
<thead>
|
||||
|
@ -403,11 +402,10 @@
|
|||
else
|
||||
{
|
||||
<span class="badge badge-@invoice.Status.Status.ToModernStatus().ToString().ToLower()">
|
||||
@invoice.Status.Status.ToModernStatus().ToString() @* @invoice.Status.ToString().ToLower() *@
|
||||
@invoice.Status.Status.ToModernStatus().ToString()
|
||||
@if (invoice.Status.ExceptionStatus != InvoiceExceptionStatus.None)
|
||||
{
|
||||
@String.Format("({0})", @invoice.Status.ExceptionStatus.ToString())
|
||||
;
|
||||
@($"({invoice.Status.ExceptionStatus.ToString()})")
|
||||
}
|
||||
</span>
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue