gnucash maint: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Sat Jul 7 16:07:51 EDT 2018


Updated	 via  https://github.com/Gnucash/gnucash/commit/ad7c14a5 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/582265d0 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/0594beb0 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/5c8af379 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/d12ee9a4 (commit)
	from  https://github.com/Gnucash/gnucash/commit/eb0256e3 (commit)



commit ad7c14a5df22470e8254c00d3851ee0840ac2022
Merge: eb0256e 582265d
Author: John Ralls <jralls at ceridwen.us>
Date:   Sat Jul 7 13:05:35 2018 -0700

    Partial merge of Chris Lam's maint-stress-tests into maint.
    
    Merges he commits that aren't the stress-test.


commit 582265d0c6b3a499ca50a761633be02ad742c5cd
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Thu Jul 5 19:37:41 2018 +0800

    [job-report] Prevent Crash if there is no AR account
    
    I think this crash is triggered because the 'account' variable
    defaults to the first available AR account. If there's no AR account
    it becomes null, and querying null's default book leads to segfault.
    
    I guess I can fix segfault too by fixing gnc_account_get_book.

diff --git a/gnucash/report/business-reports/job-report.scm b/gnucash/report/business-reports/job-report.scm
index 40b2bbf..e58f5a3 100644
--- a/gnucash/report/business-reports/job-report.scm
+++ b/gnucash/report/business-reports/job-report.scm
@@ -541,7 +541,7 @@
 	 (end-date (gnc:time64-end-day-time 
 		       (gnc:date-option-absolute-time
 			(opt-val gnc:pagename-general (N_ "To")))))
-	 (book (gnc-account-get-book account))
+	 (book (gnc-get-current-book))
          (date-format (gnc:options-fancy-date book))
 	 (type (opt-val "__reg" "owner-type"))
 	 (type-str "")
diff --git a/libgnucash/engine/Account.cpp b/libgnucash/engine/Account.cpp
index a114456..7920660 100644
--- a/libgnucash/engine/Account.cpp
+++ b/libgnucash/engine/Account.cpp
@@ -1015,6 +1015,7 @@ xaccInitAccount (Account * acc, QofBook *book)
 QofBook *
 gnc_account_get_book(const Account *account)
 {
+    if (!account) return NULL;
     return qof_instance_get_book(QOF_INSTANCE(account));
 }
 

commit 0594beb08112c8fff19d198b505e85ed64bea8e5
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Thu Jul 5 15:43:08 2018 +0800

    Bug 779888 - Find Transaction by Value will not always find a split when commodities change
    
    This commit changes the "Shares" find-text to "Amount". Thus, a
    transfer from USD for 100USD -> 80GBP will be found if "Amount=80" or
    "Amount=100" are chosen. A search for "Value=80" will not find
    it. Perhaps the "Value" search option should be removed?

diff --git a/gnucash/gnome/dialog-find-transactions2.c b/gnucash/gnome/dialog-find-transactions2.c
index 93514bd..15b02da 100644
--- a/gnucash/gnome/dialog-find-transactions2.c
+++ b/gnucash/gnome/dialog-find-transactions2.c
@@ -121,7 +121,7 @@ gnc_ui_find_transactions_dialog_create2 (GNCLedgerDisplay2 * orig_ledg)
                                            type, SPLIT_RECONCILE, NULL);
         params = gnc_search_param_prepend (params, N_("Share Price"), NULL,
                                            type, SPLIT_SHARE_PRICE, NULL);
-        params = gnc_search_param_prepend (params, N_("Shares"), NULL,
+        params = gnc_search_param_prepend (params, N_("Amount"), NULL,
                                            type, SPLIT_AMOUNT, NULL);
         params = gnc_search_param_prepend (params, N_("Value"), NULL,
                                            type, SPLIT_VALUE, NULL);

commit 5c8af37901bba6e8c8d7a0f0c97f840a25edba75
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Mon Jul 2 08:58:05 2018 +0800

    [tests] modify load-path to find the parent directory
    
    Find the parent directory programmatically.

diff --git a/gnucash/report/business-reports/test/test-invoice.scm b/gnucash/report/business-reports/test/test-invoice.scm
index 3db7c4a..52159d6 100644
--- a/gnucash/report/business-reports/test/test-invoice.scm
+++ b/gnucash/report/business-reports/test/test-invoice.scm
@@ -26,7 +26,9 @@
       (run-test-proper)))
 
 (define (coverage-test tester)
-  (add-to-load-path "/home/chris/sources/gnucash/gnucash/report/business-reports")
+  (let* ((currfile (dirname (current-filename)))
+         (path (string-take currfile (string-rindex currfile #\/))))
+    (add-to-load-path path))
   (call-with-values
       (lambda()
         (with-code-coverage tester))
diff --git a/gnucash/report/standard-reports/test/test-transaction.scm b/gnucash/report/standard-reports/test/test-transaction.scm
index 56f6ffc..08be14d 100644
--- a/gnucash/report/standard-reports/test/test-transaction.scm
+++ b/gnucash/report/standard-reports/test/test-transaction.scm
@@ -50,11 +50,12 @@
       (run-test-proper)))
 
 (define (coverage-test)
-  (define %test-vm (make-vm))
-  (add-to-load-path "/home/chris/sources/gnucash/gnucash/report/standard-reports")
+  (let* ((currfile (dirname (current-filename)))
+         (path (string-take currfile (string-rindex currfile #\/))))
+    (add-to-load-path path))
   (call-with-values
       (lambda()
-        (with-code-coverage %test-vm run-test-proper))
+        (with-code-coverage run-test-proper))
     (lambda (data result)
       (let ((port (open-output-file "/tmp/lcov.info")))
         (coverage-data->lcov data port)

commit d12ee9a4fc50265bfa2aeb6561bff1006f2f134f
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sun Jul 1 15:38:15 2018 +0800

    [commodity-utilities] prevent crash if end-date is #f
    
    crash happens when (I think) no valid splits found.

diff --git a/gnucash/report/report-system/commodity-utilities.scm b/gnucash/report/report-system/commodity-utilities.scm
index 1328f1b..a6b8bbd 100644
--- a/gnucash/report/report-system/commodity-utilities.scm
+++ b/gnucash/report/report-system/commodity-utilities.scm
@@ -48,8 +48,9 @@
     (xaccQueryAddAccountMatch query
                               currency-accounts
                               QOF-GUID-MATCH-ANY QOF-QUERY-AND)
-    (xaccQueryAddDateMatchTT
-     query #f end-date #t end-date QOF-QUERY-AND)
+    (if end-date
+        (xaccQueryAddDateMatchTT
+         query #f end-date #t end-date QOF-QUERY-AND))
 
     ;; Get the query result, i.e. all splits in currency
     ;; accounts.



Summary of changes:
 gnucash/gnome/dialog-find-transactions2.c                 | 2 +-
 gnucash/report/business-reports/job-report.scm            | 2 +-
 gnucash/report/business-reports/test/test-invoice.scm     | 4 +++-
 gnucash/report/report-system/commodity-utilities.scm      | 5 +++--
 gnucash/report/standard-reports/test/test-transaction.scm | 7 ++++---
 libgnucash/engine/Account.cpp                             | 1 +
 6 files changed, 13 insertions(+), 8 deletions(-)



More information about the gnucash-changes mailing list