Commit Graph
257 Commits
Author SHA1 Message Date
John Ralls 824b515430 Fix qoflog's comments to reflect a preference for the macros over GLib functions. 2021-09-14 15:59:01 -07:00
John Ralls 74d0630867 Bug 798237 - Logging during XML file loading degrades performance...
significantly

Modify the DEBUG and PINFO macros to return unless qof_log_check is
true. Replace almost all direct calls to g_debug and g_message with
DEBUG and PINFO respectively.

Track the highest logging level sent to qof_log_set_level to provide a
short-circuit return in qof_log_check. Remove setting GNC_MOD_TESTS to
QOF_LOG_DEBUG so that the short-circuit threshold isn't defeated by
always being DEBUG.

Net result: 33% improvement in xml load times.
2021-09-14 15:15:11 -07:00
Christopher Lam d0f7daf4cf Revert "[engine.i] QofQueryParamList * args must be freed"
This reverts commit 72a3ebbba3. Freeing
does not apply to all qof_query_* calls.
2021-09-11 15:45:32 +08:00
Christopher Lam 72a3ebbba3 [engine.i] QofQueryParamList * args must be freed 2021-09-11 14:59:18 +08:00
John Ralls b8552a8070 Fix python transaction test_date on Ubuntu-81.04.
Python3 there is too old for fromisoformat, use direct construction
instead.
2021-09-10 17:01:38 -07:00
John Ralls fcab298245 Add test for Transaction GetDate() in python bindings.
Pursuant to Bug 798284.
2021-09-10 13:26:59 -07:00
Christopher Lam 140922a37e QofQuery args must be destroyed after qof_query_merge
qof_query_merge returns a new QofQuery; the two merged QofQueries are
not explicitly destroyed.
2021-09-09 19:19:44 +08:00
Christopher Lam 37cb886de5 [engine.i] gnc_budget_get_account_period_note to be freed by the caller
amendment to last commit.

this pair of changes was necessary to allow the GValue to be unset.
2021-08-25 09:17:25 +08:00
Christopher Lam 929cb3d0c1 [engine.i] free swigged GList* arg 2021-08-24 00:13:45 +08:00
Christopher Lam 9fc1ac6be1 Merge branch 'maint-guile-changes' into maint #1111 2021-08-20 17:02:19 +08:00
Christopher Lam 9bc44c62e6 [engine.i] free GSList* key_path arg to qof_book_get_option
Addendum to 6c8af6aab need to specify exact typemap target.
2021-08-20 17:01:42 +08:00
Christopher Lam 6c8af6aab1 [engine.i] free GSList* arg to qof_book_get_option 2021-08-20 09:03:37 +08:00
Christopher Lam c4a0fb468b [srfi64-extras.scm] exit instead of return #t if no failures
due to change in guile-3.0.7 to fix srfi64 bug
2021-08-19 20:56:13 +08:00
Christopher Lam de1ad9367a g_free gnc_ctime which returns a new gchar* 2021-08-05 21:42:31 +08:00
Frank H. Ellenberger b31b8dbd1e Merge PR #1103 into maint 2021-08-04 20:16:14 +02:00
Steven Walter 5f721614ad Remove unneeded .decode() from Invoice*.tex.templ
These values are already str's, don't decode them
2021-08-03 15:59:54 -04:00
Christopher Lam a3177e8b6b [swig] %newobject to g_free AccountList* functions 2021-08-03 12:14:12 +08:00
Christopher Lam e0d953bfc8 [swig] %newobject to g_free gchar* functions 2021-08-03 12:14:12 +08:00
Steven Walter 3ed6b4dab9 latex_invoices.py: write takes string not bytes
write() fails if you give it bytes, so don't encode
2021-08-01 22:17:41 -04:00
Steven Walter ba4852a9da latex_invoices.py: use default locale
Don't hardcode a locale.  Empty string means to use the user's locale
(e.g. $LANG)
2021-08-01 22:17:11 -04:00
Steven Walter ad3895fa07 latex_invoices.py: don't decode() a str
These functions all return str's not bytes.  Therefore there is no need
to decode them.
2021-08-01 22:16:33 -04:00
Christopher Lam 9767c86337 [engine.i] some GLists must be freed 2021-07-29 23:56:10 +08:00
luz paz 95f8884892 Fix misc. typos in comments 2021-06-29 08:46:34 +02:00
John Ralls da3bd8ec0e [bindings/guile/test] add SRFI64 test sources to the dist. 2021-06-13 15:25:23 -07:00
Hong Xu 79d5270c9d Fix a variable name typo in Python binding gnc_pricedb_lookup_latest_before_t64
commodit -> commodity
2021-06-13 01:12:59 -07:00
Christopher Lam 14c523e4f1 [test-engine-extras] augment book data generators
* txn-currency can be specified explicitly instead of currency of
first split
* split memos can be specified

