26 #include <glib/gi18n.h>
34 #include "dialog-find-transactions.h"
37 #include "search-param.h"
39 #define GNC_PREFS_GROUP_SEARCH "dialogs.find"
49 do_find_cb (
QofQuery *query, gpointer user_data, gpointer *result)
53 gboolean new_ledger = FALSE;
56 ledger = gnc_ledger_display_find_by_query (ftd->ledger_q);
60 ledger = gnc_ledger_display_query (query, SEARCH_LEDGER,
64 gnc_ledger_display_set_query (ledger, query);
66 gnc_ledger_display_refresh (ledger);
76 gnc_search_dialog_destroy (ftd->sw);
80 free_ftd_cb (gpointer user_data)
95 static GList *params = NULL;
103 params = gnc_search_param_prepend (params, N_(
"All Accounts"),
105 type, SPLIT_TRANS, TRANS_SPLITLIST,
107 params = gnc_search_param_prepend (params, N_(
"Account"), GNC_ID_ACCOUNT,
108 type, SPLIT_ACCOUNT, QOF_PARAM_GUID,
110 params = gnc_search_param_prepend (params, N_(
"Balanced"), NULL,
111 type, SPLIT_TRANS, TRANS_IS_BALANCED,
113 params = gnc_search_param_prepend (params, N_(
"Closing Entries"), NULL,
114 type, SPLIT_TRANS, TRANS_IS_CLOSING,
116 params = gnc_search_param_prepend (params, N_(
"Reconcile"), RECONCILED_MATCH_TYPE,
117 type, SPLIT_RECONCILE, NULL);
118 params = gnc_search_param_prepend (params, N_(
"Share Price"), NULL,
119 type, SPLIT_SHARE_PRICE, NULL);
120 params = gnc_search_param_prepend (params, N_(
"Shares"), NULL,
121 type, SPLIT_AMOUNT, NULL);
122 params = gnc_search_param_prepend (params, N_(
"Value"), NULL,
123 type, SPLIT_VALUE, NULL);
124 params = gnc_search_param_prepend (params, N_(
"Date Posted"), NULL,
125 type, SPLIT_TRANS, TRANS_DATE_POSTED,
127 params = gnc_search_param_prepend (params, N_(
"Notes"), NULL,
128 type, SPLIT_TRANS, TRANS_NOTES, NULL);
129 params = gnc_search_param_prepend (params, (num_action
130 ? N_(
"Number/Action")
131 : N_(
"Action")), NULL,
132 type, SPLIT_ACTION, NULL);
133 params = gnc_search_param_prepend (params, (num_action
134 ? N_(
"Transaction Number")
135 : N_(
"Number")), NULL,
136 type, SPLIT_TRANS, TRANS_NUM, NULL);
137 params = gnc_search_param_prepend (params, N_(
"Memo"), NULL,
138 type, SPLIT_MEMO, NULL);
139 params = gnc_search_param_prepend (params, N_(
"Description"), NULL,
140 type, SPLIT_TRANS, TRANS_DESCRIPTION,
146 for (l = params; l; l = l->next)
152 if (strcmp (param->title, N_(
"Action")) == 0)
153 gnc_search_param_set_title (param, N_(
"Number/Action"));
154 if (strcmp (param->title, N_(
"Number")) == 0)
155 gnc_search_param_set_title (param, N_(
"Transaction Number"));
159 if (strcmp (param->title, N_(
"Number/Action")) == 0)
160 gnc_search_param_set_title (param, N_(
"Action"));
161 if (strcmp (param->title, N_(
"Transaction Number")) == 0)
162 gnc_search_param_set_title (param, N_(
"Number"));
171 ftd->ledger_q = gnc_ledger_display_get_query (orig_ledg);
197 xaccQueryAddAccountMatch( start_q, al, QOF_GUID_MATCH_NONE, QOF_QUERY_AND );
206 ftd->sw = gnc_search_dialog_create (type, _(
"Find Transaction"),
207 params, NULL, start_q, show_q,
208 NULL, do_find_cb, NULL,
209 ftd, free_ftd_cb, GNC_PREFS_GROUP_SEARCH, NULL);
utility functions for the GnuCash UI
gboolean qof_book_use_split_action_for_num_field(const QofBook *book)
QofQuery * qof_query_copy(QofQuery *q)
Account * gnc_book_get_template_root(const QofBook *book)
struct _QofQuery QofQuery
void gnc_main_window_open_page(GncMainWindow *window, GncPluginPage *page)
Functions for adding content to a window.
GncPluginPage * gnc_plugin_page_register_new_ledger(GNCLedgerDisplay *ledger)
Functions providing a register page for the GnuCash UI.
void qof_query_destroy(QofQuery *q)
#define ACCOUNT_MATCH_ALL_TYPE
void qof_query_set_book(QofQuery *q, QofBook *book)
#define SPLIT_ACCOUNT_GUID
Anchor Scheduled Transaction info in a book. See src/doc/books.txt for design overview.
GList * gnc_account_get_descendants(const Account *account)
API for Transactions and Splits (journal entries)
QofQuery * qof_query_create(void)