Commit Graph

1710 Commits

Author SHA1 Message Date
Christopher Lam
161b07b241 Merge branch 'maint' 2022-09-09 21:23:40 +08: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
John Ralls
95361ad060 [options] Move gnc-options test to engine/test/CMakeLists.txt. 2022-08-29 17:05:33 -07:00
John Ralls
4ae17d12c7 [options] Move options from app-utils to engine.
Options is required for book options that are stored as part of the data
 file and so belongs in engine.
2022-08-25 22:09:56 -07:00
John Ralls
f24f29830b [options] Change std::cerr stream output to PWARN.
Remove temporary diagnostic.
2022-08-25 22:09:56 -07:00
Christopher Lam
3e02859277 Merge branch 'maint' 2022-08-25 23:47:18 +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
6ba912ee0d Merge branch 'maint' 2022-08-09 18:15:23 +08: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
John Ralls
8b07ac88cd [options] Add "key" to the register-option documentation blocks. 2022-08-06 17:17:32 -07:00
John Ralls
e29ab5336f [options] Remove key and doc_string from gnc_register_query_option.
It's always used as an internal option with no UI component so it doesn't
use them.
2022-08-06 17:17:32 -07:00
John Ralls
6faaf3b427 [options] Provide a const char* value flavor for register_commodity
And register_currency_option
2022-08-06 17:17:32 -07:00
John Ralls
1ff844c195 [options] Fix implementation of gnc_register_owner_option
To take an owner-type parameter and to set the UIType accordingly.
2022-08-06 17:17:32 -07:00
John Ralls
aa0b0921f4 [options] Add a function to check if an option is internal.
Instead of relying on the legacy underscore-section-name hack.
2022-08-06 17:17:32 -07:00
John Ralls
da0eff2cac [options] Implement widget-changed callbacks.
Enables full functionality for complex-boolean and multichoice-callback
options.

Note that setter-function callback isn't used in any GnuCash code so it
is not implemented and is not present in the register-callback functions.
2022-08-06 17:17:26 -07:00
John Ralls
552aa438ff [options] Implement gnc_register_internal_option. 2022-08-06 17:13:28 -07:00
John Ralls
0e9ed8cf0a [options] Provide float variants to gnc_register_plot_size_option. 2022-08-06 17:13:28 -07:00
John Ralls
0213787a2f [options] Enable registering an absolute date option. 2022-08-06 16:25:42 -07:00
John Ralls
cf2870b71a [options] Change RelativeDate and Multichoice index type to uint16_t.
From size_t because clang thinks that std::is_same_v<size_t, time64> is
true and we need to differentiate the handling of the two.
2022-08-06 16:25:42 -07:00
John Ralls
0b2d14ee72 Fix distribution for expressions target. 2022-08-06 16:25:42 -07:00
Christopher Lam
b94440b16a Bug 798588 - sx scrubbing was using incorrect free function
the GHashTable values are gnc_numeric*.
2022-08-06 16:25:42 -07:00
Christopher Lam
ea56d67797 [gnc-sx-instance-model.c] indent attributes properly 2022-08-06 16:25:42 -07: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
0b5a4cd298 Merge branch 'maint' 2022-08-03 20:38:08 +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
Christopher Lam
fd12d3900c [Transaction.c] use heuristics to determine txn->txn_type 2022-07-18 09:24:05 +08:00
John Ralls
f4c27d4494 Move gnc_ui_account_get_tax_info_string to gnc-locale-tax.c
To prevent a circular dependency between libgnc-app-utils and
libgnucash-guile.
2022-07-17 10:00:23 -07:00
Robert Fewell
ce4768c357 Bug 798565 - Import map editor entry deletion
When a top level bayesian entry is deleted, the book is not marked
dirty and so the save button is not highlighted. Deleting individual
entries did mark book dirty.

Fixed in gnc_account_delete_all_bayes_maps by wrapping the deletion
with xaccAccountBeginEdit/CommitEdit block.
2022-07-17 12:51:38 +01:00
Robert Fewell
d688a17ef6 Merge 'luzpaz' branch 'source-typos' into maint PR #1364 2022-07-17 11:31:54 +01:00
John Ralls
3e2f7bc66a Create separate shared library for expression parser and SX instance model.
These functions depend on both libgnc-app-utils and libgnucash-guile,
creating a circular dependency when the app-utils bindings are added to
libgnucash-guile.
2022-07-16 18:20:17 -07:00
John Ralls
47904a858e Fix distcheck in master.
Several gnc-optiondb dependencies left out of tarball.
2022-07-16 18:15:57 -07:00
John Ralls
3fd8bd9ddf Merge branch 'maint' 2022-07-16 17:15:20 -07:00
Christopher Lam
263f007d5c [gnc-filepath-utils] new: gnc_list_all_paths 2022-07-10 23:44:13 +08:00