Note test-register.scm gets some changes because the Trans Num field
was erroneously saved into Split Action fields. Now the num field is
only copied into the TransNum field.
2021-04-30 08:55:26 +08:00
Christopher Lam 5957b3c256 Add scheme backward compatibility functions renamed in #979 2021-04-23 21:20:42 +08:00
John Ralls 49102c7ac2 Python Bindings: Provide a deprecated GncPriceDB.lookup_latest_before_t64.
To avoid breaking user scripts.
2021-04-23 11:56:15 +01:00
Robert Fewell 87285f945e Update gnucash_core.py with gnc-pricedb function name change 2021-04-23 11:56:15 +01:00
John Ralls 490f9a8035 Change the g_log macro calls to QofLog ones so that they don't go to /dev/null. 2021-04-13 16:58:11 -07:00
koldavi 506fd57989 Fix to_string_with_decimal_point_placed
>>> nominator='123456'
A digit is missing in the string returned from to_string_with_decimal_point_placed. The -1 error.
>>> point_place=2
>>> nominator[:-point_place - 1], nominator[-point_place:]
('123', '56')
2021-04-01 13:26:15 +02:00
Christopher Lam df457622b5 Merge branch 'python-silent-conversion' of git://github.com/c-holtermann/gnucash into maint 2021-03-27 21:20:37 +08:00
c-holtermann d3b8a59d7e remove debug information for time conversion 2021-03-27 14:05:21 +01:00
Geert Janssens 1dd426e314 Potentially fix CI test on Arch related to glib and c++ 2021-03-22 12:37:24 +01:00
John Ralls a11065b823 Fix fencepost error in calculating the week_num for POSIX timezone rules.
Fixes CI failure caused by US starting DST in 2021, a year in which
March began on a Monday.
2021-03-15 17:07:16 -07:00
John Ralls 66eca8aab7 Update python/gnucash_business.py to reflect rename of gncOwnerApplyPayment.
Made 3 years ago.
2021-03-14 10:48:30 -07:00
Dong Lin 75209c024f Update price database for imported transactions
When a transaction is added from the ledger, price database is updated properly.
But if the transaction is imported, there is no price db update.

This change adds the proper pricedb update in the import path (qfx/ofx/qif).
Tested with make check
2021-03-09 10:39:56 -08:00
Christopher Lam a754289daa [test-scm-utilities] test-end properly
otherwise test failures do not set exit code correctly
2021-01-25 22:24:51 +08:00
Christopher Lam df30b6da37 [utilities.scm] deprecate unused functions
these functions were never used.
2021-01-24 21:56:34 +08:00
Christopher Lam 6df74eb94f [core-utils.scm] typo in guile: use-modules 2021-01-03 16:03:14 +08:00
Christopher Lam 6f9517845a [core-utils] use custom unbound-variable exception printer
When a guile coder uses a variable but omits use-modules, this code
will scan *all* available modules and offer the appropriate module
name.

Before:
Unbound variable: gnc-build-url

After:
Unbound variable: gnc-build-url. Did you forget (use-module (sw_gnc_html))?
2020-12-14 21:54:52 +08:00
Christopher Lam 6927c12292 Bug 798039 - Using 'Consolidate Transactions' option on Consolidate Transaction Report returns Error
because (gnc:module-load "gnucash/html" 0) was meant to load the html
module and was incorrectly assumed to be present in (gnucash report)
module.
2020-12-12 07:44:14 +08:00
Christopher Lam 4910b532e0 [modularise] (gnucash engine) 2020-12-09 06:39:51 +08:00
Christopher Lam c17ce5251c [modularise] (gnucash core-utils) 2020-12-09 06:39:51 +08:00
Christopher Lam 096be60860 [modularise] (gnucash utilities) 2020-12-09 06:39:51 +08:00
Christopher Lam da32fb0dae [utilities] simplify addto! 2020-12-04 21:33:31 +08:00
Christopher Lam 82d3bcd394 [core-utils] N_ is identity function
N_ is mapped to the identity function. Previously N_ was defined as a
macro, which is more tricky to export.
2020-12-04 21:33:01 +08:00
Christopher Lam a1c517b4ba [gnc_scm_to_numeric] create NaN gnc_numeric instead of runtime error
If guile calls a C function which expects gnc_numeric but sends a
non-number, it will create a gnc_numeric_error object. This will allow
error gnc_numeric to be handled elsewhere.

Also the overflow gnc_numeric was incorrectly created.
2020-11-23 21:50:05 +08:00
Christopher Lam 8f32992100 [gnc-engine-guile.c] return #f when gnc_numeric has error
otherwise it'd throw guile div/0 exception
2020-11-23 08:08:27 +08:00
Christopher Lam 6d6eff6b70 Expose ngettext as gnc:ngettext 2020-11-02 22:24:05 +08:00