foreign-currency transaction into a trading account transaction.
Disable scrubbing while committing the new trading split, otherwise
the recursed scrub will delete it causing a crash when GnuCash tries
to populate it.
Instead of setlocale(LC_ALL, NULL). The uses for the string either create
an ICU locale or sort between German and US TXF reports. On some OSes
where the user has different locales set for one or more categories LC_ALL
produces a dump of all of the LC_FOO variables and their values. That's
not useful for comparing to de_DE and it's too long for ICU, which
crashes.
Meanwhile in dialog-print-checks the RV of setlocale was ignored,
rendering the call a no-op.
The first-line cause of the bug was that the safe save was failing on
SQLite3 because the backup tables weren't visible inside the
transaction and that prevented them from being dropped. Commit the
transaction before trying to drop the backup tables.
https://bugs.gnucash.org/show_bug.cgi?id=799623 identified a problem
with int64_t storage in SQLite3 by setting a date after 2038-01-23
whose time64 overflowed int32_t. But dates shouldn't be stored as
time64s, they should be stored as ISO 8601 date-time strings. So fix
the test to store the date correctly and to store the big int as an
int64_t.
instead of strcmp. strcmp does a byte-by-byte numerical
comparison, not an alphabetical one (e.g. A > e).
Also fix the transposed args in the strstr call in
gnc_unicode_has_substring_identical.
zeros when entering stocks.
Preserve the decimal point when printing numbers with no decimal
places to stop the auto-decimal code from triggering when exiting the
field.
And as a side benefit don't leak signal handlers for the repGncFreq
changed signal.
The crash occured because gnc_frequency_setup_recurrence first calls
gnc_date_edit_set_gdate which emits a changed signal that, if it
wasn't the first call to loan_rep_prep would call
update_repayment_formula_cb and that would generate a new recurrences
list. But the still running gnc_frequency_setup_recurrence still had a
pointer to the old list and when it tried to manipulate it it would
crash.
This change disconnects the previous signal handler preventing the
list from being replaced.
Boost Process 1.88 defaults to the new V2 API introduced in Boost
1.81. https://repology.org/project/boost/versions shows that distro
support for boost 1.81 and later is spotty at best so we won't be able
to migrate to v2 until that improves.
Leverages the FakePrefsBackend from the previous commit to change the
fiscal year for testing.
Makes now_t a defaulted parameter of gnc_relative_date_to_time64 so
that we can inject different reference dates for testing.
This restores the expected precondition for the quarter tests of the
Accounting Period being the current calendar year, replacing the
today-relative quarter begin and end dates.
Only the quarter's start month in reports is adjusted when Absolute is selected in the Start Date on the Accounting Period preferences. This branch adjusts both the quarter's start day and month when Absolute is selected or when Relative and Today, Start of this month, or Start of previous month are selected.
Chris Lam pointed out that the original algo would crash if a
transaction had more than one split in the account being deleted.
Deduplicate the transaction vector first to protect against that.
Also suspend qof events for a 4x speedup.
New function xaccAccountDeleteAllTransactions.
Delete all transactions before deleting the account; simply deleting the
splits during account destruction isn't safe. In the particular case of an
imbalance account the transaction commit after deleting a split just makes
a new one.
Make the behaviour when the "Jump" operation encounters a transaction with
more than two splits configurable.
This can be configured as:
* Do nothing (this is the default)
* Use the split with the largest value
* Use the split with the smallest value
This makes it much easier to jump between accounts for stock transactions
that include splits for fees and taxes, or dividend transactions that have
a zero value split for the stock account.
The "=" in the widget name will separate the pref name from the enum
string value that is used when the radio button is activated. When the
radio button is deactivated, its preference update is ignored because
another button must have been made active.
clear lock on the origin SQL book.
GncDbiSqlConnection::unlock_database function errored out if the last
dbi interaction resulted in an error, even if it was a harmless index
out of range. Ignore index out of range errors.
Not quite true, it just takes a really long time for a large database.
The underlying problem is gnc_file_do_save_as reloads the data to make
sure that the save-as saves everything. On the SQL backend that
triggers a scrub. The scrub itseld doesn't take long, but every
transaction commit was logged in the transaction log and did a refresh
of the registers. So:
* Suspend logging while doing the scrub.
* Suspend UI refreshes and QOF events while reloading the data.
CAMT.053.001.02 via aqbanking
Deduplicate the description inputs when joining them by creating a
variant of gnc_g_list_stringjoin named gnc_g_list_stringjoin_nodups
that tests each string against the agregate string and adds it only if
it's not already included. Note that while it uses g_utf8_normalize to
ensure that non-ascii strings are consistently composed it has to do a
bytewise comparison with strstr as glib doesn't provide a UTF-8
equivalent. strnocasestr would work only with ASCII strings so it's
not suitable.
If a user has set environment variable GNC_DATA_HOME
to a valid directory (containing real gnucash metadata)
the test would fail. It expects to follow the code path
to set up a gnucash data home directory in the temporary
directory, but the directory pointed to in GNC_DATA_HOME
is used instead.
Fix this by also setting environment variable GNC_DATA_HOME
to something invalid during the test.