gnucash maint: [budget-flow] delay creating exchange-fn until a valid budget exists

Christopher Lam clam at code.gnucash.org
Fri Dec 3 23:03:40 EST 2021


Updated	 via  https://github.com/Gnucash/gnucash/commit/f771513f (commit)
	from  https://github.com/Gnucash/gnucash/commit/ca6604c9 (commit)



commit f771513f4ff9c77705a1d9217893963342082950
Author: Christopher Lam <christopher.lck at gmail.com>
Date:   Sat Dec 4 11:43:19 2021 +0800

    [budget-flow] delay creating exchange-fn until a valid budget exists
    
    because it needs budget period end-date.

diff --git a/gnucash/report/reports/standard/budget-flow.scm b/gnucash/report/reports/standard/budget-flow.scm
index c8a9961c1..6928733e2 100644
--- a/gnucash/report/reports/standard/budget-flow.scm
+++ b/gnucash/report/reports/standard/budget-flow.scm
@@ -272,12 +272,6 @@
                                       optname-report-currency))
          (price-source (get-option gnc:pagename-general
                                    optname-price-source))
-
-         ;; calculate the exchange rates
-         (exchange-fn (gnc:case-exchange-fn
-                       price-source report-currency
-                       (gnc-budget-get-period-end-date budget period)))
-
          ;; The HTML document
          (doc (gnc:make-html-document)))
 
@@ -296,6 +290,10 @@
 
      (else
       (let* ((html-table (gnc:make-html-table))
+             ;; calculate the exchange rates
+             (exchange-fn (gnc:case-exchange-fn
+                           price-source report-currency
+                           (gnc-budget-get-period-end-date budget period)))
              (report-name (get-option gnc:pagename-general gnc:optname-reportname))
              ;; decompose the account list
              (split-up-accounts (gnc:decompose-accountlist accounts))



Summary of changes:
 gnucash/report/reports/standard/budget-flow.scm | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)



More information about the gnucash-changes mailing list