Add search by line items

This commit is contained in:
Hillel Coren 2022-03-11 10:59:52 +02:00
parent 04e97e5ba4
commit 97708d3aa1
1 changed files with 19 additions and 0 deletions

View File

@ -791,6 +791,25 @@ abstract class InvoiceEntity extends Object
@override
bool matchesFilter(String filter) {
for (var i = 0; i < lineItems.length; i++) {
final lineItem = lineItems[i];
final isMatch = matchesStrings(
haystacks: [
lineItem.productKey,
lineItem.notes,
lineItem.customValue1,
lineItem.customValue2,
lineItem.customValue3,
lineItem.customValue4,
],
needle: filter,
);
if (isMatch) {
return true;
}
}
return matchesStrings(
haystacks: [
number,