diff --git a/lib/redux/invoice/invoice_selectors.dart b/lib/redux/invoice/invoice_selectors.dart index eed60ad2b..3645eeeca 100644 --- a/lib/redux/invoice/invoice_selectors.dart +++ b/lib/redux/invoice/invoice_selectors.dart @@ -72,10 +72,6 @@ List filteredInvoicesSelector( } } - if (invoiceListState.filterEntityId != null) { - } else if (!client.isActive) { - return false; - } if (!invoice.matchesStates(invoiceListState.stateFilters)) { return false; diff --git a/lib/redux/quote/quote_selectors.dart b/lib/redux/quote/quote_selectors.dart index 226de4eeb..828bd846d 100644 --- a/lib/redux/quote/quote_selectors.dart +++ b/lib/redux/quote/quote_selectors.dart @@ -24,12 +24,21 @@ List filteredQuotesSelector( final client = clientMap[quote.clientId] ?? ClientEntity(id: quote.clientId); - if (quoteListState.filterEntityId != null) { + + if (quoteListState.filterEntityType == EntityType.client) { if (!quoteListState.entityMatchesFilter(client)) { return false; } - } else if (!client.isActive) { - return false; + } else { + if (!client.isActive) { + return false; + } + + if (quoteListState.filterEntityType == EntityType.user) { + if (!quote.userCanAccess(quoteListState.filterEntityId)) { + return false; + } + } } if (!quote.matchesStates(quoteListState.stateFilters)) {