diff --git a/doc/win-account.html b/doc/win-account.html index 8746090..4d7e12d 100644 --- a/doc/win-account.html +++ b/doc/win-account.html @@ -22,7 +22,7 @@

Balance

The balance area contains the balance summary of the account, see this page for details. If the minor option is checked in the preferences, a minor toggle button appear here, see this page for details.

Quick search

-

The quick search will permit to filter the transaction list instantly on text column. The search apply to all columns except status, date and amount columns.

+

The quick search will permit to filter the transaction list instantly on text column. The search apply to all columns except status and date columns.

Quick filter area

On the left, the account title is displayed.
Theses widgets will enable you to quickly filter the transaction list without opening the filter dialog.

diff --git a/src/hb-filter.c b/src/hb-filter.c index 80570a1..cce644d 100644 --- a/src/hb-filter.c +++ b/src/hb-filter.c @@ -594,9 +594,16 @@ gchar *tags; retval |= filter_text_compare(tags, needle, FALSE); } g_free(tags); - //if(retval) goto end; + if(retval) goto end; } + if(flags & FLT_QSEARCH_AMMOUNT) { + gchar formatd_buf[G_ASCII_DTOSTR_BUF_SIZE]; + gdouble monval; + monval = hb_amount_round(txn->amount, 2); + g_ascii_formatd(formatd_buf, sizeof (formatd_buf), "%.2f", monval); + retval |= filter_text_compare(formatd_buf, needle, FALSE); + } end: return retval; diff --git a/src/hb-filter.h b/src/hb-filter.h index d68d15f..0ab7ff3 100644 --- a/src/hb-filter.h +++ b/src/hb-filter.h @@ -85,7 +85,8 @@ enum FLT_QSEARCH_INFO = 1<<1, FLT_QSEARCH_PAYEE = 1<<2, FLT_QSEARCH_CATEGORY = 1<<3, - FLT_QSEARCH_TAGS = 1<<4 + FLT_QSEARCH_TAGS = 1<<4, + FLT_QSEARCH_AMMOUNT = 1<<5 }; diff --git a/src/list_operation.c b/src/list_operation.c index 998bf90..3211243 100644 --- a/src/list_operation.c +++ b/src/list_operation.c @@ -543,11 +543,14 @@ gint id; id = gtk_tree_view_column_get_sort_column_id (column); switch(id) { - case LST_DSPOPE_WORDING: mask |= FLT_QSEARCH_MEMO; break; - case LST_DSPOPE_INFO: mask |= FLT_QSEARCH_INFO; break; - case LST_DSPOPE_PAYEE: mask |= FLT_QSEARCH_PAYEE; break; + case LST_DSPOPE_WORDING: mask |= FLT_QSEARCH_MEMO; break; + case LST_DSPOPE_INFO: mask |= FLT_QSEARCH_INFO; break; + case LST_DSPOPE_PAYEE: mask |= FLT_QSEARCH_PAYEE; break; case LST_DSPOPE_CATEGORY: mask |= FLT_QSEARCH_CATEGORY; break; - case LST_DSPOPE_TAGS: mask |= FLT_QSEARCH_TAGS; break; + case LST_DSPOPE_TAGS: mask |= FLT_QSEARCH_TAGS; break; + case LST_DSPOPE_EXPENSE: + case LST_DSPOPE_INCOME: mask |= FLT_QSEARCH_AMMOUNT; break; + } } }