34 #include <glib/gi18n.h>
35 #ifdef __G_IR_SCANNER__
36 #undef __G_IR_SCANNER__
38 #include <gdk/gdkkeysyms.h>
43 #include "dialog-transfer.h"
44 #include "dialog-utils.h"
45 #include "gnc-amount-edit.h"
46 #include "gnc-component-manager.h"
47 #include "gnc-date-edit.h"
53 #include "gnc-plugin-page-register2.h"
56 #include "gnc-ui-balances.h"
57 #include "guile-util.h"
58 #include "reconcile-view.h"
59 #include "window-reconcile2.h"
61 #define WINDOW_RECONCILE_CM_CLASS "window-reconcile"
62 #define GNC_PREF_AUTO_INTEREST_TRANSFER "auto-interest-transfer"
63 #define GNC_PREF_AUTO_CC_PAYMENT "auto-cc-payment"
64 #define GNC_PREF_ALWAYS_REC_TO_TODAY "always-reconcile-to-today"
78 GtkUIManager *ui_merge;
79 GtkActionGroup *action_group;
84 GtkWidget *reconciled;
85 GtkWidget *difference;
87 GtkWidget *total_debit;
88 GtkWidget *total_credit;
93 GtkWidget *debit_frame;
94 GtkWidget *credit_frame;
96 gboolean delete_refresh;
110 GtkWidget *startRecnWindow;
111 GtkWidget *xfer_button;
112 GtkWidget *date_value;
115 gboolean user_set_value;
118 gboolean include_children;
128 #define account_type_has_auto_interest_charge(type) (((type) == ACCT_TYPE_CREDIT) || \
129 ((type) == ACCT_TYPE_LIABILITY) ||\
130 ((type) == ACCT_TYPE_PAYABLE))
132 #define account_type_has_auto_interest_payment(type) (((type) == ACCT_TYPE_BANK) || \
133 ((type) == ACCT_TYPE_ASSET) || \
134 ((type) == ACCT_TYPE_MUTUAL) || \
135 ((type) == ACCT_TYPE_RECEIVABLE))
137 #define account_type_has_auto_interest_xfer(type) \
138 ( account_type_has_auto_interest_charge(type) || \
139 account_type_has_auto_interest_payment(type) )
144 static void recn_destroy_cb (GtkWidget *w, gpointer data);
146 static gboolean recn_delete_cb (GtkWidget *widget, GdkEvent *event, gpointer data);
147 static gboolean recn_key_press_cb (GtkWidget *widget, GdkEventKey *event, gpointer data);
148 static void recnFinishCB (GtkAction *action,
RecnWindow2 *recnData);
149 static void recnPostponeCB (GtkAction *action, gpointer data);
150 static void recnCancelCB (GtkAction *action, gpointer data);
155 static void gnc_reconcile_window_set_sensitivity (
RecnWindow2 *recnData);
156 static char * gnc_recn_make_window_name (
Account *account);
157 static void gnc_recn_set_window_name (
RecnWindow2 *recnData);
158 static gboolean find_by_account (gpointer
find_data, gpointer user_data);
163 G_GNUC_UNUSED
static QofLogModule log_module = GNC_MOD_GUI;
165 static time64 gnc_reconcile_last_statement_date = 0;
174 static GtkActionEntry recnWindow2_actions [];
176 static guint recnWindow2_n_actions;
188 if (recnData == NULL)
191 gnc_reconcile_view_refresh (GNC_RECONCILE_VIEW (recnData->debit));
192 gnc_reconcile_view_refresh (GNC_RECONCILE_VIEW (recnData->credit));
194 gnc_reconcile_window_set_sensitivity (recnData);
196 gnc_recn_set_window_name (recnData);
198 recnRecalculateBalance (recnData);
200 gtk_widget_queue_resize (recnData->window);
234 gboolean reverse_balance, include_children;
237 account = recn_get_account (recnData);
239 return gnc_numeric_zero ();
241 reverse_balance = gnc_reverse_balance (account);
245 starting = gnc_ui_account_get_reconciled_balance (account, include_children);
246 print_info = gnc_account_print_info (account, TRUE);
255 amount = xaccPrintAmount (starting, print_info);
256 gnc_set_label_color (recnData->starting, starting);
257 gtk_label_set_text (GTK_LABEL (recnData->starting), amount);
263 gtk_label_set_text (GTK_LABEL (recnData->recn_date), amount);
266 ending = recnData->new_ending;
269 amount = xaccPrintAmount (ending, print_info);
270 gnc_set_label_color (recnData->ending, ending);
271 gtk_label_set_text (GTK_LABEL (recnData->ending), amount);
275 debit = gnc_reconcile_view_reconciled_balance
276 (GNC_RECONCILE_VIEW (recnData->debit));
278 credit = gnc_reconcile_view_reconciled_balance
279 (GNC_RECONCILE_VIEW (recnData->credit));
282 amount = xaccPrintAmount (debit, print_info);
283 gtk_label_set_text (GTK_LABEL (recnData->total_debit), amount);
285 amount = xaccPrintAmount (credit, print_info);
287 gtk_label_set_text (GTK_LABEL (recnData->total_credit), amount);
290 reconciled = gnc_numeric_add_fixed (starting,
291 gnc_numeric_sub_fixed (debit, credit));
294 amount = xaccPrintAmount (reconciled, print_info);
295 gnc_set_label_color (recnData->reconciled, reconciled);
296 gtk_label_set_text (GTK_LABEL (recnData->reconciled), amount);
301 diff = gnc_numeric_sub_fixed (ending, reconciled);
304 amount = xaccPrintAmount (diff, print_info);
305 gnc_set_label_color (recnData->difference, diff);
306 gtk_label_set_text (GTK_LABEL (recnData->difference), amount);
310 action = gtk_action_group_get_action (recnData->action_group,
314 action = gtk_action_group_get_action (recnData->action_group,
315 "TransBalanceAction");
323 gnc_start_recn2_update_cb (GtkWidget *widget, GdkEventFocus *event,
328 gnc_amount_edit_evaluate (GNC_AMOUNT_EDIT (data->end_value));
330 value = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (data->end_value));
347 if (data->user_set_value)
349 new_date = gnc_date_edit_get_date_end (gde);
351 new_balance = gnc_ui_account_get_balance_as_of_date (data->account, new_date,
352 data->include_children);
354 gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (data->end_value),
362 data->include_children =
363 gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
366 gnc_start_recn2_date_changed (data->date_value, data);
376 gnc_recn_interest_xfer_get_auto_interest_xfer_allowed (
Account *account)
380 auto_xfer =
gnc_prefs_get_bool (GNC_PREFS_GROUP_RECONCILE, GNC_PREF_AUTO_INTEREST_TRANSFER);
404 gnc_recn_make_interest_window_name (
Account *account,
char *text)
410 title = g_strconcat (fullname,
" - ", text && *text ? _(text) :
"", NULL);
422 gnc_recn_interest_xfer_no_auto_clicked_cb (GtkButton *button,
431 gnc_xfer_dialog_close (data->xferData);
434 if (data->xfer_button)
435 gtk_widget_set_sensitive (GTK_WIDGET (data->xfer_button), TRUE);
444 if (!account_type_has_auto_interest_xfer (data->account_type))
return;
447 data->xferData = gnc_xfer_dialog (GTK_WIDGET(data->startRecnWindow),
453 if ( account_type_has_auto_interest_payment (data->account_type))
454 title = gnc_recn_make_interest_window_name (data->account,
455 _(
"Interest Payment"));
457 title = gnc_recn_make_interest_window_name (data->account,
458 _(
"Interest Charge"));
460 gnc_xfer_dialog_set_title (data->xferData, title);
465 gnc_xfer_dialog_set_information_label (data->xferData,
466 _(
"Payment Information"));
473 if (account_type_has_auto_interest_payment (data->account_type))
475 gnc_xfer_dialog_set_from_account_label (data->xferData,
477 gnc_xfer_dialog_set_from_show_button_active( data->xferData, TRUE);
481 gnc_xfer_dialog_set_to_account_label (data->xferData,
482 _(
"Reconcile Account"));
483 gnc_xfer_dialog_select_to_account (data->xferData, data->account);
484 gnc_xfer_dialog_lock_to_account_tree (data->xferData );
487 gnc_xfer_dialog_quickfill_to_account (data->xferData, TRUE);
491 gnc_xfer_dialog_set_from_account_label (data->xferData,
492 _(
"Reconcile Account"));
493 gnc_xfer_dialog_select_from_account (data->xferData, data->account);
494 gnc_xfer_dialog_lock_from_account_tree (data->xferData);
496 gnc_xfer_dialog_set_to_account_label (data->xferData,
498 gnc_xfer_dialog_set_to_show_button_active (data->xferData, TRUE);
503 gnc_xfer_dialog_quickfill_to_account (data->xferData, FALSE);
508 gnc_xfer_dialog_add_user_specified_button (data->xferData,
509 ( account_type_has_auto_interest_payment (data->account_type) ?
510 _(
"No Auto Interest Payments for this Account")
511 : _(
"No Auto Interest Charges for this Account")),
512 G_CALLBACK (gnc_recn_interest_xfer_no_auto_clicked_cb),
516 gnc_xfer_dialog_toggle_currency_table (data->xferData, FALSE);
519 gnc_xfer_dialog_set_date (data->xferData, data->date);
528 if (!gnc_xfer_dialog_run_until_done (data->xferData))
529 if (data->xfer_button)
530 gtk_widget_set_sensitive (GTK_WIDGET (data->xfer_button), TRUE);
533 data->xferData = NULL;
543 GtkWidget *entry = gnc_amount_edit_gtk_entry (
544 GNC_AMOUNT_EDIT(data->end_value));
546 GNC_AMOUNT_EDIT(data->end_value));
549 recnInterestXferWindow (data);
557 if (gnc_reverse_balance (data->account))
560 gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (data->end_value), after);
561 gtk_widget_grab_focus (GTK_WIDGET (entry));
562 gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1);
563 data->original_value = after;
564 data->user_set_value = FALSE;
577 if (data->xfer_button)
578 gtk_widget_set_sensitive (GTK_WIDGET (data->xfer_button), FALSE);
581 gnc_reconcile_interest_xfer_run (data);
586 gnc_save_reconcile_interval (
Account *account,
time64 statement_date)
588 time64 prev_statement_date;
589 int days = 0, months = 0;
598 seconds =
gnc_difftime (statement_date, prev_statement_date);
599 days = (int)(seconds / 60 / 60 / 24);
607 int prev_days = 0, prev_months = 1;
611 if (prev_months == 1)
619 struct tm current, prev;
623 months = ((12 * current.tm_year + current.tm_mon) -
624 (12 * prev.tm_year + prev.tm_mon));
631 if (months >= 0 && days >= 0)
651 startRecnWindow (GtkWidget *parent,
Account *account,
653 gboolean enable_subaccount)
655 GtkWidget *dialog, *end_value, *date_value, *include_children_button;
658 gboolean auto_interest_xfer_option;
670 data.account = account;
672 data.date = *statement_date;
675 auto_interest_xfer_option =
676 gnc_recn_interest_xfer_get_auto_interest_xfer_allowed (account);
680 ending = gnc_ui_account_get_reconciled_balance (account,
681 data.include_children);
682 print_info = gnc_account_print_info (account, TRUE);
692 builder = gtk_builder_new();
693 gnc_builder_add_from_file (builder,
"window-reconcile.glade",
"Reconcile Start Dialog");
695 dialog = GTK_WIDGET(gtk_builder_get_object (builder,
"Reconcile Start Dialog"));
697 title = gnc_recn_make_window_name (account);
698 gtk_window_set_title (GTK_WINDOW (dialog), title);
701 data.startRecnWindow = GTK_WIDGET (dialog);
704 gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
707 GtkWidget *start_value, *box;
708 GtkWidget *entry, *label;
709 GtkWidget *interest = NULL;
711 start_value = GTK_WIDGET (gtk_builder_get_object (builder,
"start_value"));
712 gtk_label_set_text (GTK_LABEL(start_value), xaccPrintAmount (ending, print_info));
714 include_children_button = GTK_WIDGET (gtk_builder_get_object (builder,
"subaccount_check"));
715 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (include_children_button),
716 data.include_children);
717 gtk_widget_set_sensitive (include_children_button, enable_subaccount);
719 date_value = gnc_date_edit_new (*statement_date, FALSE, FALSE);
720 data.date_value = date_value;
721 box = GTK_WIDGET (gtk_builder_get_object (builder,
"date_value_box"));
722 gtk_box_pack_start (GTK_BOX (box), date_value, TRUE, TRUE, 0);
723 label = GTK_WIDGET (gtk_builder_get_object (builder,
"date_label"));
724 gnc_date_make_mnemonic_target (GNC_DATE_EDIT (date_value), label);
726 end_value = gnc_amount_edit_new ();
727 data.end_value = GNC_AMOUNT_EDIT (end_value);
728 data.original_value = *new_ending;
729 data.user_set_value = FALSE;
730 box = GTK_WIDGET (gtk_builder_get_object (builder,
"ending_value_box"));
731 gtk_box_pack_start (GTK_BOX (box), end_value, TRUE, TRUE, 0);
732 label = GTK_WIDGET (gtk_builder_get_object (builder,
"end_label"));
733 gtk_label_set_mnemonic_widget (GTK_LABEL (label), end_value);
735 gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, &data);
737 gnc_date_activates_default (GNC_DATE_EDIT (date_value), TRUE);
740 g_signal_connect ( G_OBJECT (date_value),
"date_changed",
741 G_CALLBACK (gnc_start_recn2_date_changed), (gpointer) &data );
743 print_info.use_symbol = 0;
744 gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (end_value), print_info);
745 gnc_amount_edit_set_fraction (GNC_AMOUNT_EDIT (end_value),
748 gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (end_value), *new_ending);
750 entry = gnc_amount_edit_gtk_entry (GNC_AMOUNT_EDIT (end_value));
751 gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1);
752 g_signal_connect (G_OBJECT (entry),
"focus-out-event",
753 G_CALLBACK (gnc_start_recn2_update_cb), (gpointer) &data);
754 gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
760 interest = GTK_WIDGET(gtk_builder_get_object (builder,
"interest_button"));
761 if ( account_type_has_auto_interest_payment( data.account_type ) )
762 gtk_button_set_label (GTK_BUTTON (interest), _(
"Enter _Interest Payment...") );
763 else if ( account_type_has_auto_interest_charge( data.account_type ) )
764 gtk_button_set_label (GTK_BUTTON (interest), _(
"Enter _Interest Charge...") );
767 gtk_widget_destroy (interest);
773 data.xfer_button = interest;
774 if ( auto_interest_xfer_option )
775 gtk_widget_set_sensitive (GTK_WIDGET (interest), FALSE);
778 gtk_widget_show_all (dialog);
780 gtk_widget_grab_focus(gnc_amount_edit_gtk_entry
781 (GNC_AMOUNT_EDIT (end_value)));
786 if (account_type_has_auto_interest_xfer (data.account_type)
787 && auto_interest_xfer_option)
789 gnc_reconcile_interest_xfer_run (&data);
792 result = gtk_dialog_run (GTK_DIALOG (dialog));
793 if (result == GTK_RESPONSE_OK)
795 *new_ending = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (end_value));
796 *statement_date = gnc_date_edit_get_date_end (GNC_DATE_EDIT (date_value));
798 if (gnc_reverse_balance (account))
803 gnc_save_reconcile_interval (account, *statement_date);
805 gtk_widget_destroy (dialog);
806 g_object_unref (G_OBJECT (builder));
808 return (result == GTK_RESPONSE_OK);
813 gnc_reconcile_window_set_sensitivity (
RecnWindow2 *recnData)
815 gboolean sensitive = FALSE;
819 view = GNC_RECONCILE_VIEW (recnData->debit);
820 if (gnc_reconcile_view_num_selected (view) == 1)
823 view = GNC_RECONCILE_VIEW (recnData->credit);
824 if (gnc_reconcile_view_num_selected (view) == 1)
827 action = gtk_action_group_get_action (recnData->action_group,
829 gtk_action_set_sensitive (action, sensitive);
830 action = gtk_action_group_get_action (recnData->action_group,
831 "TransDeleteAction");
832 gtk_action_set_sensitive (action, sensitive);
836 view = GNC_RECONCILE_VIEW (recnData->debit);
837 if (gnc_reconcile_view_num_selected (view) > 0)
840 view = GNC_RECONCILE_VIEW (recnData->credit);
841 if (gnc_reconcile_view_num_selected (view) > 0)
844 action = gtk_action_group_get_action (recnData->action_group,
846 gtk_action_set_sensitive (action, sensitive);
847 action = gtk_action_group_get_action (recnData->action_group,
849 gtk_action_set_sensitive (action, sensitive);
858 gnc_reconcile_window_set_sensitivity (recnData);
859 recnRecalculateBalance (recnData);
868 gnc_reconcile_window_set_sensitivity (recnData);
885 do_popup_menu (
RecnWindow2 *recnData, GdkEventButton *event)
888 int button, event_time;
890 menu = gtk_ui_manager_get_widget (recnData->ui_merge,
"/MainPopup");
898 button =
event->button;
899 event_time =
event->time;
904 event_time = gtk_get_current_event_time ();
907 gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, button, event_time);
925 gnc_reconcile_window_popup_menu_cb (GtkWidget *widget,
928 do_popup_menu (recnData, NULL);
938 gnc_reconcile_window_button_press_cb (GtkWidget *widget,
939 GdkEventButton *event,
944 GtkTreeSelection *selection;
947 model = gtk_tree_view_get_model (GTK_TREE_VIEW (qview));
949 if (event->button == 3 && event->type == GDK_BUTTON_PRESS)
953 gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (qview),
956 &path, NULL, NULL, NULL);
958 selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (qview));
959 gtk_tree_selection_select_path (selection, path);
960 gtk_tree_path_free (path);
961 do_popup_menu (recnData, event);
969 gnc_reconcile_window_open_register (
RecnWindow2 *recnData)
971 Account *account = recn_get_account (recnData);
974 gboolean include_children;
983 gnc_split_reg2_raise (gsr);
999 gsr = gnc_reconcile_window_open_register (recnData);
1002 gnc_split_reg2_jump_to_split (gsr, split);
1007 gnc_reconcile_window_focus_cb (GtkWidget *widget, GdkEventFocus *event,
1014 this_view = GNC_RECONCILE_VIEW (widget);
1016 debit = GNC_RECONCILE_VIEW (recnData->debit);
1017 credit = GNC_RECONCILE_VIEW (recnData->credit);
1019 other_view = GNC_RECONCILE_VIEW (this_view == debit ? credit : debit);
1022 gnc_reconcile_view_unselect_all (other_view);
1027 gnc_reconcile_key_press_cb (GtkWidget *widget, GdkEventKey *event,
1031 GtkWidget *this_view, *other_view;
1032 GtkWidget *debit, *credit;
1034 switch (event->keyval)
1037 case GDK_ISO_Left_Tab:
1044 g_signal_stop_emission_by_name (widget,
"key_press_event");
1048 debit = recnData->debit;
1049 credit = recnData->credit;
1051 other_view = (this_view == debit ? credit : debit);
1053 gtk_widget_grab_focus (other_view);
1060 gnc_reconcile_window_set_titles (
RecnWindow2 *recnData)
1068 title = _(
"Debits");
1072 gtk_frame_set_label (GTK_FRAME (recnData->debit_frame), title);
1078 title = _(
"Credits");
1082 gtk_frame_set_label (GTK_FRAME (recnData->credit_frame), title);
1090 gnc_reconcile_window_create_view_box (
Account *account,
1091 GNCReconcileViewType type,
1093 GtkWidget **list_save,
1094 GtkWidget **total_save)
1096 GtkWidget *frame, *scrollWin, *view, *vbox, *label, *hbox;
1098 frame = gtk_frame_new (NULL);
1100 if (type == RECLIST_DEBIT)
1101 recnData->debit_frame = frame;
1103 recnData->credit_frame = frame;
1105 vbox = gtk_vbox_new (FALSE, 5);
1107 view = gnc_reconcile_view_new(account, type, recnData->statement_date);
1110 g_signal_connect (view,
"toggle_reconciled",
1111 G_CALLBACK (gnc_reconcile_window_toggled_cb),
1113 g_signal_connect (view,
"line_selected",
1114 G_CALLBACK (gnc_reconcile_window_row_cb),
1116 g_signal_connect (view,
"button_press_event",
1117 G_CALLBACK (gnc_reconcile_window_button_press_cb),
1119 g_signal_connect (view,
"double_click_split",
1120 G_CALLBACK (gnc_reconcile_window_double_click_cb),
1122 g_signal_connect (view,
"focus_in_event",
1123 G_CALLBACK (gnc_reconcile_window_focus_cb),
1125 g_signal_connect (view,
"key_press_event",
1126 G_CALLBACK (gnc_reconcile_key_press_cb),
1129 scrollWin = gtk_scrolled_window_new (NULL, NULL);
1130 gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrollWin),
1131 GTK_POLICY_AUTOMATIC,
1132 GTK_POLICY_AUTOMATIC);
1133 gtk_container_set_border_width (GTK_CONTAINER (scrollWin), 5);
1135 gtk_container_add (GTK_CONTAINER (frame), scrollWin);
1136 gtk_container_add (GTK_CONTAINER (scrollWin), view);
1137 gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
1139 hbox = gtk_hbox_new (FALSE, 5);
1140 gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
1142 label = gtk_label_new (_(
"Total:"));
1143 gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
1144 gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
1146 label = gtk_label_new(
"");
1147 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
1148 *total_save = label;
1155 gnc_reconcile_window_get_current_split (
RecnWindow2 *recnData)
1160 view = GNC_RECONCILE_VIEW (recnData->debit);
1161 split = gnc_reconcile_view_get_current_split (view);
1165 view = GNC_RECONCILE_VIEW (recnData->credit);
1166 split = gnc_reconcile_view_get_current_split (view);
1173 gnc_ui_reconcile_window_help_cb (GtkWidget *widget, gpointer data)
1180 gnc_ui_reconcile_window_change_cb (GtkAction *action, gpointer data)
1183 Account *account = recn_get_account (recnData);
1185 time64 statement_date = recnData->statement_date;
1187 if (gnc_reverse_balance (account))
1189 if (startRecnWindow (recnData->window, account, &new_ending, &statement_date,
1192 recnData->new_ending = new_ending;
1193 recnData->statement_date = statement_date;
1194 recnRecalculateBalance (recnData);
1200 gnc_ui_reconcile_window_balance_cb (GtkButton *button, gpointer data)
1209 gsr = gnc_reconcile_window_open_register (recnData);
1213 account = recn_get_account (recnData);
1214 if (account == NULL)
1217 balancing_amount = recnRecalculateBalance (recnData);
1221 statement_date = recnData->statement_date;
1222 if (statement_date == 0)
1225 gnc_split_reg2_balancing_entry (gsr, account, statement_date, balancing_amount);
1230 gnc_ui_reconcile_window_rec_cb (GtkButton *button, gpointer data)
1235 debit = GNC_RECONCILE_VIEW (recnData->debit);
1236 credit = GNC_RECONCILE_VIEW (recnData->credit);
1238 gnc_reconcile_view_set_list (debit, TRUE);
1239 gnc_reconcile_view_set_list (credit, TRUE);
1244 gnc_ui_reconcile_window_unrec_cb(GtkButton *button, gpointer data)
1249 debit = GNC_RECONCILE_VIEW (recnData->debit);
1250 credit = GNC_RECONCILE_VIEW (recnData->credit);
1252 gnc_reconcile_view_set_list (debit, FALSE);
1253 gnc_reconcile_view_set_list (credit, FALSE);
1258 gnc_ui_reconcile_window_delete_cb (GtkButton *button, gpointer data)
1264 split = gnc_reconcile_window_get_current_split (recnData);
1270 const char *message = _(
"Are you sure you want to delete the selected "
1274 result = gnc_verify_dialog (recnData->window, FALSE,
"%s", message);
1280 gnc_suspend_gui_refresh ();
1285 gnc_resume_gui_refresh ();
1290 gnc_ui_reconcile_window_edit_cb (GtkButton *button, gpointer data)
1296 split = gnc_reconcile_window_get_current_split (recnData);
1301 gsr = gnc_reconcile_window_open_register (recnData);
1304 gnc_split_reg2_jump_to_split_amount (gsr, split);
1309 gnc_recn_make_window_name (
Account *account)
1315 title = g_strconcat (fullname,
" - ", _(
"Reconcile"), NULL);
1328 title = gnc_recn_make_window_name (recn_get_account (recnData));
1330 gtk_window_set_title (GTK_WINDOW (recnData->window), title);
1337 gnc_recn_edit_account_cb (GtkAction *action, gpointer data)
1340 Account *account = recn_get_account (recnData);
1342 if (account == NULL)
1350 gnc_recn_xfer_cb (GtkAction *action, gpointer data)
1353 Account *account = recn_get_account (recnData);
1355 if (account == NULL)
1358 gnc_xfer_dialog (recnData->window, account);
1363 gnc_recn_scrub_cb (GtkAction *action, gpointer data)
1366 Account *account = recn_get_account (recnData);
1368 if (account == NULL)
1371 gnc_suspend_gui_refresh ();
1374 xaccAccountTreeScrubImbalance (account);
1377 if (g_getenv(
"GNC_AUTO_SCRUB_LOTS") != NULL)
1378 xaccAccountTreeScrubLots(account);
1380 gnc_resume_gui_refresh ();
1385 gnc_recn_open_cb (GtkAction *action, gpointer data)
1389 gnc_reconcile_window_open_register (recnData);
1394 gnc_get_reconcile_info (
Account *account,
1398 gboolean always_today;
1403 g_date_clear(&date, 1);
1405 always_today =
gnc_prefs_get_bool (GNC_PREFS_GROUP_RECONCILE, GNC_PREF_ALWAYS_REC_TO_TODAY);
1407 if (!always_today &&
1410 int months = 1, days = 0;
1418 gboolean was_last_day_of_month = g_date_is_last_of_month (&date);
1420 g_date_add_months (&date, months);
1423 if (was_last_day_of_month)
1425 g_date_set_day (&date, g_date_get_days_in_month (g_date_get_month (&date),
1426 g_date_get_year (&date)));
1431 g_date_add_days (&date, days);
1437 if (*statement_date > today)
1438 *statement_date = today;
1445 if (gnc_reverse_balance (account))
1454 gnc_ui_account_get_balance_as_of_date
1455 (account, *statement_date,
1462 find_by_account (gpointer
find_data, gpointer user_data)
1475 recn_set_watches_one_account (gpointer data, gpointer user_data)
1483 Split *split = node->data;
1494 gnc_gui_component_watch_entity (recnData->component_id,
1498 | GNC_EVENT_ITEM_CHANGED);
1511 gboolean include_children;
1513 GList *accounts = NULL;
1515 gnc_gui_component_clear_watches (recnData->component_id);
1517 gnc_gui_component_watch_entity (recnData->component_id,
1519 QOF_EVENT_MODIFY | QOF_EVENT_DESTROY);
1521 account = recn_get_account (recnData);
1524 if (include_children)
1528 accounts = g_list_prepend (accounts, account);
1530 g_list_foreach (accounts, recn_set_watches_one_account, recnData);
1532 g_list_free (accounts);
1537 refresh_handler (GHashTable *changes, gpointer user_data)
1543 account = recn_get_account (recnData);
1546 gnc_close_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
1552 info = gnc_gui_get_entity_events (changes, &recnData->account);
1553 if (info && (info->event_mask & QOF_EVENT_DESTROY))
1555 gnc_close_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
1560 gnc_reconcile_window_set_titles (recnData);
1561 recn_set_watches (recnData);
1563 recnRefresh (recnData);
1568 close_handler (gpointer user_data)
1572 gnc_save_window_size (GNC_PREFS_GROUP_RECONCILE, GTK_WINDOW (recnData->window));
1573 gtk_widget_destroy (recnData->window);
1586 recnWindow2 (GtkWidget *parent,
Account *account)
1591 if (account == NULL)
1599 if (!gnc_reconcile_last_statement_date)
1602 statement_date = gnc_reconcile_last_statement_date;
1604 gnc_get_reconcile_info (account, &new_ending, &statement_date);
1608 if (!startRecnWindow (parent, account, &new_ending, &statement_date, TRUE))
1611 return recnWindow2WithBalance (parent, account, new_ending, statement_date);
1616 recnWindow2_add_widget (GtkUIManager *merge,
1620 gtk_box_pack_start (GTK_BOX (dock), widget, FALSE, FALSE, 0);
1621 gtk_widget_show (widget);
1638 recnWindow2WithBalance (GtkWidget *parent,
Account *account,
1642 GtkWidget *statusbar;
1646 if (account == NULL)
1649 recnData = gnc_find_first_gui_component (WINDOW_RECONCILE_CM_CLASS,
1650 find_by_account, account);
1659 recnData->component_id =
1660 gnc_register_gui_component (WINDOW_RECONCILE_CM_CLASS,
1661 refresh_handler, close_handler,
1664 recn_set_watches (recnData);
1666 gnc_reconcile_last_statement_date = statement_date;
1668 recnData->new_ending = new_ending;
1669 recnData->statement_date = statement_date;
1670 recnData->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
1671 recnData->delete_refresh = FALSE;
1673 gnc_recn_set_window_name (recnData);
1675 vbox = gtk_vbox_new (FALSE, 0);
1676 gtk_container_add (GTK_CONTAINER(recnData->window), vbox);
1678 dock = gtk_vbox_new (FALSE, 0);
1679 gtk_widget_show (dock);
1680 gtk_box_pack_start (GTK_BOX (vbox), dock, FALSE, TRUE, 0);
1686 GtkActionGroup *action_group;
1687 GError *error = NULL;
1689 recnData->ui_merge = gtk_ui_manager_new ();
1690 g_signal_connect (recnData->ui_merge,
"add_widget",
1691 G_CALLBACK (recnWindow2_add_widget), dock);
1693 action_group = gtk_action_group_new (
"ReconcileWindowActions");
1694 recnData->action_group = action_group;
1696 gtk_action_group_add_actions (action_group, recnWindow2_actions,
1697 recnWindow2_n_actions, recnData);
1699 gtk_action_group_get_action (action_group,
"AccountOpenAccountAction");
1700 g_object_set (G_OBJECT (action),
"short_label", _(
"Open"), NULL);
1702 gtk_ui_manager_insert_action_group (recnData->ui_merge, action_group, 0);
1706 g_assert (filename);
1708 merge_id = gtk_ui_manager_add_ui_from_file (recnData->ui_merge,
1710 g_assert(merge_id || error);
1713 gtk_window_add_accel_group (GTK_WINDOW (recnData->window),
1714 gtk_ui_manager_get_accel_group (recnData->ui_merge));
1715 gtk_ui_manager_ensure_update (recnData->ui_merge);
1719 g_critical(
"Failed to load ui file.\n Filename %s\n Error %s",
1720 filename, error->message);
1721 g_error_free (error);
1722 g_assert (merge_id != 0);
1727 g_signal_connect (recnData->window,
"popup-menu",
1728 G_CALLBACK (gnc_reconcile_window_popup_menu_cb), recnData);
1730 statusbar = gtk_statusbar_new ();
1731 gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (statusbar), TRUE);
1732 gtk_box_pack_end (GTK_BOX (vbox), statusbar, FALSE, FALSE, 0);
1734 g_signal_connect (recnData->window,
"destroy",
1735 G_CALLBACK (recn_destroy_cb), recnData);
1736 g_signal_connect (recnData->window,
"delete_event",
1737 G_CALLBACK (recn_delete_cb), recnData);
1738 g_signal_connect (recnData->window,
"key_press_event",
1739 G_CALLBACK (recn_key_press_cb), recnData);
1743 GtkWidget *frame = gtk_frame_new (NULL);
1744 GtkWidget *main_area = gtk_vbox_new (FALSE, 10);
1745 GtkWidget *debcred_area = gtk_table_new (1, 2, TRUE);
1746 GtkWidget *debits_box;
1747 GtkWidget *credits_box;
1749 gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 10);
1752 gtk_window_set_default_size (GTK_WINDOW (recnData->window), 800, 600);
1753 gnc_restore_window_size (GNC_PREFS_GROUP_RECONCILE, GTK_WINDOW (recnData->window));
1755 gtk_container_add(GTK_CONTAINER(frame), main_area);
1756 gtk_container_set_border_width(GTK_CONTAINER(main_area), 10);
1758 debits_box = gnc_reconcile_window_create_view_box
1759 (account, RECLIST_DEBIT, recnData,
1760 &recnData->debit, &recnData->total_debit);
1762 credits_box = gnc_reconcile_window_create_view_box
1763 (account, RECLIST_CREDIT, recnData,
1764 &recnData->credit, &recnData->total_credit);
1766 GNC_RECONCILE_VIEW (recnData->debit)->sibling = GNC_RECONCILE_VIEW (recnData->credit);
1767 GNC_RECONCILE_VIEW (recnData->credit)->sibling = GNC_RECONCILE_VIEW (recnData->debit);
1769 gtk_box_pack_start (GTK_BOX (main_area), debcred_area, TRUE, TRUE, 0);
1770 gtk_table_set_col_spacings (GTK_TABLE (debcred_area), 15);
1771 gtk_table_attach_defaults (GTK_TABLE (debcred_area), debits_box, 0, 1, 0, 1);
1772 gtk_table_attach_defaults (GTK_TABLE (debcred_area), credits_box, 1, 2, 0, 1);
1775 GtkWidget *hbox, *title_vbox, *value_vbox;
1776 GtkWidget *totals_hbox, *frame, *title, *value;
1779 hbox = gtk_hbox_new (FALSE, 5);
1780 gtk_box_pack_start (GTK_BOX (main_area), hbox, FALSE, FALSE, 0);
1783 frame = gtk_frame_new (NULL);
1784 gtk_box_pack_end (GTK_BOX (hbox), frame, FALSE, FALSE, 0);
1787 totals_hbox = gtk_hbox_new (FALSE, 3);
1788 gtk_container_add (GTK_CONTAINER (frame), totals_hbox);
1789 gtk_container_set_border_width (GTK_CONTAINER (totals_hbox), 5);
1792 title_vbox = gtk_vbox_new (FALSE, 3);
1793 gtk_box_pack_start (GTK_BOX (totals_hbox), title_vbox, FALSE, FALSE, 0);
1796 value_vbox = gtk_vbox_new (FALSE, 3);
1797 gtk_box_pack_start (GTK_BOX (totals_hbox), value_vbox, TRUE, TRUE, 0);
1800 title = gtk_label_new (_(
"Statement Date:"));
1801 gtk_misc_set_alignment (GTK_MISC (title), 1.0, 0.5);
1802 gtk_box_pack_start (GTK_BOX (title_vbox), title, FALSE, FALSE, 0);
1804 value = gtk_label_new (
"");
1805 recnData->recn_date = value;
1806 gtk_misc_set_alignment (GTK_MISC (value), 1.0, 0.5);
1807 gtk_box_pack_start (GTK_BOX (value_vbox), value, FALSE, FALSE, 0);
1810 title = gtk_label_new(_(
"Starting Balance:"));
1811 gtk_misc_set_alignment (GTK_MISC (title), 1.0, 0.5);
1812 gtk_box_pack_start (GTK_BOX (title_vbox), title, FALSE, FALSE, 3);
1814 value = gtk_label_new (
"");
1815 recnData->starting = value;
1816 gtk_misc_set_alignment (GTK_MISC (value), 1.0, 0.5);
1817 gtk_box_pack_start (GTK_BOX (value_vbox), value, FALSE, FALSE, 3);
1820 title = gtk_label_new (_(
"Ending Balance:"));
1821 gtk_misc_set_alignment (GTK_MISC (title), 1.0, 0.5);
1822 gtk_box_pack_start (GTK_BOX (title_vbox), title, FALSE, FALSE, 0);
1824 value = gtk_label_new (
"");
1825 recnData->ending = value;
1826 gtk_misc_set_alignment (GTK_MISC (value), 1.0, 0.5);
1827 gtk_box_pack_start (GTK_BOX (value_vbox), value, FALSE, FALSE, 0);
1830 title = gtk_label_new (_(
"Reconciled Balance:"));
1831 gtk_misc_set_alignment (GTK_MISC (title), 1.0, 0.5);
1832 gtk_box_pack_start (GTK_BOX (title_vbox), title, FALSE, FALSE, 0);
1834 value = gtk_label_new (
"");
1835 recnData->reconciled = value;
1836 gtk_misc_set_alignment (GTK_MISC (value), 1.0, 0.5);
1837 gtk_box_pack_start (GTK_BOX (value_vbox), value, FALSE, FALSE, 0);
1840 title = gtk_label_new (_(
"Difference:"));
1841 gtk_misc_set_alignment(GTK_MISC (title), 1.0, 0.5);
1842 gtk_box_pack_start (GTK_BOX (title_vbox), title, FALSE, FALSE, 0);
1844 value = gtk_label_new (
"");
1845 recnData->difference = value;
1846 gtk_misc_set_alignment (GTK_MISC (value), 1.0, 0.5);
1847 gtk_box_pack_start (GTK_BOX (value_vbox), value, FALSE, FALSE, 0);
1851 recnRefresh (recnData);
1855 gtk_window_set_resizable (GTK_WINDOW (recnData->window), TRUE);
1857 gtk_widget_show_all (recnData->window);
1859 gnc_reconcile_window_set_titles (recnData);
1861 recnRecalculateBalance (recnData);
1863 gnc_window_adjust_for_screen (GTK_WINDOW (recnData->window));
1866 gnc_query_sort_order (GNC_QUERY_VIEW (recnData->debit), 1, GTK_SORT_ASCENDING);
1867 gnc_query_sort_order (GNC_QUERY_VIEW (recnData->credit), 1, GTK_SORT_ASCENDING);
1869 gtk_widget_grab_focus (recnData->debit);
1882 gnc_ui_reconcile_window2_raise (
RecnWindow2 * recnData)
1884 if (recnData == NULL)
1887 if (recnData->window == NULL)
1890 gtk_window_present (GTK_WINDOW (recnData->window));
1904 recn_destroy_cb (GtkWidget *w, gpointer data)
1908 gnc_unregister_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
1910 if (recnData->delete_refresh)
1911 gnc_resume_gui_refresh ();
1920 gboolean changed = FALSE;
1922 if (gnc_reconcile_view_changed (GNC_RECONCILE_VIEW (recnData->credit)))
1924 if (gnc_reconcile_view_changed (GNC_RECONCILE_VIEW (recnData->debit)))
1929 const char *message = _(
"You have made changes to this reconcile "
1930 "window. Are you sure you want to cancel?");
1931 if (!gnc_verify_dialog(recnData->window, FALSE,
"%s", message))
1935 gnc_close_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
1940 recn_delete_cb (GtkWidget *widget, GdkEvent *event, gpointer data)
1944 recn_cancel (recnData);
1950 recn_key_press_cb (GtkWidget *widget, GdkEventKey *event, gpointer data)
1954 if (event->keyval == GDK_Escape)
1956 recn_cancel (recnData);
1976 find_payment_account (
Account *account)
1981 if (account == NULL)
1987 for (node = g_list_last (list); node; node = node->prev)
2012 if ((s == NULL) || (s == split))
2016 if ((a == NULL) || (a == account))
2039 recnFinishCB (GtkAction *action,
RecnWindow2 *recnData)
2041 gboolean auto_payment;
2047 const char *message = _(
"The account is not balanced. "
2048 "Are you sure you want to finish?");
2049 if (!gnc_verify_dialog (recnData->window, FALSE,
"%s", message))
2053 date = recnData->statement_date;
2055 gnc_suspend_gui_refresh ();
2057 recnData->delete_refresh = TRUE;
2059 gnc_reconcile_view_commit (GNC_RECONCILE_VIEW (recnData->credit), date);
2060 gnc_reconcile_view_commit (GNC_RECONCILE_VIEW (recnData->debit), date);
2062 auto_payment =
gnc_prefs_get_bool (GNC_PREFS_GROUP_RECONCILE, GNC_PREF_AUTO_CC_PAYMENT);
2064 account = recn_get_account (recnData);
2076 xfer = gnc_xfer_dialog (NULL, account);
2078 gnc_xfer_dialog_set_amount (xfer,
gnc_numeric_neg (recnData->new_ending));
2080 payment_account = find_payment_account (account);
2081 if (payment_account != NULL)
2082 gnc_xfer_dialog_select_from_account (xfer, payment_account);
2085 gnc_close_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
2098 recnPostponeCB (GtkAction *action, gpointer data)
2104 const char *message = _(
"Do you want to postpone this reconciliation "
2105 "and finish it later?");
2106 if (!gnc_verify_dialog (recnData->window, FALSE,
"%s", message))
2110 gnc_suspend_gui_refresh ();
2112 recnData->delete_refresh = TRUE;
2114 gnc_reconcile_view_postpone (GNC_RECONCILE_VIEW (recnData->credit));
2115 gnc_reconcile_view_postpone (GNC_RECONCILE_VIEW (recnData->debit));
2117 account = recn_get_account (recnData);
2122 gnc_close_gui_component_by_data (WINDOW_RECONCILE_CM_CLASS, recnData);
2127 recnCancelCB (GtkAction *action, gpointer data)
2130 recn_cancel (recnData);
2138 static GtkActionEntry recnWindow2_actions [] =
2142 {
"ReconcileMenuAction", NULL, N_(
"_Reconcile"), NULL, NULL, NULL, },
2143 {
"AccountMenuAction", NULL, N_(
"_Account"), NULL, NULL, NULL, },
2144 {
"TransactionMenuAction", NULL, N_(
"_Transaction"), NULL, NULL, NULL, },
2145 {
"HelpMenuAction", NULL, N_(
"_Help"), NULL, NULL, NULL, },
2150 "RecnChangeInfoAction", NULL, N_(
"_Reconcile Information..."), NULL,
2151 N_(
"Change the reconcile information "
2152 "including statement date and ending balance."),
2153 G_CALLBACK (gnc_ui_reconcile_window_change_cb)
2156 "RecnFinishAction", GTK_STOCK_YES, N_(
"_Finish"),
"<control>w",
2157 N_(
"Finish the reconciliation of this account"),
2158 G_CALLBACK(recnFinishCB)
2161 "RecnPostponeAction", GTK_STOCK_GO_BACK, N_(
"_Postpone"),
"<control>p",
2162 N_(
"Postpone the reconciliation of this account"),
2163 G_CALLBACK(recnPostponeCB)
2166 "RecnCancelAction", GTK_STOCK_CANCEL, N_(
"_Cancel"), NULL,
2167 N_(
"Cancel the reconciliation of this account"),
2168 G_CALLBACK(recnCancelCB)
2174 "AccountOpenAccountAction", GTK_STOCK_JUMP_TO, N_(
"_Open Account"), NULL,
2175 N_(
"Open the account"),
2176 G_CALLBACK(gnc_recn_open_cb)
2179 "AccountEditAccountAction", NULL, N_(
"_Edit Account"), NULL,
2180 N_(
"Edit the main account for this register"),
2181 G_CALLBACK(gnc_recn_edit_account_cb)
2184 "AccountTransferAction", NULL, N_(
"_Transfer..."), NULL,
2185 N_(
"Transfer funds from one account to another"),
2186 G_CALLBACK(gnc_recn_xfer_cb)
2189 "AccountCheckRepairAction", NULL, N_(
"_Check & Repair"), NULL,
2190 N_(
"Check for and repair unbalanced transactions and orphan splits "
2192 G_CALLBACK(gnc_recn_scrub_cb)
2198 "TransBalanceAction", GTK_STOCK_NEW, N_(
"_Balance"),
"<control>b",
2199 N_(
"Add a new balancing entry to the account"),
2200 G_CALLBACK(gnc_ui_reconcile_window_balance_cb)
2203 "TransEditAction", GTK_STOCK_PROPERTIES, N_(
"_Edit"),
"<control>e",
2204 N_(
"Edit the current transaction"),
2205 G_CALLBACK(gnc_ui_reconcile_window_edit_cb)
2208 "TransDeleteAction", GTK_STOCK_DELETE, N_(
"_Delete"),
"<control>d",
2209 N_(
"Delete the selected transaction"),
2210 G_CALLBACK(gnc_ui_reconcile_window_delete_cb)
2213 "TransRecAction", GTK_STOCK_APPLY, N_(
"_Reconcile Selection"),
"<control>r",
2214 N_(
"Reconcile the selected transactions"),
2215 G_CALLBACK(gnc_ui_reconcile_window_rec_cb)
2218 "TransUnRecAction", GTK_STOCK_CLEAR, N_(
"_Unreconcile Selection"),
"<control>u",
2219 N_(
"Unreconcile the selected transactions"),
2220 G_CALLBACK(gnc_ui_reconcile_window_unrec_cb)
2226 "HelpHelpAction", NULL, N_(
"_Help"), NULL,
2227 N_(
"Open the GnuCash help window"),
2228 G_CALLBACK(gnc_ui_reconcile_window_help_cb)
2233 static guint recnWindow2_n_actions = G_N_ELEMENTS (recnWindow2_actions);
High-Level API for imposing Lot constraints.
gboolean gnc_numeric_equal(gnc_numeric a, gnc_numeric b)
SplitList * xaccAccountGetSplitList(const Account *acc)
Dialog for create/edit an account.
GNCAccountType xaccAccountGetType(const Account *acc)
int xaccAccountGetCommoditySCU(const Account *acc)
gnc_numeric gnc_numeric_neg(gnc_numeric a)
void xaccAccountSetReconcileLastDate(Account *acc, time64 last_date)
char xaccSplitGetReconcile(const Split *split)
void xaccAccountSetReconcileLastInterval(Account *acc, int months, int days)
GncPluginPage * gnc_plugin_page_register2_new(Account *account, gboolean subaccounts)
gboolean gnc_numeric_zero_p(gnc_numeric a)
gchar * gnc_filepath_locate_ui_file(const gchar *name)
Transaction * xaccSplitGetParent(const Split *split)
gint gnc_numeric_compare(gnc_numeric a, gnc_numeric b)
struct tm * gnc_localtime_r(const time64 *secs, struct tm *time)
fill out a time struct from a 64-bit time value adjusted for the current time zone.
time64 gnc_time64_get_day_end_gdate(const GDate *date)
void gnc_main_window_open_page(GncMainWindow *window, GncPluginPage *page)
void gnc_ui_edit_account_window(Account *account)
Functions for adding content to a window.
gboolean gnc_numeric_negative_p(gnc_numeric a)
gboolean xaccAccountGetReconcilePostponeDate(const Account *acc, time64 *postpone_date)
void xaccTransDestroy(Transaction *trans)
char * qof_print_date(time64 secs)
GNCSplitReg2 * gnc_plugin_page_register2_get_gsr(GncPluginPage *plugin_page)
#define xaccAccountGetGUID(X)
convert single-entry accounts to clean double-entry
gchar * gnc_account_get_full_name(const Account *account)
gboolean guid_equal(const GncGUID *guid_1, const GncGUID *guid_2)
time64 gnc_time64_get_day_end(time64 time_val)
void xaccAccountClearReconcilePostpone(Account *acc)
void xaccAccountSetReconcilePostponeDate(Account *acc, time64 postpone_date)
Gnome specific utility functions.
Additional event handling code.
void xaccAccountSetReconcilePostponeBalance(Account *acc, gnc_numeric balance)
void gnc_gnome_help(const char *file_name, const char *anchor)
gnc_numeric xaccAccountGetBalanceAsOfDate(Account *acc, time64 date)
gboolean xaccAccountGetReconcileLastDate(const Account *acc, time64 *last_date)
gdouble gnc_difftime(const time64 secs1, const time64 secs2)
Find the difference in seconds between two time values.
gboolean gnc_numeric_positive_p(gnc_numeric a)
#define xaccTransGetGUID(X)
Generic api to store and retrieve preferences.
GList * gnc_account_get_descendants(const Account *account)
gboolean xaccAccountGetReconcileChildrenStatus(const Account *acc)
gboolean xaccAccountGetReconcileLastInterval(const Account *acc, int *months, int *days)
Account * xaccSplitGetAccount(const Split *s)
gboolean gnc_prefs_get_bool(const gchar *group, const gchar *pref_name)
time64 gnc_time(time64 *tbuf)
get the current local time
void xaccAccountSetAutoInterestXfer(Account *acc, gboolean option)
void xaccAccountTreeScrubOrphans(Account *acc)
File path resolution utility functions.
void gnc_gtk_action_group_set_translation_domain(GtkActionGroup *action_group, const gchar *domain)
SplitList * xaccTransGetSplitList(const Transaction *trans)
gboolean xaccAccountGetAutoInterestXfer(const Account *acc, gboolean default_value)
void xaccAccountSetReconcileChildrenStatus(Account *acc, gboolean status)
const gchar * QofLogModule
void gnc_gdate_set_time64(GDate *gd, time64 time)
gnc_numeric xaccSplitGetAmount(const Split *split)
gboolean xaccAccountGetReconcilePostponeBalance(const Account *acc, gnc_numeric *balance)
Account * xaccAccountLookup(const GncGUID *guid, QofBook *book)