Commit Graph

1435 Commits

Author SHA1 Message Date
John Ralls
091d4aff22 Bug 798657 - Import Summary language is wrong
Root cause is using boost::locale::translate because it ignores
the LANGUAGES environment variable and doesn't support different
values for LC_MESSAGES, LC_DATE, LC_MONETARY, and LC_NUMERIC.
That makes it impossible to configure a user environment that
presents translated strings in a different locale from the one
applied to formatting dates and numbers.

To correct this replace all use of boost::locale::translate
with GNU gettext.
2022-12-16 15:34:10 -08:00
John Ralls
73a134730f Bug 798680 - Not able to match a reverse transaction of a...
previously matched transaction.

Cloned transactions and copied splits shouldn't keep the online-id
slot.
2022-12-13 13:13:13 -08:00
John Ralls
b4bab92da2 Bug 798664 - Result of 'gnucash --nofile' is marked dirty
Don't create a new book in the new-user dialog unless the user says to.
Don't automatically create a new book when retrieving default commodities
because the retrieve might be requested in a context like the Preferences
dialog when there is no book.

Some report tests relied on requesting the default commodity creating
the book, so in those tests ensure that the book is created first.
2022-12-12 11:30:59 -08:00
John Ralls
fae5de80d3 Undo unintended change in Bug 798679 commit. 2022-12-11 19:54:35 -08:00
John Ralls
fd2761bd68 Bug 798679 - Fullwidth characters cannot be pasted as-is in register fields
Control character check doesn't need normalization, the control character
codepoints aren't graphic and so can't be composed nor have compatible
equivalents.
2022-12-11 13:00:40 -08:00
Geert Janssens
98251d59a6 Bug 798672 - Preferences are not saved nor loaded, ERROR <GLib-GIO> g_settings_new_full: assertion 'schema != NULL' failed
Apparently it was a failure on our side to properly look up
requested gsettings schema.
2022-11-29 12:27:21 +01:00
Marco Scardovi
6fe2028bca
Fix test
Signed-off-by: Marco Scardovi <mscardovi@icloud.com>
2022-11-24 23:20:07 +01:00
Robert Fewell
59d95a4ce6 Bug 798545 - Crash when updating document link on vendor bill
There were two issues here, the first one was that the copied doclink
was pointing to the original doclink which lead to a double-free. The
second is the setting of the doclink on the copied invoice needs to be
done with gncInvoiceSetDocLink otherwise on closure the doclink value
will disappear.
2022-11-24 11:16:01 +00:00
Christopher Lam
3d8a28898d [gnc-budget] gnc_budget_get_account_period_note returns a const
to harmonize with all other char getters
2022-11-19 10:35:49 +08:00
Christopher Lam
2ee0c98200 [gnc-budget] use operator[] instead of find() and insert()
- avoid hashing Account* twice. one call to operator[] is sufficient.
- don't need use std::move with better constructors
- sanity check - can't have a budget with num_periods = 0
- remove unused headers
2022-11-19 10:35:43 +08:00
Christopher Lam
6f80c548e6 [gtest-qofevent.cpp] comprehensive tests for qofevent 2022-11-05 09:25:24 +08:00
Christopher Lam
b87aa004f9 [test-qofbook] add tests for unknown features
tests that gnc_features_test_unknown returns a suitable error message
2022-10-31 10:40:12 +08:00
John Ralls
b9077bccd3 Bug 798640 - Segfault when running saved report 2022-10-29 17:45:35 -07:00
Christopher Lam
f2354d6b2a [test-qofbook.c] add test for gnc_features_set_unused 2022-10-29 21:01:08 +08:00
Christopher Lam
1516bb18b0 [gnc-features.cpp] backport gnc_features_set_unused from master 2022-10-29 21:01:01 +08:00
Christopher Lam
a078921a33 [qofbook.cpp] backport qof_book_unset_feature from master 2022-10-29 21:00:54 +08:00
John Ralls
cf088f2a70 Merge John Ralls's 'Bug798614' into maint. 2022-10-28 15:27:28 -07:00
Christopher Lam
093aa81ed1 [qofbook.cpp] deprecate qof_book_get_features 2022-10-28 21:57:15 +08:00
Christopher Lam
8192deff37 [gnc-features.cpp] convert to cpp
- don't need to create/destroy GHashTable for each feature query
- plugs leak: g_hash_table_unref (features_used) not always called properly
- to check 1 feature, don't need to traverse whole GHashTable
2022-10-28 20:50:35 +08:00
Christopher Lam
6f6d2fef48 [test-qofbook] basic features test
sets a feature and tests it's set. it's impossible to design a book
with unknown features using the API.
2022-10-27 20:10:49 +08:00
John Ralls
f24c2c8bdd Instrument failure to set the account when creating a split. 2022-10-11 14:05:45 -07:00
Mike Alexander
2d3e80ea08 Compatibility with XCode's "new build system"
With XCode 14 or newer CMake tries to use the "new build system" which has a
requirement that if two targets depend on the same generated file one of them
must depend on the other.  This commit adds reduntant dependencies to satisfy
this requirement.
2022-10-09 01:10:06 -04:00
John Ralls
c7d1b6ab26 Bug 798633 - 4.12 build failure on 32-bit Linux: "No code for module" 2022-10-04 09:12:10 -04:00
John Ralls
8cb8f5067d Remove non-ISO4217 currency codes from gnc-euro table.
They're not reachable because they don't have commodities associated with them.
2022-09-30 15:12:19 -07:00
John Ralls
d8417c3cfa Move gnc-euro.[ch] to engine and unit test it. 2022-09-30 15:12:12 -07:00
John Ralls
2774f8f88c Bug 798614 - Croatia to join the Euro
Add HRK to the conversion array.
2022-09-30 13:51:28 -07:00
John Ralls
2505955ab9 Fix test failure from Bug 798616 fix. 2022-09-20 09:09:34 -07:00
John Ralls
7c350c3ae5 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.
2022-09-19 18:17:58 -07:00
Frank H. Ellenberger
47fa8b281e Merge PR #1425 into maint 2022-09-07 03:16:05 +02:00
John Ralls
a807d3e6b7 Create function gnc_tm_get_today_neutral.
To complement gnc_tm_get_today_begin and gnc_tm_get_today_end.
2022-09-06 14:35:11 -07:00
luz paz
ba94730a23 Fix various typos
Found via `codespell`
2022-09-06 10:44:29 -04:00
Christopher Lam
ecd2cdf425 [gnc-glib-utils] gnc_g_list_stringjoin skips NULL data 2022-09-06 18:14:15 +08:00
Christopher Lam
b7a3652de7 [date-utilities] avoid report crash if start>end date 2022-08-21 17:27:05 +08:00
John Ralls
087501d316 Bug 798262 - Scheduled transactions with blank amounts do not get created.
Handle template transactions that don't have any splits with empty credit
and debit strings and those having no set transaction account.

