Correct task selector
This commit is contained in:
parent
68664844a1
commit
47e769653b
|
|
@ -257,7 +257,9 @@ List<String> clientExpenseList(
|
||||||
BuiltMap<String, ExpenseEntity> expenseMap, String clientId) {
|
BuiltMap<String, ExpenseEntity> expenseMap, String clientId) {
|
||||||
final list = expenseMap.keys.where((expenseid) {
|
final list = expenseMap.keys.where((expenseid) {
|
||||||
final expense = expenseMap[expenseid];
|
final expense = expenseMap[expenseid];
|
||||||
if ((clientId ?? '').isNotEmpty && expense.clientId != clientId) {
|
if ((clientId ?? '').isNotEmpty &&
|
||||||
|
(expense.clientId ?? '').isNotEmpty &&
|
||||||
|
expense.clientId != clientId) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return expense.isActive && !expense.isInvoiced;
|
return expense.isActive && !expense.isInvoiced;
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,9 @@ List<String> taskList(
|
||||||
BuiltMap<String, ProjectEntity> projectMap) {
|
BuiltMap<String, ProjectEntity> projectMap) {
|
||||||
final list = taskMap.keys.where((taskId) {
|
final list = taskMap.keys.where((taskId) {
|
||||||
final task = taskMap[taskId];
|
final task = taskMap[taskId];
|
||||||
if ((clientId ?? '').isNotEmpty && task.clientId != clientId) {
|
if ((clientId ?? '').isNotEmpty &&
|
||||||
|
(task.clientId ?? '').isNotEmpty &&
|
||||||
|
task.clientId != clientId) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return task.isActive && task.isStopped && !task.isInvoiced;
|
return task.isActive && task.isStopped && !task.isInvoiced;
|
||||||
|
|
|
||||||
|
|
@ -138,9 +138,13 @@ class _InvoiceItemSelectorState extends State<InvoiceItemSelector>
|
||||||
return entity.isActive && entity.matchesFilter(_filter);
|
return entity.isActive && entity.matchesFilter(_filter);
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
final tasks = memoizedTaskList(state.taskState.map, _filterClientId,
|
final tasks = memoizedTaskList(
|
||||||
state.userState.map, state.clientState.map, state.projectState.map)
|
state.taskState.map,
|
||||||
.where((entityId) {
|
_filterClientId,
|
||||||
|
state.userState.map,
|
||||||
|
state.clientState.map,
|
||||||
|
state.projectState.map,
|
||||||
|
).where((entityId) {
|
||||||
final task = state.taskState.get(entityId);
|
final task = state.taskState.get(entityId);
|
||||||
final client = state.clientState.get(task.clientId);
|
final client = state.clientState.get(task.clientId);
|
||||||
if (widget.excluded != null && widget.excluded.contains(task)) {
|
if (widget.excluded != null && widget.excluded.contains(task)) {
|
||||||
|
|
@ -149,9 +153,10 @@ class _InvoiceItemSelectorState extends State<InvoiceItemSelector>
|
||||||
return task.matchesFilter(_filter) || client.matchesName(_filter);
|
return task.matchesFilter(_filter) || client.matchesName(_filter);
|
||||||
}).toList();
|
}).toList();
|
||||||
|
|
||||||
final expenses =
|
final expenses = memoizedClientExpenseList(
|
||||||
memoizedClientExpenseList(state.expenseState.map, _filterClientId)
|
state.expenseState.map,
|
||||||
.where((entityId) {
|
_filterClientId,
|
||||||
|
).where((entityId) {
|
||||||
final expense = state.expenseState.get(entityId);
|
final expense = state.expenseState.get(entityId);
|
||||||
final client = state.clientState.get(expense.clientId);
|
final client = state.clientState.get(expense.clientId);
|
||||||
if (widget.excluded != null && widget.excluded.contains(expense)) {
|
if (widget.excluded != null && widget.excluded.contains(expense)) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue