diff --git a/BTCPayServer/Controllers/InvoiceController.UI.cs b/BTCPayServer/Controllers/InvoiceController.UI.cs index a902ee263..e5ef213e8 100644 --- a/BTCPayServer/Controllers/InvoiceController.UI.cs +++ b/BTCPayServer/Controllers/InvoiceController.UI.cs @@ -398,11 +398,15 @@ namespace BTCPayServer.Controllers [BitpayAPIConstraint(false)] public async Task ListInvoices(string searchTerm = null, int skip = 0, int count = 50, int timezoneOffset = 0) { + var fs = new SearchString(searchTerm); + var storeIds = fs.GetFilterArray("storeid") != null ? fs.GetFilterArray("storeid") : new List().ToArray(); + var model = new InvoicesModel { SearchTerm = searchTerm, Skip = skip, Count = count, + StoreIds = storeIds, TimezoneOffset = timezoneOffset }; InvoiceQuery invoiceQuery = GetInvoiceQuery(searchTerm, timezoneOffset); diff --git a/BTCPayServer/Models/InvoicingModels/InvoicesModel.cs b/BTCPayServer/Models/InvoicingModels/InvoicesModel.cs index 26bcddfed..f516ec091 100644 --- a/BTCPayServer/Models/InvoicingModels/InvoicesModel.cs +++ b/BTCPayServer/Models/InvoicingModels/InvoicesModel.cs @@ -13,8 +13,8 @@ namespace BTCPayServer.Models.InvoicingModels public int Total { get; set; } public string SearchTerm { get; set; } public int? TimezoneOffset { get; set; } - public List Invoices { get; set; } = new List(); + public string[] StoreIds { get; set; } } public class InvoiceModel diff --git a/BTCPayServer/Views/Invoice/ListInvoices.cshtml b/BTCPayServer/Views/Invoice/ListInvoices.cshtml index daabddd24..5dd86093f 100644 --- a/BTCPayServer/Views/Invoice/ListInvoices.cshtml +++ b/BTCPayServer/Views/Invoice/ListInvoices.cshtml @@ -73,17 +73,25 @@ + + @{ + var storeIds = String.Join( + "", + Model.StoreIds.Select(storeId => string.Format(",storeid:{0}", storeId)) + ); + } +