26 #include <glib/gi18n.h> 34 #include "dialog-find-transactions.h" 37 #include "search-param.h" 38 #include "dialog-utils.h" 40 #define GNC_PREFS_GROUP_SEARCH "dialogs.find" 51 do_find_cb (
QofQuery *query, gpointer user_data, gpointer *result)
54 GNCLedgerDisplay *ledger;
55 gboolean new_ledger = FALSE;
78 gnc_search_dialog_destroy (ftd->sw);
82 free_ftd_cb (gpointer user_data)
93 gnc_ui_find_transactions_dialog_create(GtkWindow *parent, GNCLedgerDisplay * orig_ledg)
97 static GList *params = NULL;
105 params = gnc_search_param_prepend (params, N_(
"All Accounts"),
107 type, SPLIT_TRANS, TRANS_SPLITLIST,
109 params = gnc_search_param_prepend (params, N_(
"Account"), GNC_ID_ACCOUNT,
110 type, SPLIT_ACCOUNT, QOF_PARAM_GUID,
112 params = gnc_search_param_prepend (params, N_(
"Balanced"), NULL,
113 type, SPLIT_TRANS, TRANS_IS_BALANCED,
115 params = gnc_search_param_prepend (params, N_(
"Closing Entries"), NULL,
116 type, SPLIT_TRANS, TRANS_IS_CLOSING,
118 params = gnc_search_param_prepend (params, N_(
"Reconcile"), RECONCILED_MATCH_TYPE,
119 type, SPLIT_RECONCILE, NULL);
120 params = gnc_search_param_prepend (params, N_(
"Share Price"), NULL,
121 type, SPLIT_SHARE_PRICE, NULL);
122 params = gnc_search_param_prepend (params, N_(
"Shares"), NULL,
123 type, SPLIT_AMOUNT, NULL);
124 params = gnc_search_param_prepend (params, N_(
"Value"), NULL,
125 type, SPLIT_VALUE, NULL);
126 params = gnc_search_param_prepend (params, N_(
"Date Posted"), NULL,
127 type, SPLIT_TRANS, TRANS_DATE_POSTED,
129 params = gnc_search_param_prepend (params, N_(
"Reconciled Date"), NULL,
130 type, SPLIT_DATE_RECONCILED, NULL);
131 params = gnc_search_param_prepend (params, (num_action
132 ? N_(
"Number/Action")
133 : N_(
"Action")), NULL,
134 type, SPLIT_ACTION, NULL);
135 params = gnc_search_param_prepend (params, (num_action
136 ? N_(
"Transaction Number")
137 : N_(
"Number")), NULL,
138 type, SPLIT_TRANS, TRANS_NUM, NULL);
140 GList *params2 = NULL;
141 params2 = gnc_search_param_prepend (params2,
"", NULL,
142 type, SPLIT_MEMO, NULL);
143 params2 = gnc_search_param_prepend (params2,
"", NULL,
144 type, SPLIT_TRANS, TRANS_DESCRIPTION,
146 params2 = gnc_search_param_prepend (params2,
"", NULL,
147 type, SPLIT_TRANS, TRANS_NOTES, NULL);
148 params = gnc_search_param_prepend_compound (params,
149 N_(
"Description, Notes, or Memo"),
151 GTK_JUSTIFY_LEFT, SEARCH_PARAM_ANY);
153 params = gnc_search_param_prepend (params, N_(
"Memo"), NULL,
154 type, SPLIT_MEMO, NULL);
155 params = gnc_search_param_prepend (params, N_(
"Notes"), NULL,
156 type, SPLIT_TRANS, TRANS_NOTES, NULL);
157 params = gnc_search_param_prepend (params, N_(
"Description"), NULL,
158 type, SPLIT_TRANS, TRANS_DESCRIPTION,
164 for (l = params; l; l = l->next)
166 GNCSearchParam *param = l->data;
170 if (strcmp (gnc_search_param_get_title (param), N_(
"Action")) == 0)
171 gnc_search_param_set_title (param, N_(
"Number/Action"));
172 if (strcmp (gnc_search_param_get_title (param), N_(
"Number")) == 0)
173 gnc_search_param_set_title (param, N_(
"Transaction Number"));
177 if (strcmp (gnc_search_param_get_title (param), N_(
"Number/Action")) == 0)
178 gnc_search_param_set_title (param, N_(
"Action"));
179 if (strcmp (gnc_search_param_get_title (param), N_(
"Transaction Number")) == 0)
180 gnc_search_param_set_title (param, N_(
"Number"));
199 ftd->parent = parent;
201 ftd->sw = gnc_search_dialog_create (parent, type, _(
"Find Transaction"),
202 params, NULL, start_q, show_q,
203 NULL, do_find_cb, NULL,
204 ftd, free_ftd_cb, GNC_PREFS_GROUP_SEARCH, NULL,
205 "gnc-class-transactions");
void gnc_ledger_display_refresh(GNCLedgerDisplay *ld)
redisplay/redraw only the indicated window.
The instance data structure for a content plugin.
utility functions for the GnuCash UI
gboolean qof_book_use_split_action_for_num_field(const QofBook *book)
Returns TRUE if this book uses split action field as the 'Num' field, FALSE if it uses transaction nu...
QofQuery * qof_query_copy(QofQuery *q)
Make a copy of the indicated query.
void gnc_ledger_display_set_query(GNCLedgerDisplay *ledger_display, Query *q)
Set the query used for a register.
void gnc_main_window_open_page(GncMainWindow *window, GncPluginPage *page)
Display a data plugin page in a window.
Query * gnc_ledger_display_get_query(GNCLedgerDisplay *ld)
return the query associated with a ledger
Functions for adding content to a window.
GncPluginPage * gnc_plugin_page_register_new_ledger(GNCLedgerDisplay *ledger)
Create a new "register" plugin page, given a pointer to an already created ledger.
const gchar * QofIdType
QofIdType declaration.
Functions providing a register page for the GnuCash UI.
void qof_query_destroy(QofQuery *query)
Frees the resources associate with a Query object.
#define ACCOUNT_MATCH_ALL_TYPE
This is the type-override when you want to match all accounts.
void qof_query_set_book(QofQuery *query, QofBook *book)
Set the book to be searched.
#define SPLIT_ACCOUNT_GUID
for guid_match_all
Anchor Scheduled Transaction info in a book.
GNCLedgerDisplay * gnc_ledger_display_find_by_query(Query *q)
If the given ledger display still exists, return it.
GNCLedgerDisplay * gnc_ledger_display_query(Query *query, SplitRegisterType type, SplitRegisterStyle style)
display a general ledger for an arbitrary query
API for Transactions and Splits (journal entries)
QofQuery * qof_query_create(void)
Create a new query.