diff --git a/src/accounting/models.py b/src/accounting/models.py index 470e148..32e8e76 100644 --- a/src/accounting/models.py +++ b/src/accounting/models.py @@ -760,7 +760,7 @@ class JournalEntryLineItem(db.Model): setattr(self, "__net_balance", net_balance) @property - def query_values(self) -> tuple[list[str], list[str]]: + def query_values(self) -> list[str]: """Returns the values to be queried. :return: The values to be queried. @@ -772,17 +772,17 @@ class JournalEntryLineItem(db.Model): journal_entry_day: date = self.journal_entry.date description: str = "" if self.description is None else self.description - return ([description], - [str(journal_entry_day.year), - "{}/{}".format(journal_entry_day.year, - journal_entry_day.month), - "{}/{}".format(journal_entry_day.month, - journal_entry_day.day), - "{}/{}/{}".format(journal_entry_day.year, - journal_entry_day.month, - journal_entry_day.day), - format_amount(self.amount), - format_amount(self.net_balance)]) + return [description, + str(journal_entry_day.year), + "{}/{}".format(journal_entry_day.year, + journal_entry_day.month), + "{}/{}".format(journal_entry_day.month, + journal_entry_day.day), + "{}/{}/{}".format(journal_entry_day.year, + journal_entry_day.month, + journal_entry_day.day), + format_amount(self.amount), + format_amount(self.net_balance)] class Option(db.Model): diff --git a/src/accounting/static/js/original-line-item-selector.js b/src/accounting/static/js/original-line-item-selector.js index 2278e5c..24b62ec 100644 --- a/src/accounting/static/js/original-line-item-selector.js +++ b/src/accounting/static/js/original-line-item-selector.js @@ -273,7 +273,7 @@ class OriginalLineItem { /** * The values to query against - * @type {string[][]} + * @type {string[]} */ #queryValues; @@ -366,16 +366,11 @@ class OriginalLineItem { if (query === "") { return true; } - for (const queryValue of this.#queryValues[0]) { + for (const queryValue of this.#queryValues) { if (queryValue.toLowerCase().includes(query.toLowerCase())) { return true; } } - for (const queryValue of this.#queryValues[1]) { - if (queryValue === query) { - return true; - } - } return false; }