gnucash maint: Multiple changes pushed

Christopher Lam clam at code.gnucash.org
Mon Jul 27 11:31:06 EDT 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/ef67de44 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/150bfc8d (commit)
	from  https://github.com/Gnucash/gnucash/commit/d0d7fc8b (commit)



commit ef67de44db05768b511c48f5fc439c7b8e99b504
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Mon Jul 27 23:00:15 2020 +0800

    [job-report] deprecate old report.

diff --git a/gnucash/report/reports/standard/job-report.scm b/gnucash/report/reports/standard/job-report.scm
index f78710e09..50c988991 100644
--- a/gnucash/report/reports/standard/job-report.scm
+++ b/gnucash/report/reports/standard/job-report.scm
@@ -478,6 +478,9 @@
     (gnc:option-value
      (gnc:lookup-option (gnc:report-options report-obj) section name)))
 
+  (issue-deprecation-warning
+   "old job report is deprecated and will be removed in 5.x")
+
   (let* ((document (gnc:make-html-document))
 	 (table '())
 	 (orders '())

commit 150bfc8d1b0f55c62f19fc3ed30c0da69a076a65
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Mon Jul 27 22:39:19 2020 +0800

    [advanced-portfolio] bugfix. move functions top-level
    
    skipped during 8d47622ab. parent-or-sibling? was inaccessible to
    table-add-stock-rows, causing errors that were not during internal
    testing.

diff --git a/gnucash/report/reports/standard/advanced-portfolio.scm b/gnucash/report/reports/standard/advanced-portfolio.scm
index ef0be616c..92587aa91 100644
--- a/gnucash/report/reports/standard/advanced-portfolio.scm
+++ b/gnucash/report/reports/standard/advanced-portfolio.scm
@@ -182,6 +182,17 @@ by preventing negative stock balances.<br/>")
 
 ;; helper functions for renderer
 
+(define (same-account? a1 a2)
+  (equal? (gncAccountGetGUID a1) (gncAccountGetGUID a2)))
+
+;; Return true if either account is the parent of the other or they are siblings
+(define (parent-or-sibling? a1 a2)
+  (let ((a2parent (gnc-account-get-parent a2))
+        (a1parent (gnc-account-get-parent a1)))
+    (or (same-account? a2parent a1)
+        (same-account? a1parent a2)
+        (same-account? a1parent a2parent))))
+
 ;; sum up the contents of the b-list built by basis-builder below
 (define (sum-basis b-list currency-frac)
   (fold (lambda (a b) (+ (* (car a) (cdr a)) b)) 0 b-list))
@@ -897,9 +908,6 @@ by preventing negative stock balances.<br/>")
   (define (same-split? s1 s2)
     (equal? (gncSplitGetGUID s1) (gncSplitGetGUID s2)))
 
-  (define (same-account? a1 a2)
-    (equal? (gncAccountGetGUID a1) (gncAccountGetGUID a2)))
-
   ;; Given a price list and a currency find the price for that currency on the list.
   ;; If there is none for the requested currency, return the first one.
   ;; The price list is released but the price returned is ref counted.
@@ -917,14 +925,6 @@ by preventing negative stock balances.<br/>")
         (gnc-price-list-destroy price-list)
         price)))
 
-  ;; Return true if either account is the parent of the other or they are siblings
-  (define (parent-or-sibling? a1 a2)
-    (let ((a2parent (gnc-account-get-parent a2))
-          (a1parent (gnc-account-get-parent a1)))
-          (or (same-account? a2parent a1)
-              (same-account? a1parent a2)
-              (same-account? a1parent a2parent))))
-
   ;; Test whether the given split is the source of a spin off transaction
   ;; This will be a no-units split with only one other split.
   ;; xaccSplitGetOtherSplit only returns on a two-split txn.  It's not a spinoff



Summary of changes:
 .../report/reports/standard/advanced-portfolio.scm | 22 +++++++++++-----------
 gnucash/report/reports/standard/job-report.scm     |  3 +++
 2 files changed, 14 insertions(+), 11 deletions(-)



More information about the gnucash-changes mailing list