From 79286d92d570135d7697eb3a65cbe725a9a8b449 Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Sat, 2 May 2020 11:11:21 +0800 Subject: [PATCH 1/5] Bug 797659 - Liabilities in budget report no longer calculate correctly Restores budget-3.7 behaviour for current budgets. Fixes future budget behaviour. Restore budget-3.7 headings "Income/Expense/Transfer" Renamed budget-3.7 heading Total to "Remaining" --- gnucash/gnome/gnc-budget-view.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/gnucash/gnome/gnc-budget-view.c b/gnucash/gnome/gnc-budget-view.c index 7b44c294ac..046efef3bb 100644 --- a/gnucash/gnome/gnc-budget-view.c +++ b/gnucash/gnome/gnc-budget-view.c @@ -447,11 +447,11 @@ gbv_create_widget (GncBudgetView *budget_view) // Create totals tree view totals_tree_model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT); gtk_list_store_append(totals_tree_model, &iter); - gtk_list_store_set(totals_tree_model, &iter, 0, _("Inflow from Income"), 1, TOTALS_TYPE_INCOME, -1); + gtk_list_store_set(totals_tree_model, &iter, 0, _("Income"), 1, TOTALS_TYPE_INCOME, -1); gtk_list_store_append(totals_tree_model, &iter); - gtk_list_store_set(totals_tree_model, &iter, 0, _("Outflow to Expenses"), 1, TOTALS_TYPE_EXPENSES, -1); + gtk_list_store_set(totals_tree_model, &iter, 0, _("Expenses"), 1, TOTALS_TYPE_EXPENSES, -1); gtk_list_store_append(totals_tree_model, &iter); - gtk_list_store_set(totals_tree_model, &iter, 0, _("Outflow to Asset/Equity/Liability"), 1, TOTALS_TYPE_ASSET_LIAB_EQ, -1); + gtk_list_store_set(totals_tree_model, &iter, 0, _("Transfer"), 1, TOTALS_TYPE_ASSET_LIAB_EQ, -1); gtk_list_store_append(totals_tree_model, &iter); gtk_list_store_set(totals_tree_model, &iter, 0, _("Remaining to Budget"), 1, TOTALS_TYPE_REMAINDER, -1); @@ -1202,11 +1202,11 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell, switch (row_type) { case TOTALS_TYPE_ASSET_LIAB_EQ: - if ((acctype == ACCT_TYPE_LIABILITY) || - (acctype == ACCT_TYPE_EQUITY)) - neg = !neg; - else if (acctype != ACCT_TYPE_ASSET) + if ((acctype != ACCT_TYPE_ASSET) && + (acctype != ACCT_TYPE_LIABILITY) && + (acctype != ACCT_TYPE_EQUITY)) continue; + neg = !neg; break; case TOTALS_TYPE_EXPENSES: if (acctype != ACCT_TYPE_EXPENSE) @@ -1218,10 +1218,7 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell, neg = !neg; break; case TOTALS_TYPE_REMAINDER: - if ((acctype == ACCT_TYPE_ASSET) || - (acctype == ACCT_TYPE_INCOME) || - (acctype == ACCT_TYPE_EXPENSE)) - neg = !neg; + neg = !neg; break; default: continue; /* don't count if unexpected total row type is passed in... */ @@ -1239,6 +1236,7 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell, (acctype != ACCT_TYPE_LIABILITY) && (acctype != ACCT_TYPE_EQUITY)) continue; + neg = (acctype == ACCT_TYPE_ASSET); break; case TOTALS_TYPE_EXPENSES: if (acctype != ACCT_TYPE_EXPENSE) @@ -1249,7 +1247,8 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell, continue; break; case TOTALS_TYPE_REMAINDER: - neg = (acctype != ACCT_TYPE_INCOME); + neg = ((acctype == ACCT_TYPE_ASSET) || + (acctype == ACCT_TYPE_EXPENSE)); break; default: continue; /* don't count if unexpected total row type is passed in... */ From a143d59b7c9984d532c4db15c0f7438cb18dd3ac Mon Sep 17 00:00:00 2001 From: jean Date: Fri, 8 May 2020 08:44:23 -0700 Subject: [PATCH 2/5] Bug 797737 - Import matching can match an imported transaction to an existing, previously matched transaction A simple fix that skips transactions that have an online_id in the matching process. This fixes the issue, and also speeds up the import. --- gnucash/import-export/import-backend.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gnucash/import-export/import-backend.c b/gnucash/import-export/import-backend.c index 888b913b2f..747cf29cd7 100644 --- a/gnucash/import-export/import-backend.c +++ b/gnucash/import-export/import-backend.c @@ -627,6 +627,10 @@ static void split_find_match (GNCImportTransInfo * trans_info, Transaction *new_trans = gnc_import_TransInfo_get_trans (trans_info); Split *new_trans_fsplit = gnc_import_TransInfo_get_fsplit (trans_info); + // Do not consider transactions that have been previously matched. + if (gnc_import_split_has_online_id (split)) + return; + /* Matching heuristics */ /* Amount heuristics */ From e84e680603b225cb52be6981840b80291ef8352b Mon Sep 17 00:00:00 2001 From: "Frank H. Ellenberger" Date: Sat, 9 May 2020 01:51:05 +0200 Subject: [PATCH 3/5] I18N: Fix several issuse with 'Help not found' strings Unify and modularize the strings Add an unmarked string --- gnucash/gnome-utils/gnc-gnome-utils.c | 30 +++++++++++++-------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/gnucash/gnome-utils/gnc-gnome-utils.c b/gnucash/gnome-utils/gnc-gnome-utils.c index b9066ab356..188da7d458 100644 --- a/gnucash/gnome-utils/gnc-gnome-utils.c +++ b/gnucash/gnome-utils/gnc-gnome-utils.c @@ -64,6 +64,13 @@ static int gnome_is_initialized = FALSE; #define ACCEL_MAP_NAME "accelerator-map" +const gchar *msg_no_help_found = + N_("GnuCash could not find the files of the help documentation."); +const gchar *msg_no_help_reason = + N_("This is likely because the \"gnucash-docs\" package is not properly installed."); + /* Translators: URI of missing help files */ +const gchar *msg_no_help_location = N_("Expected location"); + static void gnc_book_options_help_cb (GNCOptionWin *win, gpointer dat); static void @@ -280,10 +287,9 @@ gnc_gnome_help (const char *dir, const char *detail) componentsJoinedByString: @"-"]; if (![[NSFileManager defaultManager] fileExistsAtPath: docs_dir]) { - const gchar *message = - _("GnuCash could not find the files for the help documentation. " - "This is likely because the 'gnucash-docs' package is not installed"); - gnc_error_dialog(NULL, "%s at %s", message, [docs_dir UTF8String]); + gnc_error_dialog(NULL, "%s\n%s\n%s: %s", _(msg_no_help_found), + _(msg_no_help_reason), + _(msg_no_help_location), [docs_dir UTF8String]); [pool release]; return; } @@ -373,10 +379,7 @@ gnc_gnome_help (const char *dir, const char *detail) [[NSWorkspace sharedWorkspace] openURL: url]; else { - const gchar *message = - _("GnuCash could not find the files for the help documentation. " - "This is likely because the 'gnucash-docs' package is not installed."); - gnc_error_dialog(NULL, "%s", message); + gnc_error_dialog(NULL, "%s\n%s", _(msg_no_help_found), _(msg_no_help_reason)); } [pool release]; } @@ -404,9 +407,7 @@ gnc_gnome_help (const char *file_name, const char *anchor) if (!found) { - const gchar *message = - _("GnuCash could not find the files for the help documentation."); - gnc_error_dialog (NULL, message); + gnc_error_dialog (NULL, "%s\n%s", _(msg_no_help_found), _(msg_no_help_reason)); } else { @@ -439,10 +440,7 @@ gnc_gnome_help (const char *file_name, const char *anchor) g_assert(error != NULL); { - const gchar *message = - _("GnuCash could not find the files for the help documentation. " - "This is likely because the 'gnucash-docs' package is not installed."); - gnc_error_dialog(NULL, "%s", message); + gnc_error_dialog(NULL, "%s\n%s", _(msg_no_help_found), _(msg_no_help_reason)); } PERR ("%s", error->message); g_error_free(error); @@ -505,7 +503,7 @@ gnc_launch_assoc (GtkWindow *parent, const char *uri) NULL, NULL, SW_SHOWNORMAL) <= 32) { const gchar *message = - _("GnuCash could not find the associated file"); + _("GnuCash could not find the associated file."); gnc_error_dialog(parent, "%s:\n%s", message, filename); } g_free (wincmd); From f7a85161cdbc7700317c0731ffb4aa373d0efd2c Mon Sep 17 00:00:00 2001 From: "Frank H. Ellenberger" Date: Sat, 9 May 2020 23:47:43 +0200 Subject: [PATCH 4/5] I18N: fix translator comments in window-reconcile.c --- gnucash/gnome/window-reconcile.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gnucash/gnome/window-reconcile.c b/gnucash/gnome/window-reconcile.c index e01a0987ea..d5085afa78 100644 --- a/gnucash/gnome/window-reconcile.c +++ b/gnucash/gnome/window-reconcile.c @@ -370,17 +370,15 @@ gnc_start_recn_date_changed (GtkWidget *widget, startRecnWindowData *data) if (days_after_today > 0) { - /* Translators: This is a ngettext(3) message, %d is the - number of days in the future */ gchar *str = g_strdup_printf + /* Translators: %d is the number of days in the future */ (ngettext ("Statement Date is %d day after today.", "Statement Date is %d days after today.", days_after_today), days_after_today); - /* Translators: This is a ngettext(3) message, %d is the - number of days in the future */ gchar *tip_start = g_strdup_printf + /* Translators: %d is the number of days in the future */ (ngettext ("The statement date you have chosen is %d day in the future.", "The statement date you have chosen is %d days in the future.", days_after_today), From 0b0e4c7630f9a5a8202011fe5dc760eaed58dc28 Mon Sep 17 00:00:00 2001 From: "Frank H. Ellenberger" Date: Sun, 10 May 2020 03:41:05 +0200 Subject: [PATCH 5/5] HIG, I18N: Improve Budget menu entries --- gnucash/gnome/gnc-plugin-budget.c | 16 ++++++++-------- gnucash/gnome/gnc-plugin-page-budget.c | 20 ++++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/gnucash/gnome/gnc-plugin-budget.c b/gnucash/gnome/gnc-plugin-budget.c index bdbd9b21e8..6632a8d117 100644 --- a/gnucash/gnome/gnc-plugin-budget.c +++ b/gnucash/gnome/gnc-plugin-budget.c @@ -60,25 +60,25 @@ static void gnc_plugin_budget_cmd_delete_budget (GtkAction *action, static GtkActionEntry gnc_plugin_actions [] = { { - "NewBudgetAction", NULL, N_("New Budget"), NULL, - N_("Create a new Budget"), + "NewBudgetAction", NULL, N_("_New Budget"), NULL, + N_("Create a new Budget."), G_CALLBACK(gnc_plugin_budget_cmd_new_budget) }, { - "OpenBudgetAction", NULL, N_("Open Budget"), NULL, - N_("Open an existing Budget"), + "OpenBudgetAction", NULL, N_("_Open Budget"), NULL, + N_("Open an existing Budget in a new tab. If none exists a new budget will be created."), G_CALLBACK(gnc_plugin_budget_cmd_open_budget) }, { - "CopyBudgetAction", NULL, N_("Copy Budget"), NULL, - N_("Copy an existing Budget"), + "CopyBudgetAction", NULL, N_("_Copy Budget"), NULL, + N_("Copy an existing Budget."), G_CALLBACK(gnc_plugin_budget_cmd_copy_budget) }, { - "DeleteBudgetAction", NULL, N_("Delete Budget"), NULL, - N_("Deletes an existing Budget"), + "DeleteBudgetAction", NULL, N_("_Delete Budget"), NULL, + N_("Delete an existing Budget."), G_CALLBACK(gnc_plugin_budget_cmd_delete_budget) }, diff --git a/gnucash/gnome/gnc-plugin-page-budget.c b/gnucash/gnome/gnc-plugin-page-budget.c index cd845c23e0..90d7f20a11 100644 --- a/gnucash/gnome/gnc-plugin-page-budget.c +++ b/gnucash/gnome/gnc-plugin-page-budget.c @@ -132,37 +132,37 @@ static GtkActionEntry gnc_plugin_page_budget_actions [] = /* File menu */ { "OpenAccountAction", GNC_ICON_OPEN_ACCOUNT, N_("Open _Account"), NULL, - N_("Open the selected account"), + N_("Open the selected account."), G_CALLBACK(gnc_plugin_page_budget_cmd_open_account) }, { "OpenSubaccountsAction", GNC_ICON_OPEN_ACCOUNT, N_("Open _Subaccounts"), NULL, - N_("Open the selected account and all its subaccounts"), + N_("Open the selected account and all its subaccounts."), G_CALLBACK(gnc_plugin_page_budget_cmd_open_subaccounts) }, /* Edit menu */ { "DeleteBudgetAction", GNC_ICON_DELETE_BUDGET, N_("_Delete Budget"), - NULL, N_("Delete this budget"), + NULL, N_("Delete this budget."), G_CALLBACK(gnc_plugin_page_budget_cmd_delete_budget) }, { - "OptionsBudgetAction", "document-properties", N_("Budget Options"), - NULL, N_("Edit this budget's options"), + "OptionsBudgetAction", "document-properties", N_("Budget _Options..."), + NULL, N_("Edit this budget's options."), G_CALLBACK(gnc_plugin_page_budget_cmd_view_options) }, { - "EstimateBudgetAction", "system-run", N_("Estimate Budget"), + "EstimateBudgetAction", "system-run", N_("Esti_mate Budget..."), NULL, - N_("Estimate a budget value for the selected accounts from past transactions"), + N_("Estimate a budget value for the selected accounts from past transactions."), G_CALLBACK(gnc_plugin_page_budget_cmd_estimate_budget) }, { - "AllPeriodsBudgetAction", "system-run", N_("All Periods"), + "AllPeriodsBudgetAction", "system-run", N_("_All Periods..."), NULL, - N_("Edit budget for all periods for the selected accounts"), + N_("Edit budget for all periods for the selected accounts."), G_CALLBACK(gnc_plugin_page_budget_cmd_allperiods_budget) }, @@ -173,7 +173,7 @@ static GtkActionEntry gnc_plugin_page_budget_actions [] = }, { "ViewRefreshAction", "view-refresh", N_("_Refresh"), "r", - N_("Refresh this window"), + N_("Refresh this window."), G_CALLBACK(gnc_plugin_page_budget_cmd_refresh) },