gnucash master: Multiple changes pushed
John Ralls
jralls at code.gnucash.org
Sun Sep 25 14:59:55 EDT 2022
Updated via https://github.com/Gnucash/gnucash/commit/3949821d (commit)
via https://github.com/Gnucash/gnucash/commit/ebd34067 (commit)
via https://github.com/Gnucash/gnucash/commit/6f0d1fa6 (commit)
via https://github.com/Gnucash/gnucash/commit/87c1e475 (commit)
via https://github.com/Gnucash/gnucash/commit/9c4fac3d (commit)
via https://github.com/Gnucash/gnucash/commit/ae993503 (commit)
via https://github.com/Gnucash/gnucash/commit/1cac1322 (commit)
via https://github.com/Gnucash/gnucash/commit/05f952db (commit)
via https://github.com/Gnucash/gnucash/commit/788c3ee6 (commit)
via https://github.com/Gnucash/gnucash/commit/3e4a4dbf (commit)
via https://github.com/Gnucash/gnucash/commit/2505955a (commit)
via https://github.com/Gnucash/gnucash/commit/43b6c17b (commit)
via https://github.com/Gnucash/gnucash/commit/7c350c3a (commit)
via https://github.com/Gnucash/gnucash/commit/1752f1d1 (commit)
via https://github.com/Gnucash/gnucash/commit/84f4f3b6 (commit)
via https://github.com/Gnucash/gnucash/commit/cfd37c91 (commit)
via https://github.com/Gnucash/gnucash/commit/6ba0f849 (commit)
via https://github.com/Gnucash/gnucash/commit/9a8bc8f7 (commit)
via https://github.com/Gnucash/gnucash/commit/596ff269 (commit)
from https://github.com/Gnucash/gnucash/commit/58c1a518 (commit)
commit 3949821da63381afef9e47d81373f2563ab60460
Merge: 58c1a5189 ebd340674
Author: John Ralls <jralls at ceridwen.us>
Date: Sun Sep 25 11:50:10 2022 -0700
Merge branch 'maint'
commit ebd340674e1c326323aabcd5cd85206a462ecb6e
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Sep 24 14:06:53 2022 -0700
Release GnuCash 4.12
diff --git a/CMakeLists.txt b/CMakeLists.txt
index da89165f2..ea1f99ca8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,7 +6,7 @@ if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.14.0)
endif()
project (gnucash
- VERSION 4.11
+ VERSION 4.12
)
enable_testing()
diff --git a/NEWS b/NEWS
index ac75c28a3..621cc481a 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,71 @@
Version history:
------- -------
+4.12 - 25 September 2022
+Between 4.11 and 4.12, the following bugfixes were accomplished:
+
+ Bug 794584 - Register not updated when scheduled transactions created
+ Bug 798262 - Scheduled transactions with blank amounts do not get created.
+ Bug 798385 - Description to often only "Landesbank Hessen-Thuringen Girozentrale"
+
+ Prepend the Ulitimate Creditor or Ultimate Debtor to the transaction description.
+ Bug 798565 - Import map editor: deletion of a map does not mark gnucash document as dirty
+ Bug 798573 - Tab Width Behaviour
+
+ Formerly when the notebook tabs on the left or right, the space used fluctuated depending on tab label width. This change sets the label width to the preference setting when the tabs are on the left or right but when top or bottom the width is set to the number of characters when shorter than the preference setting so they take up less room.
+ Bug 798578 - MT940 imports broken - all transactions have date of first transaction
+ Bug 798585 - segfault running sample script
+
+ simple_business_create.py.
+ Bug 798588 - sx scrubbing was using incorrect free function
+ Bug 798590 - Transaction report: wrong type argument in position 1
+ Bug 798598 - Selecting a line in a Vendor Credit Note changes display of Subtotal cell to 0.00
+ Bug 798611 - Date changing when changing timezone by one hour
+
+ When getting a date from the date editor anywhere in the program set the time to neutral time instead of the beginning of the day unless get_date_internal is called with GNC_DATE_EDIT_SHOW_TIME in which case the user-provided time is used.
+ Bug 798616 - Can't register amount greater than 9,000,000,000
+
+ Because when loading the value the split in the xml backend doesn't yet have a parent so the code tried to convert to GNC_COMMODITY_MAX_FRACTION and if the numerator was larger than 10^10 that would overflow. To fix it this changes the "don't know" response in get_currency_denom and get_commodity_denom to GNC_DENOM_AUTO which will normally leave the denominator alone.
+
+The following fixes and improvements were not associated with bug reports:
+
+ It is now possible to edit the description, notes, and memo fields of new transactions in the import matcher and to do so for multiple transactions. The option is accessed via a context menu on selected import lines.
+ Show GnuCash's installation and configuration configuration paths in the About dialog. List the same from the command line with a --paths option.
+ Add account hierarchy templates for locale es_AR
+ Continued work on the Stock Transaction Assistant. If you want to try out this new way of recording your investment transactions start GnuCash with the --extra option. The stock assistant is available on the toolbar and from the Actions menu when a register for a STOCK or FUND account is focused.
+ Replace the very obsolete ghelp: URI scheme with help: and install the documentation according to the XDG documentation spec on non-Mac Linux systems. This ensures that the Help menu documentation items work with Gnome 42 and later.
+ Conforming to the XDG documentation spec, rename the root page of the Help manual to index from help. This has the happy side effect of removing some special-case code from the macOS documentation links.
+ Standardize the top-level Equity and Assets account names in the French templates to "Capitaux propres" and "Actif" respectively.
+ [gnc-ab-utils] concise string accumulator
+ [gnc-glib-utils] gnc_g_list_stringjoin skips NULL data
+ [ifrs-cost-basis] identify sale/purchase according to truth table instead of via flawed heuristics
+ [ifrs-cost-basis] add options used as a report footer
+ [lot-viewer] Show Open & Close dates only when they have a value.
+ Fix use-after-free crash in gnc_set_busy_cursor.
+ Create Swiss SMB account chart acctchrt_pme-19.gnucash-xea.
+ [date-utilities] avoid report crash if start > end date
+ [html-chart] add percent formatter for numbers for older javascript.
+ [trial-balance] set default price-source to average-cost
+
+ to minimise complaints (see Bug 798550)
+ Use macos-latest github runner for mac tests.
+ [dialog-price] Price Database: Insert help buttons
+ Disable transaction type (i.e. Bill or Invoice) in Invoice/Bill Registers, determining the type by inspecting the money flow.
+ Fix python tests dependencies
+
+ So that ninja check works from a clean build directory with Python enabled.
+ Review of account templates Câmissing placeholders, redundancies
+ Fixed a variety of fixed memory leaks, poor list handling, and dangling reference errors.
+
+New API:
+ gnc_tm_get_today_neutral to complement gnc_tm_get_today_begin and
+ gnc_tm_get_today_end.
+ gnc_get_dialog_widget_from_id
+ gnc_list_all_paths
+
+Deprecations: None.
+
+New and Updated Translations: Basque, Chinese (Simplified), Croatian, Dutch, English (Australia), English (New Zealand), English (United Kingdom), French, German, Hebrew, Hungarian, Indonesian, Italian, Korean, Marathi, Polish, Portuguese, Portuguese (Brazil), Russian, Swedish, Ukrainian
+
4.11 - 26 June 2022
Between 4.10 and 4.11, the following bugfixes were accomplished:
commit 6f0d1fa60ff0ef35442dc11706406f5f8a477758
Author: Maxime Leroy <lisacintosh at gmail.com>
Date: Fri Sep 23 21:20:24 2022 +0200
Translation update by Maxime Leroy <lisacintosh at gmail.com> using Weblate
po/fr.po: 99.9% (5399 of 5401 strings; 2 fuzzy)
3 failing checks (0.1%)
Translation: GnuCash/Program (French)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/fr/
Co-authored-by: Maxime Leroy <lisacintosh at gmail.com>
diff --git a/po/fr.po b/po/fr.po
index 7b5dd4c82..07c2c4f86 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -33,11 +33,11 @@
msgid ""
msgstr ""
"Project-Id-Version: GnuCash 4.12-pre1\n"
-"Report-Msgid-Bugs-To: https://bugs.gnucash.org/enter_bug.cgi?"
-"product=GnuCash&component=Translations\n"
+"Report-Msgid-Bugs-To: https://bugs.gnucash.org/enter_bug."
+"cgi?product=GnuCash&component=Translations\n"
"POT-Creation-Date: 2022-09-11 23:24+0200\n"
-"PO-Revision-Date: 2022-09-11 09:20+0000\n"
-"Last-Translator: Simon Arlott <weblate.simon at arlott.org>\n"
+"PO-Revision-Date: 2022-09-23 19:20+0000\n"
+"Last-Translator: Maxime Leroy <lisacintosh at gmail.com>\n"
"Language-Team: French <https://hosted.weblate.org/projects/gnucash/gnucash/"
"fr/>\n"
"Language: fr\n"
@@ -45,7 +45,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
-"X-Generator: Weblate 4.14.1-dev\n"
+"X-Generator: Weblate 4.14.1\n"
#: borrowed/goffice/go-charmap-sel.c:70
msgid "Arabic"
@@ -2897,10 +2897,8 @@ msgstr "Chercher une prestation"
# po/guile_strings.txt:188
#: gnucash/gnome/dialog-lot-viewer.c:817
-#, fuzzy
-#| msgid "Empty space"
msgid "Empty"
-msgstr "Espace vide"
+msgstr "Vide"
# messages-i18n.c:310
#: gnucash/gnome/dialog-lot-viewer.c:829
@@ -2908,7 +2906,7 @@ msgstr "Espace vide"
#| msgid "Open"
msgctxt "Adjective"
msgid "Open"
-msgstr "Ouvrir"
+msgstr "Ouvert"
# messages-i18n.c:261
#: gnucash/gnome/dialog-lot-viewer.c:923 gnucash/gnome/dialog-order.c:890
commit 87c1e4752ace5c9728896481fe56c43b678f1a55
Author: Minjae Isaac Kwon <minjae.isaac.kwon at gmail.com>
Date: Fri Sep 23 21:20:24 2022 +0200
Translation update by Minjae Isaac Kwon <minjae.isaac.kwon at gmail.com> using Weblate
po/ko.po: 63.8% (3450 of 5401 strings; 1015 fuzzy)
263 failing checks (4.8%)
Translation: GnuCash/Program (Korean)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/ko/
Co-authored-by: Minjae Isaac Kwon <minjae.isaac.kwon at gmail.com>
diff --git a/po/ko.po b/po/ko.po
index fca85d291..fc6e247a7 100644
--- a/po/ko.po
+++ b/po/ko.po
@@ -1,13 +1,14 @@
# Taehun Yun <yooontehoon at naver.com>, 2022.
# ì´ì í¬ <daemul72 at gmail.com>, 2022.
+# Minjae Isaac Kwon <minjae.isaac.kwon at gmail.com>, 2022.
msgid ""
msgstr ""
"Project-Id-Version: GnuCash 4.12-pre1\n"
"Report-Msgid-Bugs-To: https://bugs.gnucash.org/enter_bug."
"cgi?product=GnuCash&component=Translations\n"
"POT-Creation-Date: 2022-09-11 23:24+0200\n"
-"PO-Revision-Date: 2022-09-14 15:50+0000\n"
-"Last-Translator: ì´ì í¬ <daemul72 at gmail.com>\n"
+"PO-Revision-Date: 2022-09-23 10:21+0000\n"
+"Last-Translator: Minjae Isaac Kwon <minjae.isaac.kwon at gmail.com>\n"
"Language-Team: Korean <https://hosted.weblate.org/projects/gnucash/gnucash/"
"ko/>\n"
"Language: ko\n"
@@ -15,7 +16,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-"X-Generator: Weblate 4.14.1-dev\n"
+"X-Generator: Weblate 4.14.1\n"
"X-Poedit-Language: Korean\n"
"X-Poedit-Country: KOREA, REPUBLIC OF\n"
@@ -599,7 +600,8 @@ msgstr ""
msgid ""
"To switch between multiple tabs in the main window, press Control+Page Up/"
"Down."
-msgstr ""
+msgstr "주 ìëì°ì ì¬ë¬ íì ì´ëíë ¤ë©´, Control ê³¼ Page Up/Down ì ëìì "
+"ì
ë ¥íììì¤."
#: doc/tip_of_the_day.list.c:82
msgid ""
commit 9c4fac3da7a3d9d8f2766a49b156a7b893fbe841
Author: Eduardo Malaspina <vaio0 at swismail.com>
Date: Fri Sep 23 21:20:23 2022 +0200
Translation update by Eduardo Malaspina <vaio0 at swismail.com> using Weblate
po/es.po: 99.8% (5391 of 5401 strings; 10 fuzzy)
10 failing checks (0.1%)
Translation: GnuCash/Program (Spanish)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/es/
Co-authored-by: Eduardo Malaspina <vaio0 at swismail.com>
diff --git a/po/es.po b/po/es.po
index f1ddc635b..6de896206 100644
--- a/po/es.po
+++ b/po/es.po
@@ -11,6 +11,7 @@
# Adolfo Jayme Barrientos <fitojb at ubuntu.com>, 2021.
# Francisco Serrador <fserrador at gmail.com>, 2021, 2022.
# Cow <javier.fserrador at gmail.com>, 2022.
+# Eduardo Malaspina <vaio0 at swismail.com>, 2022.
#
#
# ###############################################################################
@@ -77,12 +78,11 @@
msgid ""
msgstr ""
"Project-Id-Version: GnuCash 4.12-pre1\n"
-"Report-Msgid-Bugs-To: https://bugs.gnucash.org/enter_bug.cgi?"
-"product=GnuCash&component=Translations\n"
+"Report-Msgid-Bugs-To: https://bugs.gnucash.org/enter_bug."
+"cgi?product=GnuCash&component=Translations\n"
"POT-Creation-Date: 2022-09-11 23:24+0200\n"
-"PO-Revision-Date: 2022-06-22 07:21+0000\n"
-"Last-Translator: Jaime MarquÃnez Ferrándiz <weblate at jregistros.fastmail."
-"net>\n"
+"PO-Revision-Date: 2022-09-21 15:50+0000\n"
+"Last-Translator: Eduardo Malaspina <vaio0 at swismail.com>\n"
"Language-Team: Spanish <https://hosted.weblate.org/projects/gnucash/gnucash/"
"es/>\n"
"Language: es\n"
@@ -90,11 +90,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 4.13.1-dev\n"
+"X-Generator: Weblate 4.14.1\n"
"X-Bugs: Report translation errors to the Language-Team address.\n"
"X-Poedit-SourceCharset: UTF-8\n"
-"X-Poedit-KeywordsList: <b>;</b>;<span weight=\"bold\" size=\"larger\">;</"
-"span>;<span size=\"larger\" weight=\"bold\">\n"
+"X-Poedit-KeywordsList: <b>;</b>;<span weight=\"bold\" size=\"larger\""
+">;</span>;<span size=\"larger\" weight=\"bold\">\n"
#: borrowed/goffice/go-charmap-sel.c:70
msgid "Arabic"
@@ -9267,7 +9267,7 @@ msgstr "Opciones del Libro"
#: gnucash/gnome-utils/gnc-main-window.c:4897 gnucash/gnucash-core-app.cpp:261
msgid "(user modifiable)"
-msgstr ""
+msgstr "(modificable por el usuario)"
#. Translators: %s will be replaced with the current year
#: gnucash/gnome-utils/gnc-main-window.c:4924
commit ae993503ee84934474601c41f1c7e22a4c6823fe
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Sat Sep 24 00:19:12 2022 +0800
[assistant-stock-transaction] better punctuation for error messages.
diff --git a/gnucash/gnome/assistant-stock-transaction.cpp b/gnucash/gnome/assistant-stock-transaction.cpp
index 481dc9e6a..d05fb34b8 100644
--- a/gnucash/gnome/assistant-stock-transaction.cpp
+++ b/gnucash/gnome/assistant-stock-transaction.cpp
@@ -696,7 +696,7 @@ check_page (SummaryLineInfo& line, gnc_numeric& debit, gnc_numeric& credit,
line.account = "";
else
{
- add_error (errors, N_("Account for %s is missing"), page);
+ add_error (errors, N_("Account for %s is missing."), page);
line.account = _(missing_str);
}
}
@@ -775,11 +775,11 @@ to ensure proper recording."), new_date_str, last_split_date_str);
line.units = xaccPrintAmount (stock_amount, stock_pinfo);
line.units_in_red = negative_in_red && gnc_numeric_negative_p (stock_amount);
if (gnc_numeric_check (ratio) || !gnc_numeric_positive_p (ratio))
- add_error_str (errors, N_("Invalid stock new balance"));
+ add_error_str (errors, N_("Invalid stock new balance."));
else if (gnc_numeric_negative_p (delta) && !credit_side)
- add_error_str (errors, N_("New balance must be higher than old balance"));
+ add_error_str (errors, N_("New balance must be higher than old balance."));
else if (gnc_numeric_positive_p (delta) && credit_side)
- add_error_str (errors, N_("New balance must be lower than old balance"));
+ add_error_str (errors, N_("New balance must be lower than old balance."));
}
else
{
@@ -788,7 +788,7 @@ to ensure proper recording."), new_date_str, last_split_date_str);
auto stock_pinfo = gnc_commodity_print_info
(xaccAccountGetCommodity (info->acct), true);
if (!gnc_numeric_positive_p (stock_amount))
- add_error_str (errors, N_("Stock amount must be positive"));
+ add_error_str (errors, N_("Stock amount must be positive."));
if (info->txn_type->stock_amount & FieldMask::ENABLED_CREDIT)
stock_amount = gnc_numeric_neg (stock_amount);
line.units = xaccPrintAmount (stock_amount, stock_pinfo);
@@ -796,10 +796,10 @@ to ensure proper recording."), new_date_str, last_split_date_str);
auto new_bal = gnc_numeric_add_fixed (info->balance_at_date, stock_amount);
if (gnc_numeric_positive_p (info->balance_at_date) &&
gnc_numeric_negative_p (new_bal))
- add_error_str (errors, N_("Cannot sell more units than owned"));
+ add_error_str (errors, N_("Cannot sell more units than owned."));
else if (gnc_numeric_negative_p (info->balance_at_date) &&
gnc_numeric_positive_p (new_bal))
- add_error_str (errors, N_("Cannot cover buy more units than owed"));
+ add_error_str (errors, N_("Cannot cover buy more units than owed."));
}
add_to_summary_table (list, line);
commit 1cac132214858cb4a10217568c3c8e0d9a71f8cf
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Mon Sep 19 14:17:06 2022 +0800
[gnc-plugin-page-register] hide toolbar and menu in regular register
Instead of toggling sensitivity according to xaccAccountIsPriced,
toggle visibility instead.
diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index 0719d678b..93eef4203 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -624,12 +624,6 @@ static const gchar* view_style_actions[] =
NULL
};
-static const gchar* actions_requiring_extra[] =
-{
- "ActionsStockAssistantAction",
- NULL
-};
-
static const gchar* actions_requiring_priced_account[] =
{
"ActionsStockAssistantAction",
@@ -1289,11 +1283,10 @@ gnc_plugin_page_register_ui_initial_state (GncPluginPageRegister* page)
gnc_plugin_update_actions (action_group, actions_requiring_account,
"sensitive", is_readwrite && account != NULL);
- gnc_plugin_update_actions (action_group, actions_requiring_extra,
- "visible", gnc_prefs_is_extra_enabled ());
-
gnc_plugin_update_actions (action_group, actions_requiring_priced_account,
- "sensitive", account && xaccAccountIsPriced (account));
+ "visible", account &&
+ gnc_prefs_is_extra_enabled () &&
+ xaccAccountIsPriced (account));
/* Set "style" radio button */
ledger_type = gnc_ledger_display_type (priv->ledger);
commit 05f952dbe83f4718e3145768b30ed4c3b113ed32
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Thu Sep 22 18:10:47 2022 +0800
[assistant-stock-transaction] use cpp form for struct
...and remove unused pointer in struct
diff --git a/gnucash/gnome/assistant-stock-transaction.cpp b/gnucash/gnome/assistant-stock-transaction.cpp
index 619f52347..481dc9e6a 100644
--- a/gnucash/gnome/assistant-stock-transaction.cpp
+++ b/gnucash/gnome/assistant-stock-transaction.cpp
@@ -374,10 +374,9 @@ then record the reverse split.")
}
};
-typedef struct
+struct StockTransactionInfo
{
GtkWidget * window;
- GtkWidget * assistant;
std::optional<TxnTypeVec> txn_types;
// the following stores date at which the txn_types were set. If
@@ -443,7 +442,7 @@ typedef struct
GtkWidget * finish_page;
GtkWidget * finish_split_view;
GtkWidget * finish_summary;
-} StockTransactionInfo;
+};
/******* implementations ***********************************************/
commit 788c3ee6176d1a843769d12b9008b7e619ec741a
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Wed Sep 21 00:06:25 2022 +0800
[import-main-matcher] setup_entry handles NULL and empty initial
gtk_entry_set_text throws a warning if initial is empty. Avoid calling
when initial==NULL.
Also, if the imported transaction has empty-string desc/notes/memo, we
don't want to populate the GtkEntryCompletion with it.
diff --git a/gnucash/import-export/import-main-matcher.c b/gnucash/import-export/import-main-matcher.c
index bb03dcb1b..b82a201b6 100644
--- a/gnucash/import-export/import-main-matcher.c
+++ b/gnucash/import-export/import-main-matcher.c
@@ -1020,14 +1020,17 @@ setup_entry (GtkWidget *entry, gboolean sensitive, GHashTable *hash,
GtkEntryCompletion* completion;
GtkListStore *list;
- gtk_entry_set_text (GTK_ENTRY (entry), sensitive ? initial : _("Disabled"));
+ if (!sensitive)
+ gtk_entry_set_text (GTK_ENTRY (entry), _("Disabled"));
+ else if (initial && *initial)
+ gtk_entry_set_text (GTK_ENTRY (entry), initial);
gtk_widget_set_sensitive (entry, sensitive);
if (!sensitive)
return;
list = gtk_list_store_new (NUM_COMPLETION_COLS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
g_hash_table_foreach (hash, (GHFunc)populate_list, list);
- if (initial && !g_hash_table_lookup (hash, (gpointer)initial))
+ if (initial && *initial && !g_hash_table_lookup (hash, (gpointer)initial))
populate_list ((gpointer)initial, NULL, list);
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (list),
COMPLETION_LIST_ORIGINAL,
commit 3e4a4dbfe12981b6ffd6eddfc93e568e6ead0f98
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Wed Sep 21 00:05:34 2022 +0800
[import-main-matcher] initialize hash tables in common setup
... otherwise the hash tables aren't initialized when the CSV importer
calls the import matcher.
diff --git a/gnucash/import-export/import-main-matcher.c b/gnucash/import-export/import-main-matcher.c
index 9c785bb38..bb03dcb1b 100644
--- a/gnucash/import-export/import-main-matcher.c
+++ b/gnucash/import-export/import-main-matcher.c
@@ -1676,6 +1676,10 @@ gnc_gen_trans_common_setup (GNCImportMainMatcher *info,
if (heading)
gtk_label_set_text (GTK_LABEL(heading_label), heading);
+ info->desc_hash = g_hash_table_new (g_str_hash, g_str_equal);
+ info->notes_hash = g_hash_table_new (g_str_hash, g_str_equal);
+ info->memo_hash = g_hash_table_new (g_str_hash, g_str_equal);
+ info->new_strings = NULL;
info->transaction_processed_cb = NULL;
/* Connect the signals */
@@ -1731,11 +1735,6 @@ gnc_gen_trans_list_new (GtkWidget *parent,
// This ensure this dialog is closed when the session is closed.
gnc_gui_component_set_session (info->id, gnc_get_current_session());
- info->desc_hash = g_hash_table_new (g_str_hash, g_str_equal);
- info->notes_hash = g_hash_table_new (g_str_hash, g_str_equal);
- info->memo_hash = g_hash_table_new (g_str_hash, g_str_equal);
-
- info->new_strings = NULL;
return info;
}
commit 2505955ab90e43cc9cb89b7de7930af7e0f9a947
Author: John Ralls <jralls at ceridwen.us>
Date: Tue Sep 20 09:09:28 2022 -0700
Fix test failure from Bug 798616 fix.
diff --git a/libgnucash/engine/test/utest-Split.cpp b/libgnucash/engine/test/utest-Split.cpp
index 4d257c4d4..c0fa7400f 100644
--- a/libgnucash/engine/test/utest-Split.cpp
+++ b/libgnucash/engine/test/utest-Split.cpp
@@ -760,10 +760,10 @@ test_get_currency_denom (Fixture *fixture, gconstpointer pData)
const gint denom = gnc_commodity_get_fraction (fixture->curr);
g_assert_cmpint (fixture->func->get_currency_denom (NULL), ==, 0);
fixture->split->parent = NULL;
- g_assert_cmpint (fixture->func->get_currency_denom (fixture->split), ==, GNC_COMMODITY_MAX_FRACTION);
+ g_assert_cmpint (fixture->func->get_currency_denom (fixture->split), ==, GNC_DENOM_AUTO);
fixture->split->parent = txn;
txn->common_currency = NULL;
- g_assert_cmpint (fixture->func->get_currency_denom (fixture->split), ==, GNC_COMMODITY_MAX_FRACTION);
+ g_assert_cmpint (fixture->func->get_currency_denom (fixture->split), ==, GNC_DENOM_AUTO);
txn->common_currency = fixture->curr;
g_assert_cmpint (fixture->func->get_currency_denom (fixture->split), ==, denom);
}
@@ -778,7 +778,7 @@ test_get_commodity_denom (Fixture *fixture, gconstpointer pData)
const gint denom = gnc_commodity_get_fraction (fixture->comm);
g_assert_cmpint (fixture->func->get_commodity_denom (NULL), ==, 0);
fixture->split->acc = NULL;
- g_assert_cmpint (fixture->func->get_commodity_denom (fixture->split), ==, GNC_COMMODITY_MAX_FRACTION);
+ g_assert_cmpint (fixture->func->get_commodity_denom (fixture->split), ==, GNC_DENOM_AUTO);
fixture->split->acc = acc;
g_assert_cmpint (fixture->func->get_commodity_denom (fixture->split), ==, denom);
}
commit 43b6c17b92904d74ae6ce264eb1b07ef59d8eabe
Author: Arve Eriksson <031299870 at telia.com>
Date: Sat Sep 17 19:19:29 2022 +0200
Translation update by Arve Eriksson <031299870 at telia.com> using Weblate
po/sv.po: 100.0% (5401 of 5401 strings; 0 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Program (Swedish)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/sv/
Co-authored-by: Arve Eriksson <031299870 at telia.com>
diff --git a/po/sv.po b/po/sv.po
index b6961e481..6a10b50b2 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -14,10 +14,10 @@
msgid ""
msgstr ""
"Project-Id-Version: GnuCash 4.12-pre1\n"
-"Report-Msgid-Bugs-To: https://bugs.gnucash.org/enter_bug.cgi?"
-"product=GnuCash&component=Translations\n"
+"Report-Msgid-Bugs-To: https://bugs.gnucash.org/enter_bug."
+"cgi?product=GnuCash&component=Translations\n"
"POT-Creation-Date: 2022-09-11 23:24+0200\n"
-"PO-Revision-Date: 2022-08-11 07:18+0000\n"
+"PO-Revision-Date: 2022-09-17 17:19+0000\n"
"Last-Translator: Arve Eriksson <031299870 at telia.com>\n"
"Language-Team: Swedish <https://hosted.weblate.org/projects/gnucash/gnucash/"
"sv/>\n"
@@ -26,7 +26,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
-"X-Generator: Weblate 4.14-dev\n"
+"X-Generator: Weblate 4.14.1-dev\n"
"X-Bugs: Report translation errors to the Language-Team address.\n"
#: borrowed/goffice/go-charmap-sel.c:70
@@ -2682,14 +2682,10 @@ msgid "Find Job"
msgstr "Sök jobb"
#: gnucash/gnome/dialog-lot-viewer.c:817
-#, fuzzy
-#| msgid "Empty space"
msgid "Empty"
-msgstr "Tomt utrymme"
+msgstr "Tom"
#: gnucash/gnome/dialog-lot-viewer.c:829
-#, fuzzy
-#| msgid "Open"
msgctxt "Adjective"
msgid "Open"
msgstr "Ãppna"
commit 7c350c3ae5ab014ecd611a518a7738fd8a46082b
Author: John Ralls <jralls at ceridwen.us>
Date: Mon Sep 19 18:06:26 2022 -0700
Bug 798616 - Can't register amount greater than 9,000,000,000
Because when loading the value the split in the xml backend doesn't yet
have a parent so the code tried to convert to GNC_COMMODITY_MAX_FRACTION
and if the numerator was larger than 10^10 that would overflow.
To fix it this changes the "don't know" response to get_currency_denom
and get_commodity_denom to GNC_DENOM_AUTO which will normally leave
the denominator alone.
diff --git a/libgnucash/engine/Split.c b/libgnucash/engine/Split.c
index 406ab8603..d8fc1b784 100644
--- a/libgnucash/engine/Split.c
+++ b/libgnucash/engine/Split.c
@@ -1130,13 +1130,9 @@ xaccSplitDetermineGainStatus (Split *split)
static inline int
get_currency_denom(const Split * s)
{
- if (!s)
+ if (!(s && s->parent && s->parent->common_currency))
{
- return 0;
- }
- else if (!s->parent || !s->parent->common_currency)
- {
- return GNC_COMMODITY_MAX_FRACTION;
+ return GNC_DENOM_AUTO;
}
else
{
@@ -1147,13 +1143,9 @@ get_currency_denom(const Split * s)
static inline int
get_commodity_denom(const Split * s)
{
- if (!s)
- {
- return 0;
- }
- else if (!s->acc)
+ if (!(s && s->acc))
{
- return GNC_COMMODITY_MAX_FRACTION;
+ return GNC_DENOM_AUTO;
}
else
{
commit 1752f1d19d3e59de0ba4b6a42dc93af4f79c0385
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Mon Sep 19 23:05:33 2022 +0800
[assistant-stock-transaction] disallow stock split ratio of 0.
otherwise the reverse stock split would allow a new stock amount
balance of zero.
diff --git a/gnucash/gnome/assistant-stock-transaction.cpp b/gnucash/gnome/assistant-stock-transaction.cpp
index 2d6734c0b..619f52347 100644
--- a/gnucash/gnome/assistant-stock-transaction.cpp
+++ b/gnucash/gnome/assistant-stock-transaction.cpp
@@ -526,7 +526,7 @@ refresh_page_stock_amount (GtkWidget *widget, gpointer user_data)
{
gnc_numeric ratio = gnc_numeric_div (stock_amount, bal,
GNC_DENOM_AUTO, GNC_HOW_DENOM_REDUCE);
- if (gnc_numeric_check (ratio) || gnc_numeric_negative_p (ratio))
+ if (gnc_numeric_check (ratio) || !gnc_numeric_positive_p (ratio))
gtk_label_set_text (GTK_LABEL(info->next_amount), nullptr);
else
{
@@ -775,10 +775,8 @@ to ensure proper recording."), new_date_str, last_split_date_str);
stock_amount = gnc_numeric_sub_fixed (stock_amount, info->balance_at_date);
line.units = xaccPrintAmount (stock_amount, stock_pinfo);
line.units_in_red = negative_in_red && gnc_numeric_negative_p (stock_amount);
- if (gnc_numeric_check (ratio))
+ if (gnc_numeric_check (ratio) || !gnc_numeric_positive_p (ratio))
add_error_str (errors, N_("Invalid stock new balance"));
- else if (gnc_numeric_negative_p (ratio))
- add_error_str (errors, N_("New and old balance must have same signs"));
else if (gnc_numeric_negative_p (delta) && !credit_side)
add_error_str (errors, N_("New balance must be higher than old balance"));
else if (gnc_numeric_positive_p (delta) && credit_side)
commit 84f4f3b6f852bb76382009466beb4335f5cb4aa6
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Mon Sep 19 10:03:28 2022 +0800
[assistant-stock-transaction] add to toolbar
diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index 4e2368840..0719d678b 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -487,8 +487,8 @@ static GtkActionEntry gnc_plugin_page_register_actions [] =
G_CALLBACK (gnc_plugin_page_register_cmd_autoclear)
},
{
- "ActionsStockAssistantAction", NULL, N_ ("Stock Ass_istant"), NULL,
- N_ ("Stock Assistant"),
+ "ActionsStockAssistantAction", "applications-utilities",
+ N_ ("Stock Ass_istant"), NULL, N_ ("Stock Assistant"),
G_CALLBACK (gnc_plugin_page_register_cmd_stock_assistant)
},
{
diff --git a/gnucash/ui/gnc-plugin-page-register-ui.xml b/gnucash/ui/gnc-plugin-page-register-ui.xml
index ab1405a7f..cc57ebdb9 100644
--- a/gnucash/ui/gnc-plugin-page-register-ui.xml
+++ b/gnucash/ui/gnc-plugin-page-register-ui.xml
@@ -86,6 +86,7 @@
<separator name="ToolbarSep68"/>
<toolitem name="ToolbarTransfer" action="ActionsTransferAction"/>
<toolitem name="ActionsReconcile" action="ActionsReconcileAction"/>
+ <toolitem name="ActionsAssistant" action="ActionsStockAssistantAction"/>
</placeholder>
</toolbar>
commit cfd37c91028268c8a8b4199bc7bc3b60ade03099
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Mon Sep 19 09:31:21 2022 +0800
[assistant-stock-transaction] fix stock split creation algorithm
* stock_amount was reduced as a previous bugfix attempt
* remove references to Stock Split Assistant
diff --git a/gnucash/gnome/assistant-stock-transaction.cpp b/gnucash/gnome/assistant-stock-transaction.cpp
index 788d7b01a..2d6734c0b 100644
--- a/gnucash/gnome/assistant-stock-transaction.cpp
+++ b/gnucash/gnome/assistant-stock-transaction.cpp
@@ -263,7 +263,7 @@ reinvested must be subsequently recorded as a regular stock purchase.")
N_("Company redeems units, thereby increasing the stock price by a \
multiple, while keeping the total monetary value of the overall investment \
constant.\n\nIf the reverse split results in a cash in lieu for remainder \
-units, please record the sale using the Stock Split Assistant first, then \
+units, please record the sale using the Stock Transaction Assistant first, then \
record the reverse split.")
}
};
@@ -369,7 +369,7 @@ static const TxnTypeVec short_types
N_("Company redeems units, thereby increasing the stock price by \
a multiple, while keeping the total monetary value of the overall investment \
constant.\n\nIf the reverse split results in a cash in lieu for remainder \
-units, please record the cover buy using the Stock Split Assistant first, \
+units, please record the cover buy using the Stock Transaction Assistant first, \
then record the reverse split.")
}
};
@@ -1099,8 +1099,6 @@ stock_assistant_finish (GtkAssistant *assistant, gpointer user_data)
gae_amount (info->stock_amount_edit) : gnc_numeric_zero ();
auto stock_value = info->txn_type->stock_value != FieldMask::DISABLED ?
gae_amount (info->stock_value_edit) : gnc_numeric_zero ();
- if (info->txn_type->input_new_balance)
- stock_amount = gnc_numeric_sub_fixed (stock_amount, info->balance_at_date);
create_split (trans, info->txn_type->stock_amount | info->txn_type->stock_value,
NC_ ("Stock Assistant: Action field", "Stock"),
info->acct, account_commits, info->stock_memo_edit,
diff --git a/gnucash/gtkbuilder/assistant-stock-transaction.glade b/gnucash/gtkbuilder/assistant-stock-transaction.glade
index b21930132..c28e6d7b6 100644
--- a/gnucash/gtkbuilder/assistant-stock-transaction.glade
+++ b/gnucash/gtkbuilder/assistant-stock-transaction.glade
@@ -6,7 +6,7 @@
<property name="can-focus">False</property>
<property name="halign">start</property>
<property name="border-width">12</property>
- <property name="title" translatable="yes">Stock Split Assistant</property>
+ <property name="title" translatable="yes">Stock Transaction Assistant</property>
<property name="window-position">center</property>
<property name="default-width">500</property>
<signal name="cancel" handler="stock_assistant_cancel" swapped="no"/>
commit 6ba0f849ba925e797d1ab65f5374db7740139c53
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Sat Sep 17 22:51:18 2022 +0800
[assistant-stock-transaction] refactor: centralize price calculator
Price was being computed in 3 places: the stock_value page, the
summary-table info list, and the final pricedb creation function. This
commit centralizes it into 1 function which returns std::nullopt if
the price is not computable.
Also fixes price display to follow global pref general/force-price-decimal
diff --git a/gnucash/gnome/assistant-stock-transaction.cpp b/gnucash/gnome/assistant-stock-transaction.cpp
index bca3653d9..788d7b01a 100644
--- a/gnucash/gnome/assistant-stock-transaction.cpp
+++ b/gnucash/gnome/assistant-stock-transaction.cpp
@@ -490,6 +490,22 @@ refresh_page_transaction_type (GtkWidget *widget, gpointer user_data)
info->txn_type->fees_capitalize);
}
+static std::optional<gnc_numeric>
+calculate_price (StockTransactionInfo* info)
+{
+ gnc_numeric amount, value;
+
+ if (info->txn_type->stock_amount == FieldMask::DISABLED ||
+ info->txn_type->stock_value == FieldMask::DISABLED ||
+ gnc_amount_edit_expr_is_valid (GNC_AMOUNT_EDIT (info->stock_amount_edit), &amount, true, nullptr) ||
+ gnc_amount_edit_expr_is_valid (GNC_AMOUNT_EDIT (info->stock_value_edit), &value, true, nullptr))
+ return std::nullopt;
+
+ if (gnc_numeric_zero_p (amount) || gnc_numeric_zero_p (value))
+ return std::nullopt;
+
+ return gnc_numeric_div (value, amount, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT);
+}
static void
refresh_page_stock_amount (GtkWidget *widget, gpointer user_data)
@@ -540,14 +556,10 @@ static void
refresh_page_stock_value (GtkWidget *widget, gpointer user_data)
{
auto info = static_cast<StockTransactionInfo*>(user_data);
- gnc_numeric amount, value;
g_return_if_fail (info->txn_type);
- if (info->txn_type->stock_amount == FieldMask::DISABLED ||
- info->txn_type->stock_value == FieldMask::DISABLED ||
- gnc_amount_edit_expr_is_valid (GNC_AMOUNT_EDIT (info->stock_amount_edit), &amount, true, nullptr) ||
- gnc_amount_edit_expr_is_valid (GNC_AMOUNT_EDIT (info->stock_value_edit), &value, true, nullptr) ||
- gnc_numeric_zero_p (value))
+ auto price = calculate_price (info);
+ if (!price.has_value())
{
// Translators: StockAssistant: N/A denotes stock price is not computable
const char* na_label = N_("N/A");
@@ -555,9 +567,8 @@ refresh_page_stock_value (GtkWidget *widget, gpointer user_data)
return;
}
- auto price = gnc_numeric_div (value, amount, GNC_DENOM_AUTO, GNC_HOW_RND_ROUND);
- auto pinfo = gnc_commodity_print_info (info->currency, true);
- gtk_label_set_text (GTK_LABEL (info->price_value), xaccPrintAmount (price, pinfo));
+ auto pinfo = gnc_price_print_info (info->currency, true);
+ gtk_label_set_text (GTK_LABEL (info->price_value), xaccPrintAmount (*price, pinfo));
}
static void
@@ -796,13 +807,10 @@ to ensure proper recording."), new_date_str, last_split_date_str);
add_to_summary_table (list, line);
- if (info->txn_type->stock_amount != FieldMask::DISABLED &&
- info->txn_type->stock_value != FieldMask::DISABLED)
+ auto price = calculate_price (info);
+ if (price.has_value())
{
- auto amt = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT(info->stock_amount_edit));
- auto val = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT(info->stock_value_edit));
- auto p = gnc_numeric_div (val, amt, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT);
- auto curr_pinfo = gnc_commodity_print_info (info->currency, true);
+ auto curr_pinfo = gnc_price_print_info (info->currency, true);
// Translators: %s refer to: stock mnemonic, broker currency,
// date of transaction.
auto tmpl = N_("A price of 1 %s = %s on %s will be recorded.");
@@ -810,7 +818,7 @@ to ensure proper recording."), new_date_str, last_split_date_str);
auto price_str = g_strdup_printf
(_(tmpl),
gnc_commodity_get_mnemonic (xaccAccountGetCommodity (info->acct)),
- xaccPrintAmount (p, curr_pinfo), date_str);
+ xaccPrintAmount (*price, curr_pinfo), date_str);
infos.emplace_back (price_str);
g_free (price_str);
g_free (date_str);
@@ -1036,21 +1044,22 @@ create_split (Transaction *trans, FieldMask splitfield,
}
static void
-add_price (GtkWidget *amount, GtkWidget *value,
- gnc_commodity *commodity, gnc_commodity *currency, time64 date)
+add_price (StockTransactionInfo* info, time64 date)
{
- auto amt = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (amount));
- auto val = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (value));
- auto p = gnc_numeric_div (val, amt, GNC_DENOM_AUTO, GNC_HOW_DENOM_EXACT);
+ auto p = calculate_price (info);
+
+ if (!p.has_value())
+ return;
+
auto price = gnc_price_create (gnc_get_current_book ());
gnc_price_begin_edit (price);
- gnc_price_set_commodity (price, commodity);
- gnc_price_set_currency (price, currency);
+ gnc_price_set_commodity (price, xaccAccountGetCommodity (info->acct));
+ gnc_price_set_currency (price, info->currency);
gnc_price_set_time64 (price, date);
gnc_price_set_source (price, PRICE_SOURCE_STOCK_TRANSACTION);
gnc_price_set_typestr (price, PRICE_TYPE_UNK);
- gnc_price_set_value (price, p);
+ gnc_price_set_value (price, *p);
gnc_price_commit_edit (price);
auto book = gnc_get_current_book ();
@@ -1143,10 +1152,7 @@ stock_assistant_finish (GtkAssistant *assistant, gpointer user_data)
gnc_numeric_zero (), capgains, false, info);
}
- if (info->txn_type->stock_amount != FieldMask::DISABLED &&
- info->txn_type->stock_value != FieldMask::DISABLED)
- add_price (info->stock_amount_edit, info->stock_value_edit,
- xaccAccountGetCommodity (info->acct), info->currency, date);
+ add_price (info, date);
xaccTransCommitEdit (trans);
commit 9a8bc8f7e5b8f44076297689adfa698929a77f2b
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Sat Sep 17 14:17:50 2022 +0800
[assistant-stock-transaction] disallow selection in summary table
... because selection hides the red color from last commit. There's no
action attached to selection in the treeview. It can be disabled.
diff --git a/gnucash/gnome/assistant-stock-transaction.cpp b/gnucash/gnome/assistant-stock-transaction.cpp
index 09f283d3a..bca3653d9 100644
--- a/gnucash/gnome/assistant-stock-transaction.cpp
+++ b/gnucash/gnome/assistant-stock-transaction.cpp
@@ -1236,6 +1236,8 @@ get_treeview (GtkBuilder *builder, const gchar *treeview_label)
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
G_TYPE_STRING, G_TYPE_STRING);
gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
+ gtk_tree_selection_set_mode (gtk_tree_view_get_selection (view),
+ GTK_SELECTION_NONE);
g_object_unref(store);
auto renderer = gtk_cell_renderer_text_new();
commit 596ff26928b55a3d3eb887affbe087f736359fb0
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Sat Sep 17 13:37:04 2022 +0800
[assistant-stock-transaction] if negative Units, render in red color
...in the summary table
diff --git a/gnucash/gnome/assistant-stock-transaction.cpp b/gnucash/gnome/assistant-stock-transaction.cpp
index 03b9105b8..09f283d3a 100644
--- a/gnucash/gnome/assistant-stock-transaction.cpp
+++ b/gnucash/gnome/assistant-stock-transaction.cpp
@@ -38,6 +38,7 @@ extern "C" {
#include "assistant-stock-transaction.h"
#include "gnc-account-sel.h"
#include "gnc-amount-edit.h"
+#include "gnc-prefs.h"
#include "gnc-component-manager.h"
#include "gnc-date-edit.h"
#include "gnc-tree-view-account.h"
@@ -79,6 +80,7 @@ enum split_cols
SPLIT_COL_DEBIT,
SPLIT_COL_CREDIT,
SPLIT_COL_UNITS,
+ SPLIT_COL_UNITS_COLOR,
NUM_SPLIT_COLS
};
@@ -608,6 +610,7 @@ struct SummaryLineInfo
std::string memo;
std::string value;
std::string units;
+ bool units_in_red;
};
static void
@@ -623,6 +626,7 @@ add_to_summary_table (GtkListStore *list, SummaryLineInfo line)
SPLIT_COL_DEBIT, line.debit_side ? line.value.c_str() : "",
SPLIT_COL_CREDIT, !line.debit_side ? line.value.c_str() : "",
SPLIT_COL_UNITS, line.units.c_str(),
+ SPLIT_COL_UNITS_COLOR, line.units_in_red ? "red" : nullptr,
-1);
g_free (tooltip);
}
@@ -640,6 +644,7 @@ check_page (SummaryLineInfo& line, gnc_numeric& debit, gnc_numeric& credit,
line.memo = gtk_entry_get_text (GTK_ENTRY (memo));
line.units = "";
+ line.units_in_red = false;
line.debit_side = (splitfield & FieldMask::ENABLED_DEBIT);
if (gnc_amount_edit_expr_is_valid (GNC_AMOUNT_EDIT (gae), &amount, true, nullptr))
@@ -704,6 +709,8 @@ refresh_page_finish (StockTransactionInfo *info)
gnc_numeric credit = gnc_numeric_zero ();
StringVec errors, warnings, infos;
SummaryLineInfo line;
+ bool negative_in_red = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL,
+ GNC_PREF_NEGATIVE_IN_RED);
// check the stock transaction date. If there are existing stock
// transactions dated after the date specified, it is very likely
@@ -735,7 +742,7 @@ to ensure proper recording."), new_date_str, last_split_date_str);
}
if (info->txn_type->stock_value == FieldMask::DISABLED)
- line = { false, false, xaccAccountGetName (info->acct), "", "", "" };
+ line = { false, false, xaccAccountGetName (info->acct), "", "", "", false };
else
check_page (line, debit, credit, info->txn_type->stock_value, info->acct,
info->stock_memo_edit, info->stock_value_edit, info->currency,
@@ -756,6 +763,7 @@ to ensure proper recording."), new_date_str, last_split_date_str);
(xaccAccountGetCommodity (info->acct), true);
stock_amount = gnc_numeric_sub_fixed (stock_amount, info->balance_at_date);
line.units = xaccPrintAmount (stock_amount, stock_pinfo);
+ line.units_in_red = negative_in_red && gnc_numeric_negative_p (stock_amount);
if (gnc_numeric_check (ratio))
add_error_str (errors, N_("Invalid stock new balance"));
else if (gnc_numeric_negative_p (ratio))
@@ -776,6 +784,7 @@ to ensure proper recording."), new_date_str, last_split_date_str);
if (info->txn_type->stock_amount & FieldMask::ENABLED_CREDIT)
stock_amount = gnc_numeric_neg (stock_amount);
line.units = xaccPrintAmount (stock_amount, stock_pinfo);
+ line.units_in_red = negative_in_red && gnc_numeric_negative_p (stock_amount);
auto new_bal = gnc_numeric_add_fixed (info->balance_at_date, stock_amount);
if (gnc_numeric_positive_p (info->balance_at_date) &&
gnc_numeric_negative_p (new_bal))
@@ -1225,7 +1234,7 @@ get_treeview (GtkBuilder *builder, const gchar *treeview_label)
auto store = gtk_list_store_new (NUM_SPLIT_COLS, G_TYPE_STRING, G_TYPE_STRING,
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
- G_TYPE_STRING);
+ G_TYPE_STRING, G_TYPE_STRING);
gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
g_object_unref(store);
@@ -1259,7 +1268,10 @@ get_treeview (GtkBuilder *builder, const gchar *treeview_label)
gtk_cell_renderer_set_alignment (renderer, 1.0, 0.5);
gtk_cell_renderer_set_padding (renderer, 5, 0);
column = gtk_tree_view_column_new_with_attributes
- (_("Units"), renderer, "text", SPLIT_COL_UNITS, nullptr);
+ (_("Units"), renderer,
+ "text", SPLIT_COL_UNITS,
+ "foreground", SPLIT_COL_UNITS_COLOR,
+ nullptr);
gtk_tree_view_append_column(view, column);
return GTK_WIDGET (view);
Summary of changes:
NEWS | 66 ++++++++++++
gnucash/gnome/assistant-stock-transaction.cpp | 113 ++++++++++++---------
gnucash/gnome/gnc-plugin-page-register.c | 17 +---
.../gtkbuilder/assistant-stock-transaction.glade | 2 +-
gnucash/import-export/import-main-matcher.c | 16 +--
gnucash/ui/gnc-plugin-page-register-ui.xml | 1 +
libgnucash/engine/Split.c | 16 +--
libgnucash/engine/test/utest-Split.cpp | 6 +-
po/es.po | 18 ++--
po/fr.po | 16 ++-
po/ko.po | 10 +-
po/sv.po | 14 +--
12 files changed, 180 insertions(+), 115 deletions(-)
More information about the gnucash-changes
mailing list