Set the concrete transaction commodity to the first found of:
The template transaction's commodity
The commodity of the first split with a credit or debit string
The commodity of the first split.
2022-08-14 15:31:46 -07:00
John Ralls
410db42df0 Test case where the template txn doesn't have a set currency. 2022-08-14 15:28:14 -07:00
John Ralls
229f6f5e85 Fix gdate adjustments. 2022-08-12 12:58:58 -07:00
Simon Arlott
4c1fc1d555 Bug 798262 - Add test case for basic scheduled transactions
Test these scheduled transactions:
* 2 splits with fixed amounts "123"
* 2 splits with fixed amounts "0"
* 2 splits with empty amounts ""

Verify that automatically created scheduled transactions exist.
2022-08-11 11:01:03 -07:00
Christopher Lam
de7a63082b [gnc-sx-instance-model] leaks: free temporal_state
it's a simple struct containing GDate and int
2022-08-08 13:58:53 +08:00
Christopher Lam
ad27be333e [gnc-sx-instance-model] prepend GList loops instead of append 2022-08-08 13:58:53 +08:00
Christopher Lam
bfa0fd1819 Bug 798588 - sx scrubbing was using incorrect free function
the GHashTable values are gnc_numeric*.
2022-08-06 14:39:57 +08:00
Christopher Lam
f0ac8d69b2 [gnc-sx-instance-model.c] indent attributes properly 2022-08-06 14:39:55 +08:00
Christopher Lam
d1aefc851d [sx-book] free sx_list before g_object_unreffing sxes 2022-08-01 23:43:08 +08:00
John Ralls
688832b5f8 Bug 798585 - segfault running sample script
The root cause of which is that on recent releases of GLib (recent
meaning 2.66 in the current Debian stable!) g_type_instance_get_private
looks in the wrong place for the private data. When running the script
in question it returned NULL and since the code didn't check for a valid
pointer, it crashed.

So this change replaces all calls to g_type_instance_get_private with
the function [type_prefix]_get_instance_private() added in glib-2.36
except for two register2 files that have been removed from master; those
are ignored to avoid unnecessary merge conflicts.
2022-07-30 16:50:51 -07:00
Christopher Lam
67a1b7a873 [gnc-sx-instance-model] free GHashTable keys when destroying 2022-07-30 13:43:06 +08:00
Christopher Lam
ebf3439558 [gnc-sx-instance-model] free some GHashTable keys & Values 2022-07-29 12:56:02 +08:00
Christopher Lam
7c2a249511 [gnc-sx-instance-model.c] refactor Scrub function
This scrubbing function calls xaccTransRollbackEdit which is
leaky. Instead of trying to fix xaccTransRollbackEdit which requires
superhuman skills, it's easiest to track the changes separately in a
GList, and use xaccTransBeginEdit/xaccTransCommitEdit only if
necessary.
2022-07-29 12:47:10 +08:00
Christopher Lam
7880f9b16f [SchedXaction.c] free list of recurrences 2022-07-29 12:23:09 +08:00
Christopher Lam
c16840b840 more leaks because qof_instance_get returns a new char* 2022-07-21 07:46:40 +08:00
Christopher Lam
f1adb5da34 Merge branch 'TXN_TYPE-is-dynamic' xaccTransGetTxnType into maint #1201 2022-07-18 09:24:32 +08:00
Christopher Lam
ec3e996f92 tests xaccTransGetTxnType heuristics
tests TXN_TYPE_NONE in utest-Transaction.c

testing TXN_TYPE_INVOICE, TXN_TYPE_PAYMENT, and TXN_TYPE_LINK will
require valid posted invoices, so, are best tested in utest-Invoice.c
2022-07-18 09:24:05 +08:00